status-im-auto 872562a7de Updates
2022-05-13 05:11:40 +00:00

3 lines
1.9 MiB

/*! For license information please see main.4b3f1bf8.js.LICENSE.txt */
(()=>{var __webpack_modules__={77788:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DUMP_SESSION_KEYS=e.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=e.NOISE_MSG_MAX_LENGTH_BYTES=void 0,e.NOISE_MSG_MAX_LENGTH_BYTES=65535,e.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=e.NOISE_MSG_MAX_LENGTH_BYTES-16,e.DUMP_SESSION_KEYS={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DUMP_SESSION_KEYS},87477:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decryptStream=e.encryptStream=void 0;const n=r(77788);e.encryptStream=function(t){return async function*(e){for await(const r of e)for(let e=0;e<r.length;e+=n.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG){let i=e+n.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG;i>r.length&&(i=r.length);const o=t.encrypt(r.slice(e,i),t.session);yield o}}},e.decryptStream=function(t){return async function*(e){for await(const r of e)for(let e=0;e<r.length;e+=n.NOISE_MSG_MAX_LENGTH_BYTES){let i=e+n.NOISE_MSG_MAX_LENGTH_BYTES;i>r.length&&(i=r.length);const{plaintext:o,valid:s}=await t.decrypt(r.slice(e,i),t.session);if(!s)throw new Error("Failed to validate decrypted chunk");yield o}}}},75698:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decode2=e.decode1=e.decode0=e.encode2=e.encode1=e.encode0=e.uint16BEDecode=e.uint16BEEncode=void 0;const i=n(r(41976)),o=r(62110);e.uint16BEEncode=(t,e,r)=>{var n;return e=e||(n=2,globalThis.Buffer?globalThis.Buffer.allocUnsafe(n):new Uint8Array(n)),new DataView(e.buffer,e.byteOffset,e.byteLength).setUint16(r,t,!1),e},e.uint16BEEncode.bytes=2;e.uint16BEDecode=t=>{if(t.length<2)throw RangeError("Could not decode int16BE");return t instanceof i.default?t.readUInt16BE(0):new DataView(t.buffer,t.byteOffset,t.byteLength).getUint16(0,!1)},e.uint16BEDecode.bytes=2,e.encode0=function(t){return(0,o.concat)([t.ne,t.ciphertext],t.ne.length+t.ciphertext.length)},e.encode1=function(t){return(0,o.concat)([t.ne,t.ns,t.ciphertext],t.ne.length+t.ns.length+t.ciphertext.length)},e.encode2=function(t){return(0,o.concat)([t.ns,t.ciphertext],t.ns.length+t.ciphertext.length)},e.decode0=function(t){if(t.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:t.slice(0,32),ciphertext:t.slice(32,t.length),ns:new Uint8Array(0)}},e.decode1=function(t){if(t.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:t.slice(0,32),ns:t.slice(32,80),ciphertext:t.slice(80,t.length)}},e.decode2=function(t){if(t.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:new Uint8Array(0),ns:t.slice(0,48),ciphertext:t.slice(48,t.length)}}},88919:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FailedIKError=void 0;class r extends Error{constructor(t,e){super(e),this.initialMsg=t,this.name="FailedIKhandshake"}}e.FailedIKError=r},77827:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IKHandshake=void 0;const n=r(8609),i=r(75698),o=r(83605),s=r(88919),a=r(46400);e.IKHandshake=class{constructor(t,e,r,i,o,s,a,u){this.isInitiator=t,this.payload=e,this.prologue=r,this.staticKeypair=i,this.connection=o,a&&(this.remotePeer=a),this.ik=null!==u&&void 0!==u?u:new n.IK,this.session=this.ik.initSession(this.isInitiator,this.prologue,this.staticKeypair,s),this.remoteEarlyData=new Uint8Array}async stage0(){if((0,a.logLocalStaticKeys)(this.session.hs.s),(0,a.logRemoteStaticKey)(this.session.hs.rs),this.isInitiator){(0,a.logger)("IK Stage 0 - Initiator sending message...");const t=this.ik.sendMessage(this.session,this.payload);this.connection.writeLP((0,i.encode1)(t)),(0,a.logger)("IK Stage 0 - Initiator sent message."),(0,a.logLocalEphemeralKeys)(this.session.hs.e)}else{(0,a.logger)("IK Stage 0 - Responder receiving message...");const e=await this.connection.readLP();try{const t=(0,i.decode1)(e.slice()),{plaintext:r,valid:n}=this.ik.recvMessage(this.session,t);if(!n)throw new Error("ik handshake stage 0 decryption validation fail");(0,a.logger)("IK Stage 0 - Responder got message, going to verify payload.");const s=await(0,o.decodePayload)(r);this.remotePeer=this.remotePeer||await(0,o.getPeerIdFromPayload)(s),await(0,o.verifySignedPayload)(this.session.hs.rs,s,this.remotePeer),this.setRemoteEarlyData(s.data),(0,a.logger)("IK Stage 0 - Responder successfully verified payload!"),(0,a.logRemoteEphemeralKey)(this.session.hs.re)}catch(t){const r=t;throw(0,a.logger)("Responder breaking up with IK handshake in stage 0."),new s.FailedIKError(e,"Error occurred while verifying initiator's signed payload: ".concat(r.message))}}}async stage1(){if(this.isInitiator){(0,a.logger)("IK Stage 1 - Initiator receiving message...");const e=(await this.connection.readLP()).slice(),r=(0,i.decode0)(e),{plaintext:n,valid:u}=this.ik.recvMessage(this.session,r);(0,a.logger)("IK Stage 1 - Initiator got message, going to verify payload.");try{if(!u)throw new Error("ik stage 1 decryption validation fail");const t=await(0,o.decodePayload)(n);this.remotePeer=this.remotePeer||await(0,o.getPeerIdFromPayload)(t),await(0,o.verifySignedPayload)(r.ns.slice(0,32),t,this.remotePeer),this.setRemoteEarlyData(t.data),(0,a.logger)("IK Stage 1 - Initiator successfully verified payload!"),(0,a.logRemoteEphemeralKey)(this.session.hs.re)}catch(t){const r=t;throw(0,a.logger)("Initiator breaking up with IK handshake in stage 1."),new s.FailedIKError(e,"Error occurred while verifying responder's signed payload: ".concat(r.message))}}else{(0,a.logger)("IK Stage 1 - Responder sending message...");const t=this.ik.sendMessage(this.session,this.payload);this.connection.writeLP((0,i.encode0)(t)),(0,a.logger)("IK Stage 1 - Responder sent message..."),(0,a.logLocalEphemeralKeys)(this.session.hs.e)}(0,a.logCipherState)(this.session)}decrypt(t,e){const r=this.getCS(e,!1);return this.ik.decryptWithAd(r,new Uint8Array(0),t)}encrypt(t,e){const r=this.getCS(e);return this.ik.encryptWithAd(r,new Uint8Array(0),t)}getLocalEphemeralKeys(){if(!this.session.hs.e)throw new Error("Ephemeral keys do not exist.");return this.session.hs.e}getCS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t.cs1||!t.cs2)throw new Error("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?e?t.cs1:t.cs2:e?t.cs2:t.cs1}setRemoteEarlyData(t){t&&(this.remoteEarlyData=t)}}},7548:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XXFallbackHandshake=void 0;const n=r(8382),i=r(83605),o=r(46400),s=r(75698);class a extends n.XXHandshake{constructor(t,e,r,n,i,o,s,a,u){super(t,e,r,n,i,s,u),a&&(this.ephemeralKeys=a),this.initialMsg=o}async propose(){if(this.isInitiator)this.xx.sendMessage(this.session,new Uint8Array(0),this.ephemeralKeys),(0,o.logger)("XX Fallback Stage 0 - Initialized state as the first message was sent by initiator."),(0,o.logLocalEphemeralKeys)(this.session.hs.e);else{(0,o.logger)("XX Fallback Stage 0 - Responder decoding initial msg from IK.");const t=(0,s.decode0)(this.initialMsg),{valid:e}=this.xx.recvMessage(this.session,{ne:t.ne,ns:new Uint8Array(0),ciphertext:new Uint8Array(0)});if(!e)throw new Error("xx fallback stage 0 decryption validation fail");(0,o.logger)("XX Fallback Stage 0 - Responder used received message from IK."),(0,o.logRemoteEphemeralKey)(this.session.hs.re)}}async exchange(){if(this.isInitiator){const e=(0,s.decode1)(this.initialMsg),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new Error("xx fallback stage 1 decryption validation fail");(0,o.logger)("XX Fallback Stage 1 - Initiator used received message from IK."),(0,o.logRemoteEphemeralKey)(this.session.hs.re),(0,o.logRemoteStaticKey)(this.session.hs.rs),(0,o.logger)("Initiator going to check remote's signature...");try{const t=await(0,i.decodePayload)(r);this.remotePeer=this.remotePeer||await(0,i.getPeerIdFromPayload)(t),await(0,i.verifySignedPayload)(this.session.hs.rs,t,this.remotePeer),this.setRemoteEarlyData(t.data)}catch(t){throw new Error("Error occurred while verifying signed payload from responder: ".concat(t.message))}(0,o.logger)("All good with the signature!")}else(0,o.logger)("XX Fallback Stage 1 - Responder start"),await super.exchange(),(0,o.logger)("XX Fallback Stage 1 - Responder end")}}e.XXFallbackHandshake=a},8382:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XXHandshake=void 0;const n=r(22757),i=r(83605),o=r(46400),s=r(75698);e.XXHandshake=class{constructor(t,e,r,i,o,s,a){this.isInitiator=t,this.payload=e,this.prologue=r,this.staticKeypair=i,this.connection=o,s&&(this.remotePeer=s),this.xx=null!==a&&void 0!==a?a:new n.XX,this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair),this.remoteEarlyData=new Uint8Array(0)}async propose(){if((0,o.logLocalStaticKeys)(this.session.hs.s),this.isInitiator){(0,o.logger)("Stage 0 - Initiator starting to send first message.");const t=this.xx.sendMessage(this.session,new Uint8Array(0));this.connection.writeLP((0,s.encode0)(t)),(0,o.logger)("Stage 0 - Initiator finished sending first message."),(0,o.logLocalEphemeralKeys)(this.session.hs.e)}else{(0,o.logger)("Stage 0 - Responder waiting to receive first message...");const t=(0,s.decode0)((await this.connection.readLP()).slice()),{valid:e}=this.xx.recvMessage(this.session,t);if(!e)throw new Error("xx handshake stage 0 validation fail");(0,o.logger)("Stage 0 - Responder received first message."),(0,o.logRemoteEphemeralKey)(this.session.hs.re)}}async exchange(){if(this.isInitiator){(0,o.logger)("Stage 1 - Initiator waiting to receive first message from responder...");const e=(0,s.decode1)((await this.connection.readLP()).slice()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new Error("xx handshake stage 1 validation fail");(0,o.logger)("Stage 1 - Initiator received the message."),(0,o.logRemoteEphemeralKey)(this.session.hs.re),(0,o.logRemoteStaticKey)(this.session.hs.rs),(0,o.logger)("Initiator going to check remote's signature...");try{const t=await(0,i.decodePayload)(r);this.remotePeer=this.remotePeer||await(0,i.getPeerIdFromPayload)(t),this.remotePeer=await(0,i.verifySignedPayload)(this.session.hs.rs,t,this.remotePeer),this.setRemoteEarlyData(t.data)}catch(t){throw new Error("Error occurred while verifying signed payload: ".concat(t.message))}(0,o.logger)("All good with the signature!")}else{(0,o.logger)("Stage 1 - Responder sending out first message with signed payload and static key.");const t=this.xx.sendMessage(this.session,this.payload);this.connection.writeLP((0,s.encode1)(t)),(0,o.logger)("Stage 1 - Responder sent the second handshake message with signed payload."),(0,o.logLocalEphemeralKeys)(this.session.hs.e)}}async finish(){if(this.isInitiator){(0,o.logger)("Stage 2 - Initiator sending third handshake message.");const t=this.xx.sendMessage(this.session,this.payload);this.connection.writeLP((0,s.encode2)(t)),(0,o.logger)("Stage 2 - Initiator sent message with signed payload.")}else{(0,o.logger)("Stage 2 - Responder waiting for third handshake message...");const e=(0,s.decode2)((await this.connection.readLP()).slice()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,e);if(!n)throw new Error("xx handshake stage 2 validation fail");(0,o.logger)("Stage 2 - Responder received the message, finished handshake.");try{const t=await(0,i.decodePayload)(r);this.remotePeer=this.remotePeer||await(0,i.getPeerIdFromPayload)(t),await(0,i.verifySignedPayload)(this.session.hs.rs,t,this.remotePeer),this.setRemoteEarlyData(t.data)}catch(t){throw new Error("Error occurred while verifying signed payload: ".concat(t.message))}}(0,o.logCipherState)(this.session)}encrypt(t,e){const r=this.getCS(e);return this.xx.encryptWithAd(r,new Uint8Array(0),t)}decrypt(t,e){const r=this.getCS(e,!1);return this.xx.decryptWithAd(r,new Uint8Array(0),t)}getRemoteStaticKey(){return this.session.hs.rs}getCS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t.cs1||!t.cs2)throw new Error("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?e?t.cs1:t.cs2:e?t.cs2:t.cs1}setRemoteEarlyData(t){t&&(this.remoteEarlyData=t)}}},68006:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractHandshake=e.MAX_NONCE=e.MIN_NONCE=void 0;const s=o(r(52029)),a=o(r(24888)),u=r(53642),c=r(98779),l=r(62110),h=r(79421),f=r(83605),d=r(46400);e.MIN_NONCE=0,e.MAX_NONCE=Number.MAX_SAFE_INTEGER;const p="Cipherstate has reached maximum n, a new handshake must be performed";e.AbstractHandshake=class{encryptWithAd(t,e,r){const n=this.encrypt(t.k,t.n,e,r);return this.setNonce(t,this.incrementNonce(t.n)),n}decryptWithAd(t,e,r){const{plaintext:n,valid:i}=this.decrypt(t.k,t.n,e,r);return this.setNonce(t,this.incrementNonce(t.n)),{plaintext:n,valid:i}}hasKey(t){return!this.isEmptyKey(t.k)}setNonce(t,e){t.n=e}createEmptyKey(){return new Uint8Array(32)}isEmptyKey(t){const e=this.createEmptyKey();return(0,c.equals)(e,t)}incrementNonce(t){return t+1}nonceToBytes(t){const e=new Uint8Array(12);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint32(4,t,!0),e}encrypt(t,r,n,i){if(r>e.MAX_NONCE)throw new Error(p);const o=this.nonceToBytes(r);return new u.ChaCha20Poly1305(t).seal(o,i,n)}encryptAndHash(t,e){let r;return r=this.hasKey(t.cs)?this.encryptWithAd(t.cs,t.h,e):e,this.mixHash(t,r),r}decrypt(t,r,n,i){if(r>e.MAX_NONCE)throw new Error(p);const o=this.nonceToBytes(r),s=new u.ChaCha20Poly1305(t).open(o,i,n);return s?{plaintext:s,valid:!0}:{plaintext:new Uint8Array(0),valid:!1}}decryptAndHash(t,e){let r,n=!0;return this.hasKey(t.cs)?({plaintext:r,valid:n}=this.decryptWithAd(t.cs,t.h,e)):r=e,this.mixHash(t,e),{plaintext:r,valid:n}}dh(t,e){try{const r=s.sharedKey(t,e);return 32===r.length?r:r.slice(0,32)}catch(r){return(0,d.logger)(r.message),new Uint8Array(32)}}mixHash(t,e){t.h=this.getHash(t.h,e)}getHash(t,e){return a.hash((0,l.concat)([t,e],t.length+e.length))}mixKey(t,e){const[r,n]=(0,f.getHkdf)(t.ck,e);t.cs=this.initializeKey(n),t.ck=r}initializeKey(t){return{k:t,n:e.MIN_NONCE}}initializeSymmetric(t){const e=(0,h.fromString)(t,"utf-8"),r=this.hashProtocolName(e),n=r,i=this.createEmptyKey();return{cs:this.initializeKey(i),ck:n,h:r}}hashProtocolName(t){if(t.length<=32){const e=new Uint8Array(32);return e.set(t),e}return this.getHash(t,new Uint8Array(0))}split(t){const[e,r]=(0,f.getHkdf)(t.ck,new Uint8Array(0));return{cs1:this.initializeKey(e),cs2:this.initializeKey(r)}}writeMessageRegular(t,e){const r=this.encryptWithAd(t,new Uint8Array(0),e);return{ne:this.createEmptyKey(),ns:new Uint8Array(0),ciphertext:r}}readMessageRegular(t,e){return this.decryptWithAd(t,new Uint8Array(0),e.ciphertext)}}},8609:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IK=void 0;const n=r(83605),i=r(68006);class o extends i.AbstractHandshake{initSession(t,e,r,n){const i=this.createEmptyKey();let o;return o=t?this.initializeInitiator(e,r,n,i):this.initializeResponder(e,r,n,i),{hs:o,i:t,mc:0}}sendMessage(t,e){let r;if(0===t.mc)r=this.writeMessageA(t.hs,e);else if(1===t.mc){const{messageBuffer:n,h:i,cs1:o,cs2:s}=this.writeMessageB(t.hs,e);r=n,t.h=i,t.cs1=o,t.cs2=s}else{if(!(t.mc>1))throw new Error("Session invalid.");if(t.i){if(!t.cs1)throw new Error("CS1 (cipher state) is not defined");r=this.writeMessageRegular(t.cs1,e)}else{if(!t.cs2)throw new Error("CS2 (cipher state) is not defined");r=this.writeMessageRegular(t.cs2,e)}}return t.mc++,r}recvMessage(t,e){let r=new Uint8Array(0),n=!1;if(0===t.mc&&({plaintext:r,valid:n}=this.readMessageA(t.hs,e)),1===t.mc){const{plaintext:i,valid:o,h:s,cs1:a,cs2:u}=this.readMessageB(t.hs,e);r=i,n=o,t.h=s,t.cs1=a,t.cs2=u}return t.mc++,{plaintext:r,valid:n}}writeMessageA(t,e){t.e=(0,n.generateKeypair)();const r=t.e.publicKey;this.mixHash(t.ss,r),this.mixKey(t.ss,this.dh(t.e.privateKey,t.rs));const i=t.s.publicKey,o=this.encryptAndHash(t.ss,i);this.mixKey(t.ss,this.dh(t.s.privateKey,t.rs));return{ne:r,ns:o,ciphertext:this.encryptAndHash(t.ss,e)}}writeMessageB(t,e){t.e=(0,n.generateKeypair)();const r=t.e.publicKey;this.mixHash(t.ss,r),this.mixKey(t.ss,this.dh(t.e.privateKey,t.re)),this.mixKey(t.ss,this.dh(t.e.privateKey,t.rs));const i=this.encryptAndHash(t.ss,e),o={ne:r,ns:this.createEmptyKey(),ciphertext:i},{cs1:s,cs2:a}=this.split(t.ss);return{messageBuffer:o,cs1:s,cs2:a,h:t.ss.h}}readMessageA(t,e){(0,n.isValidPublicKey)(e.ne)&&(t.re=e.ne),this.mixHash(t.ss,t.re),this.mixKey(t.ss,this.dh(t.s.privateKey,t.re));const{plaintext:r,valid:i}=this.decryptAndHash(t.ss,e.ns);i&&32===r.length&&(0,n.isValidPublicKey)(r)&&(t.rs=r),this.mixKey(t.ss,this.dh(t.s.privateKey,t.rs));const{plaintext:o,valid:s}=this.decryptAndHash(t.ss,e.ciphertext);return{plaintext:o,valid:i&&s}}readMessageB(t,e){if((0,n.isValidPublicKey)(e.ne)&&(t.re=e.ne),this.mixHash(t.ss,t.re),!t.e)throw new Error("Handshake state should contain ephemeral key by now.");this.mixKey(t.ss,this.dh(t.e.privateKey,t.re)),this.mixKey(t.ss,this.dh(t.s.privateKey,t.re));const{plaintext:r,valid:i}=this.decryptAndHash(t.ss,e.ciphertext),{cs1:o,cs2:s}=this.split(t.ss);return{h:t.ss.h,valid:i,plaintext:r,cs1:o,cs2:s}}initializeInitiator(t,e,r,n){const i=this.initializeSymmetric("Noise_IK_25519_ChaChaPoly_SHA256");this.mixHash(i,t),this.mixHash(i,r);return{ss:i,s:e,rs:r,re:new Uint8Array(32),psk:n}}initializeResponder(t,e,r,n){const i=this.initializeSymmetric("Noise_IK_25519_ChaChaPoly_SHA256");this.mixHash(i,t),this.mixHash(i,e.publicKey);return{ss:i,s:e,rs:r,re:new Uint8Array(32),psk:n}}}e.IK=o},22757:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XX=void 0;const n=r(83605),i=r(68006);class o extends i.AbstractHandshake{initializeInitiator(t,e,r,n){const i=this.initializeSymmetric("Noise_XX_25519_ChaChaPoly_SHA256");this.mixHash(i,t);return{ss:i,s:e,rs:r,psk:n,re:new Uint8Array(32)}}initializeResponder(t,e,r,n){const i=this.initializeSymmetric("Noise_XX_25519_ChaChaPoly_SHA256");this.mixHash(i,t);return{ss:i,s:e,rs:r,psk:n,re:new Uint8Array(32)}}writeMessageA(t,e,r){const i=new Uint8Array(0);t.e=void 0!==r?r:(0,n.generateKeypair)();const o=t.e.publicKey;this.mixHash(t.ss,o);return{ne:o,ns:i,ciphertext:this.encryptAndHash(t.ss,e)}}writeMessageB(t,e){t.e=(0,n.generateKeypair)();const r=t.e.publicKey;this.mixHash(t.ss,r),this.mixKey(t.ss,this.dh(t.e.privateKey,t.re));const i=t.s.publicKey,o=this.encryptAndHash(t.ss,i);this.mixKey(t.ss,this.dh(t.s.privateKey,t.re));return{ne:r,ns:o,ciphertext:this.encryptAndHash(t.ss,e)}}writeMessageC(t,e){const r=t.s.publicKey,n=this.encryptAndHash(t.ss,r);this.mixKey(t.ss,this.dh(t.s.privateKey,t.re));const i=this.encryptAndHash(t.ss,e),o={ne:this.createEmptyKey(),ns:n,ciphertext:i},{cs1:s,cs2:a}=this.split(t.ss);return{h:t.ss.h,messageBuffer:o,cs1:s,cs2:a}}readMessageA(t,e){return(0,n.isValidPublicKey)(e.ne)&&(t.re=e.ne),this.mixHash(t.ss,t.re),this.decryptAndHash(t.ss,e.ciphertext)}readMessageB(t,e){if((0,n.isValidPublicKey)(e.ne)&&(t.re=e.ne),this.mixHash(t.ss,t.re),!t.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(t.ss,this.dh(t.e.privateKey,t.re));const{plaintext:r,valid:i}=this.decryptAndHash(t.ss,e.ns);i&&32===r.length&&(0,n.isValidPublicKey)(r)&&(t.rs=r),this.mixKey(t.ss,this.dh(t.e.privateKey,t.rs));const{plaintext:o,valid:s}=this.decryptAndHash(t.ss,e.ciphertext);return{plaintext:o,valid:i&&s}}readMessageC(t,e){const{plaintext:r,valid:i}=this.decryptAndHash(t.ss,e.ns);if(i&&32===r.length&&(0,n.isValidPublicKey)(r)&&(t.rs=r),!t.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(t.ss,this.dh(t.e.privateKey,t.rs));const{plaintext:o,valid:s}=this.decryptAndHash(t.ss,e.ciphertext),{cs1:a,cs2:u}=this.split(t.ss);return{h:t.ss.h,plaintext:o,valid:i&&s,cs1:a,cs2:u}}initSession(t,e,r){const n=this.createEmptyKey(),i=new Uint8Array(32);let o;return o=t?this.initializeInitiator(e,r,i,n):this.initializeResponder(e,r,i,n),{hs:o,i:t,mc:0}}sendMessage(t,e,r){let n;if(0===t.mc)n=this.writeMessageA(t.hs,e,r);else if(1===t.mc)n=this.writeMessageB(t.hs,e);else if(2===t.mc){const{h:r,messageBuffer:i,cs1:o,cs2:s}=this.writeMessageC(t.hs,e);n=i,t.h=r,t.cs1=o,t.cs2=s}else{if(!(t.mc>2))throw new Error("Session invalid.");if(t.i){if(!t.cs1)throw new Error("CS1 (cipher state) is not defined");n=this.writeMessageRegular(t.cs1,e)}else{if(!t.cs2)throw new Error("CS2 (cipher state) is not defined");n=this.writeMessageRegular(t.cs2,e)}}return t.mc++,n}recvMessage(t,e){let r=new Uint8Array(0),n=!1;if(0===t.mc)({plaintext:r,valid:n}=this.readMessageA(t.hs,e));else if(1===t.mc)({plaintext:r,valid:n}=this.readMessageB(t.hs,e));else if(2===t.mc){const{h:i,plaintext:o,valid:s,cs1:a,cs2:u}=this.readMessageC(t.hs,e);r=o,n=s,t.h=i,t.cs1=a,t.cs2=u}return t.mc++,{plaintext:r,valid:n}}}e.XX=o},52109:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCache=void 0;const r=new class{constructor(){this.storage=new Map}store(t,e){this.storage.set(t.id,e)}load(t){var e;return t&&null!==(e=this.storage.get(t.id))&&void 0!==e?e:null}resetStorage(){this.storage.clear()}};e.KeyCache=r},46400:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.logCipherState=e.logRemoteEphemeralKey=e.logRemoteStaticKey=e.logLocalEphemeralKeys=e.logLocalStaticKeys=e.logger=void 0;const i=n(r(18392)),o=r(77788),s=r(82051);let a;e.logger=(0,i.default)("libp2p:noise"),a=o.DUMP_SESSION_KEYS?e.logger:()=>{},e.logLocalStaticKeys=function(t){a("LOCAL_STATIC_PUBLIC_KEY ".concat((0,s.toString)(t.publicKey,"hex"))),a("LOCAL_STATIC_PRIVATE_KEY ".concat((0,s.toString)(t.privateKey,"hex")))},e.logLocalEphemeralKeys=function(t){t?(a("LOCAL_PUBLIC_EPHEMERAL_KEY ".concat((0,s.toString)(t.publicKey,"hex"))),a("LOCAL_PRIVATE_EPHEMERAL_KEY ".concat((0,s.toString)(t.privateKey,"hex")))):a("Missing local ephemeral keys.")},e.logRemoteStaticKey=function(t){a("REMOTE_STATIC_PUBLIC_KEY ".concat((0,s.toString)(t,"hex")))},e.logRemoteEphemeralKey=function(t){a("REMOTE_EPHEMERAL_PUBLIC_KEY ".concat((0,s.toString)(t,"hex")))},e.logCipherState=function(t){t.cs1&&t.cs2?(a("CIPHER_STATE_1 ".concat(t.cs1.n," ").concat((0,s.toString)(t.cs1.k,"hex"))),a("CIPHER_STATE_2 ".concat(t.cs2.n," ").concat((0,s.toString)(t.cs2.k,"hex")))):a("Missing cipher state.")}},97806:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Noise=void 0;const a=o(r(52029)),u=s(r(85551)),c=s(r(85907)),l=s(r(90351)),h=s(r(79023)),f=r(44709),d=r(8382),p=r(77827),y=r(7548),g=r(83605),m=r(75698),b=r(87477),v=r(52109),w=r(46400),_=r(77788);e.Noise=class{constructor(t,e){if(this.protocol="/noise",this.prologue=new Uint8Array(0),this.earlyData=null!==e&&void 0!==e?e:new Uint8Array(0),this.useNoisePipes=!1,t){const e=a.generateKeyPairFromSeed(t);this.staticKeys={privateKey:e.secretKey,publicKey:e.publicKey}}else this.staticKeys=(0,g.generateKeypair)()}async secureOutbound(t,e,r){const n=(0,u.default)(e,{lengthEncoder:m.uint16BEEncode,lengthDecoder:m.uint16BEDecode,maxDataLength:_.NOISE_MSG_MAX_LENGTH_BYTES}),i=await this.performHandshake({connection:n,isInitiator:!0,localPeer:t,remotePeer:r});return{conn:await this.createSecureConnection(n,i),remoteEarlyData:i.remoteEarlyData,remotePeer:i.remotePeer}}async secureInbound(t,e,r){const n=(0,u.default)(e,{lengthEncoder:m.uint16BEEncode,lengthDecoder:m.uint16BEDecode,maxDataLength:_.NOISE_MSG_MAX_LENGTH_BYTES}),i=await this.performHandshake({connection:n,isInitiator:!1,localPeer:t,remotePeer:r});return{conn:await this.createSecureConnection(n,i),remoteEarlyData:i.remoteEarlyData,remotePeer:i.remotePeer}}async performHandshake(t){var e;const r=await(0,g.getPayload)(t.localPeer,this.staticKeys.publicKey,this.earlyData);let n=this.useNoisePipes;if(t.isInitiator&&null===v.KeyCache.load(t.remotePeer)&&(n=!1),!n)return await this.performXXHandshake(t,r);{const{remotePeer:n,connection:o,isInitiator:s}=t,a=new p.IKHandshake(s,r,this.prologue,this.staticKeys,o,null!==(e=v.KeyCache.load(t.remotePeer))&&void 0!==e?e:new Uint8Array(32),n);try{return await this.performIKHandshake(a)}catch(i){let e;return t.isInitiator&&(e=a.getLocalEphemeralKeys()),await this.performXXFallbackHandshake(t,r,i.initialMsg,e)}}}async performXXFallbackHandshake(t,e,r,n){const{isInitiator:i,remotePeer:o,connection:s}=t,a=new y.XXFallbackHandshake(i,e,this.prologue,this.staticKeys,s,r,o,n);try{await a.propose(),await a.exchange(),await a.finish()}catch(u){(0,w.logger)(u);throw new Error("Error occurred during XX Fallback handshake: ".concat(u.message))}return a}async performXXHandshake(t,e){const{isInitiator:r,remotePeer:n,connection:i}=t,o=new d.XXHandshake(r,e,this.prologue,this.staticKeys,i,n);try{await o.propose(),await o.exchange(),await o.finish(),this.useNoisePipes&&o.remotePeer&&v.KeyCache.store(o.remotePeer,o.getRemoteStaticKey())}catch(s){throw new Error("Error occurred during XX handshake: ".concat(s.message))}return o}async performIKHandshake(t){return await t.stage0(),await t.stage1(),t}async createSecureConnection(t,e){const[r,n]=(0,c.default)(),i=t.unwrap();return await(0,h.default)(r,l.default,(0,b.encryptStream)(e),(0,f.encode)({lengthEncoder:m.uint16BEEncode}),i,(0,f.decode)({lengthDecoder:m.uint16BEDecode}),l.default,(0,b.decryptStream)(e),r),n}}},14660:function(t,e,r){"use strict";var n,i,o;i=[r(80886)],void 0===(o="function"===typeof(n=function(t){var e=t.Reader,r=t.Writer,n=t.util,i=t.roots["libp2p-noise"]||(t.roots["libp2p-noise"]={});return i.pb=function(){var o={};return o.NoiseHandshakePayload=function(){function o(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return o.prototype.identityKey=n.newBuffer([]),o.prototype.identitySig=n.newBuffer([]),o.prototype.data=n.newBuffer([]),o.create=function(t){return new o(t)},o.encode=function(t,e){return e||(e=r.create()),null!=t.identityKey&&Object.hasOwnProperty.call(t,"identityKey")&&e.uint32(10).bytes(t.identityKey),null!=t.identitySig&&Object.hasOwnProperty.call(t,"identitySig")&&e.uint32(18).bytes(t.identitySig),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&e.uint32(26).bytes(t.data),e},o.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.pb.NoiseHandshakePayload;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.identityKey=t.bytes();break;case 2:o.identitySig=t.bytes();break;case 3:o.data=t.bytes();break;default:t.skipType(7&s)}}return o},o.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},o.verify=function(t){return"object"!==typeof t||null===t?"object expected":null!=t.identityKey&&t.hasOwnProperty("identityKey")&&!(t.identityKey&&"number"===typeof t.identityKey.length||n.isString(t.identityKey))?"identityKey: buffer expected":null!=t.identitySig&&t.hasOwnProperty("identitySig")&&!(t.identitySig&&"number"===typeof t.identitySig.length||n.isString(t.identitySig))?"identitySig: buffer expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"===typeof t.data.length||n.isString(t.data))?"data: buffer expected":null},o.fromObject=function(t){if(t instanceof i.pb.NoiseHandshakePayload)return t;var e=new i.pb.NoiseHandshakePayload;return null!=t.identityKey&&("string"===typeof t.identityKey?n.base64.decode(t.identityKey,e.identityKey=n.newBuffer(n.base64.length(t.identityKey)),0):t.identityKey.length&&(e.identityKey=t.identityKey)),null!=t.identitySig&&("string"===typeof t.identitySig?n.base64.decode(t.identitySig,e.identitySig=n.newBuffer(n.base64.length(t.identitySig)),0):t.identitySig.length&&(e.identitySig=t.identitySig)),null!=t.data&&("string"===typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length&&(e.data=t.data)),e},o.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.identityKey="":(r.identityKey=[],e.bytes!==Array&&(r.identityKey=n.newBuffer(r.identityKey))),e.bytes===String?r.identitySig="":(r.identitySig=[],e.bytes!==Array&&(r.identitySig=n.newBuffer(r.identitySig))),e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data)))),null!=t.identityKey&&t.hasOwnProperty("identityKey")&&(r.identityKey=e.bytes===String?n.base64.encode(t.identityKey,0,t.identityKey.length):e.bytes===Array?Array.prototype.slice.call(t.identityKey):t.identityKey),null!=t.identitySig&&t.hasOwnProperty("identitySig")&&(r.identitySig=e.bytes===String?n.base64.encode(t.identitySig,0,t.identitySig.length):e.bytes===Array?Array.prototype.slice.call(t.identitySig):t.identitySig),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o}(),i})?n.apply(e,i):n)||(t.exports=o)},83605:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.isValidPublicKey=e.getHkdf=e.verifySignedPayload=e.getHandshakePayload=e.decodePayload=e.getPeerIdFromPayload=e.signPayload=e.createHandshakePayload=e.getPayload=e.generateKeypair=void 0;const a=r(52497),u=r(24888),c=o(r(52029)),l=s(r(90190)),h=r(14660),f=r(98779),d=r(46765),p=r(62110),y=h.pb.NoiseHandshakePayload;function g(t,e,r){const n=y.create({identityKey:t,identitySig:e,data:null!==r&&void 0!==r?r:null});return y.encode(n).finish()}async function m(t,e){return await t.privKey.sign(e)}function b(t){const e=(0,d.fromString)("noise-libp2p-static-key:");return(0,p.concat)([e,t],e.length+t.length)}e.generateKeypair=function(){const t=c.generateKeyPair();return{publicKey:t.publicKey,privateKey:t.secretKey}},e.getPayload=async function(t,e,r){const n=await m(t,b(e)),i=null!==r&&void 0!==r?r:new Uint8Array(0);return g(t.marshalPubKey(),n,i)},e.createHandshakePayload=g,e.signPayload=m,e.getPeerIdFromPayload=async function(t){return await l.default.createFromPubKey(t.identityKey)},e.decodePayload=function(t){return y.toObject(y.decode(t))},e.getHandshakePayload=b,e.verifySignedPayload=async function(t,e,r){const n=e.identityKey;if(!await async function(t,e){const r=await l.default.createFromPubKey(e);return(0,f.equals)(r.id,t)}(r.id,n))throw new Error("Peer ID doesn't match libp2p public key.");const i=b(t),o=await l.default.createFromPubKey(n);if(!e.identitySig||!await o.pubKey.verify(i,e.identitySig))throw new Error("Static key doesn't match to peer that signed payload!");return o},e.getHkdf=function(t,e){const r=new a.HKDF(u.SHA256,e,t).expand(96);return[r.slice(0,32),r.slice(32,64),r.slice(64,96)]},e.isValidPublicKey=function(t){return t instanceof Uint8Array&&32===t.length}},67845:(t,e,r)=>{"use strict";r.r(e),r.d(e,{decode:()=>C,encode:()=>T});let n=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=o.default,a=null;const u=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var c,l;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(c||(c={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(l||(l={}));const h="0123456789abcdef";class f{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==o[r]&&this.throwArgumentError("invalid log level name","logLevel",t),s>o[r]||console.log.apply(console,e)}debug(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this._log(f.levels.DEBUG,e)}info(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this._log(f.levels.INFO,e)}warn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this._log(f.levels.WARNING,e)}makeError(t,e,r){if(i)return this.makeError("censored error",e,{});e||(e=f.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t<e.length;t++)r+=h[e[t]>>4],r+=h[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(a){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push("code=".concat(e)),n.push("version=".concat(this.version));const o=t;let s="";switch(e){case l.NUMERIC_FAULT:{s="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const a=new Error(t);return a.reason=o,a.code=e,Object.keys(r).forEach((function(t){a[t]=r[t]})),a}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,f.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),u&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}checkSafeUint53(t,e){"number"===typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",t<e&&this.throwError("missing argument"+r,f.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+r,f.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",f.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",f.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",f.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return a||(a=new f("logger/5.6.0")),a}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!t)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!t,n=!!e}static setLogLevel(t){const e=o[t.toLowerCase()];null!=e?s=e:f.globalLogger().warn("invalid log level - "+t)}static from(t){return new f(t)}}f.errors=l,f.levels=c;const d=new f("bytes/5.6.0");function p(t){return!!t.toHexString}function y(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return y(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function g(t){return w(t)&&!(t.length%2)||b(t)}function m(t){return"number"===typeof t&&t==t&&t%1===0}function b(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"===typeof t)return!1;if(!m(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!m(r)||r<0||r>=256)return!1}return!0}function v(t,e){if(e||(e={}),"number"===typeof t){d.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),y(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"===typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),p(t)&&(t=t.toHexString()),w(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":d.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let t=0;t<r.length;t+=2)n.push(parseInt(r.substring(t,t+2),16));return y(new Uint8Array(n))}return b(t)?y(new Uint8Array(t)):d.throwArgumentError("invalid arrayify value","value",t)}function w(t,e){return!("string"!==typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}const _="0123456789abcdef";function E(t,e){if(e||(e={}),"number"===typeof t){d.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=_[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"===typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"===typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),p(t))return t.toHexString();if(w(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":d.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(b(t)){let e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=_[(240&n)>>4]+_[15&n]}return e}return d.throwArgumentError("invalid hexlify value","value",t)}const S=new f("rlp/5.6.0");function I(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function A(t,e,r){let n=0;for(let i=0;i<r;i++)n=256*n+t[e+i];return n}function M(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(M(t))})),e.length<=55)return e.unshift(192+e.length),e;const r=I(e.length);return r.unshift(247+r.length),r.concat(e)}g(t)||S.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(v(t));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=I(e.length);return r.unshift(183+r.length),r.concat(e)}function T(t){return E(M(t))}function R(t,e,r,n){const i=[];for(;r<e+1+n;){const o=k(t,r);i.push(o.result),(r+=o.consumed)>e+1+n&&S.throwError("child data too short",f.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function k(t,e){if(0===t.length&&S.throwError("data too short",f.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&S.throwError("data short segment too short",f.errors.BUFFER_OVERRUN,{});const n=A(t,e+1,r);return e+1+r+n>t.length&&S.throwError("data long segment too short",f.errors.BUFFER_OVERRUN,{}),R(t,e,e+1+r,r+n)}if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&S.throwError("data array too short",f.errors.BUFFER_OVERRUN,{}),R(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&S.throwError("data array too short",f.errors.BUFFER_OVERRUN,{});const n=A(t,e+1,r);e+1+r+n>t.length&&S.throwError("data array too short",f.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:E(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&S.throwError("data too short",f.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:E(t.slice(e+1,e+1+r))}}return{consumed:1,result:E(t[e])}}function C(t){const e=v(t),r=k(e,0);return r.consumed!==e.length&&S.throwArgumentError("invalid rlp data","data",t),r.result}},17612:t=>{const e=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n={name:"v4",size:4,isFormat:t=>e.test(t),encode(t,e,r){r=~~r,e=e||new Uint8Array(r+4);const n=t.length;let i=0;for(let o=0;o<n;){const n=t.charCodeAt(o++);46===n?(e[r++]=i,i=0):i=10*i+(n-48)}return e[r]=i,e},decode:(t,e)=>(e=~~e,"".concat(t[e++],".").concat(t[e++],".").concat(t[e++],".").concat(t[e]))},i={name:"v6",size:16,isFormat:t=>t.length>0&&r.test(t),encode(t,e,r){let n=(r=~~r)+16,i=-1,o=0,s=0,a=!0,u=!1;e=e||new Uint8Array(r+16);for(let c=0;c<t.length;c++){let l=t.charCodeAt(c);58===l?(a?-1!==i?(r<n&&(e[r]=0),r<n-1&&(e[r+1]=0),r+=2):r<n&&(i=r):(!0===u?(r<n&&(e[r]=s),r++):(r<n&&(e[r]=o>>8),r<n-1&&(e[r+1]=255&o),r+=2),o=0,s=0),a=!0,u=!1):46===l?(r<n&&(e[r]=s),r++,s=0,o=0,a=!1,u=!0):(a=!1,l>=97?l-=87:l>=65?l-=55:(l-=48,s=10*s+l),o=(o<<4)+l)}if(!1===a)!0===u?(r<n&&(e[r]=s),r++):(r<n&&(e[r]=o>>8),r<n-1&&(e[r+1]=255&o),r+=2);else if(0===i)r<n&&(e[r]=0),r<n-1&&(e[r+1]=0),r+=2;else if(-1!==i){r+=2;for(let t=Math.min(r-1,n-1);t>=i+2;t--)e[t]=e[t-2];e[i]=0,e[i+1]=0,i=r}if(i!==r&&-1!==i)for(r>n-2&&(r=n-2);n>i;)e[--n]=r<n&&r>i?e[--r]:0;else for(;r<n;)e[r++]=0;return e},decode(t,e){e=~~e;let r="";for(let n=0;n<16;n+=2)0!==n&&(r+=":"),r+=(t[e+n]<<8|t[e+n+1]).toString(16);return r.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};function o(t){if(n.isFormat(t))return n.size;if(i.isFormat(t))return i.size;throw Error("Invalid ip address: ".concat(t))}t.exports=Object.freeze({name:"ip",sizeOf:o,familyOf:t=>o(t)===n.size?1:2,v4:n,v6:i,encode(t,e,r){r=~~r;const s=o(t);return"function"===typeof e&&(e=e(r+s)),s===n.size?n.encode(t,e,r):i.encode(t,e,r)},decode(t,e,r){if(e=~~e,(r=r||t.length-e)===n.size)return n.decode(t,e,r);if(r===i.size)return i.decode(t,e,r);throw Error("Invalid buffer size needs to be ".concat(n.size," for v4 or ").concat(i.size," for v6."))}})},19814:t=>{"use strict";t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw new TypeError(i+" is ambiguous");e[o]=n}var s=t.length,a=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function l(t){if("string"!==typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;var r=0;if(" "!==t[r]){for(var n=0,i=0;t[r]===a;)n++,r++;for(var o=(t.length-r)*u+1>>>0,c=new Uint8Array(o);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var h=0,f=o-1;(0!==l||h<i)&&-1!==f;f--,h++)l+=s*c[f]>>>0,c[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,r++}if(" "!==t[r]){for(var d=o-i;d!==o&&0===c[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=c[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var h=e[i],f=0,d=u-1;(0!==h||f<n)&&-1!==d;d--,f++)h+=256*l[d]>>>0,l[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");n=f,i++}for(var p=u-n;p!==u&&0===l[p];)p++;for(var y=a.repeat(r);p<u;++p)y+=t.charAt(l[p]);return y},decodeUnsafe:l,decode:function(t){var e=l(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},47835:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.curve25519=e.getSharedSecret=e.verify=e.sign=e.getPublicKey=e.Signature=e.Point=e.RistrettoPoint=e.ExtendedPoint=e.CURVE=void 0;const i=n(r(43094)),o=BigInt(0),s=BigInt(1),a=BigInt(2),u=BigInt(255),c=a**BigInt(252)+BigInt("27742317777372353535851937790883648493"),l={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:a**u-BigInt(19),l:c,n:c,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")};e.CURVE=l;const h=a**BigInt(256),f=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=(BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),p=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),y=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),g=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class m{constructor(t,e,r,n){this.x=t,this.y=e,this.z=r,this.t=n}static fromAffine(t){if(!(t instanceof S))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(S.ZERO)?m.ZERO:new m(t.x,t.y,s,N(t.x*t.y))}static toAffineBatch(t){const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.P;const r=new Array(t.length),n=D(t.reduce(((t,n,i)=>n===o?t:(r[i]=t,N(t*n,e))),s),e);return t.reduceRight(((t,n,i)=>n===o?t:(r[i]=N(t*r[i],e),N(t*n,e))),n),r}(t.map((t=>t.z)));return t.map(((t,r)=>t.toAffine(e[r])))}static normalizeZ(t){return this.toAffineBatch(t).map(this.fromAffine)}equals(t){b(t);const{x:e,y:r,z:n}=this,{x:i,y:o,z:s}=t,a=N(e*s),u=N(i*n),c=N(r*s),l=N(o*n);return a===u&&c===l}negate(){return new m(N(-this.x),this.y,this.z,N(-this.t))}double(){const{x:t,y:e,z:r}=this,{a:n}=l,i=N(t**a),o=N(e**a),s=N(a*N(r**a)),u=N(n*i),c=N(N((t+e)**a)-i-o),h=u+o,f=h-s,d=u-o,p=N(c*f),y=N(h*d),g=N(c*d),b=N(f*h);return new m(p,y,b,g)}add(t){b(t);const{x:e,y:r,z:n,t:i}=this,{x:s,y:u,z:c,t:l}=t,h=N((r-e)*(u+s)),f=N((r+e)*(u-s)),d=N(f-h);if(d===o)return this.double();const p=N(n*a*l),y=N(i*a*c),g=y+p,v=f+h,w=y-p,_=N(g*d),E=N(v*w),S=N(g*w),I=N(d*v);return new m(_,E,I,S)}subtract(t){return this.add(t.negate())}precomputeWindow(t){const e=1+256/t,r=[];let n=this,i=n;for(let o=0;o<e;o++){i=n,r.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(t,e){!e&&this.equals(m.BASE)&&(e=S.BASE);const r=e&&e._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=e&&E.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=m.normalizeZ(n),E.set(e,n)));let i=m.ZERO,o=m.ZERO;const a=1+256/r,u=2**(r-1),c=BigInt(2**r-1),l=2**r,h=BigInt(r);for(let f=0;f<a;f++){const e=f*u;let r=Number(t&c);if(t>>=h,r>u&&(r-=l,t+=s),0===r){let t=n[e];f%2&&(t=t.negate()),o=o.add(t)}else{let t=n[e+Math.abs(r)-1];r<0&&(t=t.negate()),i=i.add(t)}}return m.normalizeZ([i,o])[0]}multiply(t,e){return this.wNAF(V(t,l.l),e)}multiplyUnsafe(t){let e=V(t,l.l,!1);const r=m.BASE,n=m.ZERO;if(e===o)return n;if(this.equals(n)||e===s)return this;if(this.equals(r))return this.wNAF(e);let i=n,a=this;for(;e>o;)e&s&&(i=i.add(a)),a=a.double(),e>>=s;return i}isSmallOrder(){return this.multiplyUnsafe(l.h).equals(m.ZERO)}isTorsionFree(){return this.multiplyUnsafe(l.l).equals(m.ZERO)}toAffine(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(this.z);const{x:e,y:r,z:n}=this,i=N(e*t),o=N(r*t);if(N(n*t)!==s)throw new Error("invZ was invalid");return new S(i,o)}fromRistrettoBytes(){w()}toRistrettoBytes(){w()}fromRistrettoHash(){w()}}function b(t){if(!(t instanceof m))throw new TypeError("ExtendedPoint expected")}function v(t){if(!(t instanceof _))throw new TypeError("RistrettoPoint expected")}function w(){throw new Error("Legacy method: switch to RistrettoPoint")}e.ExtendedPoint=m,m.BASE=new m(l.Gx,l.Gy,s,N(l.Gx*l.Gy)),m.ZERO=new m(o,s,s,o);class _{constructor(t){this.ep=t}static calcElligatorRistrettoMap(t){const{d:e}=l,r=N(f*t*t),n=N((r+s)*y);let i=BigInt(-1);const o=N((i-e*r)*N(r+e));let{isValid:a,value:u}=U(n,o),c=N(u*t);P(c)||(c=N(-c)),a||(u=c),a||(i=r);const h=N(i*(r-s)*g-o),p=u*u,b=N((u+u)*o),v=N(h*d),w=N(s-p),_=N(s+p);return new m(N(b*_),N(w*v),N(v*_),N(b*w))}static hashToCurve(t){const e=O((t=F(t,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(e),n=O(t.slice(32,64)),i=this.calcElligatorRistrettoMap(n);return new _(r.add(i))}static fromHex(t){t=F(t,32);const{a:e,d:r}=l,n="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",i=O(t);if(!function(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}(C(i),t)||P(i))throw new Error(n);const a=N(i*i),u=N(s+e*a),c=N(s-e*a),h=N(u*u),f=N(c*c),d=N(e*r*h-f),{isValid:p,value:y}=j(N(d*f)),g=N(y*c),b=N(y*g*d);let v=N((i+i)*g);P(v)&&(v=N(-v));const w=N(u*b),E=N(v*w);if(!p||P(E)||w===o)throw new Error(n);return new _(new m(v,w,s,E))}toRawBytes(){let{x:t,y:e,z:r,t:n}=this.ep;const i=N(N(r+e)*N(r-e)),o=N(t*e),{value:s}=j(N(i*o**a)),u=N(s*i),c=N(s*o),l=N(u*c*n);let h;if(P(n*l)){let r=N(e*f),n=N(t*f);t=r,e=n,h=N(u*p)}else h=c;P(t*l)&&(e=N(-e));let d=N((r-e)*h);return P(d)&&(d=N(-d)),C(d)}toHex(){return T(this.toRawBytes())}toString(){return this.toHex()}equals(t){v(t);const e=this.ep,r=t.ep,n=N(e.x*r.y)===N(e.y*r.x),i=N(e.y*r.y)===N(e.x*r.x);return n||i}add(t){return v(t),new _(this.ep.add(t.ep))}subtract(t){return v(t),new _(this.ep.subtract(t.ep))}multiply(t){return new _(this.ep.multiply(t))}multiplyUnsafe(t){return new _(this.ep.multiplyUnsafe(t))}}e.RistrettoPoint=_,_.BASE=new _(m.BASE),_.ZERO=new _(m.ZERO);const E=new WeakMap;class S{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,E.delete(this)}static fromHex(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{d:r,P:n}=l,i=(t=F(t,32)).slice();i[31]=-129&t[31];const o=B(i);if(e&&o>=n)throw new Error("Expected 0 < hex < P");if(!e&&o>=h)throw new Error("Expected 0 < hex < 2**256");const a=N(o*o),u=N(a-s),c=N(r*a+s);let{isValid:f,value:d}=U(u,c);if(!f)throw new Error("Point.fromHex: invalid y coordinate");const p=(d&s)===s;return 0!==(128&t[31])!==p&&(d=N(-d)),new S(d,o)}static async fromPrivateKey(t){return(await z(t)).point}toRawBytes(){const t=C(this.y);return t[31]|=this.x&s?128:0,t}toHex(){return T(this.toRawBytes())}toX25519(){const{y:t}=this;return C(N((s+t)*D(s-t)))}isTorsionFree(){return m.fromAffine(this).isTorsionFree()}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new S(N(-this.x),this.y)}add(t){return m.fromAffine(this).add(m.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return m.fromAffine(this).multiply(t,this).toAffine()}}e.Point=S,S.BASE=new S(l.Gx,l.Gy),S.ZERO=new S(o,s);class I{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromHex(t){const e=F(t,64),r=S.fromHex(e.slice(0,32),!1),n=B(e.slice(32,64));return new I(r,n)}assertValidity(){const{r:t,s:e}=this;if(!(t instanceof S))throw new Error("Expected Point instance");return V(e,l.l,!1),this}toRawBytes(){const t=new Uint8Array(64);return t.set(this.r.toRawBytes()),t.set(C(this.s),32),t}toHex(){return T(this.toRawBytes())}}function A(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(!e.every((t=>t instanceof Uint8Array)))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];const n=e.reduce(((t,e)=>t+e.length),0),i=new Uint8Array(n);for(let o=0,s=0;o<e.length;o++){const t=e[o];i.set(t,s),s+=t.length}return i}e.Signature=I;const M=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function T(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=M[t[r]];return e}function R(t){if("string"!==typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[r]=o}return e}function k(t){return R(t.toString(16).padStart(64,"0"))}function C(t){return k(t).reverse()}function P(t){return(N(t)&s)===s}function B(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+T(Uint8Array.from(t).reverse()))}function O(t){return N(B(t)&a**u-s)}function N(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.P;const r=t%e;return r>=o?r:e+r}function D(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.P;if(t===o||e<=o)throw new Error("invert: expected positive integers, got n=".concat(t," mod=").concat(e));let r=N(t,e),n=e,i=o,a=s,u=s,c=o;for(;r!==o;){const t=n/r,e=n%r,o=i-u*t,s=a-c*t;n=r,r=e,i=u,a=c,u=o,c=s}const h=n;if(h!==s)throw new Error("invert: does not exist");return N(i,e)}function x(t,e){const{P:r}=l;let n=t;for(;e-- >o;)n*=n,n%=r;return n}function L(t){const{P:e}=l,r=BigInt(5),n=BigInt(10),i=BigInt(20),o=BigInt(40),u=BigInt(80),c=t*t%e*t%e,h=x(c,a)*c%e,f=x(h,s)*t%e,d=x(f,r)*f%e,p=x(d,n)*d%e,y=x(p,i)*p%e,g=x(y,o)*y%e,m=x(g,u)*g%e,b=x(m,u)*g%e,v=x(b,n)*d%e;return{pow_p_5_8:x(v,a)*t%e,b2:c}}function U(t,e){const r=N(e*e*e),n=N(r*r*e);let i=N(t*r*L(t*n).pow_p_5_8);const o=N(e*i*i),s=i,a=N(i*f),u=o===t,c=o===N(-t),l=o===N(-t*f);return u&&(i=s),(c||l)&&(i=a),P(i)&&(i=N(-i)),{isValid:u||c,value:i}}function j(t){return U(s,t)}async function K(){const t=await e.utils.sha512(A(...arguments)),r=B(t);return N(r,l.l)}function F(t,e){const r=t instanceof Uint8Array?Uint8Array.from(t):R(t);if("number"===typeof e&&r.length!==e)throw new Error("Expected ".concat(e," bytes"));return r}function V(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)throw new TypeError("Specify max value");if("number"===typeof t&&Number.isSafeInteger(t)&&(t=BigInt(t)),"bigint"===typeof t&&t<e)if(r){if(o<t)return t}else if(o<=t)return t;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function q(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}async function z(t){if(32!==(t="bigint"===typeof t||"number"===typeof t?k(V(t,h)):F(t)).length)throw new Error("Expected 32 bytes");const r=await e.utils.sha512(t),n=q(r.slice(0,32)),i=r.slice(32,64),o=N(B(n),l.l),s=S.BASE.multiply(o),a=s.toRawBytes();return{head:n,prefix:i,scalar:o,point:s,pointBytes:a}}function H(t,e,r){const n=N(t*(e-r));return[e=N(e-n),r=N(r+n)]}e.getPublicKey=async function(t){return(await z(t)).pointBytes},e.sign=async function(t,e){t=F(t);const{prefix:r,scalar:n,pointBytes:i}=await z(e),o=await K(r,t),s=S.BASE.multiply(o),a=N(o+await K(s.toRawBytes(),i,t)*n,l.l);return new I(s,a).toRawBytes()},e.verify=async function(t,e,r){e=F(e),r instanceof S||(r=S.fromHex(r,!1));const{r:n,s:i}=t instanceof I?t.assertValidity():I.fromHex(t),o=m.BASE.multiplyUnsafe(i),s=await K(n.toRawBytes(),r.toRawBytes(),e),a=m.fromAffine(r).multiplyUnsafe(s);return m.fromAffine(n).add(a).subtract(o).multiplyUnsafe(l.h).equals(m.ZERO)},e.getSharedSecret=async function(t,r){const{head:n}=await z(t),i=S.fromHex(r).toX25519();return e.curve25519.scalarMult(n,i)},S.BASE._setWindowSize(8),e.curve25519={BASE_POINT_U:"0900000000000000000000000000000000000000000000000000000000000000",scalarMult(t,e){const r=function(t,e){const{P:r}=l,n=V(t,r),i=V(e,r),u=BigInt(121665),c=n;let h,f=s,d=o,p=n,y=s,g=o;for(let l=BigInt(254);l>=o;l--){const t=i>>l&s;g^=t,h=H(g,f,p),f=h[0],p=h[1],h=H(g,d,y),d=h[0],y=h[1],g=t;const e=f+d,r=N(e*e),n=f-d,o=N(n*n),m=r-o,b=p+y,v=N((p-y)*e),w=N(b*n);p=N((v+w)**a),y=N(c*(v-w)**a),f=N(r*o),d=N(m*(r+N(u*m)))}h=H(g,f,p),f=h[0],p=h[1],h=H(g,d,y),d=h[0],y=h[1];const{pow_p_5_8:m,b2:b}=L(d),v=N(x(m,BigInt(3))*b);return N(f*v)}(function(t){const e=F(t,32);return e[31]&=127,B(e)}(e),B(q(F(t,32))));if(r===o)throw new Error("Invalid private or public key received");return function(t){return C(N(t,l.P))}(r)},scalarMultBase:t=>e.curve25519.scalarMult(t,e.curve25519.BASE_POINT_U)};const G={node:i.default,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0};e.utils={TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],bytesToHex:T,getExtendedPublicKey:z,mod:N,invert:D,hashToPrivateScalar:t=>{if((t=F(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const e=N(B(t),l.l);if(e===o||e===s)throw new Error("Invalid private key");return e},randomBytes:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(G.web)return G.web.getRandomValues(new Uint8Array(t));if(G.node){const{randomBytes:e}=G.node;return new Uint8Array(e(t).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>e.utils.randomBytes(32),sha512:async t=>{if(G.web){const e=await G.web.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}if(G.node)return Uint8Array.from(G.node.createHash("sha512").update(t).digest());throw new Error("The environment doesn't have sha512 function")},precompute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S.BASE;const r=e.equals(S.BASE)?e:new S(e.x,e.y);return r._setWindowSize(t),r.multiply(a),r}}},53845:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.schnorr=e.verify=e.signSync=e.sign=e.getSharedSecret=e.recoverPublicKey=e.getPublicKey=e.Signature=e.Point=e.CURVE=void 0;const i=n(r(69159)),o=BigInt(0),s=BigInt(1),a=BigInt(2),u=BigInt(3),c=BigInt(8),l=a**BigInt(256),h={a:o,b:BigInt(7),P:l-a**BigInt(32)-BigInt(977),n:l-BigInt("432420386565659656852420866394968145599"),h:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function f(t){const{a:e,b:r}=h,n=B(t*t),i=B(n*t);return B(i+e*t+r)}e.CURVE=h;const d=h.a===o;class p{constructor(t,e,r){this.x=t,this.y=e,this.z=r}static fromAffine(t){if(!(t instanceof g))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new p(t.x,t.y,s)}static toAffineBatch(t){const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.P;const r=new Array(t.length),n=N(t.reduce(((t,n,i)=>n===o?t:(r[i]=t,B(t*n,e))),s),e);return t.reduceRight(((t,n,i)=>n===o?t:(r[i]=B(t*r[i],e),B(t*n,e))),n),r}(t.map((t=>t.z)));return t.map(((t,r)=>t.toAffine(e[r])))}static normalizeZ(t){return p.toAffineBatch(t).map(p.fromAffine)}equals(t){if(!(t instanceof p))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:i,y:o,z:s}=t,u=B(n**a),c=B(s**a),l=B(e*c),h=B(i*u),f=B(B(r*s)*c),d=B(B(o*n)*u);return l===h&&f===d}negate(){return new p(this.x,B(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=B(t**a),i=B(e**a),o=B(i**a),s=B(a*(B((t+i)**a)-n-o)),l=B(u*n),h=B(l**a),f=B(h-a*s),d=B(l*(s-f)-c*o),y=B(a*e*r);return new p(f,d,y)}add(t){if(!(t instanceof p))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:i,y:s,z:u}=t;if(i===o||s===o)return this;if(e===o||r===o)return t;const c=B(n**a),l=B(u**a),h=B(e*l),f=B(i*c),d=B(B(r*u)*l),y=B(B(s*n)*c),g=B(f-h),m=B(y-d);if(g===o)return m===o?this.double():p.ZERO;const b=B(g**a),v=B(g*b),w=B(h*b),_=B(m**a-v-a*w),E=B(m*(w-_)-d*v),S=B(n*u*g);return new p(_,E,S)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){let e=P(t);p.BASE;const r=p.ZERO;if(e===o)return r;if(e===s)return this;if(!d){let t=r,n=this;for(;e>o;)e&s&&(t=t.add(n)),n=n.double(),e>>=s;return t}let{k1neg:n,k1:i,k2neg:a,k2:u}=L(e),c=r,l=r,f=this;for(;i>o||u>o;)i&s&&(c=c.add(f)),u&s&&(l=l.add(f)),f=f.double(),i>>=s,u>>=s;return n&&(c=c.negate()),a&&(l=l.negate()),l=new p(B(l.x*h.beta),l.y,l.z),c.add(l)}precomputeWindow(t){const e=d?128/t+1:256/t+1,r=[];let n=this,i=n;for(let o=0;o<e;o++){i=n,r.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(t,e){!e&&this.equals(p.BASE)&&(e=g.BASE);const r=e&&e._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=e&&y.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=p.normalizeZ(n),y.set(e,n)));let i=p.ZERO,o=p.ZERO;const a=1+(d?128/r:256/r),u=2**(r-1),c=BigInt(2**r-1),l=2**r,h=BigInt(r);for(let f=0;f<a;f++){const e=f*u;let r=Number(t&c);if(t>>=h,r>u&&(r-=l,t+=s),0===r){let t=n[e];f%2&&(t=t.negate()),o=o.add(t)}else{let t=n[e+Math.abs(r)-1];r<0&&(t=t.negate()),i=i.add(t)}}return{p:i,f:o}}multiply(t,e){let r,n,i=P(t);if(d){const{k1neg:t,k1:o,k2neg:s,k2:a}=L(i);let{p:u,f:c}=this.wNAF(o,e),{p:l,f:f}=this.wNAF(a,e);t&&(u=u.negate()),s&&(l=l.negate()),l=new p(B(l.x*h.beta),l.y,l.z),r=u.add(l),n=c.add(f)}else{const{p:t,f:o}=this.wNAF(i,e);r=t,n=o}return p.normalizeZ([r,n])[0]}toAffine(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N(this.z);const{x:e,y:r,z:n}=this,i=t,o=B(i*i),a=B(o*i),u=B(e*o),c=B(r*a);if(B(n*i)!==s)throw new Error("invZ was invalid");return new g(u,c)}}p.BASE=new p(h.Gx,h.Gy,s),p.ZERO=new p(o,s,o);const y=new WeakMap;class g{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,y.delete(this)}static fromCompressedHex(t){const e=32===t.length,r=k(e?t:t.subarray(1));if(!F(r))throw new Error("Point is not on curve");let n=function(t){const{P:e}=h,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=t*t*t%e,f=l*l*t%e,d=O(f,u)*f%e,p=O(d,u)*f%e,y=O(p,a)*l%e,g=O(y,n)*y%e,m=O(g,i)*g%e,b=O(m,s)*m%e,v=O(b,c)*b%e,w=O(v,s)*m%e,_=O(w,u)*f%e,E=O(_,o)*g%e,S=O(E,r)*l%e;return O(S,a)}(f(r));const i=(n&s)===s;if(e)i&&(n=B(-n));else{1===(1&t[0])!==i&&(n=B(-n))}const o=new g(r,n);return o.assertValidity(),o}static fromUncompressedHex(t){const e=k(t.subarray(1,33)),r=k(t.subarray(33,65)),n=new g(e,r);return n.assertValidity(),n}static fromHex(t){const e=C(t),r=e.length,n=e[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(e);if(65===r&&4===n)return this.fromUncompressedHex(e);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ".concat(r))}static fromPrivateKey(t){return g.BASE.multiply(q(t))}static fromSignature(t,e,r){const n=U(t=C(t)),{r:i,s:s}=H(e);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");if(n===o)throw new Error("Cannot recover signature: msgHash cannot be 0");const a=1&r?"03":"02",u=g.fromHex(a+I(i)),{n:c}=h,l=N(i,c),f=B(-n*l,c),d=B(s*l,c),p=g.BASE.multiplyAndAddUnsafe(u,f,d);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}toRawBytes(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return R(this.toHex(t))}toHex(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=I(this.x);if(t){const t=this.y&s?"03":"02";return"".concat(t).concat(e)}return"04".concat(e).concat(I(this.y))}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:e,y:r}=this;if(!F(e)||!F(r))throw new Error(t);const n=B(r*r);if(B(n-f(e))!==o)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new g(this.x,B(-this.y))}double(){return p.fromAffine(this).double().toAffine()}add(t){return p.fromAffine(this).add(p.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return p.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,r){const n=p.fromAffine(this).multiply(e),i=p.fromAffine(t).multiplyUnsafe(r),o=n.add(i);return o.equals(p.ZERO)?void 0:o.toAffine()}}function m(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function b(t){if(t.length<2||2!==t[0])throw new Error("Invalid signature integer tag: ".concat(S(t)));const e=t[1],r=t.subarray(2,e+2);if(!e||r.length!==e)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:k(r),left:t.subarray(e+2)}}e.Point=g,g.BASE=new g(h.Gx,h.Gy),g.ZERO=new g(o,o);class v{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=_(t),r="Signature.fromCompact";if("string"!==typeof t&&!e)throw new TypeError("".concat(r,": Expected string or Uint8Array"));const n=e?S(t):t;if(128!==n.length)throw new Error("".concat(r,": Expected 64-byte hex"));return new v(T(n.slice(0,64)),T(n.slice(64,128)))}static fromDER(t){const e=_(t);if("string"!==typeof t&&!e)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:r,s:n}=function(t){if(t.length<2||48!=t[0])throw new Error("Invalid signature tag: ".concat(S(t)));if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:r}=b(t.subarray(2)),{data:n,left:i}=b(r);if(i.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(S(i)));return{r:e,s:n}}(e?t:R(t));return new v(r,n)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!K(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!K(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=h.n>>s;return this.s>t}normalizeS(){return this.hasHighS()?new v(this.r,h.n-this.s):this}toDERRawBytes(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return R(this.toDERHex(t))}toDERHex(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=m(M(this.s));if(t)return e;const r=m(M(this.r)),n=M(r.length/2),i=M(e.length/2),o=M(r.length/2+e.length/2+4);return"30".concat(o,"02").concat(n).concat(r,"02").concat(i).concat(e)}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return R(this.toCompactHex())}toCompactHex(){return I(this.r)+I(this.s)}}function w(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(!e.every(_))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const n=e.reduce(((t,e)=>t+e.length),0),i=new Uint8Array(n);for(let o=0,s=0;o<e.length;o++){const t=e[o];i.set(t,s),s+=t.length}return i}function _(t){return t instanceof Uint8Array}e.Signature=v;const E=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function S(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let r=0;r<t.length;r++)e+=E[t[r]];return e}function I(t){if(t>l)throw new Error("Expected number < 2^256");return t.toString(16).padStart(64,"0")}function A(t){return R(I(t))}function M(t){const e=t.toString(16);return 1&e.length?"0".concat(e):e}function T(t){if("string"!==typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt("0x".concat(t))}function R(t){if("string"!==typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[r]=o}return e}function k(t){return T(S(t))}function C(t){return t instanceof Uint8Array?Uint8Array.from(t):R(t)}function P(t){if("number"===typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"===typeof t&&K(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function B(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.P;const r=t%e;return r>=o?r:e+r}function O(t,e){const{P:r}=h;let n=t;for(;e-- >o;)n*=n,n%=r;return n}function N(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.P;if(t===o||e<=o)throw new Error("invert: expected positive integers, got n=".concat(t," mod=").concat(e));let r=B(t,e),n=e,i=o,a=s,u=s,c=o;for(;r!==o;){const t=n/r,e=n%r,o=i-u*t,s=a-c*t;n=r,r=e,i=u,a=c,u=o,c=s}const l=n;if(l!==s)throw new Error("invert: does not exist");return B(i,e)}const D=(t,e)=>(t+e/a)/e,x=a**BigInt(128);function L(t){const{n:e}=h,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-s*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=D(o*t,e),u=D(-n*t,e);let c=B(t-a*r-u*i,e),l=B(-a*n-u*o,e);const f=c>x,d=l>x;if(f&&(c=e-c),d&&(l=e-l),c>x||l>x)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:d,k2:l}}function U(t){const{n:e}=h,r=8*t.length-256;let n=k(t);return r>0&&(n>>=BigInt(r)),n>=e&&(n-=e),n}class j{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.utils.hmacSha256(this.k,...r)}hmacSync(){if("function"!==typeof e.utils.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const i=e.utils.hmacSha256Sync(this.k,...r);if(i instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return i}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),0!==t.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),0!==t.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function K(t){return o<t&&t<h.n}function F(t){return o<t&&t<h.P}function V(t,e,r){const n=k(t);if(!K(n))return;const{n:i}=h,a=g.BASE.multiply(n),u=B(a.x,i);if(u===o)return;const c=B(N(n,i)*B(e+r*u,i),i);if(c===o)return;const l=new v(u,c);return{sig:l,recovery:(a.x===l.r?0:2)|Number(a.y&s)}}function q(t){let e;if("bigint"===typeof t)e=t;else if("number"===typeof t&&Number.isSafeInteger(t)&&t>0)e=BigInt(t);else if("string"===typeof t){if(64!==t.length)throw new Error("Expected 32 bytes of private key");e=T(t)}else{if(!_(t))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=k(t)}if(!K(e))throw new Error("Expected private key: 0 < key < n");return e}function z(t){return t instanceof g?(t.assertValidity(),t):g.fromHex(t)}function H(t){if(t instanceof v)return t.assertValidity(),t;try{return v.fromDER(t)}catch(e){return v.fromCompact(t)}}function G(t){const e=_(t),r="string"===typeof t,n=(e||r)&&t.length;return e?33===n||65===n:r?66===n||130===n:t instanceof g}function W(t){return k(t.length>32?t.slice(0,32):t)}function Z(t){const e=W(t),r=B(e,h.n);return Y(r<o?e:r)}function Y(t){if("bigint"!==typeof t)throw new Error("Expected bigint");return R(I(t))}function X(t,r,n){if(null==t)throw new Error('sign: expected valid message hash, not "'.concat(t,'"'));const i=C(t),o=q(r),s=[Y(o),Z(i)];if(null!=n){!0===n&&(n=e.utils.randomBytes(32));const t=C(n);if(32!==t.length)throw new Error("sign: Expected 32 bytes of extra data");s.push(t)}return{seed:w(...s),m:W(i),d:o}}function Q(t,e){let{sig:r,recovery:n}=t;const{canonical:i,der:o,recovered:s}=Object.assign({canonical:!0,der:!0},e);i&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=o?r.toDERRawBytes():r.toCompactRawBytes();return s?[a,n]:a}e.getPublicKey=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return g.fromPrivateKey(t).toRawBytes(e)},e.recoverPublicKey=function(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return g.fromSignature(t,e,r).toRawBytes(n)},e.getSharedSecret=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(G(t))throw new TypeError("getSharedSecret: first arg must be private key");if(!G(e))throw new TypeError("getSharedSecret: second arg must be public key");const n=z(e);return n.assertValidity(),n.multiply(q(t)).toRawBytes(r)},e.sign=async function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{seed:n,m:i,d:o}=X(t,e,r.extraEntropy);let s;const a=new j;for(await a.reseed(n);!(s=V(await a.generate(),i,o));)await a.reseed();return Q(s,r)},e.signSync=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{seed:n,m:i,d:o}=X(t,e,r.extraEntropy);let s;const a=new j;for(a.reseedSync(n);!(s=V(a.generateSync(),i,o));)a.reseedSync();return Q(s,r)};const J={strict:!0};async function $(t){const r=new Uint8Array(t.split("").map((t=>t.charCodeAt(0)))),n=await e.utils.sha256(r);for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];const a=await e.utils.sha256(w(n,n,...o));return k(a)}async function tt(t,e,r){const n=A(t);return B(await $("BIP0340/challenge",n,e.toRawX(),r),h.n)}function et(t){return(t.y&s)===o}e.verify=function(t,e,r){let n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:J;try{n=H(t),e=C(e)}catch(b){return!1}const{r:s,s:a}=n;if(i.strict&&n.hasHighS())return!1;const u=U(e);if(u===o)return!1;let c;try{c=z(r)}catch(b){return!1}const{n:l}=h,f=N(a,l),d=B(u*f,l),p=B(s*f,l),y=g.BASE.multiplyAndAddUnsafe(c,d,p);if(!y)return!1;const m=B(y.x,l);return m===s};class rt{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromHex(t){const e=C(t);if(64!==e.length)throw new TypeError("SchnorrSignature.fromHex: expected 64 bytes, not ".concat(e.length));const r=k(e.subarray(0,32)),n=k(e.subarray(32,64));return new rt(r,n)}assertValidity(){const{r:t,s:e}=this;if(!F(t)||!K(e))throw new Error("Invalid signature")}toHex(){return I(this.r)+I(this.s)}toRawBytes(){return R(this.toHex())}}async function nt(t,e,r){const n=t instanceof rt;let i;try{i=n?t:rt.fromHex(t),n&&i.assertValidity()}catch(f){return!1}const{r:o,s:s}=i,a=C(e);let u;try{u=z(r)}catch(f){return!1}const c=await tt(o,u,a),l=g.BASE.multiplyAndAddUnsafe(u,q(s),B(-c,h.n));return!(!l||!et(l)||l.x!==o)}e.schnorr={Signature:rt,getPublicKey:function(t){return g.fromPrivateKey(t).toRawX()},sign:async function(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.utils.randomBytes();if(null==t)throw new TypeError('sign: Expected valid message, not "'.concat(t,'"'));const{n:i}=h,s=C(t),a=q(r),u=C(n);if(32!==u.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const c=g.fromPrivateKey(a),l=et(c)?a:i-a,f=await $("BIP0340/aux",u),d=l^f,p=await $("BIP0340/nonce",A(d),c.toRawX(),s),y=B(p,i);if(y===o)throw new Error("sign: Creation of signature failed. k is zero");const m=g.fromPrivateKey(y),b=et(m)?y:i-y,v=await tt(m.x,c,s),w=new rt(m.x,B(b+v*l,i)).toRawBytes(),_=await nt(w,s,c.toRawX());if(!_)throw new Error("sign: Invalid signature produced");return w},verify:nt},g.BASE._setWindowSize(8);const it={node:i.default,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0};e.utils={isValidPrivateKey(t){try{return q(t),!0}catch(e){return!1}},hashToPrivateKey:t=>{if((t=C(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const e=B(k(t),h.n);if(e===o||e===s)throw new Error("Invalid private key");return A(e)},randomBytes:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(it.web)return it.web.getRandomValues(new Uint8Array(t));if(it.node){const{randomBytes:e}=it.node;return Uint8Array.from(e(t))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>e.utils.hashToPrivateKey(e.utils.randomBytes(40)),bytesToHex:S,mod:B,sha256:async t=>{if(it.web){const e=await it.web.subtle.digest("SHA-256",t.buffer);return new Uint8Array(e)}if(it.node){const{createHash:e}=it.node;return Uint8Array.from(e("sha256").update(t).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(it.web){const e=await it.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=w(...r),i=await it.web.subtle.sign("HMAC",e,n);return new Uint8Array(i)}if(it.node){const{createHmac:e}=it.node,n=e("sha256",t);return r.forEach((t=>n.update(t))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.BASE;const r=e===g.BASE?e:new g(e.x,e.y);return r._setWindowSize(t),r.multiply(u),r}}},17206:t=>{"use strict";t.exports=function(t,e){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,s){r[n]=function(t){if(o)if(o=!1,t)s(t);else{for(var e=new Array(arguments.length-1),r=0;r<e.length;)e[r++]=arguments[r];i.apply(null,e)}};try{t.apply(e||null,r)}catch(a){o&&(o=!1,s(a))}}))}},70001:(t,e)=>{"use strict";var r=e;r.length=function(t){var e=t.length;if(!e)return 0;for(var r=0;--e%4>1&&"="===t.charAt(e);)++r;return Math.ceil(3*t.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(t,e,r){for(var i,o=null,s=[],a=0,u=0;e<r;){var c=t[e++];switch(u){case 0:s[a++]=n[c>>2],i=(3&c)<<4,u=1;break;case 1:s[a++]=n[i|c>>4],i=(15&c)<<2,u=2;break;case 2:s[a++]=n[i|c>>6],s[a++]=n[63&c],u=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=n[i],s[a++]=61,1===u&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(t,e,r){for(var n,o=r,a=0,u=0;u<t.length;){var c=t.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=i[c]))throw Error(s);switch(a){case 0:n=c,a=1;break;case 1:e[r++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:e[r++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:e[r++]=(3&n)<<6|c,a=0}}if(1===a)throw Error(s);return r-o},r.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},27111:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,r){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:r||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var r=this._listeners[t],n=0;n<r.length;)r[n].fn===e?r.splice(n,1):++n;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<e.length;)e[n].fn.apply(e[n++].ctx,r)}return this}},30802:t=>{"use strict";function e(t){return"undefined"!==typeof Float32Array?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=128===r[3];function i(t,n,i){e[0]=t,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(t,n,i){e[0]=t,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function s(t,n){return r[0]=t[n],r[1]=t[n+1],r[2]=t[n+2],r[3]=t[n+3],e[0]}function a(t,n){return r[3]=t[n],r[2]=t[n+1],r[1]=t[n+2],r[0]=t[n+3],e[0]}t.writeFloatLE=n?i:o,t.writeFloatBE=n?o:i,t.readFloatLE=n?s:a,t.readFloatBE=n?a:s}():function(){function e(t,e,r,n){var i=e<0?1:0;if(i&&(e=-e),0===e)t(1/e>0?0:2147483648,r,n);else if(isNaN(e))t(2143289344,r,n);else if(e>34028234663852886e22)t((i<<31|2139095040)>>>0,r,n);else if(e<11754943508222875e-54)t((i<<31|Math.round(e/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(e)/Math.LN2);t((i<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,r,n)}}function s(t,e,r){var n=t(e,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}t.writeFloatLE=e.bind(null,r),t.writeFloatBE=e.bind(null,n),t.readFloatLE=s.bind(null,i),t.readFloatBE=s.bind(null,o)}(),"undefined"!==typeof Float64Array?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=128===r[7];function i(t,n,i){e[0]=t,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(t,n,i){e[0]=t,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(t,n){return r[0]=t[n],r[1]=t[n+1],r[2]=t[n+2],r[3]=t[n+3],r[4]=t[n+4],r[5]=t[n+5],r[6]=t[n+6],r[7]=t[n+7],e[0]}function a(t,n){return r[7]=t[n],r[6]=t[n+1],r[5]=t[n+2],r[4]=t[n+3],r[3]=t[n+4],r[2]=t[n+5],r[1]=t[n+6],r[0]=t[n+7],e[0]}t.writeDoubleLE=n?i:o,t.writeDoubleBE=n?o:i,t.readDoubleLE=n?s:a,t.readDoubleBE=n?a:s}():function(){function e(t,e,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)t(0,i,o+e),t(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))t(0,i,o+e),t(2146959360,i,o+r);else if(n>17976931348623157e292)t(0,i,o+e),t((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)t((a=n/5e-324)>>>0,i,o+e),t((s<<31|a/4294967296)>>>0,i,o+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(a=n*Math.pow(2,-u))>>>0,i,o+e),t((s<<31|u+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function s(t,e,r,n,i){var o=t(n,i+e),s=t(n,i+r),a=2*(s>>31)+1,u=s>>>20&2047,c=4294967296*(1048575&s)+o;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}t.writeDoubleLE=e.bind(null,r,0,4),t.writeDoubleBE=e.bind(null,n,4,0),t.readDoubleLE=s.bind(null,i,0,4),t.readDoubleBE=s.bind(null,o,4,0)}(),t}function r(t,e,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function n(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=255&t}function i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},77172:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},58236:t=>{"use strict";t.exports=function(t,e,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return t(r);s+r>n&&(o=t(n),s=0);var a=e.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},93861:(t,e)=>{"use strict";var r=e;r.length=function(t){for(var e=0,r=0,n=0;n<t.length;++n)(r=t.charCodeAt(n))<128?e+=1:r<2048?e+=2:55296===(64512&r)&&56320===(64512&t.charCodeAt(n+1))?(++n,e+=4):e+=3;return e},r.read=function(t,e,r){if(r-e<1)return"";for(var n,i=null,o=[],s=0;e<r;)(n=t[e++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&t[e++]:n>239&&n<365?(n=((7&n)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&t[e++])<<6|63&t[e++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},r.write=function(t,e,r){for(var n,i,o=r,s=0;s<t.length;++s)(n=t.charCodeAt(s))<128?e[r++]=n:n<2048?(e[r++]=n>>6|192,e[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=t.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,e[r++]=n>>18|240,e[r++]=n>>12&63|128,e[r++]=n>>6&63|128,e[r++]=63&n|128):(e[r++]=n>>12|224,e[r++]=n>>6&63|128,e[r++]=63&n|128);return r-o}},76232:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(45073);function i(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function o(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function s(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function a(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function u(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function c(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function l(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function h(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function f(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),l(t/4294967296>>>0,e,r),l(t>>>0,e,r+4),e}function d(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),h(t>>>0,e,r),h(t/4294967296>>>0,e,r+4),e}e.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},e.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},e.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},e.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},e.writeUint16BE=i,e.writeInt16BE=i,e.writeUint16LE=o,e.writeInt16LE=o,e.readInt32BE=s,e.readUint32BE=a,e.readInt32LE=u,e.readUint32LE=c,e.writeUint32BE=l,e.writeInt32BE=l,e.writeUint32LE=h,e.writeInt32LE=h,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=s(t,e),n=s(t,e+4);return 4294967296*r+n-4294967296*(n>>31)},e.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*a(t,e)+a(t,e+4)},e.readInt64LE=function(t,e){void 0===e&&(e=0);var r=u(t,e);return 4294967296*u(t,e+4)+r-4294967296*(r>>31)},e.readUint64LE=function(t,e){void 0===e&&(e=0);var r=c(t,e);return 4294967296*c(t,e+4)+r},e.writeUint64BE=f,e.writeInt64BE=f,e.writeUint64LE=d,e.writeInt64LE=d,e.readUintBE=function(t,e,r){if(void 0===r&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n},e.readUintLE=function(t,e,r){if(void 0===r&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n},e.writeUintBE=function(t,e,r,i){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===i&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var o=1,s=t/8+i-1;s>=i;s--)r[s]=e/o&255,o*=256;return r},e.writeUintLE=function(t,e,r,i){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===i&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+t/8;s++)r[s]=e/o&255,o*=256;return r},e.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},e.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},e.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},e.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},e.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},e.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},e.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},e.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e}},78284:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(76232),i=r(9116);function o(t,e,r){for(var i=1634760805,o=857760878,s=2036477234,a=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],l=r[11]<<24|r[10]<<16|r[9]<<8|r[8],h=r[15]<<24|r[14]<<16|r[13]<<8|r[12],f=r[19]<<24|r[18]<<16|r[17]<<8|r[16],d=r[23]<<24|r[22]<<16|r[21]<<8|r[20],p=r[27]<<24|r[26]<<16|r[25]<<8|r[24],y=r[31]<<24|r[30]<<16|r[29]<<8|r[28],g=e[3]<<24|e[2]<<16|e[1]<<8|e[0],m=e[7]<<24|e[6]<<16|e[5]<<8|e[4],b=e[11]<<24|e[10]<<16|e[9]<<8|e[8],v=e[15]<<24|e[14]<<16|e[13]<<8|e[12],w=i,_=o,E=s,S=a,I=u,A=c,M=l,T=h,R=f,k=d,C=p,P=y,B=g,O=m,N=b,D=v,x=0;x<20;x+=2)I=(I^=R=R+(B=(B^=w=w+I|0)>>>16|B<<16)|0)>>>20|I<<12,A=(A^=k=k+(O=(O^=_=_+A|0)>>>16|O<<16)|0)>>>20|A<<12,M=(M^=C=C+(N=(N^=E=E+M|0)>>>16|N<<16)|0)>>>20|M<<12,T=(T^=P=P+(D=(D^=S=S+T|0)>>>16|D<<16)|0)>>>20|T<<12,M=(M^=C=C+(N=(N^=E=E+M|0)>>>24|N<<8)|0)>>>25|M<<7,T=(T^=P=P+(D=(D^=S=S+T|0)>>>24|D<<8)|0)>>>25|T<<7,A=(A^=k=k+(O=(O^=_=_+A|0)>>>24|O<<8)|0)>>>25|A<<7,I=(I^=R=R+(B=(B^=w=w+I|0)>>>24|B<<8)|0)>>>25|I<<7,A=(A^=C=C+(D=(D^=w=w+A|0)>>>16|D<<16)|0)>>>20|A<<12,M=(M^=P=P+(B=(B^=_=_+M|0)>>>16|B<<16)|0)>>>20|M<<12,T=(T^=R=R+(O=(O^=E=E+T|0)>>>16|O<<16)|0)>>>20|T<<12,I=(I^=k=k+(N=(N^=S=S+I|0)>>>16|N<<16)|0)>>>20|I<<12,T=(T^=R=R+(O=(O^=E=E+T|0)>>>24|O<<8)|0)>>>25|T<<7,I=(I^=k=k+(N=(N^=S=S+I|0)>>>24|N<<8)|0)>>>25|I<<7,M=(M^=P=P+(B=(B^=_=_+M|0)>>>24|B<<8)|0)>>>25|M<<7,A=(A^=C=C+(D=(D^=w=w+A|0)>>>24|D<<8)|0)>>>25|A<<7;n.writeUint32LE(w+i|0,t,0),n.writeUint32LE(_+o|0,t,4),n.writeUint32LE(E+s|0,t,8),n.writeUint32LE(S+a|0,t,12),n.writeUint32LE(I+u|0,t,16),n.writeUint32LE(A+c|0,t,20),n.writeUint32LE(M+l|0,t,24),n.writeUint32LE(T+h|0,t,28),n.writeUint32LE(R+f|0,t,32),n.writeUint32LE(k+d|0,t,36),n.writeUint32LE(C+p|0,t,40),n.writeUint32LE(P+y|0,t,44),n.writeUint32LE(B+g|0,t,48),n.writeUint32LE(O+m|0,t,52),n.writeUint32LE(N+b|0,t,56),n.writeUint32LE(D+v|0,t,60)}function s(t,e,r,n,s){if(void 0===s&&(s=0),32!==t.length)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var u,c;if(0===s){if(8!==e.length&&12!==e.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");c=(u=new Uint8Array(16)).length-e.length,u.set(e,c)}else{if(16!==e.length)throw new Error("ChaCha nonce with counter must be 16 bytes");u=e,c=s}for(var l=new Uint8Array(64),h=0;h<r.length;h+=64){o(l,u,t);for(var f=h;f<h+64&&f<r.length;f++)n[f]=r[f]^l[f-h];a(u,0,c)}return i.wipe(l),0===s&&i.wipe(u),n}function a(t,e,r){for(var n=1;r--;)n=n+(255&t[e])|0,t[e]=255&n,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}e.streamXOR=s,e.stream=function(t,e,r,n){return void 0===n&&(n=0),i.wipe(r),s(t,e,r,r,n)}},53642:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(78284),i=r(75629),o=r(9116),s=r(76232),a=r(68770);e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var u=new Uint8Array(16),c=function(){function t(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return t.prototype.seal=function(t,e,r,i){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(t,s.length-t.length);var a=new Uint8Array(32);n.stream(this._key,s,a,4);var u,c=e.length+this.tagLength;if(i){if(i.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(c);return n.streamXOR(this._key,s,e,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),a,u.subarray(0,u.length-this.tagLength),r),o.wipe(s),u},t.prototype.open=function(t,e,r,i){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(e.length<this.tagLength)return null;var s=new Uint8Array(16);s.set(t,s.length-t.length);var u=new Uint8Array(32);n.stream(this._key,s,u,4);var c=new Uint8Array(this.tagLength);if(this._authenticate(c,u,e.subarray(0,e.length-this.tagLength),r),!a.equal(c,e.subarray(e.length-this.tagLength,e.length)))return null;var l,h=e.length-this.tagLength;if(i){if(i.length!==h)throw new Error("ChaCha20Poly1305: incorrect destination length");l=i}else l=new Uint8Array(h);return n.streamXOR(this._key,s,e.subarray(0,e.length-this.tagLength),l,4),o.wipe(s),l},t.prototype.clean=function(){return o.wipe(this._key),this},t.prototype._authenticate=function(t,e,r,n){var a=new i.Poly1305(e);n&&(a.update(n),n.length%16>0&&a.update(u.subarray(n.length%16))),a.update(r),r.length%16>0&&a.update(u.subarray(r.length%16));var c=new Uint8Array(8);n&&s.writeUint64LE(n.length,c),a.update(c),s.writeUint64LE(r.length,c),a.update(c);for(var l=a.digest(),h=0;h<l.length;h++)t[h]=l[h];a.clean(),o.wipe(l),o.wipe(c)},t}();e.ChaCha20Poly1305=c},68770:(t,e)=>{"use strict";function r(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}Object.defineProperty(e,"__esModule",{value:!0}),e.select=function(t,e,r){return~(t-1)&e|t-1&r},e.lessOrEqual=function(t,e){return(0|t)-(0|e)-1>>>31&1},e.compare=r,e.equal=function(t,e){return 0!==t.length&&0!==e.length&&0!==r(t,e)}},41412:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSerializableHash=function(t){return"undefined"!==typeof t.saveState&&"undefined"!==typeof t.restoreState&&"undefined"!==typeof t.cleanSavedState}},52497:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(5499),i=r(9116),o=function(){function t(t,e,r,i){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=i;var o=n.hmac(this._hash,r,e);this._hmac=new n.HMAC(t,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(0===t)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(t){for(var e=new Uint8Array(t),r=0;r<e.length;r++)this._bufpos===this._buffer.length&&this._fillBuffer(),e[r]=this._buffer[this._bufpos++];return e},t.prototype.clean=function(){this._hmac.clean(),i.wipe(this._buffer),i.wipe(this._counter),this._bufpos=0},t}();e.HKDF=o},5499:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(41412),i=r(68770),o=r(9116),s=function(){function t(t,e){this._finished=!1,this._inner=new t,this._outer=new t,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);e.length>this.blockSize?this._inner.update(e).finish(r).clean():r.set(e);for(var i=0;i<r.length;i++)r[i]^=54;this._inner.update(r);for(i=0;i<r.length;i++)r[i]^=106;this._outer.update(r),n.isSerializableHash(this._inner)&&n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),o.wipe(r)}return t.prototype.reset=function(){if(!n.isSerializableHash(this._inner)||!n.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){n.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),n.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(t){return this._inner.update(t),this},t.prototype.finish=function(t){return this._finished?(this._outer.finish(t),this):(this._inner.finish(t),this._outer.update(t.subarray(0,this.digestLength)).finish(t),this._finished=!0,this)},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(!n.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(t){if(!n.isSerializableHash(this._inner)||!n.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(t),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(t){if(!n.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(t)},t}();e.HMAC=s,e.hmac=function(t,e,r){var n=new s(t,e);n.update(r);var i=n.digest();return n.clean(),i},e.equal=i.equal},45073:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16&65535)*n+r*(e>>>16&65535)<<16>>>0)|0},e.add=function(t,e){return t+e|0},e.sub=function(t,e){return t-e|0},e.rotl=function(t,e){return t<<e|t>>>32-e},e.rotr=function(t,e){return t<<32-e|t>>>e},e.isInteger=Number.isInteger||function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}},75629:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(68770),i=r(9116);e.DIGEST_LENGTH=16;var o=function(){function t(t){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=t[0]|t[1]<<8;this._r[0]=8191&r;var n=t[2]|t[3]<<8;this._r[1]=8191&(r>>>13|n<<3);var i=t[4]|t[5]<<8;this._r[2]=7939&(n>>>10|i<<6);var o=t[6]|t[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=t[8]|t[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var u=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|u<<5);var c=t[14]|t[15]<<8;this._r[8]=8191&(u>>>8|c<<8),this._r[9]=c>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return t.prototype._blocks=function(t,e,r){for(var n=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],u=this._h[4],c=this._h[5],l=this._h[6],h=this._h[7],f=this._h[8],d=this._h[9],p=this._r[0],y=this._r[1],g=this._r[2],m=this._r[3],b=this._r[4],v=this._r[5],w=this._r[6],_=this._r[7],E=this._r[8],S=this._r[9];r>=16;){var I=t[e+0]|t[e+1]<<8;i+=8191&I;var A=t[e+2]|t[e+3]<<8;o+=8191&(I>>>13|A<<3);var M=t[e+4]|t[e+5]<<8;s+=8191&(A>>>10|M<<6);var T=t[e+6]|t[e+7]<<8;a+=8191&(M>>>7|T<<9);var R=t[e+8]|t[e+9]<<8;u+=8191&(T>>>4|R<<12),c+=R>>>1&8191;var k=t[e+10]|t[e+11]<<8;l+=8191&(R>>>14|k<<2);var C=t[e+12]|t[e+13]<<8;h+=8191&(k>>>11|C<<5);var P=t[e+14]|t[e+15]<<8,B=0,O=B;O+=i*p,O+=o*(5*S),O+=s*(5*E),O+=a*(5*_),B=(O+=u*(5*w))>>>13,O&=8191,O+=c*(5*v),O+=l*(5*b),O+=h*(5*m),O+=(f+=8191&(C>>>8|P<<8))*(5*g);var N=B+=(O+=(d+=P>>>5|n)*(5*y))>>>13;N+=i*y,N+=o*p,N+=s*(5*S),N+=a*(5*E),B=(N+=u*(5*_))>>>13,N&=8191,N+=c*(5*w),N+=l*(5*v),N+=h*(5*b),N+=f*(5*m),B+=(N+=d*(5*g))>>>13,N&=8191;var D=B;D+=i*g,D+=o*y,D+=s*p,D+=a*(5*S),B=(D+=u*(5*E))>>>13,D&=8191,D+=c*(5*_),D+=l*(5*w),D+=h*(5*v),D+=f*(5*b);var x=B+=(D+=d*(5*m))>>>13;x+=i*m,x+=o*g,x+=s*y,x+=a*p,B=(x+=u*(5*S))>>>13,x&=8191,x+=c*(5*E),x+=l*(5*_),x+=h*(5*w),x+=f*(5*v);var L=B+=(x+=d*(5*b))>>>13;L+=i*b,L+=o*m,L+=s*g,L+=a*y,B=(L+=u*p)>>>13,L&=8191,L+=c*(5*S),L+=l*(5*E),L+=h*(5*_),L+=f*(5*w);var U=B+=(L+=d*(5*v))>>>13;U+=i*v,U+=o*b,U+=s*m,U+=a*g,B=(U+=u*y)>>>13,U&=8191,U+=c*p,U+=l*(5*S),U+=h*(5*E),U+=f*(5*_);var j=B+=(U+=d*(5*w))>>>13;j+=i*w,j+=o*v,j+=s*b,j+=a*m,B=(j+=u*g)>>>13,j&=8191,j+=c*y,j+=l*p,j+=h*(5*S),j+=f*(5*E);var K=B+=(j+=d*(5*_))>>>13;K+=i*_,K+=o*w,K+=s*v,K+=a*b,B=(K+=u*m)>>>13,K&=8191,K+=c*g,K+=l*y,K+=h*p,K+=f*(5*S);var F=B+=(K+=d*(5*E))>>>13;F+=i*E,F+=o*_,F+=s*w,F+=a*v,B=(F+=u*b)>>>13,F&=8191,F+=c*m,F+=l*g,F+=h*y,F+=f*p;var V=B+=(F+=d*(5*S))>>>13;V+=i*S,V+=o*E,V+=s*_,V+=a*w,B=(V+=u*v)>>>13,V&=8191,V+=c*b,V+=l*m,V+=h*g,V+=f*y,i=O=8191&(B=(B=((B+=(V+=d*p)>>>13)<<2)+B|0)+(O&=8191)|0),o=N+=B>>>=13,s=D&=8191,a=x&=8191,u=L&=8191,c=U&=8191,l=j&=8191,h=K&=8191,f=F&=8191,d=V&=8191,e+=16,r-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=u,this._h[5]=c,this._h[6]=l,this._h[7]=h,this._h[8]=f,this._h[9]=d},t.prototype.finish=function(t,e){void 0===e&&(e=0);var r,n,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=r,r=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,s[0]=this._h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this._h[o]=this._h[o]&n|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return t[e+0]=this._h[0]>>>0,t[e+1]=this._h[0]>>>8,t[e+2]=this._h[1]>>>0,t[e+3]=this._h[1]>>>8,t[e+4]=this._h[2]>>>0,t[e+5]=this._h[2]>>>8,t[e+6]=this._h[3]>>>0,t[e+7]=this._h[3]>>>8,t[e+8]=this._h[4]>>>0,t[e+9]=this._h[4]>>>8,t[e+10]=this._h[5]>>>0,t[e+11]=this._h[5]>>>8,t[e+12]=this._h[6]>>>0,t[e+13]=this._h[6]>>>8,t[e+14]=this._h[7]>>>0,t[e+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(t){var e,r=0,n=t.length;if(this._leftover){(e=16-this._leftover)>n&&(e=n);for(var i=0;i<e;i++)this._buffer[this._leftover+i]=t[r+i];if(n-=e,r+=e,this._leftover+=e,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(e=n-n%16,this._blocks(t,r,e),r+=e,n-=e),n){for(i=0;i<n;i++)this._buffer[this._leftover+i]=t[r+i];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var t=new Uint8Array(16);return this.finish(t),t},t.prototype.clean=function(){return i.wipe(this._buffer),i.wipe(this._r),i.wipe(this._h),i.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();e.Poly1305=o,e.oneTimeAuth=function(t,e){var r=new o(t);r.update(e);var n=r.digest();return r.clean(),n},e.equal=function(t,r){return t.length===e.DIGEST_LENGTH&&r.length===e.DIGEST_LENGTH&&n.equal(t,r)}},56271:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(933),i=r(76232),o=r(9116);function s(t,r){return void 0===r&&(r=e.defaultRandomSource),r.randomBytes(t)}e.defaultRandomSource=new n.SystemRandomSource,e.randomBytes=s,e.randomUint32=function(t){void 0===t&&(t=e.defaultRandomSource);var r=s(4,t),n=i.readUint32LE(r);return o.wipe(r),n};var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(t,r,n){if(void 0===r&&(r=a),void 0===n&&(n=e.defaultRandomSource),r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");for(var i="",u=r.length,c=256-256%u;t>0;){for(var l=s(Math.ceil(256*t/c),n),h=0;h<l.length&&t>0;h++){var f=l[h];f<c&&(i+=r.charAt(f%u),t--)}o.wipe(l)}return i}e.randomString=u,e.randomStringForEntropy=function(t,r,n){return void 0===r&&(r=a),void 0===n&&(n=e.defaultRandomSource),u(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,n)}},98136:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.isAvailable=!1,this.isInstantiated=!1;var t="undefined"!==typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}return t.prototype.randomBytes=function(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var e=new Uint8Array(t),r=0;r<e.length;r+=65536)this._crypto.getRandomValues(e.subarray(r,r+Math.min(e.length-r,65536)));return e},t}();e.BrowserRandomSource=r},38188:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9116),i=function(){function t(){this.isAvailable=!1,this.isInstantiated=!1;var t=r(35883);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}return t.prototype.randomBytes=function(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var r=new Uint8Array(t),i=0;i<r.length;i++)r[i]=e[i];return n.wipe(e),r},t}();e.NodeRandomSource=i},933:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(98136),i=r(38188),o=function(){function t(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}return t.prototype.randomBytes=function(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)},t}();e.SystemRandomSource=o},24888:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(76232),i=r(9116);e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var o=function(){function t(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._temp),this.reset()},t.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=e,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&e>0;)this._buffer[this._bufferLength++]=t[r++],e--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(e>=this.blockSize&&(r=a(this._temp,this._state,t,r,e),e%=this.blockSize);e>0;)this._buffer[this._bufferLength++]=t[r++],e--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,i=e/536870912|0,o=e<<3,s=e%64<56?64:128;this._buffer[r]=128;for(var u=r+1;u<s-8;u++)this._buffer[u]=0;n.writeUint32BE(i,this._buffer,s-8),n.writeUint32BE(o,this._buffer,s-4),a(this._temp,this._state,this._buffer,0,s),this._finished=!0}for(u=0;u<this.digestLength/4;u++)n.writeUint32BE(this._state[u],t,4*u);return this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(t){return this._state.set(t.state),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){i.wipe(t.state),t.buffer&&i.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.SHA256=o;var s=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(t,e,r,i,o){for(;o>=64;){for(var a=e[0],u=e[1],c=e[2],l=e[3],h=e[4],f=e[5],d=e[6],p=e[7],y=0;y<16;y++){var g=i+4*y;t[y]=n.readUint32BE(r,g)}for(y=16;y<64;y++){var m=t[y-2],b=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,v=((m=t[y-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;t[y]=(b+t[y-7]|0)+(v+t[y-16]|0)}for(y=0;y<64;y++){b=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&f^~h&d)|0)+(p+(s[y]+t[y]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&u^a&c^u&c)|0;p=d,d=f,f=h,h=l+b|0,l=c,c=u,u=a,a=b+v|0}e[0]+=a,e[1]+=u,e[2]+=c,e[3]+=l,e[4]+=h,e[5]+=f,e[6]+=d,e[7]+=p,i+=64,o-=64}return i}e.hash=function(t){var e=new o;e.update(t);var r=e.digest();return e.clean(),r}},9116:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t}},52029:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(56271),i=r(9116);function o(t){var e=new Float64Array(16);if(t)for(var r=0;r<t.length;r++)e[r]=t[r];return e}e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;var s=new Uint8Array(32);s[0]=9;var a=o([56129,1]);function u(t){for(var e=1,r=0;r<16;r++){var n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-65536*e}t[0]+=e-1+37*(e-1)}function c(t,e,r){for(var n=~(r-1),i=0;i<16;i++){var o=n&(t[i]^e[i]);t[i]^=o,e[i]^=o}}function l(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]+r[n]}function h(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]-r[n]}function f(t,e,r){var n,i,o=0,s=0,a=0,u=0,c=0,l=0,h=0,f=0,d=0,p=0,y=0,g=0,m=0,b=0,v=0,w=0,_=0,E=0,S=0,I=0,A=0,M=0,T=0,R=0,k=0,C=0,P=0,B=0,O=0,N=0,D=0,x=r[0],L=r[1],U=r[2],j=r[3],K=r[4],F=r[5],V=r[6],q=r[7],z=r[8],H=r[9],G=r[10],W=r[11],Z=r[12],Y=r[13],X=r[14],Q=r[15];o+=(n=e[0])*x,s+=n*L,a+=n*U,u+=n*j,c+=n*K,l+=n*F,h+=n*V,f+=n*q,d+=n*z,p+=n*H,y+=n*G,g+=n*W,m+=n*Z,b+=n*Y,v+=n*X,w+=n*Q,s+=(n=e[1])*x,a+=n*L,u+=n*U,c+=n*j,l+=n*K,h+=n*F,f+=n*V,d+=n*q,p+=n*z,y+=n*H,g+=n*G,m+=n*W,b+=n*Z,v+=n*Y,w+=n*X,_+=n*Q,a+=(n=e[2])*x,u+=n*L,c+=n*U,l+=n*j,h+=n*K,f+=n*F,d+=n*V,p+=n*q,y+=n*z,g+=n*H,m+=n*G,b+=n*W,v+=n*Z,w+=n*Y,_+=n*X,E+=n*Q,u+=(n=e[3])*x,c+=n*L,l+=n*U,h+=n*j,f+=n*K,d+=n*F,p+=n*V,y+=n*q,g+=n*z,m+=n*H,b+=n*G,v+=n*W,w+=n*Z,_+=n*Y,E+=n*X,S+=n*Q,c+=(n=e[4])*x,l+=n*L,h+=n*U,f+=n*j,d+=n*K,p+=n*F,y+=n*V,g+=n*q,m+=n*z,b+=n*H,v+=n*G,w+=n*W,_+=n*Z,E+=n*Y,S+=n*X,I+=n*Q,l+=(n=e[5])*x,h+=n*L,f+=n*U,d+=n*j,p+=n*K,y+=n*F,g+=n*V,m+=n*q,b+=n*z,v+=n*H,w+=n*G,_+=n*W,E+=n*Z,S+=n*Y,I+=n*X,A+=n*Q,h+=(n=e[6])*x,f+=n*L,d+=n*U,p+=n*j,y+=n*K,g+=n*F,m+=n*V,b+=n*q,v+=n*z,w+=n*H,_+=n*G,E+=n*W,S+=n*Z,I+=n*Y,A+=n*X,M+=n*Q,f+=(n=e[7])*x,d+=n*L,p+=n*U,y+=n*j,g+=n*K,m+=n*F,b+=n*V,v+=n*q,w+=n*z,_+=n*H,E+=n*G,S+=n*W,I+=n*Z,A+=n*Y,M+=n*X,T+=n*Q,d+=(n=e[8])*x,p+=n*L,y+=n*U,g+=n*j,m+=n*K,b+=n*F,v+=n*V,w+=n*q,_+=n*z,E+=n*H,S+=n*G,I+=n*W,A+=n*Z,M+=n*Y,T+=n*X,R+=n*Q,p+=(n=e[9])*x,y+=n*L,g+=n*U,m+=n*j,b+=n*K,v+=n*F,w+=n*V,_+=n*q,E+=n*z,S+=n*H,I+=n*G,A+=n*W,M+=n*Z,T+=n*Y,R+=n*X,k+=n*Q,y+=(n=e[10])*x,g+=n*L,m+=n*U,b+=n*j,v+=n*K,w+=n*F,_+=n*V,E+=n*q,S+=n*z,I+=n*H,A+=n*G,M+=n*W,T+=n*Z,R+=n*Y,k+=n*X,C+=n*Q,g+=(n=e[11])*x,m+=n*L,b+=n*U,v+=n*j,w+=n*K,_+=n*F,E+=n*V,S+=n*q,I+=n*z,A+=n*H,M+=n*G,T+=n*W,R+=n*Z,k+=n*Y,C+=n*X,P+=n*Q,m+=(n=e[12])*x,b+=n*L,v+=n*U,w+=n*j,_+=n*K,E+=n*F,S+=n*V,I+=n*q,A+=n*z,M+=n*H,T+=n*G,R+=n*W,k+=n*Z,C+=n*Y,P+=n*X,B+=n*Q,b+=(n=e[13])*x,v+=n*L,w+=n*U,_+=n*j,E+=n*K,S+=n*F,I+=n*V,A+=n*q,M+=n*z,T+=n*H,R+=n*G,k+=n*W,C+=n*Z,P+=n*Y,B+=n*X,O+=n*Q,v+=(n=e[14])*x,w+=n*L,_+=n*U,E+=n*j,S+=n*K,I+=n*F,A+=n*V,M+=n*q,T+=n*z,R+=n*H,k+=n*G,C+=n*W,P+=n*Z,B+=n*Y,O+=n*X,N+=n*Q,w+=(n=e[15])*x,s+=38*(E+=n*U),a+=38*(S+=n*j),u+=38*(I+=n*K),c+=38*(A+=n*F),l+=38*(M+=n*V),h+=38*(T+=n*q),f+=38*(R+=n*z),d+=38*(k+=n*H),p+=38*(C+=n*G),y+=38*(P+=n*W),g+=38*(B+=n*Z),m+=38*(O+=n*Y),b+=38*(N+=n*X),v+=38*(D+=n*Q),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=u,t[4]=c,t[5]=l,t[6]=h,t[7]=f,t[8]=d,t[9]=p,t[10]=y,t[11]=g,t[12]=m,t[13]=b,t[14]=v,t[15]=w}function d(t,e){f(t,e,e)}function p(t,e){for(var r=new Uint8Array(32),n=new Float64Array(80),i=o(),s=o(),p=o(),y=o(),g=o(),m=o(),b=0;b<31;b++)r[b]=t[b];r[31]=127&t[31]|64,r[0]&=248,function(t,e){for(var r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(n,e);for(b=0;b<16;b++)s[b]=n[b];i[0]=y[0]=1;for(b=254;b>=0;--b){var v=r[b>>>3]>>>(7&b)&1;c(i,s,v),c(p,y,v),l(g,i,p),h(i,i,p),l(p,s,y),h(s,s,y),d(y,g),d(m,i),f(i,p,i),f(p,s,g),l(g,i,p),h(i,i,p),d(s,i),h(p,y,m),f(i,p,a),l(i,i,y),f(p,p,i),f(i,y,m),f(y,s,n),d(s,g),c(i,s,v),c(p,y,v)}for(b=0;b<16;b++)n[b+16]=i[b],n[b+32]=p[b],n[b+48]=s[b],n[b+64]=y[b];var w=n.subarray(32),_=n.subarray(16);!function(t,e){for(var r=o(),n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)d(r,r),2!==n&&4!==n&&f(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}(w,w),f(_,_,w);var E=new Uint8Array(32);return function(t,e){for(var r=o(),n=o(),i=0;i<16;i++)n[i]=e[i];u(n),u(n),u(n);for(var s=0;s<2;s++){for(r[0]=n[0]-65517,i=1;i<15;i++)r[i]=n[i]-65535-(r[i-1]>>16&1),r[i-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);var a=r[15]>>16&1;r[14]&=65535,c(n,r,1-a)}for(i=0;i<16;i++)t[2*i]=255&n[i],t[2*i+1]=n[i]>>8}(E,_),E}function y(t){return p(t,s)}function g(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+e.SECRET_KEY_LENGTH+" bytes");var r=new Uint8Array(t);return{publicKey:y(r),secretKey:r}}e.scalarMult=p,e.scalarMultBase=y,e.generateKeyPairFromSeed=g,e.generateKeyPair=function(t){var e=n.randomBytes(32,t),r=g(e);return i.wipe(e),r},e.sharedKey=function(t,r,n){if(void 0===n&&(n=!1),t.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(r.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var i=p(t,r);if(n){for(var o=0,s=0;s<i.length;s++)o|=i[s];if(0===o)throw new Error("X25519: invalid shared key")}return i}},56755:(t,e)=>{"use strict";const r=Math.exp;t.exports=function(t){if("number"!==typeof t)throw new Error("must provide a timespan to the moving average constructor");if(t<=0)throw new Error("must provide a timespan > 0 to the moving average constructor");let e,n,i=0,o=0,s=0,a={};return a.push=function(a,u){if(n){const c=1-r(-(a-n)/t),l=u-e;e=c*u+(1-c)*e,i=(1-c)*(i+l*(c*l)),o=Math.sqrt(i),s=e+c*l}else e=u;n=a},a.movingAverage=function(){return e},a.variance=function(){return i},a.deviation=function(){return o},a.forecast=function(){return s},a}},67418:t=>{t.exports=class extends Error{constructor(t,e){super(t||"The operation was aborted"),this.type="aborted",this.code=e||"ABORT_ERR"}}},64183:(t,e,r)=>{const n=r(38295),i=r(67418),o=(t,e,r)=>s(t,Array.isArray(e)?e:[{signal:e,options:r}]),s=(t,e)=>(t=n(t),e=e.map((t=>{let{signal:e,options:r}=t;return{signal:e,options:r||{}}})),async function*(){let r;const n=()=>{r&&r()};for(const{signal:t}of e)t.addEventListener("abort",n);for(;;){let s;try{for(const{signal:t,options:r}of e)if(t.aborted){const{abortMessage:t,abortCode:e}=r;throw new i(t,e)}const n=new Promise(((t,n)=>{r=()=>{const{options:t}=e.find((t=>{let{signal:e}=t;return e.aborted})),{abortMessage:r,abortCode:o}=t;n(new i(r,o))}}));s=await Promise.race([n,t.next()]),r=null}catch(o){for(const{signal:t}of e)t.removeEventListener("abort",n);const r=e.find((t=>{let{signal:e}=t;return e.aborted})),i="aborted"===o.type&&r;if(i&&r.options.onAbort&&await r.options.onAbort(t),"function"===typeof t.return)try{const e=t.return();e instanceof Promise&&e.catch((t=>{null!=r.options.onReturnError&&r.options.onReturnError(t)}))}catch(o){null!=r.options.onReturnError&&r.options.onReturnError(o)}if(i&&r.options.returnOnAbort)return;throw o}if(s.done)break;yield s.value}for(const{signal:t}of e)t.removeEventListener("abort",n)}()),a=(t,e,r)=>u(t,Array.isArray(e)?e:[{signal:e,options:r}]),u=(t,e)=>r=>t(s(r,e)),c=(t,e)=>({sink:u(t.sink,e),source:s(t.source,e)});t.exports=o,t.exports.AbortError=i,t.exports.source=o,t.exports.sink=a,t.exports.transform=a,t.exports.duplex=(t,e,r)=>c(t,Array.isArray(e)?e:[{signal:e,options:r}])},64928:(t,e,r)=>{"use strict";const n=r(67263),i=r(75235);class o extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError("Expected input to be an Array, got ".concat(typeof t));let e=(t=[...t].map((t=>t instanceof Error?t:null!==t&&"object"===typeof t?Object.assign(new Error(t.message),t):new Error(t)))).map((t=>"string"===typeof t.stack?i(t.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(t))).join("\n");e="\n"+n(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}}t.exports=o},66622:t=>{function e(t){const e=new globalThis.AbortController;function r(){e.abort();for(const e of t)e&&e.removeEventListener&&e.removeEventListener("abort",r)}for(const n of t)if(n&&n.addEventListener){if(n.aborted){r();break}n.addEventListener("abort",r)}return e.signal}t.exports=e,t.exports.anySignal=e},16522:(t,e,r)=>{"use strict";const n=e;n.bignum=r(87664),n.define=r(88199).define,n.base=r(68222),n.constants=r(43062),n.decoders=r(4023),n.encoders=r(37407)},88199:(t,e,r)=>{"use strict";const n=r(37407),i=r(4023),o=r(12534);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},90357:(t,e,r)=>{"use strict";const n=r(12534),i=r(92382).b,o=r(39138).Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"===typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"===typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),e.C=s,s.isDecoderBuffer=function(t){if(t instanceof s)return!0;return"object"===typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"===typeof t.offset&&"number"===typeof t.length&&"function"===typeof t.save&&"function"===typeof t.restore&&"function"===typeof t.isEmpty&&"function"===typeof t.readUInt8&&"function"===typeof t.skip&&"function"===typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){const e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){if(t instanceof a)return!0;return"object"===typeof t&&"EncoderBuffer"===t.constructor.name&&"number"===typeof t.length&&"function"===typeof t.join},a.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"===typeof this.value?t[e]=this.value:"string"===typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},68222:(t,e,r)=>{"use strict";const n=e;n.Reporter=r(92382).b,n.DecoderBuffer=r(90357).C,n.EncoderBuffer=r(90357).R,n.Node=r(32319)},32319:(t,e,r)=>{"use strict";const n=r(92382).b,i=r(90357).R,o=r(90357).C,s=r(72325),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function c(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=c;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const t=this._baseState,e={};l.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},c.prototype._wrap=function(){const t=this._baseState;u.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},c.prototype._init=function(t){const e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){c.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){c.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),c.prototype.use=function(t){s(t);const e=this._baseState;return s(null===e.use),e.use=t,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(t){const e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},c.prototype.explicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},c.prototype.implicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},c.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},c.prototype.key=function(t){const e=this._baseState;return s(null===e.key),e.key=t,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(t){const e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},c.prototype.contains=function(t){const e=this._baseState;return s(null===e.use),e.contains=t,this},c.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(t,n,r.any),t.isError(s))return s}else{const n=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(u){s=!1}t.restore(n)}}if(r.obj&&s&&(n=t.enterObject()),s){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const n=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const n=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(n))return n;r.any?i=t.raw(e):t=n}if(e&&e.track&&null!==r.tag&&e.track(t.path(),n,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(n,e)}}return r.obj&&s&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},c.prototype._decodeGeneric=function(t,e,r){const n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},c.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(t,e){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=t.save(),a=r.choice[o];try{const r=a._decode(t,e);if(t.isError(r))return!1;n={type:o,value:r},i=!0}catch(u){return t.restore(s),!1}return!0}),this),i?n:t.error("Choice not matched")},c.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},c.prototype._encode=function(t,e,r){const n=this._baseState;if(null!==n.default&&n.default===t)return;const i=this._encodeValue(t,e,r);return void 0===i||this._skipDefault(i,e,r)?void 0:i},c.prototype._encodeValue=function(t,e,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);let o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)s=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const n=e.enterKey(r._baseState.key);if("object"!==typeof t)return e.error("Child expected, but input is not object");const i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){const n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(s=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){const t=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===t?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(t,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(t,e){const r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},c.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},c.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},c.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},92382:(t,e,r)=>{"use strict";const n=r(12534);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){const n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){let e;const r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},38266:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},43062:(t,e,r)=>{"use strict";const n=e;n._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e},n.der=r(38266)},92650:(t,e,r)=>{"use strict";const n=r(12534),i=r(87664),o=r(90357).C,s=r(32319),a=r(38266);function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new c,this.tree._init(t.body)}function c(t){s.call(this,"der",t)}function l(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const n=a.tagClass[r>>6],i=0===(32&r);if(31===(31&r)){let n=r;for(r=0;128===(128&n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function h(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0===(128&n))return n;const i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(let o=0;o<i;o++){n<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;n|=e}return n}t.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},n(c,s),c.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const n=t.save(),i=l(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},c.prototype._decodeTag=function(t,e,r){const n=l(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;let i=h(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},c.prototype._skipUntilEnd=function(t,e){for(;;){const r=l(t,e);if(t.isError(r))return r;const n=h(t,r.primitive,e);if(t.isError(n))return n;let i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},c.prototype._decodeList=function(t,e,r,n){const i=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=r.decode(t,"der",n);if(t.isError(o)&&e)break;i.push(o)}return i},c.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2===1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},c.prototype._decodeObjid=function(t,e,r){let n;const i=[];let o=0,s=0;for(;!t.isEmpty();)s=t.readUInt8(),o<<=7,o|=127&s,0===(128&s)&&(i.push(o),o=0);128&s&&i.push(o);const a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),e){let t=e[n.join(" ")];void 0===t&&(t=e[n.join(".")]),void 0!==t&&(n=t)}return n},c.prototype._decodeTime=function(t,e){const r=t.raw().toString();let n,i,o,s,a,u;if("gentime"===e)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},c.prototype._decodeInt=function(t,e){const r=t.raw();let n=new i(r);return e&&(n=e[n.toString(10)]||n),n},c.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getDecoder("der").tree}},4023:(t,e,r)=>{"use strict";const n=e;n.der=r(92650),n.pem=r(56282)},56282:(t,e,r)=>{"use strict";const n=r(12534),i=r(39138).Buffer,o=r(92650);function s(t){o.call(this,t),this.enc="pem"}n(s,o),t.exports=s,s.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let i=0;i<r.length;i++){const t=r[i].match(s);if(null!==t&&t[2]===n){if(-1!==a){if("END"!==t[1])break;u=i;break}if("BEGIN"!==t[1])break;a=i}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(a+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const l=i.from(c,"base64");return o.prototype.decode.call(this,l,e)}},22627:(t,e,r)=>{"use strict";const n=r(12534),i=r(39138).Buffer,o=r(32319),s=r(38266);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function c(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){const o=function(t,e,r,n){let i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!==typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6,i}(t,e,r,this.reporter);if(n.length<128){const t=i.alloc(2);return t[0]=o,t[1]=n.length,this._createEncoderBuffer([t,n])}let a=1;for(let i=n.length;i>=256;i>>=8)a++;const u=i.alloc(2+a);u[0]=o,u[1]=128|a;for(let i=1+a,s=n.length;s>0;i--,s>>=8)u[i]=255&s;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=i.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"===typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let n=0;for(let i=0;i<t.length;i++){let e=t[i];for(n++;e>=128;e>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let i=t.length-1;i>=0;i--){let e=t[i];for(o[s--]=127&e;(e>>=7)>0;)o[s--]=128|127&e}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(t,e){let r;const n=new Date(t);return"gentime"===e?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=i.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let i=t;i>=256;i>>=8)r++;const n=new Array(r);for(let i=n.length-1;i>=0;i--)n[i]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},37407:(t,e,r)=>{"use strict";const n=e;n.der=r(22627),n.pem=r(78540)},78540:(t,e,r)=>{"use strict";const n=r(12534),i=r(22627);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){const r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"];for(let i=0;i<r.length;i+=64)n.push(r.slice(i,i+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},87664:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(80950).Buffer}catch(A){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):y(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new I(t)},i(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},88093:(t,e,r)=>{"use strict";var n=r(21964);function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o,s,a=r(53372).codes,u=a.ERR_AMBIGUOUS_ARGUMENT,c=a.ERR_INVALID_ARG_TYPE,l=a.ERR_INVALID_ARG_VALUE,h=a.ERR_INVALID_RETURN_VALUE,f=a.ERR_MISSING_ARGS,d=r(24945),p=r(49639).inspect,y=r(49639).types,g=y.isPromise,m=y.isRegExp,b=Object.assign?Object.assign:r(50887).assign,v=Object.is?Object.is:r(33454);new Map;function w(){var t=r(46912);o=t.isDeepEqual,s=t.isDeepStrictEqual}var _=!1,E=t.exports=M,S={};function I(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function A(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function M(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];A.apply(void 0,[M,e.length].concat(e))}E.fail=function t(e,r,i,o,s){var a,u=arguments.length;if(0===u)a="Failed";else if(1===u)i=e,e=void 0;else{if(!1===_){_=!0;var c=n.emitWarning?n.emitWarning:console.warn.bind(console);c("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===u&&(o="!=")}if(i instanceof Error)throw i;var l={actual:e,expected:r,operator:void 0===o?"fail":o,stackStartFn:s||t};void 0!==i&&(l.message=i);var h=new d(l);throw a&&(h.message=a,h.generatedMessage=!0),h},E.AssertionError=d,E.ok=M,E.equal=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");e!=r&&I({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},E.notEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");e==r&&I({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},E.deepEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w(),o(e,r)||I({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},E.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w(),o(e,r)&&I({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},E.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w(),s(e,r)||I({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},E.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w();s(e,r)&&I({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},E.strictEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");v(e,r)||I({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},E.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new f("actual","expected");v(e,r)&&I({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var T=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"===typeof n[t]&&m(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function R(t,e,r,n,i,o){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new T(t,i),u=new T(e,i,t),c=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=t,c.expected=e,c.operator=o.name,c}I({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}function k(t,e,r,n){if("function"!==typeof e){if(m(e))return e.test(t);if(2===arguments.length)throw new c("expected",["Function","RegExp"],e);if("object"!==i(t)||null===t){var s=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw s.operator=n.name,s}var a=Object.keys(e);if(e instanceof Error)a.push("name","message");else if(0===a.length)throw new l("error",e,"may not be an empty object");return void 0===o&&w(),a.forEach((function(i){"string"===typeof t[i]&&m(e[i])&&e[i].test(t[i])||R(t,e,i,r,a,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function C(t){if("function"!==typeof t)throw new c("fn","Function",t);try{t()}catch(e){return e}return S}function P(t){return g(t)||null!==t&&"object"===i(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function B(t){return Promise.resolve().then((function(){var e;if("function"===typeof t){if(!P(e=t()))throw new h("instance of Promise","promiseFn",e)}else{if(!P(t))throw new c("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return S})).catch((function(t){return t}))}))}function O(t,e,r,n){if("string"===typeof r){if(4===arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===i(e)&&null!==e){if(e.message===r)throw new u("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new u("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!==typeof r)throw new c("error",["Object","Error","Function","RegExp"],r);if(e===S){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var s="rejects"===t.name?"rejection":"exception";I({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(s).concat(o),stackStartFn:t})}if(r&&!k(e,r,n,t))throw e}function N(t,e,r,n){if(e!==S){if("string"===typeof r&&(n=r,r=void 0),!r||k(e,r)){var i=n?": ".concat(n):".",o="doesNotReject"===t.name?"rejection":"exception";I({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function D(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];A.apply(void 0,[D,e.length].concat(e))}E.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];O.apply(void 0,[t,C(e)].concat(n))},E.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return B(e).then((function(e){return O.apply(void 0,[t,e].concat(n))}))},E.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];N.apply(void 0,[t,C(e)].concat(n))},E.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return B(e).then((function(e){return N.apply(void 0,[t,e].concat(n))}))},E.ifError=function t(e){if(null!==e&&void 0!==e){var r="ifError got unwanted exception: ";"object"===i(e)&&"string"===typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=p(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),o=e.stack;if("string"===typeof o){var s=o.split("\n");s.shift();for(var a=n.stack.split("\n"),u=0;u<s.length;u++){var c=a.indexOf(s[u]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},E.strict=b(D,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict},24945:(t,e,r)=>{"use strict";var n=r(21964);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return!e||"object"!==d(e)&&"function"!==typeof e?a(t):e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"===typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)},u(t)}function c(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t,e,r){return l=c()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&h(i,r.prototype),i},l.apply(null,arguments)}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function d(t){return d="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}var p=r(49639).inspect,y=r(53372).codes.ERR_INVALID_ARG_TYPE;function g(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var m="",b="",v="",w="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function S(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function I(t,e,r){var i="",o="",s=0,a="",u=!1,c=S(t),l=c.split("\n"),h=S(e).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===d(t)&&"object"===d(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var y=l[0].length+h[0].length;if(y<=10){if(("object"!==d(t)||null===t)&&("object"!==d(e)||null===e)&&(0!==t||0!==e))return"".concat(_[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r){if(y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][f]===h[0][f];)f++;f>2&&(p="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",f),"^"),f=0)}}}for(var E=l[l.length-1],I=h[h.length-1];E===I&&(f++<2?a="\n ".concat(E).concat(a):i=E,l.pop(),h.pop(),0!==l.length&&0!==h.length);)E=l[l.length-1],I=h[h.length-1];var A=Math.max(l.length,h.length);if(0===A){var M=c.split("\n");if(M.length>30)for(M[26]="".concat(m,"...").concat(w);M.length>27;)M.pop();return"".concat(_.notIdentical,"\n\n").concat(M.join("\n"),"\n")}f>3&&(a="\n".concat(m,"...").concat(w).concat(a),u=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var T=0,R=_[r]+"\n".concat(b,"+ actual").concat(w," ").concat(v,"- expected").concat(w),k=" ".concat(m,"...").concat(w," Lines skipped");for(f=0;f<A;f++){var C=f-s;if(l.length<f+1)C>1&&f>2&&(C>4?(o+="\n".concat(m,"...").concat(w),u=!0):C>3&&(o+="\n ".concat(h[f-2]),T++),o+="\n ".concat(h[f-1]),T++),s=f,i+="\n".concat(v,"-").concat(w," ").concat(h[f]),T++;else if(h.length<f+1)C>1&&f>2&&(C>4?(o+="\n".concat(m,"...").concat(w),u=!0):C>3&&(o+="\n ".concat(l[f-2]),T++),o+="\n ".concat(l[f-1]),T++),s=f,o+="\n".concat(b,"+").concat(w," ").concat(l[f]),T++;else{var P=h[f],B=l[f],O=B!==P&&(!g(B,",")||B.slice(0,-1)!==P);O&&g(P,",")&&P.slice(0,-1)===B&&(O=!1,B+=","),O?(C>1&&f>2&&(C>4?(o+="\n".concat(m,"...").concat(w),u=!0):C>3&&(o+="\n ".concat(l[f-2]),T++),o+="\n ".concat(l[f-1]),T++),s=f,o+="\n".concat(b,"+").concat(w," ").concat(B),i+="\n".concat(v,"-").concat(w," ").concat(P),T+=2):(o+=i,i="",1!==C&&0!==f||(o+="\n ".concat(B),T++))}if(T>20&&f<A-2)return"".concat(R).concat(k,"\n").concat(o,"\n").concat(m,"...").concat(w).concat(i,"\n")+"".concat(m,"...").concat(w)}return"".concat(R).concat(u?k:"","\n").concat(o).concat(i).concat(a).concat(p)}var A=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==d(t)||null===t)throw new y("options","Object",t);var i=t.message,o=t.operator,u=t.stackStartFn,c=t.actual,l=t.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,f(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="\x1b[34m",b="\x1b[32m",w="\x1b[39m",v="\x1b[31m"):(m="",b="",w="",v="")),"object"===d(c)&&null!==c&&"object"===d(l)&&null!==l&&"stack"in c&&c instanceof Error&&"stack"in l&&l instanceof Error&&(c=E(c),l=E(l)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,f(e).call(this,I(c,l,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=_[o],g=S(c).split("\n");if("notStrictEqual"===o&&"object"===d(c)&&null!==c&&(p=_.notStrictEqualObject),g.length>30)for(g[26]="".concat(m,"...").concat(w);g.length>27;)g.pop();r=1===g.length?s(this,f(e).call(this,"".concat(p," ").concat(g[0]))):s(this,f(e).call(this,"".concat(p,"\n\n").concat(g.join("\n"),"\n")))}else{var A=S(c),M="",T=_[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(_[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(M="".concat(S(l)),A.length>512&&(A="".concat(A.slice(0,509),"...")),M.length>512&&(M="".concat(M.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(T,"\n\n").concat(A,"\n\nshould equal\n\n"):M=" ".concat(o," ").concat(M)),r=s(this,f(e).call(this,"".concat(A).concat(M)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),u),r.stack,r.name="AssertionError",s(r)}var r,u,c;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(e,t),r=e,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],u&&o(r.prototype,u),c&&o(r,c),e}(u(Error));t.exports=A},53372:(t,e,r)=>{"use strict";function n(t){return n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return!e||"object"!==n(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}var a,u,c={};function l(t,e,r){r||(r=Error);var n=function(r){function n(r,s,a){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),u=i(this,o(n).call(this,function(t,r,n){return"string"===typeof e?e:e(t,r,n)}(r,s,a))),u.code=t,u}return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(n,r),n}(r);c[t]=n}function h(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,s,u,c;if(void 0===a&&(a=r(88093)),a("string"===typeof t,"'name' must be a string"),"string"===typeof e&&(s="not ",e.substr(!u||u<0?0:+u,s.length)===s)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))c="The ".concat(t," ").concat(o," ").concat(h(e,"type"));else{var l=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";c='The "'.concat(t,'" ').concat(l," ").concat(o," ").concat(h(e,"type"))}return c+=". Received type ".concat(n(i))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(49639));var i=u.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===a&&(a=r(88093)),a(e.length>0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=c},46912:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(u){i=!0,o=u}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=void 0!==/a/g.flags,s=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},a=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(33454),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(6188);function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),p=h(Object.prototype.toString),y=r(49639).types,g=y.isAnyArrayBuffer,m=y.isArrayBufferView,b=y.isDate,v=y.isMap,w=y.isRegExp,_=y.isSet,E=y.isNativeError,S=y.isBoxedPrimitive,I=y.isNumberObject,A=y.isStringObject,M=y.isBooleanObject,T=y.isBigIntObject,R=y.isSymbolObject,k=y.isFloat32Array,C=y.isFloat64Array;function P(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function B(t){return Object.keys(t).filter(P).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function O(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function N(t,e,r,n){if(t===e)return 0!==t||(!r||u(t,e));if(r){if("object"!==i(t))return"number"===typeof t&&l(t)&&l(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var s,a,c,h,f=p(t);if(f!==p(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var d=B(t),y=B(e);return d.length===y.length&&x(t,e,r,n,1,d)}if("[object Object]"===f&&(!v(t)&&v(e)||!_(t)&&_(e)))return!1;if(b(t)){if(!b(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(c=t,h=e,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(E(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(m(t)){if(r||!k(t)&&!C(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===O(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var P=B(t),N=B(e);return P.length===N.length&&x(t,e,r,n,0,P)}if(_(t))return!(!_(e)||t.size!==e.size)&&x(t,e,r,n,2);if(v(t))return!(!v(e)||t.size!==e.size)&&x(t,e,r,n,3);if(g(t)){if(a=e,(s=t).byteLength!==a.byteLength||0!==O(new Uint8Array(s),new Uint8Array(a)))return!1}else if(S(t)&&!function(t,e){return I(t)?I(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):M(t)?M(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):T(t)?T(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):R(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return x(t,e,r,n,0)}function D(t,e){return e.filter((function(e){return d(t,e)}))}function x(t,e,r,n,i,o){if(5===arguments.length){o=Object.keys(t);var s=Object.keys(e);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!f(e,o[a]))return!1;if(r&&5===arguments.length){var u=c(t);if(0!==u.length){var l=0;for(a=0;a<u.length;a++){var h=u[a];if(d(t,h)){if(!d(e,h))return!1;o.push(h),l++}else if(d(e,h))return!1}var p=c(e);if(u.length!==p.length&&D(e,p).length!==l)return!1}else{var y=c(e);if(0!==y.length&&0!==D(e,y).length)return!1}}if(0===o.length&&(0===i||1===i&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var g=n.val1.get(t);if(void 0!==g){var m=n.val2.get(e);if(void 0!==m)return g===m}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var b=V(t,e,r,o,n,i);return n.val1.delete(t),n.val2.delete(e),b}function L(t,e,r,n){for(var i=s(t),o=0;o<i.length;o++){var a=i[o];if(N(e,a,r,n))return t.delete(a),!0}return!1}function U(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function j(t,e,r){var n=U(r);return null!=n?n:e.has(n)&&!t.has(n)}function K(t,e,r,n,i){var o=U(r);if(null!=o)return o;var s=e.get(o);return!(void 0===s&&!e.has(o)||!N(n,s,!1,i))&&(!t.has(o)&&N(n,s,!1,i))}function F(t,e,r,n,i,o){for(var a=s(t),u=0;u<a.length;u++){var c=a[u];if(N(r,c,i,o)&&N(n,e.get(c),i,o))return t.delete(c),!0}return!1}function V(t,e,r,o,u,c){var l=0;if(2===c){if(!function(t,e,r,n){for(var o=null,a=s(t),u=0;u<a.length;u++){var c=a[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!e.has(c)){if(r)return!1;if(!j(t,e,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=s(e),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!L(o,f,r,n))return!1}else if(!r&&!t.has(f)&&!L(o,f,r,n))return!1}return 0===o.size}return!0}(t,e,r,u))return!1}else if(3===c){if(!function(t,e,r,o){for(var s=null,u=a(t),c=0;c<u.length;c++){var l=n(u[c],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===s&&(s=new Set),s.add(h);else{var d=e.get(h);if(void 0===d&&!e.has(h)||!N(f,d,r,o)){if(r)return!1;if(!K(t,e,h,f,o))return!1;null===s&&(s=new Set),s.add(h)}}}if(null!==s){for(var p=a(e),y=0;y<p.length;y++){var g=n(p[y],2),m=(h=g[0],g[1]);if("object"===i(h)&&null!==h){if(!F(s,t,h,m,r,o))return!1}else if(!r&&(!t.has(h)||!N(t.get(h),m,!1,o))&&!F(s,t,h,m,!1,o))return!1}return 0===s.size}return!0}(t,e,r,u))return!1}else if(1===c)for(;l<t.length;l++){if(!f(t,l)){if(f(e,l))return!1;for(var h=Object.keys(t);l<h.length;l++){var d=h[l];if(!f(e,d)||!N(t[d],e[d],r,u))return!1}return h.length===Object.keys(e).length}if(!f(e,l)||!N(t[l],e[l],r,u))return!1}for(l=0;l<o.length;l++){var p=o[l];if(!N(t[p],e[p],r,u))return!1}return!0}t.exports={isDeepEqual:function(t,e){return N(t,e,false)},isDeepStrictEqual:function(t,e){return N(t,e,true)}}},2009:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},17144:function(t,e,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",h=1e14,f=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(t){var e=0|t;return t>0||t===e?e:e-1}function b(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(e=t[n++]+"",r=f-e.length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(t,e){var r,n,i=t.c,o=e.c,s=t.s,a=e.s,u=t.e,c=e.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(t,e,r,n){if(t<e||t>r||t!==u(t))throw Error(c+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _(t){var e=t.c.length-1;return m(t.e/f)==e&&t.c[e]%2!=0}function E(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function S(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}o=function t(e){var r,n,i,o=L.prototype={constructor:L,toString:null,valueOf:null},I=new L(1),A=20,M=4,T=-7,R=21,k=-1e7,C=1e7,P=!1,B=1,O=0,N={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},D="0123456789abcdefghijklmnopqrstuvwxyz",x=!0;function L(t,e){var r,o,a,c,h,p,y,g,m=this;if(!(m instanceof L))return new L(t,e);if(null==e){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>C?m.c=m.e=null:t.e<k?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,h=t;h>=10;h/=10,c++);return void(c>C?m.c=m.e=null:(m.e=c,m.c=[t]))}g=String(t)}else{if(!s.test(g=String(t)))return i(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(h=g.search(/e/i))>0?(c<0&&(c=h),c+=+g.slice(h+1),g=g.substring(0,h)):c<0&&(c=g.length)}else{if(w(e,2,D.length,"Base"),10==e&&x)return F(m=new L(t),A+m.e+1,M);if(g=String(t),p="number"==typeof t){if(0*t!=0)return i(m,g,p,e);if(m.s=1/t<0?(g=g.slice(1),-1):1,L.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+t)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=D.slice(0,e),c=h=0,y=g.length;h<y;h++)if(r.indexOf(o=g.charAt(h))<0){if("."==o){if(h>c){c=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,h=-1,c=0;continue}return i(m,String(t),p,e)}p=!1,(c=(g=n(g,e,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(h=0;48===g.charCodeAt(h);h++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(h,++y)){if(y-=h,p&&L.DEBUG&&y>15&&(t>d||t!==u(t)))throw Error(l+m.s*t);if((c=c-h-1)>C)m.c=m.e=null;else if(c<k)m.c=[m.e=0];else{if(m.e=c,m.c=[],h=(c+1)%f,c<0&&(h+=f),h<y){for(h&&m.c.push(+g.slice(0,h)),y-=f;h<y;)m.c.push(+g.slice(h,h+=f));h=f-(g=g.slice(h)).length}else h-=y;for(;h--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function U(t,e,r,n){var i,o,s,a,u;if(null==r?r=M:w(r,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)u=b(t.c),u=1==n||2==n&&(s<=T||s>=R)?E(u,s):S(u,s,"0");else if(o=(t=F(new L(t),e,r)).e,a=(u=b(t.c)).length,1==n||2==n&&(e<=o||o<=T)){for(;a<e;u+="0",a++);u=E(u,o)}else if(e-=s,u=S(u,o,"0"),o+1>a){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-a)>0)for(o+1==a&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function j(t,e){for(var r,n=1,i=new L(t[0]);n<t.length;n++){if(!(r=new L(t[n])).s){i=r;break}e.call(i,r)&&(i=r)}return i}function K(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+r*f-1)>C?t.c=t.e=null:r<k?t.c=[t.e=0]:(t.e=r,t.c=e),t}function F(t,e,r,n){var i,o,s,c,l,d,y,g=t.c,m=p;if(g){t:{for(i=1,c=g[0];c>=10;c/=10,i++);if((o=e-i)<0)o+=f,s=e,y=(l=g[d=0])/m[i-s-1]%10|0;else if((d=a((o+1)/f))>=g.length){if(!n)break t;for(;g.length<=d;g.push(0));l=y=0,i=1,s=(o%=f)-f+1}else{for(l=c=g[d],i=1;c>=10;c/=10,i++);y=(s=(o%=f)-f+i)<0?0:l/m[i-s-1]%10|0}if(n=n||e<0||null!=g[d+1]||(s<0?l:l%m[i-s-1]),n=r<4?(y||n)&&(0==r||r==(t.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(o>0?s>0?l/m[i-s]:0:g[d-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=m[(f-e%f)%f],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=d,c=1,d--):(g.length=d+1,c=m[f-o],g[d]=s>0?u(l/m[i-s]%m[s])*c:0),n)for(;;){if(0==d){for(o=1,s=g[0];s>=10;s/=10,o++);for(s=g[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(t.e++,g[0]==h&&(g[0]=1));break}if(g[d]+=c,g[d]!=h)break;g[d--]=0,c=1}for(o=g.length;0===g[--o];g.pop());}t.e>C?t.c=t.e=null:t.e<k&&(t.c=[t.e=0])}return t}function V(t){var e,r=t.e;return null===r?t.toString():(e=b(t.c),e=r<=T||r>=R?E(e,r):S(e,r,"0"),t.s<0?"-"+e:e)}return L.clone=t,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(c+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,g,e),A=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),M=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(w(r[0],-g,0,e),w(r[1],0,g,e),T=r[0],R=r[1]):(w(r,-g,g,e),T=-(R=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)w(r[0],-g,-1,e),w(r[1],1,g,e),k=r[0],C=r[1];else{if(w(r,-g,g,e),!r)throw Error(c+e+" cannot be zero: "+r);k=-(C=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(c+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(c+"crypto unavailable");P=r}else P=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),B=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,g,e),O=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(c+e+" not an object: "+r);N=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+e+" invalid: "+r);x="0123456789"==r.slice(0,10),D=r}}return{DECIMAL_PLACES:A,ROUNDING_MODE:M,EXPONENTIAL_AT:[T,R],RANGE:[k,C],CRYPTO:P,MODULO_MODE:B,POW_PRECISION:O,FORMAT:N,ALPHABET:D}},L.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!L.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%f)<1&&(e+=f),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=h||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+t)},L.maximum=L.max=function(){return j(arguments,o.lt)},L.minimum=L.min=function(){return j(arguments,o.gt)},L.random=function(){var t=9007199254740992,e=Math.random()*t&2097151?function(){return u(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,n,i,o,s,l=0,h=[],d=new L(I);if(null==t?t=A:w(t,0,g),o=a(t/f),P)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(o*=2));l<o;)(s=131072*r[l]+(r[l+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[l]=n[0],r[l+1]=n[1]):(h.push(s%1e14),l+=2);l=o/2}else{if(!crypto.randomBytes)throw P=!1,Error(c+"crypto unavailable");for(r=crypto.randomBytes(o*=7);l<o;)(s=281474976710656*(31&r[l])+1099511627776*r[l+1]+4294967296*r[l+2]+16777216*r[l+3]+(r[l+4]<<16)+(r[l+5]<<8)+r[l+6])>=9e15?crypto.randomBytes(7).copy(r,l):(h.push(s%1e14),l+=7);l=o/7}if(!P)for(;l<o;)(s=e())<9e15&&(h[l++]=s%1e14);for(o=h[--l],t%=f,o&&t&&(s=p[f-t],h[l]=u(o/s)*s);0===h[l];h.pop(),l--);if(l<0)h=[i=0];else{for(i=-1;0===h[0];h.splice(0,1),i-=f);for(l=1,s=h[0];s>=10;s/=10,l++);l<f&&(i-=f-l)}return d.e=i,d.c=h,d}}(),L.sum=function(){for(var t=1,e=arguments,r=new L(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){var t="0123456789";function e(t,e,r,n){for(var i,o,s=[0],a=0,u=t.length;a<u;){for(o=s.length;o--;s[o]*=e);for(s[0]+=n.indexOf(t.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,l,h,f,d,p,y,g=n.indexOf("."),m=A,v=M;for(g>=0&&(h=O,O=0,n=n.replace(".",""),d=(y=new L(i)).pow(n.length-g),O=h,y.c=e(S(b(d.c),d.e,"0"),10,o,t),y.e=y.c.length),l=h=(p=e(n,i,o,a?(u=D,t):(u=t,D))).length;0==p[--h];p.pop());if(!p[0])return u.charAt(0);if(g<0?--l:(d.c=p,d.e=l,d.s=s,p=(d=r(d,y,m,v,o)).c,f=d.r,l=d.e),g=p[c=l+m+1],h=o/2,f=f||c<0||null!=p[c+1],f=v<4?(null!=g||f)&&(0==v||v==(d.s<0?3:2)):g>h||g==h&&(4==v||f||6==v&&1&p[c-1]||v==(d.s<0?8:7)),c<1||!p[0])n=f?S(u.charAt(1),-m,u.charAt(0)):u.charAt(0);else{if(p.length=c,f)for(--o;++p[--c]>o;)p[c]=0,c||(++l,p=[1].concat(p));for(h=p.length;!p[--h];);for(g=0,n="";g<=h;n+=u.charAt(p[g++]));n=S(n,l,u.charAt(0))}return n}}(),r=function(){function t(t,e,r){var n,i,o,s,a=0,u=t.length,c=e%y,l=e/y|0;for(t=t.slice();u--;)a=((i=c*(o=t[u]%y)+(n=l*o+(s=t[u]/y|0)*c)%y*y+a)/r|0)+(n/y|0)+l*s,t[u]=i%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,i,o,s,a){var c,l,d,p,y,g,b,v,w,_,E,S,I,A,M,T,R,k=n.s==i.s?1:-1,C=n.c,P=i.c;if(!C||!C[0]||!P||!P[0])return new L(n.s&&i.s&&(C?!P||C[0]!=P[0]:P)?C&&0==C[0]||!P?0*k:k/0:NaN);for(w=(v=new L(k)).c=[],k=o+(l=n.e-i.e)+1,a||(a=h,l=m(n.e/f)-m(i.e/f),k=k/f|0),d=0;P[d]==(C[d]||0);d++);if(P[d]>(C[d]||0)&&l--,k<0)w.push(1),p=!0;else{for(A=C.length,T=P.length,d=0,k+=2,(y=u(a/(P[0]+1)))>1&&(P=t(P,y,a),C=t(C,y,a),T=P.length,A=C.length),I=T,E=(_=C.slice(0,T)).length;E<T;_[E++]=0);R=P.slice(),R=[0].concat(R),M=P[0],P[1]>=a/2&&M++;do{if(y=0,(c=e(P,_,T,E))<0){if(S=_[0],T!=E&&(S=S*a+(_[1]||0)),(y=u(S/M))>1)for(y>=a&&(y=a-1),b=(g=t(P,y,a)).length,E=_.length;1==e(g,_,b,E);)y--,r(g,T<b?R:P,b,a),b=g.length,c=1;else 0==y&&(c=y=1),b=(g=P.slice()).length;if(b<E&&(g=[0].concat(g)),r(_,g,E,a),E=_.length,-1==c)for(;e(P,_,T,E)<1;)y++,r(_,T<E?R:P,E,a),E=_.length}else 0===c&&(y++,_=[0]);w[d++]=y,_[0]?_[E++]=C[I]||0:(_=[C[I]],E=1)}while((I++<A||null!=_[0])&&k--);p=null!=_[0],w[0]||w.splice(0,1)}if(a==h){for(d=1,k=w[0];k>=10;k/=10,d++);F(v,o+(v.e=d+l*f-1)+1,s,p)}else v.e=l,v.r=+p;return v}}(),i=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,e=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,a,u){var l,h=a?s:s.replace(i,"");if(n.test(h))o.s=isNaN(h)?null:h<0?-1:1;else{if(!a&&(h=h.replace(t,(function(t,e,r){return l="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=l?t:e})),u&&(l=u,h=h.replace(e,"$1").replace(r,"0.$1")),s!=h))return new L(h,l);if(L.DEBUG)throw Error(c+"Not a"+(u?" base "+u:"")+" number: "+s);o.s=null}o.c=o.e=null}}(),o.absoluteValue=o.abs=function(){var t=new L(this);return t.s<0&&(t.s=1),t},o.comparedTo=function(t,e){return v(this,new L(t,e))},o.decimalPlaces=o.dp=function(t,e){var r,n,i,o=this;if(null!=t)return w(t,0,g),null==e?e=M:w(e,0,8),F(new L(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=((i=r.length-1)-m(this.e/f))*f,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},o.dividedBy=o.div=function(t,e){return r(this,new L(t,e),A,M)},o.dividedToIntegerBy=o.idiv=function(t,e){return r(this,new L(t,e),0,1)},o.exponentiatedBy=o.pow=function(t,e){var r,n,i,o,s,l,h,d,p=this;if((t=new L(t)).c&&!t.isInteger())throw Error(c+"Exponent not an integer: "+V(t));if(null!=e&&(e=new L(e)),s=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new L(Math.pow(+V(p),s?2-_(t):+V(t))),e?d.mod(e):d;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new L(NaN);(n=!l&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&_(t)?-0:0,p.e>-1&&(o=1/o),new L(l?1/o:o);O&&(o=a(O/f+2))}for(s?(r=new L(.5),l&&(t.s=1),h=_(t)):h=(i=Math.abs(+V(t)))%2,d=new L(I);;){if(h){if(!(d=d.times(p)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(e))}if(i){if(0===(i=u(i/2)))break;h=i%2}else if(F(t=t.times(r),t.e+1,1),t.e>14)h=_(t);else{if(0===(i=+V(t)))break;h=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}return n?d:(l&&(d=I.div(d)),e?d.mod(e):o?F(d,O,M,undefined):d)},o.integerValue=function(t){var e=new L(this);return null==t?t=M:w(t,0,8),F(e,e.e+1,t)},o.isEqualTo=o.eq=function(t,e){return 0===v(this,new L(t,e))},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(t,e){return v(this,new L(t,e))>0},o.isGreaterThanOrEqualTo=o.gte=function(t,e){return 1===(e=v(this,new L(t,e)))||0===e},o.isInteger=function(){return!!this.c&&m(this.e/f)>this.c.length-2},o.isLessThan=o.lt=function(t,e){return v(this,new L(t,e))<0},o.isLessThanOrEqualTo=o.lte=function(t,e){return-1===(e=v(this,new L(t,e)))||0===e},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&0==this.c[0]},o.minus=function(t,e){var r,n,i,o,s=this,a=s.s;if(e=(t=new L(t,e)).s,!a||!e)return new L(NaN);if(a!=e)return t.s=-e,s.plus(t);var u=s.e/f,c=t.e/f,l=s.c,d=t.c;if(!u||!c){if(!l||!d)return l?(t.s=-e,t):new L(d?s:NaN);if(!l[0]||!d[0])return d[0]?(t.s=-e,t):new L(l[0]?s:3==M?-0:0)}if(u=m(u),c=m(c),l=l.slice(),a=u-c){for((o=a<0)?(a=-a,i=l):(c=u,i=d),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(e=d.length))?a:e,a=e=0;e<n;e++)if(l[e]!=d[e]){o=l[e]<d[e];break}if(o&&(i=l,l=d,d=i,t.s=-t.s),(e=(n=d.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=h-1;n>a;){if(l[--n]<d[n]){for(r=n;r&&!l[--r];l[r]=e);--l[r],l[n]+=h}l[n]-=d[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?K(t,l,c):(t.s=3==M?-1:1,t.c=[t.e=0],t)},o.modulo=o.mod=function(t,e){var n,i,o=this;return t=new L(t,e),!o.c||!t.s||t.c&&!t.c[0]?new L(NaN):!t.c||o.c&&!o.c[0]?new L(o):(9==B?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,B),(t=o.minus(n.times(t))).c[0]||1!=B||(t.s=o.s),t)},o.multipliedBy=o.times=function(t,e){var r,n,i,o,s,a,u,c,l,d,p,g,b,v,w,_=this,E=_.c,S=(t=new L(t,e)).c;if(!E||!S||!E[0]||!S[0])return!_.s||!t.s||E&&!E[0]&&!S||S&&!S[0]&&!E?t.c=t.e=t.s=null:(t.s*=_.s,E&&S?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=m(_.e/f)+m(t.e/f),t.s*=_.s,(u=E.length)<(d=S.length)&&(b=E,E=S,S=b,i=u,u=d,d=i),i=u+d,b=[];i--;b.push(0));for(v=h,w=y,i=d;--i>=0;){for(r=0,p=S[i]%w,g=S[i]/w|0,o=i+(s=u);o>i;)r=((c=p*(c=E[--s]%w)+(a=g*c+(l=E[s]/w|0)*p)%w*w+b[o]+r)/v|0)+(a/w|0)+g*l,b[o--]=c%v;b[o]=r}return r?++n:b.splice(0,1),K(t,b,n)},o.negated=function(){var t=new L(this);return t.s=-t.s||null,t},o.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new L(t,e)).s,!i||!e)return new L(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/f,s=t.e/f,a=n.c,u=t.c;if(!o||!s){if(!a||!u)return new L(i/0);if(!a[0]||!u[0])return u[0]?t:new L(a[0]?n:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(e=u.length)<0&&(r=u,u=a,a=r,e=i),i=0;e;)i=(a[--e]=a[e]+u[e]+i)/h|0,a[e]=h===a[e]?0:a[e]%h;return i&&(a=[i].concat(a),++s),K(t,a,s)},o.precision=o.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return w(t,1,g),null==e?e=M:w(e,0,8),F(new L(o),t,e);if(!(r=o.c))return null;if(n=(i=r.length-1)*f+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},o.shiftedBy=function(t){return w(t,-9007199254740991,d),this.times("1e"+t)},o.squareRoot=o.sqrt=function(){var t,e,n,i,o,s=this,a=s.c,u=s.s,c=s.e,l=A+4,h=new L("0.5");if(1!==u||!a||!a[0])return new L(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+V(s)))||u==1/0?(((e=b(a)).length+c)%2==0&&(e+="0"),u=Math.sqrt(+e),c=m((c+1)/2)-(c<0||c%2),n=new L(e=u==1/0?"5e"+c:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new L(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=h.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,u)===(e=b(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(F(n,n.e+A+2,1),t=!n.times(n).eq(s));break}if(!i&&(F(o,o.e+A+2,0),o.times(o).eq(s))){n=o;break}l+=4,u+=4,i=1}return F(n,n.e+A+1,M,t)},o.toExponential=function(t,e){return null!=t&&(w(t,0,g),t++),U(this,t,e,1)},o.toFixed=function(t,e){return null!=t&&(w(t,0,g),t=t+this.e+1),U(this,t,e)},o.toFormat=function(t,e,r){var n,i=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=N;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(t,e),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",h=s[0],f=s[1],d=i.s<0,p=d?h.slice(1):h,y=p.length;if(u&&(o=a,a=u,u=o,y-=o),a>0&&y>0){for(o=y%a||a,h=p.substr(0,o);o<y;o+=a)h+=l+p.substr(o,a);u>0&&(h+=l+p.slice(o)),d&&(h="-"+h)}n=f?h+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):h}return(r.prefix||"")+n+(r.suffix||"")},o.toFraction=function(t){var e,n,i,o,s,a,u,l,h,d,y,g,m=this,v=m.c;if(null!=t&&(!(u=new L(t)).isInteger()&&(u.c||1!==u.s)||u.lt(I)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+V(u));if(!v)return new L(m);for(e=new L(I),h=n=new L(I),i=l=new L(I),g=b(v),s=e.e=g.length-m.e-1,e.c[0]=p[(a=s%f)<0?f+a:a],t=!t||u.comparedTo(e)>0?s>0?e:h:u,a=C,C=1/0,u=new L(g),l.c[0]=0;d=r(u,e,0,1),1!=(o=n.plus(d.times(i))).comparedTo(t);)n=i,i=o,h=l.plus(d.times(o=h)),l=o,e=u.minus(d.times(o=e)),u=o;return o=r(t.minus(n),i,0,1),l=l.plus(o.times(h)),n=n.plus(o.times(i)),l.s=h.s=m.s,y=r(h,i,s*=2,M).minus(m).abs().comparedTo(r(l,n,s,M).minus(m).abs())<1?[h,i]:[l,n],C=a,y},o.toNumber=function(){return+V(this)},o.toPrecision=function(t,e){return null!=t&&w(t,1,g),U(this,t,e,2)},o.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=T||o>=R?E(b(r.c),o):S(b(r.c),o,"0"):10===t&&x?e=S(b((r=F(new L(r),A+o+1,M)).c),r.e,"0"):(w(t,2,D.length,"Base"),e=n(S(b(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},o.valueOf=o.toJSON=function(){return V(this)},o._isBigNumber=!0,null!=e&&L.set(e),L}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},41976:(t,e,r)=>{"use strict";const{Buffer:n}=r(19778),i=Symbol.for("BufferList");function o(t){if(!(this instanceof o))return new o(t);o._init.call(this,t)}o._init=function(t){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},o.prototype._new=function(t){return new o(t)},o.prototype._offset=function(t){if(0===t)return[0,0];let e=0;for(let r=0;r<this._bufs.length;r++){const n=e+this._bufs[r].length;if(t<n||r===this._bufs.length-1)return[r,t-e];e=n}},o.prototype._reverseOffset=function(t){const e=t[0];let r=t[1];for(let n=0;n<e;n++)r+=this._bufs[n].length;return r},o.prototype.get=function(t){if(t>this.length||t<0)return;const e=this._offset(t);return this._bufs[e[0]][e[1]]},o.prototype.slice=function(t,e){return"number"===typeof t&&t<0&&(t+=this.length),"number"===typeof e&&e<0&&(e+=this.length),this.copy(null,0,t,e)},o.prototype.copy=function(t,e,r,i){if(("number"!==typeof r||r<0)&&(r=0),("number"!==typeof i||i>this.length)&&(i=this.length),r>=this.length)return t||n.alloc(0);if(i<=0)return t||n.alloc(0);const o=!!t,s=this._offset(r),a=i-r;let u=a,c=o&&e||0,l=s[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let e=0;e<this._bufs.length;e++)this._bufs[e].copy(t,c),c+=this._bufs[e].length;return t}if(u<=this._bufs[s[0]].length-l)return o?this._bufs[s[0]].copy(t,e,l,l+u):this._bufs[s[0]].slice(l,l+u);o||(t=n.allocUnsafe(a));for(let n=s[0];n<this._bufs.length;n++){const e=this._bufs[n].length-l;if(!(u>e)){this._bufs[n].copy(t,c,l,l+u),c+=e;break}this._bufs[n].copy(t,c,l),c+=e,u-=e,l&&(l=0)}return t.length>c?t.slice(0,c):t},o.prototype.shallowSlice=function(t,e){if(t=t||0,e="number"!==typeof e?this.length:e,t<0&&(t+=this.length),e<0&&(e+=this.length),t===e)return this._new();const r=this._offset(t),n=this._offset(e),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},o.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)},o.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){const t=this._new();for(let e=0;e<this._bufs.length;e++)t.append(this._bufs[e]);return t},o.prototype.append=function(t){if(null==t)return this;if(t.buffer)this._appendBuffer(n.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let e=0;e<t.length;e++)this.append(t[e]);else if(this._isBufferList(t))for(let e=0;e<t._bufs.length;e++)this.append(t._bufs[e]);else"number"===typeof t&&(t=t.toString()),this._appendBuffer(n.from(t));return this},o.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},o.prototype.indexOf=function(t,e,r){if(void 0===r&&"string"===typeof e&&(r=e,e=void 0),"function"===typeof t||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"===typeof t?t=n.from([t]):"string"===typeof t?t=n.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=n.from(t.buffer,t.byteOffset,t.byteLength):n.isBuffer(t)||(t=n.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),0===t.length)return e>this.length?this.length:e;const i=this._offset(e);let o=i[0],s=i[1];for(;o<this._bufs.length;o++){const e=this._bufs[o];for(;s<e.length;){if(e.length-s>=t.length){const r=e.indexOf(t,s);if(-1!==r)return this._reverseOffset([o,r]);s=e.length-t.length+1}else{const e=this._reverseOffset([o,s]);if(this._match(e,t))return e;s++}}s=0}return-1},o.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0},function(){const t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const e in t)!function(e){o.prototype[e]=null===t[e]?function(t,r){return this.slice(t,t+r)[e](0,r)}:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.slice(r,r+t[e])[e](0)}}(e)}(),o.prototype._isBufferList=function(t){return t instanceof o||o.isBufferList(t)},o.isBufferList=function(t){return null!=t&&t[i]},t.exports=o},80518:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(46601).Buffer}catch(R){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){l(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(R){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var y=h.modrn(l).toString(t);r=(h=h.idivn(l)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function y(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return m(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=y),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?y(this,t,e):r<1024?m(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"===typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(E,_),E.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},E.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,_),i(I,_),i(A,_),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new S;else if("p192"===t)e=new I;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},i(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},26084:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"===typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"===typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(89214);if("function"!==typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(s){}},59915:(t,e,r)=>{var n=r(82543).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,u,c=r[0],l=r[1],h=r[2],f=r[3],d=t[0]^e[0],p=t[1]^e[1],y=t[2]^e[2],g=t[3]^e[3],m=4,b=1;b<i;b++)o=c[d>>>24]^l[p>>>16&255]^h[y>>>8&255]^f[255&g]^e[m++],s=c[p>>>24]^l[y>>>16&255]^h[g>>>8&255]^f[255&d]^e[m++],a=c[y>>>24]^l[g>>>16&255]^h[d>>>8&255]^f[255&p]^e[m++],u=c[g>>>24]^l[d>>>16&255]^h[p>>>8&255]^f[255&y]^e[m++],d=o,p=s,y=a,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&g])^e[m++],s=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[m++],a=(n[y>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[m++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^e[m++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,r[s]=c,n[c]=s;var l=t[s],h=t[l],f=t[h],d=257*t[c]^16843008*c;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*f^65537*h^257*l^16843008*s,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===s?s=a=1:(s=l^t[t[t[f^l]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e===0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e===4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var c=[],l=0;l<n;l++){var h=n-l,f=i[h-(l%4?0:4)];c[l]=l<4||h<=4?f:u.INV_SUB_MIX[0][u.SBOX[f>>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=c},3560:(t,e,r)=>{var n=r(59915),i=r(82543).Buffer,o=r(92221),s=r(12534),a=r(15283),u=r(35865),c=r(8387);function l(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var l=this._cipher.encryptBlock(u);this._ghash=new a(l),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,l=i.alloc(8);l.writeUIntBE(u,0,8),n.update(l),t._finID=n.state;var h=i.from(t._finID);return c(h),h}(this,r,l),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(l,o),l.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},l.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},l.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},l.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=l},23525:(t,e,r)=>{var n=r(25270),i=r(75194),o=r(44946);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},75194:(t,e,r)=>{var n=r(3560),i=r(82543).Buffer,o=r(88172),s=r(12776),a=r(92221),u=r(59915),c=r(48462);function l(t,e,r){a.call(this),this._cache=new h,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function h(){this.cache=i.allocUnsafe(0)}function f(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"===typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new l(a.module,e,r)}r(12534)(l,a),l.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},l.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=i.concat([this.cache,t])},h.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(e,!1,r.key,r.iv);return f(t,n.key,n.iv)},e.createDecipheriv=f},25270:(t,e,r)=>{var n=r(88172),i=r(3560),o=r(82543).Buffer,s=r(12776),a=r(92221),u=r(59915),c=r(48462);function l(t,e,r){a.call(this),this._cache=new f,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(12534)(l,a),l.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var h=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"===typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new l(a.module,e,r)}l.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=o.concat([this.cache,t])},f.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},f.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},15283:(t,e,r)=>{var n=r(82543).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!==(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!==(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},8387:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},10694:(t,e,r)=>{var n=r(35865);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},33492:(t,e,r)=>{var n=r(82543).Buffer,i=r(35865);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},61400:(t,e,r)=>{var n=r(82543).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},38681:(t,e,r)=>{var n=r(82543).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},89347:(t,e,r)=>{var n=r(35865),i=r(82543).Buffer,o=r(8387);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),c=o+16*a;t._cache.writeUInt32BE(u[0],c+0),t._cache.writeUInt32BE(u[1],c+4),t._cache.writeUInt32BE(u[2],c+8),t._cache.writeUInt32BE(u[3],c+12)}var l=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,l)}},14097:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},88172:(t,e,r)=>{var n={ECB:r(14097),CBC:r(10694),CFB:r(33492),CFB8:r(38681),CFB1:r(61400),OFB:r(91746),CTR:r(89347),GCM:r(89347)},i=r(44946);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},91746:(t,e,r)=>{var n=r(19778).Buffer,i=r(35865);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=n.concat([t._cache,o(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},12776:(t,e,r)=>{var n=r(59915),i=r(82543).Buffer,o=r(92221);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(12534)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},69161:(t,e,r)=>{var n=r(47788),i=r(23525),o=r(88172),s=r(67282),a=r(48462);function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function c(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return c(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=c,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},47788:(t,e,r)=>{var n=r(92221),i=r(7439),o=r(12534),s=r(82543).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},67282:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},81330:(t,e,r)=>{var n=r(19778).Buffer,i=r(80518),o=r(12525);function s(t){var e,r=t.modulus.byteLength();do{e=new i(o(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,e){var r=function(t){var e=s(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=new i(t).mul(r.blinder).umod(e.modulus),u=a.toRed(i.mont(e.prime1)),c=a.toRed(i.mont(e.prime2)),l=e.coefficient,h=e.prime1,f=e.prime2,d=u.redPow(e.exponent1).fromRed(),p=c.redPow(e.exponent2).fromRed(),y=d.isub(p).imul(l).umod(h).imul(f);return p.iadd(y).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}a.getr=s,t.exports=a},77050:(t,e,r)=>{t.exports=r(75207)},87834:(t,e,r)=>{var n=r(34777).Buffer,i=r(83569),o=r(90723),s=r(12534),a=r(45908),u=r(71666),c=r(75207);function l(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function f(t){return new l(t)}function d(t){return new h(t)}Object.keys(c).forEach((function(t){c[t].id=n.from(c[t].id,"hex"),c[t.toLowerCase()]=c[t]})),s(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return"string"===typeof t&&(t=n.from(t,e)),this._hash.update(t),this},l.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(h,o.Writable),h.prototype._write=function(t,e,r){this._hash.update(t),r()},h.prototype.update=function(t,e){return"string"===typeof t&&(t=n.from(t,e)),this._hash.update(t),this},h.prototype.verify=function(t,e,r){"string"===typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},t.exports={Sign:f,Verify:d,createSign:f,createVerify:d}},45908:(t,e,r)=>{var n=r(34777).Buffer,i=r(57651),o=r(81330),s=r(6289).ec,a=r(80518),u=r(37510),c=r(1308);function l(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var s=n.alloc(e.byteLength()-t.length);t=n.concat([s,t])}var a=r.length,u=function(t,e){t=(t=h(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),c=n.alloc(a);c.fill(1);var l=n.alloc(a);return l=i(o,l).update(c).update(n.from([0])).update(t).update(u).digest(),c=i(o,l).update(c).digest(),{k:l=i(o,l).update(c).update(n.from([1])).update(t).update(u).digest(),v:c=i(o,l).update(c).digest()}}function h(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function f(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);s=h(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,p){var y=u(e);if(y.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=c[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new s(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,y)}if("dsa"===y.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){var i,o=e.params.priv_key,s=e.params.p,u=e.params.q,c=e.params.g,p=new a(0),y=h(t,u).mod(u),g=!1,m=l(o,u,t,r);for(;!1===g;)p=d(c,i=f(u,m,r),s,u),0===(g=i.invm(u).imul(y.add(o.mul(p))).mod(u)).cmpn(0)&&(g=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t));128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(p,g)}(t,y,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([p,t]);for(var g=y.modulus.byteLength(),m=[0,1];t.length+m.length+1<g;)m.push(255);m.push(0);for(var b=-1;++b<t.length;)m.push(t[b]);return o(m,y)},t.exports.getKey=l,t.exports.makeKey=f},71666:(t,e,r)=>{var n=r(34777).Buffer,i=r(80518),o=r(6289).ec,s=r(37510),a=r(1308);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,c,l){var h=s(r);if("ec"===h.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,h)}if("dsa"===h.type){if("dsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,c=r.data.pub_key,l=s.signature.decode(t,"der"),h=l.s,f=l.r;u(h,o),u(f,o);var d=i.mont(n),p=h.invm(o);return 0===a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(c.toRed(d).redPow(f.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(f)}(t,e,h)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");e=n.concat([l,e]);for(var f=h.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<f;)d.push(255),p++;d.push(0);for(var y=-1;++y<e.length;)d.push(e[y]);d=n.from(d);var g=i.mont(h.modulus);t=(t=new i(t).toRed(g)).redPow(new i(h.publicExponent)),t=n.from(t.fromRed().toArray());var m=p<8?1:0;for(f=Math.min(t.length,d.length),t.length!==d.length&&(m=1),y=-1;++y<f;)m|=t[y]^d[y];return 0===m}},34777:(t,e,r)=>{var n=r(19778),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},35865:(t,e,r)=>{var n=r(19778).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o<r;++o)i[o]=t[o]^e[o];return i}},19778:(t,e,r)=>{"use strict";const n=r(2009),i=r(84038),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,r)}function c(t,e,r){if("string"===typeof t)return function(t,e){"string"===typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!==typeof t.length||X(t.length)?a(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:G(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(X(n))return s;t[r+s]=n}return s}function _(t,e,r,n){return Z(G(e,t.length-r),t,r,n)}function E(t,e,r,n){return Z(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return Z(W(e),t,r,n)}function I(t,e,r,n){return Z(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128===(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128===(192&r)&&128===(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128===(192&r)&&128===(192&n)&&128===(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=T));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"===typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return h(t)},u.allocUnsafeSlow=function(t){return h(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Y(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),c=this.slice(n,i),l=t.slice(e,r);for(let u=0;u<a;++u)if(c[u]!==l[u]){o=c[u],s=l[u];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"===typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=Q[t[o]];return i}function P(t,e,r){const n=t.slice(e,r);let i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function B(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i){V(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function D(t,e,r,n,i){V(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function x(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return e=+e,r>>>=0,o||x(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||x(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=J((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=J((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=J((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=J((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){O(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){O(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=J((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);O(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=J((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"===typeof t){if("string"===typeof e?(n=e,e=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"===typeof t?t&=255:"boolean"===typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const j={};function K(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(t,"]"),this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function V(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"===typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(o+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(o+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(n):">= ".concat(e).concat(n," and <= ").concat(r).concat(n),new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function q(t,e){if("number"!==typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw q(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)}),TypeError),K("ERR_OUT_OF_RANGE",(function(t,e,r){let n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i),n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function Z(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!==t}const Q=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function J(t){return"undefined"===typeof BigInt?$:t}function $(){throw new Error("BigInt not supported")}},44037:(t,e,r)=>{"use strict";var n=r(52506),i=r(19722),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"===typeof r&&o(t,".prototype.")>-1?i(r):r}},19722:(t,e,r)=>{"use strict";var n=r(33350),i=r(52506),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(f){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var h=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h},92221:(t,e,r)=>{var n=r(82543).Buffer,i=r(41064).Transform,o=r(15948).s;function s(t){i.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(12534)(s,i),s.prototype.update=function(t,e,r){"string"===typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},83708:t=>{"use strict";t.exports=function(t,e){let{className:r,symbolName:n}=e;const i=Symbol.for(n),o={[r]:class extends t{constructor(){super(...arguments),Object.defineProperty(this,i,{value:!0})}get[Symbol.toStringTag](){return r}}}[r];return o["is".concat(r)]=t=>!(!t||!t[i]),o},t.exports.proto=function(t,e){let{className:r,symbolName:n,withoutNew:i}=e;const o=Symbol.for(n),s={[r]:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(i&&!(this instanceof s))return new s(...r);const a=t.call(this,...r)||this;return a&&!a[o]&&Object.defineProperty(a,o,{value:!0}),a}}[r];return s.prototype=Object.create(t.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,Symbol.toStringTag,{get:()=>r}),s["is".concat(r)]=t=>!(!t||!t[o]),s}},75235:(t,e,r)=>{"use strict";const n=r(5696),i=/\s+at.*(?:\(|\s)(.*)\)?/,o=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,s="undefined"===typeof n.homedir?"":n.homedir();t.exports=(t,e)=>(e=Object.assign({pretty:!1},e),t.replace(/\\/g,"/").split("\n").filter((t=>{const e=t.match(i);if(null===e||!e[1])return!0;const r=e[1];return!r.includes(".app/Contents/Resources/electron.asar")&&!r.includes(".app/Contents/Resources/default_app.asar")&&!o.test(r)})).filter((t=>""!==t.trim())).map((t=>e.pretty?t.replace(i,((t,e)=>t.replace(e,e.replace(s,"~")))):t)).join("\n"))},69420:(t,e,r)=>{var n=r(19778).Buffer,i=r(6289),o=r(39236);t.exports=function(t){return new a(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new n(t);if(r&&i.length<r){var o=new n(r-i.length);o.fill(0),i=n.concat([o,i])}return e?i.toString(e):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,a.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},a.prototype.computeSecret=function(t,e,r){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),u(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},a.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),u(r,t)},a.prototype.getPrivateKey=function(t){return u(this.keys.getPrivate(),t)},a.prototype.setPublicKey=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.keys._importPublic(t),this},a.prototype.setPrivateKey=function(t,e){e=e||"utf8",n.isBuffer(t)||(t=new n(t,e));var r=new o(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},39236:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(8623).Buffer}catch(A){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):y(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new I(t)},i(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},83569:(t,e,r)=>{"use strict";var n=r(12534),i=r(68437),o=r(83375),s=r(85730),a=r(92221);function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},55378:(t,e,r)=>{var n=r(68437);t.exports=function(t){return(new n).update(t).digest()}},57651:(t,e,r)=>{"use strict";var n=r(12534),i=r(43189),o=r(92221),s=r(82543).Buffer,a=r(55378),u=r(83375),c=r(85730),l=s.alloc(128);function h(t,e){o.call(this,"digest"),"string"===typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:c(t)).update(e).digest():e.length<r&&(e=s.concat([e,l],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new u:c(t),this._hash.update(n)}n(h,o),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new h("rmd160",e):"md5"===t?new i(a,e):new h(t,e)}},43189:(t,e,r)=>{"use strict";var n=r(12534),i=r(82543).Buffer,o=r(92221),s=i.alloc(128),a=64;function u(t,e){o.call(this,"digest"),"string"===typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=i.concat([e,s],a));for(var r=this._ipad=i.allocUnsafe(a),n=this._opad=i.allocUnsafe(a),u=0;u<a;u++)r[u]=54^e[u],n[u]=92^e[u];this._hash=[r]}n(u,o),u.prototype._update=function(t){this._hash.push(t)},u.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=u},86433:(t,e,r)=>{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(12525),e.createHash=e.Hash=r(83569),e.createHmac=e.Hmac=r(57651);var n=r(77050),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var s=r(95896);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(69161);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var u=r(2197);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var c=r(87834);e.createSign=c.createSign,e.Sign=c.Sign,e.createVerify=c.createVerify,e.Verify=c.Verify,e.createECDH=r(69420);var l=r(60012);e.publicEncrypt=l.publicEncrypt,e.privateEncrypt=l.privateEncrypt,e.publicDecrypt=l.publicDecrypt,e.privateDecrypt=l.privateDecrypt;var h=r(50394);e.randomFill=h.randomFill,e.randomFillSync=h.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},18392:(t,e,r)=>{var n=r(21964);e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(r){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(r){}!t&&"undefined"!==typeof n&&"env"in n&&(t={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DEBUG);return t},e.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=r(18472)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},18472:(t,e,r)=>{t.exports=function(t){function e(t){let r,i,o,s=null;function a(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(!a.enabled)return;const o=a,s=Number(new Date),u=s-(r||s);o.diff=u,o.prev=r,o.curr=s,r=s,n[0]=e.coerce(n[0]),"string"!==typeof n[0]&&n.unshift("%O");let c=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,((t,r)=>{if("%%"===t)return"%";c++;const i=e.formatters[r];if("function"===typeof i){const e=n[c];t=i.call(o,e),n.splice(c,1),c--}return t})),e.formatArgs.call(o,n);const l=o.log||e.log;l.apply(o,n)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"===typeof e.init&&e.init(a),a}function n(t,r){const n=e(this.namespace+("undefined"===typeof r?":":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"===typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(78193),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},9396:(t,e,r)=>{"use strict";var n=r(24892),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,u=r(84510)(),c=a&&u,l=function(t,e,r,n){var i;(!(e in t)||"function"===typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a<o.length;a+=1)l(t,o[a],e[o[a]],r[o[a]])};h.supportsDescriptors=!!c,t.exports=h},68718:t=>{"use strict";function e(t,e){e=e||{};this._head=0,this._tail=0,this._capacity=e.capacity,this._capacityMask=3,this._list=new Array(4),Array.isArray(t)&&this._fromArray(t)}e.prototype.peekAt=function(t){var e=t;if(e===(0|e)){var r=this.size();if(!(e>=r||e<-r))return e<0&&(e+=r),e=this._head+e&this._capacityMask,this._list[e]}},e.prototype.get=function(t){return this.peekAt(t)},e.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},e.prototype.peekFront=function(){return this.peek()},e.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(e.prototype,"length",{get:function(){return this.size()}}),e.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},e.prototype.unshift=function(t){if(void 0===t)return this.size();var e=this._list.length;return this._head=this._head-1+e&this._capacityMask,this._list[this._head]=t,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},e.prototype.shift=function(){var t=this._head;if(t!==this._tail){var e=this._list[t];return this._list[t]=void 0,this._head=t+1&this._capacityMask,t<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),e}},e.prototype.push=function(t){if(void 0===t)return this.size();var e=this._tail;return this._list[e]=t,this._tail=e+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},e.prototype.pop=function(){var t=this._tail;if(t!==this._head){var e=this._list.length;this._tail=t-1+e&this._capacityMask;var r=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&t>1e4&&t<=e>>>2&&this._shrinkArray(),r}},e.prototype.removeOne=function(t){var e=t;if(e===(0|e)&&this._head!==this._tail){var r=this.size(),n=this._list.length;if(!(e>=r||e<-r)){e<0&&(e+=r),e=this._head+e&this._capacityMask;var i,o=this._list[e];if(t<r/2){for(i=t;i>0;i--)this._list[e]=this._list[e=e-1+n&this._capacityMask];this._list[e]=void 0,this._head=this._head+1+n&this._capacityMask}else{for(i=r-1-t;i>0;i--)this._list[e]=this._list[e=e+1+n&this._capacityMask];this._list[e]=void 0,this._tail=this._tail-1+n&this._capacityMask}return o}}},e.prototype.remove=function(t,e){var r,n=t,i=e;if(n===(0|n)&&this._head!==this._tail){var o=this.size(),s=this._list.length;if(!(n>=o||n<-o||e<1)){if(n<0&&(n+=o),1===e||!e)return(r=new Array(1))[0]=this.removeOne(n),r;if(0===n&&n+e>=o)return r=this.toArray(),this.clear(),r;var a;for(n+e>o&&(e=o-n),r=new Array(e),a=0;a<e;a++)r[a]=this._list[this._head+n+a&this._capacityMask];if(n=this._head+n&this._capacityMask,t+e===o){for(this._tail=this._tail-e+s&this._capacityMask,a=e;a>0;a--)this._list[n=n+1+s&this._capacityMask]=void 0;return r}if(0===t){for(this._head=this._head+e+s&this._capacityMask,a=e-1;a>0;a--)this._list[n=n+1+s&this._capacityMask]=void 0;return r}if(n<o/2){for(this._head=this._head+t+e+s&this._capacityMask,a=t;a>0;a--)this.unshift(this._list[n=n-1+s&this._capacityMask]);for(n=this._head-1+s&this._capacityMask;i>0;)this._list[n=n-1+s&this._capacityMask]=void 0,i--;t<0&&(this._tail=n)}else{for(this._tail=n,n=n+e+s&this._capacityMask,a=o-(e+t);a>0;a--)this.push(this._list[n++]);for(n=this._tail;i>0;)this._list[n=n+1+s&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=s>>>2&&this._shrinkArray(),r}}},e.prototype.splice=function(t,e){var r=t;if(r===(0|r)){var n=this.size();if(r<0&&(r+=n),!(r>n)){if(arguments.length>2){var i,o,s,a=arguments.length,u=this._list.length,c=2;if(!n||r<n/2){for(o=new Array(r),i=0;i<r;i++)o[i]=this._list[this._head+i&this._capacityMask];for(0===e?(s=[],r>0&&(this._head=this._head+r+u&this._capacityMask)):(s=this.remove(r,e),this._head=this._head+r+u&this._capacityMask);a>c;)this.unshift(arguments[--a]);for(i=r;i>0;i--)this.unshift(o[i-1])}else{var l=(o=new Array(n-(r+e))).length;for(i=0;i<l;i++)o[i]=this._list[this._head+r+e+i&this._capacityMask];for(0===e?(s=[],r!=n&&(this._tail=this._head+r+u&this._capacityMask)):(s=this.remove(r,e),this._tail=this._tail-l+u&this._capacityMask);c<a;)this.push(arguments[c++]);for(i=0;i<l;i++)this.push(o[i])}return s}return this.remove(r,e)}}},e.prototype.clear=function(){this._head=0,this._tail=0},e.prototype.isEmpty=function(){return this._head===this._tail},e.prototype.toArray=function(){return this._copyArray(!1)},e.prototype._fromArray=function(t){for(var e=0;e<t.length;e++)this.push(t[e])},e.prototype._copyArray=function(t){var e,r=[],n=this._list,i=n.length;if(t||this._head>this._tail){for(e=this._head;e<i;e++)r.push(n[e]);for(e=0;e<this._tail;e++)r.push(n[e])}else for(e=this._head;e<this._tail;e++)r.push(n[e]);return r},e.prototype._growArray=function(){this._head&&(this._list=this._copyArray(!0),this._head=0),this._tail=this._list.length,this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1},e.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},t.exports=e},7439:(t,e,r)=>{"use strict";e.utils=r(47427),e.Cipher=r(834),e.DES=r(23688),e.CBC=r(1159),e.EDE=r(38534)},1159:(t,e,r)=>{"use strict";var n=r(72325),i=r(12534),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];o._update.call(this,s,0,r,n);for(a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{o._update.call(this,t,e,r,n);for(a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},834:(t,e,r)=>{"use strict";var n=r(72325);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},23688:(t,e,r)=>{"use strict";var n=r(72325),i=r(12534),o=r(47427),s=r(834);function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(u,s),t.exports=u,u.create=function(t){return new u(t)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=c[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},u.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},u.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var c=t.keys[u],l=t.keys[u+1];o.expand(a,t.tmp,0),c^=t.tmp[0],l^=t.tmp[1];var h=o.substitute(c,l),f=a;a=(s^o.permute(h))>>>0,s=f}o.rip(a,s,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],l=t.keys[u+1];o.expand(s,t.tmp,0),c^=t.tmp[0],l^=t.tmp[1];var h=o.substitute(c,l),f=s;s=(a^o.permute(h))>>>0,a=f}o.rip(s,a,n,i)}},38534:(t,e,r)=>{"use strict";var n=r(72325),i=r(12534),o=r(834),s=r(23688);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},47427:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,s=0,a=r.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>r[u]&1;for(u=a;u<r.length;u++)s<<=1,s|=e>>>r[u]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},2197:(t,e,r)=>{var n=r(19778).Buffer,i=r(13164),o=r(29799),s=r(4771);var a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new n(o[t].prime,"hex"),r=new n(o[t].gen,"hex");return new s(e,r)},e.createDiffieHellman=e.DiffieHellman=function t(e,r,o,u){return n.isBuffer(r)||void 0===a[r]?t(e,"binary",r,o):(r=r||"binary",u=u||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,u)),"number"===typeof e?new s(i(e,o),o,!0):(n.isBuffer(e)||(e=new n(e,r)),new s(e,o,!0)))}},4771:(t,e,r)=>{var n=r(19778).Buffer,i=r(54231),o=new(r(31595)),s=new i(24),a=new i(11),u=new i(10),c=new i(3),l=new i(7),h=r(13164),f=r(12525);function d(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._pub=new i(t),this}function p(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._priv=new i(t),this}t.exports=g;var y={};function g(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function m(t,e){var r=new n(t.toArray());return e?r.toString(e):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!==typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in y)return y[n];var i,f=0;if(t.isEven()||!h.simpleSieve||!h.fermatTest(t)||!o.test(t))return f+=1,f+="02"===r||"05"===r?8:4,y[n]=f,f;switch(o.test(t.shrn(1))||(f+=2),r){case"02":t.mod(s).cmp(a)&&(f+=8);break;case"05":(i=t.mod(u)).cmp(c)&&i.cmp(l)&&(f+=8);break;default:f+=4}return y[n]=f,f}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new i(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var e=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(e.toArray()),o=this.getPrime();if(r.length<o.length){var s=new n(o.length-r.length);s.fill(0),r=n.concat([s,r])}return r},g.prototype.getPublicKey=function(t){return m(this._pub,t)},g.prototype.getPrivateKey=function(t){return m(this._priv,t)},g.prototype.getPrime=function(t){return m(this.__prime,t)},g.prototype.getGenerator=function(t){return m(this._gen,t)},g.prototype.setGenerator=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.__gen=t,this._gen=new i(t),this}},13164:(t,e,r)=>{var n=r(12525);t.exports=b,b.simpleSieve=g,b.fermatTest=m;var i=r(54231),o=new i(24),s=new(r(31595)),a=new i(1),u=new i(2),c=new i(5),l=(new i(16),new i(8),new i(10)),h=new i(3),f=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function y(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!==0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function g(t){for(var e=y(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function m(t){var e=i.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function b(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(c))for(;r.mod(l).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(f);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&m(p)&&m(r)&&s.test(p)&&s.test(r))return r}}},54231:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7748).Buffer}catch(A){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):y(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new I(t)},i(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},18259:(t,e,r)=>{"use strict";const n=r(18392),i=n("dns-over-http-resolver");i.error=n("dns-over-http-resolver:error");const o=r(449),s=r(20827);class a{constructor(){let{maxCache:t=100}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._cache=new o({max:t}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"]}getServers(){return this._servers}_getShuffledServers(){const t=[].concat(this._servers);for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*e),n=t[e];t[e]=t[r],t[r]=n}return t}setServers(t){this._servers=t}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A";switch(e){case"A":return this.resolve4(t);case"AAAA":return this.resolve6(t);case"TXT":return this.resolveTxt(t);default:throw new Error("".concat(e," is not supported"))}}async resolve4(t){const e="A",r=this._cache.get(s.getCacheKey(t,e));if(r)return r;for(const o of this._getShuffledServers())try{const r=await s.fetch(s.buildResource({serverResolver:o,hostname:t,recordType:e})),n=await r.json(),i=n.Answer.map((t=>t.data)),a=Math.min(n.Answer.map((t=>t.TTL)));return this._cache.set(s.getCacheKey(t,e),i,{ttl:a}),i}catch(n){i.error("".concat(o," could not resolve ").concat(t," record ").concat(e))}throw new Error("Could not resolve ".concat(t," record ").concat(e))}async resolve6(t){const e="AAAA",r=this._cache.get(s.getCacheKey(t,e));if(r)return r;for(const o of this._getShuffledServers())try{const r=await s.fetch(s.buildResource({serverResolver:o,hostname:t,recordType:e})),n=await r.json(),i=n.Answer.map((t=>t.data)),a=Math.min(n.Answer.map((t=>t.TTL)));return this._cache.set(s.getCacheKey(t,e),i,{ttl:a}),i}catch(n){i.error("".concat(o," could not resolve ").concat(t," record ").concat(e))}throw new Error("Could not resolve ".concat(t," record ").concat(e))}async resolveTxt(t){const e="TXT",r=this._cache.get(s.getCacheKey(t,e));if(r)return r;for(const o of this._getShuffledServers())try{const r=await s.fetch(s.buildResource({serverResolver:o,hostname:t,recordType:e})),n=await r.json(),i=n.Answer.map((t=>[t.data.replace(/['"]+/g,"")])),a=Math.min(n.Answer.map((t=>t.TTL)));return this._cache.set(s.getCacheKey(t,e),i,{ttl:a}),i}catch(n){i.error("".concat(o," could not resolve ").concat(t," record ").concat(e))}throw new Error("Could not resolve ".concat(t," record ").concat(e))}}a.Resolver=a,t.exports=a},20827:(t,e,r)=>{"use strict";const{default:n,Headers:i}=r(1900);t.exports={buildResource:function(t){let{serverResolver:e,hostname:r,recordType:n}=t;return"".concat(e,"?name=").concat(r,"&type=").concat(n)},fetch:function(t){return n(t,{headers:new i({accept:"application/dns-json"})})},getCacheKey:function(t,e){return"".concat(e,"_").concat(t)}}},82010:(t,e,r)=>{"use strict";function n(t,e){Object.defineProperty(t,"super_",{value:e,writable:!0,configurable:!0}),Object.setPrototypeOf(t.prototype,e.prototype)}let i="undefined"!==typeof r.g?r.g.AbortError:"undefined"!==typeof window?window.AbortError:null;function o(t,e,r){Error.captureStackTrace(this,o),this.message="status="+e+" while requesting "+t+" ["+r+"]",this.uri=t,this.status=e,this.method=r}function s(t,e){Error.captureStackTrace(this,s),this.message=t,this.cause=e}function a(t){Error.captureStackTrace(this,a),this.message="Timeout (t="+t+").",this.timeout=t}function u(t){if(t.protocol){if(!["http:","https:","udp4:","udp6:"].includes(t.protocol))throw new Error('Invalid Endpoint: unsupported protocol "'.concat(t.protocol,'" for endpoint: ').concat(JSON.stringify(t)))}else t.protocol="https:";if("string"!==typeof t.host)throw new Error('Invalid Endpoint: host "'.concat(t.host,'" needs to be a string: ').concat(JSON.stringify(t)));if("number"!==typeof t.port&&!isNaN(t.port))throw new Error('Invalid Endpoint: port "'.concat(t.port,'" needs to be a number: ').concat(JSON.stringify(t)));for(const e in t)void 0!==t[e]&&(this[e]=t[e])}i||(i=function(){Error.captureStackTrace(this,i),this.message="Request aborted."},n(i,Error),i.prototype.code="ABORT_ERR",i.prototype.name="AbortError"),n(o,Error),o.prototype.code="HTTP_STATUS",o.prototype.name="StatusError",n(s,Error),s.prototype.code="RESPONSE_ERR",s.prototype.name="ResponseError",n(a,Error),a.prototype.code="ETIMEOUT",a.prototype.name="TimeoutError";const c=r(35438),l={};for(const h in c)l[h]=new u(c[h]);t.exports={endpoints:l,AbortError:i,HTTPStatusError:o,ResponseError:s,TimeoutError:a,Endpoint:u}},54535:(t,e,r)=>{"use strict";const n=r(85720),i=r(11313),o=r(82010),s=o.AbortError,a=o.ResponseError,u=o.Endpoint,c=o.endpoints,l=/^((\d{1,3}\.){3,3}\d{1,3})(:(\d{2,5}))?$/,h=/^((::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?)(:(\d{2,5}))?$/i;function f(t,e,r,o){return o&&o.aborted?Promise.reject(new s):"udp4:"===t.protocol||"udp6:"===t.protocol?i.queryDns(t,e,r,o):function(t,e,r,o){const s=t.protocol||"https:";return new Promise((function(u,c){i.request(s,t.host,t.port?parseInt(t.port,10):"https:"===s?443:80,t.path||"/dns-query",/^post$/i.test(t.method)?"POST":"GET",n.encode(Object.assign({flags:n.RECURSION_DESIRED,type:"query"},e)),r,o,(function(e,r,i){let o;if(null===e)if(0===r.length)e=new a("Empty.");else try{o=n.decode(r)}catch(s){e=new a("Invalid packet (cause="+s.message+")",s)}null!==e?c(Object.assign(e,{response:i,endpoint:t})):(o.endpoint=t,o.response=i,u(o))}))}))}(t,e,r,o)}function d(t,e){let r;e=Object.assign({retries:5,timeout:3e4},e);try{if(r="doh"===e.endpoints?i.endpoints({doh:!0,dns:!1}):"dns"===e.endpoints?i.endpoints({doh:!1,dns:!0}):p(e.endpoints)||i.endpoints({doh:!0,dns:!0}),!r||0===r.length)throw new Error("No endpoints defined.")}catch(n){return Promise.reject(n)}return function(t,e,r){const n=1===t.length?t[0]:t[Math.floor(Math.random()*t.length)%t.length];return f(n,e,r.timeout,r.signal).then((t=>(t.endpoint=n,t)),(t=>{if("AbortError"===t.name||0===r.retries)throw t;return r.retries>0&&(r.retries-=1),d(e,r)}))}(r,t,e)}function p(t){if(!t)return;if("function"!==typeof t[Symbol.iterator]||"string"===typeof t)throw new Error("Endpoints needs to be iterable.");const e=[];for(let r of t)"object"===typeof r?(r instanceof u||(r=new u(r)),e.push(r)):"string"===typeof r&&e.push(c[r]||y(r));return e}function y(t){const e=/^(([^:]+?:)\/\/)?([^/]*?)(\/.*?)?(\s\[(post|get)\])?$/i.exec(t);let r,n,i=e[2]||"https:",o=1;const s=h.exec(e[3]);if(s){const t=l.exec(e[3]);t?(r=t[1],t[4]&&(n=parseInt(t[4]))):(o=2,r=s[1],s[9]&&(n=parseInt(s[10])))}else{const t=/^([^:]*)(:(.*))?$/.exec(e[3]);r=t[1],t[3]&&(n=parseInt(t[3]))}return"udp:"===i&&(i=2===o?"udp6:":"udp4:"),new u({protocol:i,host:r,port:n,path:e[4],method:e[6]})}t.exports={query:d,endpoints:c,parseEndpoints:p,AbortError:s,ResponseError:a,TimeoutError:o.TimeoutError,HTTPStatusError:o.HTTPStatusError,Endpoint:u}},11313:(t,e,r)=>{"use strict";const n=r(19778).Buffer,i=r(82010),o=i.AbortError,s=i.HTTPStatusError,a=i.TimeoutError,u="application/dns-message",c=Object.values(i.endpoints).filter((function(t){return!t.filter&&!t.logging&&t.cors}));function l(){}t.exports={request:function(t,e,r,i,c,h,f,d,p){const y=t+"//"+e+":"+r+i+("GET"===c?"?dns="+h.toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):""),g=new XMLHttpRequest;g.open(c,y,!0),g.setRequestHeader("Accept",u),"POST"===c&&g.setRequestHeader("Content-Type",u),g.responseType="arraybuffer",g.timeout=f,g.ontimeout=function(){m(new a(f));try{g.abort()}catch(t){}},g.onreadystatechange=function(){if(g.readyState>1&&200!==g.status&&0!==g.status){m(new s(y,g.status,c));try{g.abort()}catch(t){}}},g.onerror=function(){m(200===g.status?new Error("Inexplicable XHR Error"):new s(y,g.status,c))},g.onload=function(){200!==g.status?m(new s(y,g.status,c)):m(null,n.from(g.response))},"GET"===c?g.send():g.send(h),d&&d.addEventListener("abort",b);let m=function(t,e){m=l,d&&d.removeEventListener("abort",b),p(t,e,g)};function b(){m(new o);try{g.abort()}catch(t){}}},queryDns:function(){throw new Error('Only "doh" endpoints are supported in the browser')},endpoints:t=>{if(t.doh)return c;if(t.dns)throw new Error('Only "doh" is supported in the browser')}}},99882:(t,e)=>{"use strict";e.toString=function(t){switch(t){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+t},e.toClass=function(t){switch(t.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}},85720:(t,e,r)=>{"use strict";const n=r(19778).Buffer,i=r(82936),o=r(2266),s=r(71365),a=r(99882),u=r(61974),c=r(17612),l=32768,h=e.name={};h.encode=function(t,e,r){e||(e=n.alloc(h.encodingLength(t))),r||(r=0);const i=r,o=t.replace(/^\.|\.$/gm,"");if(o.length){const t=o.split(".");for(let n=0;n<t.length;n++){const i=e.write(t[n],r+1);e[r]=i,r+=i+1}}return e[r++]=0,h.encode.bytes=r-i,e},h.encode.bytes=0,h.decode=function(t,e){e||(e=0);const r=[];let n=e,i=0,o=0,s=!1;for(;;){if(e>=t.length)throw new Error("Cannot decode name (buffer overflow)");const a=t[e++];if(o+=s?0:1,0===a)break;if(0===(192&a)){if(e+a>t.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=a+1,i>254)throw new Error("Cannot decode name (name too long)");r.push(t.toString("utf-8",e,e+a)),e+=a,o+=s?0:a}else{if(192!==(192&a))throw new Error("Cannot decode name (bad label)");{if(e+1>t.length)throw new Error("Cannot decode name (buffer overflow)");const r=t.readUInt16BE(e-1)-49152;if(r>=n)throw new Error("Cannot decode name (bad pointer)");e=r,n=r,o+=s?0:1,s=!0}}}return h.decode.bytes=o,0===r.length?".":r.join(".")},h.decode.bytes=0,h.encodingLength=function(t){return"."===t||".."===t?1:n.byteLength(t.replace(/^\.|\.$/gm,""))+2};const f={encode:function(t,e,r){e||(e=n.alloc(f.encodingLength(t))),r||(r=0);const i=e.write(t,r+1);return e[r]=i,f.encode.bytes=i+1,e}};f.encode.bytes=0,f.decode=function(t,e){e||(e=0);const r=t[e],n=t.toString("utf-8",e+1,e+1+r);return f.decode.bytes=r+1,n},f.decode.bytes=0,f.encodingLength=function(t){return n.byteLength(t)+1};const d={encode:function(t,e,r){e||(e=d.encodingLength(t)),r||(r=0);const n=32767&(t.flags||0),i="response"===t.type?32768:0;return e.writeUInt16BE(t.id||0,r),e.writeUInt16BE(n|i,r+2),e.writeUInt16BE(t.questions.length,r+4),e.writeUInt16BE(t.answers.length,r+6),e.writeUInt16BE(t.authorities.length,r+8),e.writeUInt16BE(t.additionals.length,r+10),e}};d.encode.bytes=12,d.decode=function(t,e){if(e||(e=0),t.length<12)throw new Error("Header must be 12 bytes");const r=t.readUInt16BE(e+2);return{id:t.readUInt16BE(e),type:32768&r?"response":"query",flags:32767&r,flag_qr:1===(r>>15&1),opcode:s.toString(r>>11&15),flag_aa:1===(r>>10&1),flag_tc:1===(r>>9&1),flag_rd:1===(r>>8&1),flag_ra:1===(r>>7&1),flag_z:1===(r>>6&1),flag_ad:1===(r>>5&1),flag_cd:1===(r>>4&1),rcode:o.toString(15&r),questions:new Array(t.readUInt16BE(e+4)),answers:new Array(t.readUInt16BE(e+6)),authorities:new Array(t.readUInt16BE(e+8)),additionals:new Array(t.readUInt16BE(e+10))}},d.decode.bytes=12,d.encodingLength=function(){return 12};const p=e.unknown={};p.encode=function(t,e,r){return e||(e=n.alloc(p.encodingLength(t))),r||(r=0),e.writeUInt16BE(t.length,r),t.copy(e,r+2),p.encode.bytes=t.length+2,e},p.encode.bytes=0,p.decode=function(t,e){e||(e=0);const r=t.readUInt16BE(e),n=t.slice(e+2,e+2+r);return p.decode.bytes=r+2,n},p.decode.bytes=0,p.encodingLength=function(t){return t.length+2};const y=e.ns={};y.encode=function(t,e,r){return e||(e=n.alloc(y.encodingLength(t))),r||(r=0),h.encode(t,e,r+2),e.writeUInt16BE(h.encode.bytes,r),y.encode.bytes=h.encode.bytes+2,e},y.encode.bytes=0,y.decode=function(t,e){e||(e=0);const r=t.readUInt16BE(e),n=h.decode(t,e+2);return y.decode.bytes=r+2,n},y.decode.bytes=0,y.encodingLength=function(t){return h.encodingLength(t)+2};const g=e.soa={};g.encode=function(t,e,r){e||(e=n.alloc(g.encodingLength(t))),r||(r=0);const i=r;return r+=2,h.encode(t.mname,e,r),r+=h.encode.bytes,h.encode(t.rname,e,r),r+=h.encode.bytes,e.writeUInt32BE(t.serial||0,r),r+=4,e.writeUInt32BE(t.refresh||0,r),r+=4,e.writeUInt32BE(t.retry||0,r),r+=4,e.writeUInt32BE(t.expire||0,r),r+=4,e.writeUInt32BE(t.minimum||0,r),r+=4,e.writeUInt16BE(r-i-2,i),g.encode.bytes=r-i,e},g.encode.bytes=0,g.decode=function(t,e){e||(e=0);const r=e,n={};return e+=2,n.mname=h.decode(t,e),e+=h.decode.bytes,n.rname=h.decode(t,e),e+=h.decode.bytes,n.serial=t.readUInt32BE(e),e+=4,n.refresh=t.readUInt32BE(e),e+=4,n.retry=t.readUInt32BE(e),e+=4,n.expire=t.readUInt32BE(e),e+=4,n.minimum=t.readUInt32BE(e),e+=4,g.decode.bytes=e-r,n},g.decode.bytes=0,g.encodingLength=function(t){return 22+h.encodingLength(t.mname)+h.encodingLength(t.rname)};const m=e.txt={};m.encode=function(t,e,r){Array.isArray(t)||(t=[t]);for(let o=0;o<t.length;o++)if("string"===typeof t[o]&&(t[o]=n.from(t[o])),!n.isBuffer(t[o]))throw new Error("Must be a Buffer");e||(e=n.alloc(m.encodingLength(t))),r||(r=0);const i=r;return r+=2,t.forEach((function(t){e[r++]=t.length,t.copy(e,r,0,t.length),r+=t.length})),e.writeUInt16BE(r-i-2,i),m.encode.bytes=r-i,e},m.encode.bytes=0,m.decode=function(t,e){e||(e=0);const r=e;let n=t.readUInt16BE(e);e+=2;let i=[];for(;n>0;){const r=t[e++];if(--n,n<r)throw new Error("Buffer overflow");i.push(t.slice(e,e+r)),e+=r,n-=r}return m.decode.bytes=e-r,i},m.decode.bytes=0,m.encodingLength=function(t){Array.isArray(t)||(t=[t]);let e=2;return t.forEach((function(t){e+="string"===typeof t?n.byteLength(t)+1:t.length+1})),e};const b=e.null={};b.encode=function(t,e,r){e||(e=n.alloc(b.encodingLength(t))),r||(r=0),"string"===typeof t&&(t=n.from(t)),t||(t=n.alloc(0));const i=r;r+=2;const o=t.length;return t.copy(e,r,0,o),r+=o,e.writeUInt16BE(r-i-2,i),b.encode.bytes=r-i,e},b.encode.bytes=0,b.decode=function(t,e){e||(e=0);const r=e,n=t.readUInt16BE(e);e+=2;const i=t.slice(e,e+n);return e+=n,b.decode.bytes=e-r,i},b.decode.bytes=0,b.encodingLength=function(t){return t?(n.isBuffer(t)?t.length:n.byteLength(t))+2:2};const v=e.hinfo={};v.encode=function(t,e,r){e||(e=n.alloc(v.encodingLength(t))),r||(r=0);const i=r;return r+=2,f.encode(t.cpu,e,r),r+=f.encode.bytes,f.encode(t.os,e,r),r+=f.encode.bytes,e.writeUInt16BE(r-i-2,i),v.encode.bytes=r-i,e},v.encode.bytes=0,v.decode=function(t,e){e||(e=0);const r=e,n={};return e+=2,n.cpu=f.decode(t,e),e+=f.decode.bytes,n.os=f.decode(t,e),e+=f.decode.bytes,v.decode.bytes=e-r,n},v.decode.bytes=0,v.encodingLength=function(t){return f.encodingLength(t.cpu)+f.encodingLength(t.os)+2};const w=e.ptr={},_=e.cname=w,E=e.dname=w;w.encode=function(t,e,r){return e||(e=n.alloc(w.encodingLength(t))),r||(r=0),h.encode(t,e,r+2),e.writeUInt16BE(h.encode.bytes,r),w.encode.bytes=h.encode.bytes+2,e},w.encode.bytes=0,w.decode=function(t,e){e||(e=0);const r=h.decode(t,e+2);return w.decode.bytes=h.decode.bytes+2,r},w.decode.bytes=0,w.encodingLength=function(t){return h.encodingLength(t)+2};const S=e.srv={};S.encode=function(t,e,r){e||(e=n.alloc(S.encodingLength(t))),r||(r=0),e.writeUInt16BE(t.priority||0,r+2),e.writeUInt16BE(t.weight||0,r+4),e.writeUInt16BE(t.port||0,r+6),h.encode(t.target,e,r+8);const i=h.encode.bytes+6;return e.writeUInt16BE(i,r),S.encode.bytes=i+2,e},S.encode.bytes=0,S.decode=function(t,e){e||(e=0);const r=t.readUInt16BE(e),n={};return n.priority=t.readUInt16BE(e+2),n.weight=t.readUInt16BE(e+4),n.port=t.readUInt16BE(e+6),n.target=h.decode(t,e+8),S.decode.bytes=r+2,n},S.decode.bytes=0,S.encodingLength=function(t){return 8+h.encodingLength(t.target)};const I=e.caa={};I.ISSUER_CRITICAL=128,I.encode=function(t,e,r){const i=I.encodingLength(t);return e||(e=n.alloc(I.encodingLength(t))),r||(r=0),t.issuerCritical&&(t.flags=I.ISSUER_CRITICAL),e.writeUInt16BE(i-2,r),r+=2,e.writeUInt8(t.flags||0,r),r+=1,f.encode(t.tag,e,r),r+=f.encode.bytes,e.write(t.value,r),r+=n.byteLength(t.value),I.encode.bytes=i,e},I.encode.bytes=0,I.decode=function(t,e){e||(e=0);const r=t.readUInt16BE(e),n=e+=2,i={};return i.flags=t.readUInt8(e),e+=1,i.tag=f.decode(t,e),e+=f.decode.bytes,i.value=t.toString("utf-8",e,n+r),i.issuerCritical=!!(i.flags&I.ISSUER_CRITICAL),I.decode.bytes=r+2,i},I.decode.bytes=0,I.encodingLength=function(t){return f.encodingLength(t.tag)+f.encodingLength(t.value)+2};const A=e.mx={};A.encode=function(t,e,r){e||(e=n.alloc(A.encodingLength(t))),r||(r=0);const i=r;return r+=2,e.writeUInt16BE(t.preference||0,r),r+=2,h.encode(t.exchange,e,r),r+=h.encode.bytes,e.writeUInt16BE(r-i-2,i),A.encode.bytes=r-i,e},A.encode.bytes=0,A.decode=function(t,e){e||(e=0);const r=e,n={};return e+=2,n.preference=t.readUInt16BE(e),e+=2,n.exchange=h.decode(t,e),e+=h.decode.bytes,A.decode.bytes=e-r,n},A.encodingLength=function(t){return 4+h.encodingLength(t.exchange)};const M=e.a={};M.encode=function(t,e,r){return e||(e=n.alloc(M.encodingLength(t))),r||(r=0),e.writeUInt16BE(4,r),r+=2,c.v4.encode(t,e,r),M.encode.bytes=6,e},M.encode.bytes=0,M.decode=function(t,e){e||(e=0),e+=2;const r=c.v4.decode(t,e);return M.decode.bytes=6,r},M.decode.bytes=0,M.encodingLength=function(){return 6};const T=e.aaaa={};T.encode=function(t,e,r){return e||(e=n.alloc(T.encodingLength(t))),r||(r=0),e.writeUInt16BE(16,r),r+=2,c.v6.encode(t,e,r),T.encode.bytes=18,e},T.encode.bytes=0,T.decode=function(t,e){e||(e=0),e+=2;const r=c.v6.decode(t,e);return T.decode.bytes=18,r},T.decode.bytes=0,T.encodingLength=function(){return 18};const R=e.option={};R.encode=function(t,e,r){e||(e=n.alloc(R.encodingLength(t))),r||(r=0);const i=r,o=u.toCode(t.code);if(e.writeUInt16BE(o,r),r+=2,t.data)e.writeUInt16BE(t.data.length,r),r+=2,t.data.copy(e,r),r+=t.data.length;else switch(o){case 8:const i=t.sourcePrefixLength||0,o=t.family||c.familyOf(t.ip),s=c.encode(t.ip,n.alloc),a=Math.ceil(i/8);e.writeUInt16BE(a+4,r),r+=2,e.writeUInt16BE(o,r),r+=2,e.writeUInt8(i,r++),e.writeUInt8(t.scopePrefixLength||0,r++),s.copy(e,r,0,a),r+=a;break;case 11:t.timeout?(e.writeUInt16BE(2,r),r+=2,e.writeUInt16BE(t.timeout,r),r+=2):(e.writeUInt16BE(0,r),r+=2);break;case 12:const u=t.length||0;e.writeUInt16BE(u,r),r+=2,e.fill(0,r,r+u),r+=u;break;case 14:const l=2*t.tags.length;e.writeUInt16BE(l,r),r+=2;for(const n of t.tags)e.writeUInt16BE(n,r),r+=2;break;default:throw new Error("Unknown roption code: ".concat(t.code))}return R.encode.bytes=r-i,e},R.encode.bytes=0,R.decode=function(t,e){e||(e=0);const r={};r.code=t.readUInt16BE(e),r.type=u.toString(r.code),e+=2;const i=t.readUInt16BE(e);switch(e+=2,r.data=t.slice(e,e+i),r.code){case 8:r.family=t.readUInt16BE(e),e+=2,r.sourcePrefixLength=t.readUInt8(e++),r.scopePrefixLength=t.readUInt8(e++);const o=n.alloc(1===r.family?4:16);t.copy(o,0,e,e+i-4),r.ip=c.decode(o);break;case 11:i>0&&(r.timeout=t.readUInt16BE(e),e+=2);break;case 14:r.tags=[];for(let n=0;n<i;n+=2)r.tags.push(t.readUInt16BE(e)),e+=2}return R.decode.bytes=i+4,r},R.decode.bytes=0,R.encodingLength=function(t){if(t.data)return t.data.length+4;switch(u.toCode(t.code)){case 8:const e=t.sourcePrefixLength||0;return Math.ceil(e/8)+8;case 11:return"number"===typeof t.timeout?6:4;case 12:return t.length+4;case 14:return 4+2*t.tags.length}throw new Error("Unknown roption code: ".concat(t.code))};const k=e.opt={};k.encode=function(t,e,r){e||(e=n.alloc(k.encodingLength(t))),r||(r=0);const i=r,o=K(t,R);return e.writeUInt16BE(o,r),r=F(t,R,e,r+2),k.encode.bytes=r-i,e},k.encode.bytes=0,k.decode=function(t,e){e||(e=0);const r=e,n=[];let i=t.readUInt16BE(e);e+=2;let o=0;for(;i>0;)n[o++]=R.decode(t,e),e+=R.decode.bytes,i-=R.decode.bytes;return k.decode.bytes=e-r,n},k.decode.bytes=0,k.encodingLength=function(t){return 2+K(t||[],R)};const C=e.dnskey={};C.PROTOCOL_DNSSEC=3,C.ZONE_KEY=128,C.SECURE_ENTRYPOINT=32768,C.encode=function(t,e,r){e||(e=n.alloc(C.encodingLength(t))),r||(r=0);const i=r,o=t.key;if(!n.isBuffer(o))throw new Error("Key must be a Buffer");return r+=2,e.writeUInt16BE(t.flags,r),r+=2,e.writeUInt8(C.PROTOCOL_DNSSEC,r),r+=1,e.writeUInt8(t.algorithm,r),r+=1,o.copy(e,r,0,o.length),r+=o.length,C.encode.bytes=r-i,e.writeUInt16BE(C.encode.bytes-2,i),e},C.encode.bytes=0,C.decode=function(t,e){e||(e=0);const r=e;var n={},i=t.readUInt16BE(e);if(e+=2,n.flags=t.readUInt16BE(e),e+=2,t.readUInt8(e)!==C.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return e+=1,n.algorithm=t.readUInt8(e),e+=1,n.key=t.slice(e,r+i+2),e+=n.key.length,C.decode.bytes=e-r,n},C.decode.bytes=0,C.encodingLength=function(t){return 6+n.byteLength(t.key)};const P=e.rrsig={};P.encode=function(t,e,r){e||(e=n.alloc(P.encodingLength(t))),r||(r=0);const o=r,s=t.signature;if(!n.isBuffer(s))throw new Error("Signature must be a Buffer");return r+=2,e.writeUInt16BE(i.toType(t.typeCovered),r),r+=2,e.writeUInt8(t.algorithm,r),r+=1,e.writeUInt8(t.labels,r),r+=1,e.writeUInt32BE(t.originalTTL,r),r+=4,e.writeUInt32BE(t.expiration,r),r+=4,e.writeUInt32BE(t.inception,r),r+=4,e.writeUInt16BE(t.keyTag,r),r+=2,h.encode(t.signersName,e,r),r+=h.encode.bytes,s.copy(e,r,0,s.length),r+=s.length,P.encode.bytes=r-o,e.writeUInt16BE(P.encode.bytes-2,o),e},P.encode.bytes=0,P.decode=function(t,e){e||(e=0);const r=e;var n={},o=t.readUInt16BE(e);return e+=2,n.typeCovered=i.toString(t.readUInt16BE(e)),e+=2,n.algorithm=t.readUInt8(e),e+=1,n.labels=t.readUInt8(e),e+=1,n.originalTTL=t.readUInt32BE(e),e+=4,n.expiration=t.readUInt32BE(e),e+=4,n.inception=t.readUInt32BE(e),e+=4,n.keyTag=t.readUInt16BE(e),e+=2,n.signersName=h.decode(t,e),e+=h.decode.bytes,n.signature=t.slice(e,r+o+2),e+=n.signature.length,P.decode.bytes=e-r,n},P.decode.bytes=0,P.encodingLength=function(t){return 20+h.encodingLength(t.signersName)+n.byteLength(t.signature)};const B=e.rp={};B.encode=function(t,e,r){e||(e=n.alloc(B.encodingLength(t))),r||(r=0);const i=r;return r+=2,h.encode(t.mbox||".",e,r),r+=h.encode.bytes,h.encode(t.txt||".",e,r),r+=h.encode.bytes,B.encode.bytes=r-i,e.writeUInt16BE(B.encode.bytes-2,i),e},B.encode.bytes=0,B.decode=function(t,e){e||(e=0);const r=e,n={};return e+=2,n.mbox=h.decode(t,e)||".",e+=h.decode.bytes,n.txt=h.decode(t,e)||".",e+=h.decode.bytes,B.decode.bytes=e-r,n},B.decode.bytes=0,B.encodingLength=function(t){return 2+h.encodingLength(t.mbox||".")+h.encodingLength(t.txt||".")};const O={encode:function(t,e,r){e||(e=n.alloc(O.encodingLength(t))),r||(r=0);const o=r;for(var s=[],a=0;a<t.length;a++){var u=i.toType(t[a]);void 0===s[u>>8]&&(s[u>>8]=[]),s[u>>8][u>>3&31]|=1<<7-(7&u)}for(a=0;a<s.length;a++)if(void 0!==s[a]){var c=n.from(s[a]);e.writeUInt8(a,r),r+=1,e.writeUInt8(c.length,r),r+=1,c.copy(e,r),r+=c.length}return O.encode.bytes=r-o,e}};O.encode.bytes=0,O.decode=function(t,e,r){e||(e=0);const n=e;for(var o=[];e-n<r;){var s=t.readUInt8(e);e+=1;var a=t.readUInt8(e);e+=1;for(var u=0;u<a;u++)for(var c=t.readUInt8(e+u),l=0;l<8;l++)if(c&1<<7-l){var h=i.toString(s<<8|u<<3|l);o.push(h)}e+=a}return O.decode.bytes=e-n,o},O.decode.bytes=0,O.encodingLength=function(t){for(var e=[],r=0;r<t.length;r++){var n=i.toType(t[r]);e[n>>8]=Math.max(e[n>>8]||0,255&n)}var o=0;for(r=0;r<e.length;r++)void 0!==e[r]&&(o+=2+Math.ceil((e[r]+1)/8));return o};const N=e.nsec={};N.encode=function(t,e,r){e||(e=n.alloc(N.encodingLength(t))),r||(r=0);const i=r;return r+=2,h.encode(t.nextDomain,e,r),r+=h.encode.bytes,O.encode(t.rrtypes,e,r),r+=O.encode.bytes,N.encode.bytes=r-i,e.writeUInt16BE(N.encode.bytes-2,i),e},N.encode.bytes=0,N.decode=function(t,e){e||(e=0);const r=e;var n={},i=t.readUInt16BE(e);return e+=2,n.nextDomain=h.decode(t,e),e+=h.decode.bytes,n.rrtypes=O.decode(t,e,i-(e-r)),e+=O.decode.bytes,N.decode.bytes=e-r,n},N.decode.bytes=0,N.encodingLength=function(t){return 2+h.encodingLength(t.nextDomain)+O.encodingLength(t.rrtypes)};const D=e.nsec3={};D.encode=function(t,e,r){e||(e=n.alloc(D.encodingLength(t))),r||(r=0);const i=r,o=t.salt;if(!n.isBuffer(o))throw new Error("salt must be a Buffer");const s=t.nextDomain;if(!n.isBuffer(s))throw new Error("nextDomain must be a Buffer");return r+=2,e.writeUInt8(t.algorithm,r),r+=1,e.writeUInt8(t.flags,r),r+=1,e.writeUInt16BE(t.iterations,r),r+=2,e.writeUInt8(o.length,r),r+=1,o.copy(e,r,0,o.length),r+=o.length,e.writeUInt8(s.length,r),r+=1,s.copy(e,r,0,s.length),r+=s.length,O.encode(t.rrtypes,e,r),r+=O.encode.bytes,D.encode.bytes=r-i,e.writeUInt16BE(D.encode.bytes-2,i),e},D.encode.bytes=0,D.decode=function(t,e){e||(e=0);const r=e;var n={},i=t.readUInt16BE(e);e+=2,n.algorithm=t.readUInt8(e),e+=1,n.flags=t.readUInt8(e),e+=1,n.iterations=t.readUInt16BE(e),e+=2;const o=t.readUInt8(e);e+=1,n.salt=t.slice(e,e+o),e+=o;const s=t.readUInt8(e);return e+=1,n.nextDomain=t.slice(e,e+s),e+=s,n.rrtypes=O.decode(t,e,i-(e-r)),e+=O.decode.bytes,D.decode.bytes=e-r,n},D.decode.bytes=0,D.encodingLength=function(t){return 8+t.salt.length+t.nextDomain.length+O.encodingLength(t.rrtypes)};const x=e.ds={};x.encode=function(t,e,r){e||(e=n.alloc(x.encodingLength(t))),r||(r=0);const i=r,o=t.digest;if(!n.isBuffer(o))throw new Error("Digest must be a Buffer");return r+=2,e.writeUInt16BE(t.keyTag,r),r+=2,e.writeUInt8(t.algorithm,r),r+=1,e.writeUInt8(t.digestType,r),r+=1,o.copy(e,r,0,o.length),r+=o.length,x.encode.bytes=r-i,e.writeUInt16BE(x.encode.bytes-2,i),e},x.encode.bytes=0,x.decode=function(t,e){e||(e=0);const r=e;var n={},i=t.readUInt16BE(e);return e+=2,n.keyTag=t.readUInt16BE(e),e+=2,n.algorithm=t.readUInt8(e),e+=1,n.digestType=t.readUInt8(e),e+=1,n.digest=t.slice(e,r+i+2),e+=n.digest.length,x.decode.bytes=e-r,n},x.decode.bytes=0,x.encodingLength=function(t){return 6+n.byteLength(t.digest)};const L=e.record=function(t){switch(t.toUpperCase()){case"A":return M;case"PTR":return w;case"CNAME":return _;case"DNAME":return E;case"TXT":return m;case"NULL":return b;case"AAAA":return T;case"SRV":return S;case"HINFO":return v;case"CAA":return I;case"NS":return y;case"SOA":return g;case"MX":return A;case"OPT":return k;case"DNSKEY":return C;case"RRSIG":return P;case"RP":return B;case"NSEC":return N;case"NSEC3":return D;case"DS":return x}return p},U=e.answer={};U.encode=function(t,e,r){e||(e=n.alloc(U.encodingLength(t))),r||(r=0);const o=r;if(h.encode(t.name,e,r),r+=h.encode.bytes,e.writeUInt16BE(i.toType(t.type),r),"OPT"===t.type.toUpperCase()){if("."!==t.name)throw new Error("OPT name must be root.");e.writeUInt16BE(t.udpPayloadSize||4096,r+2),e.writeUInt8(t.extendedRcode||0,r+4),e.writeUInt8(t.ednsVersion||0,r+5),e.writeUInt16BE(t.flags||0,r+6),r+=8,k.encode(t.options||[],e,r),r+=k.encode.bytes}else{let n=a.toClass(void 0===t.class?"IN":t.class);t.flush&&(n|=l),e.writeUInt16BE(n,r+2),e.writeUInt32BE(t.ttl||0,r+4),r+=8;const i=L(t.type);i.encode(t.data,e,r),r+=i.encode.bytes}return U.encode.bytes=r-o,e},U.encode.bytes=0,U.decode=function(t,e){e||(e=0);const r={},n=e;if(r.name=h.decode(t,e),e+=h.decode.bytes,r.type=i.toString(t.readUInt16BE(e)),"OPT"===r.type)r.udpPayloadSize=t.readUInt16BE(e+2),r.extendedRcode=t.readUInt8(e+4),r.ednsVersion=t.readUInt8(e+5),r.flags=t.readUInt16BE(e+6),r.flag_do=1===(r.flags>>15&1),r.options=k.decode(t,e+8),e+=8+k.decode.bytes;else{const n=t.readUInt16BE(e+2);r.ttl=t.readUInt32BE(e+4),r.class=a.toString(-32769&n),r.flush=!!(n&l);const i=L(r.type);r.data=i.decode(t,e+8),e+=8+i.decode.bytes}return U.decode.bytes=e-n,r},U.decode.bytes=0,U.encodingLength=function(t){const e=null!==t.data&&void 0!==t.data?t.data:t.options;return h.encodingLength(t.name)+8+L(t.type).encodingLength(e)};const j=e.question={};function K(t,e){let r=0;for(let n=0;n<t.length;n++)r+=e.encodingLength(t[n]);return r}function F(t,e,r,n){for(let i=0;i<t.length;i++)e.encode(t[i],r,n),n+=e.encode.bytes;return n}function V(t,e,r,n){for(let i=0;i<t.length;i++)t[i]=e.decode(r,n),n+=e.decode.bytes;return n}j.encode=function(t,e,r){e||(e=n.alloc(j.encodingLength(t))),r||(r=0);const o=r;return h.encode(t.name,e,r),r+=h.encode.bytes,e.writeUInt16BE(i.toType(t.type),r),r+=2,e.writeUInt16BE(a.toClass(void 0===t.class?"IN":t.class),r),r+=2,j.encode.bytes=r-o,t},j.encode.bytes=0,j.decode=function(t,e){e||(e=0);const r=e,n={};n.name=h.decode(t,e),e+=h.decode.bytes,n.type=i.toString(t.readUInt16BE(e)),e+=2,n.class=a.toString(t.readUInt16BE(e)),e+=2;return!!(32768&n.class)&&(n.class&=-32769),j.decode.bytes=e-r,n},j.decode.bytes=0,j.encodingLength=function(t){return h.encodingLength(t.name)+4},e.AUTHORITATIVE_ANSWER=1024,e.TRUNCATED_RESPONSE=512,e.RECURSION_DESIRED=256,e.RECURSION_AVAILABLE=128,e.AUTHENTIC_DATA=32,e.CHECKING_DISABLED=16,e.DNSSEC_OK=32768,e.encode=function(t,r,i){const o=!r;o&&(r=n.alloc(e.encodingLength(t))),i||(i=0);const s=i;return t.questions||(t.questions=[]),t.answers||(t.answers=[]),t.authorities||(t.authorities=[]),t.additionals||(t.additionals=[]),d.encode(t,r,i),i+=d.encode.bytes,i=F(t.questions,j,r,i),i=F(t.answers,U,r,i),i=F(t.authorities,U,r,i),i=F(t.additionals,U,r,i),e.encode.bytes=i-s,o&&e.encode.bytes!==r.length?r.slice(0,e.encode.bytes):r},e.encode.bytes=0,e.decode=function(t,r){r||(r=0);const n=r,i=d.decode(t,r);return r+=d.decode.bytes,r=V(i.questions,j,t,r),r=V(i.answers,U,t,r),r=V(i.authorities,U,t,r),r=V(i.additionals,U,t,r),e.decode.bytes=r-n,i},e.decode.bytes=0,e.encodingLength=function(t){return d.encodingLength(t)+K(t.questions||[],j)+K(t.answers||[],U)+K(t.authorities||[],U)+K(t.additionals||[],U)},e.streamEncode=function(t){const r=e.encode(t),i=n.alloc(2);i.writeUInt16BE(r.byteLength);const o=n.concat([i,r]);return e.streamEncode.bytes=o.byteLength,o},e.streamEncode.bytes=0,e.streamDecode=function(t){const r=t.readUInt16BE(0);if(t.byteLength<r+2)return null;const n=e.decode(t.slice(2));return e.streamDecode.bytes=e.decode.bytes,n},e.streamDecode.bytes=0},71365:(t,e)=>{"use strict";e.toString=function(t){switch(t){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+t},e.toOpcode=function(t){switch(t.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}},61974:(t,e)=>{"use strict";e.toString=function(t){switch(t){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return t<0?null:"OPTION_".concat(t)},e.toCode=function(t){if("number"===typeof t)return t;if(!t)return-1;switch(t.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}const e=t.match(/_(\d+)$/);return e?parseInt(e[1],10):-1}},2266:(t,e)=>{"use strict";e.toString=function(t){switch(t){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+t},e.toRcode=function(t){switch(t.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}},82936:(t,e)=>{"use strict";e.toString=function(t){switch(t){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+t},e.toType=function(t){switch(t.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":case"*":return 255}return t.toUpperCase().startsWith("UNKNOWN_")?parseInt(t.slice(8)):0}},6289:(t,e,r)=>{"use strict";var n=e;n.version=r(18597).i8,n.utils=r(82629),n.rand=r(26084),n.curve=r(37075),n.curves=r(13297),n.ec=r(74170),n.eddsa=r(20156)},55950:(t,e,r)=>{"use strict";var n=r(37548),i=r(82629),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var s,u,c=[];for(s=0;s<n.length;s+=r.step){u=0;for(var l=s+r.step-1;l>=s;l--)u=(u<<1)+n[l];c.push(u)}for(var h=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<c.length;s++)(u=c[s])===d?f=f.mixedAdd(r.points[s]):u===-d&&(f=f.mixedAdd(r.points[s].neg()));h=h.add(f)}return h.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var l=0;c>=0&&0===s[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var h=s[c];a(0!==h),u="affine"===t.type?h>0?u.mixedAdd(i[h-1>>1]):u.mixedAdd(i[-h-1>>1].neg()):h>0?u.add(i[h-1>>1]):u.add(i[-h-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,c,l=this._wnafT1,h=this._wnafT2,f=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(c=e[a])._getNAFPoints(t);l[a]=p.wnd,h[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,g=a;if(1===l[y]&&1===l[g]){var m=[e[y],null,null,e[g]];0===e[y].y.cmp(e[g].y)?(m[1]=e[y].add(e[g]),m[2]=e[y].toJ().mixedAdd(e[g].neg())):0===e[y].y.cmp(e[g].y.redNeg())?(m[1]=e[y].toJ().mixedAdd(e[g]),m[2]=e[y].add(e[g].neg())):(m[1]=e[y].toJ().mixedAdd(e[g]),m[2]=e[y].toJ().mixedAdd(e[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[g]);for(d=Math.max(v[0].length,d),f[y]=new Array(d),f[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],_=0|v[1][u];f[y][u]=b[3*(w+1)+(_+1)],f[g][u]=0,h[y]=m}}else f[y]=o(r[y],l[y],this._bitLength),f[g]=o(r[g],l[g],this._bitLength),d=Math.max(f[y].length,d),d=Math.max(f[g].length,d)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var I=0;a>=0;){var A=!0;for(u=0;u<n;u++)S[u]=0|f[u][a],0!==S[u]&&(A=!1);if(!A)break;I++,a--}if(a>=0&&I++,E=E.dblp(I),a<0)break;for(u=0;u<n;u++){var M=S[u];0!==M&&(M>0?c=h[u][M-1>>1]:M<0&&(c=h[u][-M-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(a=0;a<n;a++)h[a]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1===2*r)return 6===t[0]?a(t[t.length-1]%2===0):7===t[0]&&a(t[t.length-1]%2===1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},72124:(t,e,r)=>{"use strict";var n=r(82629),i=r(37548),o=r(12534),s=r(55950),a=n.assert;function u(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&-1===(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function c(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),c=o.redMul(a),l=i.redMul(a),h=s.redMul(o);return this.curve.point(u,c,h,l)},c.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),e=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),c=o.redMul(s),l=a.redMul(u),h=o.redMul(u),f=s.redMul(a);return this.curve.point(c,l,f,h)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),h=n.redMul(u).redMul(l);return this.curve.twisted?(e=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(h,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},37075:(t,e,r)=>{"use strict";var n=e;n.base=r(55950),n.short=r(95536),n.mont=r(29113),n.edwards=r(72124)},29113:(t,e,r)=>{"use strict";var n=r(37548),i=r(12534),o=r(55950),s=r(82629);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},95536:(t,e,r)=>{"use strict";var n=r(82629),i=r(37548),o=r(12534),s=r(55950),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,c,l,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,d=this.n.clone(),p=new i(1),y=new i(0),g=new i(0),m=new i(1),b=0;0!==f.cmpn(0);){var v=d.div(f);c=d.sub(v.mul(f)),l=g.sub(v.mul(p));var w=m.sub(v.mul(y));if(!n&&c.cmp(h)<0)e=u.neg(),r=p,n=c.neg(),o=l;else if(n&&2===++b)break;u=c,d=f,f=c,g=p,p=l,m=y,y=w}s=c.neg(),a=l;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},o(c,s.BasePoint),u.prototype.point=function(t,e,r){return new c(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return c.fromJSON(this,t,e)},c.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(t,e,r){"string"===typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new l(this,t,e,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),h=n.redMul(c),f=u.redSqr().redIAdd(l).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),l=r.redMul(u),h=a.redSqr().redIAdd(c).redISub(l).redISub(l),f=a.redMul(l.redISub(h)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(e=0;e<t;e++){var l=o.redSqr(),h=c.redSqr(),f=h.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(h),y=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),m=d.redMul(g);m=m.redIAdd(m).redISub(f);var b=c.redMul(a);e+1<t&&(u=u.redMul(f)),o=y,a=b,c=m}return this.curve.jpoint(o,c.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=u,e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),h=this.y.redSqr(),f=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(l).redISub(f);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),y=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),t=y.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},l.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),h=this.y.redSqr(),f=this.x.redMul(h),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),y=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(l);var g=h.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},l.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(s),l=a.redSqr().redISub(c.redAdd(c)),h=c.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(h).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),l=e.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.x.redMul(a).redISub(l);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,f,d)},l.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},l.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},13297:(t,e,r)=>{"use strict";var n,i=e,o=r(33125),s=r(37075),a=r(82629).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(31025)}catch(l){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},74170:(t,e,r)=>{"use strict";var n=r(37548),i=r(17411),o=r(82629),s=r(13297),a=r(26084),u=o.assert,c=r(80615),l=r(23198);function h(t){if(!(this instanceof h))return new h(t);"string"===typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new c(this,t)},h.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,o){"object"===typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),f=0;;f++){var d=o.k?o.k(f):new n(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var y=p.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var m=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),b^=1),new l({r:g,s:m,recoveryParam:b})}}}}}},h.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new l(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(t).umod(this.n),h=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new l(e,i);var o=this.n,s=new n(t),a=e.r,c=e.s,h=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),h):this.curve.pointFromX(a,h);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),y=c.mul(d).umod(o);return this.g.mulAdd(p,a,y)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new l(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},80615:(t,e,r)=>{"use strict";var n=r(37548),i=r(82629).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"===typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},23198:(t,e,r)=>{"use strict";var n=r(37548),i=r(82629),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function l(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var c=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var l=u(t,r);if(!1===l)return!1;if(t.length!==l+r.place)return!1;var h=t.slice(r.place,l+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(c),this.s=new n(h),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,t)}},20156:(t,e,r)=>{"use strict";var n=r(33125),i=r(13297),o=r(82629),s=o.assert,a=o.parseBytes,u=r(1722),c=r(68574);function l(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof l))return new l(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=l,l.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},l.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},l.prototype.makeSignature=function(t){return t instanceof c?t:new c(this,t)},l.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},l.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!==(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(t){return o.intFromLE(t)},l.prototype.isPoint=function(t){return t instanceof this.pointClass}},1722:(t,e,r)=>{"use strict";var n=r(82629),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},68574:(t,e,r)=>{"use strict";var n=r(37548),i=r(82629),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!==typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},31025:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},82629:(t,e,r)=>{"use strict";var n=e,i=r(37548),o=r(72325),s=r(94034);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,c=e.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0===(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0===(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"===typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},37548:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(85568).Buffer}catch(A){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):y(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new I(t)},i(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},67963:t=>{"use strict";function e(t,e){for(const r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}t.exports=function(t,r,n){if(!t||"string"===typeof t)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"===typeof r&&(n=r,r=""),r&&(n.code=r);try{return e(t,n)}catch(i){n.message=t.message,n.stack=t.stack;const r=function(){};r.prototype=Object.create(Object.getPrototypeOf(t));return e(new r,n)}}},50887:t=>{"use strict";function e(t,e){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(void 0!==i&&null!==i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var u=o[s],c=Object.getOwnPropertyDescriptor(i,u);void 0!==c&&c.enumerable&&(r[u]=i[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},51590:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.promisify=r;function r(t){if("function"!=typeof t)throw new TypeError("Argument to promisify must be a function");var e=t["__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"],n=r.Promise||Promise;if("function"!=typeof n)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var r=this,i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];return new n((function(n,i){o.push((function(t){if(t)return i(t);for(var r=arguments.length,o=Array(1<r?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];if(1===o.length||!e)return n(o[0]);var a={};o.forEach((function(t,r){var n=e[r];n&&(a[n]=t)})),n(a)})),t.apply(r,o)}))}}r.argumentNames="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__",r.Promise=void 0},3634:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(45413);e.EventIterator=n.EventIterator,e.subscribe=function(t,e,r){return new n.EventIterator((r=>{let{push:n}=r;return this.addEventListener(t,n,e),()=>this.removeEventListener(t,n,e)}),r)},e.default=n.EventIterator},45413:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class r{constructor(){this.pullQueue=[],this.pushQueue=[],this.eventHandlers={},this.isPaused=!1,this.isStopped=!1}push(t){if(this.isStopped)return;const e={value:t,done:!1};if(this.pullQueue.length){const t=this.pullQueue.shift();t&&t.resolve(e)}else this.pushQueue.push(Promise.resolve(e)),void 0!==this.highWaterMark&&this.pushQueue.length>=this.highWaterMark&&!this.isPaused&&(this.isPaused=!0,this.eventHandlers.highWater?this.eventHandlers.highWater():console&&console.warn("EventIterator queue reached ".concat(this.pushQueue.length," items")))}stop(){if(!this.isStopped){this.isStopped=!0,this.remove();for(const t of this.pullQueue)t.resolve({value:void 0,done:!0});this.pullQueue.length=0}}fail(t){if(!this.isStopped)if(this.isStopped=!0,this.remove(),this.pullQueue.length){for(const e of this.pullQueue)e.reject(t);this.pullQueue.length=0}else{const e=Promise.reject(t);e.catch((()=>{})),this.pushQueue.push(e)}}remove(){Promise.resolve().then((()=>{this.removeCallback&&this.removeCallback()}))}[Symbol.asyncIterator](){return{next:t=>{const e=this.pushQueue.shift();return e?(void 0!==this.lowWaterMark&&this.pushQueue.length<=this.lowWaterMark&&this.isPaused&&(this.isPaused=!1,this.eventHandlers.lowWater&&this.eventHandlers.lowWater()),e):this.isStopped?Promise.resolve({value:void 0,done:!0}):new Promise(((t,e)=>{this.pullQueue.push({resolve:t,reject:e})}))},return:()=>(this.isStopped=!0,this.pushQueue.length=0,this.remove(),Promise.resolve({value:void 0,done:!0}))}}}class n{constructor(t){let{highWaterMark:e=100,lowWaterMark:n=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new r;i.highWaterMark=e,i.lowWaterMark=n,i.removeCallback=t({push:t=>i.push(t),stop:()=>i.stop(),fail:t=>i.fail(t),on:(t,e)=>{i.eventHandlers[t]=e}})||(()=>{}),this[Symbol.asyncIterator]=()=>i[Symbol.asyncIterator](),Object.freeze(this)}}e.EventIterator=n,e.default=n},97143:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!==typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0===--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var u,c,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,i),!0;case 5:return l.fn.call(l.context,e,n,i,o),!0;case 6:return l.fn.call(l.context,e,n,i,o,s),!0}for(c=1,u=new Array(h-1);c<h;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,i);break;default:if(!u)for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],l=a.length;u<l;u++)(a[u].fn!==e||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},47465:t=>{"use strict";var e,r="object"===typeof Reflect?Reflect:null,n=r&&"function"===typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"===typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!==t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"===typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"===typeof t.on&&y(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"===typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(t,e,r,n){if("function"===typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!==typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!==typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!==typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"===typeof u)n(u,this,e);else{var c=u.length,l=p(u,c);for(r=0;r<c;++r)n(l[r],this,e)}return!0},o.prototype.addListener=function(t,e){return c(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return c(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,h(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,h(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!==typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},48462:(t,e,r)=>{var n=r(82543).Buffer,i=r(68437);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),c=n.alloc(0);s>0||o>0;){var l=new i;l.update(c),l.update(t),e&&l.update(e),c=l.digest();var h=0;if(s>0){var f=a.length-s;h=Math.min(s,c.length),c.copy(a,f,0,h),s-=h}if(h<c.length&&o>0){var d=u.length-o,p=Math.min(o,c.length-h);c.copy(u,d,h,h+p),o-=p}}return c.fill(0),{key:a,iv:u}}},11167:t=>{t.exports=class{constructor(t){if(!(t>0)||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 void 0===this.buffer[this.top]&&(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){const t=this.buffer[this.btm];if(void 0!==t)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}}},75125:(t,e,r)=>{const n=r(11167);t.exports=class{constructor(t){this.hwm=t||16,this.head=new n(this.hwm),this.tail=this.head}push(t){if(!this.head.push(t)){const e=this.head;this.head=e.next=new n(2*this.head.buffer.length),this.head.push(t)}}shift(){const t=this.tail.shift();if(void 0===t&&this.tail.next){const t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return t}peek(){return this.tail.peek()}isEmpty(){return this.head.isEmpty()}}},27910:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s<o;s++)n.call(i,t[s],s,t);else for(var a in t)e.call(t,a)&&n.call(i,t[a],a,t)}},30222:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!==typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),l=[],h=0;h<c;h++)l.push("$"+h);if(s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(u),o.prototype){var f=function(){};f.prototype=o.prototype,s.prototype=new f,f.prototype=null}return s}},33350:(t,e,r)=>{"use strict";var n=r(30222);t.exports=Function.prototype.bind||n},52506:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(R){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(e){return c}}}():c,h=r(80697)(),f=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"===typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"===typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"===typeof Atomics?n:Atomics,"%BigInt%":"undefined"===typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"===typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?f(f([][Symbol.iterator]())):n,"%JSON%":"object"===typeof JSON?JSON:n,"%Map%":"undefined"===typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&h?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?n:Promise,"%Proxy%":"undefined"===typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&h?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"===typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[e]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(33350),v=r(58316),w=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),E=b.call(Function.call,String.prototype.replace),S=b.call(Function.call,String.prototype.slice),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,M=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return E(t,I,(function(t,e,r,i){n[n.length]=r?E(i,A,"$1"):e||t})),n},T=function(t,e){var r,n=t;if(v(m,n)&&(n="%"+(r=m[n])[0]+"%"),v(y,n)){var o=y[n];if(o===d&&(o=g(n)),"undefined"===typeof o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!==typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof e)throw new s('"allowMissing" argument must be a boolean');var r=M(t),n=r.length>0?r[0]:"",o=T("%"+n+"%",e),a=o.name,c=o.value,l=!1,h=o.alias;h&&(n=h[0],_(r,w([0,1],h)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],g=S(p,0,1),m=S(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===m||"'"===m||"`"===m)&&g!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&d||(l=!0),v(y,a="%"+(n+="."+p)+"%"))c=y[a];else if(null!=c){if(!(p in c)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var b=u(c,p);c=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[p]}else d=v(c,p),c=c[p];d&&!l&&(y[a]=c)}}return c}},38295:t=>{t.exports=function(t){if(t){if("function"===typeof t[Symbol.iterator])return t[Symbol.iterator]();if("function"===typeof t[Symbol.asyncIterator])return t[Symbol.asyncIterator]();if("function"===typeof t.next)return t}throw new Error("argument is not an iterator or iterable")}},84510:(t,e,r)=>{"use strict";var n=r(52506)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},80697:(t,e,r)=>{"use strict";var n="undefined"!==typeof Symbol&&Symbol,i=r(63297);t.exports=function(){return"function"===typeof n&&("function"===typeof Symbol&&("symbol"===typeof n("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},63297:t=>{"use strict";t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"===typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"===typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4707:(t,e,r)=>{"use strict";var n=r(63297);t.exports=function(){return n()&&!!Symbol.toStringTag}},58316:(t,e,r)=>{"use strict";var n=r(33350);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},86266:(t,e,r)=>{"use strict";var n=r(11160).Buffer,i=r(90723).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(12534)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},11160:(t,e,r)=>{var n=r(19778),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},33125:(t,e,r)=>{var n=e;n.utils=r(79046),n.common=r(79684),n.sha=r(39194),n.ripemd=r(56645),n.hmac=r(93609),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},79684:(t,e,r)=>{"use strict";var n=r(79046),i=r(72325);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},93609:(t,e,r)=>{"use strict";var n=r(79046),i=r(72325);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},56645:(t,e,r)=>{"use strict";var n=r(79046),i=r(79684),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function f(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(l,c),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],l=this.h[4],b=r,v=n,w=i,_=c,E=l,S=0;S<80;S++){var I=s(o(u(r,h(S,n,i,c),t[p[S]+e],f(S)),g[S]),l);r=l,l=c,c=o(i,10),i=n,n=I,I=s(o(u(b,h(79-S,v,w,_),t[y[S]+e],d(S)),m[S]),E),b=E,E=_,_=o(w,10),w=v,v=I}I=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,E),this.h[2]=a(this.h[3],l,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=I},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},39194:(t,e,r)=>{"use strict";e.sha1=r(77361),e.sha224=r(77753),e.sha256=r(76966),e.sha384=r(51233),e.sha512=r(59063)},77361:(t,e,r)=>{"use strict";var n=r(79046),i=r(79684),o=r(34343),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,l),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],f=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),c(p,o,l,f),d,r[n],h[p]);d=f,f=l,l=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],d)},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},77753:(t,e,r)=>{"use strict";var n=r(79046),i=r(76966);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},76966:(t,e,r)=>{"use strict";var n=r(79046),i=r(79684),o=r(34343),s=r(72325),a=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,h=o.maj32,f=o.s0_256,d=o.s1_256,p=o.g0_256,y=o.g1_256,g=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,g),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,d(b),l(b,v,w),this.k[n],r[n]),S=a(f(i),h(i,o,g));_=w,w=v,v=b,b=a(m,E),m=g,g=o,o=i,i=a(E,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},51233:(t,e,r)=>{"use strict";var n=r(79046),i=r(59063);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},59063:(t,e,r)=>{"use strict";var n=r(79046),i=r(79684),o=r(72325),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,l=n.sum64,h=n.sum64_hi,f=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,m=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function E(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function I(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function R(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,1)^a(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,19)^a(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=C(r[n-4],r[n-3]),o=P(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=R(r[n-30],r[n-29]),c=k(r[n-30],r[n-29]),l=r[n-32],h=r[n-31];r[n]=d(i,o,s,a,u,c,l,h),r[n+1]=p(i,o,s,a,u,c,l,h)}},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],m=this.h[8],b=this.h[9],v=this.h[10],R=this.h[11],k=this.h[12],C=this.h[13],P=this.h[14],B=this.h[15];o(this.k.length===r.length);for(var O=0;O<r.length;O+=2){var N=P,D=B,x=M(m,b),L=T(m,b),U=w(m,b,v,R,k),j=_(m,b,v,R,k,C),K=this.k[O],F=this.k[O+1],V=r[O],q=r[O+1],z=y(N,D,x,L,U,j,K,F,V,q),H=g(N,D,x,L,U,j,K,F,V,q);N=I(n,i),D=A(n,i),x=E(n,i,s,a,u),L=S(n,i,s,a,u,c);var G=h(N,D,x,L),W=f(N,D,x,L);P=k,B=C,k=v,C=R,v=m,R=b,m=h(d,p,z,H),b=f(p,p,z,H),d=u,p=c,u=s,c=a,s=n,a=i,n=h(z,H,G,W),i=f(z,H,G,W)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,u,c),l(this.h,6,d,p),l(this.h,8,m,b),l(this.h,10,v,R),l(this.h,12,k,C),l(this.h,14,P,B)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},34343:(t,e,r)=>{"use strict";var n=r(79046).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},79046:(t,e,r)=>{"use strict";var n=r(72325),i=r(12534);function o(t,e){return 55296===(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,i){var o=r-e;n(o%4===0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var c;c="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=c>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,c=e;return u+=(c=c+n>>>0)<e?1:0,u+=(c=c+o>>>0)<o?1:0,t+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,c){var l=0,h=e;return l+=(h=h+n>>>0)<e?1:0,l+=(h=h+o>>>0)<o?1:0,l+=(h=h+a>>>0)<a?1:0,t+r+i+s+u+(l+=(h=h+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,c){return e+n+o+a+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},34737:t=>{t.exports=function(t){if(!t)throw Error("hashlru must have a max value, of type number, greater than 0");var e=0,r=Object.create(null),n=Object.create(null);function i(i,o){r[i]=o,++e>=t&&(e=0,n=r,r=Object.create(null))}return{has:function(t){return void 0!==r[t]||void 0!==n[t]},remove:function(t){void 0!==r[t]&&(r[t]=void 0),void 0!==n[t]&&(n[t]=void 0)},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=n[t])?(i(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:i(t,e)},clear:function(){r=Object.create(null),n=Object.create(null)}}}},49437:(t,e,r)=>{var n,i=r(21964);!function(){"use strict";var e="object"===typeof window?window:{};!e.HI_BASE32_NO_NODE_JS&&"object"===typeof i&&i.versions&&i.versions.node&&(e=r.g);var o=!e.HI_BASE32_NO_COMMON_JS&&t.exports,s=r.amdO,a="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),u={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],l=function(t,e){e.length>10&&(e="..."+e.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+t+" bytes: "+e+" <-");throw r.position=t,r},h=function(t){if(""===t)return[];if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");for(var e,r,n,i,o,s,a,c,l=[],h=0,f=(t=t.replace(/=/g,"")).length,d=0,p=f>>3<<3;d<p;)e=u[t.charAt(d++)],r=u[t.charAt(d++)],n=u[t.charAt(d++)],i=u[t.charAt(d++)],o=u[t.charAt(d++)],s=u[t.charAt(d++)],a=u[t.charAt(d++)],c=u[t.charAt(d++)],l[h++]=255&(e<<3|r>>>2),l[h++]=255&(r<<6|n<<1|i>>>4),l[h++]=255&(i<<4|o>>>1),l[h++]=255&(o<<7|s<<2|a>>>3),l[h++]=255&(a<<5|c);var y=f-p;return 2===y?(e=u[t.charAt(d++)],r=u[t.charAt(d++)],l[h++]=255&(e<<3|r>>>2)):4===y?(e=u[t.charAt(d++)],r=u[t.charAt(d++)],n=u[t.charAt(d++)],i=u[t.charAt(d++)],l[h++]=255&(e<<3|r>>>2),l[h++]=255&(r<<6|n<<1|i>>>4)):5===y?(e=u[t.charAt(d++)],r=u[t.charAt(d++)],n=u[t.charAt(d++)],i=u[t.charAt(d++)],o=u[t.charAt(d++)],l[h++]=255&(e<<3|r>>>2),l[h++]=255&(r<<6|n<<1|i>>>4),l[h++]=255&(i<<4|o>>>1)):7===y&&(e=u[t.charAt(d++)],r=u[t.charAt(d++)],n=u[t.charAt(d++)],i=u[t.charAt(d++)],o=u[t.charAt(d++)],s=u[t.charAt(d++)],a=u[t.charAt(d++)],l[h++]=255&(e<<3|r>>>2),l[h++]=255&(r<<6|n<<1|i>>>4),l[h++]=255&(i<<4|o>>>1),l[h++]=255&(o<<7|s<<2|a>>>3)),l},f=function(t,e){if(!e)return function(t){for(var e,r,n="",i=t.length,o=0,s=0;o<i;)if((e=t[o++])<=127)n+=String.fromCharCode(e);else{e>191&&e<=223?(r=31&e,s=1):e<=239?(r=15&e,s=2):e<=247?(r=7&e,s=3):l(o,n);for(var a=0;a<s;++a)((e=t[o++])<128||e>191)&&l(o,n),r<<=6,r+=63&e;r>=55296&&r<=57343&&l(o,n),r>1114111&&l(o,n),r<=65535?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+(1023&r)))}return n}(h(t));if(""===t)return"";if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");var r,n,i,o,s,a,c,f,d="",p=t.indexOf("=");-1===p&&(p=t.length);for(var y=0,g=p>>3<<3;y<g;)r=u[t.charAt(y++)],n=u[t.charAt(y++)],i=u[t.charAt(y++)],o=u[t.charAt(y++)],s=u[t.charAt(y++)],a=u[t.charAt(y++)],c=u[t.charAt(y++)],f=u[t.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))+String.fromCharCode(255&(s<<7|a<<2|c>>>3))+String.fromCharCode(255&(c<<5|f));var m=p-g;return 2===m?(r=u[t.charAt(y++)],n=u[t.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))):4===m?(r=u[t.charAt(y++)],n=u[t.charAt(y++)],i=u[t.charAt(y++)],o=u[t.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))):5===m?(r=u[t.charAt(y++)],n=u[t.charAt(y++)],i=u[t.charAt(y++)],o=u[t.charAt(y++)],s=u[t.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))):7===m&&(r=u[t.charAt(y++)],n=u[t.charAt(y++)],i=u[t.charAt(y++)],o=u[t.charAt(y++)],s=u[t.charAt(y++)],a=u[t.charAt(y++)],c=u[t.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))+String.fromCharCode(255&(s<<7|a<<2|c>>>3))),d},d={encode:function(t,e){var r="string"!==typeof t;return r&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),r?function(t){for(var e,r,n,i,o,s="",u=t.length,c=0,l=5*parseInt(u/5);c<l;)e=t[c++],r=t[c++],n=t[c++],i=t[c++],o=t[c++],s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[31&(i<<3|o>>>5)]+a[31&o];var h=u-l;return 1===h?(e=t[c],s+=a[e>>>3]+a[e<<2&31]+"======"):2===h?(e=t[c++],r=t[c],s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[r<<4&31]+"===="):3===h?(e=t[c++],r=t[c++],n=t[c],s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[n<<1&31]+"==="):4===h&&(e=t[c++],r=t[c++],n=t[c++],i=t[c],s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[i<<3&31]+"="),s}(t):e?function(t){for(var e,r,n,i,o,s="",u=t.length,c=0,l=5*parseInt(u/5);c<l;)e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),i=t.charCodeAt(c++),o=t.charCodeAt(c++),s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[31&(i<<3|o>>>5)]+a[31&o];var h=u-l;return 1===h?(e=t.charCodeAt(c),s+=a[e>>>3]+a[e<<2&31]+"======"):2===h?(e=t.charCodeAt(c++),r=t.charCodeAt(c),s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[r<<4&31]+"===="):3===h?(e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c),s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[n<<1&31]+"==="):4===h&&(e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),i=t.charCodeAt(c),s+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[i<<3&31]+"="),s}(t):function(t){var e,r,n,i,o,s,u,l=!1,h="",f=0,d=0,p=t.length;if(""===t)return h;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],u=d;f<p&&u<5;++f)(s=t.charCodeAt(f))<128?c[u++]=s:s<2048?(c[u++]=192|s>>6,c[u++]=128|63&s):s<55296||s>=57344?(c[u++]=224|s>>12,c[u++]=128|s>>6&63,c[u++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++f)),c[u++]=240|s>>18,c[u++]=128|s>>12&63,c[u++]=128|s>>6&63,c[u++]=128|63&s);d=u-5,f===p&&++f,f>p&&u<6&&(l=!0),e=c[0],u>4?(r=c[1],n=c[2],i=c[3],o=c[4],h+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[31&(i<<3|o>>>5)]+a[31&o]):1===u?h+=a[e>>>3]+a[e<<2&31]+"======":2===u?(r=c[1],h+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[r<<4&31]+"===="):3===u?(r=c[1],n=c[2],h+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[n<<1&31]+"==="):(r=c[1],n=c[2],i=c[3],h+=a[e>>>3]+a[31&(e<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[i<<3&31]+"=")}while(!l);return h}(t)},decode:f};f.asBytes=h,o?t.exports=d:(e.base32=d,s&&(void 0===(n=function(){return d}.call(d,r,d,t))||(t.exports=n)))}()},17411:(t,e,r)=>{"use strict";var n=r(33125),i=r(94034),o=r(72325);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!==typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},84038:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*y}},67263:t=>{"use strict";t.exports=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(r={indent:" ",includeEmptyLines:!1,...r},"string"!==typeof t)throw new TypeError("Expected `input` to be a `string`, got `".concat(typeof t,"`"));if("number"!==typeof e)throw new TypeError("Expected `count` to be a `number`, got `".concat(typeof e,"`"));if("string"!==typeof r.indent)throw new TypeError("Expected `options.indent` to be a `string`, got `".concat(typeof r.indent,"`"));if(0===e)return t;const n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(n,r.indent.repeat(e))}},12534:t=>{"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},96831:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.v6=e.AddressError=e.Address6=e.Address4=void 0;var s=r(84595);Object.defineProperty(e,"Address4",{enumerable:!0,get:function(){return s.Address4}});var a=r(44111);Object.defineProperty(e,"Address6",{enumerable:!0,get:function(){return a.Address6}});var u=r(5383);Object.defineProperty(e,"AddressError",{enumerable:!0,get:function(){return u.AddressError}});var c=o(r(15011));e.v6={helpers:c}},5383:function(t,e){"use strict";var r=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.AddressError=void 0;var n=function(t){function e(e,r){var n=t.call(this,e)||this;return n.name="AddressError",null!==r&&(n.parseMessage=r),n}return r(e,t),e}(Error);e.AddressError=n},44201:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isCorrect=e.isInSubnet=void 0,e.isInSubnet=function(t){return!(this.subnetMask<t.subnetMask)&&this.mask(t.subnetMask)===t.mask()},e.isCorrect=function(t){return function(){return this.addressMinusSuffix===this.correctForm()&&(this.subnetMask===t&&!this.parsedSubnet||this.parsedSubnet===String(this.subnetMask))}}},84595:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Address4=void 0;var s=o(r(44201)),a=o(r(81765)),u=r(5383),c=r(87018),l=r(430),h=function(){function t(t){this.groups=a.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=s.isCorrect(a.BITS),this.isInSubnet=s.isInSubnet,this.address=t;var e=a.RE_SUBNET_STRING.exec(t);if(e){if(this.parsedSubnet=e[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,this.subnetMask<0||this.subnetMask>a.BITS)throw new u.AddressError("Invalid subnet mask.");t=t.replace(a.RE_SUBNET_STRING,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}return t.isValid=function(e){try{return new t(e),!0}catch(r){return!1}},t.prototype.parse=function(t){var e=t.split(".");if(!t.match(a.RE_ADDRESS))throw new u.AddressError("Invalid IPv4 address.");return e},t.prototype.correctForm=function(){return this.parsedAddress.map((function(t){return parseInt(t,10)})).join(".")},t.fromHex=function(e){var r,n=e.replace(/:/g,"").padStart(8,"0"),i=[];for(r=0;r<8;r+=2){var o=n.slice(r,r+2);i.push(parseInt(o,16))}return new t(i.join("."))},t.fromInteger=function(e){return t.fromHex(e.toString(16))},t.fromArpa=function(e){return new t(e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join("."))},t.prototype.toHex=function(){return this.parsedAddress.map((function(t){return l.sprintf("%02x",parseInt(t,10))})).join(":")},t.prototype.toArray=function(){return this.parsedAddress.map((function(t){return parseInt(t,10)}))},t.prototype.toGroup6=function(){var t,e=[];for(t=0;t<a.GROUPS;t+=2){var r=l.sprintf("%02x%02x",parseInt(this.parsedAddress[t],10),parseInt(this.parsedAddress[t+1],10));e.push(l.sprintf("%x",parseInt(r,16)))}return e.join(":")},t.prototype.bigInteger=function(){return new c.BigInteger(this.parsedAddress.map((function(t){return l.sprintf("%02x",parseInt(t,10))})).join(""),16)},t.prototype._startAddress=function(){return new c.BigInteger(this.mask()+"0".repeat(a.BITS-this.subnetMask),2)},t.prototype.startAddress=function(){return t.fromBigInteger(this._startAddress())},t.prototype.startAddressExclusive=function(){var e=new c.BigInteger("1");return t.fromBigInteger(this._startAddress().add(e))},t.prototype._endAddress=function(){return new c.BigInteger(this.mask()+"1".repeat(a.BITS-this.subnetMask),2)},t.prototype.endAddress=function(){return t.fromBigInteger(this._endAddress())},t.prototype.endAddressExclusive=function(){var e=new c.BigInteger("1");return t.fromBigInteger(this._endAddress().subtract(e))},t.fromBigInteger=function(e){return t.fromInteger(parseInt(e.toString(),10))},t.prototype.mask=function(t){return void 0===t&&(t=this.subnetMask),this.getBitsBase2(0,t)},t.prototype.getBitsBase2=function(t,e){return this.binaryZeroPad().slice(t,e)},t.prototype.reverseForm=function(t){t||(t={});var e=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?e:l.sprintf("%s.in-addr.arpa.",e)},t.prototype.isMulticast=function(){return this.isInSubnet(new t("224.0.0.0/4"))},t.prototype.binaryZeroPad=function(){return this.bigInteger().toString(2).padStart(a.BITS,"0")},t.prototype.groupForV6=function(){var t=this.parsedAddress;return this.address.replace(a.RE_ADDRESS,l.sprintf('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))},t}();e.Address4=h},44111:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Address6=void 0;var a=o(r(44201)),u=o(r(81765)),c=o(r(69511)),l=o(r(15011)),h=r(84595),f=r(92703),d=r(5383),p=r(87018),y=r(430);function g(t){if(!t)throw new Error("Assertion failed.")}function m(t){return t=(t=t.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2')).replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2')}function b(t){return y.sprintf("%04x",parseInt(t,16))}function v(t){return 255&t}var w=function(){function t(t,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=a.isInSubnet,this.isCorrect=a.isCorrect(c.BITS),this.groups=void 0===e?c.GROUPS:e,this.address=t;var r=c.RE_SUBNET_STRING.exec(t);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>c.BITS)throw new d.AddressError("Invalid subnet mask.");t=t.replace(c.RE_SUBNET_STRING,"")}else if(/\//.test(t))throw new d.AddressError("Invalid subnet mask.");var n=c.RE_ZONE_STRING.exec(t);n&&(this.zone=n[0],t=t.replace(c.RE_ZONE_STRING,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}return t.isValid=function(e){try{return new t(e),!0}catch(r){return!1}},t.fromBigInteger=function(e){var r,n=e.toString(16).padStart(32,"0"),i=[];for(r=0;r<c.GROUPS;r++)i.push(n.slice(4*r,4*(r+1)));return new t(i.join(":"))},t.fromURL=function(e){var r,n,i=null;if(-1!==e.indexOf("[")&&-1!==e.indexOf("]:")){if(null===(n=c.RE_URL_WITH_PORT.exec(e)))return{error:"failed to parse address with port",address:null,port:null};r=n[1],i=n[2]}else if(-1!==e.indexOf("/")){if(e=e.replace(/^[a-z0-9]+:\/\//,""),null===(n=c.RE_URL.exec(e)))return{error:"failed to parse address from URL",address:null,port:null};r=n[1]}else r=e;return i?((i=parseInt(i,10))<0||i>65536)&&(i=null):i=null,{address:new t(r),port:i}},t.fromAddress4=function(e){var r=new h.Address4(e),n=c.BITS-(u.BITS-r.subnetMask);return new t("::ffff:"+r.correctForm()+"/"+n)},t.fromArpa=function(e){var r=e.replace(/(\.ip6\.arpa)?\.$/,"");if(63!==r.length)throw new d.AddressError("Invalid 'ip6.arpa' form.");for(var n=r.split(".").reverse(),i=7;i>0;i--){var o=4*i;n.splice(o,0,":")}return new t(r=n.join(""))},t.prototype.microsoftTranscription=function(){return y.sprintf("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))},t.prototype.mask=function(t){return void 0===t&&(t=this.subnetMask),this.getBitsBase2(0,t)},t.prototype.possibleSubnets=function(t){void 0===t&&(t=128);var e=c.BITS-this.subnetMask-Math.abs(t-c.BITS);return e<0?"0":function(t){for(var e=/(\d+)(\d{3})/;e.test(t);)t=t.replace(e,"$1,$2");return t}(new p.BigInteger("2",10).pow(e).toString(10))},t.prototype._startAddress=function(){return new p.BigInteger(this.mask()+"0".repeat(c.BITS-this.subnetMask),2)},t.prototype.startAddress=function(){return t.fromBigInteger(this._startAddress())},t.prototype.startAddressExclusive=function(){var e=new p.BigInteger("1");return t.fromBigInteger(this._startAddress().add(e))},t.prototype._endAddress=function(){return new p.BigInteger(this.mask()+"1".repeat(c.BITS-this.subnetMask),2)},t.prototype.endAddress=function(){return t.fromBigInteger(this._endAddress())},t.prototype.endAddressExclusive=function(){var e=new p.BigInteger("1");return t.fromBigInteger(this._endAddress().subtract(e))},t.prototype.getScope=function(){var t=c.SCOPES[this.getBits(12,16).intValue()];return"Global unicast"===this.getType()&&"Link local"!==t&&(t="Global"),t||"Unknown"},t.prototype.getType=function(){for(var e=0,r=Object.keys(c.TYPES);e<r.length;e++){var n=r[e];if(this.isInSubnet(new t(n)))return c.TYPES[n]}return"Global unicast"},t.prototype.getBits=function(t,e){return new p.BigInteger(this.getBitsBase2(t,e),2)},t.prototype.getBitsBase2=function(t,e){return this.binaryZeroPad().slice(t,e)},t.prototype.getBitsBase16=function(t,e){var r=e-t;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,e).toString(16).padStart(r/4,"0")},t.prototype.getBitsPastSubnet=function(){return this.getBitsBase2(this.subnetMask,c.BITS)},t.prototype.reverseForm=function(t){t||(t={});var e=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,e).reverse().join(".");return e>0?t.omitSuffix?r:y.sprintf("%s.ip6.arpa.",r):t.omitSuffix?"":"ip6.arpa."},t.prototype.correctForm=function(){var t,e=[],r=0,n=[];for(t=0;t<this.parsedAddress.length;t++){var i=parseInt(this.parsedAddress[t],16);0===i&&r++,0!==i&&r>0&&(r>1&&n.push([t-r,t-1]),r=0)}r>1&&n.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);var o=n.map((function(t){return t[1]-t[0]+1}));if(n.length>0){var s=o.indexOf(Math.max.apply(Math,o));e=function(t,e){var r,n=[],i=[];for(r=0;r<t.length;r++)r<e[0]?n.push(t[r]):r>e[1]&&i.push(t[r]);return n.concat(["compact"]).concat(i)}(this.parsedAddress,n[s])}else e=this.parsedAddress;for(t=0;t<e.length;t++)"compact"!==e[t]&&(e[t]=parseInt(e[t],16).toString(16));var a=e.join(":");return a=(a=(a=a.replace(/^compact$/,"::")).replace(/^compact|compact$/,":")).replace(/compact/,"")},t.prototype.binaryZeroPad=function(){return this.bigInteger().toString(2).padStart(c.BITS,"0")},t.prototype.parse4in6=function(t){var e=t.split(":"),r=e.slice(-1)[0].match(u.RE_ADDRESS);if(r){this.parsedAddress4=r[0],this.address4=new h.Address4(this.parsedAddress4);for(var n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new d.AddressError("IPv4 addresses can't have leading zeroes.",t.replace(u.RE_ADDRESS,this.address4.parsedAddress.map(m).join(".")));this.v4=!0,e[e.length-1]=this.address4.toGroup6(),t=e.join(":")}return t},t.prototype.parse=function(t){var e=(t=this.parse4in6(t)).match(c.RE_BAD_CHARACTERS);if(e)throw new d.AddressError(y.sprintf("Bad character%s detected in address: %s",e.length>1?"s":"",e.join("")),t.replace(c.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));var r=t.match(c.RE_BAD_ADDRESS);if(r)throw new d.AddressError(y.sprintf("Address failed regex: %s",r.join("")),t.replace(c.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));var n=[],i=t.split("::");if(2===i.length){var o=i[0].split(":"),s=i[1].split(":");1===o.length&&""===o[0]&&(o=[]),1===s.length&&""===s[0]&&(s=[]);var a=this.groups-(o.length+s.length);if(!a)throw new d.AddressError("Error parsing groups");this.elidedGroups=a,this.elisionBegin=o.length,this.elisionEnd=o.length+this.elidedGroups,n=n.concat(o);for(var u=0;u<a;u++)n.push("0");n=n.concat(s)}else{if(1!==i.length)throw new d.AddressError("Too many :: groups found");n=t.split(":"),this.elidedGroups=0}if((n=n.map((function(t){return y.sprintf("%x",parseInt(t,16))}))).length!==this.groups)throw new d.AddressError("Incorrect number of groups found");return n},t.prototype.canonicalForm=function(){return this.parsedAddress.map(b).join(":")},t.prototype.decimal=function(){return this.parsedAddress.map((function(t){return y.sprintf("%05d",parseInt(t,16))})).join(":")},t.prototype.bigInteger=function(){return new p.BigInteger(this.parsedAddress.map(b).join(""),16)},t.prototype.to4=function(){var t=this.binaryZeroPad().split("");return h.Address4.fromHex(new p.BigInteger(t.slice(96,128).join(""),2).toString(16))},t.prototype.to4in6=function(){var e=this.to4(),r=new t(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),n="";return/:$/.test(r)||(n=":"),r+n+e.address},t.prototype.inspectTeredo=function(){var t=this.getBitsBase16(0,32),e=this.getBits(80,96).xor(new p.BigInteger("ffff",16)).toString(),r=h.Address4.fromHex(this.getBitsBase16(32,64)),n=h.Address4.fromHex(this.getBits(96,128).xor(new p.BigInteger("ffffffff",16)).toString(16)),i=this.getBits(64,80),o=this.getBitsBase2(64,80),s=i.testBit(15),a=i.testBit(14),u=i.testBit(8),c=i.testBit(9),l=new p.BigInteger(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:y.sprintf("%s:%s",t.slice(0,4),t.slice(4,8)),server4:r.address,client4:n.address,flags:o,coneNat:s,microsoft:{reserved:a,universalLocal:c,groupIndividual:u,nonce:l},udpPort:e}},t.prototype.inspect6to4=function(){var t=this.getBitsBase16(0,16),e=h.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:y.sprintf("%s",t.slice(0,4)),gateway:e.address}},t.prototype.to6to4=function(){return this.is4()?new t(["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":")):null},t.prototype.toByteArray=function(){var t=this.bigInteger().toByteArray();return 17===t.length&&0===t[0]?t.slice(1):t},t.prototype.toUnsignedByteArray=function(){return this.toByteArray().map(v)},t.fromByteArray=function(t){return this.fromUnsignedByteArray(t.map(v))},t.fromUnsignedByteArray=function(e){for(var r=new p.BigInteger("256",10),n=new p.BigInteger("0",10),i=new p.BigInteger("1",10),o=e.length-1;o>=0;o--)n=n.add(i.multiply(new p.BigInteger(e[o].toString(10),10))),i=i.multiply(r);return t.fromBigInteger(n)},t.prototype.isCanonical=function(){return this.addressMinusSuffix===this.canonicalForm()},t.prototype.isLinkLocal=function(){return"1111111010000000000000000000000000000000000000000000000000000000"===this.getBitsBase2(0,64)},t.prototype.isMulticast=function(){return"Multicast"===this.getType()},t.prototype.is4=function(){return this.v4},t.prototype.isTeredo=function(){return this.isInSubnet(new t("2001::/32"))},t.prototype.is6to4=function(){return this.isInSubnet(new t("2002::/16"))},t.prototype.isLoopback=function(){return"Loopback"===this.getType()},t.prototype.href=function(t){return t=void 0===t?"":y.sprintf(":%s",t),y.sprintf("http://[%s]%s/",this.correctForm(),t)},t.prototype.link=function(t){t||(t={}),void 0===t.className&&(t.className=""),void 0===t.prefix&&(t.prefix="/#address="),void 0===t.v4&&(t.v4=!1);var e=this.correctForm;return t.v4&&(e=this.to4in6),t.className?y.sprintf('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,e.call(this),t.className):y.sprintf('<a href="%1$s%2$s">%2$s</a>',t.prefix,e.call(this))},t.prototype.group=function(){if(0===this.elidedGroups)return l.simpleGroup(this.address).join(":");g("number"===typeof this.elidedGroups),g("number"===typeof this.elisionBegin);var t=[],e=this.address.split("::"),r=e[0],n=e[1];r.length?t.push.apply(t,l.simpleGroup(r)):t.push("");for(var i=["hover-group"],o=this.elisionBegin;o<this.elisionBegin+this.elidedGroups;o++)i.push(y.sprintf("group-%d",o));return t.push(y.sprintf('<span class="%s"></span>',i.join(" "))),n.length?t.push.apply(t,l.simpleGroup(n,this.elisionEnd)):t.push(""),this.is4()&&(g(this.address4 instanceof h.Address4),t.pop(),t.push(this.address4.groupForV6())),t.join(":")},t.prototype.regularExpressionString=function(e){void 0===e&&(e=!1);var r=[],n=new t(this.correctForm());if(0===n.elidedGroups)r.push(f.simpleRegularExpression(n.parsedAddress));else if(n.elidedGroups===c.GROUPS)r.push(f.possibleElisions(c.GROUPS));else{var i=n.address.split("::");i[0].length&&r.push(f.simpleRegularExpression(i[0].split(":"))),g("number"===typeof n.elidedGroups),r.push(f.possibleElisions(n.elidedGroups,0!==i[0].length,0!==i[1].length)),i[1].length&&r.push(f.simpleRegularExpression(i[1].split(":"))),r=[r.join(":")]}return e||(r=s(s(["(?=^|",f.ADDRESS_BOUNDARY,"|[^\\w\\:])("],r),[")(?=[^\\w\\:]|",f.ADDRESS_BOUNDARY,"|$)"])),r.join("")},t.prototype.regularExpression=function(t){return void 0===t&&(t=!1),new RegExp(this.regularExpressionString(t),"i")},t}();e.Address6=w},81765:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RE_SUBNET_STRING=e.RE_ADDRESS=e.GROUPS=e.BITS=void 0,e.BITS=32,e.GROUPS=4,e.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,e.RE_SUBNET_STRING=/\/\d{1,2}$/},69511:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RE_URL_WITH_PORT=e.RE_URL=e.RE_ZONE_STRING=e.RE_SUBNET_STRING=e.RE_BAD_ADDRESS=e.RE_BAD_CHARACTERS=e.TYPES=e.SCOPES=e.GROUPS=e.BITS=void 0,e.BITS=128,e.GROUPS=8,e.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},e.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},e.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,e.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,e.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,e.RE_ZONE_STRING=/%.*$/,e.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),e.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)},15011:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.simpleGroup=e.spanLeadingZeroes=e.spanAll=e.spanAllZeroes=void 0;var n=r(430);function i(t){return t.replace(/(0+)/g,'<span class="zero">$1</span>')}function o(t){return t.replace(/^(0+)/,'<span class="zero">$1</span>')}e.spanAllZeroes=i,e.spanAll=function(t,e){return void 0===e&&(e=0),t.split("").map((function(t,r){return n.sprintf('<span class="digit value-%s position-%d">%s</span>',t,r+e,i(t))})).join("")},e.spanLeadingZeroes=function(t){return t.split(":").map((function(t){return o(t)})).join(":")},e.simpleGroup=function(t,e){return void 0===e&&(e=0),t.split(":").map((function(t,r){return/group-v4/.test(t)?t:n.sprintf('<span class="hover-group group-%d">%s</span>',r+e,o(t))}))}},92703:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.possibleElisions=e.simpleRegularExpression=e.ADDRESS_BOUNDARY=e.padGroup=e.groupPossibilities=void 0;var s=o(r(69511)),a=r(430);function u(t){return a.sprintf("(%s)",t.join("|"))}function c(t){return t.length<4?a.sprintf("0{0,%d}%s",4-t.length,t):t}e.groupPossibilities=u,e.padGroup=c,e.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]",e.simpleRegularExpression=function(t){var e=[];t.forEach((function(t,r){0===parseInt(t,16)&&e.push(r)}));var r=e.map((function(e){return t.map((function(t,r){if(r===e){var n=0===r||r===s.GROUPS-1?":":"";return u([c(t),n])}return c(t)})).join(":")}));return r.push(t.map(c).join(":")),u(r)},e.possibleElisions=function(t,e,r){var n=e?"":":",i=r?"":":",o=[];e||r||o.push("::"),e&&r&&o.push(""),(r&&!e||!r&&e)&&o.push(":"),o.push(a.sprintf("%s(:0{1,4}){1,%d}",n,t-1)),o.push(a.sprintf("(0{1,4}:){1,%d}%s",t-1,i)),o.push(a.sprintf("(0{1,4}:){%d}0{1,4}",t-1));for(var s=1;s<t-1;s++)for(var c=1;c<t-s;c++)o.push(a.sprintf("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",c,t-c-s-1));return u(o)}},430:(t,e,r)=>{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(t){return a(c(t),arguments)}function s(t,e){return o.apply(null,[t].concat(e||[]))}function a(t,e){var r,n,s,a,u,c,l,h,f,d=1,p=t.length,y="";for(n=0;n<p;n++)if("string"===typeof t[n])y+=t[n];else if("object"===typeof t[n]){if((a=t[n]).keys)for(r=e[d],s=0;s<a.keys.length;s++){if(void 0==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[s],a.keys[s-1]));r=r[a.keys[s]]}else r=a.param_no?e[a.param_no]:e[d++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(a.type)&&"number"!==typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(i.number.test(a.type)&&(h=r>=0),a.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a.width?parseInt(a.width):0);break;case"e":r=a.precision?parseFloat(r).toExponential(a.precision):parseFloat(r).toExponential();break;case"f":r=a.precision?parseFloat(r).toFixed(a.precision):parseFloat(r);break;case"g":r=a.precision?String(Number(r.toPrecision(a.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a.precision?r.substring(0,a.precision):r;break;case"t":r=String(!!r),r=a.precision?r.substring(0,a.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a.precision?r.substring(0,a.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a.precision?r.substring(0,a.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?y+=r:(!i.number.test(a.type)||h&&!a.sign?f="":(f=h?"+":"-",r=r.toString().replace(i.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",l=a.width-(f+r).length,u=a.width&&l>0?c.repeat(l):"",y+=a.align?f+r+u:"0"===c?f+u+r:u+f+r)}return y}var u=Object.create(null);function c(t){if(u[t])return u[t];for(var e,r=t,n=[],o=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],a=e[2],c=[];if(null===(c=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(a=a.substring(c[0].length));)if(null!==(c=i.key_access.exec(a)))s.push(c[1]);else{if(null===(c=i.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return u[t]=n}e.sprintf=o,e.vsprintf=s,"undefined"!==typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(n=function(){return{sprintf:o,vsprintf:s}}.call(e,r,e,t))||(t.exports=n))}()},28974:t=>{"use strict";const e="[a-fA-F\\d:]",r=t=>t&&t.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):"",n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",o="\n(?:\n(?:".concat(i,":){7}(?:").concat(i,"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:").concat(i,":){6}(?:").concat(n,"|:").concat(i,"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:").concat(i,":){5}(?::").concat(n,"|(?::").concat(i,"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:").concat(i,":){4}(?:(?::").concat(i,"){0,1}:").concat(n,"|(?::").concat(i,"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:").concat(i,":){3}(?:(?::").concat(i,"){0,2}:").concat(n,"|(?::").concat(i,"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:").concat(i,":){2}(?:(?::").concat(i,"){0,3}:").concat(n,"|(?::").concat(i,"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:").concat(i,":){1}(?:(?::").concat(i,"){0,4}:").concat(n,"|(?::").concat(i,"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::").concat(i,"){0,5}:").concat(n,"|(?::").concat(i,"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),s=new RegExp("(?:^".concat(n,"$)|(?:^").concat(o,"$)")),a=new RegExp("^".concat(n,"$")),u=new RegExp("^".concat(o,"$")),c=t=>t&&t.exact?s:new RegExp("(?:".concat(r(t)).concat(n).concat(r(t),")|(?:").concat(r(t)).concat(o).concat(r(t),")"),"g");c.v4=t=>t&&t.exact?a:new RegExp("".concat(r(t)).concat(n).concat(r(t)),"g"),c.v6=t=>t&&t.exact?u:new RegExp("".concat(r(t)).concat(o).concat(r(t)),"g"),t.exports=c},87201:function(t){!function(e){"use strict";const r="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp("^".concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"$"),"i"),threeOctet:new RegExp("^".concat(r,"\\.").concat(r,"\\.").concat(r,"$"),"i"),twoOctet:new RegExp("^".concat(r,"\\.").concat(r,"$"),"i"),longValue:new RegExp("^".concat(r,"$"),"i")},i=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(s,"i"),native:new RegExp("^(::)?(".concat(a,")?([0-9a-f]+)?(::)?(").concat(s,")?$"),"i"),deprecatedTransitional:new RegExp("^(?:::)(".concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"(").concat(s,")?)$"),"i"),transitional:new RegExp("^((?:".concat(a,")|(?:::)(?:").concat(a,")?)").concat(r,"\\.").concat(r,"\\.").concat(r,"\\.").concat(r,"(").concat(s,")?$"),"i")};function c(t,e){if(t.indexOf("::")!==t.lastIndexOf("::"))return null;let r,n,i=0,o=-1,s=(t.match(u.zoneIndex)||[])[0];for(s&&(s=s.substring(1),t=t.replace(/%.+$/,""));(o=t.indexOf(":",o+1))>=0;)i++;if("::"===t.substr(0,2)&&i--,"::"===t.substr(-2,2)&&i--,i>e)return null;for(n=e-i,r=":";n--;)r+="0:";return":"===(t=t.replace("::",r))[0]&&(t=t.slice(1)),":"===t[t.length-1]&&(t=t.slice(0,-1)),{parts:e=function(){const e=t.split(":"),r=[];for(let t=0;t<e.length;t++)r.push(parseInt(e[t],16));return r}(),zoneId:s}}function l(t,e,r,n){if(t.length!==e.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let i,o=0;for(;n>0;){if(i=r-n,i<0&&(i=0),t[o]>>i!==e[o]>>i)return!1;n-=r,o+=1}return!0}function h(t){if(o.test(t))return parseInt(t,16);if("0"===t[0]&&!isNaN(parseInt(t[1],10))){if(i.test(t))return parseInt(t,8);throw new Error("ipaddr: cannot parse ".concat(t," as octal"))}return parseInt(t,10)}function f(t,e){for(;t.length<e;)t="0".concat(t);return t}const d={};d.IPv4=function(){function t(t){if(4!==t.length)throw new Error("ipaddr: ipv4 octet count should be 4");let e,r;for(e=0;e<t.length;e++)if(r=t[e],!(0<=r&&r<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=t}return t.prototype.SpecialRanges={unspecified:[[new t([0,0,0,0]),8]],broadcast:[[new t([255,255,255,255]),32]],multicast:[[new t([224,0,0,0]),4]],linkLocal:[[new t([169,254,0,0]),16]],loopback:[[new t([127,0,0,0]),8]],carrierGradeNat:[[new t([100,64,0,0]),10]],private:[[new t([10,0,0,0]),8],[new t([172,16,0,0]),12],[new t([192,168,0,0]),16]],reserved:[[new t([192,0,0,0]),24],[new t([192,0,2,0]),24],[new t([192,88,99,0]),24],[new t([198,51,100,0]),24],[new t([203,0,113,0]),24],[new t([240,0,0,0]),4]]},t.prototype.kind=function(){return"ipv4"},t.prototype.match=function(t,e){let r;if(void 0===e&&(r=t,t=r[0],e=r[1]),"ipv4"!==t.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,t.octets,8,e)},t.prototype.prefixLengthFromSubnetMask=function(){let t=0,e=!1;const r={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let n,i,o;for(n=3;n>=0;n-=1){if(i=this.octets[n],!(i in r))return null;if(o=r[i],e&&0!==o)return null;8!==o&&(e=!0),t+=o}return 32-t},t.prototype.range=function(){return d.subnetMatch(this,this.SpecialRanges)},t.prototype.toByteArray=function(){return this.octets.slice(0)},t.prototype.toIPv4MappedAddress=function(){return d.IPv6.parse("::ffff:".concat(this.toString()))},t.prototype.toNormalizedString=function(){return this.toString()},t.prototype.toString=function(){return this.octets.join(".")},t}(),d.IPv4.broadcastAddressFromCIDR=function(t){try{const e=this.parseCIDR(t),r=e[0].toByteArray(),n=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),i=[];let o=0;for(;o<4;)i.push(parseInt(r[o],10)|255^parseInt(n[o],10)),o++;return new this(i)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},d.IPv4.isIPv4=function(t){return null!==this.parser(t)},d.IPv4.isValid=function(t){try{return new this(this.parser(t)),!0}catch(e){return!1}},d.IPv4.isValidFourPartDecimal=function(t){return!(!d.IPv4.isValid(t)||!t.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},d.IPv4.networkAddressFromCIDR=function(t){let e,r,n,i,o;try{for(e=this.parseCIDR(t),n=e[0].toByteArray(),o=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),i=[],r=0;r<4;)i.push(parseInt(n[r],10)&parseInt(o[r],10)),r++;return new this(i)}catch(s){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},d.IPv4.parse=function(t){const e=this.parser(t);if(null===e)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(e)},d.IPv4.parseCIDR=function(t){let e;if(e=t.match(/^(.+)\/(\d+)$/)){const t=parseInt(e[2]);if(t>=0&&t<=32){const r=[this.parse(e[1]),t];return Object.defineProperty(r,"toString",{value:function(){return this.join("/")}}),r}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},d.IPv4.parser=function(t){let e,r,i;if(e=t.match(n.fourOctet))return function(){const t=e.slice(1,6),n=[];for(let e=0;e<t.length;e++)r=t[e],n.push(h(r));return n}();if(e=t.match(n.longValue)){if(i=h(e[1]),i>4294967295||i<0)throw new Error("ipaddr: address outside defined range");return function(){const t=[];let e;for(e=0;e<=24;e+=8)t.push(i>>e&255);return t}().reverse()}return(e=t.match(n.twoOctet))?function(){const t=e.slice(1,4),r=[];if(i=h(t[1]),i>16777215||i<0)throw new Error("ipaddr: address outside defined range");return r.push(h(t[0])),r.push(i>>16&255),r.push(i>>8&255),r.push(255&i),r}():(e=t.match(n.threeOctet))?function(){const t=e.slice(1,5),r=[];if(i=h(t[2]),i>65535||i<0)throw new Error("ipaddr: address outside defined range");return r.push(h(t[0])),r.push(h(t[1])),r.push(i>>8&255),r.push(255&i),r}():null},d.IPv4.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>32)throw new Error("ipaddr: invalid IPv4 prefix length");const e=[0,0,0,0];let r=0;const n=Math.floor(t/8);for(;r<n;)e[r]=255,r++;return n<4&&(e[n]=Math.pow(2,t%8)-1<<8-t%8),new this(e)},d.IPv6=function(){function t(t,e){let r,n;if(16===t.length)for(this.parts=[],r=0;r<=14;r+=2)this.parts.push(t[r]<<8|t[r+1]);else{if(8!==t.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=t}for(r=0;r<this.parts.length;r++)if(n=this.parts[r],!(0<=n&&n<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");e&&(this.zoneId=e)}return t.prototype.SpecialRanges={unspecified:[new t([0,0,0,0,0,0,0,0]),128],linkLocal:[new t([65152,0,0,0,0,0,0,0]),10],multicast:[new t([65280,0,0,0,0,0,0,0]),8],loopback:[new t([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new t([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new t([0,0,0,0,0,65535,0,0]),96],rfc6145:[new t([0,0,0,0,65535,0,0,0]),96],rfc6052:[new t([100,65435,0,0,0,0,0,0]),96],"6to4":[new t([8194,0,0,0,0,0,0,0]),16],teredo:[new t([8193,0,0,0,0,0,0,0]),32],reserved:[[new t([8193,3512,0,0,0,0,0,0]),32]]},t.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},t.prototype.kind=function(){return"ipv6"},t.prototype.match=function(t,e){let r;if(void 0===e&&(r=t,t=r[0],e=r[1]),"ipv6"!==t.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,t.parts,16,e)},t.prototype.prefixLengthFromSubnetMask=function(){let t=0,e=!1;const r={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let n,i;for(let o=7;o>=0;o-=1){if(n=this.parts[o],!(n in r))return null;if(i=r[n],e&&0!==i)return null;16!==i&&(e=!0),t+=i}return 128-t},t.prototype.range=function(){return d.subnetMatch(this,this.SpecialRanges)},t.prototype.toByteArray=function(){let t;const e=[],r=this.parts;for(let n=0;n<r.length;n++)t=r[n],e.push(t>>8),e.push(255&t);return e},t.prototype.toFixedLengthString=function(){const t=function(){const t=[];for(let e=0;e<this.parts.length;e++)t.push(f(this.parts[e].toString(16),4));return t}.call(this).join(":");let e="";return this.zoneId&&(e="%".concat(this.zoneId)),t+e},t.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const t=this.parts.slice(-2),e=t[0],r=t[1];return new d.IPv4([e>>8,255&e,r>>8,255&r])},t.prototype.toNormalizedString=function(){const t=function(){const t=[];for(let e=0;e<this.parts.length;e++)t.push(this.parts[e].toString(16));return t}.call(this).join(":");let e="";return this.zoneId&&(e="%".concat(this.zoneId)),t+e},t.prototype.toRFC5952String=function(){const t=/((^|:)(0(:|$)){2,})/g,e=this.toNormalizedString();let r,n=0,i=-1;for(;r=t.exec(e);)r[0].length>i&&(n=r.index,i=r[0].length);return i<0?e:"".concat(e.substring(0,n),"::").concat(e.substring(n+i))},t.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")},t}(),d.IPv6.broadcastAddressFromCIDR=function(t){try{const e=this.parseCIDR(t),r=e[0].toByteArray(),n=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),i=[];let o=0;for(;o<16;)i.push(parseInt(r[o],10)|255^parseInt(n[o],10)),o++;return new this(i)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}},d.IPv6.isIPv6=function(t){return null!==this.parser(t)},d.IPv6.isValid=function(t){if("string"===typeof t&&-1===t.indexOf(":"))return!1;try{const e=this.parser(t);return new this(e.parts,e.zoneId),!0}catch(e){return!1}},d.IPv6.networkAddressFromCIDR=function(t){let e,r,n,i,o;try{for(e=this.parseCIDR(t),n=e[0].toByteArray(),o=this.subnetMaskFromPrefixLength(e[1]).toByteArray(),i=[],r=0;r<16;)i.push(parseInt(n[r],10)&parseInt(o[r],10)),r++;return new this(i)}catch(s){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(s,")"))}},d.IPv6.parse=function(t){const e=this.parser(t);if(null===e.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(e.parts,e.zoneId)},d.IPv6.parseCIDR=function(t){let e,r,n;if((r=t.match(/^(.+)\/(\d+)$/))&&(e=parseInt(r[2]),e>=0&&e<=128))return n=[this.parse(r[1]),e],Object.defineProperty(n,"toString",{value:function(){return this.join("/")}}),n;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},d.IPv6.parser=function(t){let e,r,n,i,o,s;if(n=t.match(u.deprecatedTransitional))return this.parser("::ffff:".concat(n[1]));if(u.native.test(t))return c(t,8);if((n=t.match(u.transitional))&&(s=n[6]||"",e=c(n[1].slice(0,-1)+s,6),e.parts)){for(o=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])],r=0;r<o.length;r++)if(i=o[r],!(0<=i&&i<=255))return null;return e.parts.push(o[0]<<8|o[1]),e.parts.push(o[2]<<8|o[3]),{parts:e.parts,zoneId:e.zoneId}}return null},d.IPv6.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>128)throw new Error("ipaddr: invalid IPv6 prefix length");const e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let r=0;const n=Math.floor(t/8);for(;r<n;)e[r]=255,r++;return n<16&&(e[n]=Math.pow(2,t%8)-1<<8-t%8),new this(e)},d.fromByteArray=function(t){const e=t.length;if(4===e)return new d.IPv4(t);if(16===e)return new d.IPv6(t);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},d.isValid=function(t){return d.IPv6.isValid(t)||d.IPv4.isValid(t)},d.parse=function(t){if(d.IPv6.isValid(t))return d.IPv6.parse(t);if(d.IPv4.isValid(t))return d.IPv4.parse(t);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},d.parseCIDR=function(t){try{return d.IPv6.parseCIDR(t)}catch(e){try{return d.IPv4.parseCIDR(t)}catch(r){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},d.process=function(t){const e=this.parse(t);return"ipv6"===e.kind()&&e.isIPv4MappedAddress()?e.toIPv4Address():e},d.subnetMatch=function(t,e,r){let n,i,o,s;for(i in void 0!==r&&null!==r||(r="unicast"),e)if(Object.prototype.hasOwnProperty.call(e,i))for(o=e[i],!o[0]||o[0]instanceof Array||(o=[o]),n=0;n<o.length;n++)if(s=o[n],t.kind()===s[0].kind()&&t.match.apply(t,s))return i;return r},t.exports?t.exports=d:e.ipaddr=d}(this)},96927:(t,e,r)=>{"use strict";const n=r(82193),i="object"===typeof window&&"object"===typeof document&&9===document.nodeType,o=n(),s=i&&!o,a=o&&!i,u=o&&i,c="undefined"!==typeof globalThis.process&&"undefined"!==typeof globalThis.process.release&&"node"===globalThis.process.release.name&&!o,l="function"===typeof importScripts&&"undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,h="undefined"!==typeof globalThis.process&&"undefined"!==typeof globalThis.process.env&&"test"===globalThis.process.env.NODE_ENV,f="undefined"!==typeof navigator&&"ReactNative"===navigator.product;t.exports={isTest:h,isElectron:o,isElectronMain:a,isElectronRenderer:u,isNode:c,isBrowser:s,isWebWorker:l,isEnvWithDom:i,isReactNative:f}},65450:(t,e,r)=>{"use strict";var n=r(4707)(),i=r(44037)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"===typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},82193:(t,e,r)=>{var n=r(21964);t.exports=function(){return"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||(!("undefined"===typeof n||"object"!==typeof n.versions||!n.versions.electron)||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0)}},85718:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(4707)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!==typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if("undefined"===typeof n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},62795:(t,e,r)=>{"use strict";const n=r(28974),i=t=>n({exact:!0}).test(t);i.v4=t=>n.v4({exact:!0}).test(t),i.v6=t=>n.v6({exact:!0}).test(t),i.version=t=>i(t)?i.v4(t)?4:6:void 0,t.exports=i},56209:t=>{"use strict";t.exports=function(t){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t)||/^::1$/.test(t)}},6510:t=>{"use strict";t.exports=function(t){return t!==t}},6188:(t,e,r)=>{"use strict";var n=r(19722),i=r(9396),o=r(6510),s=r(64951),a=r(6034),u=n(s(),Number);i(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},64951:(t,e,r)=>{"use strict";var n=r(6510);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6034:(t,e,r)=>{"use strict";var n=r(9396),i=r(64951);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},66218:(t,e,r)=>{"use strict";var n=r(27910),i=r(30306),o=r(44037),s=o("Object.prototype.toString"),a=r(4707)(),u="undefined"===typeof globalThis?r.g:globalThis,c=i(),l=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},h=o("String.prototype.slice"),f={},d=r(40636),p=Object.getPrototypeOf;a&&d&&p&&n(c,(function(t){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=d(r,Symbol.toStringTag);if(!n){var i=p(r);n=d(i,Symbol.toStringTag)}f[t]=n.get}}));t.exports=function(t){if(!t||"object"!==typeof t)return!1;if(!a||!(Symbol.toStringTag in t)){var e=h(s(t),8,-1);return l(c,e)>-1}return!!d&&function(t){var e=!1;return n(f,(function(r,n){if(!e)try{e=r.call(t)===n}catch(i){}})),e}(t)}},25410:t=>{"use strict";const e=65536;t.exports=function(t){const r=new Uint8Array(t);let n=0;if(t>0)if(t>e)for(;n<t;)n+e>t?(crypto.getRandomValues(r.subarray(n,n+(t-n))),n+=t-n):(crypto.getRandomValues(r.subarray(n,n+e)),n+=e);else crypto.getRandomValues(r);return r}},16791:(t,e,r)=>{"use strict";const{URLWithLegacySupport:n,format:i,URLSearchParams:o,defaultBase:s}=r(85732),a=r(89640);t.exports={URL:n,URLSearchParams:o,format:i,relative:a,defaultBase:s}},89640:(t,e,r)=>{"use strict";const{URLWithLegacySupport:n,format:i}=r(85732);t.exports=function(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0,a=r.protocol?r.protocol.replace(":",""):"http";a=(o[a]||s||a)+":";try{e=new n(t)}catch(c){e={}}const u=Object.assign({},r,{protocol:a||e.protocol,host:r.host||e.host});return new n(t,i(u)).toString()}},85732:t=>{"use strict";const e="undefined"!==typeof navigator&&"ReactNative"===navigator.product;const r=self.URL,n=e?"http://localhost":self.location?self.location.protocol+"//"+self.location.host:"";t.exports={URLWithLegacySupport:class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;this.super=new r(t,e),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(t){this.super.hash=t}set host(t){this.super.host=t}set hostname(t){this.super.hostname=t}set href(t){this.super.href=t}set password(t){this.super.password=t}set pathname(t){this.super.pathname=t}set port(t){this.super.port=t}set protocol(t){this.super.protocol=t}set search(t){this.super.search=t}set username(t){this.super.username=t}static createObjectURL(t){return r.createObjectURL(t)}static revokeObjectURL(t){r.revokeObjectURL(t)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}},URLSearchParams:self.URLSearchParams,defaultBase:n,format:function(t){if("string"===typeof t){return new r(t).toString()}if(!(t instanceof r)){const e=t.username&&t.password?"".concat(t.username,":").concat(t.password,"@"):"",r=t.auth?t.auth+"@":"",n=t.port?":"+t.port:"",i=t.protocol?t.protocol+"//":"",o=t.host||"",s=t.hostname||"",a=t.search||(t.query?"?"+t.query:""),u=t.hash||"",c=t.pathname||"",l=t.path||c+a;return"".concat(i).concat(e||r).concat(o||s+n).concat(l).concat(u)}}}},50464:t=>{"use strict";t.exports=async t=>{const e=[];for await(const r of t)e.push(r);return e}},90351:(t,e,r)=>{"use strict";const{Buffer:n}=r(19778),i=r(41976);t.exports=async function*(t){for await(const e of t)n.isBuffer(e)?yield e:i.isBufferList(e)?yield e.slice():yield n.from(e)},t.exports.toBuffer=t.exports,t.exports.toList=async function*(t){for await(const e of t)n.isBuffer(e)?yield(new i).append(e):i.isBufferList(e)?yield e:yield(new i).append(n.from(e))}},72934:(t,e,r)=>{const n=r(41976),i={string:()=>"",buffer:()=>n()};t.exports=async(t,e)=>{if((e=e||{}).type&&!i[e.type])throw new Error('invalid type "'.concat(e.type,'"'));let r,n;for await(const o of t)r||(n=e.type||("string"===typeof o?"string":"buffer"),r=i[n]()),"string"===n?r+=o:r.append(o);return r||i[e.type||"buffer"]()}},79272:t=>{"use strict";t.exports=async t=>{for await(const e of t);}},12393:t=>{"use strict";t.exports=async function*(t,e){for await(const r of t)await e(r)&&(yield r)}},84744:t=>{"use strict";t.exports=async t=>{for await(const e of t)return e}},61309:t=>{"use strict";t.exports=async function*(t,e){for await(const r of t)await e(r),yield r}},39610:(t,e,r)=>{"use strict";const n=r(55502),i=r(77674),o=r(70121);t.exports=t=>{const e=i(),r=n(t.source),s=o();let a;const u=t.sink(async function*(){yield*e;const t=await s.promise;yield*t}());u.catch((t=>{a=t}));return{reader:r,writer:e,stream:{sink:t=>a?Promise.reject(a):(s.resolve(t),u),source:r},rest:()=>e.end(),write:e.push,read:async()=>(await r.next()).value}}},96596:(t,e,r)=>{"use strict";const{Buffer:n}=r(19778),i=r(41976),o=r(17104),s=4194304,a=n.alloc(0),u="readLength",c="readData",l={[u]:(t,e,r,n)=>{let o;e=e.append(t);try{o=n.lengthDecoder(e)}catch(s){if(e.length>n.maxLengthLength)throw Object.assign(s,{message:"message length too long",code:"ERR_MSG_LENGTH_TOO_LONG"});if(s instanceof RangeError)return{mode:u,buffer:e,chunk:void 0,state:void 0,data:void 0};throw s}if(o>n.maxDataLength)throw Object.assign(new Error("message data too long"),{code:"ERR_MSG_DATA_TOO_LONG"});return t=e.shallowSlice(n.lengthDecoder.bytes),e=new i,n.onLength&&n.onLength(o),o<=0?(n.onData&&n.onData(a),{mode:u,chunk:t,buffer:e,data:a}):{mode:c,chunk:t,buffer:e,state:{dataLength:o},data:void 0}},[c]:(t,e,r,n)=>{if(e=e.append(t),!r)throw new Error("state is required");if(e.length<r.dataLength)return{mode:c,buffer:e,state:r,chunk:void 0,data:void 0};const{dataLength:o}=r,s=e.shallowSlice(0,o),a=e.length>o?e.shallowSlice(o):void 0;return e=new i,n.onData&&n.onData(s),{mode:u,chunk:a,buffer:e,state:void 0,data:s}}};function h(t){const e={lengthDecoder:(t=t||{}).lengthDecoder||o,maxLengthLength:t.maxLengthLength||8,maxDataLength:t.maxDataLength||s,onLength:t.onLength,onData:t.onData};return async function*(t){let r,n=new i,o=u;for await(const i of t){let t=i;for(;t;){const i=l[o](t,n,r,e);o=i.mode,t=i.chunk,n=i.buffer,r=i.state,i.data&&(yield i.data)}}if(n.length)throw Object.assign(new Error("unexpected end of input"),{code:"ERR_UNEXPECTED_EOF"})}}h.fromReader=(t,e)=>{let r=1;const n={[Symbol.asyncIterator](){return this},next:async()=>{try{return await t.next(r)}catch(e){if("ERR_UNDER_READ"===e.code)return{done:!0,value:null};throw e}finally{r=1}}};return h({...e||{},onLength:t=>{r=t}})(n)},t.exports=h,t.exports.MAX_LENGTH_LENGTH=8,t.exports.MAX_DATA_LENGTH=s},82986:(t,e,r)=>{"use strict";const{Buffer:n}=r(19778),i=r(41976),o=r(28859);function s(t){t=t||{};const e=Math.max(t.poolSize||10240,t.minPoolSize||8),r=t.lengthEncoder||o;return async function*(t){let o=n.alloc(e),s=0;for await(const a of t){r(a.length,o,s);const t=o.slice(s,s+r.bytes);s+=r.bytes,o.length-s<8&&(o=n.alloc(e),s=0),yield(new i).append(t).append(a)}}}s.single=(t,e)=>{const r=(e=e||{}).lengthEncoder||o;return new i([r(t.length),t.slice()])},t.exports=s,t.exports.MIN_POOL_SIZE=8,t.exports.DEFAULT_POOL_SIZE=10240},44709:(t,e,r)=>{"use strict";e.encode=r(82986),e.decode=r(96596),e.varintEncode=r(28859),e.varintDecode=r(17104),e.int32BEEncode=r(95441),e.int32BEDecode=r(61336)},61336:t=>{"use strict";const e=t=>{if(t.length<4)throw RangeError("Could not decode int32BE");return t.readInt32BE(0)};e.bytes=4,t.exports=e},95441:(t,e,r)=>{"use strict";const{Buffer:n}=r(19778),i=(t,e,r)=>((e=e||n.allocUnsafe(4)).writeInt32BE(t,r),e);i.bytes=4,t.exports=i},17104:(t,e,r)=>{"use strict";const n=r(74561),{Buffer:i}=r(19778),o=t=>{const e=n.decode(i.isBuffer(t)?t:(r=t,new Proxy({},{get:(t,e)=>"l"===e[0]?r[e]:r.get(parseInt(e))})));var r;return o.bytes=n.decode.bytes,e};t.exports=o},28859:(t,e,r)=>{"use strict";const n=r(74561),{Buffer:i}=r(19778),o=(t,e,r)=>{const s=n.encode(t,e,r);return o.bytes=n.encode.bytes,e||i.from(s)};t.exports=o},27889:t=>{"use strict";t.exports=async function*(t,e){for await(const r of t)yield e(r)}},96155:(t,e,r)=>{"use strict";const n=r(77674);t.exports=async function*(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const i=n();setTimeout((async()=>{try{await Promise.all(e.map((async t=>{for await(const e of t)i.push(e)}))),i.end()}catch(t){i.end(t)}}),0),yield*i}},85907:(t,e,r)=>{var n=r(52227);t.exports=function(){var t=n(),e=n();return[{source:t.source,sink:e.sink},{source:e.source,sink:t.sink}]}},52227:(t,e,r)=>{"use strict";const n=r(38295);t.exports=function(){let t,e;return{sink:async r=>{if(t)throw new Error("already piped");t=n(r),e&&e(t)},source:{[Symbol.asyncIterator](){return this},next:()=>t?t.next():new Promise((t=>{e=r=>{e=null,t(r.next())}}))}}}},85551:(t,e,r)=>{"use strict";const n=r(39610),i=r(44709);t.exports=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=n(t),o=i.decode.fromReader(r.reader,e);let s=!1;const a={read:async t=>{const{value:e,done:n}=await r.reader.next(t);if(n&&e.length<t)throw new Error("Couldn't read enough bytes");if(s=n,!e)throw new Error("Value is null");return e},readLP:async()=>{const{value:t,done:e}=await o.next();if(s=e,!t)throw new Error("Value is null");return t},readPB:async t=>{const e=await a.readLP();if(!e)throw new Error("Value is null");const r=e instanceof Uint8Array?e:e.slice();return t.decode(r)},write:t=>{r.writer.push(t)},writeLP:t=>{a.write(i.encode.single(t,e))},writePB:(t,e)=>{a.writeLP(e.encode(t))},pb:t=>({read:()=>a.readPB(t),write:e=>a.writePB(e,t)}),unwrap:()=>(r.rest(),r.stream)};return a}},79023:t=>{const e=function(){let t;for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(;r.length;)t=r.shift()(t);return t},r=t=>t&&("function"===typeof t[Symbol.asyncIterator]||"function"===typeof t[Symbol.iterator]||"function"===typeof t.next),n=t=>t&&"function"===typeof t.sink&&r(t.source),i=t=>e=>(t.sink(e),t.source),o=function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];if(n(o[0])){const t=o[0];o[0]=()=>t.source}else if(r(o[0])){const t=o[0];o[0]=()=>t}if(o.length>1&&n(o[o.length-1])&&(o[o.length-1]=o[o.length-1].sink),o.length>2)for(let e=1;e<o.length-1;e++)n(o[e])&&(o[e]=i(o[e]));return e(...o)};t.exports=o,t.exports.pipe=o,t.exports.rawPipe=e,t.exports.isIterable=r,t.exports.isDuplex=n},77674:(t,e,r)=>{const n=r(75125);t.exports=t=>{let e;"function"===typeof(t=t||{})?(e=t,t={}):e=t.onEnd;let r,i,o,s=new n;const a=t=>i?i(t):(s.push(t),r),u=t=>o?r:a({done:!1,value:t}),c=t=>o?r:(o=!0,t?(t=>(s=new n,i?i({error:t}):(s.push({error:t}),r)))(t):a({done:!0}));if(r={[Symbol.asyncIterator](){return this},next:()=>{if(!s.isEmpty()){if(t.writev){let t;const e=[];for(;!s.isEmpty();){if(t=s.shift(),t.error)throw t.error;e.push(t.value)}return{done:t.done,value:e}}const e=s.shift();if(e.error)throw e.error;return e}return o?{done:!0}:new Promise(((e,n)=>{i=o=>(i=null,o.error?n(o.error):t.writev&&!o.done?e({done:o.done,value:[o.value]}):e(o),r)}))},return:()=>(s=new n,c(),{done:!0}),throw:t=>(c(t),{done:!0}),push:u,end:c},!e)return r;const l=r;return r={[Symbol.asyncIterator](){return this},next:()=>l.next(),throw:t=>(l.throw(t),e&&(e(t),e=null),{done:!0}),return:()=>(l.return(),e&&(e(),e=null),{done:!0}),push:u,end:t=>(l.end(t),e&&(e(t),e=null),r)},r}},55502:(t,e,r)=>{const n=r(41976);t.exports=t=>{const e=async function*(){let e=yield,r=new n;for await(const i of t)if(e)for(r.append(i);r.length>=e;){const t=r.shallowSlice(0,e);if(r.consume(e),e=yield t,!e){r.length&&(e=yield r,r=new n);break}}else e=yield r.append(i),r=new n;if(e)throw Object.assign(new Error("stream ended before ".concat(e," bytes became available")),{code:"ERR_UNDER_READ",buffer:r})}();return e.next(),e}},22035:(t,e,r)=>{"use strict";const n=r(50464);t.exports=async function*(t,e){const r=await n(t);yield*r.sort(e)}},35959:t=>{"use strict";t.exports=async function*(t,e){let r=0;if(!(e<1))for await(const n of t)if(yield n,r++,r===e)return}},88042:(t,e,r)=>{"use strict";var n=r(87191),i=r(18335),o=r(40142);t.exports=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r="undefined"===typeof window?{}:window.location,s=o(t,r),a=new n(s,e.websocket),u=i(a,e);return u.remoteAddress=s,u.close=()=>new Promise(((t,e)=>{a.addEventListener("close",t),a.close()})),u.destroy=()=>{a.terminate?a.terminate():a.close()},u.socket=a,u},t.exports.connect=t.exports},18335:(t,e,r)=>{const n=r(95593),i=r(91747);t.exports=(t,e)=>{(e=e||{}).binaryType?t.binaryType=e.binaryType:e.binary&&(t.binaryType="arraybuffer");const r={sink:i(t,e),source:n(t,e),connected:()=>r.source.connected()};return r}},27208:t=>{t.exports=async t=>{if(t.readyState>=2)throw new Error("socket closed");if(1!==t.readyState)return new Promise(((e,r)=>{const n=t&&(t.removeEventListener||t.removeListener);function i(){"function"===typeof n&&(n.call(t,"open",o),n.call(t,"error",s))}function o(){i(),e()}function s(t){i(),r(t)}t.addEventListener("open",o),t.addEventListener("error",s)}))}},91747:(t,e,r)=>{const n=r(27208);t.exports=(t,e)=>((e=e||{}).closeOnEnd=!1!==e.closeOnEnd,async r=>{for await(const e of r){try{await n(t)}catch(i){if("socket closed"===i.message)break;throw i}t.send(e)}if(e.closeOnEnd&&t.readyState<=1)return new Promise(((e,r)=>{t.addEventListener("close",(t=>{if(t.wasClean||1006===t.code)e();else{const e=Object.assign(new Error("ws error"),{event:t});r(e)}})),setTimeout((()=>t.close()))}))})},95593:(t,e,r)=>{const{Buffer:n}=r(19778),{EventIterator:i}=r(3634);t.exports=t=>{const e=t.removeEventListener||t.removeListener,r=async function*(){const r=new i((r=>{let{push:n,stop:i,fail:o}=r;return t.addEventListener("message",n),t.addEventListener("error",o),t.addEventListener("close",i),()=>{e.call(t,"message",n),e.call(t,"error",o),e.call(t,"close",i)}}),{highWaterMark:1/0});for await(const{data:t}of r)yield(o=t,o instanceof ArrayBuffer||null!=o&&null!=o.constructor&&"ArrayBuffer"===o.constructor.name&&"number"===typeof o.byteLength?n.from(t):t);var o}();let o,s=1===t.readyState;return t.addEventListener("open",(()=>{s=!0,o=null})),t.addEventListener("close",(()=>{s=!1,o=null})),t.addEventListener("error",(t=>{s||(o=t)})),r.connected=()=>new Promise(((r,n)=>{if(s)return r();if(o)return n(o);const i=r=>{e.call(t,"open",a),e.call(t,"error",u),r()},a=()=>i(r),u=t=>i((()=>n(t)));t.addEventListener("open",a),t.addEventListener("error",u)})),r}},87191:(t,e,r)=>{t.exports="undefined"===typeof WebSocket?r(89408):WebSocket},40142:(t,e,r)=>{const{relative:n}=r(16791),i={http:"ws",https:"wss"};t.exports=(t,e)=>n(t,e,i,"ws")},27898:(t,e,r)=>{var n,i=r(21964);!function(){"use strict";var o="input is invalid type",s="object"===typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof i&&i.versions&&i.versions.node?a=r.g:u&&(a=self);var c=!a.JS_SHA3_NO_COMMON_JS&&t.exports,l=r.amdO,h=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],m=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!h||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var w=function(t,e,r){return function(n){return new D(t,e,t).update(n)[r]()}},_=function(t,e,r){return function(n,i){return new D(t,e,i).update(n)[r]()}},E=function(t,e,r){return function(e,n,i,o){return T["cshake"+t].update(e,n,i,o)[r]()}},S=function(t,e,r){return function(e,n,i,o){return T["kmac"+t].update(e,n,i,o)[r]()}},I=function(t,e,r,n){for(var i=0;i<b.length;++i){var o=b[i];t[o]=e(r,n,o)}return t},A=function(t,e){var r=w(t,e,"hex");return r.create=function(){return new D(t,e,t)},r.update=function(t){return r.create().update(t)},I(r,w,t,e)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:m,createMethod:function(t,e){var r=_(t,e,"hex");return r.create=function(r){return new D(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},I(r,_,t,e)}},{name:"cshake",padding:d,bits:m,createMethod:function(t,e){var r=v[t],n=E(t,0,"hex");return n.create=function(n,i,o){return i||o?new D(t,e,n).bytepad([i,o],r):T["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},I(n,E,t,e)}},{name:"kmac",padding:d,bits:m,createMethod:function(t,e){var r=v[t],n=S(t,0,"hex");return n.create=function(n,i,o){return new x(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},I(n,S,t,e)}}],T={},R=[],k=0;k<M.length;++k)for(var C=M[k],P=C.bits,B=0;B<P.length;++B){var O=C.name+"_"+P[B];if(R.push(O),T[O]=C.createMethod(P[B],C.padding),"sha3"!==C.name){var N=C.name+P[B];R.push(N),T[N]=T[O]}}function D(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function x(t,e,r){D.call(this,t,e,r)}D.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(h&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!h||!ArrayBuffer.isView(t)))throw new Error(o);e=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=t.length,c=this.blockCount,l=0,f=this.s;l<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(e)for(n=this.start;l<u&&n<a;++l)s[n>>2]|=t[l]<<p[3&n++];else for(n=this.start;l<u&&n<a;++l)(i=t.charCodeAt(l))<128?s[n>>2]|=i<<p[3&n++]:i<2048?(s[n>>2]|=(192|i>>6)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(s[n>>2]|=(224|i>>12)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++l)),s[n>>2]|=(240|i>>18)<<p[3&n++],s[n>>2]|=(128|i>>12&63)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)f[n]^=s[n];L(f),this.reset=!0}else this.start=n}return this},D.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(h&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!h||!ArrayBuffer.isView(t)))throw new Error(o);e=!0}var n=0,i=t.length;if(e)n=i;else for(var s=0;s<t.length;++s){var a=t.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},D.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},D.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];L(n)}},D.prototype.toString=D.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=f[t>>4&15]+f[15&t]+f[t>>12&15]+f[t>>8&15]+f[t>>20&15]+f[t>>16&15]+f[t>>28&15]+f[t>>24&15];s%e===0&&(L(r),o=0)}return i&&(t=r[o],a+=f[t>>4&15]+f[15&t],i>1&&(a+=f[t>>12&15]+f[t>>8&15]),i>2&&(a+=f[t>>20&15]+f[t>>16&15])),a},D.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e===0&&L(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},D.prototype.buffer=D.prototype.arrayBuffer,D.prototype.digest=D.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r===0&&L(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},x.prototype=new D,x.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var L=function(t){var e,r,n,i,o,s,a,u,c,l,h,f,d,p,g,m,b,v,w,_,E,S,I,A,M,T,R,k,C,P,B,O,N,D,x,L,U,j,K,F,V,q,z,H,G,W,Z,Y,X,Q,J,$,tt,et,rt,nt,it,ot,st,at,ut,ct,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|h>>>31),r=a^(h<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=c^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=h^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],g=t[1],W=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,k=t[20]<<3|t[21]>>>29,C=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,x=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,Y=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Q=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,M=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,j=t[26]<<25|t[27]>>>7,K=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,E=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,H=t[8]<<27|t[9]>>>5,G=t[9]<<27|t[8]>>>5,T=t[18]<<20|t[19]>>>12,R=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,I=t[49]<<14|t[48]>>>18,t[0]=p^~m&v,t[1]=g^~b&w,t[10]=A^~T&k,t[11]=M^~R&C,t[20]=D^~L&j,t[21]=x^~U&K,t[30]=H^~W&Y,t[31]=G^~Z&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=m^~v&_,t[3]=b^~w&E,t[12]=T^~k&P,t[13]=R^~C&B,t[22]=L^~j&F,t[23]=U^~K&V,t[32]=W^~Y&Q,t[33]=Z^~X&J,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~_&S,t[5]=w^~E&I,t[14]=k^~P&O,t[15]=C^~B&N,t[24]=j^~F&q,t[25]=K^~V&z,t[34]=Y^~Q&$,t[35]=X^~J&tt,t[44]=ot^~at&ct,t[45]=st^~ut&lt,t[6]=_^~S&p,t[7]=E^~I&g,t[16]=P^~O&A,t[17]=B^~N&M,t[26]=F^~q&D,t[27]=V^~z&x,t[36]=Q^~$&H,t[37]=J^~tt&G,t[46]=at^~ct&et,t[47]=ut^~lt&rt,t[8]=S^~p&m,t[9]=I^~g&b,t[18]=O^~A&T,t[19]=N^~M&R,t[28]=q^~D&L,t[29]=z^~x&U,t[38]=$^~H&W,t[39]=tt^~G&Z,t[48]=ct^~et&nt,t[49]=lt^~rt&it,t[0]^=y[n],t[1]^=y[n+1]};if(c)t.exports=T;else{for(k=0;k<R.length;++k)a[R[k]]=T[R[k]];l&&(void 0===(n=function(){return T}.call(e,r,e,t))||(t.exports=n))}}()},12738:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.StoreCodecs=e.WakuStore=e.PageDirection=e.waku_store=e.RelayCodecs=e.WakuRelay=e.waku_relay=e.PushResponse=e.LightPushCodec=e.WakuLightPush=e.waku_light_push=e.getPublicKey=e.generateSymmetricKey=e.generatePrivateKey=e.WakuMessage=e.waku_message=e.Protocols=e.DefaultPubSubTopic=e.Waku=e.waku=e.utils=e.utf8=e.enr=e.discovery=e.getPredefinedBootstrapNodes=void 0;var s=r(93656);Object.defineProperty(e,"getPredefinedBootstrapNodes",{enumerable:!0,get:function(){return s.getPredefinedBootstrapNodes}}),e.discovery=o(r(93656)),e.enr=o(r(58420)),e.utf8=o(r(32744)),e.utils=o(r(58928)),e.waku=o(r(5151));var a=r(5151);Object.defineProperty(e,"Waku",{enumerable:!0,get:function(){return a.Waku}}),Object.defineProperty(e,"DefaultPubSubTopic",{enumerable:!0,get:function(){return a.DefaultPubSubTopic}}),Object.defineProperty(e,"Protocols",{enumerable:!0,get:function(){return a.Protocols}}),e.waku_message=o(r(31195));var u=r(31195);Object.defineProperty(e,"WakuMessage",{enumerable:!0,get:function(){return u.WakuMessage}});var c=r(57834);Object.defineProperty(e,"generatePrivateKey",{enumerable:!0,get:function(){return c.generatePrivateKey}}),Object.defineProperty(e,"generateSymmetricKey",{enumerable:!0,get:function(){return c.generateSymmetricKey}}),Object.defineProperty(e,"getPublicKey",{enumerable:!0,get:function(){return c.getPublicKey}}),e.waku_light_push=o(r(50510));var l=r(50510);Object.defineProperty(e,"WakuLightPush",{enumerable:!0,get:function(){return l.WakuLightPush}}),Object.defineProperty(e,"LightPushCodec",{enumerable:!0,get:function(){return l.LightPushCodec}}),Object.defineProperty(e,"PushResponse",{enumerable:!0,get:function(){return l.PushResponse}}),e.waku_relay=o(r(45549));var h=r(45549);Object.defineProperty(e,"WakuRelay",{enumerable:!0,get:function(){return h.WakuRelay}}),Object.defineProperty(e,"RelayCodecs",{enumerable:!0,get:function(){return h.RelayCodecs}}),e.waku_store=o(r(93539));var f=r(93539);Object.defineProperty(e,"PageDirection",{enumerable:!0,get:function(){return f.PageDirection}}),Object.defineProperty(e,"WakuStore",{enumerable:!0,get:function(){return f.WakuStore}}),Object.defineProperty(e,"StoreCodecs",{enumerable:!0,get:function(){return f.StoreCodecs}})},5602:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.sha256=e.randomBytes=e.subtle=e.crypto=void 0;const i=n(r(86433)),o="undefined"!==typeof window&&window&&(window.crypto||window.msCrypto)||i.default.webcrypto;e.crypto=o;const s=o.subtle||o.webkitSubtle;if(e.subtle=s,void 0===s)throw new Error("crypto and/or subtle api unavailable");e.randomBytes=function(t){return o.getRandomValues(new Uint8Array(t))},e.sha256=function(t){return s.digest({name:"SHA-256"},t)}},55007:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Bootstrap=void 0;const i=n(r(18392)),o=r(98719),s=r(22872),a=r(93656),u=(0,i.default)("waku:discovery:bootstrap");class c{constructor(t){var e;const r=null!==(e=t.maxPeers)&&void 0!==e?e:c.DefaultMaxPeers;if(t.default)u("Use hosted list of peers."),this.getBootstrapPeers=()=>Promise.resolve((0,a.getPredefinedBootstrapNodes)(void 0,r));else if(void 0!==t.peers&&t.peers.length>0){const e=t.peers.map((t=>"string"===typeof t?new o.Multiaddr(t):t)),n=(0,a.getPseudoRandomSubset)(e,r);u("Use provided list of peers (reduced to maxPeers)",e.map((t=>t.toString()))),this.getBootstrapPeers=()=>Promise.resolve(n)}else if("function"===typeof t.getPeers){u("Bootstrap: Use provided getPeers function.");const e=t.getPeers;this.getBootstrapPeers=async()=>{const t=await e();return(0,a.getPseudoRandomSubset)(t,r).map((t=>new o.Multiaddr(t)))}}else if(t.enrUrl){const e=t.enrUrl;u("Use provided EIP-1459 ENR Tree URL.");const n=s.DnsNodeDiscovery.dnsOverHttp();this.getBootstrapPeers=async()=>{const t=await n.getPeers(r,[e]);return u("Found ".concat(t.length," peers")),t.map((t=>t.getFullMultiaddrs())).flat()}}else u("No bootstrap method specified, no peer will be returned"),this.getBootstrapPeers=void 0}}e.Bootstrap=c,c.DefaultMaxPeers=1},22872:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DnsNodeDiscovery=void 0;const i=n(r(88093)),o=r(18392),s=r(58420),a=r(42132),u=r(52039),c=(0,o.debug)("waku:discovery:dns");class l{constructor(t){this._errorTolerance=10,this._DNSTreeCache={},this.dns=t}static dnsOverHttp(t){const e=new a.DnsOverHttps(t);return new l(e)}async getPeers(t,e){let r=0;const n=[],i=Math.floor(Math.random()*e.length),{publicKey:o,domain:s}=u.ENRTree.parseTree(e[i]);for(;n.length<t&&r<t+this._errorTolerance;){const t={domain:s,publicKey:o,visits:{}},e=await this._search(s,t);e&&h(e,n)&&(n.push(e),c("got new peer candidate from DNS address=".concat(e.nodeId,"@").concat(e.ip))),r++}return n}async _search(t,e){try{const n=await this._getTXTRecord(t,e);let i,o;e.visits[t]=!0;const a=function(t){return t.startsWith(u.ENRTree.ROOT_PREFIX)?u.ENRTree.ROOT_PREFIX:t.startsWith(u.ENRTree.BRANCH_PREFIX)?u.ENRTree.BRANCH_PREFIX:t.startsWith(u.ENRTree.RECORD_PREFIX)?u.ENRTree.RECORD_PREFIX:""}(n);try{switch(a){case u.ENRTree.ROOT_PREFIX:return i=u.ENRTree.parseAndVerifyRoot(n,e.publicKey),await this._search(i,e);case u.ENRTree.BRANCH_PREFIX:return o=u.ENRTree.parseBranch(n),i=function(t,e){const r={};for(const[i,o]of t.entries())e.visits[o]&&(r[i]=!0);if(Object.keys(r).length===t.length)throw new Error("Unresolvable circular path detected");let n;do{n=Math.floor(Math.random()*t.length)}while(r[n]);return t[n]}(o,e),await this._search(i,e);case u.ENRTree.RECORD_PREFIX:return s.ENR.decodeTxt(n);default:return null}}catch(r){return c("Failed to search DNS tree ".concat(a," at subdomain ").concat(t,": ").concat(r)),null}}catch(r){return c("Failed to retrieve TXT record at subdomain ".concat(t,": ").concat(r)),null}}async _getTXTRecord(t,e){if(this._DNSTreeCache[t])return this._DNSTreeCache[t];const r=t!==e.domain?"".concat(t,".").concat(e.domain):e.domain,n=await this.dns.resolveTXT(r);(0,i.default)(n.length,"Received empty result array while fetching TXT record"),(0,i.default)(n[0].length,"Received empty TXT record");const o=n.join("");return this._DNSTreeCache[t]=o,o}}function h(t,e){if(!t||!t.nodeId)return!1;for(const r of e)if(t.nodeId===r.nodeId)return!1;return!0}e.DnsNodeDiscovery=l},42132:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DnsOverHttps=void 0;const n=r(54535),i=r(32744),{cloudflare:o,google:s,opendns:a}=n.endpoints;e.DnsOverHttps=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[o,s,a];this.endpoints=t}async resolveTXT(t){const e=(await(0,n.query)({questions:[{type:"TXT",name:t}]})).answers.map((t=>t.data)),r=[];return e.forEach((t=>{"string"===typeof t?r.push(t):Array.isArray(t)?t.forEach((t=>{"string"===typeof t?r.push(t):r.push((0,i.bytesToUtf8)(t))})):r.push((0,i.bytesToUtf8)(t))})),r}}},52039:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ENRTree=void 0;const a=s(r(88093)),u=o(r(49437)),c=r(70621),l=r(58420),h=r(32744),f=r(58928);class d{static parseAndVerifyRoot(t,e){(0,a.default)(t.startsWith(this.ROOT_PREFIX),"ENRTree root entry must start with '".concat(this.ROOT_PREFIX,"'"));const r=d.parseRootValues(t),n=u.decode.asBytes(e),i=t.split(" sig")[0],o=(0,h.utf8ToBytes)(i),s=(0,f.base64ToBytes)(r.signature).slice(0,64),l=(0,c.ecdsaVerify)(s,(0,f.keccak256Buf)(o),new Uint8Array(n));return(0,a.default)(l,"Unable to verify ENRTree root signature"),r.eRoot}static parseRootValues(t){const e=t.match(/^enrtree-root:v1 e=([^ ]+) l=([^ ]+) seq=(\d+) sig=([^ ]+)$/);a.default.ok(Array.isArray(e),"Could not parse ENRTree root entry"),e.shift();const[r,n,i,o]=e;return a.default.ok(r,"Could not parse 'e' value from ENRTree root entry"),a.default.ok(n,"Could not parse 'l' value from ENRTree root entry"),a.default.ok(i,"Could not parse 'seq' value from ENRTree root entry"),a.default.ok(o,"Could not parse 'sig' value from ENRTree root entry"),{eRoot:r,lRoot:n,seq:Number(i),signature:o}}static parseTree(t){(0,a.default)(t.startsWith(this.TREE_PREFIX),"ENRTree tree entry must start with '".concat(this.TREE_PREFIX,"'"));const e=t.match(/^enrtree:\/\/([^@]+)@(.+)$/);a.default.ok(Array.isArray(e),"Could not parse ENRTree tree entry"),e.shift();const[r,n]=e;return a.default.ok(r,"Could not parse public key from ENRTree tree entry"),a.default.ok(n,"Could not parse domain from ENRTree tree entry"),{publicKey:r,domain:n}}static parseBranch(t){return(0,a.default)(t.startsWith(this.BRANCH_PREFIX),"ENRTree branch entry must start with '".concat(this.BRANCH_PREFIX,"'")),t.split(this.BRANCH_PREFIX)[1].split(",")}}e.ENRTree=d,d.RECORD_PREFIX=l.ENR.RECORD_PREFIX,d.TREE_PREFIX="enrtree:",d.BRANCH_PREFIX="enrtree-branch:",d.ROOT_PREFIX="enrtree-root:"},93656:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.getPseudoRandomSubset=e.ENRTree=e.DnsOverHttps=e.DnsNodeDiscovery=e.Bootstrap=e.predefined=e.getPredefinedBootstrapNodes=void 0;const s=r(53357);var a=r(21370);Object.defineProperty(e,"getPredefinedBootstrapNodes",{enumerable:!0,get:function(){return a.getPredefinedBootstrapNodes}}),e.predefined=o(r(21370));var u=r(55007);Object.defineProperty(e,"Bootstrap",{enumerable:!0,get:function(){return u.Bootstrap}});var c=r(22872);Object.defineProperty(e,"DnsNodeDiscovery",{enumerable:!0,get:function(){return c.DnsNodeDiscovery}});var l=r(42132);Object.defineProperty(e,"DnsOverHttps",{enumerable:!0,get:function(){return l.DnsOverHttps}});var h=r(52039);Object.defineProperty(e,"ENRTree",{enumerable:!0,get:function(){return h.ENRTree}}),e.getPseudoRandomSubset=function(t,e){return t.length<=e?t:(0,s.shuffle)(t).slice(0,e)}},21370:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fleets=e.getPredefinedBootstrapNodes=e.Fleet=e.DefaultWantedNumber=void 0;const n=r(98719),i=r(93656);var o;e.DefaultWantedNumber=1,function(t){t.Prod="prod",t.Test="test"}(o=e.Fleet||(e.Fleet={})),e.getPredefinedBootstrapNodes=function(){let t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.Prod,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultWantedNumber;if(s<=0)return[];switch(r){case o.Prod:t=e.fleets.fleets["wakuv2.prod"]["waku-websocket"];break;case o.Test:t=e.fleets.fleets["wakuv2.test"]["waku-websocket"];break;default:t=e.fleets.fleets["wakuv2.prod"]["waku-websocket"]}return t=Object.values(t),t=t.map((t=>new n.Multiaddr(t))),(0,i.getPseudoRandomSubset)(t,s)},e.fleets={fleets:{"wakuv2.prod":{"waku-websocket":{"node-01.ac-cn-hongkong-c.wakuv2.prod":"/dns4/node-01.ac-cn-hongkong-c.wakuv2.prod.statusim.net/tcp/443/wss/p2p/16Uiu2HAm4v86W3bmT1BiH6oSPzcsSr24iDQpSN5Qa992BCjjwgrD","node-01.do-ams3.wakuv2.prod":"/dns4/node-01.do-ams3.wakuv2.prod.statusim.net/tcp/443/wss/p2p/16Uiu2HAmL5okWopX7NqZWBUKVqW8iUxCEmd5GMHLVPwCgzYzQv3e","node-01.gc-us-central1-a.wakuv2.prod":"/dns4/node-01.gc-us-central1-a.wakuv2.prod.statusim.net/tcp/443/wss/p2p/16Uiu2HAmVkKntsECaYfefR1V2yCR79CegLATuTPE6B9TxgxBiiiA"}},"wakuv2.test":{"waku-websocket":{"node-01.ac-cn-hongkong-c.wakuv2.test":"/dns4/node-01.ac-cn-hongkong-c.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm","node-01.do-ams3.wakuv2.test":"/dns4/node-01.do-ams3.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ","node-01.gc-us-central1-a.wakuv2.test":"/dns4/node-01.gc-us-central1-a.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS"}}}}},74029:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MULTIADDR_LENGTH_SIZE=e.ERR_NO_SIGNATURE=e.ERR_INVALID_ID=e.MAX_RECORD_SIZE=void 0,e.MAX_RECORD_SIZE=300,e.ERR_INVALID_ID="Invalid record id",e.ERR_NO_SIGNATURE="No valid signature found",e.MULTIADDR_LENGTH_SIZE=2},94341:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createNodeId=void 0;const n=r(58928);e.createNodeId=function(t){if(32!==t.length)throw new Error("NodeId must be 32 bytes in length");return(0,n.bytesToHex)(t)}},81326:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ENR=void 0;const a=o(r(67845)),u=s(r(18392)),c=r(98719),l=s(r(93516)),h=r(74561),f=r(32744),d=r(58928),p=r(74029),y=r(3063),g=r(47159),m=o(r(71734)),b=(0,u.default)("waku:enr");class v extends Map{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(Object.entries(t)),this.seq=e,this.signature=r}static createV4(t){return new v({...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},id:(0,f.utf8ToBytes)("v4"),secp256k1:t})}static createFromPeerId(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,y.createKeypairFromPeerId)(t);if(r.type===y.KeypairType.secp256k1)return v.createV4(r.publicKey,e);throw new Error}static decodeFromValues(t){if(!Array.isArray(t))throw new Error("Decoded ENR must be an array");if(t.length%2!==0)throw new Error("Decoded ENR must have an even number of elements");const[e,r,...n]=t;if(!e||Array.isArray(e))throw new Error("Decoded ENR invalid signature: must be a byte array");if(!r||Array.isArray(r))throw new Error("Decoded ENR invalid sequence number: must be a byte array");const i={};for(let a=0;a<n.length;a+=2)try{i[(0,f.bytesToUtf8)(n[a])]=n[a+1]}catch(u){b("Failed to decode ENR key to UTF-8, skipping it",n[a],u)}const o=new v(i,BigInt("0x"+(0,d.bytesToHex)(r)),e),s=(0,d.hexToBytes)(a.encode([r,...n]));if(!o.verify(s,e))throw new Error("Unable to verify ENR signature");return o}static decode(t){const e=a.decode(t).map(d.hexToBytes);return v.decodeFromValues(e)}static decodeTxt(t){if(!t.startsWith(this.RECORD_PREFIX))throw new Error("\"string encoded ENR must start with '".concat(this.RECORD_PREFIX,"'"));return v.decode((0,d.base64ToBytes)(t.slice(4)))}set(t,e){return this.signature=null,this.seq++,super.set(t,e)}get id(){const t=this.get("id");if(!t)throw new Error("id not found.");return(0,f.bytesToUtf8)(t)}get keypairType(){if("v4"===this.id)return y.KeypairType.secp256k1;throw new Error(p.ERR_INVALID_ID)}get publicKey(){if("v4"===this.id)return this.get("secp256k1");throw new Error(p.ERR_INVALID_ID)}get keypair(){if(this.publicKey){const t=this.publicKey;return(0,y.createKeypair)(this.keypairType,void 0,t)}}get peerId(){return this.keypair?(0,y.createPeerIdFromKeypair)(this.keypair):void 0}get nodeId(){if("v4"===this.id)return this.publicKey?m.nodeId(this.publicKey):void 0;throw new Error(p.ERR_INVALID_ID)}get ip(){const t=this.get("ip");return t?l.default.toString(c.protocols.names.ip4.code,t):void 0}set ip(t){t?this.set("ip",l.default.toBytes(c.protocols.names.ip4.code,t)):this.delete("ip")}get tcp(){const t=this.get("tcp");return t?Number(l.default.toString(c.protocols.names.tcp.code,t)):void 0}set tcp(t){void 0===t?this.delete("tcp"):this.set("tcp",l.default.toBytes(c.protocols.names.tcp.code,t))}get udp(){const t=this.get("udp");return t?Number(l.default.toString(c.protocols.names.udp.code,t)):void 0}set udp(t){void 0===t?this.delete("udp"):this.set("udp",l.default.toBytes(c.protocols.names.udp.code,t))}get ip6(){const t=this.get("ip6");return t?l.default.toString(c.protocols.names.ip6.code,t):void 0}set ip6(t){t?this.set("ip6",l.default.toBytes(c.protocols.names.ip6.code,t)):this.delete("ip6")}get tcp6(){const t=this.get("tcp6");return t?Number(l.default.toString(c.protocols.names.tcp.code,t)):void 0}set tcp6(t){void 0===t?this.delete("tcp6"):this.set("tcp6",l.default.toBytes(c.protocols.names.tcp.code,t))}get udp6(){const t=this.get("udp6");return t?Number(l.default.toString(c.protocols.names.udp.code,t)):void 0}set udp6(t){void 0===t?this.delete("udp6"):this.set("udp6",l.default.toBytes(c.protocols.names.udp.code,t))}get multiaddrs(){const t=this.get("multiaddrs");if(t)return(0,g.decodeMultiaddrs)(t)}set multiaddrs(t){if(void 0===t)this.delete("multiaddrs");else{const e=(0,g.encodeMultiaddrs)(t);this.set("multiaddrs",e)}}getLocationMultiaddr(t){if("udp"===t)return this.getLocationMultiaddr("udp4")||this.getLocationMultiaddr("udp6");if("tcp"===t)return this.getLocationMultiaddr("tcp4")||this.getLocationMultiaddr("tcp6");const e=t.endsWith("6"),r=this.get(e?"ip6":"ip");if(!r)return;const n=t.startsWith("udp"),i=t.startsWith("tcp");let o,s;if(n)o="udp",s=e?this.get("udp6"):this.get("udp");else{if(!i)return;o="tcp",s=e?this.get("tcp6"):this.get("tcp")}if(!s)return;const a=c.protocols.names[e?"ip6":"ip4"],u=a.size/8,l=c.protocols.names[o],f=(0,h.encode)(l.code),d=new Uint8Array(3+u+f.length);return d[0]=a.code,d.set(r,1),d.set(f,1+u),d.set(s,1+u+f.length),new c.Multiaddr(d)}setLocationMultiaddr(t){const e=t.protoNames();if(2!==e.length&&"udp"!==e[1]&&"tcp"!==e[1])throw new Error("Invalid multiaddr");const r=t.tuples();if(!r[0][1]||!r[1][1])throw new Error("Invalid multiaddr");4===r[0][0]?(this.set("ip",r[0][1]),this.set(e[1],r[1][1])):(this.set("ip6",r[0][1]),this.set(e[1]+"6",r[1][1]))}getFullMultiaddr(t){if(this.peerId){const e=this.getLocationMultiaddr(t);if(e)return e.encapsulate("/p2p/".concat(this.peerId.toB58String()))}}getFullMultiaddrs(){if(this.peerId&&this.multiaddrs){const t=this.peerId;return this.multiaddrs.map((e=>e.encapsulate("/p2p/".concat(t.toB58String()))))}return[]}verify(t,e){if(!this.get("id")||"v4"!==this.id)throw new Error(p.ERR_INVALID_ID);if(!this.publicKey)throw new Error("Failed to verify ENR: No public key");return m.verify(this.publicKey,t,e)}sign(t,e){if("v4"!==this.id)throw new Error(p.ERR_INVALID_ID);return this.signature=m.sign(e,t),this.signature}encodeToValues(t){const e=Array.from(this.keys()).sort(((t,e)=>t.localeCompare(e))).map((t=>[t,this.get(t)])).map((t=>{let[e,r]=t;return[(0,f.utf8ToBytes)(e),r]})).flat();if(e.unshift(new Uint8Array([Number(this.seq)])),t)e.unshift(this.sign((0,d.hexToBytes)(a.encode(e)),t));else{if(!this.signature)throw new Error(p.ERR_NO_SIGNATURE);e.unshift(this.signature)}return e}encode(t){const e=(0,d.hexToBytes)(a.encode(this.encodeToValues(t)));if(e.length>=p.MAX_RECORD_SIZE)throw new Error("ENR must be less than 300 bytes");return e}async encodeTxt(t){return v.RECORD_PREFIX+await(0,d.bytesToBase64)(this.encode(t))}}e.ENR=v,v.RECORD_PREFIX="enr:"},58420:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.v4=void 0;const a=o(r(71734));e.v4=a,s(r(74029),e),s(r(81326),e),s(r(59477),e),s(r(94341),e),s(r(3063),e)},52445:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERR_INVALID_KEYPAIR_TYPE=e.ERR_TYPE_NOT_IMPLEMENTED=void 0,e.ERR_TYPE_NOT_IMPLEMENTED="Keypair type not implemented",e.ERR_INVALID_KEYPAIR_TYPE="Invalid keypair type"},3063:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createKeypairFromPeerId=e.createPeerIdFromKeypair=e.createKeypair=e.generateKeypair=void 0;const s=r(25504),a=o(r(53765)),u=o(r(90190)),{keysPBM:c,supportedKeys:l}=s.keys,h=r(52445),f=r(31981),d=r(71288);function p(t,e,r){if(t===d.KeypairType.secp256k1)return new f.Secp256k1Keypair(e,r);throw new Error(h.ERR_TYPE_NOT_IMPLEMENTED)}i(r(71288),e),i(r(31981),e),e.generateKeypair=async function(t){if(t===d.KeypairType.secp256k1)return await f.Secp256k1Keypair.generate();throw new Error(h.ERR_TYPE_NOT_IMPLEMENTED)},e.createKeypair=p,e.createPeerIdFromKeypair=function(t){if(t.type===d.KeypairType.secp256k1){const e=t.hasPrivateKey()?new l.secp256k1.Secp256k1PrivateKey(t.privateKey,t.publicKey):void 0,r=new l.secp256k1.Secp256k1PublicKey(t.publicKey),n=a.default.encode(r.bytes,"identity");return new u.default(n,e,r)}throw new Error(h.ERR_TYPE_NOT_IMPLEMENTED)},e.createKeypairFromPeerId=function(t){const e=c.PublicKey.decode(t.pubKey.bytes);return p(e.Type,t.privKey?t.privKey.marshal():void 0,e.Data)}},31981:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Secp256k1Keypair=e.secp256k1PublicKeyToRaw=e.secp256k1PublicKeyToFull=e.secp256k1PublicKeyToCompressed=void 0;const a=s(r(86433)),u=o(r(70621)),c=r(71288);function l(t){if(64===t.length){const e=new Uint8Array(t.length+1);e.set([4]),e.set(t,1),t=e}return u.publicKeyConvert(t,!0)}e.secp256k1PublicKeyToCompressed=l,e.secp256k1PublicKeyToFull=function(t){if(64===t.length){const e=new Uint8Array(t.length+1);e.set([4]),e.set(t,1),t=e}return u.publicKeyConvert(t,!1)},e.secp256k1PublicKeyToRaw=function(t){return u.publicKeyConvert(t,!1).slice(1)};const h=class t extends c.AbstractKeypair{constructor(t,e){let r=e;r&&(r=l(r)),super(t,r),this.type=c.KeypairType.secp256k1}static async generate(){const e=await function(t){if("undefined"!==typeof window&&window&&window.crypto){const e=new Uint8Array(t);return window.crypto.getRandomValues(e),e}return a.default.randomBytes(t)}(32),r=u.publicKeyCreate(e);return new t(e,r)}privateKeyVerify(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._privateKey;return!t||u.privateKeyVerify(t)}publicKeyVerify(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._publicKey;return!t||u.publicKeyVerify(t)}sign(t){const{signature:e,recid:r}=u.ecdsaSign(t,this.privateKey),n=new Uint8Array(e.length+1);return n.set(e),n.set([r],e.length),n}verify(t,e){return u.ecdsaVerify(e,t,this.publicKey)}};e.Secp256k1Keypair=h},71288:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractKeypair=e.KeypairType=void 0,function(t){t[t.rsa=0]="rsa",t[t.ed25519=1]="ed25519",t[t.secp256k1=2]="secp256k1"}(e.KeypairType||(e.KeypairType={}));e.AbstractKeypair=class{constructor(t,e){if((this._privateKey=t)&&!this.privateKeyVerify())throw new Error("Invalid private key");if((this._publicKey=e)&&!this.publicKeyVerify())throw new Error("Invalid private key")}get privateKey(){if(!this._privateKey)throw new Error;return this._privateKey}get publicKey(){if(!this._publicKey)throw new Error;return this._publicKey}privateKeyVerify(){return!0}publicKeyVerify(){return!0}hasPrivateKey(){return Boolean(this._privateKey)}}},47159:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeMultiaddrs=e.decodeMultiaddrs=void 0;const n=r(98719),i=r(74029);e.decodeMultiaddrs=function(t){const e=[];let r=0;for(;r<t.length;){const o=new DataView(t.buffer,r,i.MULTIADDR_LENGTH_SIZE).getUint16(0);r+=i.MULTIADDR_LENGTH_SIZE;const s=t.slice(r,r+o);r+=o;const a=new n.Multiaddr(s);e.push(a)}return e},e.encodeMultiaddrs=function(t){const e=t.reduce(((t,e)=>t+i.MULTIADDR_LENGTH_SIZE+e.bytes.length),0),r=new Uint8Array(e),n=new DataView(r.buffer);let o=0;return t.forEach((t=>{if(t.getPeerId())throw new Error("`multiaddr` field MUST not contain peer id");n.setUint16(o,t.bytes.length),o+=i.MULTIADDR_LENGTH_SIZE,r.set(t.bytes,o),o+=t.bytes.length})),r}},59477:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},71734:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ENRKeyPair=e.nodeId=e.verify=e.sign=e.publicKey=e.createPrivateKey=e.hash=void 0;const a=s(r(86433)),u=r(27898),c=o(r(70621)),l=r(94341);function h(t){return new Uint8Array(u.keccak256.arrayBuffer(t))}async function f(){return function(t){if("undefined"!==typeof window&&window&&window.crypto){const e=new Uint8Array(t);return window.crypto.getRandomValues(e),e}return a.default.randomBytes(t)}(32)}function d(t){return c.publicKeyCreate(t)}function p(t,e){const{signature:r}=c.ecdsaSign(h(e),t);return r}function y(t,e,r){return c.ecdsaVerify(r.slice(0,64),h(e),t)}function g(t){const e=c.publicKeyConvert(t,!1);return(0,l.createNodeId)(h(e.slice(1)))}e.hash=h,e.createPrivateKey=f,e.publicKey=d,e.sign=p,e.verify=y,e.nodeId=g;class m{constructor(t,e,r){this.nodeId=t,this.privateKey=e,this.publicKey=r}static async create(t){if(t&&!c.privateKeyVerify(t))throw new Error("Invalid private key");const e=t||await f(),r=d(e),n=g(r);return new m(n,e,r)}sign(t){return p(this.privateKey,t)}verify(t,e){return y(this.publicKey,t,e)}}e.ENRKeyPair=m},19370:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPeersForProtocol=e.selectRandomPeer=void 0,e.selectRandomPeer=async function(t){const e=[];for await(const r of t)e.push(r);if(0===e.length)return;return e[Math.round(Math.random()*(e.length-1))]},e.getPeersForProtocol=async function*(t,e){for await(const r of t.peerStore.getPeers()){let t=!1;for(let n=0;n<e.length;n++)if(r.protocols.includes(e[n])){t=!0;break}t&&(yield r)}}},32744:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.utf8ToBytes=e.bytesToUtf8=void 0,e.bytesToUtf8=function(t){let e=0,r="";for(;e<t.length;){let n=t[e++];if(n>127)if(n>191&&n<224){if(e>=t.length)throw new Error("UTF-8 decode: incomplete 2-byte sequence");n=(31&n)<<6|63&t[e++]}else if(n>223&&n<240){if(e+1>=t.length)throw new Error("UTF-8 decode: incomplete 3-byte sequence");n=(15&n)<<12|(63&t[e++])<<6|63&t[e++]}else{if(!(n>239&&n<248))throw new Error("UTF-8 decode: unknown multi byte start 0x"+n.toString(16)+" at index "+(e-1));if(e+2>=t.length)throw new Error("UTF-8 decode: incomplete 4-byte sequence");n=(7&n)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++]}if(n<=65535)r+=String.fromCharCode(n);else{if(!(n<=1114111))throw new Error("UTF-8 decode: code point 0x"+n.toString(16)+" exceeds UTF-16 reach");n-=65536,r+=String.fromCharCode(n>>10|55296),r+=String.fromCharCode(1023&n|56320)}}return r},e.utf8ToBytes=function(t){let e=0;const r=new Uint8Array(4*t.length);for(let n=0;n!=t.length;n++){let i=t.charCodeAt(n);if(i<128)r[e++]=i;else{if(i<2048)r[e++]=i>>6|192;else{if(i>55295&&i<56320){if(++n>=t.length)throw new Error("UTF-8 encode: incomplete surrogate pair");const o=t.charCodeAt(n);if(o<56320||o>57343)throw new Error("UTF-8 encode: second surrogate character 0x"+o.toString(16)+" at index "+n+" out of range");i=65536+((1023&i)<<10)+(1023&o),r[e++]=i>>18|240,r[e++]=i>>12&63|128}else r[e++]=i>>12|224;r[e++]=i>>6&63|128}r[e++]=63&i|128}}return r.subarray(0,e)}},58928:(t,e,r)=>{"use strict";var n=r(19778).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.bytesToBase64=e.base64ToBytes=e.keccak256Buf=e.equalByteArrays=e.bytesToHex=e.bufToHex=e.hexToBytes=e.hexToBuf=void 0;const i=r(27898);function o(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r]<0?t[r]+256:t[r];e.push((n>>>4).toString(16)),e.push((15&n).toString(16))}return e.join("")}e.hexToBuf=function(t){return"string"===typeof t?n.from(t.replace(/^0x/i,""),"hex"):n.from(t)},e.hexToBytes=function(t){if("string"===typeof t){const e=t.replace(/^0x/i,""),r=[];for(let t=0;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}return t},e.bufToHex=function(t){return n.from(t).toString("hex")},e.bytesToHex=o,e.equalByteArrays=function(t,e){let r,n;return r="string"===typeof t?t.replace(/^0x/i,"").toLowerCase():o(t),n="string"===typeof e?e.replace(/^0x/i,"").toLowerCase():o(e),r===n},e.keccak256Buf=function(t){return new Uint8Array(i.keccak256.arrayBuffer(t))},e.base64ToBytes=function(t){const e=new Map,r=t.length,n=[];for(let a=0;a<64;a++)e.set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(a),a);e.set("+",62),e.set("/",63);let i,o=0,s=0;for(let a=0;a<r;a++){const u=e.get(t.charAt(a));if(void 0===u)throw new Error("Invalid base64 character ".concat(t.charAt(a)));for(o=(o<<6)+u,s+=6;s>=8;)((i=o>>>(s-=8)&255)||a<r-2)&&n.push(i)}return new Uint8Array(n)},e.bytesToBase64=async function(t){return(await new Promise((e=>{const r=new window.FileReader;r.onload=()=>e(r.result),r.readAsDataURL(new Blob([t]))}))).split(",",2)[1].replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}},5151:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Waku=e.Protocols=e.DefaultPubSubTopic=e.DefaultRelayKeepAliveValueSecs=e.DefaultPingKeepAliveValueSecs=void 0;const i=r(97806),o=n(r(18392)),s=n(r(6197)),a=n(r(44786)),u=n(r(34875)),c=n(r(3300)),l=n(r(44169)),h=n(r(66321)),f=r(98719),d=n(r(90190)),p=r(93656),y=r(50510),g=r(31195),m=r(45549),b=r(21923),v=r(93539),w=c.default.prototype[Symbol.toStringTag];e.DefaultPingKeepAliveValueSecs=0,e.DefaultRelayKeepAliveValueSecs=300,e.DefaultPubSubTopic="/waku/2/default-waku/proto";const _=(0,o.default)("waku:waku");var E;!function(t){t.Relay="relay",t.Store="store",t.LightPush="lightpush"}(E=e.Protocols||(e.Protocols={}));class S{constructor(t,r,n,i){var o;this.libp2p=r,this.relay=r.pubsub,this.store=n,this.lightPush=i,this.pingKeepAliveTimers={},this.relayKeepAliveTimers={};const s=t.pingKeepAlive||e.DefaultPingKeepAliveValueSecs,a=t.relayKeepAlive||e.DefaultRelayKeepAliveValueSecs;r.connectionManager.on("peer:connect",(t=>{this.startKeepAlive(t.remotePeer,s,a)})),r.connectionManager.on("peer:disconnect",(t=>{this.stopKeepAlive(t.remotePeer)})),null===t||void 0===t||null===(o=t.decryptionKeys)||void 0===o||o.forEach((t=>{this.addDecryptionKey(t)}))}static async create(t){var e,r,n;const o=Object.assign({},null===t||void 0===t?void 0:t.libp2p);if(o.config=Object.assign({transport:{[w]:{filter:l.default.all}}},null===t||void 0===t||null===(e=t.libp2p)||void 0===e?void 0:e.config),null!==t&&void 0!==t&&t.pubSubTopic&&(o.config.pubsub=Object.assign({pubSubTopic:t.pubSubTopic},o.config.pubsub)),o.modules=Object.assign({},null===t||void 0===t||null===(r=t.libp2p)||void 0===r?void 0:r.modules),o.modules=Object.assign({transport:[c.default]},null===t||void 0===t||null===(n=t.libp2p)||void 0===n?void 0:n.modules),o.modules=Object.assign(o.modules,{streamMuxer:[u.default],connEncryption:[new i.Noise(null===t||void 0===t?void 0:t.staticNoiseKey)],pubsub:m.WakuRelay}),null!==t&&void 0!==t&&t.bootstrap){const e=new p.Bootstrap(null===t||void 0===t?void 0:t.bootstrap);if(void 0!==e.getBootstrapPeers)try{const t=await e.getBootstrapPeers();o.modules=Object.assign(o.modules,{peerDiscovery:[a.default]}),o.config.peerDiscovery={[a.default.tag]:{list:t,enabled:!0}}}catch(g){_("Failed to retrieve bootstrap nodes",g)}}const h=await s.default.create(o),f=new v.WakuStore(h,{pubSubTopic:null===t||void 0===t?void 0:t.pubSubTopic}),d=new y.WakuLightPush(h);return await h.start(),new S(t||{},h,f,d)}async dial(t,e){const r=null!==e&&void 0!==e?e:[E.Relay],n=[];if(r.includes(E.Relay)&&m.RelayCodecs.forEach((t=>n.push(t))),r.includes(E.Store))for(const i of Object.values(v.StoreCodecs))n.push(i);return r.includes(E.LightPush)&&n.push(y.LightPushCodec),this.libp2p.dialProtocol(t,n)}addPeerToAddressBook(t,e){let r;r="string"===typeof t?d.default.createFromB58String(t):t;const n=e.map((t=>"string"===typeof t?(0,f.multiaddr)(t):t));this.libp2p.peerStore.addressBook.set(r,n)}async stop(){return this.libp2p.stop()}addDecryptionKey(t,e){this.relay.addDecryptionKey(t,e),this.store.addDecryptionKey(t,e)}deleteDecryptionKey(t){this.relay.deleteDecryptionKey(t),this.store.deleteDecryptionKey(t)}getLocalMultiaddrWithID(){const t=this.libp2p.multiaddrs.find((t=>t.toString().match(/127\.0\.0\.1/)));if(!t||""===t.toString())throw"Not listening on localhost";return t+"/p2p/"+this.libp2p.peerId.toB58String()}async waitForRemotePeer(t){const e=null!==t&&void 0!==t?t:[E.Relay,E.Store],r=[];if(e.includes(E.Relay)){if(0==this.relay.getPeers().size){const t=new Promise((t=>{this.libp2p.pubsub.once("pubsub:subscription-change",(()=>{this.libp2p.pubsub.once("gossipsub:heartbeat",t)}))}));r.push(t)}}if(e.includes(E.Store)){let t=!1;for await(const e of this.store.peers){t=!0;break}if(!t){const t=new Promise((t=>{this.libp2p.peerStore.on("change:protocols",(e=>{let{protocols:r}=e;for(const n of Object.values(v.StoreCodecs))r.includes(n)&&(_("Resolving for",n,r),t())}))}));r.push(t)}}if(e.includes(E.LightPush)){let t=!1;for await(const e of this.lightPush.peers){t=!0;break}if(!t){const t=new Promise((t=>{this.libp2p.peerStore.on("change:protocols",(e=>{let{protocols:r}=e;r.includes(y.LightPushCodec)&&(_("Resolving for",y.LightPushCodec,r),t())}))}));r.push(t)}}await Promise.all(r)}startKeepAlive(t,e,r){this.stopKeepAlive(t);const n=t.toB58String();if(0!==e){const r=new h.default(this.libp2p);this.pingKeepAliveTimers[n]=setInterval((()=>{r.ping(t).catch((t=>{_("Ping failed (".concat(n,")"),t)}))}),1e3*e)}0!==r&&(this.relayKeepAliveTimers[n]=setInterval((()=>{g.WakuMessage.fromBytes(new Uint8Array,b.RelayPingContentTopic).then((t=>this.relay.send(t)))}),1e3*r))}stopKeepAlive(t){const e=t.toB58String();this.pingKeepAliveTimers[e]&&(clearInterval(this.pingKeepAliveTimers[e]),delete this.pingKeepAliveTimers[e]),this.relayKeepAliveTimers[e]&&(clearInterval(this.relayKeepAliveTimers[e]),delete this.relayKeepAliveTimers[e])}}e.Waku=S},50510:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WakuLightPush=e.PushResponse=e.LightPushCodec=void 0;const i=n(r(72934)),o=n(r(44709)),s=n(r(79023)),a=r(63623);Object.defineProperty(e,"PushResponse",{enumerable:!0,get:function(){return a.PushResponse}});const u=r(19370),c=r(5151),l=r(80522);e.LightPushCodec="/vac/waku/lightpush/2.0.0-beta1";e.WakuLightPush=class{constructor(t,e){this.libp2p=t,null!==e&&void 0!==e&&e.pubSubTopic?this.pubSubTopic=e.pubSubTopic:this.pubSubTopic=c.DefaultPubSubTopic}async push(t,r){let n;if(null!==r&&void 0!==r&&r.peerId){if(n=await this.libp2p.peerStore.get(r.peerId),!n)throw"Peer is unknown"}else n=await this.randomPeer;if(!n)throw"No peer available";if(!n.protocols.includes(e.LightPushCodec))throw"Peer does not register waku light push protocol";const a=this.libp2p.connectionManager.get(n.id);if(!a)throw"Failed to get a connection to the peer";const{stream:u}=await a.newStream(e.LightPushCodec);try{const e=null!==r&&void 0!==r&&r.pubSubTopic?r.pubSubTopic:this.pubSubTopic,n=l.PushRPC.createRequest(t,e),a=await(0,s.default)([n.encode()],o.default.encode(),u,o.default.decode(),i.default);try{const t=l.PushRPC.decode(a.slice()).response;return t||(console.log("No response in PushRPC"),null)}catch(c){console.log("Failed to decode push reply",c)}}catch(c){console.log("Failed to send waku light push request",c)}return null}get peers(){return(0,u.getPeersForProtocol)(this.libp2p,[e.LightPushCodec])}get randomPeer(){return(0,u.selectRandomPeer)(this.peers)}}},80522:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.PushRPC=void 0;const s=r(80886),a=r(75658),u=o(r(63623));class c{constructor(t){this.proto=t}static createRequest(t,e){return new c({requestId:(0,a.v4)(),request:{message:t.proto,pubSubTopic:e},response:void 0})}static decode(t){const e=u.PushRPC.decode(s.Reader.create(t));return new c(e)}encode(){return u.PushRPC.encode(this.proto).finish()}get query(){return this.proto.request}get response(){return this.proto.response}}e.PushRPC=c},28799:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=void 0;const s=o(r(53845)),a=r(5602),u=r(58928);function c(t,e){let r=1,n=0,i=Promise.resolve(new Uint8Array);for(;n<e;){const e=new Uint8Array([r>>24,r>>16,r>>8,r]),o=new Uint8Array(e.length+t.length);o.set(e,0),o.set(t,e.length);const s=(0,a.sha256)(o);i=i.then((t=>s.then((e=>{const r=new Uint8Array(e),n=new Uint8Array(t.length+r.length);return n.set(t,0),n.set(r,t.length),n})))),n+=32,r+=1}return i}function l(t,e){if(32!==t.length)throw new Error("Bad private key, it should be 32 bytes but it's actually ".concat(t.length," bytes long"));if(65!==e.length)throw new Error("Bad public key, it should be 65 bytes but it's actually ".concat(e.length," bytes long"));if(4!==e[0])throw new Error("Bad public key, a valid public key would begin with 4");{const r=s.getSharedSecret(t,e,!0);return new Uint8Array((0,u.hexToBytes)(r).slice(1))}}e.encrypt=async function(t,e){const r=(0,a.randomBytes)(32),n=await l(r,t),i=await c(n,32),o=(0,a.randomBytes)(16),u=i.slice(0,16),h=await(f=o,d=u,p=e,a.subtle.importKey("raw",d,"AES-CTR",!1,["encrypt"]).then((t=>a.subtle.encrypt({name:"AES-CTR",counter:f,length:128},t,p))).then((t=>new Uint8Array(t))));var f,d,p;const y=new Uint8Array(o.length+h.length);y.set(o,0),y.set(h,o.length);const g=await(0,a.sha256)(i.slice(16)),m=await function(t,e){const r={name:"HMAC",hash:{name:"SHA-256"}};return a.subtle.importKey("raw",t,r,!1,["sign"]).then((t=>a.subtle.sign(r,t,e))).then((t=>new Uint8Array(t)))}(g,y),b=s.getPublicKey(r,!1),v=new Uint8Array(b.length+y.length+m.length);let w=0;return v.set(b,w),w+=b.length,v.set(y,w),w+=y.length,v.set(m,w),v};e.decrypt=async function(t,e){if(e.length<=113)throw new Error("Invalid Ciphertext. Data is too small. It should ba at least ".concat(113," bytes"));if(4!==e[0])throw new Error("Not a valid ciphertext. It should begin with 4 but actually begin with ".concat(e[0]));{const o=e.slice(0,65),s=e.length-113,u=e.slice(65,81),h=e.slice(65,81+s),f=h.slice(16),d=e.slice(81+s),p=l(t,o),y=await c(p,32),[g,m]=await(0,a.sha256)(y.slice(16)).then((t=>[y.slice(0,16),t]));if(!await function(t,e,r){const n={name:"HMAC",hash:{name:"SHA-256"}};return a.subtle.importKey("raw",t,n,!1,["verify"]).then((t=>a.subtle.verify(n,t,r,e)))}(m,h,d))throw new Error("Incorrect MAC");return r=u,n=g,i=f,a.subtle.importKey("raw",n,"AES-CTR",!1,["decrypt"]).then((t=>a.subtle.decrypt({name:"AES-CTR",counter:r,length:128},t,i))).then((t=>new Uint8Array(t)))}var r,n,i}},31195:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WakuMessage=e.DecryptionMethod=void 0;const a=s(r(18392)),u=s(r(18987)),c=r(80886),l=o(r(52494)),h=r(32744),f=o(r(57834)),d=(0,a.default)("waku:message");var p;!function(t){t.Asymmetric="asymmetric",t.Symmetric="symmetric"}(p=e.DecryptionMethod||(e.DecryptionMethod={}));class y{constructor(t,e,r){this.proto=t,this._signaturePublicKey=e,this._signature=r}static async fromUtf8String(t,e,r){const n=(0,h.utf8ToBytes)(t);return y.fromBytes(n,e,r)}static async fromBytes(t,e,r){var n,i;const{timestamp:o,encPublicKey:s,symKey:a,sigPrivKey:c}=Object.assign({timestamp:new Date},r||{});let l,h=t,d=0;if(s&&a)throw"Pass either `encPublicKey` or `symKey`, not both.";if(s){const t=f.clearEncode(h,c);h=await f.encryptAsymmetric(t.payload,s),l=t.sig,d=1}else if(a){const t=f.clearEncode(h,c);h=await f.encryptSymmetric(t.payload,a),l=t.sig,d=1}return new y({payload:h,timestampDeprecated:o.valueOf()/1e3,timestamp:u.default.fromNumber(o.valueOf()).mul(1e6),version:d,contentTopic:e},null===(n=l)||void 0===n?void 0:n.publicKey,null===(i=l)||void 0===i?void 0:i.signature)}static async decode(t,e){const r=l.WakuMessage.decode(c.Reader.create(t));return y.decodeProto(r,e)}static async decodeProto(t,e){if(void 0===t.payload)return void d("Payload is undefined");const r=t.payload;let n,i;if(1===t.version&&t.payload){var o,s;if(void 0===e)return void d("Payload is encrypted but no private keys have been provided.");const a=t=>!!t,u=(await Promise.all(e.map((async e=>{let{key:n,method:i,contentTopics:o}=e;if(!o||t.contentTopic&&o.includes(t.contentTopic))switch(i){case p.Asymmetric:try{return await f.decryptAsymmetric(r,n)}catch(s){return void d("Failed to decrypt message using asymmetric encryption despite decryption method being specified",s)}case p.Symmetric:try{return await f.decryptSymmetric(r,n)}catch(s){return void d("Failed to decrypt message using asymmetric encryption despite decryption method being specified",s)}default:try{return await f.decryptSymmetric(r,n)}catch(s){d("Failed to decrypt message using symmetric encryption",s);try{return await f.decryptAsymmetric(r,n)}catch(s){return void d("Failed to decrypt message using asymmetric encryption",s)}}}})))).filter(a);if(0===u.length)return void d("Failed to decrypt payload.");const c=u[0],l=await f.clearDecode(c);if(!l)return void d("Failed to decode payload.");Object.assign(t,{payload:l.payload}),n=null===(o=l.sig)||void 0===o?void 0:o.publicKey,i=null===(s=l.sig)||void 0===s?void 0:s.signature}return new y(t,n,i)}encode(){return l.WakuMessage.encode(this.proto).finish()}get payloadAsUtf8(){if(!this.proto.payload)return"";try{return(0,h.bytesToUtf8)(this.proto.payload)}catch(t){return d("Could not decode byte as UTF-8",t),""}}get payload(){return this.proto.payload}get contentTopic(){return this.proto.contentTopic}get version(){return this.proto.version}get timestamp(){try{if(this.proto.timestamp){const t=this.proto.timestamp.div(1e6).toNumber();return new Date(t)}if(this.proto.timestampDeprecated)return new Date(1e3*this.proto.timestampDeprecated)}catch(t){return}}get signaturePublicKey(){return this._signaturePublicKey}get signature(){return this._signature}}e.WakuMessage=y},73770:(t,e,r)=>{"use strict";var n=r(19778).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.generateIv=e.decrypt=e.encrypt=void 0;const i=r(31901),o=window.crypto||window.msCrypto,s=o.subtle||o.webkitSubtle,a={name:"AES-GCM",length:128};if(void 0===s)throw new Error("Failed to load Subtle CryptoAPI");e.encrypt=async function(t,e,r){return s.importKey("raw",e,a,!1,["encrypt"]).then((e=>s.encrypt({iv:t,...a},e,r))).then(n.from)},e.decrypt=async function(t,e,r){return s.importKey("raw",e,a,!1,["decrypt"]).then((e=>s.decrypt({iv:t,...a},e,r))).then(n.from)},e.generateIv=function(){const t=new Uint8Array(i.IvSize);return o.getRandomValues(t),t}},31901:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.symmetric=e.TagSize=e.IvSize=e.SymmetricKeySize=void 0,e.SymmetricKeySize=32,e.IvSize=12,e.TagSize=16,e.symmetric={},Promise.resolve().then((()=>o(r(73770)))).then((t=>{e.symmetric=t})).catch((t=>{Promise.resolve().then((()=>o(r(32974)))).then((t=>{e.symmetric=t})).catch((e=>{throw"Could not load any symmetric crypto modules: ".concat(t,", ").concat(e)}))}))},32974:(t,e,r)=>{"use strict";var n=r(19778).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.generateIv=e.decrypt=e.encrypt=void 0;const i=r(86433),o=r(31901),s="aes-256-gcm";e.encrypt=async function(t,e,r){const o=(0,i.createCipheriv)(s,e,t),a=o.update(r),u=o.final(),c=o.getAuthTag();return n.concat([a,u,c])},e.decrypt=async function(t,e,r){const a=r.length-o.TagSize,u=r.slice(0,a),c=r.slice(a),l=(0,i.createDecipheriv)(s,e,t);l.setAuthTag(c);const h=l.update(u),f=l.final();return n.concat([h,f])},e.generateIv=function(){return(0,i.randomBytes)(o.IvSize)}},57834:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.getPublicKey=e.generateSymmetricKey=e.generatePrivateKey=e.decryptSymmetric=e.encryptSymmetric=e.decryptAsymmetric=e.encryptAsymmetric=e.clearDecode=e.clearEncode=e.PrivateKeySize=void 0;const s=r(19778),a=o(r(86433)),u=r(27898),c=o(r(70621)),l=r(58928),h=o(r(28799)),f=r(31901);function d(t){return c.publicKeyCreate(t,!1)}function p(t){let e=1;for(let r=t.length;r>=256;r/=256)e++;return e}function y(t){if("undefined"!==typeof window&&window&&window.crypto){const e=new Uint8Array(t);return window.crypto.getRandomValues(e),e}return a.randomBytes(t)}e.PrivateKeySize=32,e.clearEncode=function(t,e){let r=s.Buffer.from([0]);r=function(t,e){const r=p(e);let n=s.Buffer.alloc(4);return n.writeUInt32LE(e.length,0),n=n.slice(0,r),(t=s.Buffer.concat([t,n]))[0]|=r,t}(r,t),r=s.Buffer.concat([r,s.Buffer.from(t)]);let n=1+p(t)+t.length;e&&(n+=65);const i=256-n%256,o=s.Buffer.from(y(i));if(!function(t,e){if(t.length!==e)return!1;return!(e>3&&s.Buffer.from(t).equals(s.Buffer.alloc(t.length)))}(o,i))throw new Error("failed to generate random padding of size "+i);let a;if(r=s.Buffer.concat([r,o]),e){r[0]|=4;const t=(0,u.keccak256)(r),n=c.ecdsaSign((0,l.hexToBytes)(t),e);r=s.Buffer.concat([r,n.signature,s.Buffer.from([n.recid])]),a={signature:s.Buffer.from(n.signature),publicKey:d(e)}}return{payload:r,sig:a}},e.clearDecode=function(t){const e=s.Buffer.from(t);let r,n=1;const i=3&e.readUIntLE(0,1);if(0===i)return;const o=e.readUIntLE(n,i);n+=i;const a=e.slice(n,n+o),h=4==(4&e.readUIntLE(0,1));if(h){const t=function(t){return t.slice(t.length-65,t.length)}(e),n=function(t,e){if(e)return(0,u.keccak256)(t.slice(0,t.length-65));return(0,u.keccak256)(t)}(e,h),i=function(t,e){const r=e.slice(64).readIntBE(0,1);return c.ecdsaRecover(e.slice(0,64),r,(0,l.hexToBytes)(t),!1)}(n,t);r={signature:t,publicKey:i}}return{payload:a,sig:r}},e.encryptAsymmetric=async function(t,e){return h.encrypt(s.Buffer.from((0,l.hexToBytes)(e)),s.Buffer.from(t))},e.decryptAsymmetric=async function(t,e){return h.decrypt(s.Buffer.from(e),s.Buffer.from(t))},e.encryptSymmetric=async function(t,e){const r=f.symmetric.generateIv(),n=await f.symmetric.encrypt(r,s.Buffer.from((0,l.hexToBytes)(e)),s.Buffer.from(t));return s.Buffer.concat([n,s.Buffer.from(r)])},e.decryptSymmetric=async function(t,e){const r=s.Buffer.from(t),n=r.length-f.IvSize,i=r.slice(0,n),o=r.slice(n);return f.symmetric.decrypt(o,s.Buffer.from((0,l.hexToBytes)(e)),i)},e.generatePrivateKey=function(){return y(e.PrivateKeySize)},e.generateSymmetricKey=function(){return y(f.SymmetricKeySize)},e.getPublicKey=d},21923:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RelayMaxIHaveLength=e.RelayOpportunisticGraftPeers=e.RelayOpportunisticGraftTicks=e.RelayFanoutTTL=e.RelayPruneBackoff=e.RelayPrunePeers=e.RelayHeartbeatInterval=e.RelayHeartbeatInitialDelay=e.RelayGossipFactor=e.RelayPingContentTopic=e.RelayCodecs=e.minute=e.second=void 0,e.second=1e3,e.minute=60*e.second,e.RelayCodecs=["/vac/waku/relay/2.0.0-beta2","/vac/waku/relay/2.0.0"],e.RelayPingContentTopic="/relay-ping/1/ping/null",e.RelayGossipFactor=.25,e.RelayHeartbeatInitialDelay=100,e.RelayHeartbeatInterval=e.second,e.RelayPrunePeers=16,e.RelayPruneBackoff=e.minute,e.RelayFanoutTTL=e.minute,e.RelayOpportunisticGraftTicks=60,e.RelayOpportunisticGraftPeers=2,e.RelayMaxIHaveLength=5e3},65346:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRelayPeers=void 0;const n=r(53357),i=r(45549);e.getRelayPeers=function(t,e,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>!0;const s=t.topics.get(e);if(!s)return new Set;let a=[];return s.forEach((e=>{const r=t.peers.get(e);r&&i.RelayCodecs.includes(r.protocol)&&o(e)&&a.push(e)})),a=(0,n.shuffle)(a),r>0&&a.length>r&&(a=a.slice(0,r)),new Set(a)}},45549:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WakuRelay=e.RelayCodecs=void 0;const a=s(r(18392)),u=s(r(37976)),c=r(53357),l=r(83983),h=s(r(90190)),f=r(58928),d=r(5151),p=r(31195),y=o(r(21923)),g=r(21923);Object.defineProperty(e,"RelayCodecs",{enumerable:!0,get:function(){return g.RelayCodecs}});const m=r(65346),b=r(23274),v=(0,a.default)("waku:relay");class w extends u.default{constructor(t,e){var r;super(t,Object.assign(e,{globalSignaturePolicy:l.SignaturePolicy.StrictNoSign})),this.heartbeat=new b.RelayHeartbeat(this),this.observers={},this.decryptionKeys=new Map;const n=y.RelayCodecs;Object.assign(this,{multicodecs:n}),this.pubSubTopic=(null===e||void 0===e?void 0:e.pubSubTopic)||d.DefaultPubSubTopic,null===e||void 0===e||null===(r=e.decryptionKeys)||void 0===r||r.forEach((t=>{this.addDecryptionKey(t)}))}async start(){await super.start(),this.subscribe(this.pubSubTopic)}async send(t){const e=t.encode();await super.publish(this.pubSubTopic,e)}addDecryptionKey(t,e){this.decryptionKeys.set((0,f.hexToBytes)(t),null!==e&&void 0!==e?e:{})}deleteDecryptionKey(t){this.decryptionKeys.delete((0,f.hexToBytes)(t))}addObserver(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];0===e.length?(this.observers[""]||(this.observers[""]=new Set),this.observers[""].add(t)):e.forEach((e=>{this.observers[e]||(this.observers[e]=new Set),this.observers[e].add(t)}))}deleteObserver(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];0===e.length?this.observers[""]&&this.observers[""].delete(t):e.forEach((e=>{this.observers[e]&&this.observers[e].delete(t)}))}getPeers(){return(0,m.getRelayPeers)(this,this.pubSubTopic,this._options.D,(t=>this.score.score(t)>=this._options.scoreThresholds.publishThreshold))}subscribe(t){this.on(t,(e=>{const r=Array.from(this.decryptionKeys).map((t=>{let[e,{method:r,contentTopics:n}]=t;return{key:e,method:r,contentTopics:n}}));v("Message received on ".concat(t)),p.WakuMessage.decode(e.data,r).then((t=>{t?(this.observers[""]&&this.observers[""].forEach((e=>{e(t)})),t.contentTopic&&this.observers[t.contentTopic]&&this.observers[t.contentTopic].forEach((e=>{e(t)}))):v("Failed to decode Waku Message")})).catch((t=>{v("Failed to decode Waku Message",t)}))})),super.subscribe(t)}join(t){var e;if(!this.started)throw new Error("WakuRelayPubSub has not started");const r=this.fanout.get(t);if(r)r.forEach((t=>{this.score.score(t)<0&&r.delete(t)})),r.size<this._options.D&&(0,m.getRelayPeers)(this,t,this._options.D-r.size,(t=>!r.has(t)&&!this.direct.has(t)&&this.score.score(t)>=0)).forEach((t=>r.add(t))),this.mesh.set(t,r),this.fanout.delete(t),this.lastpub.delete(t);else{const e=(0,m.getRelayPeers)(this,t,this._options.D,(t=>!this.direct.has(t)&&this.score.score(t)>=0));this.mesh.set(t,e)}null===(e=this.mesh.get(t))||void 0===e||e.forEach((e=>{this.log("JOIN: Add mesh link to %s in %s",e,t),this._sendGraft(e,t)}))}async _publish(t){const e=await this.getCanonicalMsgIdStr(t);t.receivedFrom!==this.peerId.toB58String()&&(this.score.deliverMessage(t,e),this.gossipTracer.deliverMessage(e)),this.seenCache.put(e),this.messageCache.put(t,e);const r=new Set;t.topicIDs.forEach((t=>{var e;if(!this.topics.get(t))return;this.direct.forEach((t=>{r.add(t)}));let n=this.mesh.get(t);if(!n||!n.size){if(n=this.fanout.get(t),!n){const e=(0,m.getRelayPeers)(this,t,this._options.D,(t=>this.score.score(t)>=this._options.scoreThresholds.publishThreshold));e.size>0?(n=e,this.fanout.set(t,e)):n=new Set}this.lastpub.set(t,this._now())}null===(e=n)||void 0===e||e.forEach((t=>{r.add(t)}))}));const n=(0,c.createGossipRpc)([u.default.utils.normalizeOutRpcMessage(t)]);v("Relay message to ".concat(r.size," peers")),r.forEach((e=>{e!==t.from&&(v("Relay message to",e),this._sendRpc(e,n))}))}_emitGossip(t,e){const r=this.messageCache.getGossipIDs(t);if(!r.length)return;(0,c.shuffle)(r),r.length>y.RelayMaxIHaveLength&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length);const n=[],i=this.topics.get(t);if(!i)return;i.forEach((t=>{const r=this.peers.get(t);r&&!e.has(t)&&!this.direct.has(t)&&y.RelayCodecs.includes(r.protocol)&&this.score.score(t)>=this._options.scoreThresholds.gossipThreshold&&n.push(t)}));let o=this._options.Dlazy;const s=y.RelayGossipFactor*n.length;s>o&&(o=s),o>n.length?o=n.length:(0,c.shuffle)(n),n.slice(0,o).forEach((e=>{let n=r;r.length>y.RelayMaxIHaveLength&&(n=(0,c.shuffle)(n.slice()).slice(0,y.RelayMaxIHaveLength)),this._pushGossip(e,{topicID:t,messageIDs:n})}))}async _makePrune(t,e,r){const n=y.RelayPruneBackoff/1e3;if(!r)return{topicID:e,peers:[],backoff:n};const i=(0,m.getRelayPeers)(this,e,y.RelayPrunePeers,(e=>e!==t&&this.score.score(e)>=0));return{topicID:e,peers:await Promise.all(Array.from(i).map((async t=>{const e=h.default.createFromB58String(t);return{peerID:e.toBytes(),signedPeerRecord:await this._libp2p.peerStore.addressBook.getRawEnvelope(e)}}))),backoff:n}}}e.WakuRelay=w},23274:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.RelayHeartbeat=void 0;const s=r(93234),a=r(53357),u=o(r(21923)),c=r(65346);class l extends s.Heartbeat{constructor(t){super(t)}start(){if(this._heartbeatTimer)return;const t=this._heartbeat.bind(this),e=setTimeout((()=>{var e;t(),null===(e=this._heartbeatTimer)||void 0===e||e.runPeriodically(t,u.RelayHeartbeatInterval)}),u.RelayHeartbeatInitialDelay);this._heartbeatTimer={_intervalId:void 0,runPeriodically:(t,e)=>{this._heartbeatTimer._intervalId=setInterval(t,e)},cancel:()=>{var t;clearTimeout(e),clearInterval(null===(t=this._heartbeatTimer)||void 0===t?void 0:t._intervalId)}}}stop(){this._heartbeatTimer&&(this._heartbeatTimer.cancel(),this._heartbeatTimer=null)}_heartbeat(){const{D:t,Dlo:e,Dhi:r,Dscore:n,Dout:i}=this.gossipsub._options;this.gossipsub.heartbeatTicks++;const o=new Map,s=t=>{let e=o.get(t);return void 0===e&&(e=this.gossipsub.score.score(t),o.set(t,e)),e},l=new Map,h=new Map,f=new Map;this.gossipsub._clearBackoff(),this.gossipsub.peerhave.clear(),this.gossipsub.iasked.clear(),this.gossipsub._applyIwantPenalties(),this.gossipsub._directConnect(),this.gossipsub.mesh.forEach(((o,d)=>{const p=t=>{this.gossipsub.log("HEARTBEAT: Remove mesh link to %s in %s",t,d),this.gossipsub.score.prune(t,d),this.gossipsub._addBackoff(t,d),o.delete(t);const e=h.get(t);e?e.push(d):h.set(t,[d])},y=t=>{this.gossipsub.log("HEARTBEAT: Add mesh link to %s in %s",t,d),this.gossipsub.score.graft(t,d),o.add(t);const e=l.get(t);e?e.push(d):l.set(t,[d])};if(o.forEach((t=>{const e=s(t);e<0&&(this.gossipsub.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",t,e,d),p(t),f.set(t,!0))})),o.size<e){const e=this.gossipsub.backoff.get(d),r=t-o.size;(0,c.getRelayPeers)(this.gossipsub,d,r,(t=>!o.has(t)&&!this.gossipsub.direct.has(t)&&(!e||!e.has(t))&&s(t)>=0)).forEach(y)}if(o.size>r){let e=Array.from(o);e.sort(((t,e)=>s(e)-s(t))),e=e.slice(0,n).concat((0,a.shuffle)(e.slice(n)));let r=0;if(e.slice(0,t).forEach((t=>{this.gossipsub.outbound.get(t)&&r++})),r<i){const n=t=>{const r=e[t];for(let n=t;n>0;n--)e[n]=e[n-1];e[0]=r};if(r>0){let i=r;for(let r=1;r<t&&i>0;r++)this.gossipsub.outbound.get(e[r])&&(n(r),i--)}let i=t-r;for(let r=t;r<e.length&&i>0;r++)this.gossipsub.outbound.get(e[r])&&(n(r),i--)}e.slice(t).forEach(p)}if(o.size>=e){let t=0;if(o.forEach((e=>{this.gossipsub.outbound.get(e)&&t++})),t<i){const e=i-t,r=this.gossipsub.backoff.get(d);(0,c.getRelayPeers)(this.gossipsub,d,e,(t=>!o.has(t)&&!this.gossipsub.direct.has(t)&&(!r||!r.has(t))&&s(t)>=0)).forEach(y)}}if(this.gossipsub.heartbeatTicks%u.RelayOpportunisticGraftTicks===0&&o.size>1){const t=Array.from(o).sort(((t,e)=>s(t)-s(e))),e=Math.floor(o.size/2),r=s(t[e]);if(r<this.gossipsub._options.scoreThresholds.opportunisticGraftThreshold){const t=this.gossipsub.backoff.get(d);(0,c.getRelayPeers)(this.gossipsub,d,u.RelayOpportunisticGraftPeers,(e=>o.has(e)&&!this.gossipsub.direct.has(e)&&(!t||!t.has(e))&&s(e)>r)).forEach((t=>{this.gossipsub.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",t,d),y(t)}))}}this.gossipsub._emitGossip(d,o)}));const d=this.gossipsub._now();this.gossipsub.lastpub.forEach(((t,e)=>{t+u.RelayFanoutTTL<d&&(this.gossipsub.fanout.delete(e),this.gossipsub.lastpub.delete(e))})),this.gossipsub.fanout.forEach(((e,r)=>{const n=this.gossipsub.topics.get(r);if(e.forEach((t=>{(null===n||void 0===n||!n.has(t)||s(t)<this.gossipsub._options.scoreThresholds.publishThreshold)&&e.delete(t)})),e.size<t){const n=t-e.size;(0,c.getRelayPeers)(this.gossipsub,r,n,(t=>!e.has(t)&&!this.gossipsub.direct.has(t)&&s(t)>=this.gossipsub._options.scoreThresholds.publishThreshold)).forEach((t=>{e.add(t)}))}this.gossipsub._emitGossip(r,e)})),this.gossipsub._sendGraftPrune(l,h,f),this.gossipsub._flush(),this.gossipsub.messageCache.shift(),this.gossipsub.emit("gossipsub:heartbeat")}}e.RelayHeartbeat=l},47954:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryRPC=e.PageDirection=void 0;const a=s(r(18987)),u=r(80886),c=r(75658),l=o(r(63953)),h=o(r(39938)),f=r(93539);var d;!function(t){t.BACKWARD="backward",t.FORWARD="forward"}(d=e.PageDirection||(e.PageDirection={}));class p{constructor(t,e){switch(this.proto=t,this.storeCodec=e,e){case f.StoreCodecs.V2Beta3:this.protoCodec=l;break;case f.StoreCodecs.V2Beta4:this.protoCodec=h;break;default:throw"Internal Error: Unexpected store codec value received in constructor: ".concat(e)}}get query(){return this.proto.query}get response(){return this.proto.response}static createQuery(t){var e;const r=null!==(e=t.storeCodec)&&void 0!==e?e:f.StoreCodecs.V2Beta4,n=t.contentTopics.map((t=>({contentTopic:t}))),i=function(t){switch(t){case d.BACKWARD:return h.PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED;case d.FORWARD:return h.PagingInfo_Direction.DIRECTION_FORWARD;default:return h.PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED}}(t.pageDirection);switch(r){case f.StoreCodecs.V2Beta3:return(()=>{const e={pageSize:a.default.fromNumber(t.pageSize),cursor:t.cursor,direction:i};let o,s;return t.startTime&&(o=t.startTime.valueOf()/1e3),t.endTime&&(s=t.endTime.valueOf()/1e3),new p({requestId:(0,c.v4)(),query:{pubSubTopic:t.pubSubTopic,contentFilters:n,pagingInfo:e,startTime:o,endTime:s},response:void 0},r)})();case f.StoreCodecs.V2Beta4:return(()=>{const e={pageSize:a.default.fromNumber(t.pageSize),cursor:t.cursor,direction:i};let o,s;return t.startTime&&(o=a.default.fromNumber(t.startTime.valueOf()).mul(1e6)),t.endTime&&(s=a.default.fromNumber(t.endTime.valueOf()).mul(1e6)),new p({requestId:(0,c.v4)(),query:{pubSubTopic:t.pubSubTopic,contentFilters:n,pagingInfo:e,startTime:o,endTime:s},response:void 0},r)})();default:throw"Internal Error: Unexpected store codec value received in createQuery: ".concat(r)}}decode(t){const e=this.protoCodec.HistoryRPC.decode(u.Reader.create(t));return new p(e,this.storeCodec)}encode(){return this.protoCodec.HistoryRPC.encode(this.proto).finish()}}e.HistoryRPC=p},93539:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WakuStore=e.PageDirection=e.DefaultPageSize=e.StoreCodecs=void 0;const i=n(r(18392)),o=n(r(72934)),s=n(r(44709)),a=n(r(79023)),u=r(19370),c=r(58928),l=r(5151),h=r(31195),f=r(47954);Object.defineProperty(e,"PageDirection",{enumerable:!0,get:function(){return f.PageDirection}});const d=(0,i.default)("waku:store");var p;!function(t){t.V2Beta3="/vac/waku/store/2.0.0-beta3",t.V2Beta4="/vac/waku/store/2.0.0-beta4"}(p=e.StoreCodecs||(e.StoreCodecs={})),e.DefaultPageSize=10;e.WakuStore=class{constructor(t,e){this.libp2p=t,null!==e&&void 0!==e&&e.pubSubTopic?this.pubSubTopic=e.pubSubTopic:this.pubSubTopic=l.DefaultPubSubTopic,this.decryptionKeys=new Map}async queryHistory(t,r){var n;let i,u;null!==r&&void 0!==r&&r.timeFilter&&(i=r.timeFilter.startTime,u=r.timeFilter.endTime);const l=Object.assign({pubSubTopic:this.pubSubTopic,pageDirection:f.PageDirection.BACKWARD,pageSize:e.DefaultPageSize},r,{contentTopics:t,startTime:i,endTime:u});let y;if(d("Querying history with the following options",{peerId:null===r||void 0===r||null===(n=r.peerId)||void 0===n?void 0:n.toB58String(),...r}),l.peerId){if(y=await this.libp2p.peerStore.get(l.peerId),!y)throw"Failed to retrieve connection details for provided peer in peer store: ".concat(l.peerId.toB58String())}else if(y=await this.randomPeer,!y)throw"Failed to find known peer that registers waku store protocol";let g="";for(const e of Object.values(p))y.protocols.includes(e)&&(g=e);if(d("Use store codec ".concat(g)),!g)throw"Peer does not register waku store protocol: ".concat(y.id.toB58String());Object.assign(l,{storeCodec:g});const m=this.libp2p.connectionManager.get(y.id);if(!m)throw"Failed to get a connection to the peer";const b=Array.from(this.decryptionKeys).map((t=>{let[e,{method:r,contentTopics:n}]=t;return{key:e,method:r,contentTopics:n}}));l.decryptionKeys&&l.decryptionKeys.forEach((e=>{b.push({key:(0,c.hexToBytes)(e),contentTopics:t.length?t:void 0,method:void 0})}));const v=[];let w;for(;;){var _,E,S,I;const{stream:t}=await m.newStream(g),e=Object.assign(l,{cursor:w}),r=f.HistoryRPC.createQuery(e);d("Querying store peer",m.remoteAddr.toString());const n=await(0,a.default)([r.encode()],s.default.encode(),t,s.default.decode(),o.default),i=r.decode(n.slice()).response;if(!i)throw"History response misses response field";if(i.error)throw"History response contains an Error"+i.error;if(!i.messages||!i.messages.length)return console.log("No messages present in HistoryRPC response"),v;d("".concat(i.messages.length," messages retrieved for pubsub topic ").concat(l.pubSubTopic));const u=[];await Promise.all(i.messages.map((async t=>{const e=await h.WakuMessage.decodeProto(t,b);e&&(v.push(e),u.push(e))})));let c=!1;l.callback&&(c=Boolean(l.callback(u)));const p=null===(_=i.pagingInfo)||void 0===_?void 0:_.pageSize,y=null===(E=r.query)||void 0===E||null===(S=E.pagingInfo)||void 0===S?void 0:S.pageSize;if(c||p&&y&&p<y)return v;if(w=null===(I=i.pagingInfo)||void 0===I?void 0:I.cursor,void 0===w)return console.log("No cursor returned by peer."),v}}addDecryptionKey(t,e){this.decryptionKeys.set((0,c.hexToBytes)(t),null!==e&&void 0!==e?e:{})}deleteDecryptionKey(t){this.decryptionKeys.delete((0,c.hexToBytes)(t))}get peers(){const t=[];for(const e of Object.values(p))t.push(e);return(0,u.getPeersForProtocol)(this.libp2p,t)}get randomPeer(){return(0,u.selectRandomPeer)(this.peers)}}},63623:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PushRPC=e.PushResponse=e.PushRequest=e.protobufPackage=void 0;const i=n(r(18987)),o=n(r(80886)),s=r(52494);function a(t){return null!==t&&void 0!==t}e.protobufPackage="waku.v2",e.PushRequest={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==t.pubSubTopic&&e.uint32(10).string(t.pubSubTopic),void 0!==t.message&&s.WakuMessage.encode(t.message,e.uint32(18).fork()).ldelim(),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i={pubSubTopic:"",message:void 0};for(;r.pos<n;){const t=r.uint32();switch(t>>>3){case 1:i.pubSubTopic=r.string();break;case 2:i.message=s.WakuMessage.decode(r,r.uint32());break;default:r.skipType(7&t)}}return i},fromJSON:t=>({pubSubTopic:a(t.pubSubTopic)?String(t.pubSubTopic):"",message:a(t.message)?s.WakuMessage.fromJSON(t.message):void 0}),toJSON(t){const e={};return void 0!==t.pubSubTopic&&(e.pubSubTopic=t.pubSubTopic),void 0!==t.message&&(e.message=t.message?s.WakuMessage.toJSON(t.message):void 0),e},fromPartial(t){var e;const r={pubSubTopic:"",message:void 0};return r.pubSubTopic=null!==(e=t.pubSubTopic)&&void 0!==e?e:"",r.message=void 0!==t.message&&null!==t.message?s.WakuMessage.fromPartial(t.message):void 0,r}},e.PushResponse={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return!0===t.isSuccess&&e.uint32(8).bool(t.isSuccess),""!==t.info&&e.uint32(18).string(t.info),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i={isSuccess:!1,info:""};for(;r.pos<n;){const t=r.uint32();switch(t>>>3){case 1:i.isSuccess=r.bool();break;case 2:i.info=r.string();break;default:r.skipType(7&t)}}return i},fromJSON:t=>({isSuccess:!!a(t.isSuccess)&&Boolean(t.isSuccess),info:a(t.info)?String(t.info):""}),toJSON(t){const e={};return void 0!==t.isSuccess&&(e.isSuccess=t.isSuccess),void 0!==t.info&&(e.info=t.info),e},fromPartial(t){var e,r;const n={isSuccess:!1,info:""};return n.isSuccess=null!==(e=t.isSuccess)&&void 0!==e&&e,n.info=null!==(r=t.info)&&void 0!==r?r:"",n}},e.PushRPC={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==t.requestId&&r.uint32(10).string(t.requestId),void 0!==t.request&&e.PushRequest.encode(t.request,r.uint32(18).fork()).ldelim(),void 0!==t.response&&e.PushResponse.encode(t.response,r.uint32(26).fork()).ldelim(),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s={requestId:"",request:void 0,response:void 0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 1:s.requestId=n.string();break;case 2:s.request=e.PushRequest.decode(n,n.uint32());break;case 3:s.response=e.PushResponse.decode(n,n.uint32());break;default:n.skipType(7&t)}}return s},fromJSON:t=>({requestId:a(t.requestId)?String(t.requestId):"",request:a(t.request)?e.PushRequest.fromJSON(t.request):void 0,response:a(t.response)?e.PushResponse.fromJSON(t.response):void 0}),toJSON(t){const r={};return void 0!==t.requestId&&(r.requestId=t.requestId),void 0!==t.request&&(r.request=t.request?e.PushRequest.toJSON(t.request):void 0),void 0!==t.response&&(r.response=t.response?e.PushResponse.toJSON(t.response):void 0),r},fromPartial(t){var r;const n={requestId:"",request:void 0,response:void 0};return n.requestId=null!==(r=t.requestId)&&void 0!==r?r:"",n.request=void 0!==t.request&&null!==t.request?e.PushRequest.fromPartial(t.request):void 0,n.response=void 0!==t.response&&null!==t.response?e.PushResponse.fromPartial(t.response):void 0,n}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},52494:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WakuMessage=e.protobufPackage=void 0;const i=n(r(18987)),o=n(r(80886));e.protobufPackage="waku.v2",e.WakuMessage={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==t.payload&&e.uint32(10).bytes(t.payload),void 0!==t.contentTopic&&e.uint32(18).string(t.contentTopic),void 0!==t.version&&e.uint32(24).uint32(t.version),void 0!==t.timestampDeprecated&&e.uint32(33).double(t.timestampDeprecated),void 0!==t.timestamp&&e.uint32(80).sint64(t.timestamp),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i={payload:void 0,contentTopic:void 0,version:void 0,timestampDeprecated:void 0,timestamp:void 0};for(;r.pos<n;){const t=r.uint32();switch(t>>>3){case 1:i.payload=r.bytes();break;case 2:i.contentTopic=r.string();break;case 3:i.version=r.uint32();break;case 4:i.timestampDeprecated=r.double();break;case 10:i.timestamp=r.sint64();break;default:r.skipType(7&t)}}return i},fromJSON:t=>({payload:l(t.payload)?u(t.payload):void 0,contentTopic:l(t.contentTopic)?String(t.contentTopic):void 0,version:l(t.version)?Number(t.version):void 0,timestampDeprecated:l(t.timestampDeprecated)?Number(t.timestampDeprecated):void 0,timestamp:l(t.timestamp)?i.default.fromString(t.timestamp):void 0}),toJSON(t){const e={};return void 0!==t.payload&&(e.payload=void 0!==t.payload?function(t){const e=[];for(const r of t)e.push(String.fromCharCode(r));return c(e.join(""))}(t.payload):void 0),void 0!==t.contentTopic&&(e.contentTopic=t.contentTopic),void 0!==t.version&&(e.version=Math.round(t.version)),void 0!==t.timestampDeprecated&&(e.timestampDeprecated=t.timestampDeprecated),void 0!==t.timestamp&&(e.timestamp=(t.timestamp||void 0).toString()),e},fromPartial(t){var e,r,n,o;const s={payload:void 0,contentTopic:void 0,version:void 0,timestampDeprecated:void 0,timestamp:void 0};return s.payload=null!==(e=t.payload)&&void 0!==e?e:void 0,s.contentTopic=null!==(r=t.contentTopic)&&void 0!==r?r:void 0,s.version=null!==(n=t.version)&&void 0!==n?n:void 0,s.timestampDeprecated=null!==(o=t.timestampDeprecated)&&void 0!==o?o:void 0,s.timestamp=void 0!==t.timestamp&&null!==t.timestamp?i.default.fromValue(t.timestamp):void 0,s}};var s=(()=>{if("undefined"!==typeof s)return s;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw"Unable to locate global object"})();const a=s.atob||(t=>s.Buffer.from(t,"base64").toString("binary"));function u(t){const e=a(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}const c=s.btoa||(t=>s.Buffer.from(t,"binary").toString("base64"));function l(t){return null!==t&&void 0!==t}o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},63953:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryRPC=e.HistoryResponse=e.HistoryQuery=e.ContentFilter=e.PagingInfo=e.Index=e.historyResponse_ErrorToJSON=e.historyResponse_ErrorFromJSON=e.HistoryResponse_Error=e.pagingInfo_DirectionToJSON=e.pagingInfo_DirectionFromJSON=e.PagingInfo_Direction=e.protobufPackage=void 0;const i=n(r(18987)),o=n(r(80886)),s=r(52494);var a,u;function c(t){switch(t){case 0:case"DIRECTION_BACKWARD_UNSPECIFIED":return a.DIRECTION_BACKWARD_UNSPECIFIED;case 1:case"DIRECTION_FORWARD":return a.DIRECTION_FORWARD;default:return a.UNRECOGNIZED}}function l(t){switch(t){case a.DIRECTION_BACKWARD_UNSPECIFIED:return"DIRECTION_BACKWARD_UNSPECIFIED";case a.DIRECTION_FORWARD:return"DIRECTION_FORWARD";default:return"UNKNOWN"}}function h(t){switch(t){case 0:case"ERROR_NONE_UNSPECIFIED":return u.ERROR_NONE_UNSPECIFIED;case 1:case"ERROR_INVALID_CURSOR":return u.ERROR_INVALID_CURSOR;default:return u.UNRECOGNIZED}}function f(t){switch(t){case u.ERROR_NONE_UNSPECIFIED:return"ERROR_NONE_UNSPECIFIED";case u.ERROR_INVALID_CURSOR:return"ERROR_INVALID_CURSOR";default:return"UNKNOWN"}}function d(){return{digest:new Uint8Array,receivedTime:0,senderTime:0}}function p(){return{pageSize:i.default.UZERO,cursor:void 0,direction:0}}e.protobufPackage="waku.v2.store.v2beta3",function(t){t[t.DIRECTION_BACKWARD_UNSPECIFIED=0]="DIRECTION_BACKWARD_UNSPECIFIED",t[t.DIRECTION_FORWARD=1]="DIRECTION_FORWARD",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(a=e.PagingInfo_Direction||(e.PagingInfo_Direction={})),e.pagingInfo_DirectionFromJSON=c,e.pagingInfo_DirectionToJSON=l,function(t){t[t.ERROR_NONE_UNSPECIFIED=0]="ERROR_NONE_UNSPECIFIED",t[t.ERROR_INVALID_CURSOR=1]="ERROR_INVALID_CURSOR",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(u=e.HistoryResponse_Error||(e.HistoryResponse_Error={})),e.historyResponse_ErrorFromJSON=h,e.historyResponse_ErrorToJSON=f,e.Index={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==t.digest.length&&e.uint32(10).bytes(t.digest),0!==t.receivedTime&&e.uint32(17).double(t.receivedTime),0!==t.senderTime&&e.uint32(25).double(t.senderTime),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i=d();for(;r.pos<n;){const t=r.uint32();switch(t>>>3){case 1:i.digest=r.bytes();break;case 2:i.receivedTime=r.double();break;case 3:i.senderTime=r.double();break;default:r.skipType(7&t)}}return i},fromJSON:t=>({digest:v(t.digest)?m(t.digest):new Uint8Array,receivedTime:v(t.receivedTime)?Number(t.receivedTime):0,senderTime:v(t.senderTime)?Number(t.senderTime):0}),toJSON(t){const e={};return void 0!==t.digest&&(e.digest=function(t){const e=[];for(const r of t)e.push(String.fromCharCode(r));return b(e.join(""))}(void 0!==t.digest?t.digest:new Uint8Array)),void 0!==t.receivedTime&&(e.receivedTime=t.receivedTime),void 0!==t.senderTime&&(e.senderTime=t.senderTime),e},fromPartial(t){var e,r,n;const i=d();return i.digest=null!==(e=t.digest)&&void 0!==e?e:new Uint8Array,i.receivedTime=null!==(r=t.receivedTime)&&void 0!==r?r:0,i.senderTime=null!==(n=t.senderTime)&&void 0!==n?n:0,i}},e.PagingInfo={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return t.pageSize.isZero()||r.uint32(8).uint64(t.pageSize),void 0!==t.cursor&&e.Index.encode(t.cursor,r.uint32(18).fork()).ldelim(),0!==t.direction&&r.uint32(24).int32(t.direction),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s=p();for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 1:s.pageSize=n.uint64();break;case 2:s.cursor=e.Index.decode(n,n.uint32());break;case 3:s.direction=n.int32();break;default:n.skipType(7&t)}}return s},fromJSON:t=>({pageSize:v(t.pageSize)?i.default.fromString(t.pageSize):i.default.UZERO,cursor:v(t.cursor)?e.Index.fromJSON(t.cursor):void 0,direction:v(t.direction)?c(t.direction):0}),toJSON(t){const r={};return void 0!==t.pageSize&&(r.pageSize=(t.pageSize||i.default.UZERO).toString()),void 0!==t.cursor&&(r.cursor=t.cursor?e.Index.toJSON(t.cursor):void 0),void 0!==t.direction&&(r.direction=l(t.direction)),r},fromPartial(t){var r;const n=p();return n.pageSize=void 0!==t.pageSize&&null!==t.pageSize?i.default.fromValue(t.pageSize):i.default.UZERO,n.cursor=void 0!==t.cursor&&null!==t.cursor?e.Index.fromPartial(t.cursor):void 0,n.direction=null!==(r=t.direction)&&void 0!==r?r:0,n}},e.ContentFilter={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==t.contentTopic&&e.uint32(10).string(t.contentTopic),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i={contentTopic:""};for(;r.pos<n;){const t=r.uint32();if(t>>>3===1)i.contentTopic=r.string();else r.skipType(7&t)}return i},fromJSON:t=>({contentTopic:v(t.contentTopic)?String(t.contentTopic):""}),toJSON(t){const e={};return void 0!==t.contentTopic&&(e.contentTopic=t.contentTopic),e},fromPartial(t){var e;const r={contentTopic:""};return r.contentTopic=null!==(e=t.contentTopic)&&void 0!==e?e:"",r}},e.HistoryQuery={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==t.pubSubTopic&&r.uint32(18).string(t.pubSubTopic);for(const n of t.contentFilters)e.ContentFilter.encode(n,r.uint32(26).fork()).ldelim();return void 0!==t.pagingInfo&&e.PagingInfo.encode(t.pagingInfo,r.uint32(34).fork()).ldelim(),void 0!==t.startTime&&r.uint32(41).double(t.startTime),void 0!==t.endTime&&r.uint32(49).double(t.endTime),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s={pubSubTopic:void 0,contentFilters:[],pagingInfo:void 0,startTime:void 0,endTime:void 0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 2:s.pubSubTopic=n.string();break;case 3:s.contentFilters.push(e.ContentFilter.decode(n,n.uint32()));break;case 4:s.pagingInfo=e.PagingInfo.decode(n,n.uint32());break;case 5:s.startTime=n.double();break;case 6:s.endTime=n.double();break;default:n.skipType(7&t)}}return s},fromJSON:t=>({pubSubTopic:v(t.pubSubTopic)?String(t.pubSubTopic):void 0,contentFilters:Array.isArray(null===t||void 0===t?void 0:t.contentFilters)?t.contentFilters.map((t=>e.ContentFilter.fromJSON(t))):[],pagingInfo:v(t.pagingInfo)?e.PagingInfo.fromJSON(t.pagingInfo):void 0,startTime:v(t.startTime)?Number(t.startTime):void 0,endTime:v(t.endTime)?Number(t.endTime):void 0}),toJSON(t){const r={};return void 0!==t.pubSubTopic&&(r.pubSubTopic=t.pubSubTopic),t.contentFilters?r.contentFilters=t.contentFilters.map((t=>t?e.ContentFilter.toJSON(t):void 0)):r.contentFilters=[],void 0!==t.pagingInfo&&(r.pagingInfo=t.pagingInfo?e.PagingInfo.toJSON(t.pagingInfo):void 0),void 0!==t.startTime&&(r.startTime=t.startTime),void 0!==t.endTime&&(r.endTime=t.endTime),r},fromPartial(t){var r,n,i,o;const s={pubSubTopic:void 0,contentFilters:[],pagingInfo:void 0,startTime:void 0,endTime:void 0};return s.pubSubTopic=null!==(r=t.pubSubTopic)&&void 0!==r?r:void 0,s.contentFilters=(null===(n=t.contentFilters)||void 0===n?void 0:n.map((t=>e.ContentFilter.fromPartial(t))))||[],s.pagingInfo=void 0!==t.pagingInfo&&null!==t.pagingInfo?e.PagingInfo.fromPartial(t.pagingInfo):void 0,s.startTime=null!==(i=t.startTime)&&void 0!==i?i:void 0,s.endTime=null!==(o=t.endTime)&&void 0!==o?o:void 0,s}},e.HistoryResponse={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();for(const e of t.messages)s.WakuMessage.encode(e,r.uint32(18).fork()).ldelim();return void 0!==t.pagingInfo&&e.PagingInfo.encode(t.pagingInfo,r.uint32(26).fork()).ldelim(),0!==t.error&&r.uint32(32).int32(t.error),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const a={messages:[],pagingInfo:void 0,error:0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 2:a.messages.push(s.WakuMessage.decode(n,n.uint32()));break;case 3:a.pagingInfo=e.PagingInfo.decode(n,n.uint32());break;case 4:a.error=n.int32();break;default:n.skipType(7&t)}}return a},fromJSON:t=>({messages:Array.isArray(null===t||void 0===t?void 0:t.messages)?t.messages.map((t=>s.WakuMessage.fromJSON(t))):[],pagingInfo:v(t.pagingInfo)?e.PagingInfo.fromJSON(t.pagingInfo):void 0,error:v(t.error)?h(t.error):0}),toJSON(t){const r={};return t.messages?r.messages=t.messages.map((t=>t?s.WakuMessage.toJSON(t):void 0)):r.messages=[],void 0!==t.pagingInfo&&(r.pagingInfo=t.pagingInfo?e.PagingInfo.toJSON(t.pagingInfo):void 0),void 0!==t.error&&(r.error=f(t.error)),r},fromPartial(t){var r,n;const i={messages:[],pagingInfo:void 0,error:0};return i.messages=(null===(r=t.messages)||void 0===r?void 0:r.map((t=>s.WakuMessage.fromPartial(t))))||[],i.pagingInfo=void 0!==t.pagingInfo&&null!==t.pagingInfo?e.PagingInfo.fromPartial(t.pagingInfo):void 0,i.error=null!==(n=t.error)&&void 0!==n?n:0,i}},e.HistoryRPC={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==t.requestId&&r.uint32(10).string(t.requestId),void 0!==t.query&&e.HistoryQuery.encode(t.query,r.uint32(18).fork()).ldelim(),void 0!==t.response&&e.HistoryResponse.encode(t.response,r.uint32(26).fork()).ldelim(),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s={requestId:"",query:void 0,response:void 0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 1:s.requestId=n.string();break;case 2:s.query=e.HistoryQuery.decode(n,n.uint32());break;case 3:s.response=e.HistoryResponse.decode(n,n.uint32());break;default:n.skipType(7&t)}}return s},fromJSON:t=>({requestId:v(t.requestId)?String(t.requestId):"",query:v(t.query)?e.HistoryQuery.fromJSON(t.query):void 0,response:v(t.response)?e.HistoryResponse.fromJSON(t.response):void 0}),toJSON(t){const r={};return void 0!==t.requestId&&(r.requestId=t.requestId),void 0!==t.query&&(r.query=t.query?e.HistoryQuery.toJSON(t.query):void 0),void 0!==t.response&&(r.response=t.response?e.HistoryResponse.toJSON(t.response):void 0),r},fromPartial(t){var r;const n={requestId:"",query:void 0,response:void 0};return n.requestId=null!==(r=t.requestId)&&void 0!==r?r:"",n.query=void 0!==t.query&&null!==t.query?e.HistoryQuery.fromPartial(t.query):void 0,n.response=void 0!==t.response&&null!==t.response?e.HistoryResponse.fromPartial(t.response):void 0,n}};var y=(()=>{if("undefined"!==typeof y)return y;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw"Unable to locate global object"})();const g=y.atob||(t=>y.Buffer.from(t,"base64").toString("binary"));function m(t){const e=g(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}const b=y.btoa||(t=>y.Buffer.from(t,"binary").toString("base64"));function v(t){return null!==t&&void 0!==t}o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},39938:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryRPC=e.HistoryResponse=e.HistoryQuery=e.ContentFilter=e.PagingInfo=e.Index=e.historyResponse_ErrorToJSON=e.historyResponse_ErrorFromJSON=e.HistoryResponse_Error=e.pagingInfo_DirectionToJSON=e.pagingInfo_DirectionFromJSON=e.PagingInfo_Direction=e.protobufPackage=void 0;const i=n(r(18987)),o=n(r(80886)),s=r(52494);var a,u;function c(t){switch(t){case 0:case"DIRECTION_BACKWARD_UNSPECIFIED":return a.DIRECTION_BACKWARD_UNSPECIFIED;case 1:case"DIRECTION_FORWARD":return a.DIRECTION_FORWARD;default:return a.UNRECOGNIZED}}function l(t){switch(t){case a.DIRECTION_BACKWARD_UNSPECIFIED:return"DIRECTION_BACKWARD_UNSPECIFIED";case a.DIRECTION_FORWARD:return"DIRECTION_FORWARD";default:return"UNKNOWN"}}function h(t){switch(t){case 0:case"ERROR_NONE_UNSPECIFIED":return u.ERROR_NONE_UNSPECIFIED;case 1:case"ERROR_INVALID_CURSOR":return u.ERROR_INVALID_CURSOR;default:return u.UNRECOGNIZED}}function f(t){switch(t){case u.ERROR_NONE_UNSPECIFIED:return"ERROR_NONE_UNSPECIFIED";case u.ERROR_INVALID_CURSOR:return"ERROR_INVALID_CURSOR";default:return"UNKNOWN"}}function d(){return{digest:new Uint8Array,receivedTime:i.default.ZERO,senderTime:i.default.ZERO,pubsubTopic:""}}function p(){return{pageSize:i.default.UZERO,cursor:void 0,direction:0}}e.protobufPackage="waku.v2.store.v2beta4",function(t){t[t.DIRECTION_BACKWARD_UNSPECIFIED=0]="DIRECTION_BACKWARD_UNSPECIFIED",t[t.DIRECTION_FORWARD=1]="DIRECTION_FORWARD",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(a=e.PagingInfo_Direction||(e.PagingInfo_Direction={})),e.pagingInfo_DirectionFromJSON=c,e.pagingInfo_DirectionToJSON=l,function(t){t[t.ERROR_NONE_UNSPECIFIED=0]="ERROR_NONE_UNSPECIFIED",t[t.ERROR_INVALID_CURSOR=1]="ERROR_INVALID_CURSOR",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(u=e.HistoryResponse_Error||(e.HistoryResponse_Error={})),e.historyResponse_ErrorFromJSON=h,e.historyResponse_ErrorToJSON=f,e.Index={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==t.digest.length&&e.uint32(10).bytes(t.digest),t.receivedTime.isZero()||e.uint32(16).sint64(t.receivedTime),t.senderTime.isZero()||e.uint32(24).sint64(t.senderTime),""!==t.pubsubTopic&&e.uint32(34).string(t.pubsubTopic),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i=d();for(;r.pos<n;){const t=r.uint32();switch(t>>>3){case 1:i.digest=r.bytes();break;case 2:i.receivedTime=r.sint64();break;case 3:i.senderTime=r.sint64();break;case 4:i.pubsubTopic=r.string();break;default:r.skipType(7&t)}}return i},fromJSON:t=>({digest:v(t.digest)?m(t.digest):new Uint8Array,receivedTime:v(t.receivedTime)?i.default.fromString(t.receivedTime):i.default.ZERO,senderTime:v(t.senderTime)?i.default.fromString(t.senderTime):i.default.ZERO,pubsubTopic:v(t.pubsubTopic)?String(t.pubsubTopic):""}),toJSON(t){const e={};return void 0!==t.digest&&(e.digest=function(t){const e=[];for(const r of t)e.push(String.fromCharCode(r));return b(e.join(""))}(void 0!==t.digest?t.digest:new Uint8Array)),void 0!==t.receivedTime&&(e.receivedTime=(t.receivedTime||i.default.ZERO).toString()),void 0!==t.senderTime&&(e.senderTime=(t.senderTime||i.default.ZERO).toString()),void 0!==t.pubsubTopic&&(e.pubsubTopic=t.pubsubTopic),e},fromPartial(t){var e,r;const n=d();return n.digest=null!==(e=t.digest)&&void 0!==e?e:new Uint8Array,n.receivedTime=void 0!==t.receivedTime&&null!==t.receivedTime?i.default.fromValue(t.receivedTime):i.default.ZERO,n.senderTime=void 0!==t.senderTime&&null!==t.senderTime?i.default.fromValue(t.senderTime):i.default.ZERO,n.pubsubTopic=null!==(r=t.pubsubTopic)&&void 0!==r?r:"",n}},e.PagingInfo={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return t.pageSize.isZero()||r.uint32(8).uint64(t.pageSize),void 0!==t.cursor&&e.Index.encode(t.cursor,r.uint32(18).fork()).ldelim(),0!==t.direction&&r.uint32(24).int32(t.direction),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s=p();for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 1:s.pageSize=n.uint64();break;case 2:s.cursor=e.Index.decode(n,n.uint32());break;case 3:s.direction=n.int32();break;default:n.skipType(7&t)}}return s},fromJSON:t=>({pageSize:v(t.pageSize)?i.default.fromString(t.pageSize):i.default.UZERO,cursor:v(t.cursor)?e.Index.fromJSON(t.cursor):void 0,direction:v(t.direction)?c(t.direction):0}),toJSON(t){const r={};return void 0!==t.pageSize&&(r.pageSize=(t.pageSize||i.default.UZERO).toString()),void 0!==t.cursor&&(r.cursor=t.cursor?e.Index.toJSON(t.cursor):void 0),void 0!==t.direction&&(r.direction=l(t.direction)),r},fromPartial(t){var r;const n=p();return n.pageSize=void 0!==t.pageSize&&null!==t.pageSize?i.default.fromValue(t.pageSize):i.default.UZERO,n.cursor=void 0!==t.cursor&&null!==t.cursor?e.Index.fromPartial(t.cursor):void 0,n.direction=null!==(r=t.direction)&&void 0!==r?r:0,n}},e.ContentFilter={encode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==t.contentTopic&&e.uint32(10).string(t.contentTopic),e},decode(t,e){const r=t instanceof o.default.Reader?t:new o.default.Reader(t);let n=void 0===e?r.len:r.pos+e;const i={contentTopic:""};for(;r.pos<n;){const t=r.uint32();if(t>>>3===1)i.contentTopic=r.string();else r.skipType(7&t)}return i},fromJSON:t=>({contentTopic:v(t.contentTopic)?String(t.contentTopic):""}),toJSON(t){const e={};return void 0!==t.contentTopic&&(e.contentTopic=t.contentTopic),e},fromPartial(t){var e;const r={contentTopic:""};return r.contentTopic=null!==(e=t.contentTopic)&&void 0!==e?e:"",r}},e.HistoryQuery={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==t.pubSubTopic&&r.uint32(18).string(t.pubSubTopic);for(const n of t.contentFilters)e.ContentFilter.encode(n,r.uint32(26).fork()).ldelim();return void 0!==t.pagingInfo&&e.PagingInfo.encode(t.pagingInfo,r.uint32(34).fork()).ldelim(),void 0!==t.startTime&&r.uint32(40).sint64(t.startTime),void 0!==t.endTime&&r.uint32(48).sint64(t.endTime),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s={pubSubTopic:void 0,contentFilters:[],pagingInfo:void 0,startTime:void 0,endTime:void 0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 2:s.pubSubTopic=n.string();break;case 3:s.contentFilters.push(e.ContentFilter.decode(n,n.uint32()));break;case 4:s.pagingInfo=e.PagingInfo.decode(n,n.uint32());break;case 5:s.startTime=n.sint64();break;case 6:s.endTime=n.sint64();break;default:n.skipType(7&t)}}return s},fromJSON:t=>({pubSubTopic:v(t.pubSubTopic)?String(t.pubSubTopic):void 0,contentFilters:Array.isArray(null===t||void 0===t?void 0:t.contentFilters)?t.contentFilters.map((t=>e.ContentFilter.fromJSON(t))):[],pagingInfo:v(t.pagingInfo)?e.PagingInfo.fromJSON(t.pagingInfo):void 0,startTime:v(t.startTime)?i.default.fromString(t.startTime):void 0,endTime:v(t.endTime)?i.default.fromString(t.endTime):void 0}),toJSON(t){const r={};return void 0!==t.pubSubTopic&&(r.pubSubTopic=t.pubSubTopic),t.contentFilters?r.contentFilters=t.contentFilters.map((t=>t?e.ContentFilter.toJSON(t):void 0)):r.contentFilters=[],void 0!==t.pagingInfo&&(r.pagingInfo=t.pagingInfo?e.PagingInfo.toJSON(t.pagingInfo):void 0),void 0!==t.startTime&&(r.startTime=(t.startTime||void 0).toString()),void 0!==t.endTime&&(r.endTime=(t.endTime||void 0).toString()),r},fromPartial(t){var r,n;const o={pubSubTopic:void 0,contentFilters:[],pagingInfo:void 0,startTime:void 0,endTime:void 0};return o.pubSubTopic=null!==(r=t.pubSubTopic)&&void 0!==r?r:void 0,o.contentFilters=(null===(n=t.contentFilters)||void 0===n?void 0:n.map((t=>e.ContentFilter.fromPartial(t))))||[],o.pagingInfo=void 0!==t.pagingInfo&&null!==t.pagingInfo?e.PagingInfo.fromPartial(t.pagingInfo):void 0,o.startTime=void 0!==t.startTime&&null!==t.startTime?i.default.fromValue(t.startTime):void 0,o.endTime=void 0!==t.endTime&&null!==t.endTime?i.default.fromValue(t.endTime):void 0,o}},e.HistoryResponse={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();for(const e of t.messages)s.WakuMessage.encode(e,r.uint32(18).fork()).ldelim();return void 0!==t.pagingInfo&&e.PagingInfo.encode(t.pagingInfo,r.uint32(26).fork()).ldelim(),0!==t.error&&r.uint32(32).int32(t.error),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const a={messages:[],pagingInfo:void 0,error:0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 2:a.messages.push(s.WakuMessage.decode(n,n.uint32()));break;case 3:a.pagingInfo=e.PagingInfo.decode(n,n.uint32());break;case 4:a.error=n.int32();break;default:n.skipType(7&t)}}return a},fromJSON:t=>({messages:Array.isArray(null===t||void 0===t?void 0:t.messages)?t.messages.map((t=>s.WakuMessage.fromJSON(t))):[],pagingInfo:v(t.pagingInfo)?e.PagingInfo.fromJSON(t.pagingInfo):void 0,error:v(t.error)?h(t.error):0}),toJSON(t){const r={};return t.messages?r.messages=t.messages.map((t=>t?s.WakuMessage.toJSON(t):void 0)):r.messages=[],void 0!==t.pagingInfo&&(r.pagingInfo=t.pagingInfo?e.PagingInfo.toJSON(t.pagingInfo):void 0),void 0!==t.error&&(r.error=f(t.error)),r},fromPartial(t){var r,n;const i={messages:[],pagingInfo:void 0,error:0};return i.messages=(null===(r=t.messages)||void 0===r?void 0:r.map((t=>s.WakuMessage.fromPartial(t))))||[],i.pagingInfo=void 0!==t.pagingInfo&&null!==t.pagingInfo?e.PagingInfo.fromPartial(t.pagingInfo):void 0,i.error=null!==(n=t.error)&&void 0!==n?n:0,i}},e.HistoryRPC={encode(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==t.requestId&&r.uint32(10).string(t.requestId),void 0!==t.query&&e.HistoryQuery.encode(t.query,r.uint32(18).fork()).ldelim(),void 0!==t.response&&e.HistoryResponse.encode(t.response,r.uint32(26).fork()).ldelim(),r},decode(t,r){const n=t instanceof o.default.Reader?t:new o.default.Reader(t);let i=void 0===r?n.len:n.pos+r;const s={requestId:"",query:void 0,response:void 0};for(;n.pos<i;){const t=n.uint32();switch(t>>>3){case 1:s.requestId=n.string();break;case 2:s.query=e.HistoryQuery.decode(n,n.uint32());break;case 3:s.response=e.HistoryResponse.decode(n,n.uint32());break;default:n.skipType(7&t)}}return s},fromJSON:t=>({requestId:v(t.requestId)?String(t.requestId):"",query:v(t.query)?e.HistoryQuery.fromJSON(t.query):void 0,response:v(t.response)?e.HistoryResponse.fromJSON(t.response):void 0}),toJSON(t){const r={};return void 0!==t.requestId&&(r.requestId=t.requestId),void 0!==t.query&&(r.query=t.query?e.HistoryQuery.toJSON(t.query):void 0),void 0!==t.response&&(r.response=t.response?e.HistoryResponse.toJSON(t.response):void 0),r},fromPartial(t){var r;const n={requestId:"",query:void 0,response:void 0};return n.requestId=null!==(r=t.requestId)&&void 0!==r?r:"",n.query=void 0!==t.query&&null!==t.query?e.HistoryQuery.fromPartial(t.query):void 0,n.response=void 0!==t.response&&null!==t.response?e.HistoryResponse.fromPartial(t.response):void 0,n}};var y=(()=>{if("undefined"!==typeof y)return y;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw"Unable to locate global object"})();const g=y.atob||(t=>y.Buffer.from(t,"base64").toString("binary"));function m(t){const e=g(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}const b=y.btoa||(t=>y.Buffer.from(t,"binary").toString("base64"));function v(t){return null!==t&&void 0!==t}o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},87018:function(t,e){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function n(){return new r(null)}var i="undefined"!==typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*s;i=((u=s*u+((32767&l)<<15)+r[n]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i},e=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},e=26):(r.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*s;i=((u=s*u+((16383&l)<<14)+r[n]+i)>>28)+(l>>14)+a*c,r[n++]=268435455&u}return i},e=28),r.prototype.DB=e,r.prototype.DM=(1<<e)-1,r.prototype.DV=1<<e;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-e,r.prototype.F2=2*e-52;var o,s,a=new Array;for(o="0".charCodeAt(0),s=0;s<=9;++s)a[o++]=s;for(o="a".charCodeAt(0),s=10;s<36;++s)a[o++]=s;for(o="A".charCodeAt(0),s=10;s<36;++s)a[o++]=s;function u(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function c(t,e){var r=a[t.charCodeAt(e)];return null==r?-1:r}function l(t){var e=n();return e.fromInt(t),e}function h(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function f(t){this.m=t}function d(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function p(t,e){return t&e}function y(t,e){return t|e}function g(t,e){return t^e}function m(t,e){return t&~e}function b(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function v(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function _(t){return t}function E(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}f.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},f.prototype.revert=function(t){return t},f.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},d.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},d.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},d.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},d.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==n?255&t[i]:c(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+s+1]=this[r]>>i|a,a=(this[r]&o)<<n;for(r=s-1;r>=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<i,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o<i.t;++o)e[o+n.t]=n.am(0,i[o],e,o,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=n());var a=n(),u=this.s,c=t.s,l=this.DB-h(o[o.t-1]);l>0?(o.lShiftTo(l,a),s.lShiftTo(l,i)):(o.copyTo(a),s.copyTo(i));var f=a.t,d=a[f-1];if(0!=d){var p=d*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),y=this.FV/p,g=(1<<this.F1)/p,m=1<<this.F2,b=i.t,v=b-f,w=null==e?n():e;for(a.dlShiftTo(v,w),i.compareTo(w)>=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--v>=0;){var _=i[--b]==d?this.DM:Math.floor(i[b]*y+(i[b-1]+m)*g);if((i[b]+=a.am(0,_,i,v,0,f))<_)for(a.dlShiftTo(v,w),i.subTo(w,i);i[b]<--_;)i.subTo(w,i)}null!=e&&(i.drShiftTo(f,e),u!=c&&r.ZERO.subTo(e,e)),i.t=f,i.clamp(),l>0&&i.rShiftTo(l,i),u<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=n(),o=n(),s=e.convert(this),a=h(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<<a)>0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=u(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new f(e):new d(e),this.exp(t,r)},r.ZERO=l(0),r.ONE=l(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},E.prototype.convert=function(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=n();return t.copyTo(e),this.reduce(e),e},E.prototype.revert=function(t){return t},E.prototype.reduce=function(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)},E.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},E.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var S,I,A,M=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],T=(1<<26)/M[M.length-1];function R(){var t;t=(new Date).getTime(),I[A++]^=255&t,I[A++]^=t>>8&255,I[A++]^=t>>16&255,I[A++]^=t>>24&255,A>=D&&(A-=D)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=l(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,s=0,a=0,u=0;u<t.length;++u){var l=c(t,u);l<0?"-"==t.charAt(u)&&0==this.signum()&&(o=!0):(a=e*a+l,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},r.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>M.length&&(t=M.length);for(var s=n(),a=0;a<t;++a){s.fromInt(M[Math.floor(Math.random()*M.length)]);var u=s.modPow(o,this);if(0!=u.compareTo(r.ONE)&&0!=u.compareTo(e)){for(var c=1;c++<i&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},r.prototype.clone=function(){var t=n();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,p,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+b(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=v(this[r]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function(t){return this.changeBit(t,y)},r.prototype.clearBit=function(t){return this.changeBit(t,m)},r.prototype.flipBit=function(t){return this.changeBit(t,g)},r.prototype.add=function(t){var e=n();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=n(),r=n();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function(t,e){var r,i,o=t.bitLength(),s=l(1);if(o<=0)return s;r=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new f(e):e.isEven()?new E(e):new d(e);var a=new Array,u=3,c=r-1,p=(1<<r)-1;if(a[1]=i.convert(this),r>1){var y=n();for(i.sqrTo(a[1],y);u<=p;)a[u]=n(),i.mulTo(y,a[u-2],a[u]),u+=2}var g,m,b=t.t-1,v=!0,w=n();for(o=h(t[b])-1;b>=0;){for(o>=c?g=t[b]>>o-c&p:(g=(t[b]&(1<<o+1)-1)<<c-o,b>0&&(g|=t[b-1]>>this.DB+o-c)),u=r;0==(1&g);)g>>=1,--u;if((o-=u)<0&&(o+=this.DB,--b),v)a[g].copyTo(s),v=!1;else{for(;u>1;)i.sqrTo(s,w),i.sqrTo(w,s),u-=2;u>0?i.sqrTo(s,w):(m=s,s=w,w=m),i.mulTo(w,a[g],s)}for(;b>=0&&0==(t[b]&1<<o);)i.sqrTo(s,w),m=s,s=w,w=m,--o<0&&(o=this.DB-1,--b)}return i.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var n=t.clone(),i=this.clone(),o=l(1),s=l(0),a=l(0),u=l(1);0!=n.signum();){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);for(;i.isEven();)i.rShiftTo(1,i),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(n,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(r.ONE)?r.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},r.prototype.pow=function(t){return this.exp(t,new w)},r.prototype.gcd=function(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(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,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 o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=M[M.length-1]){for(e=0;e<M.length;++e)if(r[0]==M[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<M.length;){for(var n=M[e],i=e+1;i<M.length&&n<T;)n*=M[i++];for(n=r.modInt(n);e<i;)if(n%M[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function(){var t=n();return this.squareTo(t),t},r.prototype.Barrett=E,null==I){var k;if(I=new Array,A=0,"undefined"!==typeof window&&window.crypto)if(window.crypto.getRandomValues){var C=new Uint8Array(32);for(window.crypto.getRandomValues(C),k=0;k<32;++k)I[A++]=C[k]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var P=window.crypto.random(32);for(k=0;k<P.length;++k)I[A++]=255&P.charCodeAt(k)}for(;A<D;)k=Math.floor(65536*Math.random()),I[A++]=k>>>8,I[A++]=255&k;A=0,R()}function B(){if(null==S){for(R(),(S=new N).init(I),A=0;A<I.length;++A)I[A]=0;A=0}return S.next()}function O(){}function N(){this.i=0,this.j=0,this.S=new Array}O.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=B()},N.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},N.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var D=256;t.exports={default:r,BigInteger:r,SecureRandom:O}}).call(this)},44786:(t,e,r)=>{"use strict";const n=r(90190),{Multiaddr:i}=r(98719),o=r(18322),{EventEmitter:s}=r(47465),a=r(18392),u=Object.assign(a("libp2p:bootstrap"),{error:a("libp2p:bootstrap:error")});(t.exports=class extends s{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{list:[]};if(!t.list||!t.list.length)throw new Error("Bootstrap requires a list of peer addresses");super(),this._list=t.list,this._interval=t.interval||1e4,this._timer=null}start(){this._timer||(this._timer=setInterval((()=>this._discoverBootstrapPeers()),this._interval),u("Starting bootstrap node discovery"),this._discoverBootstrapPeers())}_discoverBootstrapPeers(){this._timer&&this._list.forEach((t=>{if(!o.P2P.matches(t))return u.error("Invalid multiaddr");const e=new i(t),r=e.getPeerId();if(!r)return void u.error("Invalid bootstrap multiaddr without peer id");const s=n.createFromB58String(r);try{this.emit("peer",{id:s,multiaddrs:[e]})}catch(a){u.error("Invalid bootstrap peer id",a)}}))}stop(){this._timer&&clearInterval(this._timer),this._timer=null}}).tag="bootstrap"},40110:(t,e,r)=>{var n=r(98942);function i(t,e){n.cipher.registerAlgorithm(t,(function(){return new n.aes.Algorithm(t,e)}))}r(89032),r(57300),r(94384),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){l||h();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return d(r._w,t,e,!1)},decrypt:function(t,e){return d(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!==typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i<e.length;++i)r.putByte(e[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){e=r,r=[];var o=e.length();if(16===o||24===o||32===o){o>>>=2;for(i=0;i<o;++i)r.push(e.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,a=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=f(r,t.decrypt&&!a),this._init=!0}},n.aes._expandKey=function(t,e){return l||h(),f(t,e)},n.aes._updateBlock=d,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var o,s,a,u,c,l=!1;function h(){l=!0,a=[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;o=new Array(256),s=new Array(256),u=new Array(4),c=new Array(4);for(e=0;e<4;++e)u[e]=new Array(256),c[e]=new Array(256);var r,n,i,h,f,d,p,y=0,g=0;for(e=0;e<256;++e){h=(h=g^g<<1^g<<2^g<<3^g<<4)>>8^255&h^99,o[y]=h,s[h]=y,d=(f=t[h])<<24^h<<16^h<<8^h^f,p=((r=t[y])^(n=t[r])^(i=t[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var m=0;m<4;++m)u[m][y]=d,c[m][h]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===y?y=g=1:(y=r^t[t[t[r^i]]],g^=t[t[g]])}}function f(t,e){for(var r,n=t.slice(0),i=1,s=n.length,u=4*(s+6+1),l=s;l<u;++l)r=n[l-1],l%s===0?(r=o[r>>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^a[i]<<24,i++):s>6&&l%s===4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[l]=n[l-s]^r;if(e){for(var h,f=c[0],d=c[1],p=c[2],y=c[3],g=n.slice(0),m=(l=0,(u=n.length)-4);l<u;l+=4,m-=4)if(0===l||l===u-4)g[l]=n[m],g[l+1]=n[m+3],g[l+2]=n[m+2],g[l+3]=n[m+1];else for(var b=0;b<4;++b)h=n[m+b],g[l+(3&-b)]=f[o[h>>>24]]^d[o[h>>>16&255]]^p[o[h>>>8&255]]^y[o[255&h]];n=g}return n}function d(t,e,r,n){var i,a,l,h,f,d,p,y,g,m,b,v,w=t.length/4-1;n?(i=c[0],a=c[1],l=c[2],h=c[3],f=s):(i=u[0],a=u[1],l=u[2],h=u[3],f=o),d=e[0]^t[0],p=e[n?3:1]^t[1],y=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,E=1;E<w;++E)m=i[d>>>24]^a[p>>>16&255]^l[y>>>8&255]^h[255&g]^t[++_],b=i[p>>>24]^a[y>>>16&255]^l[g>>>8&255]^h[255&d]^t[++_],v=i[y>>>24]^a[g>>>16&255]^l[d>>>8&255]^h[255&p]^t[++_],g=i[g>>>24]^a[d>>>16&255]^l[p>>>8&255]^h[255&y]^t[++_],d=m,p=b,y=v;r[0]=f[d>>>24]<<24^f[p>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^t[++_],r[n?3:1]=f[p>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&d]^t[++_],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[d>>>8&255]<<8^f[255&p]^t[++_],r[n?1:3]=f[g>>>24]<<24^f[d>>>16&255]<<16^f[p>>>8&255]<<8^f[255&y]^t[++_]}function p(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},20759:(t,e,r)=>{var n=r(98942);r(94384),r(54300);var i=t.exports=n.asn1=n.asn1||{};function o(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}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.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},i.create=function(t,e,r,o,s){if(n.util.isArray(o)){for(var a=[],u=0;u<o.length;++u)void 0!==o[u]&&a.push(o[u]);o=a}var c={tagClass:t,type:e,constructed:r,composed:r||n.util.isArray(o),value:o};return s&&"bitStringContents"in s&&(c.bitStringContents=s.bitStringContents,c.original=i.copy(c)),c},i.copy=function(t,e){var r;if(n.util.isArray(t)){r=[];for(var o=0;o<t.length;++o)r.push(i.copy(t[o],e));return r}return"string"===typeof t?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:i.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)},i.equals=function(t,e,r){if(n.util.isArray(t)){if(!n.util.isArray(e))return!1;if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!i.equals(t[o],e[o]))return!1;return!0}if(typeof t!==typeof e)return!1;if("string"===typeof t)return t===e;var s=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&i.equals(t.value,e.value);return r&&r.includeBitStringContents&&(s=s&&t.bitStringContents===e.bitStringContents),s},i.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e};function s(t,e,r,n){var a;o(t,e,2);var u=t.getByte();e--;var c=192&u,l=31&u;a=t.length();var h,f,d=function(t,e){var r=t.getByte();if(e--,128!==r){var n;if(128&r){var i=127&r;o(t,e,i),n=t.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(t,e);if(e-=a-t.length(),void 0!==d&&d>e){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=t.length(),p.remaining=e,p.requested=d,p}d=e}var y=32===(32&u);if(y)if(h=[],void 0===d)for(;;){if(o(t,e,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),e-=2;break}a=t.length(),h.push(s(t,e,r+1,n)),e-=a-t.length()}else for(;d>0;)a=t.length(),h.push(s(t,d,r+1,n)),e-=a-t.length(),d-=a-t.length();if(void 0===h&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(f=t.bytes(d)),void 0===h&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&d>1){var g=t.read,m=e,b=0;if(l===i.Type.BITSTRING&&(o(t,e,1),b=t.getByte(),e--),0===b)try{a=t.length();var v=s(t,e,r+1,{strict:!0,decodeBitStrings:!0}),w=a-t.length();e-=w,l==i.Type.BITSTRING&&w++;var _=v.tagClass;w!==d||_!==i.Class.UNIVERSAL&&_!==i.Class.CONTEXT_SPECIFIC||(h=[v])}catch(S){}void 0===h&&(t.read=g,e=m)}if(void 0===h){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=e}if(l===i.Type.BMPSTRING)for(h="";d>0;d-=2)o(t,e,2),h+=String.fromCharCode(t.getInt16()),e-=2;else h=t.getBytes(d),e-=d}var E=void 0===f?null:{bitStringContents:f};return i.create(c,l,y,h,E)}i.fromDer=function(t,e){void 0===e&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"===typeof e&&(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),"string"===typeof t&&(t=n.util.createBuffer(t));var r=t.length(),i=s(t,t.length(),0,e);if(e.parseAllBytes&&0!==t.length()){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return i},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,o=n.util.createBuffer(),s=!1;if("bitStringContents"in t&&(s=!0,t.original&&(s=i.equals(t,t.original))),s)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var a=0;a<t.value.length;++a)void 0!==t.value[a]&&o.putBuffer(i.toDer(t.value[a]))}else if(t.type===i.Type.BMPSTRING)for(a=0;a<t.value.length;++a)o.putInt16(t.value.charCodeAt(a));else t.type===i.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0===(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128===(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);e.putByte(128|c.length);for(a=c.length-1;a>=0;--a)e.putByte(c.charCodeAt(a))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,r,i,o,s=t.split("."),a=n.util.createBuffer();a.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u=2;u<s.length;++u){e=!0,r=[],i=parseInt(s[u],10);do{o=127&i,i>>>=7,e||(o|=128),r.push(o),e=!1}while(i>0);for(var c=r.length-1;c>=0;--c)a.putByte(r[c])}return a},i.derToOid=function(t){var e;"string"===typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.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),o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var u=t.charAt(10),c=10;"+"!==u&&"-"!==u&&(a=parseInt(t.substr(10,2),10),c+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(o,s,a,0),c&&("+"===(u=t.charAt(c))||"-"===u)){var l=60*parseInt(t.substr(c+1,2),10)+parseInt(t.substr(c+4,2),10);l*=6e4,"+"===u?e.setTime(+e-l):e.setTime(+e+l)}return e},i.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),o=parseInt(t.substr(8,2),10),s=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),u=0,c=0,l=!1;"Z"===t.charAt(t.length-1)&&(l=!0);var h=t.length-5,f=t.charAt(h);"+"!==f&&"-"!==f||(c=60*parseInt(t.substr(h+1,2),10)+parseInt(t.substr(h+4,2),10),c*=6e4,"+"===f&&(c*=-1),l=!0);return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),l?(e.setUTCFullYear(r,n,i),e.setUTCHours(o,s,a,u),e.setTime(+e+c)):(e.setFullYear(r,n,i),e.setHours(o,s,a,u)),e},i.dateToUtcTime=function(t){if("string"===typeof t)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"},i.dateToGeneralizedTime=function(t){if("string"===typeof t)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"},i.integerToDer=function(t){var e=n.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},i.derToInteger=function(t){"string"===typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,o){var s=!1;if(t.tagClass!==e.tagClass&&"undefined"!==typeof e.tagClass||t.type!==e.type&&"undefined"!==typeof e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||"undefined"===typeof e.constructed){if(s=!0,e.value&&n.util.isArray(e.value))for(var a=0,u=0;s&&u<e.value.length;++u)s=e.value[u].optional||!1,t.value[a]&&((s=i.validate(t.value[a],e.value[u],r,o))?++a:e.value[u].optional&&(s=!0)),!s&&o&&o.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(s&&r)if(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)if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}else o&&o.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');return s};var a=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(t,e,r){var o="";r=r||2,(e=e||0)>0&&(o+="\n");for(var s="",u=0;u<e*r;++u)s+=" ";switch(o+=s+"Tag: ",t.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(t.tagClass===i.Class.UNIVERSAL)switch(o+=t.type,t.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=t.type;if(o+="\n",o+=s+"Constructed: "+t.constructed+"\n",t.composed){var c=0,l="";for(u=0;u<t.value.length;++u)void 0!==t.value[u]&&(c+=1,l+=i.prettyPrint(t.value[u],e+1,r),u+1<t.value.length&&(l+=","));o+=s+"Sub values: "+c+l}else{if(o+=s+"Value: ",t.type===i.Type.OID){var h=i.derToOid(t.value);o+=h,n.pki&&n.pki.oids&&h in n.pki.oids&&(o+=" ("+n.pki.oids[h]+") ")}if(t.type===i.Type.INTEGER)try{o+=i.derToInteger(t.value)}catch(d){o+="0x"+n.util.bytesToHex(t.value)}else if(t.type===i.Type.BITSTRING){if(t.value.length>1?o+="0x"+n.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);1==f?o+=" (1 unused bit shown)":f>1&&(o+=" ("+f+" unused bits shown)")}}else if(t.type===i.Type.OCTETSTRING)a.test(t.value)||(o+="("+t.value+") "),o+="0x"+n.util.bytesToHex(t.value);else if(t.type===i.Type.UTF8)try{o+=n.util.decodeUtf8(t.value)}catch(p){if("URI malformed"!==p.message)throw p;o+="0x"+n.util.bytesToHex(t.value)+" (malformed UTF8)"}else t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:a.test(t.value)?o+="0x"+n.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},91559:(t,e,r)=>{var n=r(82161).Buffer,i={};t.exports=i;var o={};i.encode=function(t,e,r){if("string"!==typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!==typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,o=e.length,s=e.charAt(0),a=[0];for(i=0;i<t.length;++i){for(var u=0,c=t[i];u<a.length;++u)c+=a[u]<<8,a[u]=c%o,c=c/o|0;for(;c>0;)a.push(c%o),c=c/o|0}for(i=0;0===t[i]&&i<t.length-1;++i)n+=s;for(i=a.length-1;i>=0;--i)n+=e[a[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),o=[0];for(r=0;r<t.length();++r){for(var s=0,a=t.at(r);s<o.length;++s)a+=o[s]<<8,o[s]=a%n,a=a/n|0;for(;a>0;)o.push(a%n),a=a/n|0}var u="";for(r=0;0===t.at(r)&&r<t.length()-1;++r)u+=i;for(r=o.length-1;r>=0;--r)u+=e[o[r]];return u}(t,e);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},i.decode=function(t,e){if("string"!==typeof t)throw new TypeError('"input" must be a string.');if("string"!==typeof e)throw new TypeError('"alphabet" must be a string.');var r=o[e];if(!r){r=o[e]=[];for(var i=0;i<e.length;++i)r[e.charCodeAt(i)]=i}t=t.replace(/\s/g,"");var s=e.length,a=e.charAt(0),u=[0];for(i=0;i<t.length;i++){var c=r[t.charCodeAt(i)];if(void 0===c)return;for(var l=0,h=c;l<u.length;++l)h+=u[l]*s,u[l]=255&h,h>>=8;for(;h>0;)u.push(255&h),h>>=8}for(var f=0;t[f]===a&&f<t.length-1;++f)u.push(0);return"undefined"!==typeof n?n.from(u.reverse()):new Uint8Array(u.reverse())}},89032:(t,e,r)=>{var n=r(98942);r(94384),t.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(t,e){var r=t;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new n.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})},n.cipher.createDecipher=function(t,e){var r=t;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new n.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})},n.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),n.cipher.algorithms[t]=e},n.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[t]:null};var i=n.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)};i.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=n.util.createBuffer(),this.output=t.output||n.util.createBuffer(),this.mode.start(e)},i.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()},i.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!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)))}},57300:(t,e,r)=>{var n=r(98942);r(94384),n.cipher=n.cipher||{};var i=t.exports=n.cipher.modes=n.cipher.modes||{};function o(t,e){if("string"===typeof t&&(t=n.util.createBuffer(t)),n.util.isArray(t)&&t.length>4){var r=t;t=n.util.createBuffer();for(var i=0;i<r.length;++i)t.putByte(r[i])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!n.util.isArray(t)){var o=[],s=e/4;for(i=0;i<s;++i)o.push(t.getInt32());t=o}return t}function s(t){t[t.length-1]=t[t.length-1]+1&4294967295}function a(t){return[t/4294967296|0,4294967295&t]}i.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)},i.ecb.prototype.start=function(t){},i.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(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},i.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(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},i.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)&&(t.truncate(n),!0)},i.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)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.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(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.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(n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},i.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)&&(t.truncate(n),!0)},i.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=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.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=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.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=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.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=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=a(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o<=0||r){if(r){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(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),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.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),s(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},i.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^o[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){t[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(t,e){for(var r=1&t[3],n=3;n>0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.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)},i.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,o=new Array(i),s=0;s<i;++s){var a=[0,0,0,0],u=(n-1-s%n)*e;a[s/n|0]=1<<e-1<<u,o[s]=this.generateSubHashTable(this.multiply(a,t),e)}return o},i.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<n;){for(var s=1;s<o;++s){var a=i[o],u=i[s];i[o+s]=[a[0]^u[0],a[1]^u[1],a[2]^u[2],a[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=n+1;o<r;++o){var c=i[o^n];i[o]=[t[0]^c[0],t[1]^c[1],t[2]^c[2],t[3]^c[3]]}return i}},69530:(t,e,r)=>{var n=r(98942);function i(t,e){n.cipher.registerAlgorithm(t,(function(){return new n.des.Algorithm(t,e)}))}r(89032),r(57300),r(94384),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return d(r._keys,t,e,!1)},decrypt:function(t,e){return d(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=t.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,w=0;w<g;w++){var _=t.getInt32(),E=t.getInt32();_^=(e=252645135&(_>>>4^E))<<4,_^=e=65535&((E^=e)>>>-16^_),_^=(e=858993459&(_>>>2^(E^=e<<-16)))<<2,_^=e=65535&((E^=e)>>>-16^_),_^=(e=1431655765&(_>>>1^(E^=e<<-16)))<<1,_^=e=16711935&((E^=e)>>>8^_),e=(_^=(e=1431655765&(_>>>1^(E^=e<<8)))<<1)<<8|(E^=e)>>>20&240,_=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=e;for(var S=0;S<b.length;++S){b[S]?(_=_<<2|_>>>26,E=E<<2|E>>>26):(_=_<<1|_>>>27,E=E<<1|E>>>27),E&=-15;var I=r[(_&=-15)>>>28]|n[_>>>24&15]|i[_>>>20&15]|o[_>>>16&15]|s[_>>>12&15]|a[_>>>8&15]|u[_>>>4&15],A=c[E>>>28]|l[E>>>24&15]|h[E>>>20&15]|f[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|y[E>>>4&15];e=65535&(A>>>16^I),m[v++]=I^e,m[v++]=A^e<<16}}return m}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[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],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[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],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(t,e,r,n){var i,d,p=32===t.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=e[0],g=e[1];y^=(d=252645135&(y>>>4^g))<<4,y^=(d=65535&(y>>>16^(g^=d)))<<16,y^=d=858993459&((g^=d)>>>2^y),y^=d=16711935&((g^=d<<2)>>>8^y),y=(y^=(d=1431655765&(y>>>1^(g^=d<<8)))<<1)<<1|y>>>31,g=(g^=d)<<1|g>>>31;for(var m=0;m<p;m+=3){for(var b=i[m+1],v=i[m+2],w=i[m];w!=b;w+=v){var _=g^t[w],E=(g>>>4|g<<28)^t[w+1];d=y,y=g,g=d^(s[_>>>24&63]|u[_>>>16&63]|l[_>>>8&63]|f[63&_]|o[E>>>24&63]|a[E>>>16&63]|c[E>>>8&63]|h[63&E])}d=y,y=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(d=16711935&(g>>>8^(y^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(y^=d)))<<2,g^=d=65535&((y^=d)>>>16^g),g^=d=252645135&((y^=d<<16)>>>4^g),y^=d<<4,r[0]=y,r[1]=g}function p(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},98942:t=>{t.exports={options:{usePureJavaScript:!1}}},25547:(t,e,r)=>{var n=r(98942);r(73547),r(94384),(t.exports=n.hmac=n.hmac||{}).create=function(){var t=null,e=null,r=null,i=null,o={start:function(o,s){if(null!==o)if("string"===typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');e=n.md.algorithms[o].create()}else e=o;if(null===s)s=t;else{if("string"===typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var a=s;s=n.util.createBuffer();for(var u=0;u<a.length;++u)s.putByte(a[u])}var c=s.length();c>e.blockLength&&(e.start(),e.update(s.bytes()),s=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=s.length();for(u=0;u<c;++u){a=s.at(u);r.putByte(54^a),i.putByte(92^a)}if(c<e.blockLength)for(a=e.blockLength-c,u=0;u<a;++u)r.putByte(54),i.putByte(92);t=s,r=r.bytes(),i=i.bytes()}e.start(),e.update(r)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(i),e.update(t),e.digest()}};return o.digest=o.getMac,o}},70217:(t,e,r)=>{var n,i=r(98942);t.exports=i.jsbn=i.jsbn||{};function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new o(null)}function a(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this.data[t],c=this.data[t++]>>14,l=a*u+c*s;i=((u=s*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+a*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"===typeof navigator?(o.prototype.am=a,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this.data[t],c=this.data[t++]>>15,l=a*u+c*s;i=((u=s*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this.data[t++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(o.prototype.am=a,n=28),o.prototype.DB=n,o.prototype.DM=(1<<n)-1,o.prototype.DV=1<<n;o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-n,o.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function h(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function f(t,e){var r=l[t.charCodeAt(e)];return null==r?-1:r}function d(t){var e=s();return e.fromInt(t),e}function p(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function y(t){this.m=t}function g(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function m(t,e){return t&e}function b(t,e){return t|e}function v(t,e){return t^e}function w(t,e){return t&~e}function _(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function E(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function I(t){return t}function A(t){this.r2=s(),this.q3=s(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}y.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},y.prototype.revert=function(t){return t},y.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},g.prototype.convert=function(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},g.prototype.revert=function(t){var e=s();return t.copyTo(e),this.reduce(e),e},g.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t.data[e],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)},g.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},g.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(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},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var a=8==r?255&t[n]:f(t,n);a<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=a:s+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this.data[this.t++]=a>>this.DB-s):this.data[this.t-1]|=a<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(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},o.prototype.drShiftTo=function(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},o.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e.data[r+s+1]=this.data[r]>>i|a,a=(this.data[r]&o)<<n;for(r=s-1;r>=0;--r)e.data[r]=0;e.data[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)e.data[s-r-1]|=(this.data[s]&o)<<i,e.data[s-r]=this.data[s]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},o.prototype.subTo=function(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()},o.prototype.multiplyTo=function(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&&o.ZERO.subTo(e,e)},o.prototype.squareTo=function(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()},o.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var a=s(),u=this.s,c=t.s,l=this.DB-p(n.data[n.t-1]);l>0?(n.lShiftTo(l,a),i.lShiftTo(l,r)):(n.copyTo(a),i.copyTo(r));var h=a.t,f=a.data[h-1];if(0!=f){var d=f*(1<<this.F1)+(h>1?a.data[h-2]>>this.F2:0),y=this.FV/d,g=(1<<this.F1)/d,m=1<<this.F2,b=r.t,v=b-h,w=null==e?s():e;for(a.dlShiftTo(v,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t<h;)a.data[a.t++]=0;for(;--v>=0;){var _=r.data[--b]==f?this.DM:Math.floor(r.data[b]*y+(r.data[b-1]+m)*g);if((r.data[b]+=a.am(0,_,r,v,0,h))<_)for(a.dlShiftTo(v,w),r.subTo(w,r);r.data[b]<--_;)r.subTo(w,r)}null!=e&&(r.drShiftTo(h,e),u!=c&&o.ZERO.subTo(e,e)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=s(),n=s(),i=e.convert(this),a=p(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<<a)>0)e.mulTo(n,i,r);else{var u=r;r=n,n=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this.data[s]>>a)>0&&(i=!0,o=h(r));s>=0;)a<e?(r=(this.data[s]&(1<<a)-1)<<e-a,r|=this.data[--s]>>(a+=this.DB-e)):(r=this.data[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=h(r));return i?o:"0"},o.prototype.negate=function(){var t=s();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new y(e):new g(e),this.exp(t,r)},o.ZERO=d(0),o.ONE=d(1),S.prototype.convert=I,S.prototype.revert=I,S.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},S.prototype.sqrTo=function(t,e){t.squareTo(e)},A.prototype.convert=function(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=s();return t.copyTo(e),this.reduce(e),e},A.prototype.revert=function(t){return t},A.prototype.reduce=function(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)},A.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},A.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var M=[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],T=(1<<26)/M[M.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=d(r),i=s(),o=s(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(t).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(t)+a},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,a=0,u=0;u<t.length;++u){var c=f(t,u);c<0?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(a=e*a+c,++s>=r&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},o.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;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()},o.prototype.changeBit=function(t,e){var r=o.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},o.prototype.addTo=function(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()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){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]}},o.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,t.data[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t.data[i],r,i,0,e-i);r.clamp()},o.prototype.multiplyUpperTo=function(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)},o.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),s={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},a=0;a<t;++a){do{n=new o(this.bitLength(),s)}while(n.compareTo(o.ONE)<=0||n.compareTo(e)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var c=1;c++<r&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},o.prototype.clone=function(){var t=s();return this.copyTo(t),t},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this.data[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this.data[t]&(1<<n)-1)<<8-n,r|=this.data[--t]>>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=s();return this.bitwiseTo(t,m,e),e},o.prototype.or=function(t){var e=s();return this.bitwiseTo(t,b,e),e},o.prototype.xor=function(t){var e=s();return this.bitwiseTo(t,v,e),e},o.prototype.andNot=function(t){var e=s();return this.bitwiseTo(t,w,e),e},o.prototype.not=function(){for(var t=s(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},o.prototype.shiftLeft=function(t){var e=s();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},o.prototype.shiftRight=function(t){var e=s();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},o.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+_(this.data[t]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=E(this.data[r]^e);return t},o.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},o.prototype.setBit=function(t){return this.changeBit(t,b)},o.prototype.clearBit=function(t){return this.changeBit(t,w)},o.prototype.flipBit=function(t){return this.changeBit(t,v)},o.prototype.add=function(t){var e=s();return this.addTo(t,e),e},o.prototype.subtract=function(t){var e=s();return this.subTo(t,e),e},o.prototype.multiply=function(t){var e=s();return this.multiplyTo(t,e),e},o.prototype.divide=function(t){var e=s();return this.divRemTo(t,e,null),e},o.prototype.remainder=function(t){var e=s();return this.divRemTo(t,null,e),e},o.prototype.divideAndRemainder=function(t){var e=s(),r=s();return this.divRemTo(t,e,r),new Array(e,r)},o.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),o=d(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(e):e.isEven()?new A(e):new g(e);var a=new Array,u=3,c=r-1,l=(1<<r)-1;if(a[1]=n.convert(this),r>1){var h=s();for(n.sqrTo(a[1],h);u<=l;)a[u]=s(),n.mulTo(h,a[u-2],a[u]),u+=2}var f,m,b=t.t-1,v=!0,w=s();for(i=p(t.data[b])-1;b>=0;){for(i>=c?f=t.data[b]>>i-c&l:(f=(t.data[b]&(1<<i+1)-1)<<c-i,b>0&&(f|=t.data[b-1]>>this.DB+i-c)),u=r;0==(1&f);)f>>=1,--u;if((i-=u)<0&&(i+=this.DB,--b),v)a[f].copyTo(o),v=!1;else{for(;u>1;)n.sqrTo(o,w),n.sqrTo(w,o),u-=2;u>0?n.sqrTo(o,w):(m=o,o=w,w=m),n.mulTo(w,a[f],o)}for(;b>=0&&0==(t.data[b]&1<<i);)n.sqrTo(o,w),m=o,o=w,w=m,--i<0&&(i=this.DB-1,--b)}return n.revert(o)},o.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var r=t.clone(),n=this.clone(),i=d(1),s=d(0),a=d(0),u=d(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(a,i),s.subTo(u,s)):(n.subTo(r,n),e&&a.subTo(i,a),u.subTo(s,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new S)},o.prototype.gcd=function(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(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,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 o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=M[M.length-1]){for(e=0;e<M.length;++e)if(r.data[0]==M[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<M.length;){for(var n=M[e],i=e+1;i<M.length&&n<T;)n*=M[i++];for(n=r.modInt(n);e<i;)if(n%M[e++]==0)return!1}return r.millerRabin(t)}},73547:(t,e,r)=>{var n=r(98942);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},54300:(t,e,r)=>{var n=r(98942);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function o(t,e){i[t]=e,i[e]=t}function s(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("1.3.14.3.2.29","sha1WithRSASignature"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("2.16.840.1.101.3.4.2.4","sha224"),o("2.16.840.1.101.3.4.2.5","sha512-224"),o("2.16.840.1.101.3.4.2.6","sha512-256"),o("1.2.840.113549.2.2","md2"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.4","surname"),o("2.5.4.5","serialNumber"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.12","title"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("2.5.4.42","givenName"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},37202:(t,e,r)=>{var n=r(98942);if(r(40110),r(20759),r(69530),r(73547),r(54300),r(27033),r(88059),r(3688),r(59857),r(46712),r(94384),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.asn1,s=n.pki=n.pki||{};t.exports=s.pbe=n.pbe=n.pbe||{};var a=s.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(t,e){return t.start().update(e).digest().getBytes()}function f(t){var e;if(t){if(!(e=s.oids[o.derToOid(t)])){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else e="hmacWithSHA1";return d(e)}function d(t){var e=n.md;switch(t){case"hmacWithSHA224":e=n.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()}s.encryptPrivateKeyInfo=function(t,e,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),h=r.count,f=o.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,y,g;switch(r.algorithm){case"aes128":i=16,p=16,y=a["aes128-CBC"],g=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,y=a["aes192-CBC"],g=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,y=a["aes256-CBC"],g=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,y=a.desCBC,g=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),b=d(m),v=n.pkcs5.pbkdf2(e,l,h,i,b),w=n.random.getBytesSync(p);(S=g(v)).start(w),S.update(o.toDer(t)),S.finish(),c=S.output.getBytes();var _=function(t,e,r,i){var a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,t),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,e.getBytes())]);"hmacWithSHA1"!==i&&a.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]));return a}(l,f,i,m);u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBKDF2).getBytes()),_]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(y).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var S,I=new n.util.ByteBuffer(l);v=s.pbe.generatePkcs12Key(e,I,1,h,i),w=s.pbe.generatePkcs12Key(e,I,2,h,i);(S=n.des.createEncryptionCipher(v)).start(w),S.update(o.toDer(t)),S.finish(),c=S.output.getBytes(),u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,l),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[u,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,c)])},s.decryptPrivateKeyInfo=function(t,e){var r=null,i={},a=[];if(!o.validate(t,u,i,a)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=a,c}var l=o.derToOid(i.encryptionOid),h=s.pbe.getCipher(l,i.encryptionParams,e),f=n.util.createBuffer(i.encryptedData);return h.update(f),h.finish()&&(r=o.fromDer(h.output)),r},s.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(t).getBytes()};return n.pem.encode(r,{maxline:e})},s.encryptedPrivateKeyFromPem=function(t){var e=n.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==e.type){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&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(e.body)},s.encryptRsaPrivateKey=function(t,e,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(t));return i=s.encryptPrivateKeyInfo(i,e,r),s.encryptedPrivateKeyToPem(i)}var a,u,c,l;switch(r.algorithm){case"aes128":a="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":a="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var f=l(n.pbe.opensslDeriveBytes(e,u.substr(0,8),c));f.start(u),f.update(o.toDer(s.privateKeyToAsn1(t))),f.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:n.util.bytesToHex(u).toUpperCase()},body:f.output.getBytes()};return n.pem.encode(d)},s.decryptRsaPrivateKey=function(t,e){var r=null,i=n.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var a,u;switch(i.dekInfo.algorithm){case"DES-CBC":a=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,u=function(t){return n.rc2.createDecryptionCipher(t,40)};break;case"RC2-64-CBC":a=8,u=function(t){return n.rc2.createDecryptionCipher(t,64)};break;case"RC2-128-CBC":a=16,u=function(t){return n.rc2.createDecryptionCipher(t,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),h=u(n.pbe.opensslDeriveBytes(e,l.substr(0,8),a));if(h.start(l),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(o.fromDer(r),e):o.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(t,e,r,i,o,s){var a,u;if("undefined"===typeof s||null===s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var c=s.digestLength,l=s.blockLength,h=new n.util.ByteBuffer,f=new n.util.ByteBuffer;if(null!==t&&void 0!==t){for(u=0;u<t.length;u++)f.putInt16(t.charCodeAt(u));f.putInt16(0)}var d=f.length(),p=e.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(p/l),m=new n.util.ByteBuffer;for(u=0;u<g;u++)m.putByte(e.at(u%p));var b=l*Math.ceil(d/l),v=new n.util.ByteBuffer;for(u=0;u<b;u++)v.putByte(f.at(u%d));var w=m;w.putBuffer(v);for(var _=Math.ceil(o/c),E=1;E<=_;E++){var S=new n.util.ByteBuffer;S.putBytes(y.bytes()),S.putBytes(w.bytes());for(var I=0;I<i;I++)s.start(),s.update(S.getBytes()),S=s.digest();var A=new n.util.ByteBuffer;for(u=0;u<l;u++)A.putByte(S.at(u%c));var M=Math.ceil(p/l)+Math.ceil(d/l),T=new n.util.ByteBuffer;for(a=0;a<M;a++){var R=new n.util.ByteBuffer(w.getBytes(l)),k=511;for(u=A.length()-1;u>=0;u--)k>>=8,k+=A.at(u)+R.at(u),R.setAt(u,255&k);T.putBuffer(R)}w=T,h.putBuffer(S)}return h.truncate(h.length()-o),h},s.pbe.getCipher=function(t,e,r){switch(t){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(t,e,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.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}},s.pbe.getCipherForPBES2=function(t,e,r){var i,a={},u=[];if(!o.validate(e,c,a,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((t=o.derToOid(a.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,i.supportedOids=["pkcs5PBKDF2"],i;if((t=o.derToOid(a.encOid))!==s.oids["aes128-CBC"]&&t!==s.oids["aes192-CBC"]&&t!==s.oids["aes256-CBC"]&&t!==s.oids["des-EDE3-CBC"]&&t!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,h,d=a.kdfSalt,p=n.util.createBuffer(a.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[t]){case"aes128-CBC":l=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,h=n.des.createDecryptionCipher;break;case"desCBC":l=8,h=n.des.createDecryptionCipher}var y=f(a.prfOid),g=n.pkcs5.pbkdf2(r,d,p,l,y),m=a.encIv,b=h(g);return b.start(m),b},s.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},a=[];if(!o.validate(e,l,i,a))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,y;var u,c,h,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),t){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,h=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,h=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,y}var g=f(i.prfOid),m=s.pbe.generatePkcs12Key(r,d,1,p,u,g);return g.start(),h(m,s.pbe.generatePkcs12Key(r,d,2,p,c,g))},s.pbe.opensslDeriveBytes=function(t,e,r,i){if("undefined"===typeof i||null===i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===e&&(e="");for(var o=[h(i,t+e)],s=16,a=1;s<r;++a,s+=16)o.push(h(i,o[a-1]+t+e));return o.join("").substr(0,r)}},27033:(t,e,r)=>{var n=r(82161).Buffer,i=r(98942);r(25547),r(73547),r(94384);var o,s=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(o=r(17111)),t.exports=i.pbkdf2=s.pbkdf2=function(t,e,r,s,a,u){if("function"===typeof a&&(u=a,a=null),i.util.isNodejs&&!i.options.usePureJavaScript&&o.pbkdf2&&(null===a||"object"!==typeof a)&&(o.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!==typeof a&&(a="sha1"),t=n.from(t,"binary"),e=n.from(e,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(t,e,r,s,(function(t,e){if(t)return u(t);u(null,e.toString("binary"))})):o.pbkdf2(t,e,r,s,a,(function(t,e){if(t)return u(t);u(null,e.toString("binary"))})):4===o.pbkdf2Sync.length?o.pbkdf2Sync(t,e,r,s).toString("binary"):o.pbkdf2Sync(t,e,r,s,a).toString("binary");if("undefined"!==typeof a&&null!==a||(a="sha1"),"string"===typeof a){if(!(a in i.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=i.md[a].create()}var c=a.digestLength;if(s>4294967295*c){var l=new Error("Derived key is too long.");if(u)return u(l);throw l}var h=Math.ceil(s/c),f=s-(h-1)*c,d=i.hmac.create();d.start(a,t);var p,y,g,m="";if(!u){for(var b=1;b<=h;++b){d.start(null,null),d.update(e),d.update(i.util.int32ToBytes(b)),p=g=d.digest().getBytes();for(var v=2;v<=r;++v)d.start(null,null),d.update(g),y=d.digest().getBytes(),p=i.util.xorBytes(p,y,c),g=y;m+=b<h?p:p.substr(0,f)}return m}b=1;function w(){if(b>h)return u(null,m);d.start(null,null),d.update(e),d.update(i.util.int32ToBytes(b)),p=g=d.digest().getBytes(),v=2,_()}function _(){if(v<=r)return d.start(null,null),d.update(g),y=d.digest().getBytes(),p=i.util.xorBytes(p,y,c),g=y,++v,i.util.setImmediate(_);m+=b<h?p:p.substr(0,f),++b,w()}w()}},88059:(t,e,r)=>{var n=r(98942);r(94384);var i=t.exports=n.pem=n.pem||{};function o(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i<t.values.length;++i)r.push(t.values[i].replace(/^(\S+\r\n)/,n));e+=r.join(",")+"\r\n";var o=0,s=-1;for(i=0;i<e.length;++i,++o)if(o>65&&-1!==s){var a=e[s];","===a?(++s,e=e.substr(0,s)+"\r\n "+e.substr(s)):e=e.substr(0,s)+"\r\n"+a+e.substr(s+1),o=i-s-1,s=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(s=i);return e}function s(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=o(r)),t.headers)for(var s=0;s<t.headers.length;++s)i+=o(t.headers[s]);return t.procType&&(i+="\r\n"),i+=n.util.encode64(t.body,e.maxline||64)+"\r\n",i+="-----END "+t.type+"-----\r\n"},i.decode=function(t){for(var e,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,o=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/;e=i.exec(t);){var u=e[1];"NEW CERTIFICATE REQUEST"===u&&(u="CERTIFICATE REQUEST");var c={type:u,procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(e[3])};if(r.push(c),e[2]){for(var l=e[2].split(a),h=0;e&&h<l.length;){for(var f=l[h].replace(/\s+$/,""),d=h+1;d<l.length;++d){var p=l[d];if(!/\s/.test(p[0]))break;f+=p,h=d}if(e=f.match(o)){for(var y={name:e[1],values:[]},g=e[2].split(","),m=0;m<g.length;++m)y.values.push(s(g[m]));if(c.procType)if(c.contentDomain||"Content-Domain"!==y.name)if(c.dekInfo||"DEK-Info"!==y.name)c.headers.push(y);else{if(0===y.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');c.dekInfo={algorithm:g[0],parameters:g[1]||null}}else c.contentDomain=g[0]||"";else{if("Proc-Type"!==y.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==y.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');c.procType={version:g[0],type:g[1]}}}++h}if("ENCRYPTED"===c.procType&&!c.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},5209:(t,e,r)=>{var n=r(98942);r(94384),r(3688),r(6437);var i=t.exports=n.pkcs1=n.pkcs1||{};function o(t,e,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(e/r.digestLength),s=0;s<o;++s){var a=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(t+a),i+=r.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,r){var i,s,a,u;"string"===typeof r?(i=r,s=arguments[3]||void 0,a=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),a?a.start():a=n.md.sha1.create(),u||(u=a);var c=Math.ceil(t.n.bitLength()/8),l=c-2*a.digestLength-2;if(e.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=e.length,g.maxLength=l,g;i||(i=""),a.update(i,"raw");for(var h=a.digest(),f="",d=l-e.length,p=0;p<d;p++)f+="\0";var y=h.getBytes()+f+"\x01"+e;if(s){if(s.length!==a.digestLength){var g;throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,g.digestLength=a.digestLength,g}}else s=n.random.getBytes(a.digestLength);var m=o(s,c-a.digestLength-1,u),b=n.util.xorBytes(y,m,y.length),v=o(b,a.digestLength,u),w=n.util.xorBytes(s,v,s.length);return"\0"+w+b},i.decode_rsa_oaep=function(t,e,r){var i,s,a;"string"===typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var u=Math.ceil(t.n.bitLength()/8);if(e.length!==u)throw(b=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,b.expectedLength=u,b;if(void 0===s?s=n.md.sha1.create():s.start(),a||(a=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var c=s.digest().getBytes(),l=e.charAt(0),h=e.substring(1,s.digestLength+1),f=e.substring(1+s.digestLength),d=o(f,s.digestLength,a),p=n.util.xorBytes(h,d,h.length),y=o(p,u-s.digestLength-1,a),g=n.util.xorBytes(f,y,f.length),m=g.substring(0,s.digestLength),b="\0"!==l,v=0;v<s.digestLength;++v)b|=c.charAt(v)!==m.charAt(v);for(var w=1,_=s.digestLength,E=s.digestLength;E<g.length;E++){var S=g.charCodeAt(E),I=1&S^1,A=w?65534:0;b|=S&A,_+=w&=I}if(b||1!==g.charCodeAt(_))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(_+1)}},7724:(t,e,r)=>{var n=r(98942);r(94384),r(70217),r(3688),function(){if(n.prime)t.exports=n.prime;else{var e=t.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var s=function(t,e){return t|e};e.generateProbablePrime=function(t,e,i){"function"===typeof e&&(i=e,e={});var o=(e=e||{}).algorithm||"PRIMEINC";"string"===typeof o&&(o={name:o}),o.options=o.options||{};var s=e.prng||n.random,u={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}};if("PRIMEINC"===o.name)return function(t,e,i,o){if("workers"in i)return function(t,e,i,o){if("undefined"===typeof Worker)return a(t,e,i,o);var s=c(t,e),u=i.workers,l=i.workLoad||100,h=30*l/8,f=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(t,e){t&&(e=2),u=e-1,d()}));function d(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(f);for(i=0;i<u;++i)n[i].addEventListener("message",d);var a=!1;function d(i){if(!a){0;var u=i.data;if(u.found){for(var f=0;f<n.length;++f)n[f].terminate();return a=!0,o(null,new r(u.prime,16))}s.bitLength()>t&&(s=c(t,e));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:l}),s.dAddOffset(h,0)}}}d()}(t,e,i,o);return a(t,e,i,o)}(t,u,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function a(t,e,r,n){var i=c(t,e),o=function(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}(i.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),u(i,t,e,0,o,s,n)}function u(t,e,r,o,s,a,l){var h=+new Date;do{if(t.bitLength()>e&&(t=c(e,r)),t.isProbablePrime(s))return l(null,t);t.dAddOffset(i[o++%8],0)}while(a<0||+new Date-h<a);n.util.setImmediate((function(){u(t,e,r,o,s,a,l)}))}function c(t,e){var n=new r(t,e),i=t-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),s,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}}()},77057:(t,e,r)=>{var n=r(21964),i=r(98942);r(94384);var o=null;!i.util.isNodejs||i.options.usePureJavaScript||n.versions["node-webkit"]||(o=r(17111)),(t.exports=i.prng=i.prng||{}).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),s=0;s<32;++s)n[s]=r.create();function a(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r===0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var i=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(i),e.generated=0}function c(t){var e=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)});var o=i.util.createBuffer();if(e)for(;o.length()<t;){var s=Math.max(1,Math.min(t-o.length(),65536)/4),a=new Uint32Array(Math.floor(s));try{e(a);for(var u=0;u<a.length;++u)o.putInt32(a[u])}catch(d){if(!("undefined"!==typeof QuotaExceededError&&d instanceof QuotaExceededError))throw d}}if(o.length()<t)for(var c,l,h,f=Math.floor(65536*Math.random());o.length()<t;){l=16807*(65535&f),l+=(32767&(c=16807*(f>>16)))<<16,f=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)h=f>>>(u<<3),h^=Math.floor(256*Math.random()),o.putByte(255&h)}return o.getBytes(t)}return e.pools=n,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var n=e.plugin.cipher,o=e.plugin.increment,s=e.plugin.formatKey,a=e.plugin.formatSeed,c=i.util.createBuffer();e.key=null,function l(h){if(h)return r(h);if(c.length()>=t)return r(null,c.getBytes(t));e.generated>1048575&&(e.key=null);if(null===e.key)return i.util.nextTick((function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,(function(r,n){if(r)return t(r);e.collect(n),u(),t()}))}(l)}));var f=n(e.key,e.seed);e.generated+=f.length,c.putBytes(f),e.key=s(n(e.key,o(e.seed))),e.seed=a(n(e.key,e.seed)),i.util.setImmediate(l)}()},e.generateSync=function(t){var r=e.plugin.cipher,n=e.plugin.increment,o=e.plugin.formatKey,s=e.plugin.formatSeed;e.key=null;for(var u=i.util.createBuffer();u.length()<t;){e.generated>1048575&&(e.key=null),null===e.key&&a();var c=r(e.key,e.seed);e.generated+=c.length,u.putBytes(c),e.key=o(r(e.key,n(e.seed))),e.seed=s(r(e.key,e.seed))}return u.getBytes(t)},o?(e.seedFile=function(t,e){o.randomBytes(t,(function(t,r){if(t)return e(t);e(null,r.toString())}))},e.seedFileSync=function(t){return o.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,c(t))}catch(r){e(r)}},e.seedFileSync=c),e.collect=function(t){for(var r=t.length,n=0;n<r;++n)e.pools[e.pool].update(t.substr(n,1)),e.pool=31===e.pool?0:e.pool+1},e.collectInt=function(t,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(t>>i&255);e.collect(n)},e.registerWorker=function(t){if(t===self)e.seedFile=function(t,e){self.addEventListener("message",(function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,(function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})}))}))}},e}},3688:(t,e,r)=>{var n=r(98942);r(40110),r(46932),r(77057),r(94384),n.random&&n.random.getBytes?t.exports=n.random:function(e){var r={},i=new Array(4),o=n.util.createBuffer();function s(){var t=n.prng.create(r);return t.getBytes=function(e,r){return t.generate(e,r)},t.getBytesSync=function(e){return t.generate(e)},t}r.formatKey=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),n.aes._expandKey(t,!1)},r.formatSeed=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},r.cipher=function(t,e){return n.aes._updateBlock(t,e,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(t){return++t[3],t},r.md=n.md.sha256;var a=s(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(t){return l.getRandomValues(t)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"===typeof window||window.document,a.collectInt(+new Date,32),"undefined"!==typeof navigator){var h="";for(var f in navigator)try{"string"==typeof navigator[f]&&(h+=navigator[f])}catch(d){}a.collect(h),h=null}e&&(e().mousemove((function(t){a.collectInt(t.clientX,16),a.collectInt(t.clientY,16)})),e().keypress((function(t){a.collectInt(t.charCode,8)})))}if(n.random)for(var f in a)n.random[f]=a[f];else n.random=a;n.random.createInstance=s,t.exports=n.random}("undefined"!==typeof jQuery?jQuery:null)},59857:(t,e,r)=>{var n=r(98942);r(94384);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],s=function(t,e){return t<<e&65535|(65535&t)>>16-e},a=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"===typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,o=t,s=t.length(),a=e,u=Math.ceil(a/8),c=255>>(7&a);for(r=s;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-s)&255]);for(o.setAt(128-u,i[o.at(128-u)&c]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(t,e,r){var i,u,c,l,h=!1,f=null,d=null,p=null,y=[];for(t=n.rc2.expandKey(t,e),c=0;c<64;c++)y.push(t.getInt16Le());r?(i=function(t){for(c=0;c<4;c++)t[c]+=y[l]+(t[(c+3)%4]&t[(c+2)%4])+(~t[(c+3)%4]&t[(c+1)%4]),t[c]=s(t[c],o[c]),l++},u=function(t){for(c=0;c<4;c++)t[c]+=y[63&t[(c+3)%4]]}):(i=function(t){for(c=3;c>=0;c--)t[c]=a(t[c],o[c]),t[c]-=y[l]+(t[(c+3)%4]&t[(c+2)%4])+(~t[(c+3)%4]&t[(c+1)%4]),l--},u=function(t){for(c=3;c>=0;c--)t[c]-=y[63&t[(c+3)%4]]});var g=function(t){var e=[];for(c=0;c<4;c++){var n=f.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),e.push(65535&n)}l=r?0:63;for(var i=0;i<t.length;i++)for(var o=0;o<t[i][0];o++)t[i][1](e);for(c=0;c<4;c++)null!==p&&(r?p.putInt16Le(e[c]):e[c]^=p.getInt16Le()),d.putInt16Le(e[c])},m=null;return m={start:function(t,e){t&&"string"===typeof t&&(t=n.util.createBuffer(t)),h=!1,f=n.util.createBuffer(),d=e||new n.util.createBuffer,p=t,m.output=d},update:function(t){for(h||f.putBuffer(t);f.length()>=8;)g([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(e&&(h=!0,m.update()),!r&&(e=0===f.length()))if(t)e=t(8,d,!r);else{var i=d.length(),o=d.at(i-1);o>i?e=!1:d.truncate(o)}return e}}};n.rc2.startEncrypting=function(t,e,r){var i=n.rc2.createEncryptionCipher(t,128);return i.start(e,r),i},n.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var i=n.rc2.createDecryptionCipher(t,128);return i.start(e,r),i},n.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},46712:(t,e,r)=>{var n=r(98942);if(r(20759),r(70217),r(54300),r(5209),r(7724),r(3688),r(94384),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(17111):null,s=n.asn1,a=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},y=function(t){var e;if(!(t.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=u.oids[t.algorithm];var n=s.oidToDer(e).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),o=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);o.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),o.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var a=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(o),i.value.push(a),s.toDer(i).getBytes()},g=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);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var s=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);s.compareTo(a)<0;)s=s.add(e.p);var u=s.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return u=u.multiply(o.modInverse(e.n)).mod(e.n)};function m(t,e,r){var i=n.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}i.putByte(0),i.putByte(r);var a,u=o-3-t.length;if(0===r||1===r){a=0===r?0:255;for(var c=0;c<u;++c)i.putByte(a)}else for(;u>0;){var l=0,h=n.random.getBytes(u);for(c=0;c<u;++c)0===(a=h.charCodeAt(c))?++l:i.putByte(a);u=l}return i.putByte(0),i.putBytes(t),i}function b(t,e,r,i){var o=Math.ceil(e.n.bitLength()/8),s=n.util.createBuffer(t),a=s.getByte(),u=s.getByte();if(0!==a||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&"undefined"===typeof i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=o-3-i;for(var l=0;l<c;++l)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++c}else if(2===u)for(c=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++c}if(0!==s.getByte()||c!==o-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function v(t,e,r){"function"===typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function s(){a(t.pBits,(function(e,n){return e?r(e):(t.p=n,null!==t.q?c(e,t.q):void a(t.qBits,c))}))}function a(t,e){n.prime.generateProbablePrime(t,o,e)}function c(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void s();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void a(t.qBits,c);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void a(t.qBits,c);var l=t.e.modInverse(t.phi);t.keys={privateKey:u.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:u.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(o.prng=e.prng),s()}function w(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0===(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128===(128&r.charCodeAt(1)))?r.substr(1):r}function _(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 E(t){return n.util.isNodejs&&"function"===typeof o[t]}function S(t){return"undefined"!==typeof a.globalScope&&"object"===typeof a.globalScope.crypto&&"object"===typeof a.globalScope.crypto.subtle&&"function"===typeof a.globalScope.crypto.subtle[t]}function I(t){return"undefined"!==typeof a.globalScope&&"object"===typeof a.globalScope.msCrypto&&"object"===typeof a.globalScope.msCrypto.subtle&&"function"===typeof a.globalScope.msCrypto.subtle[t]}function A(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i<e.length;++i)r[i]=e.charCodeAt(i);return r}u.rsa.encrypt=function(t,e,r){var o,s=r,a=Math.ceil(e.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,o=m(t,e,r)):(o=n.util.createBuffer()).putBytes(t);for(var u=new i(o.toHex(),16),c=g(u,e,s).toString(16),l=n.util.createBuffer(),h=a-Math.ceil(c.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(t,e,r,o){var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=s,a}var u=new i(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=g(u,e,r).toString(16),l=n.util.createBuffer(),h=s-Math.ceil(c.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(c)),!1!==o?b(l.getBytes(),e,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(t,e,r){"string"===typeof t&&(t=parseInt(t,10)),t=t||2048;var o,s=(r=r||{}).prng||n.random,a={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:t,rng:a,eInt:e||65537,e:new i(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},u.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,s=function(t,e){return t|e},a=+new Date,l=0;null===t.keys&&(e<=0||l<e);){if(0===t.state){var h=null===t.p?t.pBits:t.qBits,f=h-1;0===t.pqState?(t.num=new i(h,t.rng),t.num.testBit(f)||t.num.bitwiseTo(i.ONE.shiftLeft(f),s,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),o=0,++t.pqState):1===t.pqState?t.num.bitLength()>h?t.pqState=0:t.num.isProbablePrime(_(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var d=t.e.modInverse(t.phi);t.keys={privateKey:u.rsa.setPrivateKey(t.n,t.e,d,t.p,t.q,d.mod(t.p1),d.mod(t.q1),t.q.modInverse(t.p)),publicKey:u.rsa.setPublicKey(t.n,t.e)}}l+=(n=+new Date)-a,a=n}return null!==t.keys},u.rsa.generateKeyPair=function(t,e,r,i){if(1===arguments.length?"object"===typeof t?(r=t,t=void 0):"function"===typeof t&&(i=t,t=void 0):2===arguments.length?"number"===typeof t?"function"===typeof e?(i=e,e=void 0):"number"!==typeof e&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):3===arguments.length&&("number"===typeof e?"function"===typeof r&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(i){if(E("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(t,e,r){if(t)return i(t);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(e)})}));if(S("generateKey")&&S("exportKey"))return a.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:A(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(t){return a.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)})).then(void 0,(function(t){i(t)})).then((function(t){if(t){var e=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));i(null,{privateKey:e,publicKey:u.setRsaPublicKey(e.n,e.e)})}}));if(I("generateKey")&&I("exportKey")){var c=a.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:A(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=a.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){i(t)}},void(c.onerror=function(t){i(t)})}}else if(E("generateKeyPairSync")){var l=o.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var h=u.rsa.createKeyPairGenerationState(t,e,r);if(!i)return u.rsa.stepKeyPairGenerationState(h,0),h.keys;v(h,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"===typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return m(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"===typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(t,e,i,o){"string"===typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===o&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(t,e){e=b(e,r,!0);var i=s.fromDer(e,{parseAllBytes:o._parseAllDigestBytes}),a={},u=[];if(!s.validate(i,p,a,u))throw(c=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,c;var c,l=s.derToOid(a.algorithmIdentifier);if(l!==n.oids.md2&&l!==n.oids.md5&&l!==n.oids.sha1&&l!==n.oids.sha224&&l!==n.oids.sha256&&l!==n.oids.sha384&&l!==n.oids.sha512&&l!==n.oids["sha512-224"]&&l!==n.oids["sha512-256"])throw(c=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=l,c;return t===a.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(t,e){return t===(e=b(e,r,!0))}});var a=u.rsa.decrypt(e,r,!0,!1);return i.verify(t,a,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(t,e,r,i,o,s,a,c){var l={n:t,e:e,d:r,p:i,q:o,dP:s,dQ:a,qInv:c,decrypt:function(t,e,r){"string"===typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(t,l,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:b};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,l,!1)},sign:function(t,e){var r=!1;"string"===typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:y},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(t).getBytes())])},u.privateKeyFromAsn1=function(t){var e,r,o,a,c,f,d,p,y={},g=[];if(s.validate(t,l,y,g)&&(t=s.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(t,h,y,g)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return e=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),f=n.util.createBuffer(y.privateKeyExponent1).toHex(),d=n.util.createBuffer(y.privateKeyExponent2).toHex(),p=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(e,16),new i(r,16),new i(o,16),new i(a,16),new i(c,16),new i(f,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.qInv))])},u.publicKeyFromAsn1=function(t){var e={},r=[];if(s.validate(t,d,e,r)){var o,a=s.derToOid(e.publicKeyOid);if(a!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=a,o;t=e.rsaPublicKey}if(r=[],!s.validate(t,f,e,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(e.publicKeyModulus).toHex(),l=n.util.createBuffer(e.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(t)])])},u.publicKeyToRSAPublicKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.e))])}},6437:(t,e,r)=>{var n=r(98942);r(73547),r(94384);var i=t.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),s=!0);var t=null,e=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return e=n.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,s){"utf8"===s&&(o=n.util.encodeUtf8(o));var u=o.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),a(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(e.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(o.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(u=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(l>>>0),l=u>>>0;s.putInt32(l);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};a(f,r,s);var d=n.util.createBuffer();return d.putInt32(f.h0),d.putInt32(f.h1),d.putInt32(f.h2),d.putInt32(f.h3),d.putInt32(f.h4),d},i};var o=null,s=!1;function a(t,e,r){for(var n,i,o,s,a,u,c,l=r.length();l>=64;){for(i=t.h0,o=t.h1,s=t.h2,a=t.h3,u=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,n=(i<<5|i>>>27)+(a^o&(s^a))+u+1518500249+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<20;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(a^o&(s^a))+u+1518500249+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<32;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+1859775393+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<40;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+1859775393+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<60;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o&s|a&(o^s))+u+2400959708+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<80;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+3395469782+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+s|0,t.h3=t.h3+a|0,t.h4=t.h4+u|0,l-=64}}},46932:(t,e,r)=>{var n=r(98942);r(73547),r(94384);var i=t.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=[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],s=!0);var t=null,e=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return e=n.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,s){"utf8"===s&&(o=n.util.encodeUtf8(o));var a=o.length;i.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=a[1],a[1]=a[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(o),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(e.bytes());var a,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(o.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(a=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(l>>>0),l=a>>>0;s.putInt32(l);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(f,r,s);var d=n.util.createBuffer();return d.putInt32(f.h0),d.putInt32(f.h1),d.putInt32(f.h2),d.putInt32(f.h3),d.putInt32(f.h4),d.putInt32(f.h5),d.putInt32(f.h6),d.putInt32(f.h7),d},i};var o=null,s=!1,a=null;function u(t,e,r){for(var n,i,o,s,u,c,l,h,f,d,p,y,g,m=r.length();m>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(c=t.h0,l=t.h1,h=t.h2,f=t.h3,d=t.h4,p=t.h5,y=t.h6,g=t.h7,u=0;u<64;++u)o=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=c&l|h&(c^l),n=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(y^d&(p^y))+a[u]+e[u],g=y,y=p,p=d,d=f+n>>>0,f=h,h=l,l=c,c=n+(i=o+s)>>>0;t.h0=t.h0+c|0,t.h1=t.h1+l|0,t.h2=t.h2+h|0,t.h3=t.h3+f|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+g|0,m-=64}}},56345:(t,e,r)=>{var n=r(98942);r(73547),r(94384);var i=t.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var o=n.sha384=n.sha512.sha384=n.sha512.sha384||{};o.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=o,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(t){if(a||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),u=[[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]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],a=!0),"undefined"===typeof t&&(t="SHA-512"),!(t in c))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=c[t],r=null,i=n.util.createBuffer(),o=new Array(80),h=0;h<80;++h)o[h]=new Array(2);var f=64;switch(t){case"SHA-384":f=48;break;case"SHA-512/256":f=32;break;case"SHA-512/224":f=28}var d={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:f,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var t=d.messageLengthSize/4,o=0;o<t;++o)d.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(e.length);for(o=0;o<e.length;++o)r[o]=e[o].slice(0);return d}};return d.start(),d.update=function(t,e){"utf8"===e&&(t=n.util.encodeUtf8(t));var s=t.length;d.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var a=d.fullMessageLength.length-1;a>=0;--a)d.fullMessageLength[a]+=s[1],s[1]=s[0]+(d.fullMessageLength[a]/4294967296>>>0),d.fullMessageLength[a]=d.fullMessageLength[a]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(t),l(r,o,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var e=n.util.createBuffer();e.putBytes(i.bytes());var a,u=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;e.putBytes(s.substr(0,d.blockLength-u));for(var c=8*d.fullMessageLength[0],h=0;h<d.fullMessageLength.length-1;++h)c+=(a=8*d.fullMessageLength[h+1])/4294967296>>>0,e.putInt32(c>>>0),c=a>>>0;e.putInt32(c);var f=new Array(r.length);for(h=0;h<r.length;++h)f[h]=r[h].slice(0);l(f,o,e);var p,y=n.util.createBuffer();p="SHA-512"===t?f.length:"SHA-384"===t?f.length-2:f.length-4;for(h=0;h<p;++h)y.putInt32(f[h][0]),h===p-1&&"SHA-512/224"===t||y.putInt32(f[h][1]);return y},d};var s=null,a=!1,u=null,c=null;function l(t,e,r){for(var n,i,o,s,a,c,l,h,f,d,p,y,g,m,b,v,w,_,E,S,I,A,M,T,R,k,C,P,B,O,N,D,x,L=r.length();L>=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)n=(((P=(O=e[C-2])[0])>>>19|(B=O[1])<<13)^(B>>>29|P<<3)^P>>>6)>>>0,i=((P<<13|B>>>19)^(B<<3|P>>>29)^(P<<26|B>>>6))>>>0,o=(((P=(D=e[C-15])[0])>>>1|(B=D[1])<<31)^(P>>>8|B<<24)^P>>>7)>>>0,s=((P<<31|B>>>1)^(P<<24|B>>>8)^(P<<25|B>>>7))>>>0,N=e[C-7],x=e[C-16],B=i+N[1]+s+x[1],e[C][0]=n+N[0]+o+x[0]+(B/4294967296>>>0)>>>0,e[C][1]=B>>>0;for(p=t[0][0],y=t[0][1],g=t[1][0],m=t[1][1],b=t[2][0],v=t[2][1],w=t[3][0],_=t[3][1],E=t[4][0],S=t[4][1],I=t[5][0],A=t[5][1],M=t[6][0],T=t[6][1],R=t[7][0],k=t[7][1],C=0;C<80;++C)l=((E>>>14|S<<18)^(E>>>18|S<<14)^(S>>>9|E<<23))>>>0,h=(M^E&(I^M))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,f=(p&g|b&(p^g))>>>0,d=(y&m|v&(y^m))>>>0,B=k+(((E<<18|S>>>14)^(E<<14|S>>>18)^(S<<23|E>>>9))>>>0)+((T^S&(A^T))>>>0)+u[C][1]+e[C][1],n=R+l+h+u[C][0]+e[C][0]+(B/4294967296>>>0)>>>0,i=B>>>0,o=a+f+((B=c+d)/4294967296>>>0)>>>0,s=B>>>0,R=M,k=T,M=I,T=A,I=E,A=S,E=w+n+((B=_+i)/4294967296>>>0)>>>0,S=B>>>0,w=b,_=v,b=g,v=m,g=p,m=y,p=n+o+((B=i+s)/4294967296>>>0)>>>0,y=B>>>0;B=t[0][1]+y,t[0][0]=t[0][0]+p+(B/4294967296>>>0)>>>0,t[0][1]=B>>>0,B=t[1][1]+m,t[1][0]=t[1][0]+g+(B/4294967296>>>0)>>>0,t[1][1]=B>>>0,B=t[2][1]+v,t[2][0]=t[2][0]+b+(B/4294967296>>>0)>>>0,t[2][1]=B>>>0,B=t[3][1]+_,t[3][0]=t[3][0]+w+(B/4294967296>>>0)>>>0,t[3][1]=B>>>0,B=t[4][1]+S,t[4][0]=t[4][0]+E+(B/4294967296>>>0)>>>0,t[4][1]=B>>>0,B=t[5][1]+A,t[5][0]=t[5][0]+I+(B/4294967296>>>0)>>>0,t[5][1]=B>>>0,B=t[6][1]+T,t[6][0]=t[6][0]+M+(B/4294967296>>>0)>>>0,t[6][1]=B>>>0,B=t[7][1]+k,t[7][0]=t[7][0]+R+(B/4294967296>>>0)>>>0,t[7][1]=B>>>0,L-=128}}},94384:(t,e,r)=>{var n=r(21964),i=r(82161).Buffer,o=r(98942),s=r(91559),a=t.exports=o.util=o.util||{};function u(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function c(t){if(this.data="",this.read=0,"string"===typeof t)this.data=t;else if(a.isArrayBuffer(t)||a.isArrayBufferView(t))if("undefined"!==typeof i&&t instanceof i)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(n){for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof c||"object"===typeof t&&"string"===typeof t.data&&"number"===typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if("undefined"!==typeof n&&n.nextTick&&!n.browser)return a.nextTick=n.nextTick,void("function"===typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"===typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(t){return setImmediate(t)});if(a.setImmediate=function(t){setTimeout(t,0)},"undefined"!==typeof window&&"function"===typeof window.postMessage){var t="forge.setImmediate",e=[];a.setImmediate=function(r){e.push(r),1===e.length&&window.postMessage(t,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===t){r.stopPropagation();var n=e.slice();e.length=0,n.forEach((function(t){t()}))}}),!0)}if("undefined"!==typeof MutationObserver){var r=Date.now(),i=!0,o=document.createElement("div");e=[];new MutationObserver((function(){var t=e.slice();e.length=0,t.forEach((function(t){t()}))})).observe(o,{attributes:!0});var s=a.setImmediate;a.setImmediate=function(t){Date.now()-r>15?(r=Date.now(),s(t)):(e.push(t),1===e.length&&o.setAttribute("a",i=!i))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!==typeof n&&n.versions&&n.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"===typeof self?window:self,a.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},a.isArrayBuffer=function(t){return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer},a.isArrayBufferView=function(t){return t&&a.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},a.ByteBuffer=c,a.ByteStringBuffer=c;a.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},a.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},a.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},a.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(a.encodeUtf8(t))},a.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.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(255&t))},a.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},a.ByteStringBuffer.prototype.putInt=function(t,e){u(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},a.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},a.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},a.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},a.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},a.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},a.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},a.ByteStringBuffer.prototype.getInt=function(t){u(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},a.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},a.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):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.ByteStringBuffer.prototype.bytes=function(t){return"undefined"===typeof t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},a.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},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var t=a.createBuffer(this.data);return t.read=this.read,t},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},a.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},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=a.isArrayBuffer(t),n=a.isArrayBufferView(t);if(r||n)return this.data=r?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==t&&void 0!==t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.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},a.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},a.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},a.DataBuffer.prototype.putBytes=function(t,e){if(a.isArrayBufferView(t)){var r=(n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(t)){var n=new Uint8Array(t);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(t instanceof a.DataBuffer||"object"===typeof t&&"number"===typeof t.read&&"number"===typeof t.write&&a.isArrayBufferView(t.data)){n=new Uint8Array(t.data.byteLength,t.read,t.length());return this.accommodate(n.byteLength),new Uint8Array(t.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(t instanceof a.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"===typeof t){var i;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(t,i,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(t,i,this.write),this;if("utf8"===e&&(t=a.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===e)return this.accommodate(2*t.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},a.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},a.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},a.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},a.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},a.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},a.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},a.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(t,e){u(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},a.DataBuffer.prototype.putSignedInt=function(t,e){return u(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},a.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},a.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},a.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},a.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},a.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},a.DataBuffer.prototype.getInt=function(t){u(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},a.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},a.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):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.DataBuffer.prototype.bytes=function(t){return"undefined"===typeof t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},a.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var 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},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},a.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},a.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return a.binary.raw.encode(e);if("hex"===t)return a.binary.hex.encode(e);if("base64"===t)return a.binary.base64.encode(e);if("utf8"===t)return a.text.utf8.decode(e);if("utf16"===t)return a.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},a.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=a.encodeUtf8(t)),new a.ByteBuffer(t)},a.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},a.xorBytes=function(t,e,r){for(var n="",i="",o="",s=0,a=0;r>0;--r,++s)i=t.charCodeAt(s)^e.charCodeAt(s),a>=10&&(n+=o,o="",a=0),o+=String.fromCharCode(i),++a;return n+=o},a.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(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},a.bytesToHex=function(t){return a.createBuffer(t).toHex()},a.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[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],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(t,e){for(var r,n,i,o="",s="",a=0;a<t.length;)r=t.charCodeAt(a++),n=t.charCodeAt(a++),i=t.charCodeAt(a++),o+=l.charAt(r>>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+=o},a.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",s=0;s<t.length;)e=h[t.charCodeAt(s++)-43],r=h[t.charCodeAt(s++)-43],n=h[t.charCodeAt(s++)-43],i=h[t.charCodeAt(s++)-43],o+=String.fromCharCode(e<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},a.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},a.decodeUtf8=function(t){return decodeURIComponent(escape(t))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},a.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},a.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o<t.length;++o)n[i++]=t.charCodeAt(o);return e?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2)));var i=0,o=r=r||0;for(1&t.length&&(i=1,n[o++]=parseInt(t[0],16));i<t.length;i+=2)n[o++]=parseInt(t.substr(i,2),16);return e?o-r:n},a.binary.base64.encode=function(t,e){for(var r,n,i,o="",s="",a=0;a<t.byteLength;)r=t[a++],n=t[a++],i=t[a++],o+=l.charAt(r>>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+=o},a.binary.base64.decode=function(t,e,r){var n,i,o,s,a=e;a||(a=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<t.length;)n=h[t.charCodeAt(u++)-43],i=h[t.charCodeAt(u++)-43],o=h[t.charCodeAt(u++)-43],s=h[t.charCodeAt(u++)-43],a[c++]=n<<2|i>>4,64!==o&&(a[c++]=(15&i)<<4|o>>2,64!==s&&(a[c++]=(3&o)<<6|s));return e?c-r:a.subarray(0,c)},a.binary.base58.encode=function(t,e){return a.binary.baseN.encode(t,f,e)},a.binary.base58.decode=function(t,e){return a.binary.baseN.decode(t,f,e)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(t,e,r){t=a.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o<t.length;++o)n[i++]=t.charCodeAt(o);return e?i-r:n},a.text.utf8.decode=function(t){return a.decodeUtf8(String.fromCharCode.apply(null,t))},a.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(2*t.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,s=r,a=0;a<t.length;++a)i[s++]=t.charCodeAt(a),o+=2;return e?o-r:n},a.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},a.deflate=function(t,e,r){if(e=a.decode64(t.deflate(a.encode64(e)).rval),r){var n=2;32&e.charCodeAt(1)&&(n=6),e=e.substring(n,e.length-4)}return e},a.inflate=function(t,e,r){var n=t.inflate(a.encode64(e)).rval;return null===n?null:a.decode64(n)};var d=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(null===r?n=t.removeItem(e):(r=a.encode64(JSON.stringify(r)),n=t.setItem(e,r)),"undefined"!==typeof n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},p=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(null===r.rval){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 null!==r&&(r=JSON.parse(a.decode64(r))),r},y=function(t,e,r,n){var i=p(t,e);null===i&&(i={}),i[r]=n,d(t,e,i)},g=function(t,e,r){var n=p(t,e);return null!==n&&(n=r in n?n[r]:null),n},m=function(t,e,r){var n=p(t,e);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),d(t,e,n)}},b=function(t,e){d(t,e,null)},v=function(t,e,r){var n,i=null;"undefined"===typeof r&&(r=["web","flash"]);var o=!1,s=null;for(var a in r){n=r[a];try{if("flash"===n||"both"===n){if(null===e[0])throw new Error("Flash local storage not available.");i=t.apply(this,e),o="flash"===n}"web"!==n&&"both"!==n||(e[0]=localStorage,i=t.apply(this,e),o=!0)}catch(u){s=u}if(o)break}if(!o)throw s;return i};a.setItem=function(t,e,r,n,i){v(y,arguments,i)},a.getItem=function(t,e,r,n){return v(g,arguments,n)},a.removeItem=function(t,e,r,n){v(m,arguments,n)},a.clearItems=function(t,e,r){v(b,arguments,r)},a.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},a.format=function(t){for(var e,r,n=/%./g,i=0,o=[],s=0;e=n.exec(t);){(r=t.substring(s,n.lastIndex-2)).length>0&&o.push(r),s=n.lastIndex;var a=e[0][1];switch(a){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+a+"?>")}}return o.push(t.substring(s)),o.join("")},a.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,s=void 0===r?",":r,a=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+a:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(i-c).toFixed(o).slice(2):"")},a.formatSize=function(t){return t=t>=1073741824?a.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?a.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?a.formatNumber(t/1024,0)+" KiB":a.formatNumber(t,0)+" bytes"},a.bytesFromIP=function(t){return-1!==t.indexOf(".")?a.bytesFromIPv4(t):-1!==t.indexOf(":")?a.bytesFromIPv6(t):null},a.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=a.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()},a.bytesFromIPv6=function(t){for(var e=0,r=2*(8-(t=t.split(":").filter((function(t){return 0===t.length&&++e,!0}))).length+e),n=a.createBuffer(),i=0;i<8;++i)if(t[i]&&0!==t[i].length){var o=a.hexToBytes(t[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(t){return 4===t.length?a.bytesToIPv4(t):16===t.length?a.bytesToIPv6(t):null},a.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},a.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var o=a.bytesToHex(t[i]+t[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=e.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),0===c.start&&e.unshift(""),7===c.end&&e.push(""))}return e.join(":")},a.estimateCores=function(t,e){if("function"===typeof t&&(e=t,t={}),t=t||{},"cores"in a&&!t.update)return e(null,a.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,e(null,a.cores);if("undefined"===typeof Worker)return a.cores=1,e(null,a.cores);if("undefined"===typeof Blob)return a.cores=2,e(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(t){for(var e=Date.now(),r=e+4;Date.now()<r;);self.postMessage({st:e,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function t(n,i,o){if(0===i){var s=Math.floor(n.reduce((function(t,e){return t+e}),0)/n.length);return a.cores=Math.max(1,s),URL.revokeObjectURL(r),e(null,a.cores)}!function(t,e){for(var n=[],i=[],o=0;o<t;++o){var s=new Worker(r);s.addEventListener("message",(function(r){if(i.push(r.data),i.length===t){for(var o=0;o<t;++o)n[o].terminate();e(null,i)}})),n.push(s)}for(o=0;o<t;++o)n[o].postMessage(o)}(o,(function(e,r){n.push(function(t,e){for(var r=[],n=0;n<t;++n)for(var i=e[n],o=r[n]=[],s=0;s<t;++s)if(n!==s){var a=e[s];(i.st>a.st&&i.st<a.et||a.st>i.st&&a.st<i.et)&&o.push(s)}return r.reduce((function(t,e){return Math.max(t,e.length)}),0)}(o,r)),t(n,i-1,o)}))}([],5,16)}},16982:(t,e,r)=>{"use strict";const n=r(67963),i={16:"aes-128-ctr",32:"aes-256-ctr"};t.exports=function(t){const e=i[t.length];if(!e){const e=Object.entries(i).map((t=>{let[e,r]=t;return"".concat(e," (").concat(r,")")})).join(" / ");throw n(new Error("Invalid key length ".concat(t.length," bytes. Must be ").concat(e)),"ERR_INVALID_KEY_LENGTH")}return e}},12808:(t,e,r)=>{"use strict";r(40110);const n=r(98942),{toString:i}=r(82051),{fromString:o}=r(46765);t.exports={createCipheriv:(t,e,r)=>{const s=n.cipher.createCipher("AES-CTR",i(e,"ascii"));return s.start({iv:i(r,"ascii")}),{update:t=>(s.update(n.util.createBuffer(i(t,"ascii"))),o(s.output.getBytes(),"ascii"))}},createDecipheriv:(t,e,r)=>{const s=n.cipher.createDecipher("AES-CTR",i(e,"ascii"));return s.start({iv:i(r,"ascii")}),{update:t=>(s.update(n.util.createBuffer(i(t,"ascii"))),o(s.output.getBytes(),"ascii"))}}}},94421:(t,e,r)=>{"use strict";const n=r(12808),i=r(16982);e.create=async function(t,e){const r=i(t),o=n.createCipheriv(r,t,e),s=n.createDecipheriv(r,t,e);return{encrypt:async t=>o.update(t),decrypt:async t=>s.update(t)}}},88279:(t,e,r)=>{"use strict";const{concat:n}=r(62110),{fromString:i}=r(46765),o=r(35288);t.exports={create:function(){let{algorithm:t="AES-GCM",nonceLength:e=12,keyLength:r=16,digest:s="SHA-256",saltLength:a=16,iterations:u=32767}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=o.get();async function l(o,l){const h=c.getRandomValues(new Uint8Array(a)),f=c.getRandomValues(new Uint8Array(e)),d={name:t,iv:f},p={name:"PBKDF2",salt:h,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(l),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:t,length:r},!0,["encrypt"]),m=await c.subtle.encrypt(d,g,o);return n([h,d.iv,new Uint8Array(m)])}async function h(n,o){const l=n.slice(0,a),h=n.slice(a,a+e),f=n.slice(a+e),d={name:t,iv:h},p={name:"PBKDF2",salt:l,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(o),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:t,length:r},!0,["decrypt"]),m=await c.subtle.decrypt(d,g,f);return new Uint8Array(m)}return r*=8,{encrypt:l,decrypt:h}}}},59938:(t,e,r)=>{"use strict";const n=r(35288),i=r(42830),o={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};e.create=async function(t,e){const r=o[t],s=await n.get().subtle.importKey("raw",e,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{digest:async t=>(async(t,e)=>{const r=await n.get().subtle.sign({name:"HMAC"},t,e);return new Uint8Array(r,r.byteOffset,r.byteLength)})(s,t),length:i[t]}}},42830:t=>{"use strict";t.exports={SHA1:20,SHA256:32,SHA512:64}},25504:(t,e,r)=>{"use strict";const n=r(59938),i=r(94421),o=r(36552);e.aes=i,e.hmac=n,e.keys=o,e.randomBytes=r(31158),e.pbkdf2=r(68037)},77129:(t,e,r)=>{"use strict";const n=r(67963),i=r(35288),{base64urlToBuffer:o}=r(12545),s=r(59846),{toString:a}=r(82051),{concat:u}=r(62110),{equals:c}=r(98779),l={"P-256":256,"P-384":384,"P-521":521};e.generateEphmeralKeyPair=async function(t){s(Object.keys(l),t);const e=await i.get().subtle.generateKey({name:"ECDH",namedCurve:t},!0,["deriveBits"]);return{key:f(await i.get().subtle.exportKey("jwk",e.publicKey)),genSharedKey:async(r,n)=>{let o;o=n?await i.get().subtle.importKey("jwk",p(t,n),{name:"ECDH",namedCurve:t},!1,["deriveBits"]):e.privateKey;const s=[await i.get().subtle.importKey("jwk",d(t,r),{name:"ECDH",namedCurve:t},!1,[]),o],a=await i.get().subtle.deriveBits({name:"ECDH",namedCurve:t,public:s[0]},s[1],l[t]);return new Uint8Array(a,a.byteOffset,a.byteLength)}}};const h={"P-256":32,"P-384":48,"P-521":66};function f(t){const e=h[t.crv];return u([Uint8Array.from([4]),o(t.x,e),o(t.y,e)],1+2*e)}function d(t,e){const r=h[t];if(c(!e.slice(0,1),Uint8Array.from([4])))throw n(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:t,x:a(e.slice(1,r+1),"base64url"),y:a(e.slice(1+r),"base64url"),ext:!0}}const p=(t,e)=>({...d(t,e.public),d:a(e.private,"base64url")})},61492:(t,e,r)=>{"use strict";const n=r(67963),{equals:i}=r(98779),{sha256:o}=r(19400),{base58btc:s}=r(86898),{identity:a}=r(60173),u=r(66556),c=r(67796),l=r(43437);class h{constructor(t){this._key=d(t,u.publicKeyLength)}async verify(t,e){return u.hashAndVerify(this._key,e,t)}marshal(){return this._key}get bytes(){return c.PublicKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(t){return i(this.bytes,t.bytes)}async hash(){const{bytes:t}=await o.digest(this.bytes);return t}}class f{constructor(t,e){this._key=d(t,u.privateKeyLength),this._publicKey=d(e,u.publicKeyLength)}async sign(t){return u.hashAndSign(this._key,t)}get public(){return new h(this._publicKey)}marshal(){return this._key}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(t){return i(this.bytes,t.bytes)}async hash(){const{bytes:t}=await o.digest(this.bytes);return t}async id(){const t=await a.digest(this.public.bytes);return s.encode(t.bytes).substring(1)}async export(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===e)return l.export(this.bytes,t);throw n(new Error("export format '".concat(e,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}function d(t,e){if((t=Uint8Array.from(t||[])).length!==e)throw n(new Error("Key must be a Uint8Array of length ".concat(e,", got ").concat(t.length)),"ERR_INVALID_KEY_TYPE");return t}t.exports={Ed25519PublicKey:h,Ed25519PrivateKey:f,unmarshalEd25519PrivateKey:function(t){if(t.length>u.privateKeyLength){const e=(t=d(t,u.privateKeyLength+u.publicKeyLength)).slice(0,u.privateKeyLength),r=t.slice(u.privateKeyLength,t.length);return new f(e,r)}const e=(t=d(t,u.privateKeyLength)).slice(0,u.privateKeyLength),r=t.slice(u.publicKeyLength);return new f(e,r)},unmarshalEd25519PublicKey:function(t){return t=d(t,u.publicKeyLength),new h(t)},generateKeyPair:async function(){const{privateKey:t,publicKey:e}=await u.generateKey();return new f(t,e)},generateKeyPairFromSeed:async function(t){const{privateKey:e,publicKey:r}=await u.generateKeyFromSeed(t);return new f(e,r)}}},66556:(t,e,r)=>{"use strict";const n=r(47835);function i(t,r){const n=new Uint8Array(e.privateKeyLength);for(let e=0;e<32;e++)n[e]=t[e],n[32+e]=r[e];return n}e.publicKeyLength=32,e.privateKeyLength=64,e.generateKey=async function(){const t=n.utils.randomPrivateKey(),e=await n.getPublicKey(t);return{privateKey:i(t,e),publicKey:e}},e.generateKeyFromSeed=async function(t){if(32!==t.length)throw new TypeError('"seed" must be 32 bytes in length.');if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');const e=t,r=await n.getPublicKey(e);return{privateKey:i(e,r),publicKey:r}},e.hashAndSign=function(t,e){const r=t.slice(0,32);return n.sign(e,r)},e.hashAndVerify=function(t,e,r){return n.verify(e,r,t)}},89097:(t,e,r)=>{"use strict";const n=r(77129);t.exports=async t=>n.generateEphmeralKeyPair(t)},43437:(t,e,r)=>{"use strict";const{base64:n}=r(24426),i=r(88279);t.exports={export:async function(t,e){const r=i.create(),o=await r.encrypt(t,e);return n.encode(o)}}},47975:(t,e,r)=>{"use strict";const{base64:n}=r(24426),i=r(88279);t.exports={import:async function(t,e){const r=n.decode(t),o=i.create();return await o.decrypt(r,e)}}},36552:(t,e,r)=>{"use strict";const n=r(67796);r(20759),r(37202);const i=r(98942),o=r(67963),{fromString:s}=r(46765),a=r(47975),u={rsa:r(14188),ed25519:r(61492),secp256k1:r(93154)(n,r(31158))},c="secp256k1 support requires libp2p-crypto-secp256k1 package",l="ERR_MISSING_PACKAGE";function h(t){const e=u[t.toLowerCase()];if(!e){const e=Object.keys(u).join(" / ");throw o(new Error("invalid or unsupported key type ".concat(t,". Must be ").concat(e)),"ERR_UNSUPPORTED_KEY_TYPE")}return e}const f=async t=>{const e=n.PrivateKey.decode(t),r=e.Data;switch(e.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPrivateKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PrivateKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PrivateKey(r);throw o(new Error(c),l);default:h(e.Type)}};t.exports={supportedKeys:u,keysPBM:n,keyStretcher:r(52936),generateEphemeralKeyPair:r(89097),generateKeyPair:async(t,e)=>h(t).generateKeyPair(e),generateKeyPairFromSeed:async(t,e,r)=>{const n=h(t);if("ed25519"!==t.toLowerCase())throw o(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return n.generateKeyPairFromSeed(e,r)},unmarshalPublicKey:t=>{const e=n.PublicKey.decode(t),r=e.Data;switch(e.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPublicKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PublicKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PublicKey(r);throw o(new Error(c),l);default:h(e.Type)}},marshalPublicKey:(t,e)=>(h(e=(e||"rsa").toLowerCase()),t.bytes),unmarshalPrivateKey:f,marshalPrivateKey:(t,e)=>(h(e=(e||"rsa").toLowerCase()),t.bytes),import:async(t,e)=>{try{const r=await a.import(t,e);return f(r)}catch(c){}const r=i.pki.decryptRsaPrivateKey(t,e);if(null===r)throw o(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let n=i.asn1.toDer(i.pki.privateKeyToAsn1(r));return n=s(n.getBytes(),"ascii"),u.rsa.unmarshalRsaPrivateKey(n)}}},15025:(t,e,r)=>{"use strict";r(46712);const n=r(98942),{base64urlToBigInteger:i}=r(12545);function o(t,e){return e.map((e=>i(t[e])))}t.exports={jwk2pub:function(t){return n.pki.setRsaPublicKey(...o(t,["n","e"]))},jwk2priv:function(t){return n.pki.setRsaPrivateKey(...o(t,["n","e","d","p","q","dp","dq","qi"]))}}},52936:(t,e,r)=>{"use strict";const n=r(67963),{concat:i}=r(62110),{fromString:o}=r(46765),s=r(59938),a={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};t.exports=async(t,e,r)=>{const u=a[t];if(!u){const e=Object.keys(a).join(" / ");throw n(new Error("unknown cipher type '".concat(t,"'. Must be ").concat(e)),"ERR_INVALID_CIPHER_TYPE")}if(!e)throw n(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");const c=u.keySize,l=u.ivSize,h=o("key expansion"),f=2*(l+c+20),d=await s.create(e,r);let p=await d.digest(h);const y=[];let g=0;for(;g<f;){const t=await d.digest(i([p,h]));let e=t.length;g+e>f&&(e=f-g),y.push(t),g+=e,p=await d.digest(p)}const m=f/2,b=i(y),v=b.slice(0,m),w=b.slice(m,f),_=t=>({iv:t.slice(0,l),cipherKey:t.slice(l,l+c),macKey:t.slice(l+c)});return{k1:_(v),k2:_(w)}}},67796:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});a.KeyType=function(){var t={},e=Object.create(t);return e[t[0]="RSA"]=0,e[t[1]="Ed25519"]=1,e[t[2]="Secp256k1"]=2,e}(),a.PublicKey=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.Type=0,t.prototype.Data=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),e.uint32(8).int32(t.Type),e.uint32(18).bytes(t.Data),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.PublicKey;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.Type=t.int32();break;case 2:n.Data=t.bytes();break;default:t.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},t.fromObject=function(t){if(t instanceof a.PublicKey)return t;var e=new a.PublicKey;switch(t.Type){case"RSA":case 0:e.Type=0;break;case"Ed25519":case 1:e.Type=1;break;case"Secp256k1":case 2:e.Type=2}return null!=t.Data&&("string"===typeof t.Data?s.base64.decode(t.Data,e.Data=s.newBuffer(s.base64.length(t.Data)),0):t.Data.length&&(e.Data=t.Data)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.Type=e.enums===String?"RSA":0,e.bytes===String?r.Data="":(r.Data=[],e.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=t.Type&&t.hasOwnProperty("Type")&&(r.Type=e.enums===String?a.KeyType[t.Type]:t.Type),null!=t.Data&&t.hasOwnProperty("Data")&&(r.Data=e.bytes===String?s.base64.encode(t.Data,0,t.Data.length):e.bytes===Array?Array.prototype.slice.call(t.Data):t.Data),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),a.PrivateKey=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.Type=0,t.prototype.Data=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),e.uint32(8).int32(t.Type),e.uint32(18).bytes(t.Data),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.PrivateKey;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.Type=t.int32();break;case 2:n.Data=t.bytes();break;default:t.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},t.fromObject=function(t){if(t instanceof a.PrivateKey)return t;var e=new a.PrivateKey;switch(t.Type){case"RSA":case 0:e.Type=0;break;case"Ed25519":case 1:e.Type=1;break;case"Secp256k1":case 2:e.Type=2}return null!=t.Data&&("string"===typeof t.Data?s.base64.decode(t.Data,e.Data=s.newBuffer(s.base64.length(t.Data)),0):t.Data.length&&(e.Data=t.Data)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.Type=e.enums===String?"RSA":0,e.bytes===String?r.Data="":(r.Data=[],e.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=t.Type&&t.hasOwnProperty("Type")&&(r.Type=e.enums===String?a.KeyType[t.Type]:t.Type),null!=t.Data&&t.hasOwnProperty("Data")&&(r.Data=e.bytes===String?s.base64.encode(t.Data,0,t.Data.length):e.bytes===Array?Array.prototype.slice.call(t.Data):t.Data),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t.exports=a},73545:(t,e,r)=>{"use strict";const n=r(35288),i=r(31158),{toString:o}=r(82051),{fromString:s}=r(46765);function a(t){return Promise.all([n.get().subtle.exportKey("jwk",t.privateKey),n.get().subtle.exportKey("jwk",t.publicKey)])}e.utils=r(27367),e.generateKey=async function(t){const e=await n.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await a(e);return{privateKey:r[0],publicKey:r[1]}},e.unmarshalPrivateKey=async function(t){const e=[await n.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await(r=t,n.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]))];var r;const i=await a({privateKey:e[0],publicKey:e[1]});return{privateKey:i[0],publicKey:i[1]}},e.getRandomValues=i,e.hashAndSign=async function(t,e){const r=await n.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),i=await n.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return new Uint8Array(i,i.byteOffset,i.byteLength)},e.hashAndVerify=async function(t,e,r){const i=await n.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return n.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,e,r)};const{jwk2pub:u,jwk2priv:c}=r(15025);function l(t,e,r,n){const i=e?u(t):c(t),a=n(o(Uint8Array.from(r),"ascii"),i);return s(a,"ascii")}e.encrypt=function(t,e){return l(t,!0,e,((t,e)=>e.encrypt(t)))},e.decrypt=function(t,e){return l(t,!1,e,((t,e)=>e.decrypt(t)))}},14188:(t,e,r)=>{"use strict";const{sha256:n}=r(19400),i=r(67963),{equals:o}=r(98779),{toString:s}=r(82051);r(56345);const a=r(98942),u=r(73545),c=r(67796),l=r(43437);class h{constructor(t){this._key=t}async verify(t,e){return u.hashAndVerify(this._key,e,t)}marshal(){return u.utils.jwkToPkix(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}encrypt(t){return u.encrypt(this._key,t)}equals(t){return o(this.bytes,t.bytes)}async hash(){const{bytes:t}=await n.digest(this.bytes);return t}}class f{constructor(t,e){this._key=t,this._publicKey=e}genSecret(){return u.getRandomValues(16)}async sign(t){return u.hashAndSign(this._key,t)}get public(){if(!this._publicKey)throw i(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new h(this._publicKey)}decrypt(t){return u.decrypt(this._key,t)}marshal(){return u.utils.jwkToPkcs1(this._key)}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}equals(t){return o(this.bytes,t.bytes)}async hash(){const{bytes:t}=await n.digest(this.bytes);return t}async id(){const t=await this.public.hash();return s(t,"base58btc")}async export(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pkcs-8";if("pkcs-8"===e){const e=new a.util.ByteBuffer(this.marshal()),r=a.asn1.fromDer(e),n=a.pki.privateKeyFromAsn1(r),i={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};return a.pki.encryptRsaPrivateKey(n,t,i)}if("libp2p-key"===e)return l.export(this.bytes,t);throw i(new Error("export format '".concat(e,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}t.exports={RsaPublicKey:h,RsaPrivateKey:f,unmarshalRsaPublicKey:function(t){const e=u.utils.pkixToJwk(t);return new h(e)},unmarshalRsaPrivateKey:async function(t){const e=u.utils.pkcs1ToJwk(t),r=await u.unmarshalPrivateKey(e);return new f(r.privateKey,r.publicKey)},generateKeyPair:async function(t){const e=await u.generateKey(t);return new f(e.privateKey,e.publicKey)},fromJwk:async function(t){const e=await u.unmarshalPrivateKey(t);return new f(e.privateKey,e.publicKey)}}},27367:(t,e,r)=>{"use strict";r(20759),r(46712);const n=r(98942),{bigIntegerToUintBase64url:i,base64urlToBigInteger:o}=r(12545),{fromString:s}=r(46765),{toString:a}=r(82051);e.pkcs1ToJwk=function(t){const e=n.asn1.fromDer(a(t,"ascii")),r=n.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:i(r.n),e:i(r.e),d:i(r.d),p:i(r.p),q:i(r.q),dp:i(r.dP),dq:i(r.dQ),qi:i(r.qInv),alg:"RS256",kid:"2011-04-29"}},e.jwkToPkcs1=function(t){const e=n.pki.privateKeyToAsn1({n:o(t.n),e:o(t.e),d:o(t.d),p:o(t.p),q:o(t.q),dP:o(t.dp),dQ:o(t.dq),qInv:o(t.qi)});return s(n.asn1.toDer(e).getBytes(),"ascii")},e.pkixToJwk=function(t){const e=n.asn1.fromDer(a(t,"ascii")),r=n.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:i(r.n),e:i(r.e),alg:"RS256",kid:"2011-04-29"}},e.jwkToPkix=function(t){const e=n.pki.publicKeyToAsn1({n:o(t.n),e:o(t.e)});return s(n.asn1.toDer(e).getBytes(),"ascii")}},93154:(t,e,r)=>{"use strict";const{sha256:n}=r(19400),i=r(67963),{equals:o}=r(98779),{toString:s}=r(82051),a=r(43437);t.exports=(t,e,u)=>{u=u||r(96932)();class c{constructor(t){u.validatePublicKey(t),this._key=t}verify(t,e){return u.hashAndVerify(this._key,e,t)}marshal(){return u.compressPublicKey(this._key)}get bytes(){return t.PublicKey.encode({Type:t.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(t){return o(this.bytes,t.bytes)}async hash(){const{bytes:t}=await n.digest(this.bytes);return t}}class l{constructor(t,e){this._key=t,this._publicKey=e||u.computePublicKey(t),u.validatePrivateKey(this._key),u.validatePublicKey(this._publicKey)}sign(t){return u.hashAndSign(this._key,t)}get public(){return new c(this._publicKey)}marshal(){return this._key}get bytes(){return t.PrivateKey.encode({Type:t.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(t){return o(this.bytes,t.bytes)}async hash(){const{bytes:t}=await n.digest(this.bytes);return t}async id(){const t=await this.public.hash();return s(t,"base58btc")}async export(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===e)return a.export(this.bytes,t);throw i(new Error("export format '".concat(e,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}return{Secp256k1PublicKey:c,Secp256k1PrivateKey:l,unmarshalSecp256k1PrivateKey:function(t){return new l(t)},unmarshalSecp256k1PublicKey:function(t){return new c(t)},generateKeyPair:async function(){const t=await u.generateKey();return new l(t)}}}},96932:(t,e,r)=>{"use strict";const n=r(67963),i=r(53845),{sha256:o}=r(19400);t.exports=()=>({generateKey:function(){return i.utils.randomPrivateKey()},privateKeyLength:32,hashAndSign:async function(t,e){const{digest:r}=await o.digest(e);try{return await i.sign(r,t)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},hashAndVerify:async function(t,e,r){try{const{digest:n}=await o.digest(r);return i.verify(e,n,t)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},compressPublicKey:function(t){return i.Point.fromHex(t).toRawBytes(!0)},decompressPublicKey:function(t){return i.Point.fromHex(t).toRawBytes(!1)},validatePrivateKey:function(t){try{i.getPublicKey(t,!0)}catch(e){throw n(e,"ERR_INVALID_PRIVATE_KEY")}},validatePublicKey:function(t){try{i.Point.fromHex(t)}catch(e){throw n(e,"ERR_INVALID_PUBLIC_KEY")}},computePublicKey:function(t){try{return i.getPublicKey(t,!0)}catch(e){throw n(e,"ERR_INVALID_PRIVATE_KEY")}}})},59846:(t,e,r)=>{"use strict";const n=r(67963);t.exports=function(t,e){if(!t.includes(e)){const r=t.join(" / ");throw n(new Error("Unknown curve: ".concat(e,". Must be ").concat(r)),"ERR_INVALID_CURVE")}}},68037:(t,e,r)=>{"use strict";const n=r(27033),i=r(94384),o=r(67963),s={sha1:"sha1","sha2-256":"sha256","sha2-512":"sha512"};t.exports=function(t,e,r,a,u){const c=s[u];if(!c){const t=Object.keys(s).join(" / ");throw o(new Error("Hash '".concat(u,"' is unknown or not supported. Must be ").concat(t)),"ERR_UNSUPPORTED_HASH_TYPE")}const l=n(t,e,r,a,c);return i.encode64(l)}},31158:(t,e,r)=>{"use strict";const n=r(25410),i=r(67963);t.exports=function(t){if(isNaN(t)||t<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(t)}},12545:(t,e,r)=>{"use strict";r(94384),r(70217);const n=r(98942),{fromString:i}=r(46765),{toString:o}=r(82051),{concat:s}=r(62110);e.bigIntegerToUintBase64url=(t,e)=>{let r=Uint8Array.from(t.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=e){if(r.length>e)throw new Error("byte array longer than desired length");r=s([new Uint8Array(e-r.length),r])}return o(r,"base64url")},e.base64urlToBigInteger=t=>{const r=e.base64urlToBuffer(t);return new n.jsbn.BigInteger(o(r,"base16"),16)},e.base64urlToBuffer=(t,e)=>{let r=i(t,"base64urlpad");if(null!=e){if(r.length>e)throw new Error("byte array longer than desired length");r=s([new Uint8Array(e-r.length),r])}return r}},35288:(t,e)=>{"use strict";e.get=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis;const e=t.crypto;if(!e||!e.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}},66759:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ACCEPT_FROM_WHITELIST_DURATION_MS=e.ACCEPT_FROM_WHITELIST_MAX_MESSAGES=e.ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE=e.ERR_TOPIC_VALIDATOR_IGNORE=e.ERR_TOPIC_VALIDATOR_REJECT=e.TimeCacheDuration=e.GossipsubSeenTTL=e.GossipsubIWantFollowupTime=e.GossipsubMaxIHaveMessages=e.GossipsubMaxIHaveLength=e.GossipsubGraftFloodThreshold=e.GossipsubOpportunisticGraftPeers=e.GossipsubOpportunisticGraftTicks=e.GossipsubDirectConnectInitialDelay=e.GossipsubDirectConnectTicks=e.GossipsubConnectionTimeout=e.GossipsubMaxPendingConnections=e.GossipsubConnectors=e.GossipsubPruneBackoffTicks=e.GossipsubPruneBackoff=e.GossipsubPrunePeers=e.GossipsubFanoutTTL=e.GossipsubHeartbeatInterval=e.GossipsubHeartbeatInitialDelay=e.GossipsubGossipRetransmission=e.GossipsubGossipFactor=e.GossipsubDlazy=e.GossipsubHistoryGossip=e.GossipsubHistoryLength=e.GossipsubDout=e.GossipsubDscore=e.GossipsubDhi=e.GossipsubDlo=e.GossipsubD=e.GossipsubIDv11=e.GossipsubIDv10=e.FloodsubID=e.minute=e.second=void 0,e.second=1e3,e.minute=60*e.second,e.FloodsubID="/floodsub/1.0.0",e.GossipsubIDv10="/meshsub/1.0.0",e.GossipsubIDv11="/meshsub/1.1.0",e.GossipsubD=6,e.GossipsubDlo=4,e.GossipsubDhi=12,e.GossipsubDscore=4,e.GossipsubDout=2,e.GossipsubHistoryLength=5,e.GossipsubHistoryGossip=3,e.GossipsubDlazy=6,e.GossipsubGossipFactor=.25,e.GossipsubGossipRetransmission=3,e.GossipsubHeartbeatInitialDelay=100,e.GossipsubHeartbeatInterval=e.second,e.GossipsubFanoutTTL=e.minute,e.GossipsubPrunePeers=16,e.GossipsubPruneBackoff=e.minute,e.GossipsubPruneBackoffTicks=15,e.GossipsubConnectors=8,e.GossipsubMaxPendingConnections=128,e.GossipsubConnectionTimeout=30*e.second,e.GossipsubDirectConnectTicks=300,e.GossipsubDirectConnectInitialDelay=e.second,e.GossipsubOpportunisticGraftTicks=60,e.GossipsubOpportunisticGraftPeers=2,e.GossipsubGraftFloodThreshold=10*e.second,e.GossipsubMaxIHaveLength=5e3,e.GossipsubMaxIHaveMessages=10,e.GossipsubIWantFollowupTime=3*e.second,e.GossipsubSeenTTL=30*e.second,e.TimeCacheDuration=12e4,e.ERR_TOPIC_VALIDATOR_REJECT="ERR_TOPIC_VALIDATOR_REJECT",e.ERR_TOPIC_VALIDATOR_IGNORE="ERR_TOPIC_VALIDATOR_IGNORE",e.ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE=0,e.ACCEPT_FROM_WHITELIST_MAX_MESSAGES=128,e.ACCEPT_FROM_WHITELIST_DURATION_MS=1e3},60622:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGossipPeers=void 0;const n=r(53357);e.getGossipPeers=function(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>!0;const o=t.topics.get(e);if(!o)return new Set;let s=[];return o.forEach((e=>{const r=t.peers.get(e);r&&n.hasGossipProtocol(r.protocol)&&i(e)&&s.push(e)})),s=n.shuffle(s),r>0&&s.length>r&&(s=s.slice(0,r)),new Set(s)}},93234:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Heartbeat=void 0;const s=o(r(66759)),a=r(60622),u=r(53357);e.Heartbeat=class{constructor(t){this.gossipsub=t}start(){if(this._heartbeatTimer)return;const t=this._heartbeat.bind(this),e=setTimeout((()=>{t(),this._heartbeatTimer.runPeriodically(t,this.gossipsub._options.heartbeatInterval)}),s.GossipsubHeartbeatInitialDelay);this._heartbeatTimer={_intervalId:void 0,runPeriodically:(t,e)=>{this._heartbeatTimer._intervalId=setInterval(t,e)},cancel:()=>{clearTimeout(e),clearInterval(this._heartbeatTimer._intervalId)}}}stop(){this._heartbeatTimer&&(this._heartbeatTimer.cancel(),this._heartbeatTimer=null)}_heartbeat(){const{D:t,Dlo:e,Dhi:r,Dscore:n,Dout:i,fanoutTTL:o}=this.gossipsub._options;this.gossipsub.heartbeatTicks++;const c=new Map,l=t=>{let e=c.get(t);return void 0===e&&(e=this.gossipsub.score.score(t),c.set(t,e)),e},h=new Map,f=new Map,d=new Map;this.gossipsub._clearBackoff(),this.gossipsub.peerhave.clear(),this.gossipsub.iasked.clear(),this.gossipsub._applyIwantPenalties(),this.gossipsub._directConnect(),this.gossipsub.mesh.forEach(((o,c)=>{const p=t=>{this.gossipsub.log("HEARTBEAT: Remove mesh link to %s in %s",t,c),this.gossipsub.score.prune(t,c),this.gossipsub._addBackoff(t,c),o.delete(t);const e=f.get(t);e?e.push(c):f.set(t,[c])},y=t=>{this.gossipsub.log("HEARTBEAT: Add mesh link to %s in %s",t,c),this.gossipsub.score.graft(t,c),o.add(t);const e=h.get(t);e?e.push(c):h.set(t,[c])};if(o.forEach((t=>{const e=l(t);e<0&&(this.gossipsub.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",t,e,c),p(t),d.set(t,!0))})),o.size<e){const e=this.gossipsub.backoff.get(c),r=t-o.size;a.getGossipPeers(this.gossipsub,c,r,(t=>!o.has(t)&&!this.gossipsub.direct.has(t)&&(!e||!e.has(t))&&l(t)>=0)).forEach(y)}if(o.size>r){let e=Array.from(o);e.sort(((t,e)=>l(e)-l(t))),e=e.slice(0,n).concat(u.shuffle(e.slice(n)));let r=0;if(e.slice(0,t).forEach((t=>{this.gossipsub.outbound.get(t)&&r++})),r<i){const n=t=>{const r=e[t];for(let n=t;n>0;n--)e[n]=e[n-1];e[0]=r};if(r>0){let i=r;for(let r=1;r<t&&i>0;r++)this.gossipsub.outbound.get(e[r])&&(n(r),i--)}let i=t-r;for(let r=t;r<e.length&&i>0;r++)this.gossipsub.outbound.get(e[r])&&(n(r),i--)}e.slice(t).forEach(p)}if(o.size>=e){let t=0;if(o.forEach((e=>{this.gossipsub.outbound.get(e)&&t++})),t<i){const e=i-t,r=this.gossipsub.backoff.get(c);a.getGossipPeers(this.gossipsub,c,e,(t=>!o.has(t)&&!this.gossipsub.direct.has(t)&&(!r||!r.has(t))&&l(t)>=0)).forEach(y)}}if(this.gossipsub.heartbeatTicks%s.GossipsubOpportunisticGraftTicks===0&&o.size>1){const t=Array.from(o).sort(((t,e)=>l(t)-l(e))),e=Math.floor(o.size/2),r=l(t[e]);if(r<this.gossipsub._options.scoreThresholds.opportunisticGraftThreshold){const t=this.gossipsub.backoff.get(c);a.getGossipPeers(this.gossipsub,c,s.GossipsubOpportunisticGraftPeers,(e=>o.has(e)&&!this.gossipsub.direct.has(e)&&(!t||!t.has(e))&&l(e)>r)).forEach((t=>{this.gossipsub.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",t,c),y(t)}))}}this.gossipsub._emitGossip(c,o)}));const p=this.gossipsub._now();this.gossipsub.lastpub.forEach(((t,e)=>{t+o<p&&(this.gossipsub.fanout.delete(e),this.gossipsub.lastpub.delete(e))})),this.gossipsub.fanout.forEach(((e,r)=>{const n=this.gossipsub.topics.get(r);if(e.forEach((t=>{(!n.has(t)||l(t)<this.gossipsub._options.scoreThresholds.publishThreshold)&&e.delete(t)})),e.size<t){const n=t-e.size;a.getGossipPeers(this.gossipsub,r,n,(t=>!e.has(t)&&!this.gossipsub.direct.has(t)&&l(t)>=this.gossipsub._options.scoreThresholds.publishThreshold)).forEach((t=>{e.add(t)}))}this.gossipsub._emitGossip(r,e)})),this.gossipsub._sendGraftPrune(h,f,d),this.gossipsub._flush(),this.gossipsub.messageCache.shift(),this.gossipsub.emit("gossipsub:heartbeat")}}},37976:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const a=o(r(4782)),u=r(45075),c=r(83519),l=o(r(66759)),h=r(93234),f=r(60622),d=r(53357),p=r(63789),y=r(61390),g=r(46561),m=r(90190),b=r(76869),v=r(66759);class w extends a.default{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r;const n=[l.GossipsubIDv11,l.GossipsubIDv10],i=Object.assign(Object.assign({gossipIncoming:!0,fallbackToFloodsub:!0,floodPublish:!0,doPX:!1,directPeers:[],D:l.GossipsubD,Dlo:l.GossipsubDlo,Dhi:l.GossipsubDhi,Dscore:l.GossipsubDscore,Dout:l.GossipsubDout,Dlazy:l.GossipsubDlazy,heartbeatInterval:l.GossipsubHeartbeatInterval,fanoutTTL:l.GossipsubFanoutTTL,mcacheLength:l.GossipsubHistoryLength,mcacheGossip:l.GossipsubHistoryGossip,seenTTL:l.GossipsubSeenTTL},e),{scoreParams:p.createPeerScoreParams(e.scoreParams),scoreThresholds:p.createPeerScoreThresholds(e.scoreThresholds)});i.fallbackToFloodsub&&n.push(l.FloodsubID),super(Object.assign({debugName:"libp2p:gossipsub",multicodecs:n,libp2p:t},i)),this._options=i,this.direct=new Set(i.directPeers.map((t=>t.id.toB58String()))),this.acceptFromWhitelist=new Map,i.directPeers.forEach((e=>{t.peerStore.addressBook.add(e.id,e.addrs)})),this.seenCache=new g.SimpleTimeCache({validityMs:i.seenTTL}),this.mesh=new Map,this.fanout=new Map,this.lastpub=new Map,this.gossip=new Map,this.control=new Map,this.peerhave=new Map,this.iasked=new Map,this.backoff=new Map,this.outbound=new Map,this.messageCache=e.messageCache||new u.MessageCache(i.mcacheGossip,i.mcacheLength),this.getFastMsgIdStr=null!==(r=e.fastMsgIdFn)&&void 0!==r?r:void 0,this.fastMsgIdCache=e.fastMsgIdFn?new g.SimpleTimeCache({validityMs:i.seenTTL}):void 0,this.heartbeat=new h.Heartbeat(this),this.heartbeatTicks=0,this.gossipTracer=new y.IWantTracer,this._libp2p=t,this.score=new p.PeerScore(this._options.scoreParams,t.connectionManager)}_decodeRpc(t){return c.RPC.decode(t)}_encodeRpc(t){return c.RPC.encode(t).finish()}_addPeer(t,e){const r=super._addPeer(t,e);this.score.addPeer(t.toB58String());let n=!1;for(const i of this._libp2p.connectionManager.getAll(t))if("outbound"===i.stat.direction&&Array.from(i.registry.values()).some((t=>e===t.protocol))){n=!0;break}return this.outbound.set(r.id.toB58String(),n),r}_removePeer(t){const e=super._removePeer(t),r=t.toB58String();for(const n of this.mesh.values())n.delete(r);for(const n of this.fanout.values())n.delete(r);return this.gossip.delete(r),this.control.delete(r),this.outbound.delete(r),this.score.removePeer(r),this.acceptFromWhitelist.delete(r),e}_processRpc(t,e,r){const n=Object.create(null,{_processRpc:{get:()=>super._processRpc}});return s(this,void 0,void 0,(function*(){return!!(yield n._processRpc.call(this,t,e,r))&&(r.control&&(yield this._processRpcControlMessage(t,r.control)),!0)}))}_processRpcControlMessage(t,e){return s(this,void 0,void 0,(function*(){if(!e)return;const r=e.ihave?this._handleIHave(t,e.ihave):[],n=e.iwant?this._handleIWant(t,e.iwant):[],i=e.graft?yield this._handleGraft(t,e.graft):[];if(e.prune&&this._handlePrune(t,e.prune),!r.length&&!n.length&&!i.length)return;const o=d.createGossipRpc(n,{iwant:r,prune:i});this._sendRpc(t,o)}))}_processRpcMessage(t){const e=Object.create(null,{_processRpcMessage:{get:()=>super._processRpcMessage}});return s(this,void 0,void 0,(function*(){let r;if(this.getFastMsgIdStr&&this.fastMsgIdCache){const e=yield this.getFastMsgIdStr(t);if(r=this.fastMsgIdCache.get(e),void 0!==r)return void this.score.duplicateMessage(t,r);r=d.messageIdToString(yield this.getMsgId(t)),this.fastMsgIdCache.put(e,r)}else if(r=d.messageIdToString(yield this.getMsgId(t)),this.seenCache.has(r))return void this.score.duplicateMessage(t,r);this.seenCache.put(r),yield this.score.validateMessage(r),yield e._processRpcMessage.call(this,t)}))}_acceptFrom(t){if(this.direct.has(t))return!0;const e=Date.now(),r=this.acceptFromWhitelist.get(t);if(r&&r.messagesAccepted<v.ACCEPT_FROM_WHITELIST_MAX_MESSAGES&&r.acceptUntil>=e)return r.messagesAccepted+=1,!0;const n=this.score.score(t);return n>=v.ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE?this.acceptFromWhitelist.set(t,{messagesAccepted:0,acceptUntil:e+v.ACCEPT_FROM_WHITELIST_DURATION_MS}):this.acceptFromWhitelist.delete(t),n>=this._options.scoreThresholds.graylistThreshold}validate(t){const e=Object.create(null,{validate:{get:()=>super.validate}});return s(this,void 0,void 0,(function*(){try{yield e.validate.call(this,t)}catch(r){const e=yield this.getCanonicalMsgIdStr(t);throw this.score.rejectMessage(t,e,r.code),this.gossipTracer.rejectMessage(e,r.code),r}}))}_handleIHave(t,e){if(!e.length)return[];const r=this.score.score(t);if(r<this._options.scoreThresholds.gossipThreshold)return this.log("IHAVE: ignoring peer %s with score below threshold [ score = %d ]",t,r),[];const n=(this.peerhave.get(t)||0)+1;if(this.peerhave.set(t,n),n>l.GossipsubMaxIHaveMessages)return this.log("IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring",t,n),[];const i=this.iasked.get(t)||0;if(i>=l.GossipsubMaxIHaveLength)return this.log("IHAVE: peer %s has already advertised too many messages (%d); ignoring",t,i),[];const o=new Map;if(e.forEach((t=>{let{topicID:e,messageIDs:r}=t;e&&r&&this.mesh.has(e)&&r.forEach((t=>{const e=d.messageIdToString(t);this.seenCache.has(e)||o.set(e,t)}))})),!o.size)return[];let s=o.size;s+i>l.GossipsubMaxIHaveLength&&(s=l.GossipsubMaxIHaveLength-i),this.log("IHAVE: Asking for %d out of %d messages from %s",s,o.size,t);let a=Array.from(o.values());return d.shuffle(a),a=a.slice(0,s),this.iasked.set(t,i+s),this.gossipTracer.addPromise(t,a),[{messageIDs:a}]}_handleIWant(t,e){if(!e.length)return[];const r=this.score.score(t);if(r<this._options.scoreThresholds.gossipThreshold)return this.log("IWANT: ignoring peer %s with score below threshold [score = %d]",t,r),[];const n=new Map;return e.forEach((e=>{let{messageIDs:r}=e;r&&r.forEach((e=>{const r=d.messageIdToString(e),[i,o]=this.messageCache.getForPeer(r,t);i&&(o>l.GossipsubGossipRetransmission?this.log("IWANT: Peer %s has asked for message %s too many times: ignoring request",t,e):n.set(r,i))}))})),n.size?(this.log("IWANT: Sending %d messages to %s",n.size,t),Array.from(n.values()).map(a.utils.normalizeOutRpcMessage)):[]}_handleGraft(t,e){return s(this,void 0,void 0,(function*(){const r=[],n=this.score.score(t),i=this._now();let o=this._options.doPX;return e.forEach((e=>{let{topicID:s}=e;var a;if(!s)return;const u=this.mesh.get(s);if(!u)return void(o=!1);if(u.has(t))return;if(this.direct.has(t))return this.log("GRAFT: ignoring request from direct peer %s",t),r.push(s),void(o=!1);const c=null===(a=this.backoff.get(s))||void 0===a?void 0:a.get(t);if("number"===typeof c&&i<c){this.log("GRAFT: ignoring backed off peer %s",t),this.score.addPenalty(t,1),o=!1;const e=c+l.GossipsubGraftFloodThreshold-l.GossipsubPruneBackoff;return i<e&&this.score.addPenalty(t,1),this._addBackoff(t,s),void r.push(s)}return n<0?(this.log("GRAFT: ignoring peer %s with negative score: score=%d, topic=%s",t,n,s),r.push(s),o=!1,void this._addBackoff(t,s)):u.size>=this._options.Dhi&&!this.outbound.get(t)?(r.push(s),void this._addBackoff(t,s)):(this.log("GRAFT: Add mesh link from %s in %s",t,s),this.score.graft(t,s),void u.add(t))})),r.length?Promise.all(r.map((e=>this._makePrune(t,e,o)))):[]}))}_handlePrune(t,e){const r=this.score.score(t);e.forEach((e=>{let{topicID:n,backoff:i,peers:o}=e;if(!n)return;const s=this.mesh.get(n);if(s&&(this.log("PRUNE: Remove mesh link to %s in %s",t,n),this.score.prune(t,n),s.delete(t),"number"===typeof i&&i>0?this._doAddBackoff(t,n,1e3*i):this._addBackoff(t,n),o&&o.length)){if(r<this._options.scoreThresholds.acceptPXThreshold)return void this.log("PRUNE: ignoring PX from peer %s with insufficient score [score = %d, topic = %s]",t,r,n);this._pxConnect(o)}}))}_addBackoff(t,e){this._doAddBackoff(t,e,l.GossipsubPruneBackoff)}_doAddBackoff(t,e,r){let n=this.backoff.get(e);n||(n=new Map,this.backoff.set(e,n));const i=this._now()+r;(n.get(t)||0)<i&&n.set(t,i)}_applyIwantPenalties(){this.gossipTracer.getBrokenPromises().forEach(((t,e)=>{this.log("peer %s didn't follow up in %d IWANT requests; adding penalty",e,t),this.score.addPenalty(e,t)}))}_clearBackoff(){if(this.heartbeatTicks%l.GossipsubPruneBackoffTicks!==0)return;const t=this._now();this.backoff.forEach(((e,r)=>{e.forEach(((r,n)=>{r<t&&e.delete(n)})),0===e.size&&this.backoff.delete(r)}))}_directConnect(){if(this.heartbeatTicks%l.GossipsubDirectConnectTicks!==0)return;const t=[];this.direct.forEach((e=>{const r=this.peers.get(e);r&&r.isWritable||t.push(e)})),t.length&&t.forEach((t=>{this._connect(t)}))}_pxConnect(t){return s(this,void 0,void 0,(function*(){t.length>l.GossipsubPrunePeers&&(d.shuffle(t),t=t.slice(0,l.GossipsubPrunePeers));const e=[];yield Promise.all(t.map((t=>s(this,void 0,void 0,(function*(){if(!t.peerID)return;const r=m.createFromBytes(t.peerID).toB58String();if(!this.peers.has(r))if(t.signedPeerRecord)try{const n=yield b.openAndCertify(t.signedPeerRecord,"libp2p-peer-record"),i=n.peerId.toB58String();if(r!==i)return void this.log("bogus peer record obtained through px: peer ID %s doesn't match expected peer %s",i,r);if(!this._libp2p.peerStore.addressBook.consumePeerRecord(n))return void this.log("bogus peer record obtained through px: could not add peer record to address book");e.push(r)}catch(n){this.log("bogus peer record obtained through px: invalid signature or not a peer record")}else e.push(r)}))))),e.length&&e.forEach((t=>this._connect(t)))}))}start(){const t=Object.create(null,{start:{get:()=>super.start}});return s(this,void 0,void 0,(function*(){yield t.start.call(this),this.heartbeat.start(),this.score.start(),this._directPeerInitial=setTimeout((()=>{this.direct.forEach((t=>{this._connect(t)}))}),l.GossipsubDirectConnectInitialDelay)}))}stop(){const t=Object.create(null,{stop:{get:()=>super.stop}});return s(this,void 0,void 0,(function*(){yield t.stop.call(this),this.heartbeat.stop(),this.score.stop(),this.mesh=new Map,this.fanout=new Map,this.lastpub=new Map,this.gossip=new Map,this.control=new Map,this.peerhave=new Map,this.iasked=new Map,this.backoff=new Map,this.outbound=new Map,this.gossipTracer.clear(),this.seenCache.clear(),this.fastMsgIdCache&&this.fastMsgIdCache.clear(),clearTimeout(this._directPeerInitial)}))}_connect(t){this.log("Initiating connection with %s",t),this._libp2p.dialProtocol(m.createFromB58String(t),this.multicodecs)}subscribe(t){super.subscribe(t),this.join(t)}unsubscribe(t){super.unsubscribe(t),this.leave(t)}join(t){if(!this.started)throw new Error("Gossipsub has not started");this.log("JOIN %s",t);const e=this.fanout.get(t);if(e)e.forEach((t=>{this.score.score(t)<0&&e.delete(t)})),e.size<this._options.D&&f.getGossipPeers(this,t,this._options.D-e.size,(t=>!e.has(t)&&!this.direct.has(t)&&this.score.score(t)>=0)).forEach((t=>e.add(t))),this.mesh.set(t,e),this.fanout.delete(t),this.lastpub.delete(t);else{const e=f.getGossipPeers(this,t,this._options.D,(t=>!this.direct.has(t)&&this.score.score(t)>=0));this.mesh.set(t,e)}this.mesh.get(t).forEach((e=>{this.log("JOIN: Add mesh link to %s in %s",e,t),this._sendGraft(e,t)}))}leave(t){if(!this.started)throw new Error("Gossipsub has not started");this.log("LEAVE %s",t);const e=this.mesh.get(t);e&&(e.forEach((e=>{this.log("LEAVE: Remove mesh link to %s in %s",e,t),this._sendPrune(e,t)})),this.mesh.delete(t))}getCanonicalMsgIdStr(t){var e,r;return s(this,void 0,void 0,(function*(){return this.fastMsgIdCache&&this.getFastMsgIdStr&&null!==(r=null!==(e=this.getCachedMsgIdStr(t))&&void 0!==e?e:this.fastMsgIdCache.get(this.getFastMsgIdStr(t)))&&void 0!==r?r:d.messageIdToString(yield this.getMsgId(t))}))}getCachedMsgIdStr(t){}_publish(t){return s(this,void 0,void 0,(function*(){const e=yield this.getCanonicalMsgIdStr(t);t.receivedFrom!==this.peerId.toB58String()&&(this.score.deliverMessage(t,e),this.gossipTracer.deliverMessage(e)),this.seenCache.put(e),this.messageCache.put(t,e);const r=new Set;t.topicIDs.forEach((e=>{const n=this.topics.get(e);if(n)if(this._options.floodPublish&&t.from===this.peerId.toB58String())n.forEach((t=>{(this.direct.has(t)||this.score.score(t)>=this._options.scoreThresholds.publishThreshold)&&r.add(t)}));else{this.direct.forEach((t=>{r.add(t)})),n.forEach((t=>{const e=this.score.score(t),n=this.peers.get(t);n&&n.protocol===l.FloodsubID&&e>=this._options.scoreThresholds.publishThreshold&&r.add(t)}));let t=this.mesh.get(e);if(!t||!t.size){if(t=this.fanout.get(e),!t){const r=f.getGossipPeers(this,e,this._options.D,(t=>this.score.score(t)>=this._options.scoreThresholds.publishThreshold));r.size>0?(t=r,this.fanout.set(e,r)):t=new Set}this.lastpub.set(e,this._now())}t.forEach((t=>{r.add(t)}))}}));const n=d.createGossipRpc([a.utils.normalizeOutRpcMessage(t)]);r.forEach((e=>{e!==t.from&&this._sendRpc(e,n)}))}))}_sendGraft(t,e){const r=[{topicID:e}],n=d.createGossipRpc([],{graft:r});this._sendRpc(t,n)}_sendPrune(t,e){return s(this,void 0,void 0,(function*(){const r=[yield this._makePrune(t,e,this._options.doPX)],n=d.createGossipRpc([],{prune:r});this._sendRpc(t,n)}))}_sendRpc(t,e){const r=this.peers.get(t);if(!r||!r.isWritable)return;const n=this.control.get(t);n&&(this._piggybackControl(t,e,n),this.control.delete(t));const i=this.gossip.get(t);i&&(this._piggybackGossip(t,e,i),this.gossip.delete(t)),r.write(c.RPC.encode(e).finish())}_piggybackControl(t,e,r){const n=(r.graft||[]).filter((e=>{let{topicID:r}=e;return(r&&this.mesh.get(r)||new Set).has(t)})),i=(r.prune||[]).filter((e=>{let{topicID:r}=e;return!(r&&this.mesh.get(r)||new Set).has(t)}));(n.length||i.length)&&(e.control?(e.control.graft=e.control.graft&&e.control.graft.concat(n),e.control.prune=e.control.prune&&e.control.prune.concat(i)):e.control={ihave:[],iwant:[],graft:n,prune:i})}_piggybackGossip(t,e,r){e.control||(e.control={ihave:[],iwant:[],graft:[],prune:[]}),e.control.ihave=r}_sendGraftPrune(t,e,r){return s(this,void 0,void 0,(function*(){const n=this._options.doPX;for(const[i,o]of t){const t=o.map((t=>({topicID:t})));let s=[];const a=e.get(i);a&&(s=yield Promise.all(a.map((t=>this._makePrune(i,t,n&&!r.get(i))))),e.delete(i));const u=d.createGossipRpc([],{graft:t,prune:s});this._sendRpc(i,u)}for(const[t,i]of e){const e=yield Promise.all(i.map((e=>this._makePrune(t,e,n&&!r.get(t))))),o=d.createGossipRpc([],{prune:e});this._sendRpc(t,o)}}))}_emitGossip(t,e){const r=this.messageCache.getGossipIDs(t);if(!r.length)return;d.shuffle(r),r.length>l.GossipsubMaxIHaveLength&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length);const n=[],i=this.topics.get(t);if(!i)return;i.forEach((t=>{const r=this.peers.get(t);r&&!e.has(t)&&!this.direct.has(t)&&d.hasGossipProtocol(r.protocol)&&this.score.score(t)>=this._options.scoreThresholds.gossipThreshold&&n.push(t)}));let o=this._options.Dlazy;const s=l.GossipsubGossipFactor*n.length;s>o&&(o=s),o>n.length?o=n.length:d.shuffle(n),n.slice(0,o).forEach((e=>{let n=r;r.length>l.GossipsubMaxIHaveLength&&(n=d.shuffle(n.slice()).slice(0,l.GossipsubMaxIHaveLength)),this._pushGossip(e,{topicID:t,messageIDs:n})}))}_flush(){for(const[t,e]of this.gossip.entries()){this.gossip.delete(t);const r=d.createGossipRpc([],{ihave:e});this._sendRpc(t,r)}for(const[t,e]of this.control.entries()){this.control.delete(t);const r=d.createGossipRpc([],{graft:e.graft,prune:e.prune});this._sendRpc(t,r)}}_pushGossip(t,e){this.log("Add gossip to %s",t);const r=this.gossip.get(t)||[];this.gossip.set(t,r.concat(e))}_now(){return Date.now()}_makePrune(t,e,r){return s(this,void 0,void 0,(function*(){if(this.peers.get(t).protocol===l.GossipsubIDv10)return{topicID:e,peers:[]};const n=l.GossipsubPruneBackoff/1e3;if(!r)return{topicID:e,peers:[],backoff:n};const i=f.getGossipPeers(this,e,l.GossipsubPrunePeers,(e=>e!==t&&this.score.score(e)>=0)),o=yield Promise.all(Array.from(i).map((t=>s(this,void 0,void 0,(function*(){const e=m.createFromB58String(t);return{peerID:e.toBytes(),signedPeerRecord:yield this._libp2p.peerStore.addressBook.getRawEnvelope(e)}})))));return{topicID:e,peers:o,backoff:n}}))}}w.multicodec=l.GossipsubIDv11,t.exports=w},45075:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MessageCache=void 0;const i=r(53357);e.MessageCache=class{constructor(t,e){this.msgs=new Map,this.peertx=new Map,this.history=[];for(let r=0;r<e;r++)this.history[r]=[];this.gossip=t}put(t,e){return n(this,void 0,void 0,(function*(){this.msgs.set(e,t);const r=i.messageIdFromString(e);this.history[0].push({msgId:r,topics:t.topicIDs})}))}get(t){return this.msgs.get(i.messageIdToString(t))}getForPeer(t,e){const r=this.msgs.get(t);if(!r)return[void 0,0];let n=this.peertx.get(t);n||(n=new Map,this.peertx.set(t,n));const i=(n.get(e)||0)+1;return n.set(e,i),[r,i]}getGossipIDs(t){const e=[];for(let r=0;r<this.gossip;r++)this.history[r].forEach((r=>{for(const n of r.topics)if(n===t){e.push(r.msgId);break}}));return e}shift(){this.history[this.history.length-1].forEach((t=>{const e=i.messageIdToString(t.msgId);this.msgs.delete(e),this.peertx.delete(e)})),this.history.pop(),this.history.unshift([])}}},83519:function(t,e,r){var n,i,o;i=[r(80886)],void 0===(o="function"===typeof(n=function(t){"use strict";var e=t.Reader,r=t.Writer,n=t.util,i=t.roots.default||(t.roots.default={});return i.RPC=function(){function o(t){if(this.subscriptions=[],this.msgs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.subscriptions=n.emptyArray,o.prototype.msgs=n.emptyArray,o.prototype.control=null,Object.defineProperty(o.prototype,"_control",{get:n.oneOfGetter(s=["control"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){if(e||(e=r.create()),null!=t.subscriptions&&t.subscriptions.length)for(var n=0;n<t.subscriptions.length;++n)i.RPC.SubOpts.encode(t.subscriptions[n],e.uint32(10).fork()).ldelim();if(null!=t.msgs&&t.msgs.length)for(n=0;n<t.msgs.length;++n)i.RPC.Message.encode(t.msgs[n],e.uint32(18).fork()).ldelim();return null!=t.control&&Object.hasOwnProperty.call(t,"control")&&i.RPC.ControlMessage.encode(t.control,e.uint32(26).fork()).ldelim(),e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.subscriptions&&o.subscriptions.length||(o.subscriptions=[]),o.subscriptions.push(i.RPC.SubOpts.decode(t,t.uint32()));break;case 2:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(i.RPC.Message.decode(t,t.uint32()));break;case 3:o.control=i.RPC.ControlMessage.decode(t,t.uint32());break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC)return t;var e=new i.RPC;if(t.subscriptions){if(!Array.isArray(t.subscriptions))throw TypeError(".RPC.subscriptions: array expected");e.subscriptions=[];for(var r=0;r<t.subscriptions.length;++r){if("object"!==typeof t.subscriptions[r])throw TypeError(".RPC.subscriptions: object expected");e.subscriptions[r]=i.RPC.SubOpts.fromObject(t.subscriptions[r])}}if(t.msgs){if(!Array.isArray(t.msgs))throw TypeError(".RPC.msgs: array expected");for(e.msgs=[],r=0;r<t.msgs.length;++r){if("object"!==typeof t.msgs[r])throw TypeError(".RPC.msgs: object expected");e.msgs[r]=i.RPC.Message.fromObject(t.msgs[r])}}if(null!=t.control){if("object"!==typeof t.control)throw TypeError(".RPC.control: object expected");e.control=i.RPC.ControlMessage.fromObject(t.control)}return e},o.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.subscriptions=[],r.msgs=[]),t.subscriptions&&t.subscriptions.length){r.subscriptions=[];for(var n=0;n<t.subscriptions.length;++n)r.subscriptions[n]=i.RPC.SubOpts.toObject(t.subscriptions[n],e)}if(t.msgs&&t.msgs.length)for(r.msgs=[],n=0;n<t.msgs.length;++n)r.msgs[n]=i.RPC.Message.toObject(t.msgs[n],e);return null!=t.control&&t.hasOwnProperty("control")&&(r.control=i.RPC.ControlMessage.toObject(t.control,e),e.oneofs&&(r._control="control")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o.SubOpts=function(){function o(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.subscribe=null,o.prototype.topicID=null,Object.defineProperty(o.prototype,"_subscribe",{get:n.oneOfGetter(s=["subscribe"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){return e||(e=r.create()),null!=t.subscribe&&Object.hasOwnProperty.call(t,"subscribe")&&e.uint32(8).bool(t.subscribe),null!=t.topicID&&Object.hasOwnProperty.call(t,"topicID")&&e.uint32(18).string(t.topicID),e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.SubOpts;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.subscribe=t.bool();break;case 2:o.topicID=t.string();break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC.SubOpts)return t;var e=new i.RPC.SubOpts;return null!=t.subscribe&&(e.subscribe=Boolean(t.subscribe)),null!=t.topicID&&(e.topicID=String(t.topicID)),e},o.toObject=function(t,e){e||(e={});var r={};return null!=t.subscribe&&t.hasOwnProperty("subscribe")&&(r.subscribe=t.subscribe,e.oneofs&&(r._subscribe="subscribe")),null!=t.topicID&&t.hasOwnProperty("topicID")&&(r.topicID=t.topicID,e.oneofs&&(r._topicID="topicID")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.Message=function(){function o(t){if(this.topicIDs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.from=null,o.prototype.data=null,o.prototype.seqno=null,o.prototype.topicIDs=n.emptyArray,o.prototype.signature=null,o.prototype.key=null,Object.defineProperty(o.prototype,"_from",{get:n.oneOfGetter(s=["from"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_data",{get:n.oneOfGetter(s=["data"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_seqno",{get:n.oneOfGetter(s=["seqno"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_signature",{get:n.oneOfGetter(s=["signature"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_key",{get:n.oneOfGetter(s=["key"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){if(e||(e=r.create()),null!=t.from&&Object.hasOwnProperty.call(t,"from")&&e.uint32(10).bytes(t.from),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&e.uint32(18).bytes(t.data),null!=t.seqno&&Object.hasOwnProperty.call(t,"seqno")&&e.uint32(26).bytes(t.seqno),null!=t.topicIDs&&t.topicIDs.length)for(var n=0;n<t.topicIDs.length;++n)e.uint32(34).string(t.topicIDs[n]);return null!=t.signature&&Object.hasOwnProperty.call(t,"signature")&&e.uint32(42).bytes(t.signature),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&e.uint32(50).bytes(t.key),e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.Message;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.from=t.bytes();break;case 2:o.data=t.bytes();break;case 3:o.seqno=t.bytes();break;case 4:o.topicIDs&&o.topicIDs.length||(o.topicIDs=[]),o.topicIDs.push(t.string());break;case 5:o.signature=t.bytes();break;case 6:o.key=t.bytes();break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC.Message)return t;var e=new i.RPC.Message;if(null!=t.from&&("string"===typeof t.from?n.base64.decode(t.from,e.from=n.newBuffer(n.base64.length(t.from)),0):t.from.length&&(e.from=t.from)),null!=t.data&&("string"===typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length&&(e.data=t.data)),null!=t.seqno&&("string"===typeof t.seqno?n.base64.decode(t.seqno,e.seqno=n.newBuffer(n.base64.length(t.seqno)),0):t.seqno.length&&(e.seqno=t.seqno)),t.topicIDs){if(!Array.isArray(t.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");e.topicIDs=[];for(var r=0;r<t.topicIDs.length;++r)e.topicIDs[r]=String(t.topicIDs[r])}return null!=t.signature&&("string"===typeof t.signature?n.base64.decode(t.signature,e.signature=n.newBuffer(n.base64.length(t.signature)),0):t.signature.length&&(e.signature=t.signature)),null!=t.key&&("string"===typeof t.key?n.base64.decode(t.key,e.key=n.newBuffer(n.base64.length(t.key)),0):t.key.length&&(e.key=t.key)),e},o.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.topicIDs=[]),null!=t.from&&t.hasOwnProperty("from")&&(r.from=e.bytes===String?n.base64.encode(t.from,0,t.from.length):e.bytes===Array?Array.prototype.slice.call(t.from):t.from,e.oneofs&&(r._from="from")),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data,e.oneofs&&(r._data="data")),null!=t.seqno&&t.hasOwnProperty("seqno")&&(r.seqno=e.bytes===String?n.base64.encode(t.seqno,0,t.seqno.length):e.bytes===Array?Array.prototype.slice.call(t.seqno):t.seqno,e.oneofs&&(r._seqno="seqno")),t.topicIDs&&t.topicIDs.length){r.topicIDs=[];for(var i=0;i<t.topicIDs.length;++i)r.topicIDs[i]=t.topicIDs[i]}return null!=t.signature&&t.hasOwnProperty("signature")&&(r.signature=e.bytes===String?n.base64.encode(t.signature,0,t.signature.length):e.bytes===Array?Array.prototype.slice.call(t.signature):t.signature,e.oneofs&&(r._signature="signature")),null!=t.key&&t.hasOwnProperty("key")&&(r.key=e.bytes===String?n.base64.encode(t.key,0,t.key.length):e.bytes===Array?Array.prototype.slice.call(t.key):t.key,e.oneofs&&(r._key="key")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.ControlMessage=function(){function o(t){if(this.ihave=[],this.iwant=[],this.graft=[],this.prune=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return o.prototype.ihave=n.emptyArray,o.prototype.iwant=n.emptyArray,o.prototype.graft=n.emptyArray,o.prototype.prune=n.emptyArray,o.encode=function(t,e){if(e||(e=r.create()),null!=t.ihave&&t.ihave.length)for(var n=0;n<t.ihave.length;++n)i.RPC.ControlIHave.encode(t.ihave[n],e.uint32(10).fork()).ldelim();if(null!=t.iwant&&t.iwant.length)for(n=0;n<t.iwant.length;++n)i.RPC.ControlIWant.encode(t.iwant[n],e.uint32(18).fork()).ldelim();if(null!=t.graft&&t.graft.length)for(n=0;n<t.graft.length;++n)i.RPC.ControlGraft.encode(t.graft[n],e.uint32(26).fork()).ldelim();if(null!=t.prune&&t.prune.length)for(n=0;n<t.prune.length;++n)i.RPC.ControlPrune.encode(t.prune[n],e.uint32(34).fork()).ldelim();return e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.ControlMessage;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.ihave&&o.ihave.length||(o.ihave=[]),o.ihave.push(i.RPC.ControlIHave.decode(t,t.uint32()));break;case 2:o.iwant&&o.iwant.length||(o.iwant=[]),o.iwant.push(i.RPC.ControlIWant.decode(t,t.uint32()));break;case 3:o.graft&&o.graft.length||(o.graft=[]),o.graft.push(i.RPC.ControlGraft.decode(t,t.uint32()));break;case 4:o.prune&&o.prune.length||(o.prune=[]),o.prune.push(i.RPC.ControlPrune.decode(t,t.uint32()));break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC.ControlMessage)return t;var e=new i.RPC.ControlMessage;if(t.ihave){if(!Array.isArray(t.ihave))throw TypeError(".RPC.ControlMessage.ihave: array expected");e.ihave=[];for(var r=0;r<t.ihave.length;++r){if("object"!==typeof t.ihave[r])throw TypeError(".RPC.ControlMessage.ihave: object expected");e.ihave[r]=i.RPC.ControlIHave.fromObject(t.ihave[r])}}if(t.iwant){if(!Array.isArray(t.iwant))throw TypeError(".RPC.ControlMessage.iwant: array expected");for(e.iwant=[],r=0;r<t.iwant.length;++r){if("object"!==typeof t.iwant[r])throw TypeError(".RPC.ControlMessage.iwant: object expected");e.iwant[r]=i.RPC.ControlIWant.fromObject(t.iwant[r])}}if(t.graft){if(!Array.isArray(t.graft))throw TypeError(".RPC.ControlMessage.graft: array expected");for(e.graft=[],r=0;r<t.graft.length;++r){if("object"!==typeof t.graft[r])throw TypeError(".RPC.ControlMessage.graft: object expected");e.graft[r]=i.RPC.ControlGraft.fromObject(t.graft[r])}}if(t.prune){if(!Array.isArray(t.prune))throw TypeError(".RPC.ControlMessage.prune: array expected");for(e.prune=[],r=0;r<t.prune.length;++r){if("object"!==typeof t.prune[r])throw TypeError(".RPC.ControlMessage.prune: object expected");e.prune[r]=i.RPC.ControlPrune.fromObject(t.prune[r])}}return e},o.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.ihave=[],r.iwant=[],r.graft=[],r.prune=[]),t.ihave&&t.ihave.length){r.ihave=[];for(var n=0;n<t.ihave.length;++n)r.ihave[n]=i.RPC.ControlIHave.toObject(t.ihave[n],e)}if(t.iwant&&t.iwant.length)for(r.iwant=[],n=0;n<t.iwant.length;++n)r.iwant[n]=i.RPC.ControlIWant.toObject(t.iwant[n],e);if(t.graft&&t.graft.length)for(r.graft=[],n=0;n<t.graft.length;++n)r.graft[n]=i.RPC.ControlGraft.toObject(t.graft[n],e);if(t.prune&&t.prune.length)for(r.prune=[],n=0;n<t.prune.length;++n)r.prune[n]=i.RPC.ControlPrune.toObject(t.prune[n],e);return r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.ControlIHave=function(){function o(t){if(this.messageIDs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.topicID=null,o.prototype.messageIDs=n.emptyArray,Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){if(e||(e=r.create()),null!=t.topicID&&Object.hasOwnProperty.call(t,"topicID")&&e.uint32(10).string(t.topicID),null!=t.messageIDs&&t.messageIDs.length)for(var n=0;n<t.messageIDs.length;++n)e.uint32(18).bytes(t.messageIDs[n]);return e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.ControlIHave;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.topicID=t.string();break;case 2:o.messageIDs&&o.messageIDs.length||(o.messageIDs=[]),o.messageIDs.push(t.bytes());break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC.ControlIHave)return t;var e=new i.RPC.ControlIHave;if(null!=t.topicID&&(e.topicID=String(t.topicID)),t.messageIDs){if(!Array.isArray(t.messageIDs))throw TypeError(".RPC.ControlIHave.messageIDs: array expected");e.messageIDs=[];for(var r=0;r<t.messageIDs.length;++r)"string"===typeof t.messageIDs[r]?n.base64.decode(t.messageIDs[r],e.messageIDs[r]=n.newBuffer(n.base64.length(t.messageIDs[r])),0):t.messageIDs[r].length&&(e.messageIDs[r]=t.messageIDs[r])}return e},o.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.messageIDs=[]),null!=t.topicID&&t.hasOwnProperty("topicID")&&(r.topicID=t.topicID,e.oneofs&&(r._topicID="topicID")),t.messageIDs&&t.messageIDs.length){r.messageIDs=[];for(var i=0;i<t.messageIDs.length;++i)r.messageIDs[i]=e.bytes===String?n.base64.encode(t.messageIDs[i],0,t.messageIDs[i].length):e.bytes===Array?Array.prototype.slice.call(t.messageIDs[i]):t.messageIDs[i]}return r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.ControlIWant=function(){function o(t){if(this.messageIDs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return o.prototype.messageIDs=n.emptyArray,o.encode=function(t,e){if(e||(e=r.create()),null!=t.messageIDs&&t.messageIDs.length)for(var n=0;n<t.messageIDs.length;++n)e.uint32(10).bytes(t.messageIDs[n]);return e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.ControlIWant;t.pos<n;){var s=t.uint32();s>>>3===1?(o.messageIDs&&o.messageIDs.length||(o.messageIDs=[]),o.messageIDs.push(t.bytes())):t.skipType(7&s)}return o},o.fromObject=function(t){if(t instanceof i.RPC.ControlIWant)return t;var e=new i.RPC.ControlIWant;if(t.messageIDs){if(!Array.isArray(t.messageIDs))throw TypeError(".RPC.ControlIWant.messageIDs: array expected");e.messageIDs=[];for(var r=0;r<t.messageIDs.length;++r)"string"===typeof t.messageIDs[r]?n.base64.decode(t.messageIDs[r],e.messageIDs[r]=n.newBuffer(n.base64.length(t.messageIDs[r])),0):t.messageIDs[r].length&&(e.messageIDs[r]=t.messageIDs[r])}return e},o.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.messageIDs=[]),t.messageIDs&&t.messageIDs.length){r.messageIDs=[];for(var i=0;i<t.messageIDs.length;++i)r.messageIDs[i]=e.bytes===String?n.base64.encode(t.messageIDs[i],0,t.messageIDs[i].length):e.bytes===Array?Array.prototype.slice.call(t.messageIDs[i]):t.messageIDs[i]}return r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.ControlGraft=function(){function o(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.topicID=null,Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){return e||(e=r.create()),null!=t.topicID&&Object.hasOwnProperty.call(t,"topicID")&&e.uint32(10).string(t.topicID),e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.ControlGraft;t.pos<n;){var s=t.uint32();s>>>3===1?o.topicID=t.string():t.skipType(7&s)}return o},o.fromObject=function(t){if(t instanceof i.RPC.ControlGraft)return t;var e=new i.RPC.ControlGraft;return null!=t.topicID&&(e.topicID=String(t.topicID)),e},o.toObject=function(t,e){e||(e={});var r={};return null!=t.topicID&&t.hasOwnProperty("topicID")&&(r.topicID=t.topicID,e.oneofs&&(r._topicID="topicID")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.ControlPrune=function(){function o(t){if(this.peers=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.topicID=null,o.prototype.peers=n.emptyArray,o.prototype.backoff=null,Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_backoff",{get:n.oneOfGetter(s=["backoff"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){if(e||(e=r.create()),null!=t.topicID&&Object.hasOwnProperty.call(t,"topicID")&&e.uint32(10).string(t.topicID),null!=t.peers&&t.peers.length)for(var n=0;n<t.peers.length;++n)i.RPC.PeerInfo.encode(t.peers[n],e.uint32(18).fork()).ldelim();return null!=t.backoff&&Object.hasOwnProperty.call(t,"backoff")&&e.uint32(24).uint64(t.backoff),e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.ControlPrune;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.topicID=t.string();break;case 2:o.peers&&o.peers.length||(o.peers=[]),o.peers.push(i.RPC.PeerInfo.decode(t,t.uint32()));break;case 3:o.backoff=t.uint64();break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC.ControlPrune)return t;var e=new i.RPC.ControlPrune;if(null!=t.topicID&&(e.topicID=String(t.topicID)),t.peers){if(!Array.isArray(t.peers))throw TypeError(".RPC.ControlPrune.peers: array expected");e.peers=[];for(var r=0;r<t.peers.length;++r){if("object"!==typeof t.peers[r])throw TypeError(".RPC.ControlPrune.peers: object expected");e.peers[r]=i.RPC.PeerInfo.fromObject(t.peers[r])}}return null!=t.backoff&&(n.Long?(e.backoff=n.Long.fromValue(t.backoff)).unsigned=!0:"string"===typeof t.backoff?e.backoff=parseInt(t.backoff,10):"number"===typeof t.backoff?e.backoff=t.backoff:"object"===typeof t.backoff&&(e.backoff=new n.LongBits(t.backoff.low>>>0,t.backoff.high>>>0).toNumber(!0))),e},o.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.peers=[]),null!=t.topicID&&t.hasOwnProperty("topicID")&&(r.topicID=t.topicID,e.oneofs&&(r._topicID="topicID")),t.peers&&t.peers.length){r.peers=[];for(var o=0;o<t.peers.length;++o)r.peers[o]=i.RPC.PeerInfo.toObject(t.peers[o],e)}return null!=t.backoff&&t.hasOwnProperty("backoff")&&("number"===typeof t.backoff?r.backoff=e.longs===String?String(t.backoff):t.backoff:r.backoff=e.longs===String?n.Long.prototype.toString.call(t.backoff):e.longs===Number?new n.LongBits(t.backoff.low>>>0,t.backoff.high>>>0).toNumber(!0):t.backoff,e.oneofs&&(r._backoff="backoff")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o.PeerInfo=function(){function o(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var s;return o.prototype.peerID=null,o.prototype.signedPeerRecord=null,Object.defineProperty(o.prototype,"_peerID",{get:n.oneOfGetter(s=["peerID"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_signedPeerRecord",{get:n.oneOfGetter(s=["signedPeerRecord"]),set:n.oneOfSetter(s)}),o.encode=function(t,e){return e||(e=r.create()),null!=t.peerID&&Object.hasOwnProperty.call(t,"peerID")&&e.uint32(10).bytes(t.peerID),null!=t.signedPeerRecord&&Object.hasOwnProperty.call(t,"signedPeerRecord")&&e.uint32(18).bytes(t.signedPeerRecord),e},o.decode=function(t,r){t instanceof e||(t=e.create(t));for(var n=void 0===r?t.len:t.pos+r,o=new i.RPC.PeerInfo;t.pos<n;){var s=t.uint32();switch(s>>>3){case 1:o.peerID=t.bytes();break;case 2:o.signedPeerRecord=t.bytes();break;default:t.skipType(7&s)}}return o},o.fromObject=function(t){if(t instanceof i.RPC.PeerInfo)return t;var e=new i.RPC.PeerInfo;return null!=t.peerID&&("string"===typeof t.peerID?n.base64.decode(t.peerID,e.peerID=n.newBuffer(n.base64.length(t.peerID)),0):t.peerID.length&&(e.peerID=t.peerID)),null!=t.signedPeerRecord&&("string"===typeof t.signedPeerRecord?n.base64.decode(t.signedPeerRecord,e.signedPeerRecord=n.newBuffer(n.base64.length(t.signedPeerRecord)),0):t.signedPeerRecord.length&&(e.signedPeerRecord=t.signedPeerRecord)),e},o.toObject=function(t,e){e||(e={});var r={};return null!=t.peerID&&t.hasOwnProperty("peerID")&&(r.peerID=e.bytes===String?n.base64.encode(t.peerID,0,t.peerID.length):e.bytes===Array?Array.prototype.slice.call(t.peerID):t.peerID,e.oneofs&&(r._peerID="peerID")),null!=t.signedPeerRecord&&t.hasOwnProperty("signedPeerRecord")&&(r.signedPeerRecord=e.bytes===String?n.base64.encode(t.signedPeerRecord,0,t.signedPeerRecord.length):e.bytes===Array?Array.prototype.slice.call(t.signedPeerRecord):t.signedPeerRecord,e.oneofs&&(r._signedPeerRecord="signedPeerRecord")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o}(),o}(),i})?n.apply(e,i):n)||(t.exports=o)},51338:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.computeScore=void 0,e.computeScore=function(t,e,r,n){let i=0;Object.entries(e.topics).forEach((t=>{let[e,n]=t;const o=r.topics[e];if(!o)return;let s=0;if(n.inMesh){let t=n.meshTime/o.timeInMeshQuantum;t>o.timeInMeshCap&&(t=o.timeInMeshCap),s+=t*o.timeInMeshWeight}if(s+=n.firstMessageDeliveries*o.firstMessageDeliveriesWeight,n.meshMessageDeliveriesActive&&n.meshMessageDeliveries<o.meshMessageDeliveriesThreshold){const t=o.meshMessageDeliveriesThreshold-n.meshMessageDeliveries;s+=t*t*o.meshMessageDeliveriesWeight}s+=n.meshFailurePenalty*o.meshFailurePenaltyWeight;s+=n.invalidMessageDeliveries*n.invalidMessageDeliveries*o.invalidMessageDeliveriesWeight,i+=s*o.topicWeight})),r.topicScoreCap>0&&i>r.topicScoreCap&&(i=r.topicScoreCap);const o=r.appSpecificScore(t);i+=o*r.appSpecificWeight,e.ips.forEach((t=>{if(r.IPColocationFactorWhitelist.has(t))return;const e=n.get(t),o=e?e.size:0;if(o>r.IPColocationFactorThreshold){const t=o-r.IPColocationFactorThreshold;i+=t*t*r.IPColocationFactorWeight}}));const s=e.behaviourPenalty*e.behaviourPenalty;return i+=s*r.behaviourPenaltyWeight,i}},54442:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERR_INVALID_PEER_SCORE_THRESHOLDS=e.ERR_INVALID_PEER_SCORE_PARAMS=void 0,e.ERR_INVALID_PEER_SCORE_PARAMS="ERR_INVALID_PEER_SCORE_PARAMS",e.ERR_INVALID_PEER_SCORE_THRESHOLDS="ERR_INVALID_PEER_SCORE_THRESHOLDS"},63789:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7507),e),i(r(50922),e),i(r(32723),e)},41838:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MessageDeliveries=e.DeliveryRecordStatus=void 0;const i=r(66759),o=n(r(68718));var s;!function(t){t[t.unknown=0]="unknown",t[t.valid=1]="valid",t[t.invalid=2]="invalid",t[t.ignored=3]="ignored"}(s=e.DeliveryRecordStatus||(e.DeliveryRecordStatus={}));e.MessageDeliveries=class{constructor(){this.records=new Map,this.queue=new o.default}ensureRecord(t){let e=this.records.get(t);if(e)return e;e={status:s.unknown,firstSeen:Date.now(),validated:0,peers:new Set},this.records.set(t,e);const r={msgId:t,expire:Date.now()+i.TimeCacheDuration};return this.queue.push(r),e}gc(){const t=Date.now();let e=this.queue.peekFront();for(;e&&e.expire<t;)this.records.delete(e.msgId),this.queue.shift(),e=this.queue.peekFront()}clear(){this.records.clear(),this.queue.clear()}}},7507:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopicScoreParams=e.validatePeerScoreParams=e.createTopicScoreParams=e.createPeerScoreParams=e.defaultTopicScoreParams=e.defaultPeerScoreParams=void 0;const n=r(54442),i=r(67963);function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},e.defaultTopicScoreParams),t)}function s(t){if(t.topicWeight<0)throw i(new Error("invalid topic weight; must be >= 0"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0===t.timeInMeshQuantum)throw i(new Error("invalid TimeInMeshQuantum; must be non zero"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.timeInMeshWeight<0)throw i(new Error("invalid TimeInMeshWeight; must be positive (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.timeInMeshWeight&&t.timeInMeshQuantum<=0)throw i(new Error("invalid TimeInMeshQuantum; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.timeInMeshWeight&&t.timeInMeshCap<=0)throw i(new Error("invalid TimeInMeshCap; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.firstMessageDeliveriesWeight<0)throw i(new Error("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.firstMessageDeliveriesWeight&&(t.firstMessageDeliveriesDecay<=0||t.firstMessageDeliveriesDecay>=1))throw i(new Error("invalid FirstMessageDeliveriesDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.firstMessageDeliveriesWeight&&t.firstMessageDeliveriesCap<=0)throw i(new Error("invalid FirstMessageDeliveriesCap; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWeight>0)throw i(new Error("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.meshMessageDeliveriesWeight&&(t.meshMessageDeliveriesDecay<=0||t.meshMessageDeliveriesDecay>=1))throw i(new Error("invalid MeshMessageDeliveriesDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.meshMessageDeliveriesWeight&&t.meshMessageDeliveriesCap<=0)throw i(new Error("invalid MeshMessageDeliveriesCap; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.meshMessageDeliveriesWeight&&t.meshMessageDeliveriesThreshold<=0)throw i(new Error("invalid MeshMessageDeliveriesThreshold; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshMessageDeliveriesWindow<0)throw i(new Error("invalid MeshMessageDeliveriesWindow; must be non-negative"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.meshMessageDeliveriesWeight&&t.meshMessageDeliveriesActivation<1e3)throw i(new Error("invalid MeshMessageDeliveriesActivation; must be at least 1s"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.meshFailurePenaltyWeight>0)throw i(new Error("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.meshFailurePenaltyWeight&&(t.meshFailurePenaltyDecay<=0||t.meshFailurePenaltyDecay>=1))throw i(new Error("invalid MeshFailurePenaltyDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.invalidMessageDeliveriesWeight>0)throw i(new Error("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.invalidMessageDeliveriesDecay<=0||t.invalidMessageDeliveriesDecay>=1)throw i(new Error("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS)}e.defaultPeerScoreParams={topics:{},topicScoreCap:10,appSpecificScore:()=>0,appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:36e5},e.defaultTopicScoreParams={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3},e.createPeerScoreParams=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign(Object.assign({},e.defaultPeerScoreParams),t),{topics:t.topics?Object.entries(t.topics).reduce(((t,e)=>{let[r,n]=e;return t[r]=o(n),t}),{}):{}})},e.createTopicScoreParams=o,e.validatePeerScoreParams=function(t){for(const[r,o]of Object.entries(t.topics))try{s(o)}catch(e){throw i(new Error("invalid score parameters for topic ".concat(r,": ").concat(e.message)),n.ERR_INVALID_PEER_SCORE_PARAMS)}if(t.topicScoreCap<0)throw i(new Error("invalid topic score cap; must be positive (or 0 for no cap)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(null===t.appSpecificScore||void 0===t.appSpecificScore)throw i(new Error("missing application specific score function"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.IPColocationFactorWeight>0)throw i(new Error("invalid IPColocationFactorWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.IPColocationFactorWeight&&t.IPColocationFactorThreshold<1)throw i(new Error("invalid IPColocationFactorThreshold; must be at least 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.behaviourPenaltyWeight>0)throw i(new Error("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==t.behaviourPenaltyWeight&&(t.behaviourPenaltyDecay<=0||t.behaviourPenaltyDecay>=1))throw i(new Error("invalid BehaviourPenaltyDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.decayInterval<1e3)throw i(new Error("invalid DecayInterval; must be at least 1s"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(t.decayToZero<=0||t.decayToZero>=1)throw i(new Error("invalid DecayToZero; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS)},e.validateTopicScoreParams=s},50922:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validatePeerScoreThresholds=e.createPeerScoreThresholds=e.defaultPeerScoreThresholds=void 0;const n=r(54442),i=r(67963);e.defaultPeerScoreThresholds={gossipThreshold:-10,publishThreshold:-50,graylistThreshold:-80,acceptPXThreshold:10,opportunisticGraftThreshold:20},e.createPeerScoreThresholds=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},e.defaultPeerScoreThresholds),t)},e.validatePeerScoreThresholds=function(t){if(t.gossipThreshold>0)throw i(new Error("invalid gossip threshold; it must be <= 0"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.publishThreshold>0||t.publishThreshold>t.gossipThreshold)throw i(new Error("invalid publish threshold; it must be <= 0 and <= gossip threshold"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.graylistThreshold>0||t.graylistThreshold>t.publishThreshold)throw i(new Error("invalid graylist threshold; it must be <= 0 and <= publish threshold"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.acceptPXThreshold<0)throw i(new Error("invalid accept PX threshold; it must be >= 0"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(t.opportunisticGraftThreshold<0)throw i(new Error("invalid opportunistic grafting threshold; it must be >= 0"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS)}},32723:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PeerScore=void 0;const o=r(7507),s=r(88338),a=r(51338),u=r(41838),c=r(66759),l=i(r(90190)),h=r(18392),f=r(40963),{ERR_INVALID_SIGNATURE:d,ERR_MISSING_SIGNATURE:p}=f.codes,y=h("libp2p:gossipsub:score");e.PeerScore=class{constructor(t,e){o.validatePeerScoreParams(t),this.params=t,this._connectionManager=e,this.peerStats=new Map,this.peerIPs=new Map,this.scoreCache=new Map,this.deliveryRecords=new u.MessageDeliveries}start(){this._backgroundInterval?y("Peer score already running"):(this._backgroundInterval=setInterval((()=>this.background()),this.params.decayInterval),y("started"))}stop(){this._backgroundInterval?(clearInterval(this._backgroundInterval),delete this._backgroundInterval,this.peerIPs.clear(),this.peerStats.clear(),this.deliveryRecords.clear(),y("stopped")):y("Peer score already stopped")}background(){this._refreshScores(),this._updateIPs(),this.deliveryRecords.gc()}_refreshScores(){const t=Date.now(),e=this.params.decayToZero;this.peerStats.forEach(((r,n)=>{r.connected?(Object.entries(r.topics).forEach((r=>{let[n,i]=r;const o=this.params.topics[n];o&&(i.firstMessageDeliveries*=o.firstMessageDeliveriesDecay,i.firstMessageDeliveries<e&&(i.firstMessageDeliveries=0),i.meshMessageDeliveries*=o.meshMessageDeliveriesDecay,i.meshMessageDeliveries<e&&(i.meshMessageDeliveries=0),i.meshFailurePenalty*=o.meshFailurePenaltyDecay,i.meshFailurePenalty<e&&(i.meshFailurePenalty=0),i.invalidMessageDeliveries*=o.invalidMessageDeliveriesDecay,i.invalidMessageDeliveries<e&&(i.invalidMessageDeliveries=0),i.inMesh&&(i.meshTime=t-i.graftTime,i.meshTime>o.meshMessageDeliveriesActivation&&(i.meshMessageDeliveriesActive=!0)))})),r.behaviourPenalty*=this.params.behaviourPenaltyDecay,r.behaviourPenalty<e&&(r.behaviourPenalty=0),this.scoreCache.set(n,{score:null,cacheUntil:0})):t>r.expire&&(this._removeIPs(n,r.ips),this.peerStats.delete(n))}))}score(t){const e=this.peerStats.get(t);if(!e)return 0;const r=Date.now();let n=this.scoreCache.get(t);void 0===n&&(n={score:null,cacheUntil:0},this.scoreCache.set(t,n));const{score:i,cacheUntil:o}=n;return o>r&&null!==i?i:(n.score=a.computeScore(t,e,this.params,this.peerIPs),n.cacheUntil=r+this.params.decayInterval,n.score)}addPenalty(t,e){const r=this.peerStats.get(t);r&&(r.behaviourPenalty+=e,this.scoreCache.set(t,{score:null,cacheUntil:0}))}addPeer(t){const e=s.createPeerStats({connected:!0});this.peerStats.set(t,e);const r=this._getIPs(t);this._setIPs(t,r,e.ips),e.ips=r}removePeer(t){const e=this.peerStats.get(t);if(e){if(this.score(t)>0)return this._removeIPs(t,e.ips),void this.peerStats.delete(t);this.scoreCache.delete(t),Object.entries(e.topics).forEach((t=>{let[e,r]=t;r.firstMessageDeliveries=0;const n=this.params.topics[e].meshMessageDeliveriesThreshold;if(r.inMesh&&r.meshMessageDeliveriesActive&&r.meshMessageDeliveries<n){const t=n-r.meshMessageDeliveries;r.meshFailurePenalty+=t*t}r.inMesh=!1})),e.connected=!1,e.expire=Date.now()+this.params.retainScore}}graft(t,e){const r=this.peerStats.get(t);if(!r)return;const n=s.ensureTopicStats(e,r,this.params);n&&(n.inMesh=!0,n.graftTime=Date.now(),n.meshTime=0,n.meshMessageDeliveriesActive=!1,this.scoreCache.set(t,{score:null,cacheUntil:0}))}prune(t,e){const r=this.peerStats.get(t);if(!r)return;const n=s.ensureTopicStats(e,r,this.params);if(!n)return;const i=this.params.topics[e].meshMessageDeliveriesThreshold;if(n.meshMessageDeliveriesActive&&n.meshMessageDeliveries<i){const t=i-n.meshMessageDeliveries;n.meshFailurePenalty+=t*t}n.inMesh=!1,this.scoreCache.set(t,{score:null,cacheUntil:0})}validateMessage(t){return n(this,void 0,void 0,(function*(){this.deliveryRecords.ensureRecord(t)}))}deliverMessage(t,e){return n(this,void 0,void 0,(function*(){const r=t.receivedFrom;this._markFirstMessageDelivery(r,t);const n=this.deliveryRecords.ensureRecord(e),i=Date.now();n.status===u.DeliveryRecordStatus.unknown?(n.status=u.DeliveryRecordStatus.valid,n.validated=i,n.peers.forEach((e=>{e!==r&&this._markDuplicateMessageDelivery(e,t)}))):y("unexpected delivery: message from %s was first seen %s ago and has delivery status %d",r,i-n.firstSeen,u.DeliveryRecordStatus[n.status])}))}rejectMessage(t,e,r){return n(this,void 0,void 0,(function*(){const n=t.receivedFrom;switch(r){case p:case d:return void this._markInvalidMessageDelivery(n,t)}const i=this.deliveryRecords.ensureRecord(e);i.status===u.DeliveryRecordStatus.unknown?r!==c.ERR_TOPIC_VALIDATOR_IGNORE?(i.status=u.DeliveryRecordStatus.invalid,this._markInvalidMessageDelivery(n,t),i.peers.forEach((e=>{this._markInvalidMessageDelivery(e,t)}))):i.status=u.DeliveryRecordStatus.ignored:y("unexpected rejection: message from %s was first seen %s ago and has delivery status %d",n,Date.now()-i.firstSeen,u.DeliveryRecordStatus[i.status])}))}duplicateMessage(t,e){return n(this,void 0,void 0,(function*(){const r=t.receivedFrom,n=this.deliveryRecords.ensureRecord(e);if(!n.peers.has(r))switch(n.status){case u.DeliveryRecordStatus.unknown:n.peers.add(r);break;case u.DeliveryRecordStatus.valid:n.peers.add(r),this._markDuplicateMessageDelivery(r,t,n.validated);break;case u.DeliveryRecordStatus.invalid:this._markInvalidMessageDelivery(r,t)}}))}_markInvalidMessageDelivery(t,e){const r=this.peerStats.get(t);r&&(e.topicIDs.forEach((t=>{const e=s.ensureTopicStats(t,r,this.params);e&&(e.invalidMessageDeliveries+=1)})),this.scoreCache.set(t,{score:null,cacheUntil:0}))}_markFirstMessageDelivery(t,e){const r=this.peerStats.get(t);r&&(e.topicIDs.forEach((t=>{const e=s.ensureTopicStats(t,r,this.params);if(!e)return;let n=this.params.topics[t].firstMessageDeliveriesCap;e.firstMessageDeliveries+=1,e.firstMessageDeliveries>n&&(e.firstMessageDeliveries=n),e.inMesh&&(n=this.params.topics[t].meshMessageDeliveriesCap,e.meshMessageDeliveries+=1,e.meshMessageDeliveries>n&&(e.meshMessageDeliveries=n))})),this.scoreCache.set(t,{score:null,cacheUntil:0}))}_markDuplicateMessageDelivery(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.peerStats.get(t);if(!n)return;const i=r?Date.now():0;e.topicIDs.forEach((t=>{const e=s.ensureTopicStats(t,n,this.params);if(!e)return;if(!e.inMesh)return;const o=this.params.topics[t];if(r&&i>r+o.meshMessageDeliveriesWindow)return;const a=o.meshMessageDeliveriesCap;e.meshMessageDeliveries+=1,e.meshMessageDeliveries>a&&(e.meshMessageDeliveries=a)})),this.scoreCache.set(t,{score:null,cacheUntil:0})}_getIPs(t){return this._connectionManager.getAll(l.default.createFromB58String(t)).map((t=>t.remoteAddr.toOptions().host))}_setIPs(t,e,r){t:for(const n of e){for(const t of r)if(n===t)continue t;let e=this.peerIPs.get(n);e||(e=new Set,this.peerIPs.set(n,e)),e.add(t)}t:for(const n of r){for(const t of e)if(n===t)continue t;const r=this.peerIPs.get(n);r&&(r.delete(t),r.size||this.peerIPs.delete(n))}this.scoreCache.set(t,{score:null,cacheUntil:0})}_removeIPs(t,e){e.forEach((e=>{const r=this.peerIPs.get(e);r&&(r.delete(t),r.size||this.peerIPs.delete(e))})),this.scoreCache.set(t,{score:null,cacheUntil:0})}_updateIPs(){this.peerStats.forEach(((t,e)=>{const r=this._getIPs(e);this._setIPs(e,r,t.ips),t.ips=r,this.scoreCache.set(e,{score:null,cacheUntil:0})}))}}},88338:(t,e)=>{"use strict";function r(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({inMesh:!1,graftTime:0,meshTime:0,firstMessageDeliveries:0,meshMessageDeliveries:0,meshMessageDeliveriesActive:!1,meshFailurePenalty:0,invalidMessageDeliveries:0},t)}Object.defineProperty(e,"__esModule",{value:!0}),e.ensureTopicStats=e.createTopicStats=e.createPeerStats=void 0,e.createPeerStats=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({connected:!1,expire:0,ips:[],behaviourPenalty:0},t),{topics:t.topics?Object.entries(t.topics).reduce(((t,e)=>{let[n,i]=e;return t[n]=r(i),t}),{}):{}})},e.createTopicStats=r,e.ensureTopicStats=function(t,e,n){let i=e.topics[t];return i||(n.topics[t]?(e.topics[t]=i=r(),i):void 0)}},61390:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.IWantTracer=void 0;const i=r(66759),o=r(53357),s=r(40963),{ERR_INVALID_SIGNATURE:a,ERR_MISSING_SIGNATURE:u}=s.codes;e.IWantTracer=class{constructor(){this.promises=new Map}addPromise(t,e){const r=e[Math.floor(Math.random()*e.length)],n=o.messageIdToString(r);let s=this.promises.get(n);s||(s=new Map,this.promises.set(n,s)),s.has(t)||s.set(t,Date.now()+i.GossipsubIWantFollowupTime)}getBrokenPromises(){const t=Date.now(),e=new Map;return this.promises.forEach(((r,n)=>{r.forEach(((n,i)=>{n<t&&(e.set(i,(e.get(i)||0)+1),r.delete(i))})),r.size||this.promises.delete(n)})),e}deliverMessage(t){return n(this,void 0,void 0,(function*(){this.promises.delete(t)}))}rejectMessage(t,e){return n(this,void 0,void 0,(function*(){switch(e){case a:case u:return}this.promises.delete(t)}))}clear(){this.promises.clear()}}},37222:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createGossipRpc=void 0,e.createGossipRpc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{subscriptions:[],msgs:t,control:Object.assign({ihave:[],iwant:[],graft:[],prune:[]},e)}}},56714:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasGossipProtocol=void 0;const n=r(66759);e.hasGossipProtocol=function(t){return t===n.GossipsubIDv10||t===n.GossipsubIDv11}},53357:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(37222),e),i(r(92506),e),i(r(56714),e),i(r(79059),e)},79059:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.messageIdFromString=e.messageIdToString=void 0;const n=r(46765),i=r(82051);e.messageIdToString=function(t){return i.toString(t,"base64")},e.messageIdFromString=function(t){return n.fromString(t,"base64")}},92506:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shuffle=void 0,e.shuffle=function(t){if(t.length<=1)return t;for(let e=0;e<t.length;e++){const r=Math.floor(Math.random()*Math.floor(t.length)),n=t[e];t[e]=t[r],t[r]=n}return t}},46561:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleTimeCache=void 0;e.SimpleTimeCache=class{constructor(t){this.lastPruneTime=0,this.entries=new Map,this.validityMs=t.validityMs}put(t,e){this.entries.set(t,{value:e,validUntilMs:Date.now()+this.validityMs}),this.prune()}prune(){const t=Date.now();if(!(t-this.lastPruneTime<200)){this.lastPruneTime=t;for(const[e,r]of this.entries.entries()){if(!(r.validUntilMs<t))break;this.entries.delete(e)}}}has(t){return this.entries.has(t)}get(t){const e=this.entries.get(t);return e&&e.validUntilMs>=Date.now()?e.value:void 0}clear(){this.entries=new Map,this.lastPruneTime=0}}},56044:(t,e,r)=>{"use strict";const n=r(90190),{Multiaddr:i}=r(98719),o=r(67963),{OPEN:s,CLOSING:a,CLOSED:u}=r(55310),c=Symbol.for("@libp2p/interface-connection/connection");class l{constructor(t){let{localAddr:e,remoteAddr:r,localPeer:a,remotePeer:u,newStream:c,close:l,getStreams:h,stat:f}=t;!function(t,e,r,s,a,u,c){if(t&&!i.isMultiaddr(t))throw o(new Error("localAddr must be an instance of multiaddr"),"ERR_INVALID_PARAMETERS");if(!n.isPeerId(e))throw o(new Error("localPeer must be an instance of peer-id"),"ERR_INVALID_PARAMETERS");if(!n.isPeerId(r))throw o(new Error("remotePeer must be an instance of peer-id"),"ERR_INVALID_PARAMETERS");if("function"!==typeof s)throw o(new Error("new stream must be a function"),"ERR_INVALID_PARAMETERS");if("function"!==typeof a)throw o(new Error("close must be a function"),"ERR_INVALID_PARAMETERS");if("function"!==typeof u)throw o(new Error("getStreams must be a function"),"ERR_INVALID_PARAMETERS");if(!c)throw o(new Error("connection metadata object must be provided"),"ERR_INVALID_PARAMETERS");if("inbound"!==c.direction&&"outbound"!==c.direction)throw o(new Error('direction must be "inbound" or "outbound"'),"ERR_INVALID_PARAMETERS");if(!c.timeline)throw o(new Error("connection timeline object must be provided in the stat object"),"ERR_INVALID_PARAMETERS");if(!c.timeline.open)throw o(new Error("connection open timestamp must be provided"),"ERR_INVALID_PARAMETERS");if(!c.timeline.upgraded)throw o(new Error("connection upgraded timestamp must be provided"),"ERR_INVALID_PARAMETERS")}(e,a,u,c,l,h,f),this.id=parseInt(String(1e9*Math.random())).toString(36)+Date.now(),this.localAddr=e,this.remoteAddr=r,this.localPeer=a,this.remotePeer=u,this._stat={...f,status:s},this._newStream=c,this._close=l,this._getStreams=h,this.registry=new Map,this.tags=[]}get[Symbol.toStringTag](){return"Connection"}get[c](){return!0}static isConnection(t){return Boolean(t&&t[c])}get stat(){return this._stat}get streams(){return this._getStreams()}async newStream(t){if(this.stat.status===a)throw o(new Error("the connection is being closed"),"ERR_CONNECTION_BEING_CLOSED");if(this.stat.status===u)throw o(new Error("the connection is closed"),"ERR_CONNECTION_CLOSED");Array.isArray(t)||(t=[t]);const{stream:e,protocol:r}=await this._newStream(t);return this.addStream(e,{protocol:r}),{stream:e,protocol:r}}addStream(t,e){let{protocol:r,metadata:n={}}=e;this.registry.set(t.id,{protocol:r,...n})}removeStream(t){this.registry.delete(t)}async close(){if(this.stat.status!==u){if(this._closing)return this._closing;this.stat.status=a,this._closing=await this._close(),this._stat.timeline.close=Date.now(),this.stat.status=u}}}t.exports=l},4438:(t,e,r)=>{"use strict";e.Connection=r(56044)},55310:t=>{"use strict";t.exports={OPEN:"open",CLOSING:"closing",CLOSED:"closed"}},40963:(t,e)=>{"use strict";e.codes={ERR_INVALID_SIGNATURE_POLICY:"ERR_INVALID_SIGNATURE_POLICY",ERR_UNHANDLED_SIGNATURE_POLICY:"ERR_UNHANDLED_SIGNATURE_POLICY",ERR_MISSING_SIGNATURE:"ERR_MISSING_SIGNATURE",ERR_MISSING_SEQNO:"ERR_MISSING_SEQNO",ERR_INVALID_SIGNATURE:"ERR_INVALID_SIGNATURE",ERR_UNEXPECTED_FROM:"ERR_UNEXPECTED_FROM",ERR_UNEXPECTED_SIGNATURE:"ERR_UNEXPECTED_SIGNATURE",ERR_UNEXPECTED_KEY:"ERR_UNEXPECTED_KEY",ERR_UNEXPECTED_SEQNO:"ERR_UNEXPECTED_SEQNO"}},4782:(t,e,r)=>{"use strict";const n=r(18392),{EventEmitter:i}=r(47465),o=r(67963),{pipe:s}=r(79023),{default:a}=r(12906),u=r(471),{codes:c}=r(40963),{RPC:l}=r(23928),h=r(75776),{SignaturePolicy:f}=r(83983),d=r(36698),{signMessage:p,verifySignature:y}=r(97800);class g extends i{constructor(t){let{debugName:e,multicodecs:r,libp2p:i,globalSignaturePolicy:s=f.StrictSign,canRelayMessage:u=!1,emitSelf:l=!1,messageProcessingConcurrency:h=10}=t;if("string"!==typeof e)throw new Error("a debugname `string` is required");if(!r)throw new Error("multicodecs are required");if(!i)throw new Error("libp2p is required");if(super(),this.log=Object.assign(n(e),{err:n("".concat(e,":error"))}),this.multicodecs=d.ensureArray(r),this._libp2p=i,this.registrar=i.registrar,this.peerId=i.peerId,this.started=!1,this.topics=new Map,this.subscriptions=new Set,this.peers=new Map,!f[s])throw o(new Error("Invalid global signature policy"),c.ERR_INVALID_SIGNATURE_POLICY);this.globalSignaturePolicy=s,this.canRelayMessage=u,this.emitSelf=l,this.topicValidators=new Map,this.queue=new a({concurrency:h}),this._registrarId=void 0,this._onIncomingStream=this._onIncomingStream.bind(this),this._onPeerConnected=this._onPeerConnected.bind(this),this._onPeerDisconnected=this._onPeerDisconnected.bind(this)}async start(){if(this.started)return;this.log("starting"),this.registrar.handle(this.multicodecs,this._onIncomingStream);const t=new u({multicodecs:this.multicodecs,handlers:{onConnect:this._onPeerConnected,onDisconnect:this._onPeerDisconnected}});this._registrarId=await this.registrar.register(t),this.log("started"),this.started=!0}async stop(){this.started&&(this.registrar.unregister(this._registrarId),this.log("stopping"),this.peers.forEach((t=>t.close())),this.peers=new Map,this.subscriptions=new Set,this.started=!1,this.log("stopped"))}_onIncomingStream(t){let{protocol:e,stream:r,connection:n}=t;const i=n.remotePeer,o=i.toB58String(),s=this._addPeer(i,e),a=s.attachInboundStream(r);this._processMessages(o,a,s)}async _onPeerConnected(t,e){const r=t.toB58String();this.log("connected",r);try{const{stream:r,protocol:n}=await e.newStream(this.multicodecs),i=this._addPeer(t,n);await i.attachOutboundStream(r)}catch(n){this.log.err(n)}this._sendSubscriptions(r,Array.from(this.subscriptions),!0)}_onPeerDisconnected(t,e){const r=t.toB58String();this.log("connection ended",r,e?e.message:""),this._removePeer(t)}_addPeer(t,e){const r=t.toB58String(),n=this.peers.get(r);if(n)return n;this.log("new peer",r);const i=new h({id:t,protocol:e});return this.peers.set(r,i),i.once("close",(()=>this._removePeer(t))),i}_removePeer(t){if(!t)return;const e=t.toB58String(),r=this.peers.get(e);if(r){r.removeAllListeners(),r.close(),this.log("delete peer",e),this.peers.delete(e);for(const t of this.topics.values())t.delete(e);return r}}async _processMessages(t,e,r){try{await s(e,(async e=>{for await(const n of e){const e=n instanceof Uint8Array?n:n.slice(),i=this._decodeRpc(e);(async()=>{try{await this._processRpc(t,r,i)}catch(e){this.log.err(e)}})()}}))}catch(n){this._onPeerDisconnected(r.id,n)}}async _processRpc(t,e,r){this.log("rpc from",t);const n=r.subscriptions,i=r.msgs;return n.length&&(n.forEach((e=>{this._processRpcSubOpt(t,e)})),this.emit("pubsub:subscription-change",e.id,n)),this._acceptFrom(t)?(i.length&&this.queue.addAll(i.map((e=>async()=>{if(this.canRelayMessage||e.topicIDs&&e.topicIDs.some((t=>this.subscriptions.has(t))))try{const r=d.normalizeInRpcMessage(e,t);await this._processRpcMessage(r)}catch(r){this.log.err(r)}else this.log("received message we didn't subscribe to. Dropping.")}))),!0):(this.log("received message from unacceptable peer %s",t),!1)}_processRpcSubOpt(t,e){const r=e.topicID;if(!r)return;let n=this.topics.get(r);n||(n=new Set,this.topics.set(r,n)),e.subscribe?n.add(t):n.delete(t)}async _processRpcMessage(t){if(this.peerId.toB58String()!==t.from||this.emitSelf){try{await this.validate(t)}catch(e){return void this.log("Message is invalid, dropping it. %O",e)}return this._emitMessage(t),this._publish(d.normalizeOutRpcMessage(t))}}_emitMessage(t){t.topicIDs.forEach((e=>{this.subscriptions.has(e)&&this.emit(e,t)}))}getMsgId(t){const e=this.globalSignaturePolicy;switch(e){case f.StrictSign:return d.msgId(t.from,t.seqno);case f.StrictNoSign:return d.noSignMsgId(t.data);default:throw o(new Error("Cannot get message id: unhandled signature policy: "+e),c.ERR_UNHANDLED_SIGNATURE_POLICY)}}_acceptFrom(t){return!0}_decodeRpc(t){return l.decode(t)}_encodeRpc(t){return l.encode(t).finish()}_sendRpc(t,e){const r=this.peers.get(t);if(r&&r.isWritable)r.write(this._encodeRpc(e));else{const e="Cannot send RPC to ".concat(t," as there is no open stream to it available");this.log.err(e)}}_sendSubscriptions(t,e,r){return this._sendRpc(t,{subscriptions:e.map((t=>({topicID:t,subscribe:r})))})}async validate(t){const e=this.globalSignaturePolicy;switch(e){case f.StrictNoSign:if(t.from)throw o(new Error("StrictNoSigning: from should not be present"),c.ERR_UNEXPECTED_FROM);if(t.signature)throw o(new Error("StrictNoSigning: signature should not be present"),c.ERR_UNEXPECTED_SIGNATURE);if(t.key)throw o(new Error("StrictNoSigning: key should not be present"),c.ERR_UNEXPECTED_KEY);if(t.seqno)throw o(new Error("StrictNoSigning: seqno should not be present"),c.ERR_UNEXPECTED_SEQNO);break;case f.StrictSign:if(!t.signature)throw o(new Error("StrictSigning: Signing required and no signature was present"),c.ERR_MISSING_SIGNATURE);if(!t.seqno)throw o(new Error("StrictSigning: Signing required and no seqno was present"),c.ERR_MISSING_SEQNO);if(!await y(t))throw o(new Error("StrictSigning: Invalid message signature"),c.ERR_INVALID_SIGNATURE);break;default:throw o(new Error("Cannot validate message: unhandled signature policy: "+e),c.ERR_UNHANDLED_SIGNATURE_POLICY)}for(const r of t.topicIDs){const e=this.topicValidators.get(r);e&&await e(r,t)}}_buildMessage(t){const e=this.globalSignaturePolicy;switch(e){case f.StrictSign:return t.from=this.peerId.toB58String(),t.seqno=d.randomSeqno(),p(this.peerId,t);case f.StrictNoSign:return Promise.resolve(t);default:throw o(new Error("Cannot build message: unhandled signature policy: "+e),c.ERR_UNHANDLED_SIGNATURE_POLICY)}}getSubscribers(t){if(!this.started)throw o(new Error("not started yet"),"ERR_NOT_STARTED_YET");if(!t||"string"!==typeof t)throw o(new Error("a string topic must be provided"),"ERR_NOT_VALID_TOPIC");const e=this.topics.get(t);return e?Array.from(e):[]}async publish(t,e){if(!this.started)throw new Error("Pubsub has not started");this.log("publish",t,e);const r={receivedFrom:this.peerId.toB58String(),data:e,topicIDs:[t]},n=await this._buildMessage(r),i=d.normalizeInRpcMessage(n);this.emitSelf&&this._emitMessage(i),await this._publish(i)}_publish(t){throw o(new Error("publish must be implemented by the subclass"),"ERR_NOT_IMPLEMENTED")}subscribe(t){if(!this.started)throw new Error("Pubsub has not started");this.subscriptions.has(t)||(this.subscriptions.add(t),this.peers.forEach(((e,r)=>this._sendSubscriptions(r,[t],!0))))}unsubscribe(t){if(!this.started)throw new Error("Pubsub is not started");this.subscriptions.has(t)&&0===this.listenerCount(t)&&(this.subscriptions.delete(t),this.peers.forEach(((e,r)=>this._sendSubscriptions(r,[t],!1))))}getTopics(){if(!this.started)throw new Error("Pubsub is not started");return Array.from(this.subscriptions)}}g.utils=d,g.SignaturePolicy=f,t.exports=g},23928:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-pubsub-rpc"]||(n.roots["libp2p-pubsub-rpc"]={});a.RPC=function(){function t(t){if(this.subscriptions=[],this.msgs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.subscriptions=s.emptyArray,t.prototype.msgs=s.emptyArray,t.encode=function(t,e){if(e||(e=o.create()),null!=t.subscriptions&&t.subscriptions.length)for(var r=0;r<t.subscriptions.length;++r)a.RPC.SubOpts.encode(t.subscriptions[r],e.uint32(10).fork()).ldelim();if(null!=t.msgs&&t.msgs.length)for(r=0;r<t.msgs.length;++r)a.RPC.Message.encode(t.msgs[r],e.uint32(18).fork()).ldelim();return e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.RPC;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.subscriptions&&n.subscriptions.length||(n.subscriptions=[]),n.subscriptions.push(a.RPC.SubOpts.decode(t,t.uint32()));break;case 2:n.msgs&&n.msgs.length||(n.msgs=[]),n.msgs.push(a.RPC.Message.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.RPC)return t;var e=new a.RPC;if(t.subscriptions){if(!Array.isArray(t.subscriptions))throw TypeError(".RPC.subscriptions: array expected");e.subscriptions=[];for(var r=0;r<t.subscriptions.length;++r){if("object"!==typeof t.subscriptions[r])throw TypeError(".RPC.subscriptions: object expected");e.subscriptions[r]=a.RPC.SubOpts.fromObject(t.subscriptions[r])}}if(t.msgs){if(!Array.isArray(t.msgs))throw TypeError(".RPC.msgs: array expected");e.msgs=[];for(r=0;r<t.msgs.length;++r){if("object"!==typeof t.msgs[r])throw TypeError(".RPC.msgs: object expected");e.msgs[r]=a.RPC.Message.fromObject(t.msgs[r])}}return e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.subscriptions=[],r.msgs=[]),t.subscriptions&&t.subscriptions.length){r.subscriptions=[];for(var n=0;n<t.subscriptions.length;++n)r.subscriptions[n]=a.RPC.SubOpts.toObject(t.subscriptions[n],e)}if(t.msgs&&t.msgs.length){r.msgs=[];for(n=0;n<t.msgs.length;++n)r.msgs[n]=a.RPC.Message.toObject(t.msgs[n],e)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t.SubOpts=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var e;return t.prototype.subscribe=null,t.prototype.topicID=null,Object.defineProperty(t.prototype,"_subscribe",{get:s.oneOfGetter(e=["subscribe"]),set:s.oneOfSetter(e)}),Object.defineProperty(t.prototype,"_topicID",{get:s.oneOfGetter(e=["topicID"]),set:s.oneOfSetter(e)}),t.encode=function(t,e){return e||(e=o.create()),null!=t.subscribe&&Object.hasOwnProperty.call(t,"subscribe")&&e.uint32(8).bool(t.subscribe),null!=t.topicID&&Object.hasOwnProperty.call(t,"topicID")&&e.uint32(18).string(t.topicID),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.RPC.SubOpts;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.subscribe=t.bool();break;case 2:n.topicID=t.string();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.RPC.SubOpts)return t;var e=new a.RPC.SubOpts;return null!=t.subscribe&&(e.subscribe=Boolean(t.subscribe)),null!=t.topicID&&(e.topicID=String(t.topicID)),e},t.toObject=function(t,e){e||(e={});var r={};return null!=t.subscribe&&t.hasOwnProperty("subscribe")&&(r.subscribe=t.subscribe,e.oneofs&&(r._subscribe="subscribe")),null!=t.topicID&&t.hasOwnProperty("topicID")&&(r.topicID=t.topicID,e.oneofs&&(r._topicID="topicID")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t.Message=function(){function t(t){if(this.topicIDs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var e;return t.prototype.from=null,t.prototype.data=null,t.prototype.seqno=null,t.prototype.topicIDs=s.emptyArray,t.prototype.signature=null,t.prototype.key=null,Object.defineProperty(t.prototype,"_from",{get:s.oneOfGetter(e=["from"]),set:s.oneOfSetter(e)}),Object.defineProperty(t.prototype,"_data",{get:s.oneOfGetter(e=["data"]),set:s.oneOfSetter(e)}),Object.defineProperty(t.prototype,"_seqno",{get:s.oneOfGetter(e=["seqno"]),set:s.oneOfSetter(e)}),Object.defineProperty(t.prototype,"_signature",{get:s.oneOfGetter(e=["signature"]),set:s.oneOfSetter(e)}),Object.defineProperty(t.prototype,"_key",{get:s.oneOfGetter(e=["key"]),set:s.oneOfSetter(e)}),t.encode=function(t,e){if(e||(e=o.create()),null!=t.from&&Object.hasOwnProperty.call(t,"from")&&e.uint32(10).bytes(t.from),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&e.uint32(18).bytes(t.data),null!=t.seqno&&Object.hasOwnProperty.call(t,"seqno")&&e.uint32(26).bytes(t.seqno),null!=t.topicIDs&&t.topicIDs.length)for(var r=0;r<t.topicIDs.length;++r)e.uint32(34).string(t.topicIDs[r]);return null!=t.signature&&Object.hasOwnProperty.call(t,"signature")&&e.uint32(42).bytes(t.signature),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&e.uint32(50).bytes(t.key),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.RPC.Message;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.from=t.bytes();break;case 2:n.data=t.bytes();break;case 3:n.seqno=t.bytes();break;case 4:n.topicIDs&&n.topicIDs.length||(n.topicIDs=[]),n.topicIDs.push(t.string());break;case 5:n.signature=t.bytes();break;case 6:n.key=t.bytes();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.RPC.Message)return t;var e=new a.RPC.Message;if(null!=t.from&&("string"===typeof t.from?s.base64.decode(t.from,e.from=s.newBuffer(s.base64.length(t.from)),0):t.from.length&&(e.from=t.from)),null!=t.data&&("string"===typeof t.data?s.base64.decode(t.data,e.data=s.newBuffer(s.base64.length(t.data)),0):t.data.length&&(e.data=t.data)),null!=t.seqno&&("string"===typeof t.seqno?s.base64.decode(t.seqno,e.seqno=s.newBuffer(s.base64.length(t.seqno)),0):t.seqno.length&&(e.seqno=t.seqno)),t.topicIDs){if(!Array.isArray(t.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");e.topicIDs=[];for(var r=0;r<t.topicIDs.length;++r)e.topicIDs[r]=String(t.topicIDs[r])}return null!=t.signature&&("string"===typeof t.signature?s.base64.decode(t.signature,e.signature=s.newBuffer(s.base64.length(t.signature)),0):t.signature.length&&(e.signature=t.signature)),null!=t.key&&("string"===typeof t.key?s.base64.decode(t.key,e.key=s.newBuffer(s.base64.length(t.key)),0):t.key.length&&(e.key=t.key)),e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.topicIDs=[]),null!=t.from&&t.hasOwnProperty("from")&&(r.from=e.bytes===String?s.base64.encode(t.from,0,t.from.length):e.bytes===Array?Array.prototype.slice.call(t.from):t.from,e.oneofs&&(r._from="from")),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?s.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data,e.oneofs&&(r._data="data")),null!=t.seqno&&t.hasOwnProperty("seqno")&&(r.seqno=e.bytes===String?s.base64.encode(t.seqno,0,t.seqno.length):e.bytes===Array?Array.prototype.slice.call(t.seqno):t.seqno,e.oneofs&&(r._seqno="seqno")),t.topicIDs&&t.topicIDs.length){r.topicIDs=[];for(var n=0;n<t.topicIDs.length;++n)r.topicIDs[n]=t.topicIDs[n]}return null!=t.signature&&t.hasOwnProperty("signature")&&(r.signature=e.bytes===String?s.base64.encode(t.signature,0,t.signature.length):e.bytes===Array?Array.prototype.slice.call(t.signature):t.signature,e.oneofs&&(r._signature="signature")),null!=t.key&&t.hasOwnProperty("key")&&(r.key=e.bytes===String?s.base64.encode(t.key,0,t.key.length):e.bytes===Array?Array.prototype.slice.call(t.key):t.key,e.oneofs&&(r._key="key")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t}(),t.exports=a},97800:(t,e,r)=>{"use strict";const n=r(90190),{RPC:i}=r(23928),{concat:o}=r(62110),{fromString:s}=r(46765),a=s("libp2p-pubsub:"),{normalizeOutRpcMessage:u}=r(36698);async function c(t){if(!t.from)throw new Error("Could not get the public key from the originator id");const e=n.createFromB58String(t.from);if(t.key){const r=await n.createFromPubKey(t.key);if(r.equals(e))return r.pubKey;throw new Error("Public Key does not match the originator")}if(e.pubKey)return e.pubKey;throw new Error("Could not get the public key from the originator id")}t.exports={messagePublicKey:c,signMessage:async function(t,e){const r=o([a,i.Message.encode(u(e)).finish()]),n=await t.privKey.sign(r);return{...e,signature:n,key:t.pubKey.bytes}},SignPrefix:a,verifySignature:async function(t){if(!t.signature)throw new Error("Message must contain a signature to be verified");if(!t.from)throw new Error("Message must contain a from property to be verified");const e=o([a,i.Message.encode({...t,from:n.createFromB58String(t.from).toBytes(),signature:void 0,key:void 0}).finish()]);return(await c(t)).verify(e,t.signature)}}},75776:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p-pubsub:peer-streams"),{error:n("libp2p-pubsub:peer-streams:err")}),{EventEmitter:o}=r(47465),s=r(44709),a=r(77674),{pipe:u}=r(79023),{source:c}=r(64183);t.exports=class extends o{constructor(t){let{id:e,protocol:r}=t;super(),this.id=e,this.protocol=r,this._rawOutboundStream=null,this._rawInboundStream=null,this._inboundAbortController=new AbortController,this.outboundStream=null,this.inboundStream=null}get isReadable(){return Boolean(this.inboundStream)}get isWritable(){return Boolean(this.outboundStream)}write(t){if(!this.outboundStream){const t=this.id.toB58String();throw new Error("No writable connection to "+t)}this.outboundStream.push(t)}attachInboundStream(t){return this._rawInboundStream=t,this.inboundStream=c(u(this._rawInboundStream,s.decode()),this._inboundAbortController.signal,{returnOnAbort:!0}),this.emit("stream:inbound"),this.inboundStream}async attachOutboundStream(t){const e=this.outboundStream;this.outboundStream&&await this.outboundStream.end(),this._rawOutboundStream=t,this.outboundStream=a({onEnd:t=>{this._rawOutboundStream&&this._rawOutboundStream.reset&&this._rawOutboundStream.reset(),this._rawOutboundStream=null,this.outboundStream=null,t&&this.emit("close")}}),u(this.outboundStream,s.encode(),this._rawOutboundStream).catch((t=>{i.error(t)})),e||this.emit("stream:outbound")}close(){this.outboundStream&&this.outboundStream.end(),this.inboundStream&&this._inboundAbortController.abort(),this._rawOutboundStream=null,this.outboundStream=null,this._rawInboundStream=null,this.inboundStream=null,this.emit("close")}}},83983:(t,e)=>{"use strict";e.SignaturePolicy={StrictSign:"StrictSign",StrictNoSign:"StrictNoSign"}},36698:(t,e,r)=>{"use strict";const n=r(31158),{toString:i}=r(82051),{fromString:o}=r(46765),s=r(90190),{sha256:a}=r(19400);t.exports={randomSeqno:()=>n(8),msgId:(t,e)=>{let r;r=t instanceof Uint8Array?s.createFromBytes(t).id:s.parse(t).id;const n=new Uint8Array(r.length+e.length);return n.set(r,0),n.set(e,r.length),n},noSignMsgId:t=>a.encode(t),anyMatch:(t,e)=>{let r;r=Array.isArray(e)?t=>e.indexOf(t)>-1:t=>e.has(t);for(const n of t)if(r(n))return!0;return!1},ensureArray:t=>Array.isArray(t)?t:[t],normalizeInRpcMessage:(t,e)=>{const r=Object.assign({},t);return t.from instanceof Uint8Array&&(r.from=i(t.from,"base58btc")),e&&(r.receivedFrom=e),r},normalizeOutRpcMessage:t=>{const e=Object.assign({},t);return"string"===typeof t.from&&(e.from=o(t.from,"base58btc")),"string"===typeof t.data&&(e.data=o(t.data)),e}}},59617:t=>{"use strict";const e=()=>{},r=Symbol.for("@libp2p/js-interfaces/topology");class n{constructor(t){let{min:r=0,max:n=1/0,handlers:i={}}=t;this.min=r,this.max=n,this._onConnect=i.onConnect||e,this._onDisconnect=i.onDisconnect||e,this.peers=new Set}get[Symbol.toStringTag](){return"Topology"}get[r](){return!0}static isTopology(t){return Boolean(t&&t[r])}async setRegistrar(t){this._registrar=t}disconnect(t){this._onDisconnect(t)}}t.exports=n},471:(t,e,r)=>{"use strict";const n=r(59617),i=Symbol.for("@libp2p/js-interfaces/topology/multicodec-topology"),o=r(18392),s=Object.assign(o("libp2p:topology:multicodec-topology"),{error:o("libp2p:topology:multicodec-topology:error")});class a extends n{constructor(t){let{min:e,max:r,multicodecs:n,handlers:i}=t;if(super({min:e,max:r,handlers:i}),!n)throw new Error("one or more multicodec should be provided");if(!i)throw new Error("the handlers should be provided");if("function"!==typeof i.onConnect)throw new Error("the 'onConnect' handler must be provided");if("function"!==typeof i.onDisconnect)throw new Error("the 'onDisconnect' handler must be provided");this.multicodecs=Array.isArray(n)?n:[n],this._registrar=void 0,this._onProtocolChange=this._onProtocolChange.bind(this),this._onPeerConnect=this._onPeerConnect.bind(this)}get[Symbol.toStringTag](){return"Topology"}get[i](){return!0}static isMulticodecTopology(t){return Boolean(t&&t[i])}async setRegistrar(t){this._registrar=t,this._registrar.peerStore.on("change:protocols",this._onProtocolChange),this._registrar.connectionManager.on("peer:connect",this._onPeerConnect),await this._updatePeers(this._registrar.peerStore.getPeers())}async _updatePeers(t){for await(const{id:e,protocols:r}of t)if(this.multicodecs.filter((t=>r.includes(t))).length){this.peers.add(e.toB58String());const t=this._registrar.getConnection(e);t&&this._onConnect(e,t)}else this.peers.delete(e.toB58String())}async _onProtocolChange(t){let{peerId:e,protocols:r}=t;try{const t=this.peers.has(e.toB58String()),n=r.filter((t=>this.multicodecs.includes(t)));t&&0===n.length&&this._onDisconnect(e);for(const i of r)if(this.multicodecs.includes(i)){const t=await this._registrar.peerStore.get(e);return void await this._updatePeers([t])}}catch(n){s.error(n)}}async _onPeerConnect(t){try{const e=t.remotePeer,r=await this._registrar.peerStore.protoBook.get(e);if(!r)return;this.multicodecs.find((t=>r.includes(t)))&&(this.peers.add(e.toB58String()),this._onConnect(e,t))}catch(e){s.error(e)}}}t.exports=a},56243:(t,e,r)=>{"use strict";const n=r(74561),i=r(41976);t.exports=t=>async function*(){const e=new o;for await(const r of t){const t=e.write(r);t.length&&(yield t)}}();class o{constructor(){this._buffer=new i,this._bufferProxy=new Proxy({},{get:(t,e)=>"l"===e[0]?this._buffer[e]:this._buffer.get(parseInt(e))}),this._headerInfo=null}write(t){if(!t||!t.length)return[];this._buffer.append(t);const e=[];for(;this._buffer.length;){if(!this._headerInfo)try{this._headerInfo=this._decodeHeader(this._bufferProxy)}catch(r){break}const{id:t,type:n,length:i,offset:o}=this._headerInfo;if(this._buffer.length-o<i)break;e.push({id:t,type:n,data:this._buffer.shallowSlice(o,o+i)}),this._buffer.consume(o+i),this._headerInfo=null}return e}_decodeHeader(t){const e=n.decode(t);let r=n.decode.bytes;const i=n.decode(t,r);return r+=n.decode.bytes,{id:e>>3,type:7&e,offset:r,length:i}}}},68536:(t,e,r)=>{"use strict";const n=r(74561),i=r(41976),o=10240;const s=new class{constructor(){this._pool=new Uint8Array(o),this._poolOffset=0}write(t){const e=this._pool;let r=this._poolOffset;n.encode(t.id<<3|t.type,e,r),r+=n.encode.bytes,n.encode(t.data?t.data.length:0,e,r),r+=n.encode.bytes;const i=e.subarray(this._poolOffset,r);return o-r<100?(this._pool=new Uint8Array(o),this._poolOffset=0):this._poolOffset=r,t.data?[i,t.data]:i}};t.exports=t=>async function*(){for await(const e of t)Array.isArray(e)?yield new i(e.map((t=>s.write(t)))):yield new i(s.write(e))}()},82540:(t,e,r)=>{"use strict";e.encode=r(68536),e.decode=r(56243)},34875:(t,e,r)=>{"use strict";t.exports=r(98187)},3678:(t,e)=>{"use strict";const r=Object.freeze({NEW_STREAM:0,MESSAGE_RECEIVER:1,MESSAGE_INITIATOR:2,CLOSE_RECEIVER:3,CLOSE_INITIATOR:4,RESET_RECEIVER:5,RESET_INITIATOR:6});e.MessageTypes=r,e.InitiatorMessageTypes=Object.freeze({NEW_STREAM:r.NEW_STREAM,MESSAGE:r.MESSAGE_INITIATOR,CLOSE:r.CLOSE_INITIATOR,RESET:r.RESET_INITIATOR}),e.ReceiverMessageTypes=Object.freeze({MESSAGE:r.MESSAGE_RECEIVER,CLOSE:r.CLOSE_RECEIVER,RESET:r.RESET_RECEIVER}),e.MessageTypeNames=Object.freeze(Object.entries(r).reduce(((t,e)=>(t[e[1]]=e[0],t)),{}))},98187:(t,e,r)=>{"use strict";const n=r(79023),i=r(77674),o=r(18392)("libp2p:mplex"),s=r(64183),a=r(82540),u=r(2233),{MessageTypes:c,MessageTypeNames:l}=r(3678),h=r(78840);class f{constructor(t){t="function"===typeof(t=t||{})?{onStream:t}:t,this._streamId=0,this._streams={initiators:new Map,receivers:new Map},this._options=t,this.sink=this._createSink(),this.source=this._createSource(),this.onStream=t.onStream,this.onStreamEnd=t.onStreamEnd}get streams(){const t=[];return this._streams.initiators.forEach((e=>{t.push(e)})),this._streams.receivers.forEach((e=>{t.push(e)})),t}newStream(t){const e=this._streamId++;t=null==t?e.toString():String(t);const r=this._streams.initiators;return this._newStream({id:e,name:t,type:"initiator",registry:r})}_newReceiverStream(t){let{id:e,name:r}=t;const n=this._streams.receivers;return this._newStream({id:e,name:r,type:"receiver",registry:n})}_newStream(t){let{id:e,name:r,type:n,registry:i}=t;if(i.has(e))throw new Error("".concat(n," stream ").concat(e," already exists!"));o("new %s stream %s %s",n,e,r);const s=h({id:e,name:r,send:t=>(o.enabled&&o("%s stream %s %s send",n,e,r,{...t,type:l[t.type],data:t.data&&t.data.slice()}),this.source.push(t)),type:n,onEnd:()=>{o("%s stream %s %s ended",n,e,r),i.delete(e),this.onStreamEnd&&this.onStreamEnd(s)},maxMsgSize:this._options.maxMsgSize});return i.set(e,s),s}_createSink(){return async t=>{this._options.signal&&(t=s(t,this._options.signal));try{await n(t,a.decode,u(this._options.maxMsgSize),(async t=>{for await(const e of t)for(const t of e)this._handleIncoming(t)}))}catch(e){return o("error in sink",e),this.source.end(e)}this.source.end()}}_createSource(){const t=i({onEnd:t=>{const{initiators:e,receivers:r}=this._streams;for(const n of e.values())n.abort(t);for(const n of r.values())n.abort(t)},writev:!0});return Object.assign(a.encode(t),{push:t.push,end:t.end,return:t.return})}_handleIncoming(t){let{id:e,type:r,data:n}=t;if(o.enabled&&o("incoming message",{id:e,type:l[r],data:n.slice()}),r===c.NEW_STREAM&&this.onStream){const t=this._newReceiverStream({id:e,name:n.toString()});return this.onStream(t)}const i=(1&r?this._streams.initiators:this._streams.receivers).get(e);if(!i)return o("missing stream %s",e);switch(r){case c.MESSAGE_INITIATOR:case c.MESSAGE_RECEIVER:i.source.push(n);break;case c.CLOSE_INITIATOR:case c.CLOSE_RECEIVER:i.close();break;case c.RESET_INITIATOR:case c.RESET_RECEIVER:i.reset();break;default:o("unknown message type %s",r)}}}f.multicodec="/mplex/6.7.0",t.exports=f},2233:t=>{"use strict";const e=1<<20;t.exports=t=>{t=t||e;const r=e=>{if(e.data&&e.data.length>t)throw Object.assign(new Error("message size too large!"),{code:"ERR_MSG_TOO_BIG"})};return t=>async function*(){for await(const e of t)Array.isArray(e)?e.forEach(r):r(e),yield e}()},t.exports.MAX_MSG_SIZE=e},78840:(t,e,r)=>{"use strict";const n=r(64183),i=r(18392)("libp2p:mplex:stream"),o=r(77674),s=r(41976),a=r(67963),{MAX_MSG_SIZE:u}=r(2233),{InitiatorMessageTypes:c,ReceiverMessageTypes:l}=r(3678),h="ERR_MPLEX_STREAM_RESET";t.exports=t=>{let{id:e,name:r,send:f,onEnd:d=(()=>{}),type:p="initiator",maxMsgSize:y=u}=t;const g=new AbortController,m=new AbortController,b="initiator"===p?c:l,v="initiator"===p?"i".concat(e):"r".concat(e);r=String(null==r?e:r);let w,_=!1,E=!1;const S=t=>{E||(E=!0,i("%s stream %s sink end",p,r,t),t&&!w&&(w=t),_&&(I.timeline.close=Date.now(),d(w)))},I={close:()=>I.source.end(),abort:t=>{i("%s stream %s abort",p,r,t),I.source.end(t),g.abort(),S(t)},reset:()=>{const t=a(new Error("stream reset"),h);m.abort(),I.source.end(t),S(t)},sink:async t=>{t=n(t,[{signal:g.signal,options:{abortMessage:"stream aborted",abortCode:"ERR_MPLEX_STREAM_ABORT"}},{signal:m.signal,options:{abortMessage:"stream reset",abortCode:h}}]),"initiator"===p&&f({id:e,type:b.NEW_STREAM,data:r});try{for await(let r of t)for(;r.length;){if(r.length<=y){f({id:e,type:b.MESSAGE,data:r});break}r=s.isBufferList(r)?r:new s(r),f({id:e,type:b.MESSAGE,data:r.shallowSlice(0,y)}),r.consume(y)}}catch(o){return o.code===h?i("%s stream %s reset",p,r):(i("%s stream %s error",p,r,o),f({id:e,type:b.RESET})),I.source.end(o),S(o)}f({id:e,type:b.CLOSE}),S()},source:o((t=>{_||(_=!0,i("%s stream %s source end",p,r,t),t&&!w&&(w=t),E&&(I.timeline.close=Date.now(),d(w)))})),timeline:{open:Date.now(),close:null},id:v};return I}},27780:(t,e,r)=>{"use strict";const n=r(85510);function i(t,e){const r=n(t.multiaddr),i=n(e.multiaddr);return r&&!i?1:!r&&i||t.isCertified&&!e.isCertified?-1:!t.isCertified&&e.isCertified?1:0}t.exports.publicAddressesFirst=function(t){return[...t].sort(i)}},80710:t=>{"use strict";t.exports=function(t,e){return t.length===e.length&&e.sort()&&t.sort().every(((t,r)=>e[r].equals(t)))}},24578:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:ip-port-to-multiaddr"),{error:n("libp2p:ip-port-to-multiaddr:err")}),{Multiaddr:o}=r(98719),s=r(67963),{Address4:a,Address6:u}=r(96831),c={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};t.exports=function(t,e){if("string"!==typeof t)throw s(new Error("invalid ip provided: ".concat(t)),c.ERR_INVALID_IP_PARAMETER);if("string"===typeof e&&(e=parseInt(e)),isNaN(e))throw s(new Error("invalid port provided: ".concat(e)),c.ERR_INVALID_PORT_PARAMETER);try{return new a(t),new o("/ip4/".concat(t,"/tcp/").concat(e))}catch{}try{const r=new u(t);return r.is4()?new o("/ip4/".concat(r.to4().correctForm(),"/tcp/").concat(e)):new o("/ip6/".concat(t,"/tcp/").concat(e))}catch(r){const n="invalid ip:port for creating a multiaddr: ".concat(t,":").concat(e);throw i.error(n),s(new Error(n),c.ERR_INVALID_IP)}},t.exports.Errors=c},57349:(t,e,r)=>{"use strict";const n=r(56209);t.exports=function(t){const{address:e}=t.nodeAddress();return n(e)}},85510:(t,e,r)=>{"use strict";const n=r(83931);t.exports=function(t){const{address:e}=t.nodeAddress();return n(e)}},68308:(t,e,r)=>{"use strict";const{source:n}=r(64183),i=r(18392)("libp2p:stream:converter");t.exports=function(t){let{stream:e,remoteAddr:r,localAddr:o}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sink:a,source:u}=e,c={async sink(t){s.signal&&(t=n(t,s.signal));try{await a(t)}catch(e){"aborted"!==e.type&&i(e)}l()},source:s.signal?n(u,s.signal):u,conn:e,localAddr:o,remoteAddr:r,timeline:{open:Date.now(),close:void 0},close:()=>(a(new Uint8Array(0)),l())};function l(){return c.timeline.close||(c.timeline.close=Date.now()),Promise.resolve()}return c}},45001:(t,e)=>{"use strict";e.CODE_P2P=421,e.CODE_CIRCUIT=290,e.CODE_TCP=6,e.CODE_WS=477,e.CODE_WSS=478,e.CLOSE_TIMEOUT=2e3},44169:(t,e,r)=>{"use strict";const n=r(18322),{CODE_CIRCUIT:i,CODE_P2P:o,CODE_TCP:s,CODE_WS:a,CODE_WSS:u}=r(45001);t.exports={all:t=>t.filter((t=>{if(t.protoCodes().includes(i))return!1;const e=t.decapsulateCode(o);return n.WebSockets.matches(e)||n.WebSocketsSecure.matches(e)})),dnsWss:t=>t.filter((t=>{if(t.protoCodes().includes(i))return!1;const e=t.decapsulateCode(o);return n.WebSocketsSecure.matches(e)&&n.DNS.matches(e.decapsulateCode(s).decapsulateCode(u))})),dnsWsOrWss:t=>t.filter((t=>{if(t.protoCodes().includes(i))return!1;const e=t.decapsulateCode(o);return n.WebSockets.matches(e)?n.DNS.matches(e.decapsulateCode(s).decapsulateCode(a)):n.WebSocketsSecure.matches(e)&&n.DNS.matches(e.decapsulateCode(s).decapsulateCode(u))}))}},3300:(t,e,r)=>{"use strict";const n=r(88042),i=r(83708),o=r(94655),{AbortError:s}=r(64183),a=r(70121),u=r(18392),c=u("libp2p:websockets");c.error=u("libp2p:websockets:error");const l=r(96927),h=r(91227),f=r(75247),d=r(44169);t.exports=i(class{constructor(t){let{upgrader:e,filter:r}=t;if(!e)throw new Error("An upgrader must be provided. See https://github.com/libp2p/interface-transport#upgrader.");this._upgrader=e,this._filter=r}async dial(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c("dialing %s",t);const r=await this._connect(t,e),n=f(r,{remoteAddr:t,signal:e.signal});c("new outbound connection %s",n.remoteAddr);const i=await this._upgrader.upgradeOutbound(n);return c("outbound connection %s upgraded",n.remoteAddr),i}async _connect(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.signal&&e.signal.aborted)throw new s;const r=t.toOptions();c("dialing %s:%s",r.host,r.port);const i=a(),u=t=>{const e="connection error: ".concat(t.message);c.error(e),i.reject(t)},l=n(o(t),Object.assign({binary:!0},e));if(l.socket.on?l.socket.on("error",u):l.socket.onerror=u,!e.signal)return await Promise.race([l.connected(),i.promise]),c("connected %s",t),l;let h;const f=new Promise(((t,r)=>{if(h=()=>{r(new s),setTimeout((()=>{l.close()}))},e.signal.aborted)return h();e.signal.addEventListener("abort",h)}));try{await Promise.race([f,i.promise,l.connected()])}finally{e.signal.removeEventListener("abort",h)}return c("connected %s",t),l}createListener(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return"function"===typeof t&&(e=t,t={}),h({handler:e,upgrader:this._upgrader},t)}filter(t){return t=Array.isArray(t)?t:[t],this._filter?this._filter(t):l.isBrowser||l.isWebWorker?d.dnsWss(t):d.all(t)}},{className:"WebSockets",symbolName:"@libp2p/js-libp2p-websockets/websockets"})},91227:t=>{"use strict";t.exports=function(){throw new Error("WebSocket Servers can not be created in the browser!")}},75247:(t,e,r)=>{"use strict";const n=r(64183),{CLOSE_TIMEOUT:i}=r(45001),o=r(24578),s=r(23807),a=r(18392),u=a("libp2p:websockets:socket");u.error=a("libp2p:websockets:socket:error"),t.exports=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={async sink(r){e.signal&&(r=n(r,e.signal));try{await t.sink(async function*(){for await(const t of r)yield t instanceof Uint8Array?t:t.slice()}())}catch(i){"aborted"!==i.type&&u.error(i)}},source:e.signal?n(t.source,e.signal):t.source,conn:t,localAddr:e.localAddr||(t.localAddress&&t.localPort?o(t.localAddress,t.localPort):void 0),remoteAddr:e.remoteAddr||o(t.remoteAddress,t.remotePort),timeline:{open:Date.now()},async close(){const e=Date.now();try{await s(t.close(),i)}catch(n){const{host:i,port:o}=r.remoteAddr.toOptions();u("timeout closing stream to %s:%s after %dms, destroying it manually",i,o,Date.now()-e),t.destroy()}finally{r.timeline.close=Date.now()}}};return t.socket.once&&t.socket.once("close",(()=>{r.timeline.close||(r.timeline.close=Date.now())})),r}},28085:(t,e,r)=>{var n=r(37934);function i(t,e){n.cipher.registerAlgorithm(t,(function(){return new n.aes.Algorithm(t,e)}))}r(36876),r(98219),r(31330),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){l||h();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return d(r._w,t,e,!1)},decrypt:function(t,e){return d(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!==typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i<e.length;++i)r.putByte(e[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){e=r,r=[];var o=e.length();if(16===o||24===o||32===o){o>>>=2;for(i=0;i<o;++i)r.push(e.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,a=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=f(r,t.decrypt&&!a),this._init=!0}},n.aes._expandKey=function(t,e){return l||h(),f(t,e)},n.aes._updateBlock=d,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var o,s,a,u,c,l=!1;function h(){l=!0,a=[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;o=new Array(256),s=new Array(256),u=new Array(4),c=new Array(4);for(e=0;e<4;++e)u[e]=new Array(256),c[e]=new Array(256);var r,n,i,h,f,d,p,y=0,g=0;for(e=0;e<256;++e){h=(h=g^g<<1^g<<2^g<<3^g<<4)>>8^255&h^99,o[y]=h,s[h]=y,d=(f=t[h])<<24^h<<16^h<<8^h^f,p=((r=t[y])^(n=t[r])^(i=t[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var m=0;m<4;++m)u[m][y]=d,c[m][h]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===y?y=g=1:(y=r^t[t[t[r^i]]],g^=t[t[g]])}}function f(t,e){for(var r,n=t.slice(0),i=1,s=n.length,u=4*(s+6+1),l=s;l<u;++l)r=n[l-1],l%s===0?(r=o[r>>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^a[i]<<24,i++):s>6&&l%s===4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[l]=n[l-s]^r;if(e){for(var h,f=c[0],d=c[1],p=c[2],y=c[3],g=n.slice(0),m=(l=0,(u=n.length)-4);l<u;l+=4,m-=4)if(0===l||l===u-4)g[l]=n[m],g[l+1]=n[m+3],g[l+2]=n[m+2],g[l+3]=n[m+1];else for(var b=0;b<4;++b)h=n[m+b],g[l+(3&-b)]=f[o[h>>>24]]^d[o[h>>>16&255]]^p[o[h>>>8&255]]^y[o[255&h]];n=g}return n}function d(t,e,r,n){var i,a,l,h,f,d,p,y,g,m,b,v,w=t.length/4-1;n?(i=c[0],a=c[1],l=c[2],h=c[3],f=s):(i=u[0],a=u[1],l=u[2],h=u[3],f=o),d=e[0]^t[0],p=e[n?3:1]^t[1],y=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,E=1;E<w;++E)m=i[d>>>24]^a[p>>>16&255]^l[y>>>8&255]^h[255&g]^t[++_],b=i[p>>>24]^a[y>>>16&255]^l[g>>>8&255]^h[255&d]^t[++_],v=i[y>>>24]^a[g>>>16&255]^l[d>>>8&255]^h[255&p]^t[++_],g=i[g>>>24]^a[d>>>16&255]^l[p>>>8&255]^h[255&y]^t[++_],d=m,p=b,y=v;r[0]=f[d>>>24]<<24^f[p>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^t[++_],r[n?3:1]=f[p>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&d]^t[++_],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[d>>>8&255]<<8^f[255&p]^t[++_],r[n?1:3]=f[g>>>24]<<24^f[d>>>16&255]<<16^f[p>>>8&255]<<8^f[255&y]^t[++_]}function p(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},10853:(t,e,r)=>{var n=r(37934);r(31330),r(56661);var i=t.exports=n.asn1=n.asn1||{};function o(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}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.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},i.create=function(t,e,r,o,s){if(n.util.isArray(o)){for(var a=[],u=0;u<o.length;++u)void 0!==o[u]&&a.push(o[u]);o=a}var c={tagClass:t,type:e,constructed:r,composed:r||n.util.isArray(o),value:o};return s&&"bitStringContents"in s&&(c.bitStringContents=s.bitStringContents,c.original=i.copy(c)),c},i.copy=function(t,e){var r;if(n.util.isArray(t)){r=[];for(var o=0;o<t.length;++o)r.push(i.copy(t[o],e));return r}return"string"===typeof t?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:i.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)},i.equals=function(t,e,r){if(n.util.isArray(t)){if(!n.util.isArray(e))return!1;if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)if(!i.equals(t[o],e[o]))return!1;return!0}if(typeof t!==typeof e)return!1;if("string"===typeof t)return t===e;var s=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&i.equals(t.value,e.value);return r&&r.includeBitStringContents&&(s=s&&t.bitStringContents===e.bitStringContents),s},i.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e};function s(t,e,r,n){var a;o(t,e,2);var u=t.getByte();e--;var c=192&u,l=31&u;a=t.length();var h,f,d=function(t,e){var r=t.getByte();if(e--,128!==r){var n;if(128&r){var i=127&r;o(t,e,i),n=t.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(t,e);if(e-=a-t.length(),void 0!==d&&d>e){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=t.length(),p.remaining=e,p.requested=d,p}d=e}var y=32===(32&u);if(y)if(h=[],void 0===d)for(;;){if(o(t,e,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),e-=2;break}a=t.length(),h.push(s(t,e,r+1,n)),e-=a-t.length()}else for(;d>0;)a=t.length(),h.push(s(t,d,r+1,n)),e-=a-t.length(),d-=a-t.length();if(void 0===h&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(f=t.bytes(d)),void 0===h&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&d>1){var g=t.read,m=e,b=0;if(l===i.Type.BITSTRING&&(o(t,e,1),b=t.getByte(),e--),0===b)try{a=t.length();var v=s(t,e,r+1,{strict:!0,decodeBitStrings:!0}),w=a-t.length();e-=w,l==i.Type.BITSTRING&&w++;var _=v.tagClass;w!==d||_!==i.Class.UNIVERSAL&&_!==i.Class.CONTEXT_SPECIFIC||(h=[v])}catch(S){}void 0===h&&(t.read=g,e=m)}if(void 0===h){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=e}if(l===i.Type.BMPSTRING)for(h="";d>0;d-=2)o(t,e,2),h+=String.fromCharCode(t.getInt16()),e-=2;else h=t.getBytes(d),e-=d}var E=void 0===f?null:{bitStringContents:f};return i.create(c,l,y,h,E)}i.fromDer=function(t,e){void 0===e&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"===typeof e&&(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),"string"===typeof t&&(t=n.util.createBuffer(t));var r=t.length(),i=s(t,t.length(),0,e);if(e.parseAllBytes&&0!==t.length()){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return i},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,o=n.util.createBuffer(),s=!1;if("bitStringContents"in t&&(s=!0,t.original&&(s=i.equals(t,t.original))),s)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var a=0;a<t.value.length;++a)void 0!==t.value[a]&&o.putBuffer(i.toDer(t.value[a]))}else if(t.type===i.Type.BMPSTRING)for(a=0;a<t.value.length;++a)o.putInt16(t.value.charCodeAt(a));else t.type===i.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0===(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128===(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);e.putByte(128|c.length);for(a=c.length-1;a>=0;--a)e.putByte(c.charCodeAt(a))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,r,i,o,s=t.split("."),a=n.util.createBuffer();a.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u=2;u<s.length;++u){e=!0,r=[],i=parseInt(s[u],10);do{o=127&i,i>>>=7,e||(o|=128),r.push(o),e=!1}while(i>0);for(var c=r.length-1;c>=0;--c)a.putByte(r[c])}return a},i.derToOid=function(t){var e;"string"===typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.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),o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),a=0;if(t.length>11){var u=t.charAt(10),c=10;"+"!==u&&"-"!==u&&(a=parseInt(t.substr(10,2),10),c+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(o,s,a,0),c&&("+"===(u=t.charAt(c))||"-"===u)){var l=60*parseInt(t.substr(c+1,2),10)+parseInt(t.substr(c+4,2),10);l*=6e4,"+"===u?e.setTime(+e-l):e.setTime(+e+l)}return e},i.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),o=parseInt(t.substr(8,2),10),s=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),u=0,c=0,l=!1;"Z"===t.charAt(t.length-1)&&(l=!0);var h=t.length-5,f=t.charAt(h);"+"!==f&&"-"!==f||(c=60*parseInt(t.substr(h+1,2),10)+parseInt(t.substr(h+4,2),10),c*=6e4,"+"===f&&(c*=-1),l=!0);return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),l?(e.setUTCFullYear(r,n,i),e.setUTCHours(o,s,a,u),e.setTime(+e+c)):(e.setFullYear(r,n,i),e.setHours(o,s,a,u)),e},i.dateToUtcTime=function(t){if("string"===typeof t)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"},i.dateToGeneralizedTime=function(t){if("string"===typeof t)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"},i.integerToDer=function(t){var e=n.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},i.derToInteger=function(t){"string"===typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,o){var s=!1;if(t.tagClass!==e.tagClass&&"undefined"!==typeof e.tagClass||t.type!==e.type&&"undefined"!==typeof e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||"undefined"===typeof e.constructed){if(s=!0,e.value&&n.util.isArray(e.value))for(var a=0,u=0;s&&u<e.value.length;++u)s=e.value[u].optional||!1,t.value[a]&&((s=i.validate(t.value[a],e.value[u],r,o))?++a:e.value[u].optional&&(s=!0)),!s&&o&&o.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(s&&r)if(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)if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}else o&&o.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');return s};var a=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(t,e,r){var o="";r=r||2,(e=e||0)>0&&(o+="\n");for(var s="",u=0;u<e*r;++u)s+=" ";switch(o+=s+"Tag: ",t.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(t.tagClass===i.Class.UNIVERSAL)switch(o+=t.type,t.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=t.type;if(o+="\n",o+=s+"Constructed: "+t.constructed+"\n",t.composed){var c=0,l="";for(u=0;u<t.value.length;++u)void 0!==t.value[u]&&(c+=1,l+=i.prettyPrint(t.value[u],e+1,r),u+1<t.value.length&&(l+=","));o+=s+"Sub values: "+c+l}else{if(o+=s+"Value: ",t.type===i.Type.OID){var h=i.derToOid(t.value);o+=h,n.pki&&n.pki.oids&&h in n.pki.oids&&(o+=" ("+n.pki.oids[h]+") ")}if(t.type===i.Type.INTEGER)try{o+=i.derToInteger(t.value)}catch(d){o+="0x"+n.util.bytesToHex(t.value)}else if(t.type===i.Type.BITSTRING){if(t.value.length>1?o+="0x"+n.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);1==f?o+=" (1 unused bit shown)":f>1&&(o+=" ("+f+" unused bits shown)")}}else if(t.type===i.Type.OCTETSTRING)a.test(t.value)||(o+="("+t.value+") "),o+="0x"+n.util.bytesToHex(t.value);else if(t.type===i.Type.UTF8)try{o+=n.util.decodeUtf8(t.value)}catch(p){if("URI malformed"!==p.message)throw p;o+="0x"+n.util.bytesToHex(t.value)+" (malformed UTF8)"}else t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:a.test(t.value)?o+="0x"+n.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},47271:(t,e,r)=>{var n=r(30285).Buffer,i={};t.exports=i;var o={};i.encode=function(t,e,r){if("string"!==typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!==typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,o=e.length,s=e.charAt(0),a=[0];for(i=0;i<t.length;++i){for(var u=0,c=t[i];u<a.length;++u)c+=a[u]<<8,a[u]=c%o,c=c/o|0;for(;c>0;)a.push(c%o),c=c/o|0}for(i=0;0===t[i]&&i<t.length-1;++i)n+=s;for(i=a.length-1;i>=0;--i)n+=e[a[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),o=[0];for(r=0;r<t.length();++r){for(var s=0,a=t.at(r);s<o.length;++s)a+=o[s]<<8,o[s]=a%n,a=a/n|0;for(;a>0;)o.push(a%n),a=a/n|0}var u="";for(r=0;0===t.at(r)&&r<t.length()-1;++r)u+=i;for(r=o.length-1;r>=0;--r)u+=e[o[r]];return u}(t,e);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},i.decode=function(t,e){if("string"!==typeof t)throw new TypeError('"input" must be a string.');if("string"!==typeof e)throw new TypeError('"alphabet" must be a string.');var r=o[e];if(!r){r=o[e]=[];for(var i=0;i<e.length;++i)r[e.charCodeAt(i)]=i}t=t.replace(/\s/g,"");var s=e.length,a=e.charAt(0),u=[0];for(i=0;i<t.length;i++){var c=r[t.charCodeAt(i)];if(void 0===c)return;for(var l=0,h=c;l<u.length;++l)h+=u[l]*s,u[l]=255&h,h>>=8;for(;h>0;)u.push(255&h),h>>=8}for(var f=0;t[f]===a&&f<t.length-1;++f)u.push(0);return"undefined"!==typeof n?n.from(u.reverse()):new Uint8Array(u.reverse())}},36876:(t,e,r)=>{var n=r(37934);r(31330),t.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(t,e){var r=t;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new n.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})},n.cipher.createDecipher=function(t,e){var r=t;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new n.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})},n.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),n.cipher.algorithms[t]=e},n.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[t]:null};var i=n.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)};i.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=n.util.createBuffer(),this.output=t.output||n.util.createBuffer(),this.mode.start(e)},i.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()},i.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!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)))}},98219:(t,e,r)=>{var n=r(37934);r(31330),n.cipher=n.cipher||{};var i=t.exports=n.cipher.modes=n.cipher.modes||{};function o(t,e){if("string"===typeof t&&(t=n.util.createBuffer(t)),n.util.isArray(t)&&t.length>4){var r=t;t=n.util.createBuffer();for(var i=0;i<r.length;++i)t.putByte(r[i])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!n.util.isArray(t)){var o=[],s=e/4;for(i=0;i<s;++i)o.push(t.getInt32());t=o}return t}function s(t){t[t.length-1]=t[t.length-1]+1&4294967295}function a(t){return[t/4294967296|0,4294967295&t]}i.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)},i.ecb.prototype.start=function(t){},i.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(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},i.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(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},i.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)&&(t.truncate(n),!0)},i.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)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.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(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.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(n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},i.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)&&(t.truncate(n),!0)},i.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=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.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=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.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=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.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=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=a(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o<=0||r){if(r){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(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),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.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),s(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},i.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^o[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){t[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(t,e){for(var r=1&t[3],n=3;n>0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.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)},i.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,o=new Array(i),s=0;s<i;++s){var a=[0,0,0,0],u=(n-1-s%n)*e;a[s/n|0]=1<<e-1<<u,o[s]=this.generateSubHashTable(this.multiply(a,t),e)}return o},i.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<n;){for(var s=1;s<o;++s){var a=i[o],u=i[s];i[o+s]=[a[0]^u[0],a[1]^u[1],a[2]^u[2],a[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=n+1;o<r;++o){var c=i[o^n];i[o]=[t[0]^c[0],t[1]^c[1],t[2]^c[2],t[3]^c[3]]}return i}},96052:(t,e,r)=>{var n=r(37934);function i(t,e){n.cipher.registerAlgorithm(t,(function(){return new n.des.Algorithm(t,e)}))}r(36876),r(98219),r(31330),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return d(r._keys,t,e,!1)},decrypt:function(t,e){return d(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=t.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,w=0;w<g;w++){var _=t.getInt32(),E=t.getInt32();_^=(e=252645135&(_>>>4^E))<<4,_^=e=65535&((E^=e)>>>-16^_),_^=(e=858993459&(_>>>2^(E^=e<<-16)))<<2,_^=e=65535&((E^=e)>>>-16^_),_^=(e=1431655765&(_>>>1^(E^=e<<-16)))<<1,_^=e=16711935&((E^=e)>>>8^_),e=(_^=(e=1431655765&(_>>>1^(E^=e<<8)))<<1)<<8|(E^=e)>>>20&240,_=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=e;for(var S=0;S<b.length;++S){b[S]?(_=_<<2|_>>>26,E=E<<2|E>>>26):(_=_<<1|_>>>27,E=E<<1|E>>>27),E&=-15;var I=r[(_&=-15)>>>28]|n[_>>>24&15]|i[_>>>20&15]|o[_>>>16&15]|s[_>>>12&15]|a[_>>>8&15]|u[_>>>4&15],A=c[E>>>28]|l[E>>>24&15]|h[E>>>20&15]|f[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|y[E>>>4&15];e=65535&(A>>>16^I),m[v++]=I^e,m[v++]=A^e<<16}}return m}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[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],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[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],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(t,e,r,n){var i,d,p=32===t.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=e[0],g=e[1];y^=(d=252645135&(y>>>4^g))<<4,y^=(d=65535&(y>>>16^(g^=d)))<<16,y^=d=858993459&((g^=d)>>>2^y),y^=d=16711935&((g^=d<<2)>>>8^y),y=(y^=(d=1431655765&(y>>>1^(g^=d<<8)))<<1)<<1|y>>>31,g=(g^=d)<<1|g>>>31;for(var m=0;m<p;m+=3){for(var b=i[m+1],v=i[m+2],w=i[m];w!=b;w+=v){var _=g^t[w],E=(g>>>4|g<<28)^t[w+1];d=y,y=g,g=d^(s[_>>>24&63]|u[_>>>16&63]|l[_>>>8&63]|f[63&_]|o[E>>>24&63]|a[E>>>16&63]|c[E>>>8&63]|h[63&E])}d=y,y=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(d=16711935&(g>>>8^(y^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(y^=d)))<<2,g^=d=65535&((y^=d)>>>16^g),g^=d=252645135&((y^=d<<16)>>>4^g),y^=d<<4,r[0]=y,r[1]=g}function p(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},37934:t=>{t.exports={options:{usePureJavaScript:!1}}},43156:(t,e,r)=>{var n=r(37934);r(84630),r(31330),(t.exports=n.hmac=n.hmac||{}).create=function(){var t=null,e=null,r=null,i=null,o={start:function(o,s){if(null!==o)if("string"===typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');e=n.md.algorithms[o].create()}else e=o;if(null===s)s=t;else{if("string"===typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var a=s;s=n.util.createBuffer();for(var u=0;u<a.length;++u)s.putByte(a[u])}var c=s.length();c>e.blockLength&&(e.start(),e.update(s.bytes()),s=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=s.length();for(u=0;u<c;++u){a=s.at(u);r.putByte(54^a),i.putByte(92^a)}if(c<e.blockLength)for(a=e.blockLength-c,u=0;u<a;++u)r.putByte(54),i.putByte(92);t=s,r=r.bytes(),i=i.bytes()}e.start(),e.update(r)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(i),e.update(t),e.digest()}};return o.digest=o.getMac,o}},78808:(t,e,r)=>{var n,i=r(37934);t.exports=i.jsbn=i.jsbn||{};function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new o(null)}function a(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this.data[t],c=this.data[t++]>>14,l=a*u+c*s;i=((u=s*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+a*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"===typeof navigator?(o.prototype.am=a,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this.data[t],c=this.data[t++]>>15,l=a*u+c*s;i=((u=s*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this.data[t++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(o.prototype.am=a,n=28),o.prototype.DB=n,o.prototype.DM=(1<<n)-1,o.prototype.DV=1<<n;o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-n,o.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function h(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function f(t,e){var r=l[t.charCodeAt(e)];return null==r?-1:r}function d(t){var e=s();return e.fromInt(t),e}function p(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function y(t){this.m=t}function g(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function m(t,e){return t&e}function b(t,e){return t|e}function v(t,e){return t^e}function w(t,e){return t&~e}function _(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function E(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function I(t){return t}function A(t){this.r2=s(),this.q3=s(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}y.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},y.prototype.revert=function(t){return t},y.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},g.prototype.convert=function(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},g.prototype.revert=function(t){var e=s();return t.copyTo(e),this.reduce(e),e},g.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t.data[e],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)},g.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},g.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(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},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var a=8==r?255&t[n]:f(t,n);a<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=a:s+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this.data[this.t++]=a>>this.DB-s):this.data[this.t-1]|=a<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(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},o.prototype.drShiftTo=function(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},o.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e.data[r+s+1]=this.data[r]>>i|a,a=(this.data[r]&o)<<n;for(r=s-1;r>=0;--r)e.data[r]=0;e.data[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)e.data[s-r-1]|=(this.data[s]&o)<<i,e.data[s-r]=this.data[s]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},o.prototype.subTo=function(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()},o.prototype.multiplyTo=function(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&&o.ZERO.subTo(e,e)},o.prototype.squareTo=function(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()},o.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var a=s(),u=this.s,c=t.s,l=this.DB-p(n.data[n.t-1]);l>0?(n.lShiftTo(l,a),i.lShiftTo(l,r)):(n.copyTo(a),i.copyTo(r));var h=a.t,f=a.data[h-1];if(0!=f){var d=f*(1<<this.F1)+(h>1?a.data[h-2]>>this.F2:0),y=this.FV/d,g=(1<<this.F1)/d,m=1<<this.F2,b=r.t,v=b-h,w=null==e?s():e;for(a.dlShiftTo(v,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t<h;)a.data[a.t++]=0;for(;--v>=0;){var _=r.data[--b]==f?this.DM:Math.floor(r.data[b]*y+(r.data[b-1]+m)*g);if((r.data[b]+=a.am(0,_,r,v,0,h))<_)for(a.dlShiftTo(v,w),r.subTo(w,r);r.data[b]<--_;)r.subTo(w,r)}null!=e&&(r.drShiftTo(h,e),u!=c&&o.ZERO.subTo(e,e)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=s(),n=s(),i=e.convert(this),a=p(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<<a)>0)e.mulTo(n,i,r);else{var u=r;r=n,n=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this.data[s]>>a)>0&&(i=!0,o=h(r));s>=0;)a<e?(r=(this.data[s]&(1<<a)-1)<<e-a,r|=this.data[--s]>>(a+=this.DB-e)):(r=this.data[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=h(r));return i?o:"0"},o.prototype.negate=function(){var t=s();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new y(e):new g(e),this.exp(t,r)},o.ZERO=d(0),o.ONE=d(1),S.prototype.convert=I,S.prototype.revert=I,S.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},S.prototype.sqrTo=function(t,e){t.squareTo(e)},A.prototype.convert=function(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=s();return t.copyTo(e),this.reduce(e),e},A.prototype.revert=function(t){return t},A.prototype.reduce=function(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)},A.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},A.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var M=[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],T=(1<<26)/M[M.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=d(r),i=s(),o=s(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(t).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(t)+a},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,a=0,u=0;u<t.length;++u){var c=f(t,u);c<0?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(a=e*a+c,++s>=r&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},o.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;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()},o.prototype.changeBit=function(t,e){var r=o.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},o.prototype.addTo=function(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()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){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]}},o.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,t.data[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t.data[i],r,i,0,e-i);r.clamp()},o.prototype.multiplyUpperTo=function(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)},o.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),s={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},a=0;a<t;++a){do{n=new o(this.bitLength(),s)}while(n.compareTo(o.ONE)<=0||n.compareTo(e)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var c=1;c++<r&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},o.prototype.clone=function(){var t=s();return this.copyTo(t),t},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this.data[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this.data[t]&(1<<n)-1)<<8-n,r|=this.data[--t]>>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=s();return this.bitwiseTo(t,m,e),e},o.prototype.or=function(t){var e=s();return this.bitwiseTo(t,b,e),e},o.prototype.xor=function(t){var e=s();return this.bitwiseTo(t,v,e),e},o.prototype.andNot=function(t){var e=s();return this.bitwiseTo(t,w,e),e},o.prototype.not=function(){for(var t=s(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},o.prototype.shiftLeft=function(t){var e=s();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},o.prototype.shiftRight=function(t){var e=s();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},o.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+_(this.data[t]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=E(this.data[r]^e);return t},o.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},o.prototype.setBit=function(t){return this.changeBit(t,b)},o.prototype.clearBit=function(t){return this.changeBit(t,w)},o.prototype.flipBit=function(t){return this.changeBit(t,v)},o.prototype.add=function(t){var e=s();return this.addTo(t,e),e},o.prototype.subtract=function(t){var e=s();return this.subTo(t,e),e},o.prototype.multiply=function(t){var e=s();return this.multiplyTo(t,e),e},o.prototype.divide=function(t){var e=s();return this.divRemTo(t,e,null),e},o.prototype.remainder=function(t){var e=s();return this.divRemTo(t,null,e),e},o.prototype.divideAndRemainder=function(t){var e=s(),r=s();return this.divRemTo(t,e,r),new Array(e,r)},o.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),o=d(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(e):e.isEven()?new A(e):new g(e);var a=new Array,u=3,c=r-1,l=(1<<r)-1;if(a[1]=n.convert(this),r>1){var h=s();for(n.sqrTo(a[1],h);u<=l;)a[u]=s(),n.mulTo(h,a[u-2],a[u]),u+=2}var f,m,b=t.t-1,v=!0,w=s();for(i=p(t.data[b])-1;b>=0;){for(i>=c?f=t.data[b]>>i-c&l:(f=(t.data[b]&(1<<i+1)-1)<<c-i,b>0&&(f|=t.data[b-1]>>this.DB+i-c)),u=r;0==(1&f);)f>>=1,--u;if((i-=u)<0&&(i+=this.DB,--b),v)a[f].copyTo(o),v=!1;else{for(;u>1;)n.sqrTo(o,w),n.sqrTo(w,o),u-=2;u>0?n.sqrTo(o,w):(m=o,o=w,w=m),n.mulTo(w,a[f],o)}for(;b>=0&&0==(t.data[b]&1<<i);)n.sqrTo(o,w),m=o,o=w,w=m,--i<0&&(i=this.DB-1,--b)}return n.revert(o)},o.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var r=t.clone(),n=this.clone(),i=d(1),s=d(0),a=d(0),u=d(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(a,i),s.subTo(u,s)):(n.subTo(r,n),e&&a.subTo(i,a),u.subTo(s,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new S)},o.prototype.gcd=function(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(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,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 o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=M[M.length-1]){for(e=0;e<M.length;++e)if(r.data[0]==M[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<M.length;){for(var n=M[e],i=e+1;i<M.length&&n<T;)n*=M[i++];for(n=r.modInt(n);e<i;)if(n%M[e++]==0)return!1}return r.millerRabin(t)}},84630:(t,e,r)=>{var n=r(37934);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},66513:(t,e,r)=>{var n=r(37934);r(1225),t.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},1225:(t,e,r)=>{var n=r(37934);r(31330),n.mgf=n.mgf||{},(t.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(t){return{generate:function(e,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/t.digestLength),s=0;s<o;s++){var a=new n.util.ByteBuffer;a.putInt32(s),t.start(),t.update(e+a.getBytes()),i.putBuffer(t.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},56661:(t,e,r)=>{var n=r(37934);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function o(t,e){i[t]=e,i[e]=t}function s(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("1.3.14.3.2.29","sha1WithRSASignature"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("2.16.840.1.101.3.4.2.4","sha224"),o("2.16.840.1.101.3.4.2.5","sha512-224"),o("2.16.840.1.101.3.4.2.6","sha512-256"),o("1.2.840.113549.2.2","md2"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.4","surname"),o("2.5.4.5","serialNumber"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.12","title"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("2.5.4.42","givenName"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},14458:(t,e,r)=>{var n=r(37934);if(r(28085),r(10853),r(96052),r(84630),r(56661),r(4723),r(82232),r(90770),r(73038),r(95791),r(31330),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.asn1,s=n.pki=n.pki||{};t.exports=s.pbe=n.pbe=n.pbe||{};var a=s.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(t,e){return t.start().update(e).digest().getBytes()}function f(t){var e;if(t){if(!(e=s.oids[o.derToOid(t)])){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else e="hmacWithSHA1";return d(e)}function d(t){var e=n.md;switch(t){case"hmacWithSHA224":e=n.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()}s.encryptPrivateKeyInfo=function(t,e,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),h=r.count,f=o.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,y,g;switch(r.algorithm){case"aes128":i=16,p=16,y=a["aes128-CBC"],g=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,y=a["aes192-CBC"],g=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,y=a["aes256-CBC"],g=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,y=a.desCBC,g=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),b=d(m),v=n.pkcs5.pbkdf2(e,l,h,i,b),w=n.random.getBytesSync(p);(S=g(v)).start(w),S.update(o.toDer(t)),S.finish(),c=S.output.getBytes();var _=function(t,e,r,i){var a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,t),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,e.getBytes())]);"hmacWithSHA1"!==i&&a.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]));return a}(l,f,i,m);u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBKDF2).getBytes()),_]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(y).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var S,I=new n.util.ByteBuffer(l);v=s.pbe.generatePkcs12Key(e,I,1,h,i),w=s.pbe.generatePkcs12Key(e,I,2,h,i);(S=n.des.createEncryptionCipher(v)).start(w),S.update(o.toDer(t)),S.finish(),c=S.output.getBytes(),u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,l),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[u,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,c)])},s.decryptPrivateKeyInfo=function(t,e){var r=null,i={},a=[];if(!o.validate(t,u,i,a)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=a,c}var l=o.derToOid(i.encryptionOid),h=s.pbe.getCipher(l,i.encryptionParams,e),f=n.util.createBuffer(i.encryptedData);return h.update(f),h.finish()&&(r=o.fromDer(h.output)),r},s.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(t).getBytes()};return n.pem.encode(r,{maxline:e})},s.encryptedPrivateKeyFromPem=function(t){var e=n.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==e.type){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&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(e.body)},s.encryptRsaPrivateKey=function(t,e,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(t));return i=s.encryptPrivateKeyInfo(i,e,r),s.encryptedPrivateKeyToPem(i)}var a,u,c,l;switch(r.algorithm){case"aes128":a="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":a="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var f=l(n.pbe.opensslDeriveBytes(e,u.substr(0,8),c));f.start(u),f.update(o.toDer(s.privateKeyToAsn1(t))),f.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:n.util.bytesToHex(u).toUpperCase()},body:f.output.getBytes()};return n.pem.encode(d)},s.decryptRsaPrivateKey=function(t,e){var r=null,i=n.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var a,u;switch(i.dekInfo.algorithm){case"DES-CBC":a=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,u=function(t){return n.rc2.createDecryptionCipher(t,40)};break;case"RC2-64-CBC":a=8,u=function(t){return n.rc2.createDecryptionCipher(t,64)};break;case"RC2-128-CBC":a=16,u=function(t){return n.rc2.createDecryptionCipher(t,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),h=u(n.pbe.opensslDeriveBytes(e,l.substr(0,8),a));if(h.start(l),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(o.fromDer(r),e):o.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(t,e,r,i,o,s){var a,u;if("undefined"===typeof s||null===s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var c=s.digestLength,l=s.blockLength,h=new n.util.ByteBuffer,f=new n.util.ByteBuffer;if(null!==t&&void 0!==t){for(u=0;u<t.length;u++)f.putInt16(t.charCodeAt(u));f.putInt16(0)}var d=f.length(),p=e.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(p/l),m=new n.util.ByteBuffer;for(u=0;u<g;u++)m.putByte(e.at(u%p));var b=l*Math.ceil(d/l),v=new n.util.ByteBuffer;for(u=0;u<b;u++)v.putByte(f.at(u%d));var w=m;w.putBuffer(v);for(var _=Math.ceil(o/c),E=1;E<=_;E++){var S=new n.util.ByteBuffer;S.putBytes(y.bytes()),S.putBytes(w.bytes());for(var I=0;I<i;I++)s.start(),s.update(S.getBytes()),S=s.digest();var A=new n.util.ByteBuffer;for(u=0;u<l;u++)A.putByte(S.at(u%c));var M=Math.ceil(p/l)+Math.ceil(d/l),T=new n.util.ByteBuffer;for(a=0;a<M;a++){var R=new n.util.ByteBuffer(w.getBytes(l)),k=511;for(u=A.length()-1;u>=0;u--)k>>=8,k+=A.at(u)+R.at(u),R.setAt(u,255&k);T.putBuffer(R)}w=T,h.putBuffer(S)}return h.truncate(h.length()-o),h},s.pbe.getCipher=function(t,e,r){switch(t){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(t,e,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.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}},s.pbe.getCipherForPBES2=function(t,e,r){var i,a={},u=[];if(!o.validate(e,c,a,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((t=o.derToOid(a.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,i.supportedOids=["pkcs5PBKDF2"],i;if((t=o.derToOid(a.encOid))!==s.oids["aes128-CBC"]&&t!==s.oids["aes192-CBC"]&&t!==s.oids["aes256-CBC"]&&t!==s.oids["des-EDE3-CBC"]&&t!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,h,d=a.kdfSalt,p=n.util.createBuffer(a.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[t]){case"aes128-CBC":l=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,h=n.des.createDecryptionCipher;break;case"desCBC":l=8,h=n.des.createDecryptionCipher}var y=f(a.prfOid),g=n.pkcs5.pbkdf2(r,d,p,l,y),m=a.encIv,b=h(g);return b.start(m),b},s.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},a=[];if(!o.validate(e,l,i,a))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,y;var u,c,h,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),t){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,h=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,h=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,y}var g=f(i.prfOid),m=s.pbe.generatePkcs12Key(r,d,1,p,u,g);return g.start(),h(m,s.pbe.generatePkcs12Key(r,d,2,p,c,g))},s.pbe.opensslDeriveBytes=function(t,e,r,i){if("undefined"===typeof i||null===i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===e&&(e="");for(var o=[h(i,t+e)],s=16,a=1;s<r;++a,s+=16)o.push(h(i,o[a-1]+t+e));return o.join("").substr(0,r)}},4723:(t,e,r)=>{var n=r(30285).Buffer,i=r(37934);r(43156),r(84630),r(31330);var o,s=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(o=r(71381)),t.exports=i.pbkdf2=s.pbkdf2=function(t,e,r,s,a,u){if("function"===typeof a&&(u=a,a=null),i.util.isNodejs&&!i.options.usePureJavaScript&&o.pbkdf2&&(null===a||"object"!==typeof a)&&(o.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!==typeof a&&(a="sha1"),t=n.from(t,"binary"),e=n.from(e,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(t,e,r,s,(function(t,e){if(t)return u(t);u(null,e.toString("binary"))})):o.pbkdf2(t,e,r,s,a,(function(t,e){if(t)return u(t);u(null,e.toString("binary"))})):4===o.pbkdf2Sync.length?o.pbkdf2Sync(t,e,r,s).toString("binary"):o.pbkdf2Sync(t,e,r,s,a).toString("binary");if("undefined"!==typeof a&&null!==a||(a="sha1"),"string"===typeof a){if(!(a in i.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=i.md[a].create()}var c=a.digestLength;if(s>4294967295*c){var l=new Error("Derived key is too long.");if(u)return u(l);throw l}var h=Math.ceil(s/c),f=s-(h-1)*c,d=i.hmac.create();d.start(a,t);var p,y,g,m="";if(!u){for(var b=1;b<=h;++b){d.start(null,null),d.update(e),d.update(i.util.int32ToBytes(b)),p=g=d.digest().getBytes();for(var v=2;v<=r;++v)d.start(null,null),d.update(g),y=d.digest().getBytes(),p=i.util.xorBytes(p,y,c),g=y;m+=b<h?p:p.substr(0,f)}return m}b=1;function w(){if(b>h)return u(null,m);d.start(null,null),d.update(e),d.update(i.util.int32ToBytes(b)),p=g=d.digest().getBytes(),v=2,_()}function _(){if(v<=r)return d.start(null,null),d.update(g),y=d.digest().getBytes(),p=i.util.xorBytes(p,y,c),g=y,++v,i.util.setImmediate(_);m+=b<h?p:p.substr(0,f),++b,w()}w()}},82232:(t,e,r)=>{var n=r(37934);r(31330);var i=t.exports=n.pem=n.pem||{};function o(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i<t.values.length;++i)r.push(t.values[i].replace(/^(\S+\r\n)/,n));e+=r.join(",")+"\r\n";var o=0,s=-1;for(i=0;i<e.length;++i,++o)if(o>65&&-1!==s){var a=e[s];","===a?(++s,e=e.substr(0,s)+"\r\n "+e.substr(s)):e=e.substr(0,s)+"\r\n"+a+e.substr(s+1),o=i-s-1,s=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(s=i);return e}function s(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=o(r)),t.headers)for(var s=0;s<t.headers.length;++s)i+=o(t.headers[s]);return t.procType&&(i+="\r\n"),i+=n.util.encode64(t.body,e.maxline||64)+"\r\n",i+="-----END "+t.type+"-----\r\n"},i.decode=function(t){for(var e,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,o=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/;e=i.exec(t);){var u=e[1];"NEW CERTIFICATE REQUEST"===u&&(u="CERTIFICATE REQUEST");var c={type:u,procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(e[3])};if(r.push(c),e[2]){for(var l=e[2].split(a),h=0;e&&h<l.length;){for(var f=l[h].replace(/\s+$/,""),d=h+1;d<l.length;++d){var p=l[d];if(!/\s/.test(p[0]))break;f+=p,h=d}if(e=f.match(o)){for(var y={name:e[1],values:[]},g=e[2].split(","),m=0;m<g.length;++m)y.values.push(s(g[m]));if(c.procType)if(c.contentDomain||"Content-Domain"!==y.name)if(c.dekInfo||"DEK-Info"!==y.name)c.headers.push(y);else{if(0===y.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');c.dekInfo={algorithm:g[0],parameters:g[1]||null}}else c.contentDomain=g[0]||"";else{if("Proc-Type"!==y.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==y.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');c.procType={version:g[0],type:g[1]}}}++h}if("ENCRYPTED"===c.procType&&!c.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},38844:(t,e,r)=>{var n=r(37934);r(31330),r(90770),r(11715);var i=t.exports=n.pkcs1=n.pkcs1||{};function o(t,e,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(e/r.digestLength),s=0;s<o;++s){var a=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(t+a),i+=r.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,r){var i,s,a,u;"string"===typeof r?(i=r,s=arguments[3]||void 0,a=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),a?a.start():a=n.md.sha1.create(),u||(u=a);var c=Math.ceil(t.n.bitLength()/8),l=c-2*a.digestLength-2;if(e.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=e.length,g.maxLength=l,g;i||(i=""),a.update(i,"raw");for(var h=a.digest(),f="",d=l-e.length,p=0;p<d;p++)f+="\0";var y=h.getBytes()+f+"\x01"+e;if(s){if(s.length!==a.digestLength){var g;throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,g.digestLength=a.digestLength,g}}else s=n.random.getBytes(a.digestLength);var m=o(s,c-a.digestLength-1,u),b=n.util.xorBytes(y,m,y.length),v=o(b,a.digestLength,u),w=n.util.xorBytes(s,v,s.length);return"\0"+w+b},i.decode_rsa_oaep=function(t,e,r){var i,s,a;"string"===typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var u=Math.ceil(t.n.bitLength()/8);if(e.length!==u)throw(b=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,b.expectedLength=u,b;if(void 0===s?s=n.md.sha1.create():s.start(),a||(a=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var c=s.digest().getBytes(),l=e.charAt(0),h=e.substring(1,s.digestLength+1),f=e.substring(1+s.digestLength),d=o(f,s.digestLength,a),p=n.util.xorBytes(h,d,h.length),y=o(p,u-s.digestLength-1,a),g=n.util.xorBytes(f,y,f.length),m=g.substring(0,s.digestLength),b="\0"!==l,v=0;v<s.digestLength;++v)b|=c.charAt(v)!==m.charAt(v);for(var w=1,_=s.digestLength,E=s.digestLength;E<g.length;E++){var S=g.charCodeAt(E),I=1&S^1,A=w?65534:0;b|=S&A,_+=w&=I}if(b||1!==g.charCodeAt(_))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(_+1)}},60322:(t,e,r)=>{var n=r(37934);r(28085),r(10853),r(96052),r(56661),r(82232),r(15758),r(90770),r(31330),r(87141);var i=n.asn1,o=t.exports=n.pkcs7=n.pkcs7||{};function s(t){var e={},r=[];if(!i.validate(t,o.asn1.recipientInfoValidator,e,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:e.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(e.issuer),serialNumber:n.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:i.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}function a(t){for(var e,r=[],o=0;o<t.length;++o)r.push((e=t[o],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.encryptedContent.content)])));return r}function u(t){var e=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(t.authenticatedAttributesAsn1&&e.value.push(t.authenticatedAttributesAsn1),e.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),e.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.signature)),t.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o<t.unauthenticatedAttributes.length;++o){var s=t.unauthenticatedAttributes[o];r.values.push(c(s))}e.value.push(r)}return e}function c(t){var e;if(t.type===n.pki.oids.contentType)e=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.value).getBytes());else if(t.type===n.pki.oids.messageDigest)e=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.value.bytes());else if(t.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),o=new Date("2050-01-01T00:00:00Z"),s=t.value;if("string"===typeof s){var a=Date.parse(s);s=isNaN(a)?13===s.length?i.utcTimeToDate(s):i.generalizedTimeToDate(s):new Date(a)}e=s>=r&&s<o?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(s)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(s))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[e])])}function l(t,e,r){var o={};if(!i.validate(e,r,o,[])){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(i.derToOid(o.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(o.encryptedContent){var a="";if(n.util.isArray(o.encryptedContent))for(var u=0;u<o.encryptedContent.length;++u){if(o.encryptedContent[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");a+=o.encryptedContent[u].value}else a=o.encryptedContent;t.encryptedContent={algorithm:i.derToOid(o.encAlgorithm),parameter:n.util.createBuffer(o.encParameter.value),content:n.util.createBuffer(a)}}if(o.content){a="";if(n.util.isArray(o.content))for(u=0;u<o.content.length;++u){if(o.content[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");a+=o.content[u].value}else a=o.content;t.content=n.util.createBuffer(a)}return t.version=o.version.charCodeAt(0),t.rawCapture=o,o}function h(t){if(void 0===t.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===t.content){var e;switch(t.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:e=n.aes.createDecryptionCipher(t.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:e=n.des.createDecryptionCipher(t.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+t.encryptedContent.algorithm)}if(e.start(t.encryptedContent.parameter),e.update(t.encryptedContent.content),!e.finish())throw new Error("Symmetric decryption failed.");t.content=e.output}}o.messageFromPem=function(t){var e=n.pem.decode(t)[0];if("PKCS7"!==e.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=i.fromDer(e.body);return o.messageFromAsn1(s)},o.messageToPem=function(t,e){var r={type:"PKCS7",body:i.toDer(t.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:e})},o.messageFromAsn1=function(t){var e={},r=[];if(!i.validate(t,o.asn1.contentInfoValidator,e,r)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw s.errors=r,s}var a,u=i.derToOid(e.contentType);switch(u){case n.pki.oids.envelopedData:a=o.createEnvelopedData();break;case n.pki.oids.encryptedData:a=o.createEncryptedData();break;case n.pki.oids.signedData:a=o.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return a.fromAsn1(e.content.value[0]),a},o.createSignedData=function(){var t=null;return t={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(e){if(l(t,e,o.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var r=t.rawCapture.certificates.value,i=0;i<r.length;++i)t.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){t.contentInfo||t.sign();for(var e=[],r=0;r<t.certificates.length;++r)e.push(n.pki.certificateToAsn1(t.certificates[r]));var o=[],s=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,t.digestAlgorithmIdentifiers),t.contentInfo])]);return e.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,e)),o.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,t.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),s])},addSigner:function(e){var r=e.issuer,i=e.serialNumber;if(e.certificate){var o=e.certificate;"string"===typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var s=e.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof s&&(s=n.pki.privateKeyFromPem(s));var a=e.digestAlgorithm||n.pki.oids.sha1;switch(a){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+a)}var u=e.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,h=0;h<u.length;++h){var f=u[h];if(c||f.type!==n.pki.oids.contentType){if(l||f.type!==n.pki.oids.messageDigest);else if(l=!0,c)break}else if(c=!0,l)break}if(!c||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}t.signers.push({key:s,version:1,issuer:r,serialNumber:i,digestAlgorithm:a,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(e){var r;(e=e||{},"object"!==typeof t.content||null===t.contentInfo)&&(t.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in t&&(t.content instanceof n.util.ByteBuffer?r=t.content.bytes():"string"===typeof t.content&&(r=n.util.encodeUtf8(t.content)),e.detached?t.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):t.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==t.signers.length&&function(e){var r;r=t.detachedContent?t.detachedContent:(r=t.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var o=i.derToOid(t.contentInfo.value[0].value),s=i.toDer(r);for(var a in s.getByte(),i.getBerValueLength(s),s=s.getBytes(),e)e[a].start().update(s);for(var l=new Date,h=0;h<t.signers.length;++h){var f=t.signers[h];if(0===f.authenticatedAttributes.length){if(o!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),p=0;p<f.authenticatedAttributes.length;++p){var y=f.authenticatedAttributes[p];y.type===n.pki.oids.messageDigest?y.value=e[f.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=l)),d.value.push(c(y)),f.authenticatedAttributesAsn1.value.push(c(y))}s=i.toDer(d).getBytes(),f.md.start().update(s)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}t.signerInfos=function(t){for(var e=[],r=0;r<t.length;++r)e.push(u(t[r]));return e}(t.signers)}(function(){for(var e={},r=0;r<t.signers.length;++r){var o=t.signers[r];(s=o.digestAlgorithm)in e||(e[s]=n.md[n.pki.oids[s]].create()),0===o.authenticatedAttributes.length?o.md=e[s]:o.md=n.md[n.pki.oids[s]].create()}for(var s in t.digestAlgorithmIdentifiers=[],e)t.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return e}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(e){"string"===typeof e&&(e=n.pki.certificateFromPem(e)),t.certificates.push(e)},addCertificateRevokationList:function(t){throw new Error("PKCS#7 CRL support not yet implemented.")}}},o.createEncryptedData=function(){var t=null;return t={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(e){l(t,e,o.asn1.encryptedDataValidator)},decrypt:function(e){void 0!==e&&(t.encryptedContent.key=e),h(t)}}},o.createEnvelopedData=function(){var t=null;return t={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(e){var r=l(t,e,o.asn1.envelopedDataValidator);t.recipients=function(t){for(var e=[],r=0;r<t.length;++r)e.push(s(t[r]));return e}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,a(t.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(e=t.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.algorithm).getBytes()),e.parameter?i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.content.getBytes())])]))])])]);var e},findRecipient:function(e){for(var r=e.issuer.attributes,n=0;n<t.recipients.length;++n){var i=t.recipients[n],o=i.issuer;if(i.serialNumber===e.serialNumber&&o.length===r.length){for(var s=!0,a=0;a<r.length;++a)if(o[a].type!==r[a].type||o[a].value!==r[a].value){s=!1;break}if(s)return i}}return null},decrypt:function(e,r){if(void 0===t.encryptedContent.key&&void 0!==e&&void 0!==r)switch(e.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(e.encryptedContent.content);t.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}h(t)},addRecipient:function(e){t.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:e.publicKey}})},encrypt:function(e,r){if(void 0===t.encryptedContent.content){var i,o,s;switch(r=r||t.encryptedContent.algorithm,e=e||t.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,o=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,o=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,o=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,o=8,s=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===e)e=n.util.createBuffer(n.random.getBytes(i));else if(e.length()!=i)throw new Error("Symmetric key has wrong length; got "+e.length()+" bytes, expected "+i+".");t.encryptedContent.algorithm=r,t.encryptedContent.key=e,t.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(o));var a=s(e);if(a.start(t.encryptedContent.parameter.copy()),a.update(t.content),!a.finish())throw new Error("Symmetric encryption failed.");t.encryptedContent.content=a.output}for(var u=0;u<t.recipients.length;++u){var c=t.recipients[u];if(void 0===c.encryptedContent.content){if(c.encryptedContent.algorithm!==n.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm);c.encryptedContent.content=c.encryptedContent.key.encrypt(t.encryptedContent.key.data)}}}}}},15758:(t,e,r)=>{var n=r(37934);r(10853),r(31330);var i=n.asn1,o=t.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=s;var a={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(a)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(a)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},6779:(t,e,r)=>{var n=r(37934);r(31330),r(78808),r(90770),function(){if(n.prime)t.exports=n.prime;else{var e=t.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var s=function(t,e){return t|e};e.generateProbablePrime=function(t,e,i){"function"===typeof e&&(i=e,e={});var o=(e=e||{}).algorithm||"PRIMEINC";"string"===typeof o&&(o={name:o}),o.options=o.options||{};var s=e.prng||n.random,u={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}};if("PRIMEINC"===o.name)return function(t,e,i,o){if("workers"in i)return function(t,e,i,o){if("undefined"===typeof Worker)return a(t,e,i,o);var s=c(t,e),u=i.workers,l=i.workLoad||100,h=30*l/8,f=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(t,e){t&&(e=2),u=e-1,d()}));function d(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(f);for(i=0;i<u;++i)n[i].addEventListener("message",d);var a=!1;function d(i){if(!a){0;var u=i.data;if(u.found){for(var f=0;f<n.length;++f)n[f].terminate();return a=!0,o(null,new r(u.prime,16))}s.bitLength()>t&&(s=c(t,e));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:l}),s.dAddOffset(h,0)}}}d()}(t,e,i,o);return a(t,e,i,o)}(t,u,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function a(t,e,r,n){var i=c(t,e),o=function(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}(i.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),u(i,t,e,0,o,s,n)}function u(t,e,r,o,s,a,l){var h=+new Date;do{if(t.bitLength()>e&&(t=c(e,r)),t.isProbablePrime(s))return l(null,t);t.dAddOffset(i[o++%8],0)}while(a<0||+new Date-h<a);n.util.setImmediate((function(){u(t,e,r,o,s,a,l)}))}function c(t,e){var n=new r(t,e),i=t-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),s,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}}()},20784:(t,e,r)=>{var n=r(21964),i=r(37934);r(31330);var o=null;!i.util.isNodejs||i.options.usePureJavaScript||n.versions["node-webkit"]||(o=r(71381)),(t.exports=i.prng=i.prng||{}).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),s=0;s<32;++s)n[s]=r.create();function a(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r===0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var i=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(i),e.generated=0}function c(t){var e=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)});var o=i.util.createBuffer();if(e)for(;o.length()<t;){var s=Math.max(1,Math.min(t-o.length(),65536)/4),a=new Uint32Array(Math.floor(s));try{e(a);for(var u=0;u<a.length;++u)o.putInt32(a[u])}catch(d){if(!("undefined"!==typeof QuotaExceededError&&d instanceof QuotaExceededError))throw d}}if(o.length()<t)for(var c,l,h,f=Math.floor(65536*Math.random());o.length()<t;){l=16807*(65535&f),l+=(32767&(c=16807*(f>>16)))<<16,f=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)h=f>>>(u<<3),h^=Math.floor(256*Math.random()),o.putByte(255&h)}return o.getBytes(t)}return e.pools=n,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var n=e.plugin.cipher,o=e.plugin.increment,s=e.plugin.formatKey,a=e.plugin.formatSeed,c=i.util.createBuffer();e.key=null,function l(h){if(h)return r(h);if(c.length()>=t)return r(null,c.getBytes(t));e.generated>1048575&&(e.key=null);if(null===e.key)return i.util.nextTick((function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,(function(r,n){if(r)return t(r);e.collect(n),u(),t()}))}(l)}));var f=n(e.key,e.seed);e.generated+=f.length,c.putBytes(f),e.key=s(n(e.key,o(e.seed))),e.seed=a(n(e.key,e.seed)),i.util.setImmediate(l)}()},e.generateSync=function(t){var r=e.plugin.cipher,n=e.plugin.increment,o=e.plugin.formatKey,s=e.plugin.formatSeed;e.key=null;for(var u=i.util.createBuffer();u.length()<t;){e.generated>1048575&&(e.key=null),null===e.key&&a();var c=r(e.key,e.seed);e.generated+=c.length,u.putBytes(c),e.key=o(r(e.key,n(e.seed))),e.seed=s(r(e.key,e.seed))}return u.getBytes(t)},o?(e.seedFile=function(t,e){o.randomBytes(t,(function(t,r){if(t)return e(t);e(null,r.toString())}))},e.seedFileSync=function(t){return o.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,c(t))}catch(r){e(r)}},e.seedFileSync=c),e.collect=function(t){for(var r=t.length,n=0;n<r;++n)e.pools[e.pool].update(t.substr(n,1)),e.pool=31===e.pool?0:e.pool+1},e.collectInt=function(t,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(t>>i&255);e.collect(n)},e.registerWorker=function(t){if(t===self)e.seedFile=function(t,e){self.addEventListener("message",(function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,(function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})}))}))}},e}},95884:(t,e,r)=>{var n=r(37934);r(90770),r(31330),(t.exports=n.pss=n.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,i=t.mgf,o=r.digestLength,s=t.salt||null;if("string"===typeof s&&(s=n.util.createBuffer(s)),"saltLength"in t)e=t.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");e=s.length()}if(null!==s&&s.length()!==e)throw new Error("Given salt length does not match length of given salt.");var a=t.prng||n.random,u={encode:function(t,u){var c,l,h=u-1,f=Math.ceil(h/8),d=t.digest().getBytes();if(f<o+e+2)throw new Error("Message is too long to encrypt.");l=null===s?a.getBytesSync(e):s.bytes();var p=new n.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(d),p.putBytes(l),r.start(),r.update(p.getBytes());var y=r.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,f-e-o-2),g.putByte(1),g.putBytes(l);var m=g.getBytes(),b=f-o-1,v=i.generate(y,b),w="";for(c=0;c<b;c++)w+=String.fromCharCode(m.charCodeAt(c)^v.charCodeAt(c));var _=65280>>8*f-h&255;return(w=String.fromCharCode(w.charCodeAt(0)&~_)+w.substr(1))+y+String.fromCharCode(188)},verify:function(t,s,a){var u,c=a-1,l=Math.ceil(c/8);if(s=s.substr(-l),l<o+e+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var h=l-o-1,f=s.substr(0,h),d=s.substr(h,o),p=65280>>8*l-c&255;if(0!==(f.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(d,h),g="";for(u=0;u<h;u++)g+=String.fromCharCode(f.charCodeAt(u)^y.charCodeAt(u));g=String.fromCharCode(g.charCodeAt(0)&~p)+g.substr(1);var m=l-o-e-2;for(u=0;u<m;u++)if(0!==g.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var b=g.substr(-e),v=new n.util.ByteBuffer;return v.fillWithByte(0,8),v.putBytes(t),v.putBytes(b),r.start(),r.update(v.getBytes()),d===r.digest().getBytes()}};return u}},90770:(t,e,r)=>{var n=r(37934);r(28085),r(25455),r(20784),r(31330),n.random&&n.random.getBytes?t.exports=n.random:function(e){var r={},i=new Array(4),o=n.util.createBuffer();function s(){var t=n.prng.create(r);return t.getBytes=function(e,r){return t.generate(e,r)},t.getBytesSync=function(e){return t.generate(e)},t}r.formatKey=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),n.aes._expandKey(t,!1)},r.formatSeed=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},r.cipher=function(t,e){return n.aes._updateBlock(t,e,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(t){return++t[3],t},r.md=n.md.sha256;var a=s(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(t){return l.getRandomValues(t)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"===typeof window||window.document,a.collectInt(+new Date,32),"undefined"!==typeof navigator){var h="";for(var f in navigator)try{"string"==typeof navigator[f]&&(h+=navigator[f])}catch(d){}a.collect(h),h=null}e&&(e().mousemove((function(t){a.collectInt(t.clientX,16),a.collectInt(t.clientY,16)})),e().keypress((function(t){a.collectInt(t.charCode,8)})))}if(n.random)for(var f in a)n.random[f]=a[f];else n.random=a;n.random.createInstance=s,t.exports=n.random}("undefined"!==typeof jQuery?jQuery:null)},73038:(t,e,r)=>{var n=r(37934);r(31330);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],s=function(t,e){return t<<e&65535|(65535&t)>>16-e},a=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"===typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,o=t,s=t.length(),a=e,u=Math.ceil(a/8),c=255>>(7&a);for(r=s;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-s)&255]);for(o.setAt(128-u,i[o.at(128-u)&c]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(t,e,r){var i,u,c,l,h=!1,f=null,d=null,p=null,y=[];for(t=n.rc2.expandKey(t,e),c=0;c<64;c++)y.push(t.getInt16Le());r?(i=function(t){for(c=0;c<4;c++)t[c]+=y[l]+(t[(c+3)%4]&t[(c+2)%4])+(~t[(c+3)%4]&t[(c+1)%4]),t[c]=s(t[c],o[c]),l++},u=function(t){for(c=0;c<4;c++)t[c]+=y[63&t[(c+3)%4]]}):(i=function(t){for(c=3;c>=0;c--)t[c]=a(t[c],o[c]),t[c]-=y[l]+(t[(c+3)%4]&t[(c+2)%4])+(~t[(c+3)%4]&t[(c+1)%4]),l--},u=function(t){for(c=3;c>=0;c--)t[c]-=y[63&t[(c+3)%4]]});var g=function(t){var e=[];for(c=0;c<4;c++){var n=f.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),e.push(65535&n)}l=r?0:63;for(var i=0;i<t.length;i++)for(var o=0;o<t[i][0];o++)t[i][1](e);for(c=0;c<4;c++)null!==p&&(r?p.putInt16Le(e[c]):e[c]^=p.getInt16Le()),d.putInt16Le(e[c])},m=null;return m={start:function(t,e){t&&"string"===typeof t&&(t=n.util.createBuffer(t)),h=!1,f=n.util.createBuffer(),d=e||new n.util.createBuffer,p=t,m.output=d},update:function(t){for(h||f.putBuffer(t);f.length()>=8;)g([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(e&&(h=!0,m.update()),!r&&(e=0===f.length()))if(t)e=t(8,d,!r);else{var i=d.length(),o=d.at(i-1);o>i?e=!1:d.truncate(o)}return e}}};n.rc2.startEncrypting=function(t,e,r){var i=n.rc2.createEncryptionCipher(t,128);return i.start(e,r),i},n.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var i=n.rc2.createDecryptionCipher(t,128);return i.start(e,r),i},n.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},95791:(t,e,r)=>{var n=r(37934);if(r(10853),r(78808),r(56661),r(38844),r(6779),r(90770),r(31330),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(71381):null,s=n.asn1,a=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},y=function(t){var e;if(!(t.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=u.oids[t.algorithm];var n=s.oidToDer(e).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),o=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);o.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),o.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var a=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(o),i.value.push(a),s.toDer(i).getBytes()},g=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);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var s=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);s.compareTo(a)<0;)s=s.add(e.p);var u=s.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return u=u.multiply(o.modInverse(e.n)).mod(e.n)};function m(t,e,r){var i=n.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}i.putByte(0),i.putByte(r);var a,u=o-3-t.length;if(0===r||1===r){a=0===r?0:255;for(var c=0;c<u;++c)i.putByte(a)}else for(;u>0;){var l=0,h=n.random.getBytes(u);for(c=0;c<u;++c)0===(a=h.charCodeAt(c))?++l:i.putByte(a);u=l}return i.putByte(0),i.putBytes(t),i}function b(t,e,r,i){var o=Math.ceil(e.n.bitLength()/8),s=n.util.createBuffer(t),a=s.getByte(),u=s.getByte();if(0!==a||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&"undefined"===typeof i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=o-3-i;for(var l=0;l<c;++l)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++c}else if(2===u)for(c=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++c}if(0!==s.getByte()||c!==o-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function v(t,e,r){"function"===typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function s(){a(t.pBits,(function(e,n){return e?r(e):(t.p=n,null!==t.q?c(e,t.q):void a(t.qBits,c))}))}function a(t,e){n.prime.generateProbablePrime(t,o,e)}function c(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void s();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void a(t.qBits,c);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void a(t.qBits,c);var l=t.e.modInverse(t.phi);t.keys={privateKey:u.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:u.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(o.prng=e.prng),s()}function w(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0===(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128===(128&r.charCodeAt(1)))?r.substr(1):r}function _(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 E(t){return n.util.isNodejs&&"function"===typeof o[t]}function S(t){return"undefined"!==typeof a.globalScope&&"object"===typeof a.globalScope.crypto&&"object"===typeof a.globalScope.crypto.subtle&&"function"===typeof a.globalScope.crypto.subtle[t]}function I(t){return"undefined"!==typeof a.globalScope&&"object"===typeof a.globalScope.msCrypto&&"object"===typeof a.globalScope.msCrypto.subtle&&"function"===typeof a.globalScope.msCrypto.subtle[t]}function A(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i<e.length;++i)r[i]=e.charCodeAt(i);return r}u.rsa.encrypt=function(t,e,r){var o,s=r,a=Math.ceil(e.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,o=m(t,e,r)):(o=n.util.createBuffer()).putBytes(t);for(var u=new i(o.toHex(),16),c=g(u,e,s).toString(16),l=n.util.createBuffer(),h=a-Math.ceil(c.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(t,e,r,o){var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=s,a}var u=new i(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=g(u,e,r).toString(16),l=n.util.createBuffer(),h=s-Math.ceil(c.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(c)),!1!==o?b(l.getBytes(),e,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(t,e,r){"string"===typeof t&&(t=parseInt(t,10)),t=t||2048;var o,s=(r=r||{}).prng||n.random,a={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:t,rng:a,eInt:e||65537,e:new i(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},u.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,s=function(t,e){return t|e},a=+new Date,l=0;null===t.keys&&(e<=0||l<e);){if(0===t.state){var h=null===t.p?t.pBits:t.qBits,f=h-1;0===t.pqState?(t.num=new i(h,t.rng),t.num.testBit(f)||t.num.bitwiseTo(i.ONE.shiftLeft(f),s,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),o=0,++t.pqState):1===t.pqState?t.num.bitLength()>h?t.pqState=0:t.num.isProbablePrime(_(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var d=t.e.modInverse(t.phi);t.keys={privateKey:u.rsa.setPrivateKey(t.n,t.e,d,t.p,t.q,d.mod(t.p1),d.mod(t.q1),t.q.modInverse(t.p)),publicKey:u.rsa.setPublicKey(t.n,t.e)}}l+=(n=+new Date)-a,a=n}return null!==t.keys},u.rsa.generateKeyPair=function(t,e,r,i){if(1===arguments.length?"object"===typeof t?(r=t,t=void 0):"function"===typeof t&&(i=t,t=void 0):2===arguments.length?"number"===typeof t?"function"===typeof e?(i=e,e=void 0):"number"!==typeof e&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):3===arguments.length&&("number"===typeof e?"function"===typeof r&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(i){if(E("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(t,e,r){if(t)return i(t);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(e)})}));if(S("generateKey")&&S("exportKey"))return a.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:A(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(t){return a.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)})).then(void 0,(function(t){i(t)})).then((function(t){if(t){var e=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));i(null,{privateKey:e,publicKey:u.setRsaPublicKey(e.n,e.e)})}}));if(I("generateKey")&&I("exportKey")){var c=a.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:A(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=a.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){i(t)}},void(c.onerror=function(t){i(t)})}}else if(E("generateKeyPairSync")){var l=o.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var h=u.rsa.createKeyPairGenerationState(t,e,r);if(!i)return u.rsa.stepKeyPairGenerationState(h,0),h.keys;v(h,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"===typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return m(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"===typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(t,e,i,o){"string"===typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===o&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(t,e){e=b(e,r,!0);var i=s.fromDer(e,{parseAllBytes:o._parseAllDigestBytes}),a={},u=[];if(!s.validate(i,p,a,u))throw(c=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,c;var c,l=s.derToOid(a.algorithmIdentifier);if(l!==n.oids.md2&&l!==n.oids.md5&&l!==n.oids.sha1&&l!==n.oids.sha224&&l!==n.oids.sha256&&l!==n.oids.sha384&&l!==n.oids.sha512&&l!==n.oids["sha512-224"]&&l!==n.oids["sha512-256"])throw(c=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=l,c;return t===a.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(t,e){return t===(e=b(e,r,!0))}});var a=u.rsa.decrypt(e,r,!0,!1);return i.verify(t,a,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(t,e,r,i,o,s,a,c){var l={n:t,e:e,d:r,p:i,q:o,dP:s,dQ:a,qInv:c,decrypt:function(t,e,r){"string"===typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(t,l,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:b};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,l,!1)},sign:function(t,e){var r=!1;"string"===typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:y},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(t).getBytes())])},u.privateKeyFromAsn1=function(t){var e,r,o,a,c,f,d,p,y={},g=[];if(s.validate(t,l,y,g)&&(t=s.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(t,h,y,g)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return e=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),f=n.util.createBuffer(y.privateKeyExponent1).toHex(),d=n.util.createBuffer(y.privateKeyExponent2).toHex(),p=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(e,16),new i(r,16),new i(o,16),new i(a,16),new i(c,16),new i(f,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.qInv))])},u.publicKeyFromAsn1=function(t){var e={},r=[];if(s.validate(t,d,e,r)){var o,a=s.derToOid(e.publicKeyOid);if(a!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=a,o;t=e.rsaPublicKey}if(r=[],!s.validate(t,f,e,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(e.publicKeyModulus).toHex(),l=n.util.createBuffer(e.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(t)])])},u.publicKeyToRSAPublicKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,w(t.e))])}},11715:(t,e,r)=>{var n=r(37934);r(84630),r(31330);var i=t.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),s=!0);var t=null,e=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return e=n.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,s){"utf8"===s&&(o=n.util.encodeUtf8(o));var u=o.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),a(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(e.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(o.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(u=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(l>>>0),l=u>>>0;s.putInt32(l);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};a(f,r,s);var d=n.util.createBuffer();return d.putInt32(f.h0),d.putInt32(f.h1),d.putInt32(f.h2),d.putInt32(f.h3),d.putInt32(f.h4),d},i};var o=null,s=!1;function a(t,e,r){for(var n,i,o,s,a,u,c,l=r.length();l>=64;){for(i=t.h0,o=t.h1,s=t.h2,a=t.h3,u=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,n=(i<<5|i>>>27)+(a^o&(s^a))+u+1518500249+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<20;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(a^o&(s^a))+u+1518500249+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<32;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+1859775393+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<40;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+1859775393+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<60;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o&s|a&(o^s))+u+2400959708+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<80;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+3395469782+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+s|0,t.h3=t.h3+a|0,t.h4=t.h4+u|0,l-=64}}},25455:(t,e,r)=>{var n=r(37934);r(84630),r(31330);var i=t.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=[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],s=!0);var t=null,e=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return e=n.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,s){"utf8"===s&&(o=n.util.encodeUtf8(o));var a=o.length;i.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=a[1],a[1]=a[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(o),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(e.bytes());var a,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(o.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(a=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(l>>>0),l=a>>>0;s.putInt32(l);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(f,r,s);var d=n.util.createBuffer();return d.putInt32(f.h0),d.putInt32(f.h1),d.putInt32(f.h2),d.putInt32(f.h3),d.putInt32(f.h4),d.putInt32(f.h5),d.putInt32(f.h6),d.putInt32(f.h7),d},i};var o=null,s=!1,a=null;function u(t,e,r){for(var n,i,o,s,u,c,l,h,f,d,p,y,g,m=r.length();m>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(c=t.h0,l=t.h1,h=t.h2,f=t.h3,d=t.h4,p=t.h5,y=t.h6,g=t.h7,u=0;u<64;++u)o=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=c&l|h&(c^l),n=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(y^d&(p^y))+a[u]+e[u],g=y,y=p,p=d,d=f+n>>>0,f=h,h=l,l=c,c=n+(i=o+s)>>>0;t.h0=t.h0+c|0,t.h1=t.h1+l|0,t.h2=t.h2+h|0,t.h3=t.h3+f|0,t.h4=t.h4+d|0,t.h5=t.h5+p|0,t.h6=t.h6+y|0,t.h7=t.h7+g|0,m-=64}}},62025:(t,e,r)=>{var n=r(37934);r(84630),r(31330);var i=t.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var o=n.sha384=n.sha512.sha384=n.sha512.sha384||{};o.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=o,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(t){if(a||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),u=[[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]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],a=!0),"undefined"===typeof t&&(t="SHA-512"),!(t in c))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=c[t],r=null,i=n.util.createBuffer(),o=new Array(80),h=0;h<80;++h)o[h]=new Array(2);var f=64;switch(t){case"SHA-384":f=48;break;case"SHA-512/256":f=32;break;case"SHA-512/224":f=28}var d={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:f,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var t=d.messageLengthSize/4,o=0;o<t;++o)d.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(e.length);for(o=0;o<e.length;++o)r[o]=e[o].slice(0);return d}};return d.start(),d.update=function(t,e){"utf8"===e&&(t=n.util.encodeUtf8(t));var s=t.length;d.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var a=d.fullMessageLength.length-1;a>=0;--a)d.fullMessageLength[a]+=s[1],s[1]=s[0]+(d.fullMessageLength[a]/4294967296>>>0),d.fullMessageLength[a]=d.fullMessageLength[a]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(t),l(r,o,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var e=n.util.createBuffer();e.putBytes(i.bytes());var a,u=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;e.putBytes(s.substr(0,d.blockLength-u));for(var c=8*d.fullMessageLength[0],h=0;h<d.fullMessageLength.length-1;++h)c+=(a=8*d.fullMessageLength[h+1])/4294967296>>>0,e.putInt32(c>>>0),c=a>>>0;e.putInt32(c);var f=new Array(r.length);for(h=0;h<r.length;++h)f[h]=r[h].slice(0);l(f,o,e);var p,y=n.util.createBuffer();p="SHA-512"===t?f.length:"SHA-384"===t?f.length-2:f.length-4;for(h=0;h<p;++h)y.putInt32(f[h][0]),h===p-1&&"SHA-512/224"===t||y.putInt32(f[h][1]);return y},d};var s=null,a=!1,u=null,c=null;function l(t,e,r){for(var n,i,o,s,a,c,l,h,f,d,p,y,g,m,b,v,w,_,E,S,I,A,M,T,R,k,C,P,B,O,N,D,x,L=r.length();L>=128;){for(C=0;C<16;++C)e[C][0]=r.getInt32()>>>0,e[C][1]=r.getInt32()>>>0;for(;C<80;++C)n=(((P=(O=e[C-2])[0])>>>19|(B=O[1])<<13)^(B>>>29|P<<3)^P>>>6)>>>0,i=((P<<13|B>>>19)^(B<<3|P>>>29)^(P<<26|B>>>6))>>>0,o=(((P=(D=e[C-15])[0])>>>1|(B=D[1])<<31)^(P>>>8|B<<24)^P>>>7)>>>0,s=((P<<31|B>>>1)^(P<<24|B>>>8)^(P<<25|B>>>7))>>>0,N=e[C-7],x=e[C-16],B=i+N[1]+s+x[1],e[C][0]=n+N[0]+o+x[0]+(B/4294967296>>>0)>>>0,e[C][1]=B>>>0;for(p=t[0][0],y=t[0][1],g=t[1][0],m=t[1][1],b=t[2][0],v=t[2][1],w=t[3][0],_=t[3][1],E=t[4][0],S=t[4][1],I=t[5][0],A=t[5][1],M=t[6][0],T=t[6][1],R=t[7][0],k=t[7][1],C=0;C<80;++C)l=((E>>>14|S<<18)^(E>>>18|S<<14)^(S>>>9|E<<23))>>>0,h=(M^E&(I^M))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,f=(p&g|b&(p^g))>>>0,d=(y&m|v&(y^m))>>>0,B=k+(((E<<18|S>>>14)^(E<<14|S>>>18)^(S<<23|E>>>9))>>>0)+((T^S&(A^T))>>>0)+u[C][1]+e[C][1],n=R+l+h+u[C][0]+e[C][0]+(B/4294967296>>>0)>>>0,i=B>>>0,o=a+f+((B=c+d)/4294967296>>>0)>>>0,s=B>>>0,R=M,k=T,M=I,T=A,I=E,A=S,E=w+n+((B=_+i)/4294967296>>>0)>>>0,S=B>>>0,w=b,_=v,b=g,v=m,g=p,m=y,p=n+o+((B=i+s)/4294967296>>>0)>>>0,y=B>>>0;B=t[0][1]+y,t[0][0]=t[0][0]+p+(B/4294967296>>>0)>>>0,t[0][1]=B>>>0,B=t[1][1]+m,t[1][0]=t[1][0]+g+(B/4294967296>>>0)>>>0,t[1][1]=B>>>0,B=t[2][1]+v,t[2][0]=t[2][0]+b+(B/4294967296>>>0)>>>0,t[2][1]=B>>>0,B=t[3][1]+_,t[3][0]=t[3][0]+w+(B/4294967296>>>0)>>>0,t[3][1]=B>>>0,B=t[4][1]+S,t[4][0]=t[4][0]+E+(B/4294967296>>>0)>>>0,t[4][1]=B>>>0,B=t[5][1]+A,t[5][0]=t[5][0]+I+(B/4294967296>>>0)>>>0,t[5][1]=B>>>0,B=t[6][1]+T,t[6][0]=t[6][0]+M+(B/4294967296>>>0)>>>0,t[6][1]=B>>>0,B=t[7][1]+k,t[7][0]=t[7][0]+R+(B/4294967296>>>0)>>>0,t[7][1]=B>>>0,L-=128}}},31330:(t,e,r)=>{var n=r(21964),i=r(30285).Buffer,o=r(37934),s=r(47271),a=t.exports=o.util=o.util||{};function u(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function c(t){if(this.data="",this.read=0,"string"===typeof t)this.data=t;else if(a.isArrayBuffer(t)||a.isArrayBufferView(t))if("undefined"!==typeof i&&t instanceof i)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(n){for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof c||"object"===typeof t&&"string"===typeof t.data&&"number"===typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if("undefined"!==typeof n&&n.nextTick&&!n.browser)return a.nextTick=n.nextTick,void("function"===typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"===typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(t){return setImmediate(t)});if(a.setImmediate=function(t){setTimeout(t,0)},"undefined"!==typeof window&&"function"===typeof window.postMessage){var t="forge.setImmediate",e=[];a.setImmediate=function(r){e.push(r),1===e.length&&window.postMessage(t,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===t){r.stopPropagation();var n=e.slice();e.length=0,n.forEach((function(t){t()}))}}),!0)}if("undefined"!==typeof MutationObserver){var r=Date.now(),i=!0,o=document.createElement("div");e=[];new MutationObserver((function(){var t=e.slice();e.length=0,t.forEach((function(t){t()}))})).observe(o,{attributes:!0});var s=a.setImmediate;a.setImmediate=function(t){Date.now()-r>15?(r=Date.now(),s(t)):(e.push(t),1===e.length&&o.setAttribute("a",i=!i))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!==typeof n&&n.versions&&n.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"===typeof self?window:self,a.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},a.isArrayBuffer=function(t){return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer},a.isArrayBufferView=function(t){return t&&a.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},a.ByteBuffer=c,a.ByteStringBuffer=c;a.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},a.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},a.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},a.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(a.encodeUtf8(t))},a.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.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(255&t))},a.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},a.ByteStringBuffer.prototype.putInt=function(t,e){u(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},a.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},a.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},a.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},a.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},a.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},a.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},a.ByteStringBuffer.prototype.getInt=function(t){u(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},a.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},a.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):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.ByteStringBuffer.prototype.bytes=function(t){return"undefined"===typeof t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},a.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},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var t=a.createBuffer(this.data);return t.read=this.read,t},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},a.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},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=a.isArrayBuffer(t),n=a.isArrayBufferView(t);if(r||n)return this.data=r?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==t&&void 0!==t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.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},a.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},a.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},a.DataBuffer.prototype.putBytes=function(t,e){if(a.isArrayBufferView(t)){var r=(n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(t)){var n=new Uint8Array(t);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(t instanceof a.DataBuffer||"object"===typeof t&&"number"===typeof t.read&&"number"===typeof t.write&&a.isArrayBufferView(t.data)){n=new Uint8Array(t.data.byteLength,t.read,t.length());return this.accommodate(n.byteLength),new Uint8Array(t.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(t instanceof a.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"===typeof t){var i;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(t,i,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(t,i,this.write),this;if("utf8"===e&&(t=a.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===e)return this.accommodate(2*t.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},a.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},a.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},a.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},a.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},a.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},a.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},a.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(t,e){u(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},a.DataBuffer.prototype.putSignedInt=function(t,e){return u(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},a.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},a.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},a.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},a.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},a.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},a.DataBuffer.prototype.getInt=function(t){u(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},a.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},a.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):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.DataBuffer.prototype.bytes=function(t){return"undefined"===typeof t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},a.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var 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},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},a.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},a.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return a.binary.raw.encode(e);if("hex"===t)return a.binary.hex.encode(e);if("base64"===t)return a.binary.base64.encode(e);if("utf8"===t)return a.text.utf8.decode(e);if("utf16"===t)return a.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},a.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=a.encodeUtf8(t)),new a.ByteBuffer(t)},a.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},a.xorBytes=function(t,e,r){for(var n="",i="",o="",s=0,a=0;r>0;--r,++s)i=t.charCodeAt(s)^e.charCodeAt(s),a>=10&&(n+=o,o="",a=0),o+=String.fromCharCode(i),++a;return n+=o},a.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(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},a.bytesToHex=function(t){return a.createBuffer(t).toHex()},a.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[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],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(t,e){for(var r,n,i,o="",s="",a=0;a<t.length;)r=t.charCodeAt(a++),n=t.charCodeAt(a++),i=t.charCodeAt(a++),o+=l.charAt(r>>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+=o},a.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",s=0;s<t.length;)e=h[t.charCodeAt(s++)-43],r=h[t.charCodeAt(s++)-43],n=h[t.charCodeAt(s++)-43],i=h[t.charCodeAt(s++)-43],o+=String.fromCharCode(e<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},a.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},a.decodeUtf8=function(t){return decodeURIComponent(escape(t))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},a.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},a.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o<t.length;++o)n[i++]=t.charCodeAt(o);return e?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2)));var i=0,o=r=r||0;for(1&t.length&&(i=1,n[o++]=parseInt(t[0],16));i<t.length;i+=2)n[o++]=parseInt(t.substr(i,2),16);return e?o-r:n},a.binary.base64.encode=function(t,e){for(var r,n,i,o="",s="",a=0;a<t.byteLength;)r=t[a++],n=t[a++],i=t[a++],o+=l.charAt(r>>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+=o},a.binary.base64.decode=function(t,e,r){var n,i,o,s,a=e;a||(a=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<t.length;)n=h[t.charCodeAt(u++)-43],i=h[t.charCodeAt(u++)-43],o=h[t.charCodeAt(u++)-43],s=h[t.charCodeAt(u++)-43],a[c++]=n<<2|i>>4,64!==o&&(a[c++]=(15&i)<<4|o>>2,64!==s&&(a[c++]=(3&o)<<6|s));return e?c-r:a.subarray(0,c)},a.binary.base58.encode=function(t,e){return a.binary.baseN.encode(t,f,e)},a.binary.base58.decode=function(t,e){return a.binary.baseN.decode(t,f,e)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(t,e,r){t=a.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o<t.length;++o)n[i++]=t.charCodeAt(o);return e?i-r:n},a.text.utf8.decode=function(t){return a.decodeUtf8(String.fromCharCode.apply(null,t))},a.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(2*t.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,s=r,a=0;a<t.length;++a)i[s++]=t.charCodeAt(a),o+=2;return e?o-r:n},a.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},a.deflate=function(t,e,r){if(e=a.decode64(t.deflate(a.encode64(e)).rval),r){var n=2;32&e.charCodeAt(1)&&(n=6),e=e.substring(n,e.length-4)}return e},a.inflate=function(t,e,r){var n=t.inflate(a.encode64(e)).rval;return null===n?null:a.decode64(n)};var d=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(null===r?n=t.removeItem(e):(r=a.encode64(JSON.stringify(r)),n=t.setItem(e,r)),"undefined"!==typeof n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},p=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(null===r.rval){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 null!==r&&(r=JSON.parse(a.decode64(r))),r},y=function(t,e,r,n){var i=p(t,e);null===i&&(i={}),i[r]=n,d(t,e,i)},g=function(t,e,r){var n=p(t,e);return null!==n&&(n=r in n?n[r]:null),n},m=function(t,e,r){var n=p(t,e);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),d(t,e,n)}},b=function(t,e){d(t,e,null)},v=function(t,e,r){var n,i=null;"undefined"===typeof r&&(r=["web","flash"]);var o=!1,s=null;for(var a in r){n=r[a];try{if("flash"===n||"both"===n){if(null===e[0])throw new Error("Flash local storage not available.");i=t.apply(this,e),o="flash"===n}"web"!==n&&"both"!==n||(e[0]=localStorage,i=t.apply(this,e),o=!0)}catch(u){s=u}if(o)break}if(!o)throw s;return i};a.setItem=function(t,e,r,n,i){v(y,arguments,i)},a.getItem=function(t,e,r,n){return v(g,arguments,n)},a.removeItem=function(t,e,r,n){v(m,arguments,n)},a.clearItems=function(t,e,r){v(b,arguments,r)},a.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},a.format=function(t){for(var e,r,n=/%./g,i=0,o=[],s=0;e=n.exec(t);){(r=t.substring(s,n.lastIndex-2)).length>0&&o.push(r),s=n.lastIndex;var a=e[0][1];switch(a){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+a+"?>")}}return o.push(t.substring(s)),o.join("")},a.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,s=void 0===r?",":r,a=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+a:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(i-c).toFixed(o).slice(2):"")},a.formatSize=function(t){return t=t>=1073741824?a.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?a.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?a.formatNumber(t/1024,0)+" KiB":a.formatNumber(t,0)+" bytes"},a.bytesFromIP=function(t){return-1!==t.indexOf(".")?a.bytesFromIPv4(t):-1!==t.indexOf(":")?a.bytesFromIPv6(t):null},a.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=a.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()},a.bytesFromIPv6=function(t){for(var e=0,r=2*(8-(t=t.split(":").filter((function(t){return 0===t.length&&++e,!0}))).length+e),n=a.createBuffer(),i=0;i<8;++i)if(t[i]&&0!==t[i].length){var o=a.hexToBytes(t[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(t){return 4===t.length?a.bytesToIPv4(t):16===t.length?a.bytesToIPv6(t):null},a.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},a.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var o=a.bytesToHex(t[i]+t[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=e.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),0===c.start&&e.unshift(""),7===c.end&&e.push(""))}return e.join(":")},a.estimateCores=function(t,e){if("function"===typeof t&&(e=t,t={}),t=t||{},"cores"in a&&!t.update)return e(null,a.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,e(null,a.cores);if("undefined"===typeof Worker)return a.cores=1,e(null,a.cores);if("undefined"===typeof Blob)return a.cores=2,e(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(t){for(var e=Date.now(),r=e+4;Date.now()<r;);self.postMessage({st:e,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function t(n,i,o){if(0===i){var s=Math.floor(n.reduce((function(t,e){return t+e}),0)/n.length);return a.cores=Math.max(1,s),URL.revokeObjectURL(r),e(null,a.cores)}!function(t,e){for(var n=[],i=[],o=0;o<t;++o){var s=new Worker(r);s.addEventListener("message",(function(r){if(i.push(r.data),i.length===t){for(var o=0;o<t;++o)n[o].terminate();e(null,i)}})),n.push(s)}for(o=0;o<t;++o)n[o].postMessage(o)}(o,(function(e,r){n.push(function(t,e){for(var r=[],n=0;n<t;++n)for(var i=e[n],o=r[n]=[],s=0;s<t;++s)if(n!==s){var a=e[s];(i.st>a.st&&i.st<a.et||a.st>i.st&&a.st<i.et)&&o.push(s)}return r.reduce((function(t,e){return Math.max(t,e.length)}),0)}(o,r)),t(n,i-1,o)}))}([],5,16)}},87141:(t,e,r)=>{var n=r(37934);r(28085),r(10853),r(96052),r(84630),r(66513),r(56661),r(82232),r(95884),r(95791),r(31330);var i=n.asn1,o=t.exports=n.pki=n.pki||{},s=o.oids,a={};a.CN=s.commonName,a.commonName="CN",a.C=s.countryName,a.countryName="C",a.L=s.localityName,a.localityName="L",a.ST=s.stateOrProvinceName,a.stateOrProvinceName="ST",a.O=s.organizationName,a.organizationName="O",a.OU=s.organizationalUnitName,a.organizationalUnitName="OU",a.E=s.emailAddress,a.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},h={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},f={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[h,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(t,e){"string"===typeof e&&(e={shortName:e});for(var r,n=null,i=0;null===n&&i<t.attributes.length;++i)r=t.attributes[i],(e.type&&e.type===r.type||e.name&&e.name===r.name||e.shortName&&e.shortName===r.shortName)&&(n=r);return n}o.RDNAttributesAsArray=function(t,e){for(var r,n,o,u=[],c=0;c<t.value.length;++c){r=t.value[c];for(var l=0;l<r.value.length;++l)o={},n=r.value[l],o.type=i.derToOid(n.value[0].value),o.value=n.value[1].value,o.valueTagClass=n.value[1].type,o.type in s&&(o.name=s[o.type],o.name in a&&(o.shortName=a[o.name])),e&&(e.update(o.type),e.update(o.value)),u.push(o)}return u},o.CRIAttributesAsArray=function(t){for(var e=[],r=0;r<t.length;++r)for(var n=t[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,l=0;l<c.length;++l){var h={};if(h.type=u,h.value=c[l].value,h.valueTagClass=c[l].type,h.type in s&&(h.name=s[h.type],h.name in a&&(h.shortName=a[h.name])),h.type===s.extensionRequest){h.extensions=[];for(var f=0;f<h.value.length;++f)h.extensions.push(o.certificateExtensionFromAsn1(h.value[f]))}e.push(h)}return e};var p=function(t,e,r){var n={};if(t!==s["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var o={},a=[];if(!i.validate(e,l,o,a)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=a,u}return void 0!==o.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(o.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(n.saltLength=o.saltLength.charCodeAt(0)),n},y=function(t){switch(s[t.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return n.md.sha1.create();case"md5WithRSAEncryption":return n.md.md5.create();case"sha256WithRSAEncryption":case"RSASSA-PSS":return n.md.sha256.create();case"sha384WithRSAEncryption":return n.md.sha384.create();case"sha512WithRSAEncryption":return n.md.sha512.create();default:var e=new Error("Could not compute "+t.type+" digest. Unknown signature OID.");throw e.signatureOid=t.signatureOid,e}},g=function(t){var e,r=t.certificate;switch(r.signatureOid){case s.sha1WithRSAEncryption:case s.sha1WithRSASignature:break;case s["RSASSA-PSS"]:var i,o,a;if(void 0===(i=s[r.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[i])throw(a=new Error("Unsupported MGF hash function.")).oid=r.signatureParameters.mgf.hash.algorithmOid,a.name=i,a;if(void 0===(o=s[r.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[o])throw(a=new Error("Unsupported MGF function.")).oid=r.signatureParameters.mgf.algorithmOid,a.name=o,a;if(o=n.mgf[o].create(n.md[i].create()),void 0===(i=s[r.signatureParameters.hash.algorithmOid])||void 0===n.md[i])throw(a=new Error("Unsupported RSASSA-PSS hash function.")).oid=r.signatureParameters.hash.algorithmOid,a.name=i,a;e=n.pss.create(n.md[i].create(),o,r.signatureParameters.saltLength)}return r.publicKey.verify(t.md.digest().getBytes(),t.signature,e)};function m(t){for(var e,r,o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),s=t.attributes,a=0;a<s.length;++a){var u=(e=s[a]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in e&&(c=e.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),o.value.push(r)}return o}function b(t){for(var e,r=0;r<t.length;++r){if("undefined"===typeof(e=t[r]).name&&(e.type&&e.type in o.oids?e.name=o.oids[e.type]:e.shortName&&e.shortName in a&&(e.name=o.oids[a[e.shortName]])),"undefined"===typeof e.type){if(!e.name||!(e.name in o.oids))throw(u=new Error("Attribute type not specified.")).attribute=e,u;e.type=o.oids[e.name]}if("undefined"===typeof e.shortName&&e.name&&e.name in a&&(e.shortName=a[e.name]),e.type===s.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=i.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var n=0;n<e.extensions.length;++n)e.value.push(o.certificateExtensionToAsn1(v(e.extensions[n])))}var u;if("undefined"===typeof e.value)throw(u=new Error("Attribute value not specified.")).attribute=e,u}}function v(t,e){if(e=e||{},"undefined"===typeof t.name&&t.id&&t.id in o.oids&&(t.name=o.oids[t.id]),"undefined"===typeof t.id){if(!t.name||!(t.name in o.oids))throw(_=new Error("Extension ID not specified.")).extension=t,_;t.id=o.oids[t.name]}if("undefined"!==typeof t.value)return t;if("keyUsage"===t.name){var r=0,a=0,u=0;t.digitalSignature&&(a|=128,r=7),t.nonRepudiation&&(a|=64,r=6),t.keyEncipherment&&(a|=32,r=5),t.dataEncipherment&&(a|=16,r=4),t.keyAgreement&&(a|=8,r=3),t.keyCertSign&&(a|=4,r=2),t.cRLSign&&(a|=2,r=1),t.encipherOnly&&(a|=1,r=0),t.decipherOnly&&(u|=128,r=7);var c=String.fromCharCode(r);0!==u?c+=String.fromCharCode(a)+String.fromCharCode(u):0!==a&&(c+=String.fromCharCode(a)),t.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("basicConstraints"===t.name)t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in t&&t.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.pathLenConstraint).getBytes()));else if("extKeyUsage"===t.name){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var h in t)!0===t[h]&&(h in s?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s[h]).getBytes())):-1!==h.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(h).getBytes())))}else if("nsCertType"===t.name){r=0,a=0;t.client&&(a|=128,r=7),t.server&&(a|=64,r=6),t.email&&(a|=32,r=5),t.objsign&&(a|=16,r=4),t.reserved&&(a|=8,r=3),t.sslCA&&(a|=4,r=2),t.emailCA&&(a|=2,r=1),t.objCA&&(a|=1,r=0);c=String.fromCharCode(r);0!==a&&(c+=String.fromCharCode(a)),t.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var f=0;f<t.altNames.length;++f){c=(b=t.altNames[f]).value;if(7===b.type&&b.ip){if(null===(c=n.util.bytesFromIP(b.ip)))throw(_=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=t,_}else 8===b.type&&(c=b.oid?i.oidToDer(i.oidToDer(b.oid)):i.oidToDer(c));t.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,b.type,!1,c))}}else if("nsComment"===t.name&&e.cert){if(!/^[\x00-\x7F]*$/.test(t.comment)||t.comment.length<1||t.comment.length>128)throw new Error('Invalid "nsComment" content.');t.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&e.cert){var d=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=d.toHex(),t.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===t.name&&e.cert){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=t.value.value;if(t.keyIdentifier){var p=!0===t.keyIdentifier?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(t.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===t.authorityCertIssuer?e.cert.issuer:t.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(t.serialNumber){var g=n.util.hexToBytes(!0===t.serialNumber?e.cert.serialNumber:t.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===t.name){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=t.value.value;var b,v=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),w=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f<t.altNames.length;++f){c=(b=t.altNames[f]).value;if(7===b.type&&b.ip){if(null===(c=n.util.bytesFromIP(b.ip)))throw(_=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=t,_}else 8===b.type&&(c=b.oid?i.oidToDer(i.oidToDer(b.oid)):i.oidToDer(c));w.value.push(i.create(i.Class.CONTEXT_SPECIFIC,b.type,!1,c))}v.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[w])),l.push(v)}var _;if("undefined"===typeof t.value)throw(_=new Error("Extension value not specified.")).extension=t,_;return t}function w(t,e){if(t===s["RSASSA-PSS"]){var r=[];return void 0!==e.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==e.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==e.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}function _(t){var e=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return e;for(var r=t.attributes,o=0;o<r.length;++o){var s=r[o],a=s.value,u=i.Type.UTF8;"valueTagClass"in s&&(u=s.valueTagClass),u===i.Type.UTF8&&(a=n.util.encodeUtf8(a));var c=!1;"valueConstructed"in s&&(c=s.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,a)])]);e.value.push(l)}return e}o.certificateFromPem=function(t,e,r){var s=n.pem.decode(t)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var a=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw a.headerType=s.type,a}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(s.body,r);return o.certificateFromAsn1(u,e)},o.certificateToPem=function(t,e){var r={type:"CERTIFICATE",body:i.toDer(o.certificateToAsn1(t)).getBytes()};return n.pem.encode(r,{maxline:e})},o.publicKeyFromPem=function(t){var e=n.pem.decode(t)[0];if("PUBLIC KEY"!==e.type&&"RSA PUBLIC KEY"!==e.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var s=i.fromDer(e.body);return o.publicKeyFromAsn1(s)},o.publicKeyToPem=function(t,e){var r={type:"PUBLIC KEY",body:i.toDer(o.publicKeyToAsn1(t)).getBytes()};return n.pem.encode(r,{maxline:e})},o.publicKeyToRSAPublicKeyPem=function(t,e){var r={type:"RSA PUBLIC KEY",body:i.toDer(o.publicKeyToRSAPublicKey(t)).getBytes()};return n.pem.encode(r,{maxline:e})},o.getPublicKeyFingerprint=function(t,e){var r,s=(e=e||{}).md||n.md.sha1.create();switch(e.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(o.publicKeyToRSAPublicKey(t)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(o.publicKeyToAsn1(t)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+e.type+'".')}s.start(),s.update(r);var a=s.digest();if("hex"===e.encoding){var u=a.toHex();return e.delimiter?u.match(/.{2}/g).join(e.delimiter):u}if("binary"===e.encoding)return a.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".');return a},o.certificationRequestFromPem=function(t,e,r){var s=n.pem.decode(t)[0];if("CERTIFICATE REQUEST"!==s.type){var a=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw a.headerType=s.type,a}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(s.body,r);return o.certificationRequestFromAsn1(u,e)},o.certificationRequestToPem=function(t,e){var r={type:"CERTIFICATE REQUEST",body:i.toDer(o.certificationRequestToAsn1(t)).getBytes()};return n.pem.encode(r,{maxline:e})},o.createCertificate=function(){var t={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return t.siginfo.algorithmOid=null,t.validity={},t.validity.notBefore=new Date,t.validity.notAfter=new Date,t.issuer={},t.issuer.getField=function(e){return d(t.issuer,e)},t.issuer.addField=function(e){b([e]),t.issuer.attributes.push(e)},t.issuer.attributes=[],t.issuer.hash=null,t.subject={},t.subject.getField=function(e){return d(t.subject,e)},t.subject.addField=function(e){b([e]),t.subject.attributes.push(e)},t.subject.attributes=[],t.subject.hash=null,t.extensions=[],t.publicKey=null,t.md=null,t.setSubject=function(e,r){b(e),t.subject.attributes=e,delete t.subject.uniqueId,r&&(t.subject.uniqueId=r),t.subject.hash=null},t.setIssuer=function(e,r){b(e),t.issuer.attributes=e,delete t.issuer.uniqueId,r&&(t.issuer.uniqueId=r),t.issuer.hash=null},t.setExtensions=function(e){for(var r=0;r<e.length;++r)v(e[r],{cert:t});t.extensions=e},t.getExtension=function(e){"string"===typeof e&&(e={name:e});for(var r,n=null,i=0;null===n&&i<t.extensions.length;++i)r=t.extensions[i],(e.id&&r.id===e.id||e.name&&r.name===e.name)&&(n=r);return n},t.sign=function(e,r){t.md=r||n.md.sha1.create();var a=s[t.md.algorithm+"WithRSAEncryption"];if(!a){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=t.md.algorithm,u}t.signatureOid=t.siginfo.algorithmOid=a,t.tbsCertificate=o.getTBSCertificate(t);var c=i.toDer(t.tbsCertificate);t.md.update(c.getBytes()),t.signature=e.sign(t.md)},t.verify=function(e){var r=!1;if(!t.issued(e)){var n=e.issuer,s=t.subject,a=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw a.expectedIssuer=s.attributes,a.actualIssuer=n.attributes,a}var u=e.md;if(null===u){u=y({signatureOid:e.signatureOid,type:"certificate"});var c=e.tbsCertificate||o.getTBSCertificate(e),l=i.toDer(c);u.update(l.getBytes())}return null!==u&&(r=g({certificate:t,md:u,signature:e.signature})),r},t.isIssuer=function(e){var r=!1,n=t.issuer,i=e.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var o,s;r=!0;for(var a=0;r&&a<n.attributes.length;++a)o=n.attributes[a],s=i.attributes[a],o.type===s.type&&o.value===s.value||(r=!1)}return r},t.issued=function(e){return e.isIssuer(t)},t.generateSubjectKeyIdentifier=function(){return o.getPublicKeyFingerprint(t.publicKey,{type:"RSAPublicKey"})},t.verifySubjectKeyIdentifier=function(){for(var e=s.subjectKeyIdentifier,r=0;r<t.extensions.length;++r){var i=t.extensions[r];if(i.id===e){var o=t.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===o}}return!1},t},o.certificateFromAsn1=function(t,e){var r={},s=[];if(!i.validate(t,c,r,s)){var a=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw a.errors=s,a}if(i.derToOid(r.publicKeyOid)!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=o.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);u.serialNumber=l.toHex(),u.signatureOid=n.asn1.derToOid(r.certSignatureOid),u.signatureParameters=p(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=p(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var h=[];if(void 0!==r.certValidity1UTCTime&&h.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&h.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),h.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(h.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=h[0],u.validity.notAfter=h[1],u.tbsCertificate=r.tbsCertificate,e){u.md=y({signatureOid:u.signatureOid,type:"certificate"});var f=i.toDer(u.tbsCertificate);u.md.update(f.getBytes())}var g=n.md.sha1.create(),m=i.toDer(r.certIssuer);g.update(m.getBytes()),u.issuer.getField=function(t){return d(u.issuer,t)},u.issuer.addField=function(t){b([t]),u.issuer.attributes.push(t)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var v=n.md.sha1.create(),w=i.toDer(r.certSubject);return v.update(w.getBytes()),u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){b([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=v.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r<t.value.length;++r)for(var n=t.value[r],i=0;i<n.value.length;++i)e.push(o.certificateExtensionFromAsn1(n.value[i]));return e},o.certificateExtensionFromAsn1=function(t){var e={};if(e.id=i.derToOid(t.value[0].value),e.critical=!1,t.value[1].type===i.Type.BOOLEAN?(e.critical=0!==t.value[1].value.charCodeAt(0),e.value=t.value[2].value):e.value=t.value[1].value,e.id in s)if(e.name=s[e.id],"keyUsage"===e.name){var r=0,o=0;(u=i.fromDer(e.value)).value.length>1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),e.digitalSignature=128===(128&r),e.nonRepudiation=64===(64&r),e.keyEncipherment=32===(32&r),e.dataEncipherment=16===(16&r),e.keyAgreement=8===(8&r),e.keyCertSign=4===(4&r),e.cRLSign=2===(2&r),e.encipherOnly=1===(1&r),e.decipherOnly=128===(128&o)}else if("basicConstraints"===e.name){(u=i.fromDer(e.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?e.cA=0!==u.value[0].value.charCodeAt(0):e.cA=!1;var a=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?a=u.value[0].value:u.value.length>1&&(a=u.value[1].value),null!==a&&(e.pathLenConstraint=i.derToInteger(a))}else if("extKeyUsage"===e.name)for(var u=i.fromDer(e.value),c=0;c<u.value.length;++c){var l=i.derToOid(u.value[c].value);l in s?e[s[l]]=!0:e[l]=!0}else if("nsCertType"===e.name){r=0;(u=i.fromDer(e.value)).value.length>1&&(r=u.value.charCodeAt(1)),e.client=128===(128&r),e.server=64===(64&r),e.email=32===(32&r),e.objsign=16===(16&r),e.reserved=8===(8&r),e.sslCA=4===(4&r),e.emailCA=2===(2&r),e.objCA=1===(1&r)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){var h;e.altNames=[];u=i.fromDer(e.value);for(var f=0;f<u.value.length;++f){var d={type:(h=u.value[f]).type,value:h.value};switch(e.altNames.push(d),h.type){case 1:case 2:case 6:break;case 7:d.ip=n.util.bytesToIP(h.value);break;case 8:d.oid=i.derToOid(h.value)}}}else if("subjectKeyIdentifier"===e.name){u=i.fromDer(e.value);e.subjectKeyIdentifier=n.util.bytesToHex(u.value)}return e},o.certificationRequestFromAsn1=function(t,e){var r={},s=[];if(!i.validate(t,f,r,s)){var a=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw a.errors=s,a}if(i.derToOid(r.publicKeyOid)!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=o.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=n.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=p(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=p(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,e){u.md=y({signatureOid:u.signatureOid,type:"certification request"});var c=i.toDer(u.certificationRequestInfo);u.md.update(c.getBytes())}var l=n.md.sha1.create();return u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){b([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certificationRequestInfoSubject,l),u.subject.hash=l.digest().toHex(),u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(t){return d(u,t)},u.addAttribute=function(t){b([t]),u.attributes.push(t)},u.attributes=o.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},o.createCertificationRequest=function(){var t={version:0,signatureOid:null,signature:null,siginfo:{}};return t.siginfo.algorithmOid=null,t.subject={},t.subject.getField=function(e){return d(t.subject,e)},t.subject.addField=function(e){b([e]),t.subject.attributes.push(e)},t.subject.attributes=[],t.subject.hash=null,t.publicKey=null,t.attributes=[],t.getAttribute=function(e){return d(t,e)},t.addAttribute=function(e){b([e]),t.attributes.push(e)},t.md=null,t.setSubject=function(e){b(e),t.subject.attributes=e,t.subject.hash=null},t.setAttributes=function(e){b(e),t.attributes=e},t.sign=function(e,r){t.md=r||n.md.sha1.create();var a=s[t.md.algorithm+"WithRSAEncryption"];if(!a){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=t.md.algorithm,u}t.signatureOid=t.siginfo.algorithmOid=a,t.certificationRequestInfo=o.getCertificationRequestInfo(t);var c=i.toDer(t.certificationRequestInfo);t.md.update(c.getBytes()),t.signature=e.sign(t.md)},t.verify=function(){var e=!1,r=t.md;if(null===r){r=y({signatureOid:t.signatureOid,type:"certification request"});var n=t.certificationRequestInfo||o.getCertificationRequestInfo(t),s=i.toDer(n);r.update(s.getBytes())}return null!==r&&(e=g({certificate:t,md:r,signature:t.signature})),e},t};var E=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function I(t){return t>=E&&t<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(t)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(t))}o.getTBSCertificate=function(t){var e=I(t.validity.notBefore),r=I(t.validity.notAfter),s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.siginfo.algorithmOid).getBytes()),w(t.siginfo.algorithmOid,t.siginfo.parameters)]),m(t.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[e,r]),m(t.subject),o.publicKeyToAsn1(t.publicKey)]);return t.issuer.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+t.issuer.uniqueId)])),t.subject.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+t.subject.uniqueId)])),t.extensions.length>0&&s.value.push(o.certificateExtensionsToAsn1(t.extensions)),s},o.getCertificationRequestInfo=function(t){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),m(t.subject),o.publicKeyToAsn1(t.publicKey),_(t)])},o.distinguishedNameToAsn1=function(t){return m(t)},o.certificateToAsn1=function(t){var e=t.tbsCertificate||o.getTBSCertificate(t);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[e,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.signatureOid).getBytes()),w(t.signatureOid,t.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+t.signature)])},o.certificateExtensionsToAsn1=function(t){var e=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n<t.length;++n)r.value.push(o.certificateExtensionToAsn1(t[n]));return e},o.certificateExtensionToAsn1=function(t){var e=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);e.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.id).getBytes())),t.critical&&e.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=t.value;return"string"!==typeof t.value&&(r=i.toDer(r).getBytes()),e.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),e},o.certificationRequestToAsn1=function(t){var e=t.certificationRequestInfo||o.getCertificationRequestInfo(t);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[e,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.signatureOid).getBytes()),w(t.signatureOid,t.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+t.signature)])},o.createCaStore=function(t){var e={certs:{}};function r(t){return s(t),e.certs[t.hash]||null}function s(t){if(!t.hash){var e=n.md.sha1.create();t.attributes=o.RDNAttributesAsArray(m(t),e),t.hash=e.digest().toHex()}}if(e.getIssuer=function(t){return r(t.issuer)},e.addCertificate=function(t){if("string"===typeof t&&(t=n.pki.certificateFromPem(t)),s(t.subject),!e.hasCertificate(t))if(t.subject.hash in e.certs){var r=e.certs[t.subject.hash];n.util.isArray(r)||(r=[r]),r.push(t),e.certs[t.subject.hash]=r}else e.certs[t.subject.hash]=t},e.hasCertificate=function(t){"string"===typeof t&&(t=n.pki.certificateFromPem(t));var e=r(t.subject);if(!e)return!1;n.util.isArray(e)||(e=[e]);for(var s=i.toDer(o.certificateToAsn1(t)).getBytes(),a=0;a<e.length;++a){if(s===i.toDer(o.certificateToAsn1(e[a])).getBytes())return!0}return!1},e.listAllCertificates=function(){var t=[];for(var r in e.certs)if(e.certs.hasOwnProperty(r)){var i=e.certs[r];if(n.util.isArray(i))for(var o=0;o<i.length;++o)t.push(i[o]);else t.push(i)}return t},e.removeCertificate=function(t){var a;if("string"===typeof t&&(t=n.pki.certificateFromPem(t)),s(t.subject),!e.hasCertificate(t))return null;var u=r(t.subject);if(!n.util.isArray(u))return a=e.certs[t.subject.hash],delete e.certs[t.subject.hash],a;for(var c=i.toDer(o.certificateToAsn1(t)).getBytes(),l=0;l<u.length;++l){c===i.toDer(o.certificateToAsn1(u[l])).getBytes()&&(a=u[l],u.splice(l,1))}return 0===u.length&&delete e.certs[t.subject.hash],a},t)for(var a=0;a<t.length;++a){var u=t[a];e.addCertificate(u)}return e},o.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},o.verifyCertificateChain=function(t,e,r){"function"===typeof r&&(r={verify:r}),r=r||{};var i=(e=e.slice(0)).slice(0),s=r.validityCheckDate;"undefined"===typeof s&&(s=new Date);var a=!0,u=null,c=0;do{var l=e.shift(),h=null,f=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===u){if(null===(h=e[0]||t.getIssuer(l))&&l.isIssuer(l)&&(f=!0,h=l),h){var d=h;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){h=d.shift();try{p=h.verify(l)}catch(E){}}p||(u={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==u||h&&!f||t.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===u&&h&&!l.isIssuer(h)&&(u={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===u&&g<l.extensions.length;++g){var m=l.extensions[g];m.critical&&!(m.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:o.certificateError.unsupported_certificate})}if(null===u&&(!a||0===e.length&&(!h||f))){var b=l.getExtension("basicConstraints"),v=l.getExtension("keyUsage");if(null!==v&&(v.keyCertSign&&null!==b||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:o.certificateError.bad_certificate})),null!==u||null===b||b.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:o.certificateError.bad_certificate}),null===u&&null!==v&&"pathLenConstraint"in b)c-1>b.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var w=null===u||u.error,_=r.verify?r.verify(w,c,i):w;if(!0!==_)throw!0===w&&(u={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(_||0===_)&&("object"!==typeof _||n.util.isArray(_)?"string"===typeof _&&(u.error=_):(_.message&&(u.message=_.message),_.error&&(u.error=_.error))),u;u=null,a=!1,++c}while(e.length>0);return!0}},61995:(t,e,r)=>{"use strict";const{EventEmitter:n}=r(47465),{Multiaddr:i}=r(98719),o=r(90190);t.exports=class extends n{constructor(t){let{listen:e=[],announce:r=[]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.peerId=t,this.listen=new Set(e.map((t=>t.toString()))),this.announce=new Set(r.map((t=>t.toString()))),this.observed=new Set}getListenAddrs(){return Array.from(this.listen).map((t=>new i(t)))}getAnnounceAddrs(){return Array.from(this.announce).map((t=>new i(t)))}getObservedAddrs(){return Array.from(this.observed).map((t=>new i(t)))}addObservedAddr(t){let e=new i(t);const r=e.getPeerId();if(r){o.createFromB58String(r).equals(this.peerId)&&(e=e.decapsulate(new i("/p2p/".concat(this.peerId))))}const n=e.toString();this.observed.has(n)||(this.observed.add(n),this.emit("change:addresses"))}}},26604:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:auto-relay"),{error:n("libp2p:auto-relay:err")}),{fromString:o}=r(46765),{toString:s}=r(82051),{Multiaddr:a}=r(98719),u=r(50464),{relay:c}=r(16074),{canHop:l}=r(4364),{namespaceToCid:h}=r(7958),{CIRCUIT_PROTO_CODE:f,HOP_METADATA_KEY:d,HOP_METADATA_VALUE:p,RELAY_RENDEZVOUS_NS:y}=r(3369);t.exports=class{constructor(t){let{libp2p:e,maxListeners:r=1,onError:n}=t;this._libp2p=e,this._peerId=e.peerId,this._peerStore=e.peerStore,this._connectionManager=e.connectionManager,this._transportManager=e.transportManager,this._addressSorter=e.dialer.addressSorter,this.maxListeners=r,this._listenRelays=new Set,this._onProtocolChange=this._onProtocolChange.bind(this),this._onPeerDisconnected=this._onPeerDisconnected.bind(this),this._peerStore.on("change:protocols",this._onProtocolChange),this._connectionManager.on("peer:disconnect",this._onPeerDisconnected),this._onError=(t,e)=>{i.error(e||t),n&&n(t,e)}}async _onProtocolChange(t){let{peerId:e,protocols:r}=t;const n=e.toB58String(),s=r.find((t=>t===c));if(s||!this._listenRelays.has(n)){if(s&&!this._listenRelays.has(n))try{const t=this._connectionManager.get(e);if(!t)return;if(t.remoteAddr.protoCodes().includes(f))return void i("relayed connection to ".concat(n," will not be used to hop on"));await l({connection:t})&&(await this._peerStore.metadataBook.setValue(e,d,o(p)),await this._addListenRelay(t,n))}catch(a){this._onError(a)}}else await this._removeListenRelay(n)}_onPeerDisconnected(t){const e=t.remotePeer.toB58String();this._listenRelays.has(e)&&this._removeListenRelay(e).catch((t=>{i.error(t)}))}async _addListenRelay(t,e){try{if(this._listenRelays.size>=this.maxListeners)return;const r=await this._peerStore.addressBook.getMultiaddrsForPeer(t.remotePeer,this._addressSorter);(await Promise.all(r.map((async t=>{try{return await this._transportManager.listen([new a("".concat(t.toString(),"/p2p-circuit"))]),!0}catch(e){this._onError(e)}return!1})))).includes(!0)&&this._listenRelays.add(e)}catch(r){this._onError(r),this._listenRelays.delete(e)}}async _removeListenRelay(t){this._listenRelays.delete(t)&&await this._listenOnAvailableHopRelays([t])}async _listenOnAvailableHopRelays(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this._listenRelays.size>=this.maxListeners)return;const e=[],r=await u(this._peerStore.getPeers());for await(const{id:i,metadata:o}of r){const r=i.toB58String();if(this._listenRelays.has(r))continue;if(t.includes(r))continue;const n=o.get(d);if(!n||s(n)!==p)continue;const a=this._connectionManager.get(i);if(a){if(await this._addListenRelay(a,r),this._listenRelays.size>=this.maxListeners)return}else e.push(i)}for(const i of e)if(await this._tryToListenOnRelay(i),this._listenRelays.size>=this.maxListeners)return;try{const t=await h(y);for await(const e of this._libp2p.contentRouting.findProviders(t)){if(!e.multiaddrs.length)continue;const t=e.id;if(await this._peerStore.addressBook.add(t,e.multiaddrs),await this._tryToListenOnRelay(t),this._listenRelays.size>=this.maxListeners)return}}catch(n){this._onError(n)}}async _tryToListenOnRelay(t){try{const e=await this._libp2p.dial(t);await this._addListenRelay(e,t.toB58String())}catch(e){this._onError(e,"could not connect and listen on known hop relay ".concat(t.toB58String()))}}}},4364:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:circuit:hop"),{error:n("libp2p:circuit:hop:err")}),o=r(67963),s=r(90190),{validateAddrs:a}=r(55341),u=r(67903),{CircuitRelay:c}=r(91267),{pipe:l}=r(79023),{codes:h}=r(59087),{stop:f}=r(90807),d=r(16074);t.exports={handleHop:async function(t){let{connection:e,request:r,streamHandler:n,circuit:o}=t;if(!o._options.hop.enabled)return i("HOP request received but we are not acting as a relay"),n.end({type:c.Type.STATUS,code:c.Status.HOP_CANT_SPEAK_RELAY});try{a(r,n)}catch(g){return i.error("invalid hop request via peer %s",e.remotePeer.toB58String(),g)}if(!r.dstPeer)return void i("HOP request received but we do not receive a dstPeer");const u=new s(r.dstPeer.id),h=o._connectionManager.get(u);if(!h&&!o._options.hop.active)return i("HOP request received but we are not connected to the destination peer"),n.end({type:c.Type.STATUS,code:c.Status.HOP_NO_CONN_TO_DST});if(!h)return;const d={type:c.Type.STOP,dstPeer:r.dstPeer,srcPeer:r.srcPeer};let p;try{p=await f({connection:h,request:d})}catch(g){return i.error(g)}i("hop request from %s is valid",e.remotePeer.toB58String()),n.write({type:c.Type.STATUS,code:c.Status.SUCCESS});const y=n.rest();return l(y,p,y)},hop:async function(t){let{connection:e,request:r}=t;const{stream:n}=await e.newStream([d.relay]),s=new u({stream:n});s.write(r);const a=await s.read();if(!a)throw o(new Error("HOP request had no response"),h.ERR_HOP_REQUEST_FAILED);if(a.code===c.Status.SUCCESS)return i("hop request was successful"),s.rest();throw i("hop request failed with code %d, closing stream",a.code),s.close(),o(new Error("HOP request failed with code ".concat(a.code)),h.ERR_HOP_REQUEST_FAILED)},canHop:async function(t){let{connection:e}=t;const{stream:r}=await e.newStream([d.relay]),n=new u({stream:r});n.write({type:c.Type.CAN_HOP});const i=await n.read();return await n.close(),!(!i||i.code!==c.Status.SUCCESS)},handleCanHop:function(t){let{connection:e,streamHandler:r,circuit:n}=t;const o=n._options.hop.enabled;i("can hop (%s) request from %s",o,e.remotePeer.toB58String()),r.end({type:c.Type.STATUS,code:o?c.Status.SUCCESS:c.Status.HOP_CANT_SPEAK_RELAY})}}},90807:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:circuit:stop"),{error:n("libp2p:circuit:stop:err")}),{CircuitRelay:o}=r(91267),s=r(16074),a=r(67903),{validateAddrs:u}=r(55341);t.exports.handleStop=function(t){let{connection:e,request:r,streamHandler:n}=t;try{u(r,n)}catch(s){return i.error("invalid stop request via peer %s",e.remotePeer.toB58String(),s)}return i("stop request is valid"),n.write({type:o.Type.STATUS,code:o.Status.SUCCESS}),n.rest()},t.exports.stop=async function(t){let{connection:e,request:r}=t;const{stream:n}=await e.newStream([s.relay]);i("starting stop request to %s",e.remotePeer.toB58String());const u=new a({stream:n});u.write(r);const c=await u.read();return c?c.code===o.Status.SUCCESS?(i("stop request to %s was successful",e.remotePeer.toB58String()),u.rest()):(i("stop request failed with code %d",c.code),void u.close()):u.close()}},67903:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:circuit:stream-handler"),{error:n("libp2p:circuit:stream-handler:err")}),o=r(44709),s=r(39610),{CircuitRelay:a}=r(91267);t.exports=class{constructor(t){let{stream:e,maxLength:r=4096}=t;this.stream=e,this.shake=s(this.stream),this.decoder=o.decode.fromReader(this.shake.reader,{maxDataLength:r})}async read(){const t=await this.decoder.next();if(t.value){const e=a.decode(t.value.slice());return i("read message type",e.type),e}i("read received no value, closing stream"),this.close()}write(t){i("write message type %s",t.type),this.shake.write(o.encode.single(a.encode(t).finish()))}rest(){return this.shake.rest(),this.shake.stream}end(t){this.write(t),this.close()}close(){i("closing the stream"),this.rest().sink([])}}},55341:(t,e,r)=>{"use strict";const{Multiaddr:n}=r(98719),{CircuitRelay:i}=r(91267);function o(t,e){t.write({type:i.Type.STATUS,code:e})}t.exports={validateAddrs:function(t,e){try{t.dstPeer&&t.dstPeer.addrs&&t.dstPeer.addrs.forEach((t=>new n(t)))}catch(r){throw o(e,t.type===i.Type.HOP?i.Status.HOP_DST_MULTIADDR_INVALID:i.Status.STOP_DST_MULTIADDR_INVALID),r}try{t.srcPeer&&t.srcPeer.addrs&&t.srcPeer.addrs.forEach((t=>new n(t)))}catch(r){throw o(e,t.type===i.Type.HOP?i.Status.HOP_SRC_MULTIADDR_INVALID:i.Status.STOP_SRC_MULTIADDR_INVALID),r}}}},3369:t=>{"use strict";t.exports={ADVERTISE_BOOT_DELAY:9e5,ADVERTISE_TTL:18e5,CIRCUIT_PROTO_CODE:290,HOP_METADATA_KEY:"hop_relay",HOP_METADATA_VALUE:"true",RELAY_RENDEZVOUS_NS:"/libp2p/relay"}},90432:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:relay"),{error:n("libp2p:relay:err")}),{codes:o}=r(59087),{setDelayedInterval:s,clearDelayedInterval:a}=r(18928),u=r(26604),{namespaceToCid:c}=r(7958),{RELAY_RENDEZVOUS_NS:l}=r(3369);t.exports=class{constructor(t){this._libp2p=t,this._options={...t._config.relay},this._autoRelay=this._options.autoRelay.enabled&&new u({libp2p:t,...this._options.autoRelay}),this._advertiseService=this._advertiseService.bind(this)}start(){this._options.hop.enabled&&this._options.advertise.enabled&&(this._timeout=s(this._advertiseService,this._options.advertise.ttl,this._options.advertise.bootDelay))}stop(){a(this._timeout)}async _advertiseService(){try{const t=await c(l);await this._libp2p.contentRouting.provide(t)}catch(t){t.code===o.ERR_NO_ROUTERS_AVAILABLE?(i.error("a content router, such as a DHT, must be provided in order to advertise the relay service",t),this.stop()):i.error(t)}}}},95031:(t,e,r)=>{"use strict";const{EventEmitter:n}=r(47465),{Multiaddr:i}=r(98719);t.exports=t=>{const e=new Map;const r=Object.assign(new n,{close:()=>Promise.resolve(),listen:async function(n){const o=String(n).split("/p2p-circuit").find((t=>""!==t)),s=await t.dial(new i(o)),a=s.remoteAddr.encapsulate("/p2p-circuit");e.set(s.remotePeer.toB58String(),a),r.emit("listening")},getAddrs:function(){const t=[];for(const r of e.values())t.push(r);return t}});return t.connectionManager.on("peer:disconnect",(t=>{e.delete(t.remotePeer.toB58String())&&r.emit("close")})),r}},16074:t=>{"use strict";t.exports={relay:"/libp2p/circuit/relay/0.1.0"}},91267:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-circuit"]||(n.roots["libp2p-circuit"]={});a.CircuitRelay=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.type=1,t.prototype.srcPeer=null,t.prototype.dstPeer=null,t.prototype.code=100,t.encode=function(t,e){return e||(e=o.create()),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&e.uint32(8).int32(t.type),null!=t.srcPeer&&Object.hasOwnProperty.call(t,"srcPeer")&&a.CircuitRelay.Peer.encode(t.srcPeer,e.uint32(18).fork()).ldelim(),null!=t.dstPeer&&Object.hasOwnProperty.call(t,"dstPeer")&&a.CircuitRelay.Peer.encode(t.dstPeer,e.uint32(26).fork()).ldelim(),null!=t.code&&Object.hasOwnProperty.call(t,"code")&&e.uint32(32).int32(t.code),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.CircuitRelay;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.type=t.int32();break;case 2:n.srcPeer=a.CircuitRelay.Peer.decode(t,t.uint32());break;case 3:n.dstPeer=a.CircuitRelay.Peer.decode(t,t.uint32());break;case 4:n.code=t.int32();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.CircuitRelay)return t;var e=new a.CircuitRelay;switch(t.type){case"HOP":case 1:e.type=1;break;case"STOP":case 2:e.type=2;break;case"STATUS":case 3:e.type=3;break;case"CAN_HOP":case 4:e.type=4}if(null!=t.srcPeer){if("object"!==typeof t.srcPeer)throw TypeError(".CircuitRelay.srcPeer: object expected");e.srcPeer=a.CircuitRelay.Peer.fromObject(t.srcPeer)}if(null!=t.dstPeer){if("object"!==typeof t.dstPeer)throw TypeError(".CircuitRelay.dstPeer: object expected");e.dstPeer=a.CircuitRelay.Peer.fromObject(t.dstPeer)}switch(t.code){case"SUCCESS":case 100:e.code=100;break;case"HOP_SRC_ADDR_TOO_LONG":case 220:e.code=220;break;case"HOP_DST_ADDR_TOO_LONG":case 221:e.code=221;break;case"HOP_SRC_MULTIADDR_INVALID":case 250:e.code=250;break;case"HOP_DST_MULTIADDR_INVALID":case 251:e.code=251;break;case"HOP_NO_CONN_TO_DST":case 260:e.code=260;break;case"HOP_CANT_DIAL_DST":case 261:e.code=261;break;case"HOP_CANT_OPEN_DST_STREAM":case 262:e.code=262;break;case"HOP_CANT_SPEAK_RELAY":case 270:e.code=270;break;case"HOP_CANT_RELAY_TO_SELF":case 280:e.code=280;break;case"STOP_SRC_ADDR_TOO_LONG":case 320:e.code=320;break;case"STOP_DST_ADDR_TOO_LONG":case 321:e.code=321;break;case"STOP_SRC_MULTIADDR_INVALID":case 350:e.code=350;break;case"STOP_DST_MULTIADDR_INVALID":case 351:e.code=351;break;case"STOP_RELAY_REFUSED":case 390:e.code=390;break;case"MALFORMED_MESSAGE":case 400:e.code=400}return e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=e.enums===String?"HOP":1,r.srcPeer=null,r.dstPeer=null,r.code=e.enums===String?"SUCCESS":100),null!=t.type&&t.hasOwnProperty("type")&&(r.type=e.enums===String?a.CircuitRelay.Type[t.type]:t.type),null!=t.srcPeer&&t.hasOwnProperty("srcPeer")&&(r.srcPeer=a.CircuitRelay.Peer.toObject(t.srcPeer,e)),null!=t.dstPeer&&t.hasOwnProperty("dstPeer")&&(r.dstPeer=a.CircuitRelay.Peer.toObject(t.dstPeer,e)),null!=t.code&&t.hasOwnProperty("code")&&(r.code=e.enums===String?a.CircuitRelay.Status[t.code]:t.code),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t.Status=function(){var t={},e=Object.create(t);return e[t[100]="SUCCESS"]=100,e[t[220]="HOP_SRC_ADDR_TOO_LONG"]=220,e[t[221]="HOP_DST_ADDR_TOO_LONG"]=221,e[t[250]="HOP_SRC_MULTIADDR_INVALID"]=250,e[t[251]="HOP_DST_MULTIADDR_INVALID"]=251,e[t[260]="HOP_NO_CONN_TO_DST"]=260,e[t[261]="HOP_CANT_DIAL_DST"]=261,e[t[262]="HOP_CANT_OPEN_DST_STREAM"]=262,e[t[270]="HOP_CANT_SPEAK_RELAY"]=270,e[t[280]="HOP_CANT_RELAY_TO_SELF"]=280,e[t[320]="STOP_SRC_ADDR_TOO_LONG"]=320,e[t[321]="STOP_DST_ADDR_TOO_LONG"]=321,e[t[350]="STOP_SRC_MULTIADDR_INVALID"]=350,e[t[351]="STOP_DST_MULTIADDR_INVALID"]=351,e[t[390]="STOP_RELAY_REFUSED"]=390,e[t[400]="MALFORMED_MESSAGE"]=400,e}(),t.Type=function(){var t={},e=Object.create(t);return e[t[1]="HOP"]=1,e[t[2]="STOP"]=2,e[t[3]="STATUS"]=3,e[t[4]="CAN_HOP"]=4,e}(),t.Peer=function(){function t(t){if(this.addrs=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.id=s.newBuffer([]),t.prototype.addrs=s.emptyArray,t.encode=function(t,e){if(e||(e=o.create()),e.uint32(10).bytes(t.id),null!=t.addrs&&t.addrs.length)for(var r=0;r<t.addrs.length;++r)e.uint32(18).bytes(t.addrs[r]);return e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.CircuitRelay.Peer;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.id=t.bytes();break;case 2:n.addrs&&n.addrs.length||(n.addrs=[]),n.addrs.push(t.bytes());break;default:t.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},t.fromObject=function(t){if(t instanceof a.CircuitRelay.Peer)return t;var e=new a.CircuitRelay.Peer;if(null!=t.id&&("string"===typeof t.id?s.base64.decode(t.id,e.id=s.newBuffer(s.base64.length(t.id)),0):t.id.length&&(e.id=t.id)),t.addrs){if(!Array.isArray(t.addrs))throw TypeError(".CircuitRelay.Peer.addrs: array expected");e.addrs=[];for(var r=0;r<t.addrs.length;++r)"string"===typeof t.addrs[r]?s.base64.decode(t.addrs[r],e.addrs[r]=s.newBuffer(s.base64.length(t.addrs[r])),0):t.addrs[r].length&&(e.addrs[r]=t.addrs[r])}return e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.addrs=[]),e.defaults&&(e.bytes===String?r.id="":(r.id=[],e.bytes!==Array&&(r.id=s.newBuffer(r.id)))),null!=t.id&&t.hasOwnProperty("id")&&(r.id=e.bytes===String?s.base64.encode(t.id,0,t.id.length):e.bytes===Array?Array.prototype.slice.call(t.id):t.id),t.addrs&&t.addrs.length){r.addrs=[];for(var n=0;n<t.addrs.length;++n)r.addrs[n]=e.bytes===String?s.base64.encode(t.addrs[n],0,t.addrs[n].length):e.bytes===Array?Array.prototype.slice.call(t.addrs[n]):t.addrs[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t}(),t.exports=a},46162:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:circuit"),{error:n("libp2p:circuit:err")}),o=r(67963),s=r(18322),{Multiaddr:a}=r(98719),u=r(90190),{CircuitRelay:c}=r(91267),{codes:l}=r(59087),h=r(68308),{relay:f}=r(16074),d=r(95031),{handleCanHop:p,handleHop:y,hop:g}=r(4364),{handleStop:m}=r(90807),b=r(67903),v=Symbol.for("@libp2p/js-libp2p-circuit/circuit");class w{constructor(t){let{libp2p:e,upgrader:r}=t;this._dialer=e.dialer,this._registrar=e.registrar,this._connectionManager=e.connectionManager,this._upgrader=r,this._options=e._config.relay,this._libp2p=e,this.peerId=e.peerId,this._registrar.handle(f,this._onProtocol.bind(this))}async _onProtocol(t){let{connection:e,stream:r}=t;const n=new b({stream:r}),o=await n.read();if(!o)return;const s=this;let u;switch(o.type){case c.Type.CAN_HOP:i("received CAN_HOP request from %s",e.remotePeer.toB58String()),await p({circuit:s,connection:e,streamHandler:n});break;case c.Type.HOP:i("received HOP request from %s",e.remotePeer.toB58String()),u=await y({connection:e,request:o,streamHandler:n,circuit:s});break;case c.Type.STOP:i("received STOP request from %s",e.remotePeer.toB58String()),u=await m({connection:e,request:o,streamHandler:n});break;default:i("Request of type %s not supported",o.type)}if(u){const t=new a(o.dstPeer.addrs[0]),e=new a(o.srcPeer.addrs[0]),r=h({stream:u,remoteAddr:t,localAddr:e}),n=o.type===c.Type.HOP?"relay":"inbound";i("new %s connection %s",n,r.remoteAddr);const s=await this._upgrader.upgradeInbound(r);i("%s connection %s upgraded",n,r.remoteAddr),this.handler&&this.handler(s)}}async dial(t,e){const r=t.toString().split("/p2p-circuit"),n=new a(r[0]),s=new a(r[r.length-1]),f=n.getPeerId(),d=s.getPeerId();if(!f||!d){const t="Circuit relay dial failed as addresses did not have peer id";throw i.error(t),o(new Error(t),l.ERR_RELAYED_DIAL)}const p=u.createFromB58String(f),y=u.createFromB58String(d);let m=!1,b=this._connectionManager.get(p);b||(b=await this._dialer.connectToPeer(n,e),m=!0);try{const e=await g({connection:b,request:{type:c.Type.HOP,srcPeer:{id:this.peerId.toBytes(),addrs:this._libp2p.multiaddrs.map((t=>t.bytes))},dstPeer:{id:y.toBytes(),addrs:[new a(s).bytes]}}}),r=n.encapsulate("/p2p-circuit/p2p/".concat(this.peerId.toB58String())),o=h({stream:e,remoteAddr:t,localAddr:r});return i("new outbound connection %s",o.remoteAddr),this._upgrader.upgradeOutbound(o)}catch(v){throw i.error("Circuit relay dial failed",v),m&&await b.close(),v}}createListener(t,e){return"function"===typeof t&&(e=t,t={}),this.handler=e,d(this._libp2p)}filter(t){return(t=Array.isArray(t)?t:[t]).filter((t=>s.Circuit.matches(t)))}get[Symbol.toStringTag](){return"Circuit"}static isTransport(t){return Boolean(t&&t[v])}}t.exports=w},7958:(t,e,r)=>{"use strict";const{CID:n}=r(16629),{sha256:i}=r(19400);t.exports.namespaceToCid=async t=>{const e=(new TextEncoder).encode(t),r=await i.digest(e);return n.createV0(r)}},7037:(t,e,r)=>{"use strict";const n=r(89842),{dnsaddrResolver:i}=r(44689),o=r(70127),{AGENT_VERSION:s}=r(43367),a=r(3369),{publicAddressesFirst:u}=r(27780),{FaultTolerance:c}=r(48350),l={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:t=>t},connectionManager:{minConnections:25},connectionGater:{},transportManager:{faultTolerance:c.FATAL_ALL},dialer:{maxParallelDials:o.MAX_PARALLEL_DIALS,maxDialsPerPeer:o.MAX_PER_PEER_DIALS,dialTimeout:o.DIAL_TIMEOUT,resolvers:{dnsaddr:i},addressSorter:u},host:{agentVersion:s},metrics:{enabled:!1},peerStore:{persistence:!1,threshold:5},peerRouting:{refreshManager:{enabled:!0,interval:6e5,bootDelay:1e4}},config:{protocolPrefix:"ipfs",dht:{enabled:!1,kBucketSize:20},nat:{enabled:!0,ttl:7200,keepAlive:!0,gateway:null,externalIp:null,pmp:{enabled:!1}},peerDiscovery:{autoDial:!0},pubsub:{enabled:!0},relay:{enabled:!0,advertise:{bootDelay:a.ADVERTISE_BOOT_DELAY,enabled:!1,ttl:a.ADVERTISE_TTL},hop:{enabled:!1,active:!1},autoRelay:{enabled:!1,maxListeners:2}},transport:{}}};t.exports.validate=t=>{const e=n(l,t);if(e.modules.transport.length<1)throw new Error("'options.modules.transport' must contain at least 1 transport");return e}},75570:(t,e,r)=>{"use strict";const n=r(18392),i=r(89842),o=r(31779),s=r(50464),{pipe:a}=r(79023),u=r(12393),c=r(22035),l=Object.assign(n("libp2p:connection-manager:auto-dialler"),{error:n("libp2p:connection-manager:auto-dialler:err")}),h={enabled:!0,minConnections:0,autoDialInterval:1e4};t.exports=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._options=i.call({ignoreUndefined:!0},h,e),this._libp2p=t,this._running=!1,this._autoDialTimeout=null,this._autoDial=this._autoDial.bind(this),l("options: %j",this._options)}async start(){this._options.enabled?(this._running=!0,this._autoDial().catch((t=>{l.error("could start autodial",t)})),l("started")):l("not enabled")}async stop(){this._options.enabled?(this._running=!1,this._autoDialTimeout&&this._autoDialTimeout.clear(),l("stopped")):l("not enabled")}async _autoDial(){const t=this._options.minConnections;if(this._libp2p.connections.size>=t)return void(this._autoDialTimeout=o(this._autoDial,this._options.autoDialInterval));const e=await a(this._libp2p.peerStore.getPeers(),(t=>u(t,(t=>!t.id.equals(this._libp2p.peerId)))),(t=>c(t,((t,e)=>!e.protocols||!e.protocols.length||t.protocols&&t.protocols.length?e.id.pubKey&&!t.id.pubKey?1:-1:1))),(t=>s(t)));for(let n=0;this._running&&n<e.length&&this._libp2p.connections.size<t;n++){const t=e[n];if(!this._libp2p.connectionManager.get(t.id)){l("connecting to a peerStore stored peer %s",t.id.toB58String());try{await this._libp2p.dialer.connectToPeer(t.id)}catch(r){l.error("could not connect to peerStore stored peer",r)}}}this._running&&(this._autoDialTimeout=o(this._autoDial,this._options.autoDialInterval))}}},71997:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:connection-manager"),{error:n("libp2p:connection-manager:err")}),o=r(67963),s=r(89842),a=r(382),u=r(31779),{EventEmitter:c}=r(47465),l=r(3342),h=r(90190),{codes:{ERR_INVALID_PARAMETERS:f}}=r(59087),d={maxConnections:1/0,minConnections:0,maxData:1/0,maxSentData:1/0,maxReceivedData:1/0,maxEventLoopDelay:1/0,pollInterval:2e3,autoDialInterval:1e4,movingAverageInterval:6e4,defaultPeerValue:1},p="connection-manager";t.exports=class extends c{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this._libp2p=t,this._peerId=t.peerId.toB58String(),this._options=s.call({ignoreUndefined:!0},d,e),this._options.maxConnections<this._options.minConnections)throw o(new Error("Connection Manager maxConnections must be greater than minConnections"),f);i("options: %j",this._options),this._peerValues=l({component:p,metric:"peer-values",metrics:this._libp2p.metrics}),this.connections=l({component:p,metric:"peer-connections",metrics:this._libp2p.metrics}),this._started=!1,this._timer=null,this._checkMetrics=this._checkMetrics.bind(this),this._latencyMonitor=new a({latencyCheckIntervalMs:this._options.pollInterval,dataEmitIntervalMs:this._options.pollInterval}),this.setMaxListeners(1/0)}get size(){return Array.from(this.connections.values()).reduce(((t,e)=>t+e.length),0)}start(){this._libp2p.metrics&&(this._timer=this._timer||u(this._checkMetrics,this._options.pollInterval)),this._latencyMonitor.start(),this._onLatencyMeasure=this._onLatencyMeasure.bind(this),this._latencyMonitor.on("data",this._onLatencyMeasure),this._started=!0,i("started")}async stop(){this._timer&&this._timer.clear(),this._latencyMonitor.removeListener("data",this._onLatencyMeasure),this._latencyMonitor.stop(),this._started=!1,await this._close(),i("stopped")}async _close(){const t=[];for(const e of this.connections.values())for(const r of e)t.push(r.close());await Promise.all(t),this.connections.clear()}setPeerValue(t,e){if(e<0||e>1)throw new Error("value should be a number between 0 and 1");this._peerValues.set(t.toB58String(),e)}async _checkMetrics(){if(this._libp2p.metrics)try{const t=this._libp2p.metrics.global.movingAverages,e=t.dataReceived[this._options.movingAverageInterval].movingAverage();await this._checkMaxLimit("maxReceivedData",e);const r=t.dataSent[this._options.movingAverageInterval].movingAverage();await this._checkMaxLimit("maxSentData",r);const n=e+r;await this._checkMaxLimit("maxData",n),i("metrics update",n)}finally{this._timer=u(this._checkMetrics,this._options.pollInterval)}}async onConnect(t){if(!this._started)return void await t.close();const e=t.remotePeer,r=e.toB58String(),n=this.connections.get(r);this.emit("peer:connect",t),n?n.push(t):this.connections.set(r,[t]),await this._libp2p.peerStore.keyBook.set(e,e.pubKey),this._peerValues.has(r)||this._peerValues.set(r,this._options.defaultPeerValue),await this._checkMaxLimit("maxConnections",this.size)}onDisconnect(t){if(!this._started)return;const e=t.remotePeer.toB58String();let r=this.connections.get(e);r&&r.length>1?(r=r.filter((e=>e.id!==t.id)),this.connections.set(e,r)):r&&(this.connections.delete(e),this._peerValues.delete(t.remotePeer.toB58String()),this.emit("peer:disconnect",t),this._libp2p.metrics&&this._libp2p.metrics.onPeerDisconnected(t.remotePeer))}get(t){const e=this.getAll(t);return e.length?e[0]:null}getAll(t){if(!h.isPeerId(t))throw o(new Error("peerId must be an instance of peer-id"),f);const e=t.toB58String(),r=this.connections.get(e);return r?r.filter((t=>"open"===t.stat.status)):[]}_onLatencyMeasure(t){this._checkMaxLimit("maxEventLoopDelay",t.avgMs).catch((t=>{i.error(t)}))}async _checkMaxLimit(t,e){const r=this._options[t];i("checking limit of %s. current value: %d of %d",t,e,r),e>r&&(i("%s: limit exceeded: %s, %d",this._peerId,t,e),await this._maybeDisconnectOne())}async _maybeDisconnectOne(){if(this._options.minConnections<this.connections.size){const t=Array.from(new Map([...this._peerValues.entries()].sort(((t,e)=>t[1]-e[1]))));i("%s: sorted peer values: %j",this._peerId,t);const e=t[0];if(e){const t=e[0];i("%s: lowest value peer is %s",this._peerId,t),i("%s: closing a connection to %j",this._peerId,t);for(const e of this.connections.values())if(e[0].remotePeer.toB58String()===t){e[0].close().catch((t=>{i.error(t)})),this.onDisconnect(e[0]);break}}}}}},382:(t,e,r)=>{"use strict";const{EventEmitter:n}=r(47465),i=r(19021),o=r(18392)("latency-monitor:LatencyMonitor");t.exports=class extends n{constructor(){let{latencyCheckIntervalMs:t,dataEmitIntervalMs:e,asyncTestFn:r,latencyRandomPercentage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();const i=this;i.latencyCheckIntervalMs=t||500,i.latencyRandomPercentage=n||10,i._latecyCheckMultiply=i.latencyRandomPercentage/100*2*i.latencyCheckIntervalMs,i._latecyCheckSubtract=i._latecyCheckMultiply/2,i.dataEmitIntervalMs=null===e||0===e?void 0:e||5e3,o("latencyCheckIntervalMs: %s dataEmitIntervalMs: %s",i.latencyCheckIntervalMs,i.dataEmitIntervalMs),i.dataEmitIntervalMs?o("Expecting ~%s events per summary",i.latencyCheckIntervalMs/i.dataEmitIntervalMs):o("Not emitting summaries"),i.asyncTestFn=r}start(){globalThis.process&&globalThis.process.hrtime?(o("Using process.hrtime for timing"),this.now=globalThis.process.hrtime,this.getDeltaMS=t=>{const e=this.now(t);return 1e3*e[0]+e[1]/1e6}):"undefined"!==typeof window&&window.performance&&window.performance.now?(o("Using performance.now for timing"),this.now=window.performance.now.bind(window.performance),this.getDeltaMS=t=>Math.round(this.now()-t)):(o("Using Date.now for timing"),this.now=Date.now,this.getDeltaMS=t=>this.now()-t),this._latencyData=this._initLatencyData(),"undefined"!==typeof window&&(this._visibilityChangeEmitter=new i,this._visibilityChangeEmitter.on("visibilityChange",(t=>{t?this._startTimers():(this._emitSummary(),this._stopTimers())}))),this._visibilityChangeEmitter&&!this._visibilityChangeEmitter.isVisible()||this._startTimers()}stop(){this._stopTimers()}_startTimers(){this._checkLatencyID||(this._checkLatency(),this.dataEmitIntervalMs&&(this._emitIntervalID=setInterval((()=>this._emitSummary()),this.dataEmitIntervalMs),"function"===typeof this._emitIntervalID.unref&&this._emitIntervalID.unref()))}_stopTimers(){this._checkLatencyID&&(clearTimeout(this._checkLatencyID),this._checkLatencyID=void 0),this._emitIntervalID&&(clearInterval(this._emitIntervalID),this._emitIntervalID=void 0)}_emitSummary(){const t=this.getSummary();t.events>0&&this.emit("data",t)}getSummary(){const t={events:this._latencyData.events,minMs:this._latencyData.minMs,maxMs:this._latencyData.maxMs,avgMs:this._latencyData.events?this._latencyData.totalMs/this._latencyData.events:Number.POSITIVE_INFINITY,lengthMs:this.getDeltaMS(this._latencyData.startTime)};return this._latencyData=this._initLatencyData(),o("Summary: %O",t),t}_checkLatency(){const t=this,e=Math.random()*t._latecyCheckMultiply-t._latecyCheckSubtract,r={deltaOffset:Math.ceil(t.latencyCheckIntervalMs+e),startTime:t.now()},n=()=>{if(!this._checkLatencyID)return;const e=t.getDeltaMS(r.startTime)-r.deltaOffset;t._checkLatency(),t._latencyData.events++,t._latencyData.minMs=Math.min(t._latencyData.minMs,e),t._latencyData.maxMs=Math.max(t._latencyData.maxMs,e),t._latencyData.totalMs+=e,o("MS: %s Data: %O",e,t._latencyData)};o("localData: %O",r),this._checkLatencyID=setTimeout((()=>{t.asyncTestFn?(r.deltaOffset=0,r.startTime=t.now(),t.asyncTestFn(n)):(r.deltaOffset-=1,n())}),r.deltaOffset),"function"===typeof this._checkLatencyID.unref&&this._checkLatencyID.unref()}_initLatencyData(){return{startTime:this.now(),minMs:Number.POSITIVE_INFINITY,maxMs:Number.NEGATIVE_INFINITY,events:0,totalMs:0}}}},19021:(t,e,r)=>{"use strict";const{EventEmitter:n}=r(47465),i=r(18392)("latency-monitor:VisibilityChangeEmitter");t.exports=class extends n{constructor(){super(),"undefined"!==typeof document?(this._initializeVisibilityVarNames(),this._addVisibilityChangeListener()):i('This is not a browser, no "document" found. Stopping.')}_initializeVisibilityVarNames(){let t,e;"undefined"!==typeof document.hidden?(t="hidden",e="visibilitychange"):"undefined"!==typeof document.mozHidden?(t="mozHidden",e="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(t="msHidden",e="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange"),this._hidden=t,this._visibilityChange=e}_addVisibilityChangeListener(){"undefined"===typeof document.addEventListener||"undefined"===typeof document[this._hidden]?i("Checking page visibility requires a browser that supports the Page Visibility API."):document.addEventListener(this._visibilityChange,this._handleVisibilityChange.bind(this),!1)}isVisible(){if(void 0!==this._hidden&&void 0!==document[this._hidden])return!document[this._hidden]}_handleVisibilityChange(){const t=!document[this._hidden];i(t?"Page Visible":"Page Hidden"),this.emit("visibilityChange",t)}}},70127:t=>{"use strict";t.exports={DIAL_TIMEOUT:3e4,MAX_PARALLEL_DIALS:100,MAX_PER_PEER_DIALS:4,MAX_ADDRS_TO_DIAL:25,METRICS:{computeThrottleMaxQueueSize:1e3,computeThrottleTimeout:2e3,movingAverageIntervals:[6e4,3e5,9e5],maxOldPeersRetention:50}}},78909:(t,e,r)=>{"use strict";const n=r(67963),{messages:i,codes:o}=r(59087),{storeAddresses:s,uniquePeers:a,requirePeers:u,maybeLimitSource:c}=r(31935),l=r(79272),h=r(96155),{pipe:f}=r(79023),{DHTContentRouting:d}=r(9336);t.exports=class{constructor(t){this.libp2p=t,this.routers=t._modules.contentRouting||[],this.dht=t._dht,this.dht&&t._config.dht.enabled&&this.routers.push(new d(this.dht))}async*findProviders(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.routers.length)throw n(new Error("No content this.routers available"),o.ERR_NO_ROUTERS_AVAILABLE);yield*f(h(...this.routers.map((r=>r.findProviders(t,e)))),(t=>s(t,this.libp2p.peerStore)),(t=>a(t)),(t=>c(t,e.maxNumProviders)),(t=>u(t)))}async provide(t){if(!this.routers.length)throw n(new Error("No content routers available"),o.ERR_NO_ROUTERS_AVAILABLE);await Promise.all(this.routers.map((e=>e.provide(t))))}async put(t,e,r){if(!this.libp2p.isStarted()||!this.dht.isStarted)throw n(new Error(i.NOT_STARTED_YET),o.DHT_NOT_STARTED);await l(this.dht.put(t,e,r))}async get(t,e){if(!this.libp2p.isStarted()||!this.dht.isStarted)throw n(new Error(i.NOT_STARTED_YET),o.DHT_NOT_STARTED);for await(const r of this.dht.get(t,e))if("VALUE"===r.name)return{from:r.peerId,val:r.value};throw n(new Error(i.NOT_FOUND),o.ERR_NOT_FOUND)}async*getMany(t,e,r){if(!this.libp2p.isStarted()||!this.dht.isStarted)throw n(new Error(i.NOT_STARTED_YET),o.DHT_NOT_STARTED);if(!e)return;let s=0;for await(const n of this.dht.get(t,r))if("VALUE"===n.name&&(yield{from:n.peerId,val:n.value},s++,s===e))break;if(0===s)throw n(new Error(i.NOT_FOUND),o.ERR_NOT_FOUND)}}},31935:(t,e,r)=>{"use strict";const n=r(67963),i=r(12393),o=r(27889),s=r(35959);t.exports={storeAddresses:async function*(t,e){yield*o(t,(async t=>(await e.addressBook.add(t.id,t.multiaddrs),t)))},uniquePeers:function(t){const e=new Set;return i(t,(t=>!e.has(t.id.toString())&&(e.add(t.id.toString()),!0)))},requirePeers:async function*(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0;for await(const n of t)r++,yield n;if(r<e)throw n(new Error("not found"),"NOT_FOUND")},maybeLimitSource:function(t,e){return e?s(t,e):t}}},9336:(t,e,r)=>{"use strict";const n=r(79272);t.exports={DHTContentRouting:class{constructor(t){this._dht=t}async provide(t){await n(this._dht.provide(t))}async*findProviders(t,e){for await(const r of this._dht.findProviders(t,e))"PROVIDER"===r.name&&(yield*r.providers)}}}},39862:(t,e,r)=>{"use strict";const n=r(67963),{messages:i,codes:o}=r(59087);t.exports={DHTPeerRouting:class{constructor(t){this._dht=t}async findPeer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const r of this._dht.findPeer(t,e))if("FINAL_PEER"===r.name)return r.peer;throw n(new Error(i.NOT_FOUND),o.ERR_NOT_FOUND)}async*getClosestPeers(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const r of this._dht.getClosestPeers(t,e))"PEER_RESPONSE"===r.name&&(yield*r.closer)}}}},12141:(t,e,r)=>{"use strict";const n=r(67963),{anySignal:i}=r(66622),o=r(49879),s=r(61552),{setMaxListeners:a}=r(47465),{codes:u}=r(59087);t.exports=class{constructor(t){let{addrs:e,dialAction:r,dialer:n}=t;this.addrs=e,this.dialer=n,this.dialAction=r}async run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.dialer.getTokens(this.addrs.length);if(e.length<1)throw n(new Error("No dial tokens available"),u.ERR_NO_DIAL_TOKENS);const r=new o;e.forEach((t=>r.push(t)));const c=this.addrs.map((()=>{const t=new AbortController;try{a&&a(1/0,t.signal)}catch{}return t}));let l=0;try{return await s(this.addrs.map((async(n,o)=>{const s=await r.shift();let a;try{const u=c[o].signal;a=await this.dialAction(n,{...t,signal:t.signal?i([u,t.signal]):u}),c.splice(o,1)}finally{l++,this.addrs.length-l>=e.length?r.push(s):this.dialer.releaseToken(e.splice(e.indexOf(s),1)[0])}return a})))}finally{c.map((t=>t.abort())),e.forEach((t=>this.dialer.releaseToken(t)))}}}},50453:(t,e,r)=>{"use strict";const n=r(18392),i=r(50464),o=r(12393),{pipe:s}=r(79023),a=Object.assign(n("libp2p:dialer"),{error:n("libp2p:dialer:err")}),u=r(67963),{Multiaddr:c}=r(98719),{TimeoutController:l}=r(87683),{AbortError:h}=r(64183),{anySignal:f}=r(66622),{setMaxListeners:d}=r(47465),p=r(12141),{publicAddressesFirst:y}=r(27780),g=r(85012),m=r(3342),{codes:b}=r(59087),{DIAL_TIMEOUT:v,MAX_PARALLEL_DIALS:w,MAX_PER_PEER_DIALS:_,MAX_ADDRS_TO_DIAL:E}=r(70127),S="dialler";t.exports=class{constructor(t){let{transportManager:e,peerStore:r,connectionGater:n,addressSorter:i=y,maxParallelDials:o=w,maxAddrsToDial:s=E,dialTimeout:a=v,maxDialsPerPeer:u=_,resolvers:l={},metrics:h}=t;this.connectionGater=n,this.transportManager=e,this.peerStore=r,this.addressSorter=i,this.maxParallelDials=o,this.maxAddrsToDial=s,this.timeout=a,this.maxDialsPerPeer=u,this.tokens=[...new Array(o)].map(((t,e)=>e)),this._pendingDials=m({component:S,metric:"pending-dials",metrics:h}),this._pendingDialTargets=m({component:S,metric:"pending-dial-targets",metrics:h});for(const[f,d]of Object.entries(l))c.resolvers.set(f,d)}destroy(){for(const e of this._pendingDials.values())try{e.controller.abort()}catch(t){a.error(t)}this._pendingDials.clear();for(const e of this._pendingDialTargets.values())e.reject(new h("Dialer was destroyed"));this._pendingDialTargets.clear()}async connectToPeer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{id:r}=g(t);if(await this.connectionGater.denyDialPeer(r))throw u(new Error("The dial request is blocked by gater.allowDialPeer"),b.ERR_PEER_DIAL_INTERCEPTED);const n=await this._createCancellableDialTarget(t);if(!n.addrs.length)throw u(new Error("The dial request has no valid addresses"),b.ERR_NO_VALID_ADDRESSES);const i=this._pendingDials.get(n.id)||this._createPendingDial(n,e);try{const t=await i.promise;return a("dial succeeded to %s",n.id),t}catch(o){throw i.controller.signal.aborted&&(o.code=b.ERR_TIMEOUT),a.error(o),o}finally{i.destroy()}}async _createCancellableDialTarget(t){const e="".concat(parseInt(String(1e9*Math.random()),10).toString()+Date.now()),r=new Promise(((t,r)=>{this._pendingDialTargets.set(e,{resolve:t,reject:r})}));try{return await Promise.race([this._createDialTarget(t),r])}finally{this._pendingDialTargets.delete(e)}}async _createDialTarget(t){const{id:e,multiaddrs:r}=g(t);r&&await this.peerStore.addressBook.add(e,r);let n=await s(await this.peerStore.addressBook.getMultiaddrsForPeer(e,this.addressSorter),(t=>o(t,(async t=>!await this.connectionGater.denyDialMultiaddr(e,t)))),(t=>i(t)));c.isMultiaddr(t)&&(n=n.filter((e=>!t.equals(e))),n.unshift(t));const a=[];for(const i of n){(await this._resolve(i)).forEach((t=>a.push(t)))}const l=a.filter((t=>this.transportManager.transportForMultiaddr(t)));if(l.length>this.maxAddrsToDial)throw await this.peerStore.delete(e),u(new Error("dial with more addresses than allowed"),b.ERR_TOO_MANY_ADDRESSES);return{id:e.toB58String(),addrs:l}}_createPendingDial(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new p({addrs:t.addrs,dialAction:(t,e)=>{if(e.signal.aborted)throw u(new Error("already aborted"),b.ERR_ALREADY_ABORTED);return this.transportManager.dial(t,e)},dialer:this}),n=new l(this.timeout),i=[n.signal];e.signal&&i.push(e.signal);const o=f(i);try{d&&d(1/0,o)}catch{}const s={dialRequest:r,controller:n,promise:r.run({...e,signal:o}),destroy:()=>{n.clear(),this._pendingDials.delete(t.id)}};return this._pendingDials.set(t.id,s),s}getTokens(t){const e=Math.min(t,this.maxDialsPerPeer,this.tokens.length),r=this.tokens.splice(0,e);return a("%d tokens request, returning %d, %d remaining",t,e,this.tokens.length),r}releaseToken(t){this.tokens.indexOf(t)>-1||(a("token %d released",t),this.tokens.push(t))}async _resolve(t){if(!t.protoNames().includes("dnsaddr"))return[t];const e=await this._resolveRecord(t);return(await Promise.all(e.map((t=>this._resolve(t))))).flat().reduce(((t,e)=>(t.find((t=>t.equals(e)))||t.push(e),t)),[])}async _resolveRecord(t){try{t=new c(t.toString());return await t.resolve()}catch(e){return a.error("multiaddr ".concat(t," could not be resolved")),[]}}}},59087:(t,e)=>{"use strict";e.messages={NOT_STARTED_YET:"The libp2p node is not started yet",DHT_DISABLED:"DHT is not available",CONN_ENCRYPTION_REQUIRED:"At least one connection encryption module is required",NOT_FOUND:"Not found"},e.codes={DHT_DISABLED:"ERR_DHT_DISABLED",PUBSUB_NOT_STARTED:"ERR_PUBSUB_NOT_STARTED",DHT_NOT_STARTED:"ERR_DHT_NOT_STARTED",CONN_ENCRYPTION_REQUIRED:"ERR_CONN_ENCRYPTION_REQUIRED",ERR_PEER_DIAL_INTERCEPTED:"ERR_PEER_DIAL_INTERCEPTED",ERR_CONNECTION_INTERCEPTED:"ERR_CONNECTION_INTERCEPTED",ERR_INVALID_PROTOCOLS_FOR_STREAM:"ERR_INVALID_PROTOCOLS_FOR_STREAM",ERR_CONNECTION_ENDED:"ERR_CONNECTION_ENDED",ERR_CONNECTION_FAILED:"ERR_CONNECTION_FAILED",ERR_NODE_NOT_STARTED:"ERR_NODE_NOT_STARTED",ERR_ALREADY_ABORTED:"ERR_ALREADY_ABORTED",ERR_TOO_MANY_ADDRESSES:"ERR_TOO_MANY_ADDRESSES",ERR_NO_VALID_ADDRESSES:"ERR_NO_VALID_ADDRESSES",ERR_RELAYED_DIAL:"ERR_RELAYED_DIAL",ERR_DIALED_SELF:"ERR_DIALED_SELF",ERR_DISCOVERED_SELF:"ERR_DISCOVERED_SELF",ERR_DUPLICATE_TRANSPORT:"ERR_DUPLICATE_TRANSPORT",ERR_ENCRYPTION_FAILED:"ERR_ENCRYPTION_FAILED",ERR_HOP_REQUEST_FAILED:"ERR_HOP_REQUEST_FAILED",ERR_INVALID_KEY:"ERR_INVALID_KEY",ERR_INVALID_MESSAGE:"ERR_INVALID_MESSAGE",ERR_INVALID_PARAMETERS:"ERR_INVALID_PARAMETERS",ERR_INVALID_PEER:"ERR_INVALID_PEER",ERR_MUXER_UNAVAILABLE:"ERR_MUXER_UNAVAILABLE",ERR_NOT_FOUND:"ERR_NOT_FOUND",ERR_TIMEOUT:"ERR_TIMEOUT",ERR_TRANSPORT_UNAVAILABLE:"ERR_TRANSPORT_UNAVAILABLE",ERR_TRANSPORT_DIAL_FAILED:"ERR_TRANSPORT_DIAL_FAILED",ERR_UNSUPPORTED_PROTOCOL:"ERR_UNSUPPORTED_PROTOCOL",ERR_INVALID_MULTIADDR:"ERR_INVALID_MULTIADDR",ERR_SIGNATURE_NOT_VALID:"ERR_SIGNATURE_NOT_VALID",ERR_FIND_SELF:"ERR_FIND_SELF",ERR_NO_ROUTERS_AVAILABLE:"ERR_NO_ROUTERS_AVAILABLE",ERR_CONNECTION_NOT_MULTIPLEXED:"ERR_CONNECTION_NOT_MULTIPLEXED",ERR_NO_DIAL_TOKENS:"ERR_NO_DIAL_TOKENS",ERR_KEYCHAIN_REQUIRED:"ERR_KEYCHAIN_REQUIRED",ERR_INVALID_CMS:"ERR_INVALID_CMS",ERR_MISSING_KEYS:"ERR_MISSING_KEYS",ERR_NO_KEY:"ERR_NO_KEY",ERR_INVALID_KEY_NAME:"ERR_INVALID_KEY_NAME",ERR_INVALID_KEY_TYPE:"ERR_INVALID_KEY_TYPE",ERR_KEY_ALREADY_EXISTS:"ERR_KEY_ALREADY_EXISTS",ERR_INVALID_KEY_SIZE:"ERR_INVALID_KEY_SIZE",ERR_KEY_NOT_FOUND:"ERR_KEY_NOT_FOUND",ERR_OLD_KEY_NAME_INVALID:"ERR_OLD_KEY_NAME_INVALID",ERR_NEW_KEY_NAME_INVALID:"ERR_NEW_KEY_NAME_INVALID",ERR_PASSWORD_REQUIRED:"ERR_PASSWORD_REQUIRED",ERR_PEM_REQUIRED:"ERR_PEM_REQUIRED",ERR_CANNOT_READ_KEY:"ERR_CANNOT_READ_KEY",ERR_MISSING_PRIVATE_KEY:"ERR_MISSING_PRIVATE_KEY",ERR_INVALID_OLD_PASS_TYPE:"ERR_INVALID_OLD_PASS_TYPE",ERR_INVALID_NEW_PASS_TYPE:"ERR_INVALID_NEW_PASS_TYPE",ERR_INVALID_PASS_LENGTH:"ERR_INVALID_PASS_LENGTH",ERR_NOT_IMPLEMENTED:"ERR_NOT_IMPLEMENTED",ERR_WRONG_PING_ACK:"ERR_WRONG_PING_ACK"}},11002:t=>{"use strict";t.exports={PROTOCOL:"/libp2p/fetch/0.0.1"}},85889:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:fetch"),{error:n("libp2p:fetch:err")}),o=r(67963),{codes:s}=r(59087),a=r(44709),{FetchRequest:u,FetchResponse:c}=r(83201),l=r(39610),{PROTOCOL:h}=r(11002);class f{constructor(t){this._lookupFunctions=new Map,this._libp2p=t,this.handleMessage=this.handleMessage.bind(this)}async fetch(t,e){i("dialing %s to %s",this._protocol,t.toB58String?t.toB58String():t);const r=await this._libp2p.dial(t),{stream:n}=await r.newStream(f.PROTOCOL),h=l(n),d=new u({identifier:e});h.write(a.encode.single(u.encode(d).finish()));const p=c.decode((await a.decode.fromReader(h.reader).next()).value.slice());switch(p.status){case c.StatusCode.OK:return p.data;case c.StatusCode.NOT_FOUND:return null;case c.StatusCode.ERROR:{const t=(new TextDecoder).decode(p.data);throw o(new Error("Error in fetch protocol response: "+t),s.ERR_INVALID_PARAMETERS)}default:throw o(new Error("Unknown response status"),s.ERR_INVALID_MESSAGE)}}async handleMessage(t){const{stream:e}=t,r=l(e),n=u.decode((await a.decode.fromReader(r.reader).next()).value.slice());let i;const o=this._getLookupFunction(n.identifier);if(o){const t=await o(n.identifier);i=new c(t?{status:c.StatusCode.OK,data:t}:{status:c.StatusCode.NOT_FOUND})}else{const t=(new TextEncoder).encode("No lookup function registered for key: "+n.identifier);i=new c({status:c.StatusCode.ERROR,data:t})}r.write(a.encode.single(c.encode(i).finish()))}_getLookupFunction(t){for(const e of this._lookupFunctions.keys())if(t.startsWith(e))return this._lookupFunctions.get(e);return null}registerLookupFunction(t,e){if(this._lookupFunctions.has(t))throw o(new Error("Fetch protocol handler for key prefix '"+t+"' already registered"),s.ERR_KEY_ALREADY_EXISTS);this._lookupFunctions.set(t,e)}unregisterLookupFunction(t,e){if(null!=e){if(this._lookupFunctions.get(t)!==e)return}this._lookupFunctions.delete(t)}}f.PROTOCOL=h,t.exports=f},83201:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-fetch"]||(n.roots["libp2p-fetch"]={});a.FetchRequest=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.identifier="",t.encode=function(t,e){return e||(e=o.create()),null!=t.identifier&&Object.hasOwnProperty.call(t,"identifier")&&e.uint32(10).string(t.identifier),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.FetchRequest;t.pos<r;){var o=t.uint32();if(o>>>3===1)n.identifier=t.string();else t.skipType(7&o)}return n},t.fromObject=function(t){if(t instanceof a.FetchRequest)return t;var e=new a.FetchRequest;return null!=t.identifier&&(e.identifier=String(t.identifier)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.identifier=""),null!=t.identifier&&t.hasOwnProperty("identifier")&&(r.identifier=t.identifier),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),a.FetchResponse=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.status=0,t.prototype.data=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),null!=t.status&&Object.hasOwnProperty.call(t,"status")&&e.uint32(8).int32(t.status),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&e.uint32(18).bytes(t.data),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.FetchResponse;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.status=t.int32();break;case 2:n.data=t.bytes();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.FetchResponse)return t;var e=new a.FetchResponse;switch(t.status){case"OK":case 0:e.status=0;break;case"NOT_FOUND":case 1:e.status=1;break;case"ERROR":case 2:e.status=2}return null!=t.data&&("string"===typeof t.data?s.base64.decode(t.data,e.data=s.newBuffer(s.base64.length(t.data)),0):t.data.length&&(e.data=t.data)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.status=e.enums===String?"OK":0,e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=s.newBuffer(r.data)))),null!=t.status&&t.hasOwnProperty("status")&&(r.status=e.enums===String?a.FetchResponse.StatusCode[t.status]:t.status),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?s.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t.StatusCode=function(){var t={},e=Object.create(t);return e[t[0]="OK"]=0,e[t[1]="NOT_FOUND"]=1,e[t[2]="ERROR"]=2,e}(),t}(),t.exports=a},85012:(t,e,r)=>{"use strict";const n=r(90190),{Multiaddr:i}=r(98719),o=r(67963),{codes:s}=r(59087);t.exports=function(t){let e;if("string"===typeof t&&(t=new i(t)),i.isMultiaddr(t)){e=t;const i=t.getPeerId();if(!i)throw o(new Error("".concat(t," does not have a valid peer type")),s.ERR_INVALID_MULTIADDR);try{t=n.createFromB58String(i)}catch(r){throw o(new Error("".concat(t," is not a valid peer type")),s.ERR_INVALID_MULTIADDR)}}return{id:t,multiaddrs:e?[e]:void 0}}},43367:(t,e,r)=>{"use strict";const n=r(28362).version;t.exports.PROTOCOL_VERSION="ipfs/0.1.0",t.exports.AGENT_VERSION="js-libp2p/".concat(n),t.exports.MULTICODEC_IDENTIFY="/ipfs/id/1.0.0",t.exports.MULTICODEC_IDENTIFY_PUSH="/ipfs/id/push/1.0.0",t.exports.IDENTIFY_PROTOCOL_VERSION="0.1.0",t.exports.MULTICODEC_IDENTIFY_PROTOCOL_NAME="id",t.exports.MULTICODEC_IDENTIFY_PUSH_PROTOCOL_NAME="id/push",t.exports.MULTICODEC_IDENTIFY_PROTOCOL_VERSION="1.0.0",t.exports.MULTICODEC_IDENTIFY_PUSH_PROTOCOL_VERSION="1.0.0"},6215:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:identify"),{error:n("libp2p:identify:err")}),o=r(67963),s=r(44709),{pipe:a}=r(79023),{collect:u,take:c,consume:l}=r(79755),{fromString:h}=r(46765),f=r(90190),{Multiaddr:d}=r(98719),{toBuffer:p}=r(90351),y=r(32912),g=r(76869),m=r(73374),{MULTICODEC_IDENTIFY:b,MULTICODEC_IDENTIFY_PUSH:v,IDENTIFY_PROTOCOL_VERSION:w,MULTICODEC_IDENTIFY_PROTOCOL_NAME:_,MULTICODEC_IDENTIFY_PUSH_PROTOCOL_NAME:E,MULTICODEC_IDENTIFY_PROTOCOL_VERSION:S,MULTICODEC_IDENTIFY_PUSH_PROTOCOL_VERSION:I}=r(43367),{codes:A}=r(59087);class M{static getProtocolStr(t){return{identifyProtocolStr:"/".concat(t._config.protocolPrefix,"/").concat(_,"/").concat(S),identifyPushProtocolStr:"/".concat(t._config.protocolPrefix,"/").concat(E,"/").concat(I)}}constructor(t){let{libp2p:e}=t;this._libp2p=e,this.peerStore=e.peerStore,this.addressManager=e.addressManager,this.connectionManager=e.connectionManager,this.peerId=e.peerId,this.handleMessage=this.handleMessage.bind(this);const r=M.getProtocolStr(e);this.identifyProtocolStr=r.identifyProtocolStr,this.identifyPushProtocolStr=r.identifyPushProtocolStr,this._host={protocolVersion:"".concat(e._config.protocolPrefix,"/").concat(w),...e._options.host},this.connectionManager.on("peer:connect",(t=>{this.identify(t).catch(i.error)})),this.peerStore.on("change:multiaddrs",(t=>{let{peerId:e}=t;e.toString()===this.peerId.toString()&&this.pushToPeerStore().catch((t=>i.error(t)))})),this.peerStore.on("change:protocols",(t=>{let{peerId:e}=t;e.toString()===this.peerId.toString()&&this.pushToPeerStore().catch((t=>i.error(t)))}))}async start(){await this.peerStore.metadataBook.setValue(this.peerId,"AgentVersion",h(this._host.agentVersion)),await this.peerStore.metadataBook.setValue(this.peerId,"ProtocolVersion",h(this._host.protocolVersion))}async stop(){}async push(t){const e=await this.peerStore.addressBook.getRawEnvelope(this.peerId),r=this._libp2p.multiaddrs.map((t=>t.bytes)),n=await this.peerStore.protoBook.get(this.peerId),o=t.map((async t=>{try{const{stream:i}=await t.newStream(this.identifyPushProtocolStr);await a([y.Identify.encode({listenAddrs:r,signedPeerRecord:e,protocols:n}).finish()],s.encode(),i,l)}catch(o){i.error("could not push identify update to peer",o)}}));return Promise.all(o)}async pushToPeerStore(){if(!this._libp2p.isStarted())return;const t=[];let e;for await(const r of this.peerStore.getPeers())r.protocols.includes(this.identifyPushProtocolStr)&&(e=this.connectionManager.get(r.id))&&t.push(e);await this.push(t)}async identify(t){const{stream:e}=await t.newStream(this.identifyProtocolStr),[r]=await a([],e,s.decode(),c(1),p,u);if(!r)throw o(new Error("No data could be retrieved"),A.ERR_CONNECTION_ENDED);let n;try{n=y.Identify.decode(r)}catch(I){throw o(I,A.ERR_INVALID_MESSAGE)}const{publicKey:l,listenAddrs:b,protocols:v,observedAddr:w,signedPeerRecord:_}=n,E=await f.createFromPubKey(l);if(t.remotePeer.toB58String()!==E.toB58String())throw o(new Error("identified peer does not match the expected peer"),A.ERR_INVALID_PEER);const S=M.getCleanMultiaddr(w);try{const t=await g.openAndCertify(_,m.DOMAIN);if(await this.peerStore.addressBook.consumePeerRecord(t))return await this.peerStore.protoBook.set(E,v),await this.peerStore.metadataBook.setValue(E,"AgentVersion",h(n.agentVersion)),void await this.peerStore.metadataBook.setValue(E,"ProtocolVersion",h(n.protocolVersion))}catch(I){i("received invalid envelope, discard it and fallback to listenAddrs is available",I)}try{await this.peerStore.addressBook.set(E,b.map((t=>new d(t))))}catch(I){i.error("received invalid addrs",I)}await this.peerStore.protoBook.set(E,v),await this.peerStore.metadataBook.setValue(E,"AgentVersion",h(n.agentVersion)),await this.peerStore.metadataBook.setValue(E,"ProtocolVersion",h(n.protocolVersion)),i("received observed address of %s",S)}handleMessage(t){let{connection:e,stream:r,protocol:n}=t;switch(n){case this.identifyProtocolStr:return this._handleIdentify({connection:e,stream:r});case this.identifyPushProtocolStr:return this._handlePush({connection:e,stream:r});default:i.error("cannot handle unknown protocol %s",n)}}async _handleIdentify(t){let{connection:e,stream:r}=t;try{let t=new Uint8Array(0);this.peerId.pubKey&&(t=this.peerId.pubKey.bytes);const n=await this.peerStore.addressBook.getRawEnvelope(this.peerId),i=await this.peerStore.protoBook.get(this.peerId),o=y.Identify.encode({protocolVersion:this._host.protocolVersion,agentVersion:this._host.agentVersion,publicKey:t,listenAddrs:this._libp2p.multiaddrs.map((t=>t.bytes)),signedPeerRecord:n,observedAddr:e.remoteAddr.bytes,protocols:i}).finish();await a([o],s.encode(),r,l)}catch(n){i.error("could not respond to identify request",n)}}async _handlePush(t){let e,{connection:r,stream:n}=t;try{const[t]=await a([],n,s.decode(),c(1),p,u);e=y.Identify.decode(t)}catch(l){return i.error("received invalid message",l)}const o=r.remotePeer;try{const t=await g.openAndCertify(e.signedPeerRecord,m.DOMAIN);if(await this.peerStore.addressBook.consumePeerRecord(t))return void await this.peerStore.protoBook.set(o,e.protocols)}catch(l){i("received invalid envelope, discard it and fallback to listenAddrs is available",l)}try{await this.peerStore.addressBook.set(o,e.listenAddrs.map((t=>new d(t))))}catch(l){i.error("received invalid addrs",l)}try{await this.peerStore.protoBook.set(o,e.protocols)}catch(l){i.error("received invalid protocols",l)}}static getCleanMultiaddr(t){if(t&&t.length>0)try{return new d(t)}catch(e){return null}return null}}const T={IDENTIFY:b,IDENTIFY_PUSH:v};M.multicodecs=T,M.Messsage=y,t.exports=M},32912:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-identify"]||(n.roots["libp2p-identify"]={});a.Identify=function(){function t(t){if(this.listenAddrs=[],this.protocols=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.protocolVersion="",t.prototype.agentVersion="",t.prototype.publicKey=s.newBuffer([]),t.prototype.listenAddrs=s.emptyArray,t.prototype.observedAddr=s.newBuffer([]),t.prototype.protocols=s.emptyArray,t.prototype.signedPeerRecord=s.newBuffer([]),t.encode=function(t,e){if(e||(e=o.create()),null!=t.publicKey&&Object.hasOwnProperty.call(t,"publicKey")&&e.uint32(10).bytes(t.publicKey),null!=t.listenAddrs&&t.listenAddrs.length)for(var r=0;r<t.listenAddrs.length;++r)e.uint32(18).bytes(t.listenAddrs[r]);if(null!=t.protocols&&t.protocols.length)for(r=0;r<t.protocols.length;++r)e.uint32(26).string(t.protocols[r]);return null!=t.observedAddr&&Object.hasOwnProperty.call(t,"observedAddr")&&e.uint32(34).bytes(t.observedAddr),null!=t.protocolVersion&&Object.hasOwnProperty.call(t,"protocolVersion")&&e.uint32(42).string(t.protocolVersion),null!=t.agentVersion&&Object.hasOwnProperty.call(t,"agentVersion")&&e.uint32(50).string(t.agentVersion),null!=t.signedPeerRecord&&Object.hasOwnProperty.call(t,"signedPeerRecord")&&e.uint32(66).bytes(t.signedPeerRecord),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.Identify;t.pos<r;){var o=t.uint32();switch(o>>>3){case 5:n.protocolVersion=t.string();break;case 6:n.agentVersion=t.string();break;case 1:n.publicKey=t.bytes();break;case 2:n.listenAddrs&&n.listenAddrs.length||(n.listenAddrs=[]),n.listenAddrs.push(t.bytes());break;case 4:n.observedAddr=t.bytes();break;case 3:n.protocols&&n.protocols.length||(n.protocols=[]),n.protocols.push(t.string());break;case 8:n.signedPeerRecord=t.bytes();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.Identify)return t;var e=new a.Identify;if(null!=t.protocolVersion&&(e.protocolVersion=String(t.protocolVersion)),null!=t.agentVersion&&(e.agentVersion=String(t.agentVersion)),null!=t.publicKey&&("string"===typeof t.publicKey?s.base64.decode(t.publicKey,e.publicKey=s.newBuffer(s.base64.length(t.publicKey)),0):t.publicKey.length&&(e.publicKey=t.publicKey)),t.listenAddrs){if(!Array.isArray(t.listenAddrs))throw TypeError(".Identify.listenAddrs: array expected");e.listenAddrs=[];for(var r=0;r<t.listenAddrs.length;++r)"string"===typeof t.listenAddrs[r]?s.base64.decode(t.listenAddrs[r],e.listenAddrs[r]=s.newBuffer(s.base64.length(t.listenAddrs[r])),0):t.listenAddrs[r].length&&(e.listenAddrs[r]=t.listenAddrs[r])}if(null!=t.observedAddr&&("string"===typeof t.observedAddr?s.base64.decode(t.observedAddr,e.observedAddr=s.newBuffer(s.base64.length(t.observedAddr)),0):t.observedAddr.length&&(e.observedAddr=t.observedAddr)),t.protocols){if(!Array.isArray(t.protocols))throw TypeError(".Identify.protocols: array expected");e.protocols=[];for(r=0;r<t.protocols.length;++r)e.protocols[r]=String(t.protocols[r])}return null!=t.signedPeerRecord&&("string"===typeof t.signedPeerRecord?s.base64.decode(t.signedPeerRecord,e.signedPeerRecord=s.newBuffer(s.base64.length(t.signedPeerRecord)),0):t.signedPeerRecord.length&&(e.signedPeerRecord=t.signedPeerRecord)),e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.listenAddrs=[],r.protocols=[]),e.defaults&&(e.bytes===String?r.publicKey="":(r.publicKey=[],e.bytes!==Array&&(r.publicKey=s.newBuffer(r.publicKey))),e.bytes===String?r.observedAddr="":(r.observedAddr=[],e.bytes!==Array&&(r.observedAddr=s.newBuffer(r.observedAddr))),r.protocolVersion="",r.agentVersion="",e.bytes===String?r.signedPeerRecord="":(r.signedPeerRecord=[],e.bytes!==Array&&(r.signedPeerRecord=s.newBuffer(r.signedPeerRecord)))),null!=t.publicKey&&t.hasOwnProperty("publicKey")&&(r.publicKey=e.bytes===String?s.base64.encode(t.publicKey,0,t.publicKey.length):e.bytes===Array?Array.prototype.slice.call(t.publicKey):t.publicKey),t.listenAddrs&&t.listenAddrs.length){r.listenAddrs=[];for(var n=0;n<t.listenAddrs.length;++n)r.listenAddrs[n]=e.bytes===String?s.base64.encode(t.listenAddrs[n],0,t.listenAddrs[n].length):e.bytes===Array?Array.prototype.slice.call(t.listenAddrs[n]):t.listenAddrs[n]}if(t.protocols&&t.protocols.length){r.protocols=[];for(n=0;n<t.protocols.length;++n)r.protocols[n]=t.protocols[n]}return null!=t.observedAddr&&t.hasOwnProperty("observedAddr")&&(r.observedAddr=e.bytes===String?s.base64.encode(t.observedAddr,0,t.observedAddr.length):e.bytes===Array?Array.prototype.slice.call(t.observedAddr):t.observedAddr),null!=t.protocolVersion&&t.hasOwnProperty("protocolVersion")&&(r.protocolVersion=t.protocolVersion),null!=t.agentVersion&&t.hasOwnProperty("agentVersion")&&(r.agentVersion=t.agentVersion),null!=t.signedPeerRecord&&t.hasOwnProperty("signedPeerRecord")&&(r.signedPeerRecord=e.bytes===String?s.base64.encode(t.signedPeerRecord,0,t.signedPeerRecord.length):e.bytes===Array?Array.prototype.slice.call(t.signedPeerRecord):t.signedPeerRecord),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t.exports=a},6197:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p"),{error:n("libp2p:err")}),{EventEmitter:o}=r(47465),s=r(67963),a=r(90190),{Multiaddr:u}=r(98719),{MemoryDatastore:c}=r(78932),l=r(28109),h=r(78909),f=r(85012),{validate:d}=r(7037),{codes:p,messages:y}=r(59087),g=r(61995),m=r(71997),b=r(75570),v=r(46162),w=r(90432),_=r(50453),E=r(69566),S=r(70030),I=r(48350),A=r(59324),M=r(47299),T=r(88694),R=r(9828),k=r(6215),C=r(85889),P=r(66321),B=r(45020),{updateSelfPeerRecord:O}=r(17335);class N extends o{static async create(t){if(t.peerId)return new N(t);const e=await a.create();return t.peerId=e,new N(t)}constructor(t){if(super(),this._options=d(t),this.peerId=this._options.peerId,this.datastore=this._options.datastore,this._options.metrics.enabled){const t=new S({...this._options.metrics});this.metrics=t}if(this.connectionGater={denyDialPeer:async()=>Promise.resolve(!1),denyDialMultiaddr:async()=>Promise.resolve(!1),denyInboundConnection:async()=>Promise.resolve(!1),denyOutboundConnection:async()=>Promise.resolve(!1),denyInboundEncryptedConnection:async()=>Promise.resolve(!1),denyOutboundEncryptedConnection:async()=>Promise.resolve(!1),denyInboundUpgradedConnection:async()=>Promise.resolve(!1),denyOutboundUpgradedConnection:async()=>Promise.resolve(!1),filterMultiaddrForPeer:async()=>Promise.resolve(!0),...this._options.connectionGater},this.peerStore=new M({peerId:this.peerId,datastore:this.datastore&&this._options.peerStore.persistence?this.datastore:new c,addressFilter:this.connectionGater.filterMultiaddrForPeer}),this.addresses=this._options.addresses,this.addressManager=new g(this.peerId,this._options.addresses),this.addressManager.on("change:addresses",(()=>{O(this).catch((t=>{i.error("Error updating self peer record",t)}))})),this._modules=this._options.modules,this._config=this._options.config,this._transport=[],this._discovery=new Map,this.connectionManager=new m(this,{...this._options.connectionManager}),this._autodialler=new b(this,{enabled:this._config.peerDiscovery.autoDial,minConnections:this._options.connectionManager.minConnections,autoDialInterval:this._options.connectionManager.autoDialInterval}),this._options.keychain&&this._options.keychain.datastore){i("creating keychain");const t=E.generateOptions();this.keychain=new E(this._options.keychain.datastore,{...t,...this._options.keychain}),i("keychain constructed")}if(this.upgrader=new A({connectionGater:this.connectionGater,localPeer:this.peerId,metrics:this.metrics,onConnection:t=>this.connectionManager.onConnect(t),onConnectionEnd:t=>this.connectionManager.onDisconnect(t)}),this.transportManager=new I({libp2p:this,upgrader:this.upgrader,faultTolerance:this._options.transportManager.faultTolerance}),this.natManager=new B({peerId:this.peerId,addressManager:this.addressManager,transportManager:this.transportManager,...this._options.config.nat}),this.registrar=new R({peerStore:this.peerStore,connectionManager:this.connectionManager}),this.handle=this.handle.bind(this),this.registrar.handle=this.handle,!this._modules.connEncryption||!this._modules.connEncryption.length)throw s(new Error(y.CONN_ENCRYPTION_REQUIRED),p.CONN_ENCRYPTION_REQUIRED);if(this._modules.connEncryption.forEach((t=>{this.upgrader.cryptos.set(t.protocol,t)})),this.dialer=new _({transportManager:this.transportManager,connectionGater:this.connectionGater,peerStore:this.peerStore,metrics:this.metrics,...this._options.dialer}),this._modules.transport.forEach((t=>{const e=t.prototype[Symbol.toStringTag],r=this._config.transport[e];this.transportManager.add(e,t,r)})),this._config.relay.enabled&&(this.transportManager.add(v.prototype[Symbol.toStringTag],v),this.relay=new w(this)),this._modules.streamMuxer){this._modules.streamMuxer.forEach((t=>{this.upgrader.muxers.set(t.multicodec,t)})),this.identifyService=new k({libp2p:this})}if(this._modules.connProtector)this.upgrader.protector=this._modules.connProtector;else if(void 0!==globalThis.process&&globalThis.process.env&&globalThis.process.env.LIBP2P_FORCE_PNET)throw new Error("Private network is enforced, but no protector was provided");if(this._modules.dht){const t=this._modules.dht;this._dht=t.create({libp2p:this,...this._config.dht})}if(this._modules.pubsub){const t=this._modules.pubsub;this.pubsub=T(t,this,this._config.pubsub)}this.peerRouting=new l(this),this.contentRouting=new h(this),this._onDiscoveryPeer=this._onDiscoveryPeer.bind(this),this.fetchService=new C(this),this.pingService=new P(this)}emit(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return"error"!==t||this._events.error?super.emit(t,...r):(i.error(r),!1)}async start(){i("libp2p is starting"),this.identifyService&&await this.handle(Object.values(k.getProtocolStr(this)),this.identifyService.handleMessage),this.fetchService&&await this.handle(C.PROTOCOL,this.fetchService.handleMessage),this.pingService&&await this.handle(P.getProtocolStr(this),this.pingService.handleMessage);try{await this._onStarting(),await this._onDidStart(),i("libp2p has started")}catch(t){throw this.emit("error",t),i.error("An error occurred starting libp2p",t),await this.stop(),t}}async stop(){i("libp2p is stopping");try{this._isStarted=!1,this.identifyService&&await this.identifyService.stop(),this.relay&&this.relay.stop(),this.peerRouting.stop(),await this._autodialler.stop(),await(this._dht&&this._dht.stop());for(const t of this._discovery.values())t.removeListener("peer",this._onDiscoveryPeer);await Promise.all(Array.from(this._discovery.values(),(t=>t.stop()))),this._discovery=new Map,await this.connectionManager.stop(),await Promise.all([this.pubsub&&this.pubsub.stop(),this.metrics&&this.metrics.stop()]),await this.natManager.stop(),await this.transportManager.close(),await this.unhandle(C.PROTOCOL),await this.unhandle(P.getProtocolStr(this)),this.dialer.destroy()}catch(t){t&&(i.error(t),this.emit("error",t))}i("libp2p has stopped")}async loadKeychain(){if(this.keychain)try{await this.keychain.findKeyByName("self")}catch(t){await this.keychain.importPeer("self",this.peerId)}}isStarted(){return this._isStarted}get connections(){return this.connectionManager.connections}dial(t,e){return this._dial(t,e)}async dialProtocol(t,e,r){if(!e||!e.length)throw s(new Error("no protocols were provided to open a stream"),p.ERR_INVALID_PROTOCOLS_FOR_STREAM);return(await this._dial(t,r)).newStream(e)}async _dial(t,e){const{id:r,multiaddrs:n}=f(t);if(r.equals(this.peerId))throw s(new Error("Cannot dial self"),p.ERR_DIALED_SELF);let i=this.connectionManager.get(r);return i?n&&await this.peerStore.addressBook.add(r,n):i=await this.dialer.connectToPeer(t,e),i}get multiaddrs(){let t=this.addressManager.getAnnounceAddrs().map((t=>t.toString()));t.length||(t=this.transportManager.getAddrs().map((t=>t.toString()))),t=t.concat(this.addressManager.getObservedAddrs().map((t=>t.toString())));const e=this._options.addresses.announceFilter,r=new Set(t);return e(Array.from(r).map((t=>new u(t))))}async hangUp(t){const{id:e}=f(t),r=this.connectionManager.connections.get(e.toB58String());r&&await Promise.all(r.map((t=>t.close())))}fetch(t,e){return this.fetchService.fetch(t,e)}ping(t){const{id:e,multiaddrs:r}=f(t);return r?this.pingService.ping(r[0]):this.pingService.ping(e)}async handle(t,e){(t=Array.isArray(t)?t:[t]).forEach((t=>{this.upgrader.protocols.set(t,e)})),await this.peerStore.protoBook.add(this.peerId,t)}async unhandle(t){(t=Array.isArray(t)?t:[t]).forEach((t=>{this.upgrader.protocols.delete(t)})),await this.peerStore.protoBook.remove(this.peerId,t)}async _onStarting(){const t=this.addressManager.getListenAddrs();await this.transportManager.listen(t),this.natManager.start(),this._config.pubsub.enabled&&this.pubsub&&await this.pubsub.start(),this._config.dht.enabled&&(this._dht&&await this._dht.start(),this._dht.on("peer",this._onDiscoveryPeer)),this.metrics&&this.metrics.start(),this.identifyService&&await this.identifyService.start()}async _onDidStart(){this._isStarted=!0,this.peerStore.on("peer",(t=>{this.emit("peer:discovery",t),this._maybeConnect(t).catch((t=>{i.error(t)}))}));for await(const t of this.peerStore.getPeers())this.emit("peer:discovery",t.id);this.connectionManager.start(),await this._autodialler.start(),await this._setupPeerDiscovery(),this.relay&&this.relay.start(),this.peerRouting.start()}_onDiscoveryPeer(t){t.id.toB58String()!==this.peerId.toB58String()?(t.multiaddrs&&this.peerStore.addressBook.add(t.id,t.multiaddrs).catch((t=>i.error(t))),t.protocols&&this.peerStore.protoBook.set(t.id,t.protocols).catch((t=>i.error(t)))):i.error(new Error(p.ERR_DISCOVERED_SELF))}async _maybeConnect(t){if(!0===this._config.peerDiscovery.autoDial&&!this.connectionManager.get(t)){if((this._options.connectionManager.minConnections||0)>this.connectionManager.size){i("connecting to discovered peer %s",t.toB58String());try{await this.dialer.connectToPeer(t)}catch(e){i.error("could not connect to discovered peer ".concat(t.toB58String()," with ").concat(e))}}}}async _setupPeerDiscovery(){const t=t=>{let e={enabled:!0};if(t.tag&&this._config.peerDiscovery&&this._config.peerDiscovery[t.tag]&&(e={...e,...this._config.peerDiscovery[t.tag]}),e.enabled&&!this._discovery.has(t.tag)){let r;r="function"===typeof t?new t(Object.assign({},e,{peerId:this.peerId,libp2p:this})):t,r.on("peer",this._onDiscoveryPeer),this._discovery.set(t.tag,r)}};for(const e of this._modules.peerDiscovery||[])t(e);for(const e of this.transportManager.getTransports())e.discovery&&t(e.discovery);await Promise.all(Array.from(this._discovery.values(),(t=>t.start())))}}t.exports=N},37929:(t,e,r)=>{"use strict";r(60322),r(14458);const n=r(37934),{certificateForKey:i,findAsync:o}=r(2730),s=r(67963),{fromString:a}=r(46765),{toString:u}=r(82051),{codes:c}=r(59087),l=new WeakMap;t.exports=class{constructor(t,e){if(!t)throw s(new Error("keychain is required"),c.ERR_KEYCHAIN_REQUIRED);this.keychain=t,l.set(this,{dek:e})}async encrypt(t,e){if(!(e instanceof Uint8Array))throw s(new Error("Plain data must be a Uint8Array"),c.ERR_INVALID_PARAMETERS);const r=await this.keychain.findKeyByName(t),o=await this.keychain._getPrivateKey(t),u=l.get(this).dek,h=n.pki.decryptRsaPrivateKey(o,u),f=await i(r,h),d=n.pkcs7.createEnvelopedData();d.addRecipient(f),d.content=n.util.createBuffer(e),d.encrypt();const p=n.asn1.toDer(d.toAsn1()).getBytes();return a(p,"ascii")}async decrypt(t){if(!(t instanceof Uint8Array))throw s(new Error("CMS data is required"),c.ERR_INVALID_PARAMETERS);let e;try{const r=n.util.createBuffer(u(t,"ascii")),i=n.asn1.fromDer(r);e=n.pkcs7.messageFromAsn1(i)}catch(y){throw s(new Error("Invalid CMS: "+y.message),c.ERR_INVALID_CMS)}const r=e.recipients.filter((t=>t.issuer.find((t=>"O"===t.shortName&&"ipfs"===t.value)))).filter((t=>t.issuer.find((t=>"CN"===t.shortName)))).map((t=>({recipient:t,keyId:t.issuer.find((t=>"CN"===t.shortName)).value}))),i=await o(r,(async t=>{try{if(await this.keychain.findKeyById(t.keyId))return!0}catch(y){return!1}return!1}));if(!i){const t=r.map((t=>t.keyId));throw s(new Error("Decryption needs one of the key(s): "+t.join(", ")),c.ERR_MISSING_KEYS,{missingKeys:t})}const h=await this.keychain.findKeyById(i.keyId);if(!h)throw s(new Error("No key available to decrypto"),c.ERR_NO_KEY);const f=await this.keychain._getPrivateKey(h.name),d=l.get(this).dek,p=n.pki.decryptRsaPrivateKey(f,d);return e.decrypt(i.recipient,p),a(e.content.getBytes(),"ascii")}}},69566:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:keychain"),{error:n("libp2p:keychain:err")}),o=r(6327),s=r(89842),a=r(25504),{Key:u}=r(3450),c=r(37929),l=r(67963),{codes:h}=r(59087),{toString:f}=r(82051),{fromString:d}=r(46765);r(62025);const p="/info/",y=new WeakMap,g=14,m=16,b=1e3,v={dek:{keyLength:64,iterationCount:1e4,salt:"you should override this value with a crypto secure random number",hash:"sha2-512"}};function w(t){return!!t&&("string"===typeof t&&t===o(t.trim()))}async function _(t){const e=800*Math.random()+200;throw await new Promise((t=>setTimeout(t,e))),t}function E(t){return new u("/pkcs8/"+t)}function S(t){return new u(p+t)}t.exports=class{constructor(t,e){if(!t)throw new Error("store is required");if(this.store=t,this.opts=s(v,e),this.opts.pass&&this.opts.pass.length<20)throw new Error("pass must be least 20 characters");if(this.opts.dek.keyLength<g)throw new Error("dek.keyLength must be least ".concat(g," bytes"));if(this.opts.dek.salt.length<m)throw new Error("dek.saltLength must be least ".concat(m," bytes"));if(this.opts.dek.iterationCount<b)throw new Error("dek.iterationCount must be least ".concat(b));const r=this.opts.pass?a.pbkdf2(this.opts.pass,this.opts.dek.salt,this.opts.dek.iterationCount,this.opts.dek.keyLength,this.opts.dek.hash):"";y.set(this,{dek:r})}get cms(){return new c(this,y.get(this).dek)}static generateOptions(){const t=Object.assign({},v),e=3*Math.ceil(m/3);return t.dek.salt=f(a.randomBytes(e),"base64"),t}static get options(){return v}async createKey(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2048;const n=this;if(!w(t)||"self"===t)return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));if("string"!==typeof e)return _(l(new Error("Invalid key type '".concat(e,"'")),h.ERR_INVALID_KEY_TYPE));const i=E(t);if(await n.store.has(i))return _(l(new Error("Key '".concat(t,"' already exists")),h.ERR_KEY_ALREADY_EXISTS));if("rsa"===e.toLowerCase())if(!Number.isSafeInteger(r)||r<2048)return _(l(new Error("Invalid RSA key size ".concat(r)),h.ERR_INVALID_KEY_SIZE));let o;try{const s=await a.keys.generateKeyPair(e,r),u=await s.id(),c=y.get(this).dek,l=await s.export(c);o={name:t,id:u};const h=n.store.batch();h.put(i,d(l)),h.put(S(t),d(JSON.stringify(o))),await h.commit()}catch(s){return _(s)}return o}async listKeys(){const t=this,e={prefix:p},r=[];for await(const n of t.store.query(e))r.push(JSON.parse(f(n.value)));return r}async findKeyById(t){try{return(await this.listKeys()).find((e=>e.id===t))}catch(e){return _(e)}}async findKeyByName(t){if(!w(t))return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));const e=S(t);try{const t=await this.store.get(e);return JSON.parse(f(t))}catch(r){return _(l(new Error("Key '".concat(t,"' does not exist. ").concat(r.message)),h.ERR_KEY_NOT_FOUND))}}async removeKey(t){if(!w(t)||"self"===t)return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));const e=E(t),r=await this.findKeyByName(t),n=this.store.batch();return n.delete(e),n.delete(S(t)),await n.commit(),r}async renameKey(t,e){const r=this;if(!w(t)||"self"===t)return _(l(new Error("Invalid old key name '".concat(t,"'")),h.ERR_OLD_KEY_NAME_INVALID));if(!w(e)||"self"===e)return _(l(new Error("Invalid new key name '".concat(e,"'")),h.ERR_NEW_KEY_NAME_INVALID));const n=E(t),i=E(e),o=S(t),s=S(e);if(await r.store.has(i))return _(l(new Error("Key '".concat(e,"' already exists")),h.ERR_KEY_ALREADY_EXISTS));try{const t=await r.store.get(n),a=await r.store.get(o),u=JSON.parse(f(a));u.name=e;const c=r.store.batch();return c.put(i,t),c.put(s,d(JSON.stringify(u))),c.delete(n),c.delete(o),await c.commit(),u}catch(a){return _(a)}}async exportKey(t,e){if(!w(t))return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));if(!e)return _(l(new Error("Password is required"),h.ERR_PASSWORD_REQUIRED));const r=E(t);try{const t=await this.store.get(r),n=f(t),i=y.get(this).dek;return(await a.keys.import(n,i)).export(e)}catch(n){return _(n)}}async importKey(t,e,r){if(!w(t)||"self"===t)return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));if(!e)return _(l(new Error("PEM encoded key is required"),h.ERR_PEM_REQUIRED));const n=E(t);if(await this.store.has(n))return _(l(new Error("Key '".concat(t,"' already exists")),h.ERR_KEY_ALREADY_EXISTS));let i,o;try{i=await a.keys.import(e,r)}catch(c){return _(l(new Error("Cannot read the key, most likely the password is wrong"),h.ERR_CANNOT_READ_KEY))}try{o=await i.id();const t=y.get(this).dek;e=await i.export(t)}catch(c){return _(c)}const s={name:t,id:o},u=this.store.batch();return u.put(n,d(e)),u.put(S(t),d(JSON.stringify(s))),await u.commit(),s}async importPeer(t,e){const r=this;if(!w(t))return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));if(!e||!e.privKey)return _(l(new Error("Peer.privKey is required"),h.ERR_MISSING_PRIVATE_KEY));const n=e.privKey,i=E(t);if(await r.store.has(i))return _(l(new Error("Key '".concat(t,"' already exists")),h.ERR_KEY_ALREADY_EXISTS));try{const e=await n.id(),o=y.get(this).dek,s=await n.export(o),a={name:t,id:e},u=r.store.batch();return u.put(i,d(s)),u.put(S(t),d(JSON.stringify(a))),await u.commit(),a}catch(o){return _(o)}}async _getPrivateKey(t){if(!w(t))return _(l(new Error("Invalid key name '".concat(t,"'")),h.ERR_INVALID_KEY_NAME));try{const e=E(t),r=await this.store.get(e);return f(r)}catch(e){return _(l(new Error("Key '".concat(t,"' does not exist. ").concat(e.message)),h.ERR_KEY_NOT_FOUND))}}async rotateKeychainPass(t,e){if("string"!==typeof t)return _(l(new Error("Invalid old pass type '".concat(typeof t,"'")),h.ERR_INVALID_OLD_PASS_TYPE));if("string"!==typeof e)return _(l(new Error("Invalid new pass type '".concat(typeof e,"'")),h.ERR_INVALID_NEW_PASS_TYPE));if(e.length<20)return _(l(new Error("Invalid pass length ".concat(e.length)),h.ERR_INVALID_PASS_LENGTH));i("recreating keychain");const r=y.get(this).dek;this.opts.pass=e;const n=e?a.pbkdf2(e,this.opts.dek.salt,this.opts.dek.iterationCount,this.opts.dek.keyLength,this.opts.dek.hash):"";y.set(this,{dek:n});const o=await this.listKeys();for(const i of o){const t=await this.store.get(E(i.name)),e=f(t),o=await a.keys.import(e,r),s=n.toString(),u=await o.export(s),c=this.store.batch(),l={name:i.name,id:i.id};c.put(E(i.name),d(u)),c.put(S(i.name),d(JSON.stringify(l))),await c.commit()}i("keychain reconstructed")}}},2730:(t,e,r)=>{"use strict";r(87141);const n=r(37934).pki;t.exports={certificateForKey:(t,e)=>{const r=n.setRsaPublicKey(e.n,e.e),i=n.createCertificate();i.publicKey=r,i.serialNumber="01",i.validity.notBefore=new Date,i.validity.notAfter=new Date,i.validity.notAfter.setFullYear(i.validity.notBefore.getFullYear()+10);const o=[{name:"organizationName",value:"ipfs"},{shortName:"OU",value:"keystore"},{name:"commonName",value:t.id}];return i.setSubject(o),i.setIssuer(o),i.setExtensions([{name:"basicConstraints",cA:!0},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!0,emailProtection:!0,timeStamping:!0},{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0,sslCA:!0,emailCA:!0,objCA:!0}]),i.sign(e),i},findAsync:async function(t,e){const r=t.map(e);return t[(await Promise.all(r)).findIndex((t=>t))]}}},70030:(t,e,r)=>{"use strict";const n=r(89842),{pipe:i}=r(79023),{tap:o}=r(79755),s=r(40579),{METRICS:a}=r(70127),u=r(59112),c=["dataReceived","dataSent"],l={in:"dataReceived",out:"dataSent"};class h{constructor(t){this._options=n(a,t),this._globalStats=new u(c,this._options),this._peerStats=new Map,this._protocolStats=new Map,this._oldPeers=s(this._options.maxOldPeersRetention),this._running=!1,this._onMessage=this._onMessage.bind(this),this._systems=new Map}start(){this._running=!0}stop(){this._running=!1,this._globalStats.stop();for(const t of this._peerStats.values())t.stop();for(const t of this._protocolStats.values())t.stop()}get global(){return this._globalStats}get peers(){return Array.from(this._peerStats.keys())}getComponentMetrics(){return this._systems}updateComponentMetric(t){let{system:e="libp2p",component:r,metric:n,value:i}=t;this._systems.has(e)||this._systems.set(e,new Map);const o=this._systems.get(e);o.has(r)||o.set(r,new Map);o.get(r).set(n,i)}forPeer(t){const e=t.toB58String();return this._peerStats.get(e)||this._oldPeers.get(e)}get protocols(){return Array.from(this._protocolStats.keys())}forProtocol(t){return this._protocolStats.get(t)}onPeerDisconnected(t){const e=t.toB58String(),r=this._peerStats.get(e);r&&(r.stop(),this._peerStats.delete(e),this._oldPeers.set(e,r))}_onMessage(t){let{remotePeer:e,protocol:r,direction:n,dataLength:i}=t;if(!this._running)return;const o=l[n];let s=this.forPeer(e);if(s||(s=new u(c,this._options),this._peerStats.set(e.toB58String(),s)),s.push(o,i),this._globalStats.push(o,i),r){let t=this.forProtocol(r);t||(t=new u(c,this._options),this._protocolStats.set(r,t)),t.push(o,i)}}updatePlaceholder(t,e){if(!this._running)return;const r=this.forPeer(t),n=e.toB58String(),i=this.forPeer(e);let o=r;i&&(o=h.mergeStats(i,o),this._oldPeers.delete(n)),this._peerStats.delete(t.toB58String()),this._peerStats.set(n,o),o.start()}trackStream(t){let{stream:e,remotePeer:r,protocol:n}=t;const s=this,a=e.source;e.source=o((t=>s._onMessage({remotePeer:r,protocol:n,direction:"in",dataLength:t.length})))(a);const u=e.sink;return e.sink=t=>i(t,o((t=>s._onMessage({remotePeer:r,protocol:n,direction:"out",dataLength:t.length}))),u),e}static mergeStats(t,e){return t.stop(),e.stop(),t._queue=[...t._queue,...e._queue],t}}t.exports=h},40579:(t,e,r)=>{"use strict";const n=r(34737);t.exports=t=>{const e=n(t);return e.delete=e.remove,e}},59112:(t,e,r)=>{"use strict";const{EventEmitter:n}=r(47465),{BigNumber:i}=r(17144),o=r(56755),s=r(31779);t.exports=class extends n{constructor(t,e){super(),this._options=e,this._queue=[],this._stats={dataReceived:i(0),dataSent:i(0)},this._frequencyLastTime=Date.now(),this._frequencyAccumulators={},this._movingAverages={},this._update=this._update.bind(this);const r=this._options.movingAverageIntervals;for(let n=0;n<t.length;n++){const e=t[n];this._stats[e]=i(0),this._movingAverages[e]={};for(let t=0;t<r.length;t++){const n=r[t];(this._movingAverages[e][n]=o(n)).push(this._frequencyLastTime,0)}}}start(){this._queue.length&&this._resetComputeTimeout()}stop(){this._timeout&&(this._timeout.clear(),this._timeout=null)}get snapshot(){return Object.assign({},this._stats)}get movingAverages(){return Object.assign({},this._movingAverages)}toJSON(){const t=this.snapshot,e=this.movingAverages,r={dataReceived:t.dataReceived.toString(),dataSent:t.dataSent.toString(),movingAverages:{}},n=Object.keys(e);for(const i of n){r.movingAverages[i]={};for(const t of Object.keys(e[i]))r.movingAverages[i][t]=e[i][t].movingAverage()}return r}push(t,e){this._queue.push([t,e,Date.now()]),this._resetComputeTimeout()}_resetComputeTimeout(){this._timeout=s(this._update,this._nextTimeout())}_nextTimeout(){const t=this._queue.length/this._options.computeThrottleMaxQueueSize;return Math.max(this._options.computeThrottleTimeout*(1-t),0)}_update(){if(this._timeout=null,this._queue.length){let t;for(t of this._queue)this._applyOp(t);this._queue=[],this._updateFrequency(t[2]),this.emit("update",this._stats)}}_updateFrequency(t){const e=t-this._frequencyLastTime;Object.keys(this._stats).forEach((r=>{this._updateFrequencyFor(r,e,t)})),this._frequencyLastTime=t}_updateFrequencyFor(t,e,r){const n=this._frequencyAccumulators[t]||0;this._frequencyAccumulators[t]=0;const i=n/(e||1)*1e3;let s=this._movingAverages[t];s||(s=this._movingAverages[t]={});const a=this._options.movingAverageIntervals;for(let u=0;u<a.length;u++){const t=a[u];let e=s[t];e||(e=s[t]=o(t)),e.push(r,i)}}_applyOp(t){const e=t[0],r=t[1];if("number"!==typeof r)throw new Error("invalid increment number: ".concat(r));let n;n=Object.prototype.hasOwnProperty.call(this._stats,e)?this._stats[e]:this._stats[e]=i(0),this._stats[e]=n.plus(r),this._frequencyAccumulators[e]||(this._frequencyAccumulators[e]=0),this._frequencyAccumulators[e]+=r}}},3342:t=>{"use strict";class e extends Map{constructor(t){super();const{system:e,component:r,metric:n,metrics:i}=t;this._system=e,this._component=r,this._metric=n,this._metrics=i,this._metrics.updateComponentMetric({system:this._system,component:this._component,metric:this._metric,value:this.size})}set(t,e){return super.set(t,e),this._metrics.updateComponentMetric({system:this._system,component:this._component,metric:this._metric,value:this.size}),this}delete(t){const e=super.delete(t);return this._metrics.updateComponentMetric({system:this._system,component:this._component,metric:this._metric,value:this.size}),e}clear(){super.clear(),this._metrics.updateComponentMetric({system:this._system,component:this._component,metric:this._metric,value:this.size})}}t.exports=t=>{let r,{system:n="libp2p",component:i,metric:o,metrics:s}=t;return r=s?new e({system:n,component:i,metric:o,metrics:s}):new Map,r}},45020:(t,e,r)=>{"use strict";const n=r(47956),i=r(18392),{promisify:o}=r(51590),{Multiaddr:s}=r(98719),a=Object.assign(i("libp2p:nat"),{error:i("libp2p:nat:err")}),{isBrowser:u}=r(3227),c=r(51545),l=r(83931),h=r(28362),f=r(67963),{codes:{ERR_INVALID_PARAMETERS:d}}=r(59087),p=r(57349),y=7200;function g(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:65535;return Math.floor(Math.random()*(e-t+1)+t)}t.exports=class{constructor(t){let{peerId:e,addressManager:r,transportManager:n,...i}=t;if(this._peerId=e,this._addressManager=r,this._transportManager=n,this._enabled=i.enabled,this._externalIp=i.externalIp,this._options={description:i.description||"".concat(h.name,"@").concat(h.version," ").concat(this._peerId),ttl:i.ttl||y,autoUpdate:i.keepAlive||!0,gateway:i.gateway,enablePMP:Boolean(i.pmp&&i.pmp.enabled)},this._options.ttl<y)throw f(new Error("NatManager ttl should be at least ".concat(y," seconds")),d)}start(){!u&&this._enabled&&this._start().catch((t=>{a.error(t)}))}async _start(){const t=this._transportManager.getAddrs();for(const e of t){const{family:t,host:r,port:n,transport:i}=e.toOptions();if(!e.isThinWaistAddress()||"tcp"!==i)continue;if(p(e))continue;if(4!==t)continue;const o=this._getClient(),u=this._externalIp||await o.externalIp();if(l(u))throw new Error("".concat(u," is private - please set config.nat.externalIp to an externally routable IP or ensure you are not behind a double NAT"));const c=g();a("opening uPnP connection from ".concat(u,":").concat(c," to ").concat(r,":").concat(n)),await o.map({publicPort:c,privatePort:n,protocol:i.toUpperCase()}),this._addressManager.addObservedAddr(s.fromNodeAddress({family:4,address:u,port:c},i))}}_getClient(){if(this._client)return this._client;const t=new n(this._options),e=o(t.map.bind(t)),r=o(t.destroy.bind(t)),i=o(t.externalIp.bind(t));return this._client={map:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return c((()=>e(...r)),{onFailedAttempt:a.error,unref:!0})},destroy:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return c((()=>r(...e)),{onFailedAttempt:a.error,unref:!0})},externalIp:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return c((()=>i(...e)),{onFailedAttempt:a.error,unref:!0})}},this._client}async stop(){if(!u&&this._client)try{await this._client.destroy(),this._client=null}catch(t){a.error(t)}}}},28109:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:peer-routing"),{error:n("libp2p:peer-routing:err")}),o=r(67963),s=r(59087),{storeAddresses:a,uniquePeers:u,requirePeers:c}=r(31935),{TimeoutController:l}=r(87683),h=r(96155),{pipe:f}=r(79023),d=r(84744),p=r(79272),y=r(12393),{setDelayedInterval:g,clearDelayedInterval:m}=r(18928),{DHTPeerRouting:b}=r(39862),{setMaxListeners:v}=r(47465);t.exports=class{constructor(t){this._peerId=t.peerId,this._peerStore=t.peerStore,this._routers=t._modules.peerRouting||[],t._dht&&t._config.dht.enabled&&this._routers.push(new b(t._dht)),this._refreshManagerOptions=t._options.peerRouting.refreshManager,this._findClosestPeersTask=this._findClosestPeersTask.bind(this)}start(){this._routers.length&&!this._timeoutId&&this._refreshManagerOptions.enabled&&(this._timeoutId=g(this._findClosestPeersTask,this._refreshManagerOptions.interval,this._refreshManagerOptions.bootDelay))}async _findClosestPeersTask(){try{await p(this.getClosestPeers(this._peerId.id,{timeout:this._refreshManagerOptions.timeout||1e4}))}catch(t){i.error(t)}}stop(){m(this._timeoutId)}async findPeer(t,e){if(!this._routers.length)throw o(new Error("No peer routers available"),s.codes.ERR_NO_ROUTERS_AVAILABLE);if(t.toB58String()===this._peerId.toB58String())throw o(new Error("Should not try to find self"),s.codes.ERR_FIND_SELF);const r=await f(h(...this._routers.map((r=>async function*(){try{yield await r.findPeer(t,e)}catch(n){i.error(n)}}()))),(t=>y(t,Boolean)),(t=>a(t,this._peerStore)),(t=>d(t)));if(r)return r;throw o(new Error(s.messages.NOT_FOUND),s.codes.ERR_NOT_FOUND)}async*getClosestPeers(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4};if(!this._routers.length)throw o(new Error("No peer routers available"),s.codes.ERR_NO_ROUTERS_AVAILABLE);if(e.timeout){const t=new l(e.timeout);try{v&&v(1/0,t.signal)}catch{}e.signal=t.signal}yield*f(h(...this._routers.map((r=>r.getClosestPeers(t,e)))),(t=>a(t,this._peerStore)),(t=>u(t)),(t=>c(t)))}}},2674:(t,e,r)=>{"use strict";const n=r(18392),i=r(67963),{Multiaddr:o}=r(98719),s=r(90190),{codes:a}=r(59087),u=r(73374),c=r(76869),{pipe:l}=r(79023),h=r(50464),f=r(12393),d=r(27889),p=r(61309),y=Object.assign(n("libp2p:peer-store:address-book"),{error:n("libp2p:peer-store:address-book:err")}),g="change:multiaddrs";function m(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return l(e,(t=>p(t,(t=>{if(!o.isMultiaddr(t))throw y.error("multiaddr must be an instance of Multiaddr"),i(new Error("multiaddr must be an instance of Multiaddr"),a.ERR_INVALID_PARAMETERS)}))),(e=>f(e,(e=>r(t,e)))),(t=>d(t,(t=>({multiaddr:new o(t.toString()),isCertified:n})))),(t=>h(t)))}t.exports=class{constructor(t,e,r){this._emit=t,this._store=e,this._addressFilter=r}async consumePeerRecord(t){y("consumePeerRecord await write lock");const e=await this._store.lock.writeLock();let r,n;y("consumePeerRecord got write lock");try{let o;try{o=u.createFromProtobuf(t.payload)}catch(i){return y.error("invalid peer record received"),!1}r=o.peerId;const s=o.multiaddrs;if(!r.equals(t.peerId))return y("signing key does not match PeerId in the PeerRecord"),!1;if(!s||!s.length)return!1;if(await this._store.has(r)){const t=await this._store.load(r);if(t.peerRecordEnvelope){const e=await c.createFromProtobuf(t.peerRecordEnvelope);if(u.createFromProtobuf(e.payload).seqNumber>=o.seqNumber)return!1}}n=await this._store.patchOrCreate(r,{addresses:await m(r,s,this._addressFilter,!0),peerRecordEnvelope:t.marshal()}),y("stored provided peer record for ".concat(o.peerId.toB58String()))}finally{y("consumePeerRecord release write lock"),e()}return this._emit(g,{peerId:r,multiaddrs:n.addresses.map((t=>{let{multiaddr:e}=t;return e}))}),!0}async getRawEnvelope(t){y("getRawEnvelope await read lock");const e=await this._store.lock.readLock();y("getRawEnvelope got read lock");try{return(await this._store.load(t)).peerRecordEnvelope}catch(r){if(r.code!==a.ERR_NOT_FOUND)throw r}finally{y("getRawEnvelope release read lock"),e()}}async getPeerRecord(t){const e=await this.getRawEnvelope(t);if(e)return c.createFromProtobuf(e)}async get(t){if(!s.isPeerId(t))throw y.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),a.ERR_INVALID_PARAMETERS);y("get wait for read lock");const e=await this._store.lock.readLock();y("get got read lock");try{return(await this._store.load(t)).addresses}catch(r){if(r.code!==a.ERR_NOT_FOUND)throw r}finally{y("get release read lock"),e()}return[]}async set(t,e){if(!s.isPeerId(t))throw y.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),a.ERR_INVALID_PARAMETERS);if(!Array.isArray(e))throw y.error("multiaddrs must be an array of Multiaddrs"),i(new Error("multiaddrs must be an array of Multiaddrs"),a.ERR_INVALID_PARAMETERS);y("set await write lock");const r=await this._store.lock.writeLock();y("set got write lock");let n,o=!1;try{const i=await m(t,e,this._addressFilter);if(!i.length)return;try{const e=await this._store.load(t);if(o=!0,new Set([...i.map((t=>{let{multiaddr:e}=t;return e.toString()})),...e.addresses.map((t=>{let{multiaddr:e}=t;return e.toString()}))]).size===e.addresses.length&&i.length===e.addresses.length)return}catch(u){if(u.code!==a.ERR_NOT_FOUND)throw u}n=await this._store.patchOrCreate(t,{addresses:i}),y("set multiaddrs for ".concat(t.toB58String()))}finally{y("set release write lock"),r()}this._emit(g,{peerId:t,multiaddrs:n.addresses.map((t=>t.multiaddr))}),o||this._emit("peer",t)}async add(t,e){if(!s.isPeerId(t))throw y.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),a.ERR_INVALID_PARAMETERS);if(!Array.isArray(e))throw y.error("multiaddrs must be an array of Multiaddrs"),i(new Error("multiaddrs must be an array of Multiaddrs"),a.ERR_INVALID_PARAMETERS);y("add await write lock");const r=await this._store.lock.writeLock();let n,o;y("add got write lock");try{const i=await m(t,e,this._addressFilter);if(!i.length)return;try{const e=await this._store.load(t);if(n=!0,new Set([...i.map((t=>{let{multiaddr:e}=t;return e.toString()})),...e.addresses.map((t=>{let{multiaddr:e}=t;return e.toString()}))]).size===e.addresses.length)return}catch(u){if(u.code!==a.ERR_NOT_FOUND)throw u}o=await this._store.mergeOrCreate(t,{addresses:i}),y("added multiaddrs for ".concat(t.toB58String()))}finally{y("set release write lock"),r()}this._emit(g,{peerId:t,multiaddrs:o.addresses.map((t=>t.multiaddr))}),n||this._emit("peer",t)}async delete(t){if(!s.isPeerId(t))throw y.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),a.ERR_INVALID_PARAMETERS);y("delete await write lock");const e=await this._store.lock.writeLock();let r;y("delete got write lock");try{r=await this._store.has(t),await this._store.patchOrCreate(t,{addresses:[]})}finally{y("delete release write lock"),e()}r&&this._emit(g,{peerId:t,multiaddrs:[]})}async getMultiaddrsForPeer(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t)(await this.get(t)).map((e=>{const r=e.multiaddr,n=r.getPeerId();return n&&n===t.toB58String()?r:r.encapsulate("/p2p/".concat(t.toB58String()))}))}}},47299:(t,e,r)=>{"use strict";const n=r(18392),{EventEmitter:i}=r(47465),o=r(2674),s=r(60761),a=r(50684),u=r(18383),c=r(50774),l=Object.assign(n("libp2p:peer-store"),{error:n("libp2p:peer-store:err")});t.exports=class extends i{constructor(t){let{peerId:e,datastore:r,addressFilter:n}=t;super(),this._peerId=e,this._store=new c(r),this.addressBook=new o(this.emit.bind(this),this._store,n),this.keyBook=new s(this.emit.bind(this),this._store),this.metadataBook=new a(this.emit.bind(this),this._store),this.protoBook=new u(this.emit.bind(this),this._store)}async*getPeers(){l("getPeers await read lock");const t=await this._store.lock.readLock();l("getPeers got read lock");try{for await(const t of this._store.all())t.id.toB58String()!==this._peerId.toB58String()&&(yield t)}finally{l("getPeers release read lock"),t()}}async delete(t){l("delete await write lock");const e=await this._store.lock.writeLock();l("delete got write lock");try{await this._store.delete(t)}finally{l("delete release write lock"),e()}}async get(t){l("get await read lock");const e=await this._store.lock.readLock();l("get got read lock");try{return this._store.load(t)}finally{l("get release read lock"),e()}}async has(t){l("has await read lock");const e=await this._store.lock.readLock();l("has got read lock");try{return this._store.has(t)}finally{l("has release read lock"),e()}}}},60761:(t,e,r)=>{"use strict";const n=r(18392),i=r(67963),{codes:o}=r(59087),s=r(90190),{equals:a}=r(98779),u=Object.assign(n("libp2p:peer-store:key-book"),{error:n("libp2p:peer-store:key-book:err")}),c="change:pubkey";t.exports=class{constructor(t,e){this._emit=t,this._store=e}async set(t,e){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);if(!e)throw u.error("publicKey must be an instance of PublicKey to store data"),i(new Error("publicKey must be an instance of PublicKey"),o.ERR_INVALID_PARAMETERS);u("set await write lock");const r=await this._store.lock.writeLock();u("set got write lock");let n=!1;try{try{const r=await this._store.load(t);if(r.pubKey&&a(r.pubKey.bytes,e.bytes))return}catch(l){if(l.code!==o.ERR_NOT_FOUND)throw l}await this._store.patchOrCreate(t,{pubKey:e}),n=!0}finally{u("set release write lock"),r()}n&&this._emit(c,{peerId:t,pubKey:e})}async get(t){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);u("get await write lock");const e=await this._store.lock.readLock();u("get got write lock");try{return(await this._store.load(t)).pubKey}catch(r){if(r.code!==o.ERR_NOT_FOUND)throw r}finally{u("get release write lock"),e()}}async delete(t){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);u("delete await write lock");const e=await this._store.lock.writeLock();u("delete got write lock");try{await this._store.patchOrCreate(t,{pubKey:void 0})}finally{u("delete release write lock"),e()}this._emit(c,{peerId:t,pubKey:void 0})}}},50684:(t,e,r)=>{"use strict";const n=r(18392),i=r(67963),{codes:o}=r(59087),s=r(90190),{equals:a}=r(98779),u=Object.assign(n("libp2p:peer-store:metadata-book"),{error:n("libp2p:peer-store:metadata-book:err")}),c="change:metadata";t.exports=class{constructor(t,e){this._emit=t,this._store=e}async get(t){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);u("get await read lock");const e=await this._store.lock.readLock();u("get got read lock");try{return(await this._store.load(t)).metadata}catch(r){if(r.code!==o.ERR_NOT_FOUND)throw r}finally{u("get release read lock"),e()}return new Map}async getValue(t,e){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);u("getValue await read lock");const r=await this._store.lock.readLock();u("getValue got read lock");try{return(await this._store.load(t)).metadata.get(e)}catch(n){if(n.code!==o.ERR_NOT_FOUND)throw n}finally{u("getValue release write lock"),r()}}async set(t,e){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);if(!e||!(e instanceof Map))throw u.error("valid metadata must be provided to store data"),i(new Error("valid metadata must be provided"),o.ERR_INVALID_PARAMETERS);u("set await write lock");const r=await this._store.lock.writeLock();u("set got write lock");try{await this._store.mergeOrCreate(t,{metadata:e})}finally{u("set release write lock"),r()}this._emit(c,{peerId:t,metadata:e})}async setValue(t,e,r){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);if("string"!==typeof e||!(r instanceof Uint8Array))throw u.error("valid key and value must be provided to store data"),i(new Error("valid key and value must be provided"),o.ERR_INVALID_PARAMETERS);u("setValue await write lock");const n=await this._store.lock.writeLock();let l;u("setValue got write lock");try{try{const n=(await this._store.load(t)).metadata.get(e);if(null!=n&&a(r,n))return}catch(h){if(h.code!==o.ERR_NOT_FOUND)throw h}l=await this._store.mergeOrCreate(t,{metadata:new Map([[e,r]])})}finally{u("setValue release write lock"),n()}this._emit(c,{peerId:t,metadata:l.metadata})}async delete(t){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);u("delete await write lock");const e=await this._store.lock.writeLock();let r;u("delete got write lock");try{r=await this._store.has(t),r&&await this._store.patch(t,{metadata:new Map})}finally{u("delete release write lock"),e()}r&&this._emit(c,{peerId:t,metadata:new Map})}async deleteValue(t,e){if(!s.isPeerId(t))throw u.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);u("deleteValue await write lock");const r=await this._store.lock.writeLock();let n;u("deleteValue got write lock");try{n=(await this._store.load(t)).metadata,n.delete(e),await this._store.patch(t,{metadata:n})}catch(a){if(a.code!==o.ERR_NOT_FOUND)throw a}finally{u("deleteValue release write lock"),r()}n&&this._emit(c,{peerId:t,metadata:n})}}},6716:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer"]||(n.roots["libp2p-peer"]={});a.Peer=function(){function t(t){if(this.addresses=[],this.protocols=[],this.metadata=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var e;return t.prototype.addresses=s.emptyArray,t.prototype.protocols=s.emptyArray,t.prototype.metadata=s.emptyArray,t.prototype.pubKey=null,t.prototype.peerRecordEnvelope=null,Object.defineProperty(t.prototype,"_pubKey",{get:s.oneOfGetter(e=["pubKey"]),set:s.oneOfSetter(e)}),Object.defineProperty(t.prototype,"_peerRecordEnvelope",{get:s.oneOfGetter(e=["peerRecordEnvelope"]),set:s.oneOfSetter(e)}),t.encode=function(t,e){if(e||(e=o.create()),null!=t.addresses&&t.addresses.length)for(var r=0;r<t.addresses.length;++r)a.Address.encode(t.addresses[r],e.uint32(10).fork()).ldelim();if(null!=t.protocols&&t.protocols.length)for(r=0;r<t.protocols.length;++r)e.uint32(18).string(t.protocols[r]);if(null!=t.metadata&&t.metadata.length)for(r=0;r<t.metadata.length;++r)a.Metadata.encode(t.metadata[r],e.uint32(26).fork()).ldelim();return null!=t.pubKey&&Object.hasOwnProperty.call(t,"pubKey")&&e.uint32(34).bytes(t.pubKey),null!=t.peerRecordEnvelope&&Object.hasOwnProperty.call(t,"peerRecordEnvelope")&&e.uint32(42).bytes(t.peerRecordEnvelope),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.Peer;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.addresses&&n.addresses.length||(n.addresses=[]),n.addresses.push(a.Address.decode(t,t.uint32()));break;case 2:n.protocols&&n.protocols.length||(n.protocols=[]),n.protocols.push(t.string());break;case 3:n.metadata&&n.metadata.length||(n.metadata=[]),n.metadata.push(a.Metadata.decode(t,t.uint32()));break;case 4:n.pubKey=t.bytes();break;case 5:n.peerRecordEnvelope=t.bytes();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.Peer)return t;var e=new a.Peer;if(t.addresses){if(!Array.isArray(t.addresses))throw TypeError(".Peer.addresses: array expected");e.addresses=[];for(var r=0;r<t.addresses.length;++r){if("object"!==typeof t.addresses[r])throw TypeError(".Peer.addresses: object expected");e.addresses[r]=a.Address.fromObject(t.addresses[r])}}if(t.protocols){if(!Array.isArray(t.protocols))throw TypeError(".Peer.protocols: array expected");e.protocols=[];for(r=0;r<t.protocols.length;++r)e.protocols[r]=String(t.protocols[r])}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".Peer.metadata: array expected");e.metadata=[];for(r=0;r<t.metadata.length;++r){if("object"!==typeof t.metadata[r])throw TypeError(".Peer.metadata: object expected");e.metadata[r]=a.Metadata.fromObject(t.metadata[r])}}return null!=t.pubKey&&("string"===typeof t.pubKey?s.base64.decode(t.pubKey,e.pubKey=s.newBuffer(s.base64.length(t.pubKey)),0):t.pubKey.length&&(e.pubKey=t.pubKey)),null!=t.peerRecordEnvelope&&("string"===typeof t.peerRecordEnvelope?s.base64.decode(t.peerRecordEnvelope,e.peerRecordEnvelope=s.newBuffer(s.base64.length(t.peerRecordEnvelope)),0):t.peerRecordEnvelope.length&&(e.peerRecordEnvelope=t.peerRecordEnvelope)),e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.addresses=[],r.protocols=[],r.metadata=[]),t.addresses&&t.addresses.length){r.addresses=[];for(var n=0;n<t.addresses.length;++n)r.addresses[n]=a.Address.toObject(t.addresses[n],e)}if(t.protocols&&t.protocols.length){r.protocols=[];for(n=0;n<t.protocols.length;++n)r.protocols[n]=t.protocols[n]}if(t.metadata&&t.metadata.length){r.metadata=[];for(n=0;n<t.metadata.length;++n)r.metadata[n]=a.Metadata.toObject(t.metadata[n],e)}return null!=t.pubKey&&t.hasOwnProperty("pubKey")&&(r.pubKey=e.bytes===String?s.base64.encode(t.pubKey,0,t.pubKey.length):e.bytes===Array?Array.prototype.slice.call(t.pubKey):t.pubKey,e.oneofs&&(r._pubKey="pubKey")),null!=t.peerRecordEnvelope&&t.hasOwnProperty("peerRecordEnvelope")&&(r.peerRecordEnvelope=e.bytes===String?s.base64.encode(t.peerRecordEnvelope,0,t.peerRecordEnvelope.length):e.bytes===Array?Array.prototype.slice.call(t.peerRecordEnvelope):t.peerRecordEnvelope,e.oneofs&&(r._peerRecordEnvelope="peerRecordEnvelope")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),a.Address=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}var e;return t.prototype.multiaddr=s.newBuffer([]),t.prototype.isCertified=null,Object.defineProperty(t.prototype,"_isCertified",{get:s.oneOfGetter(e=["isCertified"]),set:s.oneOfSetter(e)}),t.encode=function(t,e){return e||(e=o.create()),null!=t.multiaddr&&Object.hasOwnProperty.call(t,"multiaddr")&&e.uint32(10).bytes(t.multiaddr),null!=t.isCertified&&Object.hasOwnProperty.call(t,"isCertified")&&e.uint32(16).bool(t.isCertified),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.Address;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.multiaddr=t.bytes();break;case 2:n.isCertified=t.bool();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.Address)return t;var e=new a.Address;return null!=t.multiaddr&&("string"===typeof t.multiaddr?s.base64.decode(t.multiaddr,e.multiaddr=s.newBuffer(s.base64.length(t.multiaddr)),0):t.multiaddr.length&&(e.multiaddr=t.multiaddr)),null!=t.isCertified&&(e.isCertified=Boolean(t.isCertified)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.multiaddr="":(r.multiaddr=[],e.bytes!==Array&&(r.multiaddr=s.newBuffer(r.multiaddr)))),null!=t.multiaddr&&t.hasOwnProperty("multiaddr")&&(r.multiaddr=e.bytes===String?s.base64.encode(t.multiaddr,0,t.multiaddr.length):e.bytes===Array?Array.prototype.slice.call(t.multiaddr):t.multiaddr),null!=t.isCertified&&t.hasOwnProperty("isCertified")&&(r.isCertified=t.isCertified,e.oneofs&&(r._isCertified="isCertified")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),a.Metadata=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.key="",t.prototype.value=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&e.uint32(10).string(t.key),null!=t.value&&Object.hasOwnProperty.call(t,"value")&&e.uint32(18).bytes(t.value),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.Metadata;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.key=t.string();break;case 2:n.value=t.bytes();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.Metadata)return t;var e=new a.Metadata;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&("string"===typeof t.value?s.base64.decode(t.value,e.value=s.newBuffer(s.base64.length(t.value)),0):t.value.length&&(e.value=t.value)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.key="",e.bytes===String?r.value="":(r.value=[],e.bytes!==Array&&(r.value=s.newBuffer(r.value)))),null!=t.key&&t.hasOwnProperty("key")&&(r.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(r.value=e.bytes===String?s.base64.encode(t.value,0,t.value.length):e.bytes===Array?Array.prototype.slice.call(t.value):t.value),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t.exports=a},18383:(t,e,r)=>{"use strict";const n=r(18392),i=r(67963),{codes:o}=r(59087),s=r(90190),a=Object.assign(n("libp2p:peer-store:proto-book"),{error:n("libp2p:peer-store:proto-book:err")}),u="change:protocols";t.exports=class{constructor(t,e){this._emit=t,this._store=e}async get(t){a("get wait for read lock");const e=await this._store.lock.readLock();a("get got read lock");try{return(await this._store.load(t)).protocols}catch(r){if(r.code!==o.ERR_NOT_FOUND)throw r}finally{a("get release read lock"),e()}return[]}async set(t,e){if(!s.isPeerId(t))throw a.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);if(!Array.isArray(e))throw a.error("protocols must be provided to store data"),i(new Error("protocols must be provided"),o.ERR_INVALID_PARAMETERS);a("set await write lock");const r=await this._store.lock.writeLock();let n;a("set got write lock");try{try{const r=await this._store.load(t);if(new Set([...e]).size===r.protocols.length)return}catch(c){if(c.code!==o.ERR_NOT_FOUND)throw c}n=await this._store.patchOrCreate(t,{protocols:e}),a("stored provided protocols for ".concat(t.toB58String()))}finally{a("set release write lock"),r()}this._emit(u,{peerId:t,protocols:n.protocols})}async add(t,e){if(!s.isPeerId(t))throw a.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);if(!Array.isArray(e))throw a.error("protocols must be provided to store data"),i(new Error("protocols must be provided"),o.ERR_INVALID_PARAMETERS);a("add await write lock");const r=await this._store.lock.writeLock();let n;a("add got write lock");try{try{const r=await this._store.load(t);if(new Set([...r.protocols,...e]).size===r.protocols.length)return}catch(c){if(c.code!==o.ERR_NOT_FOUND)throw c}n=await this._store.mergeOrCreate(t,{protocols:e}),a("added provided protocols for ".concat(t.toB58String()))}finally{a("add release write lock"),r()}this._emit(u,{peerId:t,protocols:n.protocols})}async remove(t,e){if(!s.isPeerId(t))throw a.error("peerId must be an instance of peer-id to store data"),i(new Error("peerId must be an instance of peer-id"),o.ERR_INVALID_PARAMETERS);if(!Array.isArray(e))throw a.error("protocols must be provided to store data"),i(new Error("protocols must be provided"),o.ERR_INVALID_PARAMETERS);a("remove await write lock");const r=await this._store.lock.writeLock();let n;a("remove got write lock");try{try{const r=await this._store.load(t),n=new Set(r.protocols);for(const t of e)n.delete(t);if(r.protocols.length===n.size)return;e=Array.from(n)}catch(c){if(c.code!==o.ERR_NOT_FOUND)throw c}n=await this._store.patchOrCreate(t,{protocols:e})}finally{a("remove release write lock"),r()}this._emit(u,{peerId:t,protocols:n.protocols})}async delete(t){a("delete await write lock");const e=await this._store.lock.writeLock();let r;a("delete got write lock");try{r=await this._store.has(t),await this._store.patchOrCreate(t,{protocols:[]})}catch(n){if(n.code!==o.ERR_NOT_FOUND)throw n}finally{a("delete release write lock"),e()}r&&this._emit(u,{peerId:t,protocols:[]})}}},50774:(t,e,r)=>{"use strict";const n=r(18392),i=r(90190),o=r(67963),{codes:s}=r(59087),{Key:a}=r(3450),{base32:u}=r(71128),{keys:{unmarshalPublicKey:c,marshalPublicKey:l}}=r(25504),{Multiaddr:h}=r(98719),{Peer:f}=r(6716),d=r(31127),{equals:p}=r(98779),y=Object.assign(n("libp2p:peer-store:store"),{error:n("libp2p:peer-store:store:err")}),g="/peers/";t.exports=class{constructor(t){this._datastore=t,this.lock=d("peer-store",{singleProcess:!0})}_peerIdToDatastoreKey(t){if(!i.isPeerId(t))throw y.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),s.ERR_INVALID_PARAMETERS);const e=t.toString();return new a("".concat(g).concat(e))}async has(t){return this._datastore.has(this._peerIdToDatastoreKey(t))}async delete(t){await this._datastore.delete(this._peerIdToDatastoreKey(t))}async load(t){const e=await this._datastore.get(this._peerIdToDatastoreKey(t)),r=f.decode(e),n=r.pubKey?c(r.pubKey):t.pubKey,i=new Map;for(const o of r.metadata)i.set(o.key,o.value);return{...r,id:t,pubKey:n,addresses:r.addresses.map((t=>{let{multiaddr:e,isCertified:r}=t;return{multiaddr:new h(e),isCertified:r||!1}})),metadata:i,peerRecordEnvelope:r.peerRecordEnvelope||void 0}}async save(t){if(null!=t.pubKey&&null!=t.id.pubKey&&!p(t.pubKey.bytes,t.id.pubKey.bytes))throw y.error("peer publicKey bytes do not match peer id publicKey bytes"),o(new Error("publicKey bytes do not match peer id publicKey bytes"),s.ERR_INVALID_PARAMETERS);const e=new Set,r=f.encode({addresses:t.addresses.filter((t=>!e.has(t.multiaddr.toString())&&(e.add(t.multiaddr.toString()),!0))).sort(((t,e)=>t.multiaddr.toString().localeCompare(e.multiaddr.toString()))).map((t=>{let{multiaddr:e,isCertified:r}=t;return{multiaddr:e.bytes,isCertified:r}})),protocols:t.protocols.sort(),pubKey:t.pubKey?l(t.pubKey):void 0,metadata:[...t.metadata.keys()].sort().map((e=>({key:e,value:t.metadata.get(e)}))),peerRecordEnvelope:t.peerRecordEnvelope}).finish();return await this._datastore.put(this._peerIdToDatastoreKey(t.id),r),this.load(t.id)}async patch(t,e){const r=await this.load(t);return await this._patch(t,e,r)}async patchOrCreate(t,e){let r;try{r=await this.load(t)}catch(n){if(n.code!==s.ERR_NOT_FOUND)throw n;r={id:t,addresses:[],protocols:[],metadata:new Map}}return await this._patch(t,e,r)}async _patch(t,e,r){return await this.save({...r,...e,id:t})}async merge(t,e){const r=await this.load(t);return this._merge(t,e,r)}async mergeOrCreate(t,e){let r;try{r=await this.load(t)}catch(n){if(n.code!==s.ERR_NOT_FOUND)throw n;r={id:t,addresses:[],protocols:[],metadata:new Map}}return await this._merge(t,e,r)}async _merge(t,e,r){const n=new Map;return(e.addresses||[]).forEach((t=>{n.set(t.multiaddr.toString(),t.isCertified)})),r.addresses.forEach((t=>{let{multiaddr:e,isCertified:r}=t;const i=e.toString();n.set(i,Boolean(n.get(i)||r))})),await this.save({id:t,addresses:Array.from(n.entries()).map((t=>{let[e,r]=t;return{multiaddr:new h(e),isCertified:r}})),protocols:Array.from(new Set([...r.protocols||[],...e.protocols||[]])),metadata:new Map([...r.metadata?r.metadata.entries():[],...e.metadata?e.metadata.entries():[]]),pubKey:e.pubKey||(null!=r?r.pubKey:void 0),peerRecordEnvelope:e.peerRecordEnvelope||(null!=r?r.peerRecordEnvelope:void 0)})}async*all(){for await(const t of this._datastore.queryKeys({prefix:g})){const e=t.toString().split("/")[2],r=u.decode(e);yield this.load(i.createFromBytes(r))}}}},66350:t=>{"use strict";t.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32,PROTOCOL_VERSION:"1.0.0",PROTOCOL_NAME:"ping"}},66321:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:ping"),{error:n("libp2p:ping:err")}),o=r(67963),{codes:s}=r(59087),a=r(25504),{pipe:u}=r(79023),{toBuffer:c}=r(90351),{collect:l,take:h}=r(79755),{equals:f}=r(98779),{PROTOCOL_NAME:d,PING_LENGTH:p,PROTOCOL_VERSION:y}=r(66350);t.exports=class{static getProtocolStr(t){return"/".concat(t._config.protocolPrefix,"/").concat(d,"/").concat(y)}constructor(t){this._libp2p=t}handleMessage(t){let{stream:e}=t;return u(e,e)}async ping(t){const e="/".concat(this._libp2p._config.protocolPrefix,"/").concat(d,"/").concat(y);i("dialing %s to %s",e,t.toB58String?t.toB58String():t);const r=await this._libp2p.dial(t),{stream:n}=await r.newStream(e),g=Date.now(),m=a.randomBytes(p),[b]=await u([m],n,(t=>h(1,t)),c,l),v=Date.now();if(!f(m,b))throw o(new Error("Received wrong ping ack"),s.ERR_WRONG_PING_ACK);return v-g}}},88694:t=>{"use strict";t.exports=function(t,e,r){const n=new t(e,r);return n._subscribeAdapter=n.subscribe,n._unsubscribeAdapter=n.unsubscribe,n.subscribe=function(t,e){e&&n.on(t,e),n._subscribeAdapter(t)},n.unsubscribe=function(t,e){e?n.removeListener(t,e):n.removeAllListeners(t),0===n.listenerCount(t)&&n._unsubscribeAdapter(t)},n}},91282:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-envelope"]||(n.roots["libp2p-envelope"]={});a.Envelope=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.publicKey=s.newBuffer([]),t.prototype.payloadType=s.newBuffer([]),t.prototype.payload=s.newBuffer([]),t.prototype.signature=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),null!=t.publicKey&&Object.hasOwnProperty.call(t,"publicKey")&&e.uint32(10).bytes(t.publicKey),null!=t.payloadType&&Object.hasOwnProperty.call(t,"payloadType")&&e.uint32(18).bytes(t.payloadType),null!=t.payload&&Object.hasOwnProperty.call(t,"payload")&&e.uint32(26).bytes(t.payload),null!=t.signature&&Object.hasOwnProperty.call(t,"signature")&&e.uint32(42).bytes(t.signature),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.Envelope;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.publicKey=t.bytes();break;case 2:n.payloadType=t.bytes();break;case 3:n.payload=t.bytes();break;case 5:n.signature=t.bytes();break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.Envelope)return t;var e=new a.Envelope;return null!=t.publicKey&&("string"===typeof t.publicKey?s.base64.decode(t.publicKey,e.publicKey=s.newBuffer(s.base64.length(t.publicKey)),0):t.publicKey.length&&(e.publicKey=t.publicKey)),null!=t.payloadType&&("string"===typeof t.payloadType?s.base64.decode(t.payloadType,e.payloadType=s.newBuffer(s.base64.length(t.payloadType)),0):t.payloadType.length&&(e.payloadType=t.payloadType)),null!=t.payload&&("string"===typeof t.payload?s.base64.decode(t.payload,e.payload=s.newBuffer(s.base64.length(t.payload)),0):t.payload.length&&(e.payload=t.payload)),null!=t.signature&&("string"===typeof t.signature?s.base64.decode(t.signature,e.signature=s.newBuffer(s.base64.length(t.signature)),0):t.signature.length&&(e.signature=t.signature)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.publicKey="":(r.publicKey=[],e.bytes!==Array&&(r.publicKey=s.newBuffer(r.publicKey))),e.bytes===String?r.payloadType="":(r.payloadType=[],e.bytes!==Array&&(r.payloadType=s.newBuffer(r.payloadType))),e.bytes===String?r.payload="":(r.payload=[],e.bytes!==Array&&(r.payload=s.newBuffer(r.payload))),e.bytes===String?r.signature="":(r.signature=[],e.bytes!==Array&&(r.signature=s.newBuffer(r.signature)))),null!=t.publicKey&&t.hasOwnProperty("publicKey")&&(r.publicKey=e.bytes===String?s.base64.encode(t.publicKey,0,t.publicKey.length):e.bytes===Array?Array.prototype.slice.call(t.publicKey):t.publicKey),null!=t.payloadType&&t.hasOwnProperty("payloadType")&&(r.payloadType=e.bytes===String?s.base64.encode(t.payloadType,0,t.payloadType.length):e.bytes===Array?Array.prototype.slice.call(t.payloadType):t.payloadType),null!=t.payload&&t.hasOwnProperty("payload")&&(r.payload=e.bytes===String?s.base64.encode(t.payload,0,t.payload.length):e.bytes===Array?Array.prototype.slice.call(t.payload):t.payload),null!=t.signature&&t.hasOwnProperty("signature")&&(r.signature=e.bytes===String?s.base64.encode(t.signature,0,t.signature.length):e.bytes===Array?Array.prototype.slice.call(t.signature):t.signature),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t.exports=a},76869:(t,e,r)=>{"use strict";const n=r(67963),{concat:i}=r(62110),{fromString:o}=r(46765),s=r(36552),a=r(90190),u=r(74561),{equals:c}=r(98779),{codes:l}=r(59087),{Envelope:h}=r(91282);class f{constructor(t){let{peerId:e,payloadType:r,payload:n,signature:i}=t;this.peerId=e,this.payloadType=r,this.payload=n,this.signature=i,this._marshal=void 0}marshal(){if(this._marshal)return this._marshal;const t=s.marshalPublicKey(this.peerId.pubKey);return this._marshal=h.encode({publicKey:t,payloadType:this.payloadType,payload:this.payload,signature:this.signature}).finish(),this._marshal}equals(t){return c(this.peerId.pubKey.bytes,t.peerId.pubKey.bytes)&&c(this.payloadType,t.payloadType)&&c(this.payload,t.payload)&&c(this.signature,t.signature)}validate(t){const e=d(t,this.payloadType,this.payload);return this.peerId.pubKey.verify(e,this.signature)}}const d=(t,e,r)=>{const n=o(t),s=u.encode(n.byteLength),a=u.encode(e.length),c=u.encode(r.length);return i([new Uint8Array(s),n,new Uint8Array(a),e,new Uint8Array(c),r])};f.createFromProtobuf=async t=>{const e=h.decode(t),r=await a.createFromPubKey(e.publicKey);return new f({peerId:r,payloadType:e.payloadType,payload:e.payload,signature:e.signature})},f.seal=async(t,e)=>{const r=t.domain,n=t.codec,i=t.marshal(),o=d(r,n,i),s=await e.privKey.sign(o);return new f({peerId:e,payloadType:n,payload:i,signature:s})},f.openAndCertify=async(t,e)=>{const r=await f.createFromProtobuf(t);if(!await r.validate(e))throw n(new Error("envelope signature is not valid for the given domain"),l.ERR_SIGNATURE_NOT_VALID);return r},t.exports=f},6173:t=>{"use strict";const e=Uint8Array.from([3,1]);t.exports={ENVELOPE_DOMAIN_PEER_RECORD:"libp2p-peer-record",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD:e}},73374:(t,e,r)=>{"use strict";const{Multiaddr:n}=r(98719),i=r(90190),o=r(80710),{PeerRecord:s}=r(73077),{ENVELOPE_DOMAIN_PEER_RECORD:a,ENVELOPE_PAYLOAD_TYPE_PEER_RECORD:u}=r(6173);class c{constructor(t){let{peerId:e,multiaddrs:r=[],seqNumber:n=Date.now()}=t;this.domain=a,this.codec=u,this.peerId=e,this.multiaddrs=r,this.seqNumber=n,this._marshal=void 0}marshal(){return this._marshal||(this._marshal=s.encode({peerId:this.peerId.toBytes(),seq:this.seqNumber,addresses:this.multiaddrs.map((t=>({multiaddr:t.bytes})))}).finish()),this._marshal}equals(t){return t instanceof c&&(!!this.peerId.equals(t.peerId)&&(this.seqNumber===t.seqNumber&&!!o(this.multiaddrs,t.multiaddrs)))}}c.createFromProtobuf=t=>{const e=s.decode(t),r=i.createFromBytes(e.peerId),o=(e.addresses||[]).map((t=>new n(t.multiaddr))),a=Number(e.seq);return new c({peerId:r,multiaddrs:o,seqNumber:a})},c.DOMAIN=a,t.exports=c},73077:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-record"]||(n.roots["libp2p-peer-record"]={});a.PeerRecord=function(){function t(t){if(this.addresses=[],t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.peerId=s.newBuffer([]),t.prototype.seq=s.Long?s.Long.fromBits(0,0,!0):0,t.prototype.addresses=s.emptyArray,t.encode=function(t,e){if(e||(e=o.create()),null!=t.peerId&&Object.hasOwnProperty.call(t,"peerId")&&e.uint32(10).bytes(t.peerId),null!=t.seq&&Object.hasOwnProperty.call(t,"seq")&&e.uint32(16).uint64(t.seq),null!=t.addresses&&t.addresses.length)for(var r=0;r<t.addresses.length;++r)a.PeerRecord.AddressInfo.encode(t.addresses[r],e.uint32(26).fork()).ldelim();return e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.PeerRecord;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.peerId=t.bytes();break;case 2:n.seq=t.uint64();break;case 3:n.addresses&&n.addresses.length||(n.addresses=[]),n.addresses.push(a.PeerRecord.AddressInfo.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return n},t.fromObject=function(t){if(t instanceof a.PeerRecord)return t;var e=new a.PeerRecord;if(null!=t.peerId&&("string"===typeof t.peerId?s.base64.decode(t.peerId,e.peerId=s.newBuffer(s.base64.length(t.peerId)),0):t.peerId.length&&(e.peerId=t.peerId)),null!=t.seq&&(s.Long?(e.seq=s.Long.fromValue(t.seq)).unsigned=!0:"string"===typeof t.seq?e.seq=parseInt(t.seq,10):"number"===typeof t.seq?e.seq=t.seq:"object"===typeof t.seq&&(e.seq=new s.LongBits(t.seq.low>>>0,t.seq.high>>>0).toNumber(!0))),t.addresses){if(!Array.isArray(t.addresses))throw TypeError(".PeerRecord.addresses: array expected");e.addresses=[];for(var r=0;r<t.addresses.length;++r){if("object"!==typeof t.addresses[r])throw TypeError(".PeerRecord.addresses: object expected");e.addresses[r]=a.PeerRecord.AddressInfo.fromObject(t.addresses[r])}}return e},t.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.addresses=[]),e.defaults)if(e.bytes===String?r.peerId="":(r.peerId=[],e.bytes!==Array&&(r.peerId=s.newBuffer(r.peerId))),s.Long){var n=new s.Long(0,0,!0);r.seq=e.longs===String?n.toString():e.longs===Number?n.toNumber():n}else r.seq=e.longs===String?"0":0;if(null!=t.peerId&&t.hasOwnProperty("peerId")&&(r.peerId=e.bytes===String?s.base64.encode(t.peerId,0,t.peerId.length):e.bytes===Array?Array.prototype.slice.call(t.peerId):t.peerId),null!=t.seq&&t.hasOwnProperty("seq")&&("number"===typeof t.seq?r.seq=e.longs===String?String(t.seq):t.seq:r.seq=e.longs===String?s.Long.prototype.toString.call(t.seq):e.longs===Number?new s.LongBits(t.seq.low>>>0,t.seq.high>>>0).toNumber(!0):t.seq),t.addresses&&t.addresses.length){r.addresses=[];for(var i=0;i<t.addresses.length;++i)r.addresses[i]=a.PeerRecord.AddressInfo.toObject(t.addresses[i],e)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t.AddressInfo=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.multiaddr=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),null!=t.multiaddr&&Object.hasOwnProperty.call(t,"multiaddr")&&e.uint32(10).bytes(t.multiaddr),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.PeerRecord.AddressInfo;t.pos<r;){var o=t.uint32();if(o>>>3===1)n.multiaddr=t.bytes();else t.skipType(7&o)}return n},t.fromObject=function(t){if(t instanceof a.PeerRecord.AddressInfo)return t;var e=new a.PeerRecord.AddressInfo;return null!=t.multiaddr&&("string"===typeof t.multiaddr?s.base64.decode(t.multiaddr,e.multiaddr=s.newBuffer(s.base64.length(t.multiaddr)),0):t.multiaddr.length&&(e.multiaddr=t.multiaddr)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.multiaddr="":(r.multiaddr=[],e.bytes!==Array&&(r.multiaddr=s.newBuffer(r.multiaddr)))),null!=t.multiaddr&&t.hasOwnProperty("multiaddr")&&(r.multiaddr=e.bytes===String?s.base64.encode(t.multiaddr,0,t.multiaddr.length):e.bytes===Array?Array.prototype.slice.call(t.multiaddr):t.multiaddr),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t}(),t.exports=a},17335:(t,e,r)=>{"use strict";const n=r(76869),i=r(73374);t.exports.updateSelfPeerRecord=async function(t){const e=new i({peerId:t.peerId,multiaddrs:t.multiaddrs}),r=await n.seal(e,t.peerId);await t.peerStore.addressBook.consumePeerRecord(r)}},9828:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:registrar"),{error:n("libp2p:registrar:err")}),o=r(67963),{codes:{ERR_INVALID_PARAMETERS:s}}=r(59087),a=r(59617);t.exports=class{constructor(t){let{peerStore:e,connectionManager:r}=t;this.peerStore=e,this.connectionManager=r,this.topologies=new Map,this._handle=void 0,this._onDisconnect=this._onDisconnect.bind(this),this.connectionManager.on("peer:disconnect",this._onDisconnect)}get handle(){return this._handle}set handle(t){this._handle=t}getConnection(t){return this.connectionManager.get(t)}async register(t){if(!a.isTopology(t))throw i.error("topology must be an instance of interfaces/topology"),o(new Error("topology must be an instance of interfaces/topology"),s);const e=(1e9*Math.random()).toString(36)+Date.now();return this.topologies.set(e,t),await t.setRegistrar(this),e}unregister(t){return this.topologies.delete(t)}_onDisconnect(t){for(const[,e]of this.topologies)e.disconnect(t.remotePeer)}}},48350:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:transports"),{error:n("libp2p:transports:err")}),o=r(3781),{codes:s}=r(59087),a=r(67963),{updateSelfPeerRecord:u}=r(17335);class c{constructor(t){let{libp2p:e,upgrader:r,faultTolerance:n=l.FATAL_ALL}=t;this.libp2p=e,this.upgrader=r,this._transports=new Map,this._listeners=new Map,this._listenerOptions=new Map,this.faultTolerance=n}add(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i("adding %s",t),!t)throw a(new Error("Transport must have a valid key, was given '".concat(t,"'")),s.ERR_INVALID_KEY);if(this._transports.has(t))throw a(new Error("There is already a transport with this key"),s.ERR_DUPLICATE_TRANSPORT);const n=new e({...r,libp2p:this.libp2p,upgrader:this.upgrader});this._transports.set(t,n),this._listenerOptions.set(t,r.listenerOptions||{}),this._listeners.has(t)||this._listeners.set(t,[])}async close(){const t=[];for(const[e,r]of this._listeners)for(i("closing listeners for %s",e);r.length;){const e=r.pop();e.removeAllListeners("listening"),e.removeAllListeners("close"),t.push(e.close())}await Promise.all(t),i("all listeners closed");for(const e of this._listeners.keys())this._listeners.set(e,[])}async dial(t,e){const r=this.transportForMultiaddr(t);if(!r)throw a(new Error("No transport available for address ".concat(String(t))),s.ERR_TRANSPORT_UNAVAILABLE);try{return await r.dial(t,e)}catch(n){throw n.code||(n.code=s.ERR_TRANSPORT_DIAL_FAILED),n}}getAddrs(){let t=[];for(const e of this._listeners.values())for(const r of e)t=[...t,...r.getAddrs()];return t}getTransports(){return this._transports.values()}transportForMultiaddr(t){for(const e of this._transports.values()){if(e.filter([t]).length)return e}return null}async listen(t){if(!t||0===t.length)return void i("no addresses were provided for listening, this node is dial only");const e=[];for(const[r,n]of this._transports.entries()){const c=n.filter(t),h=[];for(const t of c){i("creating listener for %s on %s",r,t);const e=n.createListener(this._listenerOptions.get(r));this._listeners.get(r).push(e),e.on("listening",(()=>u(this.libp2p))),e.on("close",(()=>u(this.libp2p))),h.push(e.listen(t))}if(0===h.length){e.push(r);continue}if(!(await o(h)).find((t=>!0===t.isFulfilled))&&this.faultTolerance!==l.NO_FATAL)throw a(new Error("Transport (".concat(r,") could not listen on any available address")),s.ERR_NO_VALID_ADDRESSES)}if(e.length===this._transports.size){const t="no valid addresses were provided for transports [".concat(e,"]");if(this.faultTolerance===l.FATAL_ALL)throw a(new Error(t),s.ERR_NO_VALID_ADDRESSES);i("libp2p in dial mode only: ".concat(t))}}async remove(t){if(i("removing %s",t),this._listeners.has(t))for(const e of this._listeners.get(t))e.removeAllListeners("listening"),e.removeAllListeners("close"),await e.close();this._transports.delete(t),this._listeners.delete(t)}async removeAll(){const t=[];for(const e of this._transports.keys())t.push(this.remove(e));await Promise.all(t)}}const l={FATAL_ALL:0,NO_FATAL:1};c.FaultTolerance=l,t.exports=c},59324:(t,e,r)=>{"use strict";const n=r(18392),i=Object.assign(n("libp2p:upgrader"),{error:n("libp2p:upgrader:err")}),o=r(67963),s=r(5889),{Connection:a}=r(4438),u=r(90190),{pipe:c}=r(79023),l=r(486),{codes:h}=r(59087);t.exports=class{constructor(t){let{localPeer:e,metrics:r,connectionGater:n,cryptos:i=new Map,muxers:o=new Map,onConnectionEnd:s=(()=>{}),onConnection:a=(()=>{})}=t;this.connectionGater=n,this.localPeer=e,this.metrics=r,this.cryptos=i,this.muxers=o,this.protector=null,this.protocols=new Map,this.onConnection=a,this.onConnectionEnd=s}async upgradeInbound(t){let e,r,n,s,a,u,c;if(await this.connectionGater.denyInboundConnection(t))throw o(new Error("The multiaddr connection is blocked by gater.acceptConnection"),h.ERR_CONNECTION_INTERCEPTED);if(this.metrics){({setTarget:u,proxy:c}=l());const e=(1e9*Math.random()).toString(36)+Date.now();u({toB58String:()=>e}),t=this.metrics.trackStream({stream:t,remotePeer:c})}i("Starting the inbound connection upgrade");let f=t;this.protector&&(f=await this.protector.protect(t));try{if(({conn:e,remotePeer:r,protocol:a}=await this._encryptInbound(this.localPeer,f,this.cryptos)),await this.connectionGater.denyInboundEncryptedConnection(r,e))throw o(new Error("The multiaddr connection is blocked by gater.acceptEncryptedConnection"),h.ERR_CONNECTION_INTERCEPTED);this.muxers.size?({stream:n,Muxer:s}=await this._multiplexInbound(e,this.muxers)):n=e}catch(d){throw i.error("Failed to upgrade inbound connection",d),await t.close(d),d}if(await this.connectionGater.denyInboundUpgradedConnection(r,e))throw o(new Error("The multiaddr connection is blocked by gater.acceptEncryptedConnection"),h.ERR_CONNECTION_INTERCEPTED);return this.metrics&&(this.metrics.updatePlaceholder(c,r),u(r)),i("Successfully upgraded inbound connection"),this._createConnection({cryptoProtocol:a,direction:"inbound",maConn:t,upgradedConn:n,Muxer:s,remotePeer:r})}async upgradeOutbound(t){const e=t.remoteAddr.getPeerId();if(!e)throw o(new Error("outbound connection must have a peer id"),h.ERR_INVALID_MULTIADDR);const r=u.createFromB58String(e);if(await this.connectionGater.denyOutboundConnection(r,t))throw o(new Error("The multiaddr connection is blocked by connectionGater.denyOutboundConnection"),h.ERR_CONNECTION_INTERCEPTED);let n,s,a,c,f,d,p;if(this.metrics){({setTarget:d,proxy:p}=l());const e=(1e9*Math.random()).toString(36)+Date.now();d({toB58String:()=>e}),t=this.metrics.trackStream({stream:t,remotePeer:p})}i("Starting the outbound connection upgrade");let y=t;this.protector&&(y=await this.protector.protect(t));try{if(({conn:n,remotePeer:s,protocol:c}=await this._encryptOutbound(this.localPeer,y,r,this.cryptos)),await this.connectionGater.denyOutboundEncryptedConnection(s,n))throw o(new Error("The multiaddr connection is blocked by gater.acceptEncryptedConnection"),h.ERR_CONNECTION_INTERCEPTED);this.muxers.size?({stream:a,Muxer:f}=await this._multiplexOutbound(n,this.muxers)):a=n}catch(g){throw i.error("Failed to upgrade outbound connection",g),await t.close(g),g}if(await this.connectionGater.denyOutboundUpgradedConnection(s,n))throw o(new Error("The multiaddr connection is blocked by gater.acceptEncryptedConnection"),h.ERR_CONNECTION_INTERCEPTED);return this.metrics&&(this.metrics.updatePlaceholder(p,s),d(s)),i("Successfully upgraded outbound connection"),this._createConnection({cryptoProtocol:c,direction:"outbound",maConn:t,upgradedConn:a,Muxer:f,remotePeer:s})}_createConnection(t){var e=this;let r,n,u,{cryptoProtocol:l,direction:f,maConn:d,upgradedConn:p,Muxer:y,remotePeer:g}=t;y&&(r=new y({onStream:async t=>{if(!u)return;const e=new s.Listener(t);try{const{stream:r,protocol:n}=await e.handle(Array.from(this.protocols.keys()));i("%s: incoming stream opened on %s",f,n),this.metrics&&this.metrics.trackStream({stream:r,remotePeer:g,protocol:n}),u.addStream(t,{protocol:n}),this._onStream({connection:u,stream:{...t,...r},protocol:n})}catch(r){i.error(r)}},onStreamEnd:t=>{u.removeStream(t.id)}}),n=async t=>{i("%s: starting new stream on %s",f,t);const e=r.newStream(),n=new s.Dialer(e);try{const{stream:r,protocol:i}=await n.select(t);return this.metrics&&this.metrics.trackStream({stream:r,remotePeer:g,protocol:i}),{stream:{...e,...r},protocol:i}}catch(a){throw i.error("could not create new stream",a),o(a,h.ERR_UNSUPPORTED_PROTOCOL)}},c(p,r,p).catch(i.error));const m=d.timeline;d.timeline=new Proxy(m,{set:function(){return u&&"close"===(arguments.length<=1?void 0:arguments[1])&&(arguments.length<=2?void 0:arguments[2])&&!m.close&&(async()=>{try{"open"===u.stat.status&&await u.close()}catch(t){i.error(t)}finally{e.onConnectionEnd(u)}})().catch((t=>{i.error(t)})),Reflect.set(...arguments)}}),d.timeline.upgraded=Date.now();const b=()=>{throw o(new Error("connection is not multiplexed"),h.ERR_CONNECTION_NOT_MULTIPLEXED)};return u=new a({localAddr:d.localAddr,remoteAddr:d.remoteAddr,localPeer:this.localPeer,remotePeer:g,stat:{direction:f,timeline:d.timeline,multiplexer:y&&y.multicodec,encryption:l},newStream:n||b,getStreams:()=>r?r.streams:b(),close:async()=>{await d.close(),r&&r.streams.map((t=>t.abort()))}}),this.onConnection(u),u}_onStream(t){let{connection:e,stream:r,protocol:n}=t;this.protocols.get(n)({connection:e,stream:r,protocol:n})}async _encryptInbound(t,e,r){const n=new s.Listener(e),a=Array.from(r.keys());i("handling inbound crypto protocol selection",a);try{const{stream:e,protocol:o}=await n.handle(a),s=r.get(o);if(i("encrypting inbound connection..."),!s)throw new Error("no crypto module found for ".concat(o));return{...await s.secureInbound(t,e),protocol:o}}catch(u){throw o(u,h.ERR_ENCRYPTION_FAILED)}}async _encryptOutbound(t,e,r,n){const a=new s.Dialer(e),u=Array.from(n.keys());i("selecting outbound crypto protocol",u);try{const{stream:e,protocol:o}=await a.select(u),s=n.get(o);if(i("encrypting outbound connection to %j",r),!s)throw new Error("no crypto module found for ".concat(o));return{...await s.secureOutbound(t,e,r),protocol:o}}catch(c){throw o(c,h.ERR_ENCRYPTION_FAILED)}}async _multiplexOutbound(t,e){const r=new s.Dialer(t),n=Array.from(e.keys());i("outbound selecting muxer %s",n);try{const{stream:t,protocol:o}=await r.select(n);i("%s selected as muxer protocol",o);return{stream:t,Muxer:e.get(o)}}catch(a){throw o(a,h.ERR_MUXER_UNAVAILABLE)}}async _multiplexInbound(t,e){const r=new s.Listener(t),n=Array.from(e.keys());i("inbound handling muxers %s",n);try{const{stream:t,protocol:i}=await r.handle(n);return{stream:t,Muxer:e.get(i)}}catch(a){throw o(a,h.ERR_MUXER_UNAVAILABLE)}}}},18987:t=>{t.exports=r;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(A){}function r(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function n(t){return!0===(t&&t.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},o={};function s(t,e){var r,n,s;return e?(s=0<=(t>>>=0)&&t<256)&&(n=o[t])?n:(r=u(t,(0|t)<0?-1:0,!0),s&&(o[t]=r),r):(s=-128<=(t|=0)&&t<128)&&(n=i[t])?n:(r=u(t,t<0?-1:0,!1),s&&(i[t]=r),r)}function a(t,e){if(isNaN(t))return e?m:g;if(e){if(t<0)return m;if(t>=d)return E}else{if(t<=-p)return S;if(t+1>=p)return _}return t<0?a(-t,e).neg():u(t%f|0,t/f|0,e)}function u(t,e,n){return new r(t,e,n)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var c=Math.pow;function l(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return g;if("number"===typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(t.substring(1),e,r).neg();for(var i=a(c(r,8)),o=g,s=0;s<t.length;s+=8){var u=Math.min(8,t.length-s),h=parseInt(t.substring(s,s+u),r);if(u<8){var f=a(c(r,u));o=o.mul(f).add(a(h))}else o=(o=o.mul(i)).add(a(h))}return o.unsigned=e,o}function h(t,e){return"number"===typeof t?a(t,e):"string"===typeof t?l(t,e):u(t.low,t.high,"boolean"===typeof e?e:t.unsigned)}r.fromString=l,r.fromValue=h;var f=4294967296,d=f*f,p=d/2,y=s(1<<24),g=s(0);r.ZERO=g;var m=s(0,!0);r.UZERO=m;var b=s(1);r.ONE=b;var v=s(1,!0);r.UONE=v;var w=s(-1);r.NEG_ONE=w;var _=u(-1,2147483647,!1);r.MAX_VALUE=_;var E=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=E;var S=u(0,-2147483648,!1);r.MIN_VALUE=S;var I=r.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},I.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var e=a(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=a(c(t,6),this.unsigned),o=this,s="";;){var u=o.div(i),l=(o.sub(u.mul(i)).toInt()>>>0).toString(t);if((o=u).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1===(1&this.low)},I.isEven=function(){return 0===(1&this.low)},I.equals=function(t){return n(t)||(t=h(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&(this.high===t.high&&this.low===t.low)},I.eq=I.equals,I.notEquals=function(t){return!this.eq(t)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(t){return this.comp(t)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(t){return this.comp(t)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(t){return this.comp(t)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(t){return this.comp(t)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(t){if(n(t)||(t=h(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(b)},I.neg=I.negate,I.add=function(t){n(t)||(t=h(t));var e=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,c=t.low>>>16,l=0,f=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,f+=(d+=i+c)>>>16,l+=(f+=r+a)>>>16,l+=e+s,u((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},I.subtract=function(t){return n(t)||(t=h(t)),this.add(t.neg())},I.sub=I.subtract,I.multiply=function(t){if(this.isZero())return g;if(n(t)||(t=h(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return g;if(this.eq(S))return t.isOdd()?S:g;if(t.eq(S))return this.isOdd()?S:g;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(y)&&t.lt(y))return a(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,c=t.high>>>16,l=65535&t.high,f=t.low>>>16,d=65535&t.low,p=0,m=0,b=0,v=0;return b+=(v+=s*d)>>>16,m+=(b+=o*d)>>>16,b&=65535,m+=(b+=s*f)>>>16,p+=(m+=i*d)>>>16,m&=65535,p+=(m+=o*f)>>>16,m&=65535,p+=(m+=s*l)>>>16,p+=r*d+i*f+o*l+s*c,u((b&=65535)<<16|(v&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(t){if(n(t)||(t=h(t)),t.isZero())throw Error("division by zero");var r,i,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:g;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return v;o=m}else{if(this.eq(S))return t.eq(b)||t.eq(w)?S:t.eq(S)?b:(r=this.shr(1).div(t).shl(1)).eq(g)?t.isNegative()?b:w:(i=this.sub(t.mul(r)),o=r.add(i.div(t)));if(t.eq(S))return this.unsigned?m:g;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=g}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),l=s<=48?1:c(2,s-48),f=a(r),d=f.mul(t);d.isNegative()||d.gt(i);)d=(f=a(r-=l,this.unsigned)).mul(t);f.isZero()&&(f=b),o=o.add(f),i=i.sub(d)}return o},I.div=I.divide,I.modulo=function(t){return n(t)||(t=h(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return u(~this.low,~this.high,this.unsigned)},I.and=function(t){return n(t)||(t=h(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},I.or=function(t){return n(t)||(t=h(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},I.xor=function(t){return n(t)||(t=h(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},I.shiftLeft=function(t){return n(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(t){return n(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(t){if(n(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},I.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},I.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},r.fromBytes=function(t,e,n){return n?r.fromBytesLE(t,e):r.fromBytesBE(t,e)},r.fromBytesLE=function(t,e){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},r.fromBytesBE=function(t,e){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},18322:(t,e,r)=>{"use strict";const{Multiaddr:n}=r(98719),i=C("dns4"),o=C("dns6"),s=C("dnsaddr"),a=k(C("dns"),s,i,o),u=k(C("ip4"),C("ip6")),c=k(R(u,C("tcp")),R(a,C("tcp"))),l=R(u,C("udp")),h=R(l,C("utp")),f=R(l,C("quic")),d=k(R(c,C("ws")),R(a,C("ws"))),p=k(R(c,C("wss")),R(a,C("wss"))),y=k(R(c,C("http")),R(u,C("http")),R(a,C("http"))),g=k(R(c,C("https")),R(u,C("https")),R(a,C("https"))),m=k(R(d,C("p2p-webrtc-star"),C("p2p")),R(p,C("p2p-webrtc-star"),C("p2p")),R(d,C("p2p-webrtc-star")),R(p,C("p2p-webrtc-star"))),b=k(R(d,C("p2p-websocket-star"),C("p2p")),R(p,C("p2p-websocket-star"),C("p2p")),R(d,C("p2p-websocket-star")),R(p,C("p2p-websocket-star"))),v=k(R(y,C("p2p-webrtc-direct"),C("p2p")),R(g,C("p2p-webrtc-direct"),C("p2p")),R(y,C("p2p-webrtc-direct")),R(g,C("p2p-webrtc-direct"))),w=k(d,p,y,g,m,v,c,h,f,a),_=k(R(w,C("p2p-stardust"),C("p2p")),R(w,C("p2p-stardust"))),E=k(R(w,C("p2p")),m,v,C("p2p")),S=k(R(E,C("p2p-circuit"),E),R(E,C("p2p-circuit")),R(C("p2p-circuit"),E),R(w,C("p2p-circuit")),R(C("p2p-circuit"),w),C("p2p-circuit")),I=()=>k(R(S,I),S),A=I(),M=k(R(A,E,A),R(E,A),R(A,E),A,E);function T(t){return function(e){if(!n.isMultiaddr(e))try{e=new n(e)}catch(i){return!1}const r=t(e.protoNames());return null!==r&&(!0===r||!1===r?r:0===r.length)}}function R(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];function n(t){if(t.length<e.length)return null;let r=t;return e.some((e=>(r="function"===typeof e?e().partialMatch(t):e.partialMatch(t),Array.isArray(r)&&(t=r),null===r))),r}return{toString:function(){return"{ "+e.join(" ")+" }"},input:e,matches:T(n),partialMatch:n}}function k(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];function n(t){let r=null;return e.some((e=>{const n="function"===typeof e?e().partialMatch(t):e.partialMatch(t);return!!n&&(r=n,!0)})),r}const i={toString:function(){return"{ "+e.join(" ")+" }"},input:e,matches:T(n),partialMatch:n};return i}function C(t){const e=t;return{toString:function(){return e},matches:function(t){let r;if("string"===typeof t||t instanceof Uint8Array)try{r=new n(t)}catch(o){return!1}else r=t;const i=r.protoNames();return 1===i.length&&i[0]===e},partialMatch:function(t){return 0===t.length?null:t[0]===e?t.slice(1):null}}}t.exports={DNS:a,DNS4:i,DNS6:o,DNSADDR:s,IP:u,TCP:c,UDP:l,QUIC:f,UTP:h,HTTP:y,HTTPS:g,WebSockets:d,WebSocketsSecure:p,WebSocketStar:b,WebRTCStar:m,WebRTCDirect:v,Reliable:w,Stardust:_,Circuit:A,P2P:M,IPFS:M}},68437:(t,e,r)=>{"use strict";var n=r(12534),i=r(86266),o=r(82543).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<<e|t>>>32-e}function c(t,e,r,n,i,o,s){return u(t+(e&r|~e&n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return u(t+(e^r^n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return u(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,t[0],3614090360,7),o=c(o,r,n,i,t[1],3905402710,12),i=c(i,o,r,n,t[2],606105819,17),n=c(n,i,o,r,t[3],3250441966,22),r=c(r,n,i,o,t[4],4118548399,7),o=c(o,r,n,i,t[5],1200080426,12),i=c(i,o,r,n,t[6],2821735955,17),n=c(n,i,o,r,t[7],4249261313,22),r=c(r,n,i,o,t[8],1770035416,7),o=c(o,r,n,i,t[9],2336552879,12),i=c(i,o,r,n,t[10],4294925233,17),n=c(n,i,o,r,t[11],2304563134,22),r=c(r,n,i,o,t[12],1804603682,7),o=c(o,r,n,i,t[13],4254626195,12),i=c(i,o,r,n,t[14],2792965006,17),r=l(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=l(o,r,n,i,t[6],3225465664,9),i=l(i,o,r,n,t[11],643717713,14),n=l(n,i,o,r,t[0],3921069994,20),r=l(r,n,i,o,t[5],3593408605,5),o=l(o,r,n,i,t[10],38016083,9),i=l(i,o,r,n,t[15],3634488961,14),n=l(n,i,o,r,t[4],3889429448,20),r=l(r,n,i,o,t[9],568446438,5),o=l(o,r,n,i,t[14],3275163606,9),i=l(i,o,r,n,t[3],4107603335,14),n=l(n,i,o,r,t[8],1163531501,20),r=l(r,n,i,o,t[13],2850285829,5),o=l(o,r,n,i,t[2],4243563512,9),i=l(i,o,r,n,t[7],1735328473,14),r=h(r,n=l(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=h(o,r,n,i,t[8],2272392833,11),i=h(i,o,r,n,t[11],1839030562,16),n=h(n,i,o,r,t[14],4259657740,23),r=h(r,n,i,o,t[1],2763975236,4),o=h(o,r,n,i,t[4],1272893353,11),i=h(i,o,r,n,t[7],4139469664,16),n=h(n,i,o,r,t[10],3200236656,23),r=h(r,n,i,o,t[13],681279174,4),o=h(o,r,n,i,t[0],3936430074,11),i=h(i,o,r,n,t[3],3572445317,16),n=h(n,i,o,r,t[6],76029189,23),r=h(r,n,i,o,t[9],3654602809,4),o=h(o,r,n,i,t[12],3873151461,11),i=h(i,o,r,n,t[15],530742520,16),r=f(r,n=h(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=f(o,r,n,i,t[7],1126891415,10),i=f(i,o,r,n,t[14],2878612391,15),n=f(n,i,o,r,t[5],4237533241,21),r=f(r,n,i,o,t[12],1700485571,6),o=f(o,r,n,i,t[3],2399980690,10),i=f(i,o,r,n,t[10],4293915773,15),n=f(n,i,o,r,t[1],2240044497,21),r=f(r,n,i,o,t[8],1873313359,6),o=f(o,r,n,i,t[15],4264355552,10),i=f(i,o,r,n,t[6],2734768916,15),n=f(n,i,o,r,t[13],1309151649,21),r=f(r,n,i,o,t[4],4149444226,6),o=f(o,r,n,i,t[11],3174756917,10),i=f(i,o,r,n,t[2],718787259,15),n=f(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},89842:function(t,e,r){"use strict";const n=r(43440),{hasOwnProperty:i}=Object.prototype,{propertyIsEnumerable:o}=Object,s=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),a=this,u={concatArrays:!1,ignoreUndefined:!1},c=t=>{const e=[];for(const r in t)i.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(t);for(const n of r)o.call(t,n)&&e.push(n)}return e};function l(t){return Array.isArray(t)?function(t){const e=t.slice(0,0);return c(t).forEach((r=>{s(e,r,l(t[r]))})),e}(t):n(t)?function(t){const e=null===Object.getPrototypeOf(t)?Object.create(null):{};return c(t).forEach((r=>{s(e,r,l(t[r]))})),e}(t):t}const h=(t,e,r,n)=>(r.forEach((r=>{"undefined"===typeof e[r]&&n.ignoreUndefined||(r in t&&t[r]!==Object.getPrototypeOf(t)?s(t,r,f(t[r],e[r],n)):s(t,r,l(e[r])))})),t);function f(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?((t,e,r)=>{let n=t.slice(0,0),o=0;return[t,e].forEach((e=>{const a=[];for(let r=0;r<e.length;r++)i.call(e,r)&&(a.push(String(r)),s(n,o++,e===t?e[r]:l(e[r])));n=h(n,e,c(e).filter((t=>!a.includes(t))),r)})),n})(t,e,r):n(e)&&n(t)?h(t,e,c(e),r):l(e)}t.exports=function(){const t=f(l(u),this!==a&&this||{},u);let e={_:{}};for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];for(const s of i)if(void 0!==s){if(!n(s))throw new TypeError("`"+s+"` is not an Option Object");e=f(e,{_:s},t)}return e._}},43440:t=>{"use strict";t.exports=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}},31595:(t,e,r)=>{var n=r(97942),i=r(26084);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var c=t.shrn(u),l=a.toRed(o);e>0;e--){var h=this._randrange(new n(2),a);r&&r(h);var f=h.toRed(o).redPow(c);if(0!==f.cmp(s)&&0!==f.cmp(l)){for(var d=1;d<u;d++){if(0===(f=f.redSqr()).cmp(s))return!1;if(0===f.cmp(l))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),c=s.toRed(i);e>0;e--){var l=this._randrange(new n(2),s),h=t.gcd(l);if(0!==h.cmpn(1))return h;var f=l.toRed(i).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(c)){for(var d=1;d<a;d++){if(0===(f=f.redSqr()).cmp(o))return f.fromRed().subn(1).gcd(t);if(0===f.cmp(c))break}if(d===a)return(f=f.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},97942:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(56619).Buffer}catch(A){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):y(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new I(t)},i(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},72325:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},94034:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!==typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},80842:(t,e,r)=>{const n=r(47465).EventEmitter,{nanoid:i}=r(75926),{WORKER_REQUEST_READ_LOCK:o,WORKER_RELEASE_READ_LOCK:s,MASTER_GRANT_READ_LOCK:a,WORKER_REQUEST_WRITE_LOCK:u,WORKER_RELEASE_WRITE_LOCK:c,MASTER_GRANT_WRITE_LOCK:l}=r(20185),h=r(85913),f=(t,e,r,n,i)=>(o,s)=>{if(!s||!s.data||s.data.type!==r)return;const a={type:s.data.type,name:s.data.name,identifier:s.data.identifier};t.emit(e,a.name,(()=>(o.postMessage({type:i,name:a.name,identifier:a.identifier}),new Promise((t=>{const e=r=>{if(!r||!r.data)return;const i={type:r.data.type,name:r.data.name,identifier:r.data.identifier};i&&i.type===n&&i.identifier===a.identifier&&(o.removeEventListener("message",e),t())};o.addEventListener("message",e)})))))},d=(t,e,r,n)=>()=>{const o=i();return globalThis.postMessage({type:e,identifier:o,name:t}),new Promise((e=>{const i=s=>{if(!s||!s.data)return;const a={type:s.data.type,identifier:s.data.identifier};a&&a.type===r&&a.identifier===o&&(globalThis.removeEventListener("message",i),e((()=>{globalThis.postMessage({type:n,identifier:o,name:t})})))};globalThis.addEventListener("message",i)}))},p={singleProcess:!1};t.exports=t=>{t=Object.assign({},p,t);if(!!globalThis.document||t.singleProcess){const t=new n;return h.addEventListener("message",f(t,"requestReadLock",o,s,a)),h.addEventListener("message",f(t,"requestWriteLock",u,c,l)),t}return{isWorker:!0,readLock:t=>d(t,o,a,s),writeLock:t=>d(t,u,l,c)}}},20185:t=>{t.exports={WORKER_REQUEST_READ_LOCK:"lock:worker:request-read",WORKER_RELEASE_READ_LOCK:"lock:worker:release-read",MASTER_GRANT_READ_LOCK:"lock:master:grant-read",WORKER_REQUEST_WRITE_LOCK:"lock:worker:request-write",WORKER_RELEASE_WRITE_LOCK:"lock:worker:release-write",MASTER_GRANT_WRITE_LOCK:"lock:master:grant-write"}},31127:(t,e,r)=>{const n=r(1801),i=r(80842),{default:o}=r(12906),{timeout:s}=r(58541),a=r(85913),u={};let c;function l(t,e){let r;const n=new Promise((t=>{r=t}));return t.add((()=>s(new Promise((t=>{r((()=>{t()}))})),e.timeout))),n}const h={concurrency:1/0,timeout:846e5,global:r.g,singleProcess:!1};t.exports=(t,e)=>(e||(e={}),"object"===typeof t&&(e=t,t="lock"),t||(t="lock"),e=Object.assign({},h,e),c||(c=n(e)||i(e),c.isWorker||(c.on("requestReadLock",((t,e)=>{u[t]&&u[t].readLock().then((t=>e().finally((()=>t()))))})),c.on("requestWriteLock",(async(t,e)=>{u[t]&&u[t].writeLock().then((t=>e().finally((()=>t()))))})))),u[t]||(u[t]=((t,e)=>{if(c.isWorker)return{readLock:c.readLock(t,e),writeLock:c.writeLock(t,e)};const r=new o({concurrency:1});let n=null;return{readLock:()=>{if(n)return l(n,e);n=new o({concurrency:e.concurrency,autoStart:!1});const t=n,i=l(n,e);return r.add((()=>(t.start(),t.onIdle().then((()=>{n===t&&(n=null)}))))),i},writeLock:()=>(n=null,l(r,e))}})(t,e)),u[t]),t.exports.Worker=function(t,e){let n;e=e||r.g.Worker;try{n=new e(t)}catch(i){i.message.includes("not a constructor")&&(n=e(t))}if(!n)throw new Error("Could not create Worker from",e);return a(n),n}},1801:(t,e,r)=>{var n=r(21964);const i=r(47465).EventEmitter,{nanoid:o}=r(75926),{WORKER_REQUEST_READ_LOCK:s,WORKER_RELEASE_READ_LOCK:a,MASTER_GRANT_READ_LOCK:u,WORKER_REQUEST_WRITE_LOCK:c,WORKER_RELEASE_WRITE_LOCK:l,MASTER_GRANT_WRITE_LOCK:h}=r(20185);let f;const d=(t,e,r,n,i)=>(o,s)=>{s&&s.type===r&&t.emit(e,s.name,(()=>(o.send({type:i,name:s.name,identifier:s.identifier}),new Promise((t=>{const e=r=>{r&&r.type===n&&r.identifier===s.identifier&&(o.removeListener("message",e),t())};o.on("message",e)})))))},p=(t,e,r,i)=>()=>{const s=o();return n.send({type:e,identifier:s,name:t}),new Promise((e=>{const o=a=>{a&&a.type===r&&a.identifier===s&&(n.removeListener("message",o),e((()=>{n.send({type:i,identifier:s,name:t})})))};n.on("message",o)}))};t.exports=t=>{try{if(f=r(21724),!Object.keys(f).length)return}catch(e){return}if(f.isMaster||t.singleProcess){const t=new i;return f.on("message",d(t,"requestReadLock",s,a,u)),f.on("message",d(t,"requestWriteLock",c,l,h)),t}return{isWorker:!0,readLock:t=>p(t,s,u,a),writeLock:t=>p(t,c,h,l)}}},78193:t=>{var e=1e3,r=60*e,n=60*r,i=24*n,o=7*i,s=365.25*i;function a(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,u){u=u||{};var c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(t);if("number"===c&&isFinite(t))return u.long?function(t){var o=Math.abs(t);if(o>=i)return a(t,o,i,"day");if(o>=n)return a(t,o,n,"hour");if(o>=r)return a(t,o,r,"minute");if(o>=e)return a(t,o,e,"second");return t+" ms"}(t):function(t){var o=Math.abs(t);if(o>=i)return Math.round(t/i)+"d";if(o>=n)return Math.round(t/n)+"h";if(o>=r)return Math.round(t/r)+"m";if(o>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},94655:(t,e,r)=>{const{Multiaddr:n}=r(98719),i=(t,e)=>e,o={ip4:i,ip6:(t,e,r,n)=>1===n.length&&"ip6"===n[0].protocol?e:"[".concat(e,"]"),tcp:(t,e,r,n,i)=>n.some((t=>["http","https","ws","wss"].includes(t.protocol)))?"".concat(t,":").concat(e):((t,e,r,n)=>{if(n&&!1===n.assumeHttp)return"tcp://".concat(t,":").concat(e);let i="tcp",o=":".concat(e);return"tcp"===r[r.length-1].protocol&&(i="443"===e?"https":"http",o="443"===e||"80"===e?"":o),"".concat(i,"://").concat(t).concat(o)})(t,e,n,i),udp:(t,e)=>"udp://".concat(t,":").concat(e),dnsaddr:i,dns4:i,dns6:i,ipfs:(t,e)=>"".concat(t,"/ipfs/").concat(e),p2p:(t,e)=>"".concat(t,"/p2p/").concat(e),http:t=>"http://".concat(t),https:t=>"https://".concat(t),ws:t=>"ws://".concat(t),wss:t=>"wss://".concat(t),"p2p-websocket-star":t=>"".concat(t,"/p2p-websocket-star"),"p2p-webrtc-star":t=>"".concat(t,"/p2p-webrtc-star"),"p2p-webrtc-direct":t=>"".concat(t,"/p2p-webrtc-direct")};t.exports=(t,e)=>{const r=new n(t),i=t.toString().split("/").slice(1);return r.tuples().map((t=>({protocol:i.shift(),content:t[1]?i.shift():null}))).reduce(((t,r,n,i)=>{const s=o[r.protocol];if(!s)throw new Error("Unsupported protocol ".concat(r.protocol));return s(t,r.content,n,i,e)}),"")}},63058:(t,e,r)=>{"use strict";const n=r(93516),i=r(70023),o=r(74561),{concat:s}=r(62110),{toString:a}=r(82051);function u(t){const e=[],r=t.split("/").slice(1);if(1===r.length&&""===r[0])return[];for(let n=0;n<r.length;n++){const o=r[n],s=i(o);if(0!==s.size){if(n++,n>=r.length)throw v("invalid address: "+t);if(s.path){e.push([o,b(r.slice(n).join("/"))]);break}e.push([o,r[n]])}else e.push([o])}return e}function c(t){const e=[];return t.map((t=>{const r=w(t);return e.push(r.name),t.length>1&&e.push(t[1]),null})),b(e.join("/"))}function l(t){return t.map((t=>{Array.isArray(t)||(t=[t]);const e=w(t);return t.length>1?[e.code,n.toBytes(e.code,t[1])]:[e.code]}))}function h(t){return t.map((t=>{const e=w(t);return t[1]?[e.code,n.toString(e.code,t[1])]:[e.code]}))}function f(t){return g(s(t.map((t=>{const e=w(t);let r=Uint8Array.from(o.encode(e.code));return t.length>1&&(r=s([r,t[1]])),r}))))}function d(t,e){if(t.size>0)return t.size/8;if(0===t.size)return 0;return o.decode(e)+o.decode.bytes}function p(t){const e=[];let r=0;for(;r<t.length;){const n=o.decode(t,r),s=o.decode.bytes,u=d(i(n),t.slice(r+s));if(0===u){e.push([n]),r+=s;continue}const c=t.slice(r+s,r+s+u);if(r+=u+s,r>t.length)throw v("Invalid address Uint8Array: "+a(t,"base16"));e.push([n,c])}return e}function y(t){return f(l(u(t=b(t))))}function g(t){const e=m(t);if(e)throw e;return Uint8Array.from(t)}function m(t){try{p(t)}catch(e){return e}}function b(t){return"/"+t.trim().split("/").filter((t=>t)).join("/")}function v(t){return new Error("Error parsing address: "+t)}function w(t){return i(t[0])}t.exports={stringToStringTuples:u,stringTuplesToString:c,tuplesToStringTuples:h,stringTuplesToTuples:l,bytesToTuples:p,tuplesToBytes:f,bytesToString:function(t){const e=p(t);return c(h(e))},stringToBytes:y,fromString:function(t){return y(t)},fromBytes:g,validateBytes:m,isValidBytes:function(t){return void 0===m(t)},cleanPath:b,ParseError:v,protoFromTuple:w,sizeForAddr:d}},93516:(t,e,r)=>{"use strict";const n=r(99745),i=r(70023),{CID:o}=r(16629),{base32:s}=r(71128),{base58btc:a}=r(86898),u=r(8315),c=r(74561),{toString:l}=r(82051),{fromString:h}=r(46765),{concat:f}=r(62110);function d(t,e){return e instanceof Uint8Array?d.toString(t,e):d.toBytes(t,e)}function p(t){if(!n.isIP(t))throw new Error("invalid ip address");return n.toBytes(t)}function y(t){const e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function g(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function m(t){const e=t.slice(0,t.length-2),r=t.slice(t.length-2);return l(e,"base32")+":"+g(r)}t.exports=d,d.toString=function(t,e){switch(i(t).code){case 4:case 41:return function(t){const e=n.toString(t);if(!e||!n.isIP(e))throw new Error("invalid ip address");return e}(e);case 6:case 273:case 33:case 132:return g(e).toString();case 53:case 54:case 55:case 56:case 400:case 777:return function(t){const e=c.decode(t);if((t=t.slice(c.decode.bytes)).length!==e)throw new Error("inconsistent lengths");return l(t)}(e);case 421:return function(t){const e=c.decode(t),r=t.slice(c.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return l(r,"base58btc")}(e);case 444:case 445:return m(e);default:return l(e,"base16")}},d.toBytes=function(t,e){switch(i(t).code){case 4:case 41:return p(e);case 6:case 273:case 33:case 132:return y(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 777:return function(t){const e=h(t),r=Uint8Array.from(c.encode(e.length));return f([r,e],r.length+e.length)}(e);case 421:return function(t){let e;e="Q"===t[0]||"1"===t[0]?u.decode(a.decode("z".concat(t))).bytes:o.parse(t).multihash.bytes;const r=Uint8Array.from(c.encode(e.length));return f([r,e],r.length+e.length)}(e);case 444:return function(t){const e=t.split(":");if(2!==e.length)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(16!==e[0].length)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion address.");const r=s.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");const i=y(n);return f([r,i],r.length+i.length)}(e);case 445:return function(t){const e=t.split(":");if(2!==e.length)throw new Error("failed to parse onion addr: "+e+" does not contain a port number");if(56!==e[0].length)throw new Error("failed to parse onion addr: "+e[0]+" not a Tor onion3 address.");const r=s.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");const i=y(n);return f([r,i],r.length+i.length)}(e);default:return h(e,"base16")}}},98719:(t,e,r)=>{"use strict";const n=r(63058),i=r(70023),o=r(74561),{CID:s}=r(16629),{base58btc:a}=r(86898),u=r(67963),c=Symbol.for("nodejs.util.inspect.custom"),{toString:l}=r(82051),{equals:h}=r(98779),f=new Map,d=Symbol.for("@multiformats/js-multiaddr/multiaddr");class p{constructor(t){if(null==t&&(t=""),Object.defineProperty(this,d,{value:!0}),t instanceof Uint8Array)this.bytes=n.fromBytes(t);else if("string"===typeof t){if(t.length>0&&"/"!==t.charAt(0))throw new Error('multiaddr "'.concat(t,'" must start with a "/"'));this.bytes=n.fromString(t)}else{if(!p.isMultiaddr(t))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=n.fromBytes(t.bytes)}}toString(){return n.bytesToString(this.bytes)}toJSON(){return this.toString()}toOptions(){const t={},e=this.toString().split("/");return t.family="ip4"===e[1]?4:6,t.host=e[2],t.transport=e[3],t.port=parseInt(e[4]),t}protos(){return this.protoCodes().map((t=>Object.assign({},i(t))))}protoCodes(){const t=[],e=this.bytes;let r=0;for(;r<e.length;){const s=o.decode(e,r),a=o.decode.bytes,u=i(s);r+=n.sizeForAddr(u,e.slice(r+a))+a,t.push(s)}return t}protoNames(){return this.protos().map((t=>t.name))}tuples(){return n.bytesToTuples(this.bytes)}stringTuples(){const t=n.bytesToTuples(this.bytes);return n.tuplesToStringTuples(t)}encapsulate(t){return t=new p(t),new p(this.toString()+t.toString())}decapsulate(t){const e=t.toString(),r=this.toString(),n=r.lastIndexOf(e);if(n<0)throw new Error("Address "+this+" does not contain subaddress: "+t);return new p(r.slice(0,n))}decapsulateCode(t){const e=this.tuples();for(let r=e.length-1;r>=0;r--)if(e[r][0]===t)return new p(n.tuplesToBytes(e.slice(0,r)));return this}getPeerId(){try{const t=this.stringTuples().filter((t=>t[0]===i.names.ipfs.code)),e=t.pop();if(e&&e[1]){const t=e[1];return"Q"===t[0]||"1"===t[0]?l(a.decode("z".concat(t)),"base58btc"):l(s.parse(t).multihash.bytes,"base58btc")}return null}catch(t){return null}}getPath(){let t=null;try{t=this.stringTuples().filter((t=>!!i(t[0]).path))[0][1],t||(t=null)}catch(e){t=null}return t}equals(t){return h(this.bytes,t.bytes)}async resolve(){const t=this.protos().find((t=>t.resolvable));if(!t)return[this];const e=f.get(t.name);if(!e)throw u(new Error("no available resolver for ".concat(t.name)),"ERR_NO_AVAILABLE_RESOLVER");return(await e(this)).map((t=>new p(t)))}nodeAddress(){const t=this.protoCodes(),e=this.protoNames(),r=this.toString().split("/").slice(1);if(r.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(4!==t[0]&&41!==t[0]&&54!==t[0]&&55!==t[0])throw new Error("no protocol with name: \"'".concat(e[0],'\'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".'));if("tcp"!==r[2]&&"udp"!==r[2])throw new Error("no protocol with name: \"'".concat(e[1],'\'". Must have a valid transport protocol: "{tcp, udp}".'));return{family:41===t[0]||55===t[0]?6:4,address:r[1],port:parseInt(r[3])}}isThinWaistAddress(t){const e=(t||this).protos();return 2===e.length&&((4===e[0].code||41===e[0].code)&&(6===e[1].code||273===e[1].code))}static fromNodeAddress(t,e){if(!t)throw new Error("requires node address object");if(!e)throw new Error("requires transport protocol");let r;switch(t.family){case 4:r="ip4";break;case 6:r="ip6";break;default:throw Error("Invalid addr family. Got '".concat(t.family,"' instead of 4 or 6"))}return new p("/"+[r,t.address,e,t.port].join("/"))}static isName(t){return!!p.isMultiaddr(t)&&t.protos().some((t=>t.resolvable))}static isMultiaddr(t){return t instanceof p||Boolean(t&&t[d])}[c](){return"<Multiaddr "+l(this.bytes,"base16")+" - "+n.bytesToString(this.bytes)+">"}inspect(){return"<Multiaddr "+l(this.bytes,"base16")+" - "+n.bytesToString(this.bytes)+">"}}p.protocols=i,p.resolvers=f,t.exports={Multiaddr:p,multiaddr:function(t){return new p(t)},protocols:i,resolvers:f}},99745:(t,e,r)=>{"use strict";const n=r(62795),{toString:i}=r(82051),o=n,s=n.v4,a=n.v6,u=function(t,e,r){let n;if(r=~~r,s(t))n=e||new Uint8Array(r+4),t.split(/\./g).map((function(t){n[r++]=255&parseInt(t,10)}));else if(a(t)){const o=t.split(":",8);let a;for(a=0;a<o.length;a++){let t;s(o[a])&&(t=u(o[a]),o[a]=i(t.slice(0,2),"base16")),t&&++a<8&&o.splice(a,0,i(t.slice(2,4),"base16"))}if(""===o[0])for(;o.length<8;)o.unshift("0");else if(""===o[o.length-1])for(;o.length<8;)o.push("0");else if(o.length<8){for(a=0;a<o.length&&""!==o[a];a++);const t=[a,"1"];for(a=9-o.length;a>0;a--)t.push("0");o.splice.apply(o,t)}for(n=e||new Uint8Array(r+16),a=0;a<o.length;a++){const t=parseInt(o[a],16);n[r++]=t>>8&255,n[r++]=255&t}}if(!n)throw Error("Invalid ip address: "+t);return n};t.exports={isIP:o,isV4:s,isV6:a,toBytes:u,toString:function(t,e,r){e=~~e,r=r||t.length-e;const n=[];let i;const o=new DataView(t.buffer);if(4===r){for(let i=0;i<r;i++)n.push(t[e+i]);i=n.join(".")}else if(16===r){for(let t=0;t<r;t+=2)n.push(o.getUint16(e+t).toString(16));i=n.join(":"),i=i.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),i=i.replace(/:{3,4}/,"::")}return i}}},70023:t=>{"use strict";function e(t){if("number"===typeof t){if(e.codes[t])return e.codes[t];throw new Error("no protocol with code: "+t)}if("string"===typeof t){if(e.names[t])return e.names[t];throw new Error("no protocol with name: "+t)}throw new Error("invalid protocol id type: "+t)}const r=-1;function n(t,e,r,n,i){return{code:t,size:e,name:r,resolvable:Boolean(n),path:Boolean(i)}}e.lengthPrefixedVarSize=r,e.V=r,e.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,r,"ip6zone"],[53,r,"dns","resolvable"],[54,r,"dns4","resolvable"],[55,r,"dns6","resolvable"],[56,r,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,r,"unix",!1,"path"],[421,r,"ipfs"],[421,r,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,r,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,r,"memory"]],e.names={},e.codes={},e.table.map((t=>{const r=n.apply(null,t);return e.codes[r.code]=r,e.names[r.name]=r,null})),e.object=n,t.exports=e},34669:(t,e,r)=>{"use strict";const n=r(18259);t.exports=n},44689:(t,e,r)=>{"use strict";const n=r(70023),{code:i}=n("dnsaddr");t.exports={dnsaddrResolver:async function(t){const e=new(r(34669)),n=t.getPeerId(),[,o]=t.stringTuples().find((t=>{let[e]=t;return e===i}))||[];let s=(await e.resolveTxt("_dnsaddr.".concat(o))).flat().map((t=>t.split("=")[1]));return n&&(s=s.filter((t=>t.includes(n)))),s}}},33543:(t,e,r)=>{"use strict";const{encodeText:n}=r(61348);t.exports=class{constructor(t,e,r,i){this.name=t,this.code=e,this.codeBuf=n(this.code),this.alphabet=i,this.codec=r(i)}encode(t){return this.codec.encode(t)}decode(t){for(const e of t)if(this.alphabet&&this.alphabet.indexOf(e)<0)throw new Error("invalid character '".concat(e,"' in '").concat(t,"'"));return this.codec.decode(t)}}},39213:(t,e,r)=>{"use strict";const n=r(19814),i=r(33543),{rfc4648:o}=r(31186),{decodeText:s,encodeText:a}=r(61348),u=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=u.reduce(((t,e)=>(t[e[0]]=new i(e[0],e[1],e[2],e[3]),t)),{}),l=u.reduce(((t,e)=>(t[e[1]]=c[e[0]],t)),{});t.exports={names:c,codes:l}},80141:(t,e,r)=>{"use strict";const n=r(39213),{encodeText:i,decodeText:o,concat:s}=r(61348);function a(t){if(Object.prototype.hasOwnProperty.call(n.names,t))return n.names[t];if(Object.prototype.hasOwnProperty.call(n.codes,t))return n.codes[t];throw new Error("Unsupported encoding: ".concat(t))}(e=t.exports=function(t,e){if(!e)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(t);return function(t,e){a(t).decode(o(e))}(r,e),s([n,e],n.length+e.length)}).encode=function(t,e){const r=a(t),n=i(r.encode(e));return s([r.codeBuf,n],r.codeBuf.length+n.length)},e.decode=function(t){t instanceof Uint8Array&&(t=o(t));const e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),a(t[0]).decode(t.substring(1))},e.isEncoded=function(t){if(t instanceof Uint8Array&&(t=o(t)),"[object String]"!==Object.prototype.toString.call(t))return!1;try{return a(t[0]).name}catch(e){return!1}},e.encoding=a,e.encodingFromData=function(t){return t instanceof Uint8Array&&(t=o(t)),a(t[0])};const u=Object.freeze(n.names),c=Object.freeze(n.codes);e.names=u,e.codes=c},31186:t=>{"use strict";t.exports={rfc4648:t=>e=>({encode:r=>((t,e,r)=>{const n="="===e[e.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(r,e,t),decode:r=>((t,e,r)=>{const n={};for(let c=0;c<e.length;++c)n[e[c]]=c;let i=t.length;for(;"="===t[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,u=0;for(let c=0;c<i;++c){const e=n[t[c]];if(void 0===e)throw new SyntaxError("Invalid character "+t[c]);a=a<<r|e,s+=r,s>=8&&(s-=8,o[u++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o})(r,e,t)})}},61348:t=>{"use strict";const e=new TextDecoder,r=new TextEncoder;t.exports={decodeText:t=>e.decode(t),encodeText:t=>r.encode(t),concat:function(t,e){const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}}},2044:t=>{t.exports=function t(e,r){var n,i=0,o=0,s=r=r||0,a=e.length;do{if(s>=a)throw t.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=s-r,i}},36076:t=>{t.exports=function t(r,n,i){n=n||[];var o=i=i||0;for(;r>=e;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,t.bytes=i-o+1,n};var e=Math.pow(2,31)},36414:(t,e,r)=>{t.exports={encode:r(36076),decode:r(2044),encodingLength:r(5592)}},5592:t=>{var e=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),s=Math.pow(2,42),a=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);t.exports=function(t){return t<e?1:t<r?2:t<n?3:t<i?4:t<o?5:t<s?6:t<a?7:t<u?8:t<c?9:10}},58280:t=>{"use strict";const e=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});t.exports={names:e}},53765:(t,e,r)=>{"use strict";const n=r(80141),i=r(36414),{names:o}=r(58280),{toString:s}=r(82051),{fromString:a}=r(46765),{concat:u}=r(62110),c={};for(const y in o){const t=y;c[o[t]]=t}function l(t){if(!(t instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");const e=i.decode(t);if(!d(e))throw new Error("multihash unknown function code: 0x".concat(e.toString(16)));t=t.slice(i.decode.bytes);const r=i.decode(t);if(r<0)throw new Error("multihash invalid length: ".concat(r));if((t=t.slice(i.decode.bytes)).length!==r)throw new Error("multihash length inconsistent: 0x".concat(s(t,"base16")));return{code:e,name:c[e],length:r,digest:t}}function h(t){let e=t;if("string"===typeof t){if(void 0===o[t])throw new Error("Unrecognized hash function named: ".concat(t));e=o[t]}if("number"!==typeof e)throw new Error("Hash function code should be a number. Got: ".concat(e));if(void 0===c[e]&&!f(e))throw new Error("Unrecognized function code: ".concat(e));return e}function f(t){return t>0&&t<16}function d(t){return!!f(t)||!!c[t]}function p(t){l(t)}Object.freeze(c),t.exports={names:o,codes:c,toHexString:function(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(t,"base16")},fromHexString:function(t){return a(t,"base16")},toB58String:function(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(n.encode("base58btc",t)).slice(1)},fromB58String:function(t){const e=t instanceof Uint8Array?s(t):t;return n.decode("z"+e)},decode:l,encode:function(t,e,r){if(!t||void 0===e)throw new Error("multihash encode requires at least two args: digest, code");const n=h(e);if(!(t instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==r&&(r=t.length),r&&t.length!==r)throw new Error("digest length should be equal to specified length.");const o=i.encode(n),s=i.encode(r);return u([o,s,t],o.length+s.length+t.length)},coerceCode:h,isAppCode:f,validate:p,prefix:function(t){return p(t),t.subarray(0,2)},isValidCode:d}},96940:(t,e)=>{"use strict";e.PROTOCOL_ID="/multistream/1.0.0"},99848:(t,e,r)=>{"use strict";const n=r(18392),i=r(41976),o=r(90504),s=r(39610),{PROTOCOL_ID:a}=r(96940),u=Object.assign(n("mss:handle"),{error:n("mss:handle:error")});t.exports=async function(t,e,r){e=Array.isArray(e)?e:[e];const{writer:n,reader:c,rest:l,stream:h}=s(t);for(;;){const t=(await o.read(c,r)).toString();if(u('read "%s"',t),t!==a){if(e.includes(t))return o.write(n,t),u('respond with "%s" for "%s"',t,t),l(),{stream:h,protocol:t};"ls"!==t?(o.write(n,"na"),u('respond with "na" for "%s"',t)):(o.write(n,new i(e.map((t=>o.encode(t))))),u('respond with "%s" for %s',e,t))}else u('respond with "%s" for "%s"',a,t),o.write(n,a)}}},5889:(t,e,r)=>{"use strict";const n=r(40995),i=r(99848),o=r(46995),{PROTOCOL_ID:s}=r(96940);e.PROTOCOL_ID=s;class a{constructor(t){this._stream=t,this._shaken=!1}async _handshake(t){if(this._shaken)return;const{stream:e}=await n(this._stream,s,void 0,t);this._stream=e,this._shaken=!0}}e.Dialer=class extends a{select(t,e){return n(this._stream,t,this._shaken?void 0:s,e)}async ls(t){await this._handshake(t);const e=await o(this._stream,t),{stream:r,protocols:n}=e;return this._stream=r,n}};e.Listener=class extends a{handle(t,e){return i(this._stream,t,e)}}},46995:(t,e,r)=>{"use strict";const n=r(55502),i=r(18392),o=r(90504),s=r(39610),a=r(44709),{pipe:u}=r(79023),c=Object.assign(i("mss:ls"),{error:i("mss:ls:error")});t.exports=async function(t,e){const{reader:r,writer:i,rest:l,stream:h}=s(t);c('write "ls"'),o.write(i,"ls"),l();const f=await o.read(r,e),d=n([f]),p=[];await u(d,a.decode(),(async t=>{for await(const e of t)p.push(e.shallowSlice(0,-1).toString())}));return{stream:h,protocols:p}}},90504:(t,e,r)=>{"use strict";const n=r(41976),i=r(44709),{pipe:o}=r(79023),s=r(67963),{fromString:a}=r(46765),u=r(84744),{source:c}=r(64183),l=a("\n");function h(t){return i.encode.single(new n([t,l]))}t.exports={encode:h,write:function(t,e){t.push(h(e))},writeAll:async function(t,e){t.push(e.reduce(((t,e)=>t.append(h(e))),new n))},read:async function(t,e){let r=1;const n={[Symbol.asyncIterator](){return this},next:()=>t.next(r)};let a=n;e&&e.signal&&(a=c(n,e.signal));const h=await o(a,i.decode({onLength:t=>{r=t}}),u);if(h.get(h.length-1)!==l[0])throw s(new Error("missing newline"),"ERR_INVALID_MULTISTREAM_SELECT_MESSAGE");return h.shallowSlice(0,-1)}}},40995:(t,e,r)=>{"use strict";const n=r(18392),i=r(67963),o=r(90504),s=r(39610),a=Object.assign(n("mss:select"),{error:n("mss:select:error")});t.exports=async function(t,e,r,n){e=Array.isArray(e)?[...e]:[e];const{reader:u,writer:c,rest:l,stream:h}=s(t),f=e.shift();if(!f)throw new Error("At least one protocol must be specified");r?(a('select: write ["%s", "%s"]',r,f),o.writeAll(c,[r,f])):(a('select: write "%s"',f),o.write(c,f));let d=(await o.read(u,n)).toString();if(a('select: read "%s"',d),d===r&&(d=(await o.read(u,n)).toString(),a('select: read "%s"',d)),d===f)return l(),{stream:h,protocol:f};for(const i of e){a('select: write "%s"',i),o.write(c,i);const t=(await o.read(u,n)).toString();if(a('select: read "%s" for "%s"',t,i),t===i)return l(),{stream:h,protocol:i}}throw l(),i(new Error("protocol selection failed"),"ERR_UNSUPPORTED_PROTOCOL")}},486:t=>{"use strict";function e(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}t.exports=function(t){var r=void 0,n=void 0;function i(t){if(!(t instanceof Object))throw new Error('Target "'+t+'" is not an object');n=t}function o(t){Object.keys(t).forEach((function(e){var r=t[e];if("function"!==typeof r)throw new Error('Trap "'+e+": "+r+'" is not a function');if(!Reflect[e])throw new Error('Trap "'+e+": "+r+'" is not a valid trap')})),r=t}i((function(){})),t&&i(t),o(Reflect);var s=new Proxy({},{get:function(t,i){return function(){for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];return r[i].apply(null,[n].concat(e(o.slice(1))))}}});return{setTarget:i,setHandler:o,getTarget:function(){return n},getHandler:function(){return r},proxy:new Proxy(n,s)}}},1900:(t,e,r)=>{"use strict";globalThis.fetch&&globalThis.Headers&&globalThis.Request&&globalThis.Response?t.exports={default:globalThis.fetch,Headers:globalThis.Headers,Request:globalThis.Request,Response:globalThis.Response}:t.exports={default:r(45359).default,Headers:r(45359).Headers,Request:r(45359).Request,Response:r(45359).Response}},27922:function(t,e){(function(){var t,r,n,i,o,s,a,u;u=function(t){return[(t&255<<24)>>>24,(t&255<<16)>>>16,(65280&t)>>>8,255&t].join(".")},a=function(t){var e,n,i,o,s,a;for(e=[],i=o=0;o<=3&&0!==t.length;i=++o){if(i>0){if("."!==t[0])throw new Error("Invalid IP");t=t.substring(1)}s=(a=r(t))[0],n=a[1],t=t.substring(n),e.push(s)}if(0!==t.length)throw new Error("Invalid IP");switch(e.length){case 1:if(e[0]>4294967295)throw new Error("Invalid IP");return e[0]>>>0;case 2:if(e[0]>255||e[1]>16777215)throw new Error("Invalid IP");return(e[0]<<24|e[1])>>>0;case 3:if(e[0]>255||e[1]>255||e[2]>65535)throw new Error("Invalid IP");return(e[0]<<24|e[1]<<16|e[2])>>>0;case 4:if(e[0]>255||e[1]>255||e[2]>255||e[3]>255)throw new Error("Invalid IP");return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0;default:throw new Error("Invalid IP")}},i=(n=function(t){return t.charCodeAt(0)})("0"),s=n("a"),o=n("A"),r=function(t){var e,r,a,u,c;for(u=0,e=10,r="9",a=0,t.length>1&&"0"===t[a]&&("x"===t[a+1]||"X"===t[a+1]?(a+=2,e=16):"0"<=t[a+1]&&t[a+1]<="9"&&(a++,e=8,r="7")),c=a;a<t.length;){if("0"<=t[a]&&t[a]<=r)u=u*e+(n(t[a])-i)>>>0;else{if(16!==e)break;if("a"<=t[a]&&t[a]<="f")u=u*e+(10+n(t[a])-s)>>>0;else{if(!("A"<=t[a]&&t[a]<="F"))break;u=u*e+(10+n(t[a])-o)>>>0}}if(u>4294967295)throw new Error("too large");a++}if(a===c)throw new Error("empty octet");return[u,a]},t=function(){function t(t,e){var r,n,i;if("string"!==typeof t)throw new Error("Missing `net' parameter");if(e||(i=t.split("/",2),t=i[0],e=i[1]),e||(e=32),"string"===typeof e&&e.indexOf(".")>-1){try{this.maskLong=a(e)}catch(o){throw o,new Error("Invalid mask: "+e)}for(r=n=32;n>=0;r=--n)if(this.maskLong===4294967295<<32-r>>>0){this.bitmask=r;break}}else{if(!e&&0!==e)throw new Error("Invalid mask: empty");this.bitmask=parseInt(e,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0)}try{this.netLong=(a(t)&this.maskLong)>>>0}catch(o){throw o,new Error("Invalid net address: "+t)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+e);this.size=Math.pow(2,32-this.bitmask),this.base=u(this.netLong),this.mask=u(this.maskLong),this.hostmask=u(~this.maskLong),this.first=this.bitmask<=30?u(this.netLong+1):this.base,this.last=this.bitmask<=30?u(this.netLong+this.size-2):u(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?u(this.netLong+this.size-1):void 0}return t.prototype.contains=function(e){return"string"===typeof e&&(e.indexOf("/")>0||4!==e.split(".").length)&&(e=new t(e)),e instanceof t?this.contains(e.base)&&this.contains(e.broadcast||e.last):(a(e)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},t.prototype.next=function(e){return null==e&&(e=1),new t(u(this.netLong+this.size*e),this.mask)},t.prototype.forEach=function(t){var e,r,n;for(n=a(this.first),r=a(this.last),e=0;n<=r;)t(u(n),n,e),e++,n++},t.prototype.toString=function(){return this.base+"/"+this.bitmask},t}(),e.ip2long=a,e.long2ip=u,e.Netmask=t}).call(this)},45359:(t,e)=>{"use strict";var r=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},22592:t=>{"use strict";var e=function(t){return t!==t};t.exports=function(t,r){return 0===t&&0===r?1/t===1/r:t===r||!(!e(t)||!e(r))}},33454:(t,e,r)=>{"use strict";var n=r(9396),i=r(19722),o=r(22592),s=r(83355),a=r(13118),u=i(s(),Object);n(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},83355:(t,e,r)=>{"use strict";var n=r(22592);t.exports=function(){return"function"===typeof Object.is?Object.is:n}},13118:(t,e,r)=>{"use strict";var n=r(83355),i=r(9396);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},41949:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(27635),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"===typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"===typeof window[t])try{h(window[t])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(t){var e=null!==t&&"object"===typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(n&&t.length>0)for(var g=0;g<t.length;++g)f.push(String(g));else for(var m in t)p&&"prototype"===m||!i.call(t,m)||f.push(String(m));if(u)for(var b=function(t){if("undefined"===typeof window||!d)return h(t);try{return h(t)}catch(e){return!1}}(t),v=0;v<l.length;++v)b&&"constructor"===l[v]||!i.call(t,l[v])||f.push(l[v]);return f}}t.exports=n},24892:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(27635),o=Object.keys,s=o?function(t){return o(t)}:r(41949),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},27635:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},85913:t=>{const e={},r=t=>{t.addEventListener("message",(e=>{r.dispatchEvent("message",t,e)})),t.port&&t.port.addEventListener("message",(e=>{r.dispatchEvent("message",t,e)}))};r.addEventListener=(t,r)=>{e[t]||(e[t]=[]),e[t].push(r)},r.removeEventListener=(t,r)=>{e[t]&&(e[t]=e[t].filter((t=>t===r)))},r.dispatchEvent=function(){const t=Array.prototype.slice.call(arguments),r=t.shift();e[r]&&e[r].forEach((e=>e.apply(null,t)))},t.exports=r},61552:(t,e,r)=>{"use strict";const n=r(22514),i=r(28055);t.exports=(t,e)=>{const r=n(t,{...e,count:1});return i.fn((async t=>{t((()=>{r.cancel()}));const[e]=await r;return e}))()},t.exports.AggregateError=n.AggregateError},28055:t=>{"use strict";class e extends Error{constructor(t){super(t||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class r{static fn(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return new r(((e,r,i)=>{n.push(i),t(...n).then(e,r)}))}}constructor(t){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((e,r)=>{this._reject=r;const n=t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)};return Object.defineProperties(n,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}}),t((t=>{this._isCanceled&&n.shouldReject||(this._isPending=!1,e(t))}),(t=>{this._isPending=!1,r(t)}),n)}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const t of this._cancelHandlers)t()}catch(r){return void this._reject(r)}this._rejectOnCancel&&this._reject(new e(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(r.prototype,Promise.prototype),t.exports=r,t.exports.CancelError=e},70121:t=>{"use strict";t.exports=()=>{const t={};return t.promise=new Promise(((e,r)=>{t.resolve=e,t.reject=r})),t}},49879:(t,e,r)=>{const n=r(75125),i=r(70121);t.exports=class{constructor(){this._buffer=new n,this._waitingConsumers=new n}push(t){const{promise:e,resolve:r}=i();return this._buffer.push({chunk:t,resolve:r}),this._consume(),e}_consume(){for(;!this._waitingConsumers.isEmpty()&&!this._buffer.isEmpty();){const t=this._waitingConsumers.shift(),e=this._buffer.shift();t.resolve(e.chunk),e.resolve()}}shift(){const{promise:t,resolve:e}=i();return this._waitingConsumers.push({resolve:e}),this._consume(),t}isEmpty(){return this._buffer.isEmpty()}}},49674:t=>{"use strict";t.exports=(t,e)=>(e=e||(()=>{}),t.then((t=>new Promise((t=>{t(e())})).then((()=>t))),(t=>new Promise((t=>{t(e())})).then((()=>{throw t})))))},12906:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(97143),i=r(39744),o=r(95152),s=()=>{},a=new i.TimeoutError;e.default=class extends n{constructor(t){var e,r,n,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"===typeof(t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:o.default},t)).intervalCap&&t.intervalCap>=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat(null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:"","` (").concat(typeof t.intervalCap,")"));if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat(null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:"","` (").concat(typeof t.interval,")"));this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===1/0||0===t.interval,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=!0===t.throwOnTimeout,this._isPaused=!1===t.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const t=Date.now();if(void 0===this._intervalId){const e=this._intervalEnd-t;if(!(e<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),e)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const e=this._queue.dequeue();return!!e&&(this.emit("active"),e(),t&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(t){if(!("number"===typeof t&&t>=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(t,"` (").concat(typeof t,")"));this._concurrency=t,this._processQueue()}async add(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const o=void 0===this._timeout&&void 0===e.timeout?t():i.default(Promise.resolve(t()),void 0===e.timeout?this._timeout:e.timeout,(()=>{(void 0===e.throwOnTimeout?this._throwOnTimeout:e.throwOnTimeout)&&n(a)}));r(await o)}catch(o){n(o)}this._next()}),e),this._tryToStartAnother(),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((t=>{const e=this._resolveEmpty;this._resolveEmpty=()=>{e(),t()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((t=>{const e=this._resolveIdle;this._resolveIdle=()=>{e(),t()}}))}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}}},57009:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){let n=0,i=t.length;for(;i>0;){const o=i/2|0;let s=n+o;r(t[s],e)<=0?(n=++s,i-=o+1):i=o}return n}},95152:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(57009);e.default=class{constructor(){this._queue=[]}enqueue(t,e){const r={priority:(e=Object.assign({priority:0},e)).priority,run:t};if(this.size&&this._queue[this.size-1].priority>=e.priority)return void this._queue.push(r);const i=n.default(this._queue,r,((t,e)=>e.priority-t.priority));this._queue.splice(i,0,r)}dequeue(){const t=this._queue.shift();return null===t||void 0===t?void 0:t.run}filter(t){return this._queue.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this._queue.length}}},39744:(t,e,r)=>{"use strict";const n=r(49674);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}const o=(t,e,r)=>new Promise(((o,s)=>{if("number"!==typeof e||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0)return void o(t);const a=setTimeout((()=>{if("function"===typeof r){try{o(r())}catch(u){s(u)}return}const n="string"===typeof r?r:"Promise timed out after ".concat(e," milliseconds"),a=r instanceof Error?r:new i(n);"function"===typeof t.cancel&&t.cancel(),s(a)}),e);n(t.then(o,s),(()=>{clearTimeout(a)}))}));t.exports=o,t.exports.default=o,t.exports.TimeoutError=i},92963:t=>{"use strict";const e=async t=>{try{return{isFulfilled:!0,isRejected:!1,value:await t}}catch(e){return{isFulfilled:!1,isRejected:!0,reason:e}}};t.exports=e,t.exports.default=e},51545:(t,e,r)=>{"use strict";const n=r(99158),i=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class o extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,({message:t}=t)):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const s=(t,e)=>new Promise(((r,s)=>{e={onFailedAttempt:()=>{},retries:10,...e};const a=n.operation(e);a.attempt((async n=>{try{r(await t(n))}catch(c){if(!(c instanceof Error))return void s(new TypeError('Non-error was thrown: "'.concat(c,'". You should only throw errors.')));if(c instanceof o)a.stop(),s(c.originalError);else if(c instanceof TypeError&&(u=c.message,!i.includes(u)))a.stop(),s(c);else{((t,e,r)=>{const n=r.retries-(e-1);t.attemptNumber=e,t.retriesLeft=n})(c,n,e);try{await e.onFailedAttempt(c)}catch(c){return void s(c)}a.retry(c)||s(a.mainError())}}var u}))}));t.exports=s,t.exports.default=s,t.exports.AbortError=o},3781:(t,e,r)=>{"use strict";const n=r(92963),i=r(56266);t.exports=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{concurrency:r=1/0}=e,o=i(r);return Promise.all(t.map((t=>t&&"function"===typeof t.then?n(t):n("function"===typeof t?o((()=>t())):Promise.resolve(t)))))}},56266:(t,e,r)=>{"use strict";const n=r(23731),i=t=>{if(!Number.isInteger(t)&&t!==1/0||!(t>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const e=[];let r=0;const i=()=>{r--,e.length>0&&e.shift()()},o=function(t,e){r++;for(var o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];const u=n(t,...s);e(u),u.then(i,i)},s=function(n,i){for(var s=arguments.length,a=new Array(s>2?s-2:0),u=2;u<s;u++)a[u-2]=arguments[u];r<t?o(n,i,...a):e.push(o.bind(null,n,i,...a))},a=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return new Promise((e=>s(t,e,...r)))};return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),a};t.exports=i,t.exports.default=i},22514:(t,e,r)=>{"use strict";const n=r(64928),i=r(28055);class o extends Error{}t.exports=(t,e)=>new i(((r,i,s)=>{const{count:a,filter:u=(()=>!0)}=e;if(!Number.isFinite(a))return void i(new TypeError("Expected a finite number, got ".concat(typeof e.count)));const c=[],l=[];let h=0,f=!1;const d=new Set,p=()=>{for(const e of t)d.has(e)||"function"!==typeof e.cancel||e.cancel()};s(p);for(const e of t)h++,(async()=>{try{const t=await e;if(f)return;if(!u(t))throw new o("Value does not satisfy filter");c.push(t)}catch(t){l.push(t)}finally{d.add(e),!f&&(c.length===a&&(r(c),f=!0),h-l.length<a&&(i(new n(l)),f=!0),f)&&p()}})();a>h&&(i(new RangeError("Expected input to contain at least ".concat(e.count," items, but contains ").concat(h," items"))),p())})),t.exports.AggregateError=n,t.exports.FilterError=o},23807:t=>{"use strict";class e extends Error{constructor(t){super(t),this.name="TimeoutError"}}const r=(t,r,n,i)=>{let o;const s=new Promise(((s,a)=>{if("number"!==typeof r||r<0)throw new TypeError("Expected `milliseconds` to be a positive number");r!==1/0?(i={customTimers:{setTimeout:setTimeout,clearTimeout:clearTimeout},...i},o=i.customTimers.setTimeout.call(void 0,(()=>{if("function"===typeof n){try{s(n())}catch(u){a(u)}return}const i="string"===typeof n?n:"Promise timed out after ".concat(r," milliseconds"),o=n instanceof Error?n:new e(i);"function"===typeof t.cancel&&t.cancel(),a(o)}),r),(async()=>{try{s(await t)}catch(e){a(e)}finally{i.customTimers.clearTimeout.call(void 0,o)}})()):s(t)}));return s.clear=()=>{clearTimeout(o),o=void 0},s};t.exports=r,t.exports.default=r,t.exports.TimeoutError=e},23731:t=>{"use strict";const e=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return new Promise((e=>{e(t(...r))}))};t.exports=e,t.exports.default=e},63465:(t,e,r)=>{"use strict";var n=r(16522);e.certificate=r(18799);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=c;var l=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=l,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var h=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=h;var f=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},18799:(t,e,r)=>{"use strict";var n=r(16522),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),l=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),h=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),f=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(l),this.key("validity").use(h),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},722:(t,e,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(48462),a=r(23525),u=r(82543).Buffer;t.exports=function(t,e){var r,c=t.toString(),l=c.match(n);if(l){var h="aes"+l[1],f=u.from(l[2],"hex"),d=u.from(l[3].replace(/[\r\n]/g,""),"base64"),p=s(e,f.slice(0,8),parseInt(l[1],10)).key,y=[],g=a.createDecipheriv(h,p,f);y.push(g.update(d)),y.push(g.final()),r=u.concat(y)}else{var m=c.match(o);r=u.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},37510:(t,e,r)=>{var n=r(63465),i=r(22562),o=r(722),s=r(23525),a=r(95896),u=r(82543).Buffer;function c(t){var e;"object"!==typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"===typeof t&&(t=u.from(t));var r,c,l=o(t,e),h=l.tag,f=l.data;switch(h){case"CERTIFICATE":c=n.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(f,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":f=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,l=t.subjectPrivateKey,h=parseInt(o.split("-")[1],10)/8,f=a.pbkdf2Sync(e,r,n,h,"sha1"),d=s.createDecipheriv(o,f,c),p=[];return p.push(d.update(l)),p.push(d.final()),u.concat(p)}(f=n.EncryptedPrivateKey.decode(f,"der"),e);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=n.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+h)}}t.exports=c,c.signature=n.signature},95896:(t,e,r)=>{e.pbkdf2=r(66770),e.pbkdf2Sync=r(68017)},66770:(t,e,r)=>{var n,i,o=r(82543).Buffer,s=r(46048),a=r(74404),u=r(68017),c=r(52734),l=r.g.crypto&&r.g.crypto.subtle,h={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[];function d(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(t,e,r,n,i){return l.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return l.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,i,y,g,m){"function"===typeof g&&(m=g,g=void 0);var b=h[(g=g||"sha1").toLowerCase()];if(b&&"function"===typeof r.g.Promise){if(s(i,y),t=c(t,a,"Password"),e=c(e,a,"Salt"),"function"!==typeof m)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){d()((function(){e(null,t)}))}),(function(t){d()((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==f[t])return f[t];var e=p(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return f[t]=e,e}(b).then((function(r){return r?p(t,e,i,y,b):u(t,e,i,y,g)})),m)}else d()((function(){var r;try{r=u(t,e,i,y,g)}catch(n){return m(n)}m(null,r)}))}},74404:(t,e,r)=>{var n,i=r(21964);if(r.g.process&&r.g.process.browser)n="utf-8";else if(r.g.process&&r.g.process.version){n=parseInt(i.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n},46048:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!==typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!==typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!==r)throw new TypeError("Bad key length")}},68017:(t,e,r)=>{var n=r(55378),i=r(83375),o=r(85730),s=r(82543).Buffer,a=r(46048),u=r(74404),c=r(52734),l=s.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(t,e,r){var a=function(t){function e(e){return o(t).update(e).digest()}function r(t){return(new i).update(t).digest()}return"rmd160"===t||"ripemd160"===t?r:"md5"===t?n:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,l],u));for(var c=s.allocUnsafe(u+h[t]),f=s.allocUnsafe(u+h[t]),d=0;d<u;d++)c[d]=54^e[d],f[d]=92^e[d];var p=s.allocUnsafe(u+r+4);c.copy(p,0,0,u),this.ipad1=p,this.ipad2=c,this.opad=f,this.alg=t,this.blocksize=u,this.hash=a,this.size=h[t]}f.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,r,n,i){a(r,n);var o=new f(i=i||"sha1",t=c(t,u,"Password"),(e=c(e,u,"Salt")).length),l=s.allocUnsafe(n),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,y=h[i],g=Math.ceil(n/y),m=1;m<=g;m++){d.writeUInt32BE(m,e.length);for(var b=o.run(d,o.ipad1),v=b,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var _=0;_<y;_++)b[_]^=v[_]}b.copy(l,p),p+=y}return l}},52734:(t,e,r)=>{var n=r(82543).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"===typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},90190:(t,e,r)=>{"use strict";const{CID:n}=r(16629),i=r(71128),o=r(45645),s=r(86898),a=r(24426),{base58btc:u}=r(86898),{base32:c}=r(71128),{base16:l}=r(24031),h=r(8315),f=r(36552),d=r(83708),{PeerIdProto:p}=r(48956),{equals:y}=r(98779),{fromString:g}=r(46765),{toString:m}=r(82051),{identity:b}=r(60173),v={...i,...o,...s,...a},w=Object.keys(v).reduce(((t,e)=>t.or(v[e])),c.decoder);const _=d(class{constructor(t,e,r){if(!(t instanceof Uint8Array))throw new Error("invalid id provided");if(e&&r&&!y(e.public.bytes,r.bytes))throw new Error("inconsistent arguments");this._id=t,this._idB58String=u.encode(this.id).substring(1),this._privKey=e,this._pubKey=r}get id(){return this._id}set id(t){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(t){this._privKey=t}get pubKey(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{const t=h.decode(this.id);t.code===b.code&&(this._pubKey=f.unmarshalPublicKey(t.digest))}catch(t){}return this._pubKey}set pubKey(t){this._pubKey=t}marshalPubKey(){if(this.pubKey)return f.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return f.marshalPrivateKey(this.privKey)}marshal(t){return p.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:t?null:this.marshalPrivKey()}).finish()}toPrint(){let t=this.toB58String();t.startsWith("Qm")&&(t=t.slice(2));let e=6;return t.length<e&&(e=t.length),"<peer.ID "+t.substr(0,e)+">"}toJSON(){return{id:this.toB58String(),privKey:A(this.marshalPrivKey()),pubKey:A(this.marshalPubKey())}}toHexString(){return l.encode(this.id).substring(1)}toBytes(){return this.id}toB58String(){return this._idB58String}toString(){if(!this._idCIDString){const t=n.createV1(114,h.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:t.toString(),enumerable:!1})}return this._idCIDString}equals(t){if(t instanceof Uint8Array)return y(this.id,t);if(t.id)return y(this.id,t.id);throw new Error("not valid Id")}isEqual(t){return this.equals(t)}isValid(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&y(this.privKey.public.bytes,this.pubKey.bytes))}hasInlinePublicKey(){try{if(h.decode(this.id).code===b.code)return!0}catch(t){}return!1}},{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});e=t.exports=_;const E=t=>t.bytes.length<=42?h.create(b.code,t.bytes).bytes:t.hash(),S=async(t,e)=>{const r=await E(e);return new _(r,t,e)};e.create=async t=>{(t=t||{}).bits=t.bits||2048,t.keyType=t.keyType||"RSA";const e=await f.generateKeyPair(t.keyType,t.bits);return S(e,e.public)},e.createFromHexString=t=>new _(l.decode("f"+t)),e.createFromBytes=t=>{try{const r=n.decode(t);if(!I(r))throw new Error("Supplied PeerID CID is invalid");return e.createFromCID(r)}catch{if(h.decode(t).code!==b.code)throw new Error("Supplied PeerID CID is invalid");return new _(t)}},e.createFromB58String=t=>e.createFromBytes(u.decode("z"+t));const I=t=>114===t.code||112===t.code;function A(t){if(t)return m(t,"base64pad")}e.createFromCID=t=>{if(!(t=n.asCID(t))||!I(t))throw new Error("Supplied PeerID CID is invalid");return new _(t.multihash.bytes)},e.createFromPubKey=async t=>{let e=t;if("string"===typeof e&&(e=g(t,"base64pad")),!(e instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const r=await f.unmarshalPublicKey(e);return S(void 0,r)},e.createFromPrivKey=async t=>{if("string"===typeof t&&(t=g(t,"base64pad")),!(t instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const e=await f.unmarshalPrivateKey(t);return S(e,e.public)},e.createFromJSON=async t=>{const e=u.decode("z"+t.id),r=t.privKey&&g(t.privKey,"base64pad"),n=t.pubKey&&g(t.pubKey,"base64pad"),i=n&&await f.unmarshalPublicKey(n);if(!r)return new _(e,void 0,i);const o=await f.unmarshalPrivateKey(r),s=await E(o.public);let a;if(i&&(a=await E(i)),i&&!y(s,a))throw new Error("Public and private key do not match");if(e&&!y(s,e))throw new Error("Id and private key do not match");return new _(e,o,i)},e.createFromProtobuf=async t=>{"string"===typeof t&&(t=g(t,"base16"));let e,r,{id:n,privKey:i,pubKey:o}=p.decode(t);if(i=!!i&&await f.unmarshalPrivateKey(i),o=!!o&&await f.unmarshalPublicKey(o),i&&(r=await E(i.public)),o&&(e=await E(o)),i){if(o&&!y(r,e))throw new Error("Public and private key do not match");return new _(r,i,i.public)}if(o)return new _(e,void 0,o);if(n)return new _(n);throw new Error("Protobuf did not contain any usable key material")},e.parse=t=>("1"!==t.charAt(0)&&"Q"!==t.charAt(0)||(t="z".concat(t)),e.createFromBytes(w.decode(t))),e.isPeerId=t=>Boolean("object"===typeof t&&t._id&&t._idB58String)},48956:(t,e,r)=>{"use strict";var n=r(80886),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-id"]||(n.roots["libp2p-peer-id"]={});a.PeerIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)null!=t[e[r]]&&(this[e[r]]=t[e[r]])}return t.prototype.id=s.newBuffer([]),t.prototype.pubKey=s.newBuffer([]),t.prototype.privKey=s.newBuffer([]),t.encode=function(t,e){return e||(e=o.create()),e.uint32(10).bytes(t.id),null!=t.pubKey&&Object.hasOwnProperty.call(t,"pubKey")&&e.uint32(18).bytes(t.pubKey),null!=t.privKey&&Object.hasOwnProperty.call(t,"privKey")&&e.uint32(26).bytes(t.privKey),e},t.decode=function(t,e){t instanceof i||(t=i.create(t));for(var r=void 0===e?t.len:t.pos+e,n=new a.PeerIdProto;t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.id=t.bytes();break;case 2:n.pubKey=t.bytes();break;case 3:n.privKey=t.bytes();break;default:t.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},t.fromObject=function(t){if(t instanceof a.PeerIdProto)return t;var e=new a.PeerIdProto;return null!=t.id&&("string"===typeof t.id?s.base64.decode(t.id,e.id=s.newBuffer(s.base64.length(t.id)),0):t.id.length&&(e.id=t.id)),null!=t.pubKey&&("string"===typeof t.pubKey?s.base64.decode(t.pubKey,e.pubKey=s.newBuffer(s.base64.length(t.pubKey)),0):t.pubKey.length&&(e.pubKey=t.pubKey)),null!=t.privKey&&("string"===typeof t.privKey?s.base64.decode(t.privKey,e.privKey=s.newBuffer(s.base64.length(t.privKey)),0):t.privKey.length&&(e.privKey=t.privKey)),e},t.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.id="":(r.id=[],e.bytes!==Array&&(r.id=s.newBuffer(r.id))),e.bytes===String?r.pubKey="":(r.pubKey=[],e.bytes!==Array&&(r.pubKey=s.newBuffer(r.pubKey))),e.bytes===String?r.privKey="":(r.privKey=[],e.bytes!==Array&&(r.privKey=s.newBuffer(r.privKey)))),null!=t.id&&t.hasOwnProperty("id")&&(r.id=e.bytes===String?s.base64.encode(t.id,0,t.id.length):e.bytes===Array?Array.prototype.slice.call(t.id):t.id),null!=t.pubKey&&t.hasOwnProperty("pubKey")&&(r.pubKey=e.bytes===String?s.base64.encode(t.pubKey,0,t.pubKey.length):e.bytes===Array?Array.prototype.slice.call(t.pubKey):t.pubKey),null!=t.privKey&&t.hasOwnProperty("privKey")&&(r.privKey=e.bytes===String?s.base64.encode(t.privKey,0,t.privKey.length):e.bytes===Array?Array.prototype.slice.call(t.privKey):t.privKey),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},t}(),t.exports=a},83931:(t,e,r)=>{"use strict";t.exports=r(53794).default},53794:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(27922),o=n(r(28974)),s=n(r(62795)),a=r(87201),u=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"].map((t=>new i.Netmask(t)));function c(t){return/^::$/.test(t)||/^::1$/.test(t)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(t)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(t)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(t)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(t)||/^ff([0-9a-fA-F]{2,2}):/i.test(t)}e.default=t=>{if(a.isValid(t)){const e=a.parse(t);if("ipv4"===e.kind())return function(t){for(let e of u)if(e.contains(t))return!0;return!1}(e.toNormalizedString());if("ipv6"===e.kind())return c(t)}else if(s.default(t)&&o.default.v6().test(t))return c(t)}},58541:t=>{"use strict";var e;t.exports.timeout=function(t,r){var n,i=new e;return Promise.race([t,new Promise((function(t,e){n=setTimeout((function(){e(i)}),r)}))]).then((function(t){return clearTimeout(n),t}),(function(t){throw clearTimeout(n),t}))};(e=t.exports.TimeoutError=function(){Error.call(this),this.stack=Error().stack,this.message="Timeout"}).prototype=Object.create(Error.prototype),e.prototype.name="TimeoutError"},80886:(t,e,r)=>{"use strict";t.exports=r(94722)},94722:(t,e,r)=>{"use strict";var n=e;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(77063),n.BufferWriter=r(72815),n.Reader=r(36216),n.BufferReader=r(33557),n.util=r(3097),n.rpc=r(79994),n.roots=r(77907),n.configure=i,i()},36216:(t,e,r)=>{"use strict";t.exports=u;var n,i=r(3097),o=i.LongBits,s=i.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var c="undefined"!==typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},l=function(){return i.Buffer?function(t){return(u.create=function(t){return i.Buffer.isBuffer(t)?new n(t):c(t)})(t)}:c};function h(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function f(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw a(this,8);return new o(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}u.create=l(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=function(){var t=4294967295;return function(){if(t=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return t;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return t}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,r=this.pos+t;if(r>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,r):e===r?new this.buf.constructor(0):this._slice.call(this.buf,e,r)},u.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},u.prototype.skip=function(t){if("number"===typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){n=t,u.create=l(),n._configure();var e=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return h.call(this)[e](!1)},uint64:function(){return h.call(this)[e](!0)},sint64:function(){return h.call(this).zzDecode()[e](!1)},fixed64:function(){return d.call(this)[e](!0)},sfixed64:function(){return d.call(this)[e](!1)}})}},33557:(t,e,r)=>{"use strict";t.exports=o;var n=r(36216);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(3097);function o(t){n.call(this,t)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},77907:t=>{"use strict";t.exports={}},79994:(t,e,r)=>{"use strict";e.Service=r(64281)},64281:(t,e,r)=>{"use strict";t.exports=i;var n=r(3097);function i(t,e,r){if("function"!==typeof t)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function t(e,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(t,a,e,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(e,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(t,r){if(t)return a.emit("error",t,e),s(t);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(t){return a.emit("error",t,e),s(t)}return a.emit("data",r,e),s(null,r)}a.end(!0)}))}catch(u){return a.emit("error",u,e),void setTimeout((function(){s(u)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},69351:(t,e,r)=>{"use strict";t.exports=i;var n=r(3097);function i(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var r=t>>>0,n=(t-r)/4294967296>>>0;return e&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(t){if("number"===typeof t)return i.fromNumber(t);if(n.isString(t)){if(!n.Long)return i.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new i(t.low>>>0,t.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,r=~this.hi>>>0;return e||(r=r+1>>>0),-(e+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;i.fromHash=function(t){return t===s?o:new i((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:r<128?9:10}},3097:function(t,e,r){"use strict";var n=e;function i(t,e,r){for(var n=Object.keys(e),i=0;i<n.length;++i)void 0!==t[n[i]]&&r||(t[n[i]]=e[n[i]]);return t}function o(t){function e(t,r){if(!(this instanceof e))return new e(t,r);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}n.asPromise=r(17206),n.base64=r(70001),n.EventEmitter=r(27111),n.float=r(30802),n.inquire=r(77172),n.utf8=r(93861),n.pool=r(58236),n.LongBits=r(69351),n.isNode=Boolean("undefined"!==typeof r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!==typeof window&&window||"undefined"!==typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t},n.isString=function(t){return"string"===typeof t||t instanceof String},n.isObject=function(t){return t&&"object"===typeof t},n.isset=n.isSet=function(t,e){var r=t[e];return!(null==r||!t.hasOwnProperty(e))&&("object"!==typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var t=n.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(t){return"number"===typeof t?n.Buffer?n._Buffer_allocUnsafe(t):new n.Array(t):n.Buffer?n._Buffer_from(t):"undefined"===typeof Uint8Array?t:new Uint8Array(t)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(t){return t?n.LongBits.from(t).toHash():n.LongBits.zeroHash},n.longFromHash=function(t,e){var r=n.LongBits.fromHash(t);return n.Long?n.Long.fromBits(r.lo,r.hi,e):r.toNumber(Boolean(e))},n.merge=i,n.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(t){for(var e={},r=0;r<t.length;++r)e[t[r]]=1;return function(){for(var t=Object.keys(this),r=t.length-1;r>-1;--r)if(1===e[t[r]]&&void 0!==this[t[r]]&&null!==this[t[r]])return t[r]}},n.oneOfSetter=function(t){return function(e){for(var r=0;r<t.length;++r)t[r]!==e&&delete this[t[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var t=n.Buffer;t?(n._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},n._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},77063:(t,e,r)=>{"use strict";t.exports=h;var n,i=r(3097),o=i.LongBits,s=i.base64,a=i.utf8;function u(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function c(){}function l(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function h(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(h.create=function(){return new n})()}:function(){return new h}};function d(t,e,r){e[r]=255&t}function p(t,e){this.len=t,this.next=void 0,this.val=e}function y(t,e,r){for(;t.hi;)e[r++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=127&t.lo|128,t.lo=t.lo>>>7;e[r++]=t.lo}function g(t,e,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}h.create=f(),h.alloc=function(t){return new i.Array(t)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(t,e,r){return this.tail=this.tail.next=new u(t,e,r),this.len+=e,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(t,e,r){for(;t>127;)e[r++]=127&t|128,t>>>=7;e[r]=t},h.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new p((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},h.prototype.int32=function(t){return t<0?this._push(y,10,o.fromNumber(t)):this.uint32(t)},h.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},h.prototype.uint64=function(t){var e=o.from(t);return this._push(y,e.length(),e)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(y,e.length(),e)},h.prototype.bool=function(t){return this._push(d,1,t?1:0)},h.prototype.fixed32=function(t){return this._push(g,4,t>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(t){var e=o.from(t);return this._push(g,4,e.lo)._push(g,4,e.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(t){return this._push(i.float.writeFloatLE,4,t)},h.prototype.double=function(t){return this._push(i.float.writeDoubleLE,8,t)};var m=i.Array.prototype.set?function(t,e,r){e.set(t,r)}:function(t,e,r){for(var n=0;n<t.length;++n)e[r+n]=t[n]};h.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(d,1,0);if(i.isString(t)){var r=h.alloc(e=s.length(t));s.decode(t,r,0),t=r}return this.uint32(e)._push(m,e,t)},h.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):this._push(d,1,0)},h.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},h.prototype.ldelim=function(){var t=this.head,e=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=t.next,this.tail=e,this.len+=r),this},h.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),r=0;t;)t.fn(t.val,e,r),r+=t.len,t=t.next;return e},h._configure=function(t){n=t,h.create=f(),n._configure()}},72815:(t,e,r)=>{"use strict";t.exports=o;var n=r(77063);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(3097);function o(){n.call(this)}function s(t,e,r){t.length<40?i.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(t,e,r){e.set(t,r)}:function(t,e,r){if(t.copy)t.copy(e,r,0,t.length);else for(var n=0;n<t.length;)e[r++]=t[n++]}},o.prototype.bytes=function(t){i.isString(t)&&(t=i._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=i.Buffer.byteLength(t);return this.uint32(e),e&&this._push(s,e,t),this},o._configure()},57874:(t,e,r)=>{var n=r(96650),i=r(5586);t.exports=n,t.exports.parse=n,t.exports.stringify=i},96650:(t,e,r)=>{var n=r(29729),i=["int32","int64","uint32","uint64","sint32","sint64","bool","fixed64","sfixed64","double","fixed32","sfixed32","float"],o=function(t){var e=t.shift();if("{"!==e)return e;e={};for(var r="";t.length;)switch(t[0]){case"}":return t.shift(),e;case":":t.shift(),e[r]=o(t);break;default:r=t.shift()}},s=function(t){for(var e={};t.length;)switch(t[0]){case"[":case",":t.shift();var r=t.shift();"("===r&&(r=t.shift(),t.shift());var n=[];if("."===t[0][0]&&(n=t[0].substr(1).split("."),t.shift()),"="!==t[0])throw new Error("Unexpected token in field options: "+t[0]);if(t.shift(),"]"===t[0])throw new Error("Unexpected ] in field option");var i=[r].concat(n),s=i.pop();i.reduce((function(t,e,r){return null==t[e]&&(t[e]={}),t[e]}),e)[s]=o(t);break;case"]":return t.shift(),e;default:throw new Error("Unexpected token in field options: "+t[0])}throw new Error("No closing tag for field options")},a=function(t){for(var e={name:null,type:null,tag:-1,map:null,oneof:null,required:!1,repeated:!1,options:{}};t.length;)switch(t[0]){case"=":t.shift(),e.tag=Number(t.shift());break;case"map":if(e.type="map",e.map={from:null,to:null},t.shift(),"<"!==t[0])throw new Error("Unexpected token in map type: "+t[0]);if(t.shift(),e.map.from=t.shift(),","!==t[0])throw new Error("Unexpected token in map type: "+t[0]);if(t.shift(),e.map.to=t.shift(),">"!==t[0])throw new Error("Unexpected token in map type: "+t[0]);t.shift(),e.name=t.shift();break;case"repeated":case"required":case"optional":var r=t.shift();e.required="required"===r,e.repeated="repeated"===r,e.type=t.shift(),e.name=t.shift();break;case"[":e.options=s(t);break;case";":if(null===e.name)throw new Error("Missing field name");if(null===e.type)throw new Error("Missing type in message field: "+e.name);if(-1===e.tag)throw new Error("Missing tag number in message field: "+e.name);return t.shift(),e;default:throw new Error("Unexpected token in message field: "+t[0])}throw new Error("No ; found for message field")},u=function(t){for(var e={enums:[],options:{},messages:[],fields:[],extends:[],extensions:null};t.length;)switch(t[0]){case"map":case"repeated":case"optional":case"required":e.fields.push(a(t));break;case"enum":e.enums.push(y(t));break;case"message":e.messages.push(h(t));break;case"extensions":e.extensions=l(t);break;case"oneof":t.shift();var r=t.shift();if("{"!==t[0])throw new Error("Unexpected token in oneof: "+t[0]);for(t.shift();"}"!==t[0];){t.unshift("optional");var n=a(t);n.oneof=r,e.fields.push(n)}t.shift();break;case"extend":e.extends.push(c(t));break;case";":t.shift();break;case"reserved":for(t.shift();";"!==t[0];)t.shift();break;case"option":var i=g(t);if(void 0!==e.options[i.name])throw new Error("Duplicate option "+i.name);e.options[i.name]=i.value;break;default:t.unshift("optional"),e.fields.push(a(t))}return e},c=function(t){return{name:t[1],message:h(t)}},l=function(t){t.shift();var e=Number(t.shift());if(isNaN(e))throw new Error("Invalid from in extensions definition");if("to"!==t.shift())throw new Error("Expected keyword 'to' in extensions definition");var r=t.shift();if("max"===r&&(r=536870911),r=Number(r),isNaN(r))throw new Error("Invalid to in extensions definition");if(";"!==t.shift())throw new Error("Missing ; in extensions definition");return{from:e,to:r}},h=function(t){t.shift();var e=1,r=[],n={name:t.shift(),options:{},enums:[],extends:[],messages:[],fields:[]};if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("{"===t[0]?e++:"}"===t[0]&&e--,!e)return t.shift(),r=u(r),n.enums=r.enums,n.messages=r.messages,n.fields=r.fields,n.extends=r.extends,n.extensions=r.extensions,n.options=r.options,n;r.push(t.shift())}if(e)throw new Error("No closing tag for message")},f=function(t){t.shift();var e=t.shift();if(";"!==t[0])throw new Error("Expected ; but found "+t[0]);return t.shift(),e},d=function(t){if(t.shift(),"="!==t[0])throw new Error("Expected = but found "+t[0]);t.shift();var e=t.shift();switch(e){case'"proto2"':e=2;break;case'"proto3"':e=3;break;default:throw new Error("Expected protobuf syntax version but found "+e)}if(";"!==t[0])throw new Error("Expected ; but found "+t[0]);return t.shift(),e},p=function(t){if(t.length<4)throw new Error("Invalid enum value: "+t.slice(0,3).join(" "));if("reserved"===t[0]){for(t.shift();";"!==t[0];)t.shift();return t.shift(),null}if("="!==t[1])throw new Error("Expected = but found "+t[1]);if(";"!==t[3]&&"["!==t[3])throw new Error("Expected ; or [ but found "+t[1]);var e=t.shift();t.shift();var r={value:null,options:{}};return r.value=Number(t.shift()),"["===t[0]&&(r.options=s(t)),t.shift(),{name:e,val:r}},y=function(t){t.shift();var e={},r={name:t.shift(),values:{},options:{}};if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("}"===t[0])return t.shift(),";"===t[0]&&t.shift(),r;if("option"!==t[0]){var n=p(t);null!==n&&(r.values[n.name]=n.val)}else e=g(t),r.options[e.name]=e.value}throw new Error("No closing tag for enum")},g=function(t){for(var e=null,r=null,n=function(t){return"true"===t||"false"!==t&&t.replace(/^"+|"+$/gm,"")};t.length;){if(";"===t[0])return t.shift(),{name:e,value:r};switch(t[0]){case"option":t.shift();var i="("===t[0];if(i&&t.shift(),e=t.shift(),i){if(")"!==t[0])throw new Error("Expected ) but found "+t[0]);t.shift()}"."===t[0][0]&&(e+=t.shift());break;case"=":if(t.shift(),null===e)throw new Error("Expected key for option with value: "+t[0]);if(r=n(t.shift()),"optimize_for"===e&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(r))throw new Error("Unexpected value for option optimize_for: "+r);"{"===r&&(r=m(t));break;default:throw new Error("Unexpected token in option: "+t[0])}}},m=function(t){for(var e=function(t){return"true"===t||"false"!==t&&t.replace(/^"+|"+$/gm,"")},r={};t.length;){if("}"===t[0])return t.shift(),r;var n="("===t[0];n&&t.shift();var i=t.shift();if(n){if(")"!==t[0])throw new Error("Expected ) but found "+t[0]);t.shift()}var o=null;switch(t[0]){case":":if(void 0!==r[i])throw new Error("Duplicate option map key "+i);t.shift(),"{"===(o=e(t.shift()))&&(o=m(t)),r[i]=o,";"===t[0]&&t.shift();break;case"{":if(t.shift(),o=m(t),void 0===r[i]&&(r[i]=[]),!Array.isArray(r[i]))throw new Error("Duplicate option map key "+i);r[i].push(o);break;default:throw new Error("Unexpected token in option map: "+t[0])}}throw new Error("No closing tag for option map")},b=function(t){t.shift();var e=t.shift().replace(/^"+|"+$/gm,"");if(";"!==t[0])throw new Error("Unexpected token: "+t[0]+'. Expected ";"');return t.shift(),e},v=function(t){t.shift();var e={name:t.shift(),methods:[],options:{}};if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("}"===t[0])return t.shift(),";"===t[0]&&t.shift(),e;switch(t[0]){case"option":var r=g(t);if(void 0!==e.options[r.name])throw new Error("Duplicate option "+r.name);e.options[r.name]=r.value;break;case"rpc":e.methods.push(w(t));break;default:throw new Error("Unexpected token in service: "+t[0])}}throw new Error("No closing tag for service")},w=function(t){t.shift();var e={name:t.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==t[0])throw new Error("Expected ( but found "+t[0]);if(t.shift(),"stream"===t[0]&&(t.shift(),e.client_streaming=!0),e.input_type=t.shift(),")"!==t[0])throw new Error("Expected ) but found "+t[0]);if(t.shift(),"returns"!==t[0])throw new Error("Expected returns but found "+t[0]);if(t.shift(),"("!==t[0])throw new Error("Expected ( but found "+t[0]);if(t.shift(),"stream"===t[0]&&(t.shift(),e.server_streaming=!0),e.output_type=t.shift(),")"!==t[0])throw new Error("Expected ) but found "+t[0]);if(t.shift(),";"===t[0])return t.shift(),e;if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("}"===t[0])return t.shift(),";"===t[0]&&t.shift(),e;if("option"!==t[0])throw new Error("Unexpected token in rpc options: "+t[0]);var r=g(t);if(void 0!==e.options[r.name])throw new Error("Duplicate option "+r.name);e.options[r.name]=r.value}throw new Error("No closing tag for rpc")};t.exports=function(t){for(var e=n(t.toString()),r=0;r<e.length;r++){var o;if(/^("|')([^'"]*)$/.test(e[r]))for(o=1===e[r].length?r+1:r;o<e.length;o++)if(/^[^'"\\]*(?:\\.[^'"\\]*)*("|')$/.test(e[o])){e=e.slice(0,r).concat(e.slice(r,o+1).join("")).concat(e.slice(o+1));break}}for(var s={syntax:3,package:null,imports:[],enums:[],messages:[],options:{},extends:[]},a=!0;e.length;){switch(e[0]){case"package":s.package=f(e);break;case"syntax":if(!a)throw new Error("Protobuf syntax version should be first thing in file");s.syntax=d(e);break;case"message":s.messages.push(h(e));break;case"enum":s.enums.push(y(e));break;case"option":var u=g(e);if(s.options[u.name])throw new Error("Duplicate option "+u.name);s.options[u.name]=u.value;break;case"import":s.imports.push(b(e));break;case"extend":s.extends.push(c(e));break;case"service":s.services||(s.services=[]),s.services.push(v(e));break;default:throw new Error("Unexpected token: "+e[0])}a=!1}return s.extends.forEach((function(t){s.messages.forEach((function(e){e.name===t.name&&t.message.fields.forEach((function(t){if(!e.extensions||t.tag<e.extensions.from||t.tag>e.extensions.to)throw new Error(e.name+" does not declare "+t.tag+" as an extension number");e.fields.push(t)}))}))})),s.messages.forEach((function(t){t.fields.forEach((function(e){var r,n,o,a;if(e.options&&"true"===e.options.packed&&-1===i.indexOf(e.type)){if(-1===e.type.indexOf(".")){if(t.enums&&t.enums.some((function(t){return t.name===e.type})))return}else{if((r=e.type.split(".")).length>2)throw new Error("what is this?");if(n=r[0],o=r[1],s.messages.some((function(t){if(t.name===n)return a=t,t})),a&&a.enums&&a.enums.some((function(t){return t.name===o})))return}throw new Error("Fields of type "+e.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}}))})),s}},5586:t=>{var e=function(t,e){var r=t.repeated?"repeated":t.required?"required":"optional";"map"===t.type&&(r="map<"+t.map.from+","+t.map.to+">"),t.oneof&&(r="");var n=Object.keys(t.options||{}).map((function(e){return e+" = "+t.options[e]})).join(",");return n&&(n=" ["+n+"]"),e.push((r?r+" ":"")+("map"===t.map?"":t.type+" ")+t.name+" = "+t.tag+n+";"),e},r=function(t,i){i.push("message "+t.name+" {"),t.options||(t.options={}),o(t.options,i),t.enums||(t.enums=[]),t.enums.forEach((function(t){i.push(n(t,[]))})),t.messages||(t.messages=[]),t.messages.forEach((function(t){i.push(r(t,[]))}));var s={};return t.fields||(t.fields=[]),t.fields.forEach((function(t){t.oneof?(s[t.oneof]||(s[t.oneof]=[]),s[t.oneof].push(e(t,[]))):i.push(e(t,[]))})),Object.keys(s).forEach((function(t){s[t].unshift("oneof "+t+" {"),s[t].push("}"),i.push(s[t])})),i.push("}",""),i},n=function(t,e){e.push("enum "+t.name+" {"),t.options||(t.options={});var r=o(t.options,[]);return r.length>1&&e.push(r.slice(0,-1)),Object.keys(t.values).map((function(r){var n=i(t.values[r]);e.push([r+" = "+n+";"])})),e.push("}",""),e},i=function(t,e){var r=Object.keys(t.options||{}).map((function(e){return e+" = "+t.options[e]})).join(",");return r&&(r=" ["+r+"]"),t.value+r},o=function(t,e){var r=Object.keys(t);return r.forEach((function(r){var n=t[r];~r.indexOf(".")&&(r="("+r+")");var i=typeof n;"object"===i?(n=s(n,[])).length&&e.push("option "+r+" = {",n,"};"):("string"===i&&"optimize_for"!==r&&(n='"'+n+'"'),e.push("option "+r+" = "+n+";"))})),r.length>0&&e.push(""),e},s=function(t,e){return Object.keys(t).forEach((function(r){var n=t[r],i=typeof n;"object"===i?Array.isArray(n)?n.forEach((function(t){(t=s(t,[])).length&&e.push(r+" {",t,"}")})):(n=s(n,[])).length&&e.push(r+" {",n,"}"):("string"===i&&(n='"'+n+'"'),e.push(r+": "+n))})),e},a=function(t,e){var r="rpc "+t.name+"(";t.client_streaming&&(r+="stream "),r+=t.input_type+") returns (",t.server_streaming&&(r+="stream "),r+=t.output_type+")",t.options||(t.options={});var n=o(t.options,[]);return n.length>1?e.push(r+" {",n.slice(0,-1),"}"):e.push(r+";"),e},u=function(t){return function(e){return Array.isArray(e)?e.map(u(t+" ")).join("\n"):t+e}};t.exports=function(t){var e=[];return e.push('syntax = "proto'+t.syntax+'";',""),t.package&&e.push("package "+t.package+";",""),t.imports&&t.imports.forEach((function(t){!function(t,e){e.push('import "'+t+'";',"")}(t,e)})),t.options||(t.options={}),o(t.options,e),t.enums||(t.enums=[]),t.enums.forEach((function(t){n(t,e)})),t.messages||(t.messages=[]),t.messages.forEach((function(t){r(t,e)})),t.services&&t.services.forEach((function(t){!function(t,e){e.push("service "+t.name+" {"),t.options||(t.options={}),o(t.options,e),t.methods||(t.methods=[]),t.methods.forEach((function(t){e.push(a(t,[]))})),e.push("}","")}(t,e)})),e.map(u("")).join("\n")}},29729:t=>{t.exports=function(t){var e,r=function(t){return t.trim()},n=[];return t.replace(/"(\\"|[^"\n])*?"|'(\\'|[^'\n])*?'/gm,(e=n,function(t){var r="$"+e.length+"$";return e.push(t),r})).replace(/([;,{}()=:[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(r).filter(Boolean).map((function(t){var e=t.indexOf("//");return e>-1?t.slice(0,e):t})).map(r).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var t=!1;return function(e){return"/*"===e?(t=!0,!1):"*/"===e?(t=!1,!1):!t}}()).map(function(t){var e=/^\$(\d+)\$$/;return function(r){var n=r.match(e);return n?t[+n[1]]:r}}(n))}},47027:t=>{t.exports=function t(e,r){var n,i=0,o=0,s=r=r||0,a=e.length;do{if(s>=a)throw t.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=s-r,i}},15223:t=>{t.exports=function t(r,n,i){n=n||[];var o=i=i||0;for(;r>=e;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,t.bytes=i-o+1,n};var e=Math.pow(2,31)},99863:(t,e,r)=>{t.exports={encode:r(15223),decode:r(47027),encodingLength:r(38234)}},38234:t=>{var e=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),s=Math.pow(2,42),a=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);t.exports=function(t){return t<e?1:t<r?2:t<n?3:t<i?4:t<o?5:t<s?6:t<a?7:t<u?8:t<c?9:10}},85942:(t,e,r)=>{"use strict";const n=r(99863),i=r(7626).r;function o(t){return"".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1))}function s(t,e,r,n){if(Object.prototype.hasOwnProperty.call(t,e))return;const i=o(e);Object.defineProperties(t,{[e]:{enumerable:!0,configurable:!0,set:t=>{r=t},get:()=>void 0===r?n:r},["has".concat(i)]:{configurable:!0,value:()=>void 0!==r},["set".concat(i)]:{configurable:!0,value:t=>{r=t}},["get".concat(i)]:{configurable:!0,value:()=>r},["clear".concat(i)]:{configurable:!0,value:()=>{r=void 0,t[e]=void 0}}})}var a=function(t,e,r,i){switch(t){case 0:return n.decode(e,i),i+n.decode.bytes;case 1:return i+8;case 2:var o=n.decode(e,i);return i+n.decode.bytes+o;case 3:case 4:throw new Error("Groups are not supported");case 5:return i+4;default:throw new Error("Unknown wire type: "+t)}},u=function(t){if(t.map)return{};if(t.repeated)return[];switch(t.type){case"string":return"";case"bool":return!1;case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return 0;default:return null}},c=function(t,e){if(void 0===e)return e;switch(t.type){case"bool":return"true"===e;case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return parseInt(e,10);default:return e}};t.exports=function(t,e,r){const l=[],h={},f=[],d=[];for(var p=0;p<r.length;p++){const r=t.fields[p];h[r.tag]=p;const n=r.options&&r.options.default,i=e(r.type,t.id,!1);d[p]=[n,i&&i.values],t.fields[p].packed=r.repeated&&r.options&&r.options.packed&&"false"!==r.options.packed,r.required&&l.push(r.name),r.oneof&&f.push(r.name)}function y(t,e,r,i,a,u,c){const l=e.name;if(e.oneof){const t=Object.keys(r);for(var h=0;h<t.length;h++)if(f.indexOf(t[h])>-1){const e=o(t[h]);delete r["has".concat(e)],delete r["get".concat(e)],delete r["set".concat(e)],delete r["clear".concat(e)],delete r[t[h]]}}let d;if(t.message){const o=n.decode(i,u);u+=n.decode.bytes;const s=t.decode(i,a,u,u+o);e.map?(d=r[l]||{},d[s.key]=s.value):e.repeated?(d=r[l]||[],d.push(s)):d=s}else e.repeated?(d=r[l]||[],d.push(t.decode(i,a,u))):d=t.decode(i,a,u);return s(r,l,d),u+=t.decode.bytes}return function e(o,p,g,m){if(null==g&&(g=0),null==m&&(m=o.length),!(m<=o.length&&g<=o.length))throw new Error("Decoded message is not valid");p||(p=new DataView(o.buffer,o.byteOffset,o.byteLength));for(var b,v=g,w={};;){if(m<=g){var _,E,S="",I=0;for(I=0;I<l.length;I++)if(S=l[I],!i(w[S]))throw new Error("Decoded message is not valid, missing required field: "+S);for(I=0;I<r.length;I++){let e;if(b=t.fields[I],E=d[I][0],_=d[I][1],S=b.name,!Object.prototype.hasOwnProperty.call(w,S)){var A=!1;if(b.oneof)for(var M=Object.keys(w),T=0;T<M.length;T++)if(f.indexOf(M[T])>-1){A=!0;break}A||(_?b.repeated?E=[]:(E=E&&_[E]?_[E].value:_[Object.keys(_)[0]].value,E=parseInt(E||0,10)):(e=u(b),E=c(b,E)),s(w,S,E,e))}}return e.bytes=g-v,w}var R=n.decode(o,g);g+=n.decode.bytes;var k=h[R>>3];if(null!=k){var C=r[k];if((b=t.fields[k]).packed){var P=n.decode(o,g);for(P+=g+=n.decode.bytes;g<P;)g=y(C,b,w,o,p,g)}else g=y(C,b,w,o,p,g)}else g=a(7&R,o,p,g)}}}},17837:(t,e,r)=>{"use strict";var n=r(7626).r,i=r(99863);t.exports=function(t,e,r,o,s){const a=Object.keys(o),u=r.length,c={};for(let n=0;n<u;n++){c[n]={p:i.encode(t.fields[n].tag<<3|2),h:i.encode(t.fields[n].tag<<3|r[n].type)};const e=t.fields[n];t.fields[n].packed=e.repeated&&e.options&&e.options.packed&&"false"!==e.options.packed}function l(t,e,r,n,o,s,a){let u=0;if(!s)for(u=0;u<n.length;u++)t[r++]=n[u];return o.message&&(i.encode(o.encodingLength(a),t,r),r+=i.encode.bytes),o.encode(a,t,e,r),r+o.encode.bytes}return function e(h,f,d){let p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;null==f&&(f=new Uint8Array(s(h))),null==d&&(d=new DataView(f.buffer,f.byteOffset,f.byteLength));const y=p,g=Object.keys(h);let m=0,b=!1;for(m=0;m<a.length;m++){const t=a[m],e=o[m];if(g.indexOf(e)>-1){if(b)throw new Error("only one of the properties defined in oneof "+t+" can be set");b=!0}}for(m=0;m<u;m++){const e=r[m],o=t.fields[m];let s=h[o.name],a=0;if(!n(s)){if(o.required)throw new Error(o.name+" is required");continue}const u=c[m].p,y=c[m].h,g=o.packed;if(o.map){const t=Object.keys(s);for(a=0;a<t.length;a++)t[a]={key:t[a],value:s[t[a]]};s=t}if(g){let t=0;for(a=0;a<s.length;a++)Object.prototype.hasOwnProperty.call(s,a)&&(t+=e.encodingLength(s[a]));if(t){for(a=0;a<y.length;a++)f[p++]=u[a];i.encode(t,f,p),p+=i.encode.bytes}}if(o.repeated){let t;for(a=0;a<s.length;a++)t=s[a],n(t)&&(p=l(f,d,p,y,e,g,t))}else p=l(f,d,p,y,e,g,s)}return e.bytes=p-y,f}}},87172:(t,e,r)=>{"use strict";var n=r(7626).r,i=r(99863);t.exports=function(t,e,r){const o=Object.keys(r),s=e.length,a=new Array(s);for(let n=0;n<t.fields.length;n++){a[n]=i.encodingLength(t.fields[n].tag<<3|e[n].type);const r=t.fields[n];t.fields[n].packed=r.repeated&&r.options&&r.options.packed&&"false"!==r.options.packed}return function(u){let c=0,l=0,h=0;for(l=0;l<o.length;l++){const t=o[l],e=r[t];let i=!1;for(h=0;h<e.length;h++)if(n(u[e[h]])){if(i)throw new Error("only one of the properties defined in oneof "+t+" can be set");i=!0}}for(l=0;l<s;l++){const r=e[l],o=t.fields[l];let s=u[o.name];const f=a[l];let d;if(n(s)){if(o.map){const t=Object.keys(s);for(h=0;h<t.length;h++)t[h]={key:t[h],value:s[t[h]]};s=t}if(o.packed){let t=0;for(h=0;h<s.length;h++)n(s[h])&&(d=r.encodingLength(s[h]),t+=d,r.message&&(t+=i.encodingLength(d)));t&&(c+=f+t+i.encodingLength(t))}else if(o.repeated)for(h=0;h<s.length;h++)n(s[h])&&(d=r.encodingLength(s[h]),c+=f+d+(r.message?i.encodingLength(d):0));else d=r.encodingLength(s),c+=f+d+(r.message?i.encodingLength(d):0)}else if(o.required)throw new Error(o.name+" is required")}return c}}},12161:(t,e,r)=>{"use strict";const n=r(56457);t.exports=n(0,(function t(e,r,n,i){r[i]=e?1:0,t.bytes=1}),(function t(e,r,n){const i=e[n]>0;return t.bytes=1,i}),(function(){return 1}))},56183:(t,e,r)=>{"use strict";const n=r(99863),i=r(56457);function o(t){return t.byteLength}t.exports=i(2,(function t(e,r,i,s){const a=s,u=o(e);n.encode(u,r,s),s+=n.encode.bytes,r.set(e,s),t.bytes=(s+=u)-a}),(function t(e,r,i){const o=i,s=n.decode(e,i);i+=n.decode.bytes;const a=e.slice(i,i+s);return i+=a.length,t.bytes=i-o,a}),(function(t){const e=o(t);return n.encodingLength(e)+e}))},80379:(t,e,r)=>{"use strict";const n=r(56457);t.exports=n(1,(function t(e,r,n,i){n.setFloat64(i,e,!0),t.bytes=8}),(function t(e,r,n){const i=r.getFloat64(n,!0);return t.bytes=8,i}),(function(){return 8}))},56457:t=>{"use strict";t.exports=function(t,e,r,n){return e.bytes=r.bytes=0,{type:t,encode:e,decode:r,encodingLength:n}}},59992:(t,e,r)=>{"use strict";const n=r(56457);t.exports=n(5,(function t(e,r,n,i){n.setUint32(i,e,!0),t.bytes=4}),(function t(e,r,n){const i=r.getUint32(n,!0);return t.bytes=4,i}),(function(t){return 4}))},57907:(t,e,r)=>{"use strict";const n=r(56457);t.exports=n(1,(function t(e,r,n,i){for(const o of e)r[i]=o,i++;t.bytes=8}),(function t(e,r,n){const i=e.slice(n,n+8);return t.bytes=8,i}),(function(){return 8}))},68849:(t,e,r)=>{"use strict";const n=r(56457);t.exports=n(5,(function t(e,r,n,i){n.setFloat32(i,e,!0),t.bytes=4}),(function t(e,r,n){const i=r.getFloat32(n,!0);return t.bytes=4,i}),(function(){return 4}))},31321:(t,e,r)=>{"use strict";e.make=r(56457),e.bytes=r(56183),e.string=r(19480),e.bool=r(12161),e.int32=r(7089),e.int64=r(50877),e.sint32=e.sint64=r(62149),e.uint32=e.uint64=e.enum=e.varint=r(3868),e.fixed64=e.sfixed64=r(57907),e.double=r(80379),e.fixed32=r(59992),e.sfixed32=r(11341),e.float=r(68849)},7089:(t,e,r)=>{"use strict";const n=r(99863),i=r(56457);t.exports=i(0,(function t(e,r,i,o){n.encode(e<0?e+4294967296:e,r,o),t.bytes=n.encode.bytes}),(function t(e,r,i){const o=n.decode(e,i);return t.bytes=n.decode.bytes,o>2147483647?o-4294967296:o}),(function(t){return n.encodingLength(t<0?t+4294967296:t)}))},50877:(t,e,r)=>{"use strict";const n=r(99863),i=r(56457);t.exports=i(0,(function t(e,r,i,o){if(e<0){const i=o+9;for(n.encode(-1*e,r,o),r[o+=n.encode.bytes-1]=128|r[o];o<i-1;)r[++o]=255;r[i]=1,t.bytes=10}else n.encode(e,r,o),t.bytes=n.encode.bytes}),(function t(e,r,i){let o=n.decode(e,i);if(o>=Math.pow(2,63)){let r=9;for(;255===e[i+r-1];)r--;r=r||9;const s=e.subarray(i,i+r);s[r-1]=127&s[r-1],o=-1*n.decode(s,0),t.bytes=10}else t.bytes=n.decode.bytes;return o}),(function(t){return t<0?10:n.encodingLength(t)}))},11341:(t,e,r)=>{"use strict";const n=r(56457);t.exports=n(5,(function t(e,r,n,i){n.setInt32(i,e,!0),t.bytes=4}),(function t(e,r,n){const i=r.getInt32(n,!0);return t.bytes=4,i}),(function(t){return 4}))},62149:(t,e,r)=>{"use strict";const n=r(16872),i=r(56457);t.exports=i(0,(function t(e,r,i,o){n.encode(e,r,o),t.bytes=n.encode.bytes}),(function t(e,r,i){const o=n.decode(e,i);return t.bytes=n.decode.bytes,o}),n.encodingLength)},19480:(t,e,r)=>{"use strict";const n=r(99863),{fromString:i}=r(46765),{toString:o}=r(82051),s=r(56457);t.exports=s(2,(function t(e,r,o,s){const a=s,u=i(e).byteLength;n.encode(u,r,s,"utf-8"),s+=n.encode.bytes;const c=i(e);r.set(c,s),s+=c.length,t.bytes=s-a}),(function t(e,r,i){const s=i,a=n.decode(e,i);i+=n.decode.bytes;const u=o(e.subarray(i,i+a));return t.bytes=(i+=a)-s,u}),(function(t){const e=i(t).byteLength;return n.encodingLength(e)+e}))},3868:(t,e,r)=>{"use strict";const n=r(99863),i=r(56457);t.exports=i(0,(function t(e,r,i,o){n.encode(e,r,o),t.bytes=n.encode.bytes}),(function t(e,r,i){const o=n.decode(e,i);return t.bytes=n.decode.bytes,o}),n.encodingLength)},45538:(t,e,r)=>{"use strict";const n=r(31321),i=r(85942),o=r(17837),s=r(87172),a=r(99863);t.exports=function(t,e){const r={},u={},c={},l=function(t,e){t.enums&&t.enums.forEach((function(t){t.id=e+(e?".":"")+t.name,u[t.id]=t,l(t,t.id)})),t.messages&&t.messages.forEach((function(n){n.id=e+(e?".":"")+n.name,r[n.id]=n,n.fields.forEach((function(n){if(!n.map)return;const i="Map_"+n.map.from+"_"+n.map.to,o={name:i,enums:[],messages:[],fields:[{name:"key",type:n.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:n.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:e+(e?".":"")+i};r[o.id]||(r[o.id]=o,t.messages.push(o)),n.type=i,n.repeated=!0})),l(n,n.id)}))};l(t,"");const h=function(t,e){t.messages.forEach((function(r){e[r.name]=f(r.name,t.id)})),t.enums.forEach((function(t){e[t.name]=function(t){if(!t)return null;const e={};return Object.keys(t).forEach((function(r){e[r]=t[r].value})),e}(t.values)})),e.type=2,e.message=!0,e.name=t.name;const r={};t.fields.forEach((function(t){t.oneof&&(r[t.oneof]||(r[t.oneof]=[]),r[t.oneof].push(t.name))}));const n=t.fields.map((function(e){return f(e.type,t.id)})),a=s(t,n,r),u=o(t,f,n,r,a),c=i(t,f,n);return u.bytes=c.bytes=0,e.buffer=!0,e.encode=u,e.decode=c,e.encodingLength=a,e},f=function(t,i,o){if(e&&e[t])return e[t];if(n[t])return n[t];const s=(i?i+"."+t:t).split(".").map((function(e,r,n){return n.slice(0,r).concat(t).join(".")})).reverse().reduce((function(t,e){return t||r[e]||u[e]}),null);if(!1===o)return s;if(!s)throw new Error("Could not resolve "+t);if(s.values)return function(t){const e=Object.keys(t.values||[]).map((function(e){return parseInt(t.values[e].value,10)}));return n.make(0,(function t(r,n,i,o){if(!e.length||-1===e.indexOf(r))throw new Error("Invalid enum value: "+r);return a.encode(r,n,o),t.bytes=a.encode.bytes,n}),(function t(r,n,i){var o=a.decode(r,i);if(!e.length||-1===e.indexOf(o))throw new Error("Invalid enum value: "+o);return t.bytes=a.decode.bytes,o}),a.encodingLength)}(s);return c[s.id]||h(s,c[s.id]={})};return(t.enums||[]).concat((t.messages||[]).map((function(t){return f(t.id)})))}},7626:(t,e)=>{"use strict";e.r=function(t){return null!==t&&void 0!==t&&("number"!==typeof t||!isNaN(t))}},69145:(t,e,r)=>{"use strict";var n=r(57874),i=r(45538);t.exports=function(t,e){if(e||(e={}),!t)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var r="object"!==typeof t||t instanceof Uint8Array?n.parse(t):t,o=function(){var t=this;i(r,e.encodings||{}).forEach((function(e){t[e.name]=function(t){if(!t)return null;var e={};return Object.keys(t).forEach((function(r){e[r]=t[r].value})),e}(e.values)||e}))};return o.prototype.toString=function(){return n.stringify(r)},o.prototype.toJSON=function(){return r},new o}},60012:(t,e,r)=>{e.publicEncrypt=r(92190),e.privateDecrypt=r(93936),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},77135:(t,e,r)=>{var n=r(83569),i=r(82543).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},865:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(77108).Buffer}catch(A){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,I=E>>>13,A=0|s[5],M=8191&A,T=A>>>13,R=0|s[6],k=8191&R,C=R>>>13,P=0|s[7],B=8191&P,O=P>>>13,N=0|s[8],D=8191&N,x=N>>>13,L=0|s[9],U=8191&L,j=L>>>13,K=0|a[0],F=8191&K,V=K>>>13,q=0|a[1],z=8191&q,H=q>>>13,G=0|a[2],W=8191&G,Z=G>>>13,Y=0|a[3],X=8191&Y,Q=Y>>>13,J=0|a[4],$=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,ft=lt>>>13,dt=0|a[9],pt=8191&dt,yt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(y,F)|0,o=Math.imul(y,V);var mt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(f,z)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,V))+Math.imul(b,F)|0,o=Math.imul(b,V),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,H)|0;var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0;var vt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,V))+Math.imul(C,F)|0,o=Math.imul(C,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,V))+Math.imul(O,F)|0,o=Math.imul(O,V),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var St=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,V))+Math.imul(x,F)|0,o=Math.imul(x,V),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0;var It=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,yt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,yt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,H))+Math.imul(j,z)|0,o=Math.imul(j,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Z)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(m,ht)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,ft)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Tt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,Q))+Math.imul(j,X)|0,o=Math.imul(j,Q),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ft)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,yt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,tt))+Math.imul(j,$)|0,o=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(T,ht)|0,o=o+Math.imul(T,ft)|0;var kt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,yt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(D,ot)|0,i=(i=i+Math.imul(D,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,yt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(D,ut)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,yt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ft))+Math.imul(j,ht)|0,o=Math.imul(j,ft);var Ot=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,yt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,yt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,yt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=mt,u[2]=bt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=St,u[8]=It,u[9]=At,u[10]=Mt,u[11]=Tt,u[12]=Rt,u[13]=kt,u[14]=Ct,u[15]=Pt,u[16]=Bt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):y(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],y=n[l+d],g=r[l+d+s],m=n[l+d+s],b=h*g-f*m;m=h*m+f*g,g=b,r[l+d]=p+g,n[l+d]=y+m,r[l+d+s]=p-g,n[l+d+s]=y-m,d!==a&&(b=u*h-c*f,f=u*f+c*h,h=b)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(h,new o(1).iushln(p-g-1));f=f.redMul(m),h=m.redSqr(),d=d.redMul(h),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new I(t)},i(I,S),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},93936:(t,e,r)=>{var n=r(37510),i=r(77135),o=r(61214),s=r(865),a=r(81330),u=r(83569),c=r(4383),l=r(82543).Buffer;t.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var f,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");f=r?c(new s(e),d):a(e,d);var y=l.alloc(p-f.length);if(f=l.concat([y,f],p),4===h)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(l.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),c=e.slice(s+1),h=o(a,i(c,s)),f=o(c,i(h,r-s-1));if(function(t,e){t=l.from(t),e=l.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i<n;)r+=t[i]^e[i];return r}(n,f.slice(0,s)))throw new Error("decryption error");var d=s;for(;0===f[d];)d++;if(1!==f[d++])throw new Error("decryption error");return f.slice(d)}(d,f);if(1===h)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,f,r);if(3===h)return f;throw new Error("unknown padding")}},92190:(t,e,r)=>{var n=r(37510),i=r(12525),o=r(83569),s=r(77135),a=r(61214),u=r(865),c=r(4383),l=r(81330),h=r(82543).Buffer;t.exports=function(t,e,r){var f;f=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===f)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,c=o("sha1").update(h.alloc(0)).digest(),l=c.length,f=2*l;if(n>r-f-2)throw new Error("message too long");var d=h.alloc(r-n-f-2),p=r-l-1,y=i(l),g=a(h.concat([c,d,h.alloc(1,1),e],p),s(y,p)),m=a(y,s(g,l));return new u(h.concat([h.alloc(1),m,g],r))}(p,e);else if(1===f)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?h.alloc(s-o-3,255):function(t){var e,r=h.allocUnsafe(t),n=0,o=i(2*t),s=0;for(;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3);return new u(h.concat([h.from([0,r?1:2]),n,h.alloc(1),e],s))}(p,e,r);else{if(3!==f)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?l(d,p):c(d,p)}},4383:(t,e,r)=>{var n=r(865),i=r(82543).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},61214:t=>{t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},12525:(t,e,r)=>{"use strict";var n=r(21964),i=65536,o=4294967295;var s=r(82543).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var r=s.allocUnsafe(t);if(t>0)if(t>i)for(var u=0;u<t;u+=i)a.getRandomValues(r.slice(u,u+i));else a.getRandomValues(r);if("function"===typeof e)return n.nextTick((function(){e(null,r)}));return r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},50394:(t,e,r)=>{"use strict";var n=r(21964);function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(82543),s=r(12525),a=o.Buffer,u=o.kMaxLength,c=r.g.crypto||r.g.msCrypto,l=Math.pow(2,32)-1;function h(t,e){if("number"!==typeof t||t!==t)throw new TypeError("offset must be a number");if(t>l||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function f(t,e,r){if("number"!==typeof t||t!==t)throw new TypeError("size must be a number");if(t>l||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function d(t,e,r,i){if(n.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return c.getRandomValues(a),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return s(r).copy(t,e),t;s(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}c&&c.getRandomValues||!n.browser?(e.randomFill=function(t,e,n,i){if(!a.isBuffer(t)&&!(t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof e)i=e,e=0,n=t.length;else if("function"===typeof n)i=n,n=t.length-e;else if("function"!==typeof i)throw new TypeError('"cb" argument must be a function');return h(e,t.length),f(n,e,t.length),d(t,e,n,i)},e.randomFillSync=function(t,e,n){"undefined"===typeof e&&(e=0);if(!a.isBuffer(t)&&!(t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(e,t.length),void 0===n&&(n=t.length-e);return f(n,e,t.length),d(t,e,n)}):(e.randomFill=i,e.randomFillSync=i)},34463:(t,e,r)=>{"use strict";var n=r(72791),i=r(45296);function o(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function u(t,e){c(t,e),c(t+"Capture",e)}function c(t,e){for(a[t]=e,t=0;t<e.length;t++)s.add(e[t])}var l=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function y(t,e,r,n,i,o,s){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(t){g[t]=new y(t,0,!1,t,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(t){var e=t[0];g[e]=new y(e,1,!1,t[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(t){g[t]=new y(t,2,!1,t.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(t){g[t]=new y(t,2,!1,t,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(t){g[t]=new y(t,3,!1,t.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(t){g[t]=new y(t,3,!0,t,null,!1,!1)})),["capture","download"].forEach((function(t){g[t]=new y(t,4,!1,t,null,!1,!1)})),["cols","rows","size","span"].forEach((function(t){g[t]=new y(t,6,!1,t,null,!1,!1)})),["rowSpan","start"].forEach((function(t){g[t]=new y(t,5,!1,t.toLowerCase(),null,!1,!1)}));var m=/[\-:]([a-z])/g;function b(t){return t[1].toUpperCase()}function v(t,e,r,n){var i=g.hasOwnProperty(e)?g[e]:null;(null!==i?0!==i.type:n||!(2<e.length)||"o"!==e[0]&&"O"!==e[0]||"n"!==e[1]&&"N"!==e[1])&&(function(t,e,r,n){if(null===e||"undefined"===typeof e||function(t,e,r,n){if(null!==r&&0===r.type)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(t=t.toLowerCase().slice(0,5))&&"aria-"!==t);default:return!1}}(t,e,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!e;case 4:return!1===e;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}(e,r,i,n)&&(r=null),n||null===i?function(t){return!!h.call(p,t)||!h.call(d,t)&&(f.test(t)?p[t]=!0:(d[t]=!0,!1))}(e)&&(null===r?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=null===r?3!==i.type&&"":r:(e=i.attributeName,n=i.attributeNamespace,null===r?t.removeAttribute(e):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(t){var e=t.replace(m,b);g[e]=new y(e,1,!1,t,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(t){var e=t.replace(m,b);g[e]=new y(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(t){var e=t.replace(m,b);g[e]=new y(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(t){g[t]=new y(t,1,!1,t.toLowerCase(),null,!1,!1)})),g.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(t){g[t]=new y(t,1,!1,t.toLowerCase(),null,!0,!0)}));var w=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),B=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var O=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var N=Symbol.iterator;function D(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=N&&t[N]||t["@@iterator"])?t:null}var x,L=Object.assign;function U(t){if(void 0===x)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);x=e&&e[1]||""}return"\n"+x+t}var j=!1;function K(t,e){if(!t||j)return"";j=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var n=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){n=c}t.call(e.prototype)}else{try{throw Error()}catch(c){n=c}t()}}catch(c){if(c&&n&&"string"===typeof c.stack){for(var i=c.stack.split("\n"),o=n.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a]){var u="\n"+i[s].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}}while(1<=s&&0<=a);break}}}finally{j=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?U(t):""}function F(t){switch(t.tag){case 5:return U(t.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return t=K(t.type,!1);case 11:return t=K(t.type.render,!1);case 1:return t=K(t.type,!0);default:return""}}function V(t){if(null==t)return null;if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t;switch(t){case S:return"Fragment";case E:return"Portal";case A:return"Profiler";case I:return"StrictMode";case k:return"Suspense";case C:return"SuspenseList"}if("object"===typeof t)switch(t.$$typeof){case T:return(t.displayName||"Context")+".Consumer";case M:return(t._context.displayName||"Context")+".Provider";case R:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case P:return null!==(e=t.displayName||null)?e:V(t.type)||"Memo";case B:e=t._payload,t=t._init;try{return V(t(e))}catch(r){}}return null}function q(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(e);case 8:return e===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e}return null}function z(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":case"object":return t;default:return""}}function H(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function G(t){t._valueTracker||(t._valueTracker=function(t){var e=H(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){n=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(t){n=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function W(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=H(t)?t.checked?"true":"false":t.value),(t=n)!==r&&(e.setValue(t),!0)}function Z(t){if("undefined"===typeof(t=t||("undefined"!==typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}function Y(t,e){var r=e.checked;return L({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:t._wrapperState.initialChecked})}function X(t,e){var r=null==e.defaultValue?"":e.defaultValue,n=null!=e.checked?e.checked:e.defaultChecked;r=z(null!=e.value?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function Q(t,e){null!=(e=e.checked)&&v(t,"checked",e,!1)}function J(t,e){Q(t,e);var r=z(e.value),n=e.type;if(null!=r)"number"===n?(0===r&&""===t.value||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if("submit"===n||"reset"===n)return void t.removeAttribute("value");e.hasOwnProperty("value")?tt(t,e.type,r):e.hasOwnProperty("defaultValue")&&tt(t,e.type,z(e.defaultValue)),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked)}function $(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!("submit"!==n&&"reset"!==n||void 0!==e.value&&null!==e.value))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}""!==(r=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==r&&(t.name=r)}function tt(t,e,r){"number"===e&&Z(t.ownerDocument)===t||(null==r?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var et=Array.isArray;function rt(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+z(r),e=null,i=0;i<t.length;i++){if(t[i].value===r)return t[i].selected=!0,void(n&&(t[i].defaultSelected=!0));null!==e||t[i].disabled||(e=t[i])}null!==e&&(e.selected=!0)}}function nt(t,e){if(null!=e.dangerouslySetInnerHTML)throw Error(o(91));return L({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function it(t,e){var r=e.value;if(null==r){if(r=e.children,e=e.defaultValue,null!=r){if(null!=e)throw Error(o(92));if(et(r)){if(1<r.length)throw Error(o(93));r=r[0]}e=r}null==e&&(e=""),r=e}t._wrapperState={initialValue:z(r)}}function ot(t,e){var r=z(e.value),n=z(e.defaultValue);null!=r&&((r=""+r)!==t.value&&(t.value=r),null==e.defaultValue&&t.defaultValue!==r&&(t.defaultValue=r)),null!=n&&(t.defaultValue=""+n)}function st(t){var e=t.textContent;e===t._wrapperState.initialValue&&""!==e&&null!==e&&(t.value=e)}function at(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ut(t,e){return null==t||"http://www.w3.org/1999/xhtml"===t?at(e):"http://www.w3.org/2000/svg"===t&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":t}var ct,lt,ht=(lt=function(t,e){if("http://www.w3.org/2000/svg"!==t.namespaceURI||"innerHTML"in t)t.innerHTML=e;else{for((ct=ct||document.createElement("div")).innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ct.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,e,r,n){MSApp.execUnsafeLocalFunction((function(){return lt(t,e)}))}:lt);function ft(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&3===r.nodeType)return void(r.nodeValue=e)}t.textContent=e}var dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pt=["Webkit","ms","Moz","O"];function yt(t,e,r){return null==e||"boolean"===typeof e||""===e?"":r||"number"!==typeof e||0===e||dt.hasOwnProperty(t)&&dt[t]?(""+e).trim():e+"px"}function gt(t,e){for(var r in t=t.style,e)if(e.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=yt(r,e[r],n);"float"===r&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}Object.keys(dt).forEach((function(t){pt.forEach((function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),dt[e]=dt[t]}))}));var mt=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bt(t,e){if(e){if(mt[t]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(o(137,t));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(o(60));if("object"!==typeof e.dangerouslySetInnerHTML||!("__html"in e.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=e.style&&"object"!==typeof e.style)throw Error(o(62))}}function vt(t,e){if(-1===t.indexOf("-"))return"string"===typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wt=null;function _t(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var Et=null,St=null,It=null;function At(t){if(t=vi(t)){if("function"!==typeof Et)throw Error(o(280));var e=t.stateNode;e&&(e=_i(e),Et(t.stateNode,t.type,e))}}function Mt(t){St?It?It.push(t):It=[t]:St=t}function Tt(){if(St){var t=St,e=It;if(It=St=null,At(t),e)for(t=0;t<e.length;t++)At(e[t])}}function Rt(t,e){return t(e)}function kt(){}var Ct=!1;function Pt(t,e,r){if(Ct)return t(e,r);Ct=!0;try{return Rt(t,e,r)}finally{Ct=!1,(null!==St||null!==It)&&(kt(),Tt())}}function Bt(t,e){var r=t.stateNode;if(null===r)return null;var n=_i(r);if(null===n)return null;r=n[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(t=t.type)||"input"===t||"select"===t||"textarea"===t)),t=!n;break t;default:t=!1}if(t)return null;if(r&&"function"!==typeof r)throw Error(o(231,e,typeof r));return r}var Ot=!1;if(l)try{var Nt={};Object.defineProperty(Nt,"passive",{get:function(){Ot=!0}}),window.addEventListener("test",Nt,Nt),window.removeEventListener("test",Nt,Nt)}catch(lt){Ot=!1}function Dt(t,e,r,n,i,o,s,a,u){var c=Array.prototype.slice.call(arguments,3);try{e.apply(r,c)}catch(l){this.onError(l)}}var xt=!1,Lt=null,Ut=!1,jt=null,Kt={onError:function(t){xt=!0,Lt=t}};function Ft(t,e,r,n,i,o,s,a,u){xt=!1,Lt=null,Dt.apply(Kt,arguments)}function Vt(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!==(4098&(e=t).flags)&&(r=e.return),t=e.return}while(t)}return 3===e.tag?r:null}function qt(t){if(13===t.tag){var e=t.memoizedState;if(null===e&&(null!==(t=t.alternate)&&(e=t.memoizedState)),null!==e)return e.dehydrated}return null}function zt(t){if(Vt(t)!==t)throw Error(o(188))}function Ht(t){return null!==(t=function(t){var e=t.alternate;if(!e){if(null===(e=Vt(t)))throw Error(o(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(n=i.return)){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return zt(i),t;if(s===n)return zt(i),e;s=s.sibling}throw Error(o(188))}if(r.return!==n.return)r=i,n=s;else{for(var a=!1,u=i.child;u;){if(u===r){a=!0,r=i,n=s;break}if(u===n){a=!0,n=i,r=s;break}u=u.sibling}if(!a){for(u=s.child;u;){if(u===r){a=!0,r=s,n=i;break}if(u===n){a=!0,n=s,r=i;break}u=u.sibling}if(!a)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(3!==r.tag)throw Error(o(188));return r.stateNode.current===r?t:e}(t))?Gt(t):null}function Gt(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var e=Gt(t);if(null!==e)return e;t=t.sibling}return null}var Wt=i.unstable_scheduleCallback,Zt=i.unstable_cancelCallback,Yt=i.unstable_shouldYield,Xt=i.unstable_requestPaint,Qt=i.unstable_now,Jt=i.unstable_getCurrentPriorityLevel,$t=i.unstable_ImmediatePriority,te=i.unstable_UserBlockingPriority,ee=i.unstable_NormalPriority,re=i.unstable_LowPriority,ne=i.unstable_IdlePriority,ie=null,oe=null;var se=Math.clz32?Math.clz32:function(t){return 0===(t>>>=0)?32:31-(ae(t)/ue|0)|0},ae=Math.log,ue=Math.LN2;var ce=64,le=4194304;function he(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function fe(t,e){var r=t.pendingLanes;if(0===r)return 0;var n=0,i=t.suspendedLanes,o=t.pingedLanes,s=268435455&r;if(0!==s){var a=s&~i;0!==a?n=he(a):0!==(o&=s)&&(n=he(o))}else 0!==(s=r&~i)?n=he(s):0!==o&&(n=he(o));if(0===n)return 0;if(0!==e&&e!==n&&0===(e&i)&&((i=n&-n)>=(o=e&-e)||16===i&&0!==(4194240&o)))return e;if(0!==(4&n)&&(n|=16&r),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=n;0<e;)i=1<<(r=31-se(e)),n|=t[r],e&=~i;return n}function de(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function pe(t){return 0!==(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function ye(){var t=ce;return 0===(4194240&(ce<<=1))&&(ce=64),t}function ge(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function me(t,e,r){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-se(e)]=r}function be(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-se(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var ve=0;function we(t){return 1<(t&=-t)?4<t?0!==(268435455&t)?16:536870912:4:1}var _e,Ee,Se,Ie,Ae,Me=!1,Te=[],Re=null,ke=null,Ce=null,Pe=new Map,Be=new Map,Oe=[],Ne="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function De(t,e){switch(t){case"focusin":case"focusout":Re=null;break;case"dragenter":case"dragleave":ke=null;break;case"mouseover":case"mouseout":Ce=null;break;case"pointerover":case"pointerout":Pe.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Be.delete(e.pointerId)}}function xe(t,e,r,n,i,o){return null===t||t.nativeEvent!==o?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[i]},null!==e&&(null!==(e=vi(e))&&Ee(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,null!==i&&-1===e.indexOf(i)&&e.push(i),t)}function Le(t){var e=bi(t.target);if(null!==e){var r=Vt(e);if(null!==r)if(13===(e=r.tag)){if(null!==(e=qt(r)))return t.blockedOn=e,void Ae(t.priority,(function(){Se(r)}))}else if(3===e&&r.stateNode.current.memoizedState.isDehydrated)return void(t.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}t.blockedOn=null}function Ue(t){if(null!==t.blockedOn)return!1;for(var e=t.targetContainers;0<e.length;){var r=Ye(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(null!==r)return null!==(e=vi(r))&&Ee(e),t.blockedOn=r,!1;var n=new(r=t.nativeEvent).constructor(r.type,r);wt=n,r.target.dispatchEvent(n),wt=null,e.shift()}return!0}function je(t,e,r){Ue(t)&&r.delete(e)}function Ke(){Me=!1,null!==Re&&Ue(Re)&&(Re=null),null!==ke&&Ue(ke)&&(ke=null),null!==Ce&&Ue(Ce)&&(Ce=null),Pe.forEach(je),Be.forEach(je)}function Fe(t,e){t.blockedOn===e&&(t.blockedOn=null,Me||(Me=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Ke)))}function Ve(t){function e(e){return Fe(e,t)}if(0<Te.length){Fe(Te[0],t);for(var r=1;r<Te.length;r++){var n=Te[r];n.blockedOn===t&&(n.blockedOn=null)}}for(null!==Re&&Fe(Re,t),null!==ke&&Fe(ke,t),null!==Ce&&Fe(Ce,t),Pe.forEach(e),Be.forEach(e),r=0;r<Oe.length;r++)(n=Oe[r]).blockedOn===t&&(n.blockedOn=null);for(;0<Oe.length&&null===(r=Oe[0]).blockedOn;)Le(r),null===r.blockedOn&&Oe.shift()}var qe=w.ReactCurrentBatchConfig,ze=!0;function He(t,e,r,n){var i=ve,o=qe.transition;qe.transition=null;try{ve=1,We(t,e,r,n)}finally{ve=i,qe.transition=o}}function Ge(t,e,r,n){var i=ve,o=qe.transition;qe.transition=null;try{ve=4,We(t,e,r,n)}finally{ve=i,qe.transition=o}}function We(t,e,r,n){if(ze){var i=Ye(t,e,r,n);if(null===i)zn(t,e,n,Ze,r),De(t,n);else if(function(t,e,r,n,i){switch(e){case"focusin":return Re=xe(Re,t,e,r,n,i),!0;case"dragenter":return ke=xe(ke,t,e,r,n,i),!0;case"mouseover":return Ce=xe(Ce,t,e,r,n,i),!0;case"pointerover":var o=i.pointerId;return Pe.set(o,xe(Pe.get(o)||null,t,e,r,n,i)),!0;case"gotpointercapture":return o=i.pointerId,Be.set(o,xe(Be.get(o)||null,t,e,r,n,i)),!0}return!1}(i,t,e,r,n))n.stopPropagation();else if(De(t,n),4&e&&-1<Ne.indexOf(t)){for(;null!==i;){var o=vi(i);if(null!==o&&_e(o),null===(o=Ye(t,e,r,n))&&zn(t,e,n,Ze,r),o===i)break;i=o}null!==i&&n.stopPropagation()}else zn(t,e,n,null,r)}}var Ze=null;function Ye(t,e,r,n){if(Ze=null,null!==(t=bi(t=_t(n))))if(null===(e=Vt(t)))t=null;else if(13===(r=e.tag)){if(null!==(t=qt(e)))return t;t=null}else if(3===r){if(e.stateNode.current.memoizedState.isDehydrated)return 3===e.tag?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Ze=t,null}function Xe(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jt()){case $t:return 1;case te:return 4;case ee:case re:return 16;case ne:return 536870912;default:return 16}default:return 16}}var Qe=null,Je=null,$e=null;function tr(){if($e)return $e;var t,e,r=Je,n=r.length,i="value"in Qe?Qe.value:Qe.textContent,o=i.length;for(t=0;t<n&&r[t]===i[t];t++);var s=n-t;for(e=1;e<=s&&r[n-e]===i[o-e];e++);return $e=i.slice(t,1<e?1-e:void 0)}function er(t){var e=t.keyCode;return"charCode"in t?0===(t=t.charCode)&&13===e&&(t=13):t=e,10===t&&(t=13),32<=t||13===t?t:0}function rr(){return!0}function nr(){return!1}function ir(t){function e(e,r,n,i,o){for(var s in this._reactName=e,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null,t)t.hasOwnProperty(s)&&(e=t[s],this[s]=e?e(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rr:nr,this.isPropagationStopped=nr,this}return L(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!==typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!==typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),e}var or,sr,ar,ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cr=ir(ur),lr=L({},ur,{view:0,detail:0}),hr=ir(lr),fr=L({},lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ir,button:0,buttons:0,relatedTarget:function(t){return void 0===t.relatedTarget?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ar&&(ar&&"mousemove"===t.type?(or=t.screenX-ar.screenX,sr=t.screenY-ar.screenY):sr=or=0,ar=t),or)},movementY:function(t){return"movementY"in t?t.movementY:sr}}),dr=ir(fr),pr=ir(L({},fr,{dataTransfer:0})),yr=ir(L({},lr,{relatedTarget:0})),gr=ir(L({},ur,{animationName:0,elapsedTime:0,pseudoElement:0})),mr=L({},ur,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),br=ir(mr),vr=ir(L({},ur,{data:0})),wr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_r={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Er={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sr(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):!!(t=Er[t])&&!!e[t]}function Ir(){return Sr}var Ar=L({},lr,{key:function(t){if(t.key){var e=wr[t.key]||t.key;if("Unidentified"!==e)return e}return"keypress"===t.type?13===(t=er(t))?"Enter":String.fromCharCode(t):"keydown"===t.type||"keyup"===t.type?_r[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ir,charCode:function(t){return"keypress"===t.type?er(t):0},keyCode:function(t){return"keydown"===t.type||"keyup"===t.type?t.keyCode:0},which:function(t){return"keypress"===t.type?er(t):"keydown"===t.type||"keyup"===t.type?t.keyCode:0}}),Mr=ir(Ar),Tr=ir(L({},fr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rr=ir(L({},lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ir})),kr=ir(L({},ur,{propertyName:0,elapsedTime:0,pseudoElement:0})),Cr=L({},fr,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Pr=ir(Cr),Br=[9,13,27,32],Or=l&&"CompositionEvent"in window,Nr=null;l&&"documentMode"in document&&(Nr=document.documentMode);var Dr=l&&"TextEvent"in window&&!Nr,xr=l&&(!Or||Nr&&8<Nr&&11>=Nr),Lr=String.fromCharCode(32),Ur=!1;function jr(t,e){switch(t){case"keyup":return-1!==Br.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kr(t){return"object"===typeof(t=t.detail)&&"data"in t?t.data:null}var Fr=!1;var Vr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!Vr[t.type]:"textarea"===e}function zr(t,e,r,n){Mt(n),0<(e=Gn(e,"onChange")).length&&(r=new cr("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Hr=null,Gr=null;function Wr(t){Un(t,0)}function Zr(t){if(W(wi(t)))return t}function Yr(t,e){if("change"===t)return e}var Xr=!1;if(l){var Qr;if(l){var Jr="oninput"in document;if(!Jr){var $r=document.createElement("div");$r.setAttribute("oninput","return;"),Jr="function"===typeof $r.oninput}Qr=Jr}else Qr=!1;Xr=Qr&&(!document.documentMode||9<document.documentMode)}function tn(){Hr&&(Hr.detachEvent("onpropertychange",en),Gr=Hr=null)}function en(t){if("value"===t.propertyName&&Zr(Gr)){var e=[];zr(e,Gr,t,_t(t)),Pt(Wr,e)}}function rn(t,e,r){"focusin"===t?(tn(),Gr=r,(Hr=e).attachEvent("onpropertychange",en)):"focusout"===t&&tn()}function nn(t){if("selectionchange"===t||"keyup"===t||"keydown"===t)return Zr(Gr)}function on(t,e){if("click"===t)return Zr(e)}function sn(t,e){if("input"===t||"change"===t)return Zr(e)}var an="function"===typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t===1/e)||t!==t&&e!==e};function un(t,e){if(an(t,e))return!0;if("object"!==typeof t||null===t||"object"!==typeof e||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!h.call(e,i)||!an(t[i],e[i]))return!1}return!0}function cn(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ln(t,e){var r,n=cn(t);for(t=0;n;){if(3===n.nodeType){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=cn(n)}}function hn(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?hn(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function fn(){for(var t=window,e=Z();e instanceof t.HTMLIFrameElement;){try{var r="string"===typeof e.contentWindow.location.href}catch(n){r=!1}if(!r)break;e=Z((t=e.contentWindow).document)}return e}function dn(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}function pn(t){var e=fn(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&hn(r.ownerDocument.documentElement,r)){if(null!==n&&dn(r))if(e=n.start,void 0===(t=n.end)&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if((t=(e=r.ownerDocument||document)&&e.defaultView||window).getSelection){t=t.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=void 0===n.end?o:Math.min(n.end,i),!t.extend&&o>n&&(i=n,n=o,o=i),i=ln(r,o);var s=ln(r,n);i&&s&&(1!==t.rangeCount||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&((e=e.createRange()).setStart(i.node,i.offset),t.removeAllRanges(),o>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}for(e=[],t=r;t=t.parentNode;)1===t.nodeType&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for("function"===typeof r.focus&&r.focus(),r=0;r<e.length;r++)(t=e[r]).element.scrollLeft=t.left,t.element.scrollTop=t.top}}var yn=l&&"documentMode"in document&&11>=document.documentMode,gn=null,mn=null,bn=null,vn=!1;function wn(t,e,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;vn||null==gn||gn!==Z(n)||("selectionStart"in(n=gn)&&dn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},bn&&un(bn,n)||(bn=n,0<(n=Gn(mn,"onSelect")).length&&(e=new cr("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=gn)))}function _n(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var En={animationend:_n("Animation","AnimationEnd"),animationiteration:_n("Animation","AnimationIteration"),animationstart:_n("Animation","AnimationStart"),transitionend:_n("Transition","TransitionEnd")},Sn={},In={};function An(t){if(Sn[t])return Sn[t];if(!En[t])return t;var e,r=En[t];for(e in r)if(r.hasOwnProperty(e)&&e in In)return Sn[t]=r[e];return t}l&&(In=document.createElement("div").style,"AnimationEvent"in window||(delete En.animationend.animation,delete En.animationiteration.animation,delete En.animationstart.animation),"TransitionEvent"in window||delete En.transitionend.transition);var Mn=An("animationend"),Tn=An("animationiteration"),Rn=An("animationstart"),kn=An("transitionend"),Cn=new Map,Pn="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(t,e){Cn.set(t,e),u(e,[t])}for(var On=0;On<Pn.length;On++){var Nn=Pn[On];Bn(Nn.toLowerCase(),"on"+(Nn[0].toUpperCase()+Nn.slice(1)))}Bn(Mn,"onAnimationEnd"),Bn(Tn,"onAnimationIteration"),Bn(Rn,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(kn,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xn=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dn));function Ln(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,function(t,e,r,n,i,s,a,u,c){if(Ft.apply(this,arguments),xt){if(!xt)throw Error(o(198));var l=Lt;xt=!1,Lt=null,Ut||(Ut=!0,jt=l)}}(n,e,void 0,t),t.currentTarget=null}function Un(t,e){e=0!==(4&e);for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;t:{var o=void 0;if(e)for(var s=n.length-1;0<=s;s--){var a=n[s],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&i.isPropagationStopped())break t;Ln(i,a,c),o=u}else for(s=0;s<n.length;s++){if(u=(a=n[s]).instance,c=a.currentTarget,a=a.listener,u!==o&&i.isPropagationStopped())break t;Ln(i,a,c),o=u}}}if(Ut)throw t=jt,Ut=!1,jt=null,t}function jn(t,e){var r=e[yi];void 0===r&&(r=e[yi]=new Set);var n=t+"__bubble";r.has(n)||(qn(e,t,2,!1),r.add(n))}function Kn(t,e,r){var n=0;e&&(n|=4),qn(r,t,n,e)}var Fn="_reactListening"+Math.random().toString(36).slice(2);function Vn(t){if(!t[Fn]){t[Fn]=!0,s.forEach((function(e){"selectionchange"!==e&&(xn.has(e)||Kn(e,!1,t),Kn(e,!0,t))}));var e=9===t.nodeType?t:t.ownerDocument;null===e||e[Fn]||(e[Fn]=!0,Kn("selectionchange",!1,e))}}function qn(t,e,r,n){switch(Xe(e)){case 1:var i=He;break;case 4:i=Ge;break;default:i=We}r=i.bind(null,e,r,t),i=void 0,!Ot||"touchstart"!==e&&"touchmove"!==e&&"wheel"!==e||(i=!0),n?void 0!==i?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):void 0!==i?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function zn(t,e,r,n,i){var o=n;if(0===(1&e)&&0===(2&e)&&null!==n)t:for(;;){if(null===n)return;var s=n.tag;if(3===s||4===s){var a=n.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===s)for(s=n.return;null!==s;){var u=s.tag;if((3===u||4===u)&&((u=s.stateNode.containerInfo)===i||8===u.nodeType&&u.parentNode===i))return;s=s.return}for(;null!==a;){if(null===(s=bi(a)))return;if(5===(u=s.tag)||6===u){n=o=s;continue t}a=a.parentNode}}n=n.return}Pt((function(){var n=o,i=_t(r),s=[];t:{var a=Cn.get(t);if(void 0!==a){var u=cr,c=t;switch(t){case"keypress":if(0===er(r))break t;case"keydown":case"keyup":u=Mr;break;case"focusin":c="focus",u=yr;break;case"focusout":c="blur",u=yr;break;case"beforeblur":case"afterblur":u=yr;break;case"click":if(2===r.button)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=dr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=pr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Rr;break;case Mn:case Tn:case Rn:u=gr;break;case kn:u=kr;break;case"scroll":u=hr;break;case"wheel":u=Pr;break;case"copy":case"cut":case"paste":u=br;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=Tr}var l=0!==(4&e),h=!l&&"scroll"===t,f=l?null!==a?a+"Capture":null:a;l=[];for(var d,p=n;null!==p;){var y=(d=p).stateNode;if(5===d.tag&&null!==y&&(d=y,null!==f&&(null!=(y=Bt(p,f))&&l.push(Hn(p,y,d)))),h)break;p=p.return}0<l.length&&(a=new u(a,c,null,r,i),s.push({event:a,listeners:l}))}}if(0===(7&e)){if(u="mouseout"===t||"pointerout"===t,(!(a="mouseover"===t||"pointerover"===t)||r===wt||!(c=r.relatedTarget||r.fromElement)||!bi(c)&&!c[pi])&&(u||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,u?(u=n,null!==(c=(c=r.relatedTarget||r.toElement)?bi(c):null)&&(c!==(h=Vt(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(u=null,c=n),u!==c)){if(l=dr,y="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==t&&"pointerover"!==t||(l=Tr,y="onPointerLeave",f="onPointerEnter",p="pointer"),h=null==u?a:wi(u),d=null==c?a:wi(c),(a=new l(y,p+"leave",u,r,i)).target=h,a.relatedTarget=d,y=null,bi(i)===n&&((l=new l(f,p+"enter",c,r,i)).target=d,l.relatedTarget=h,y=l),h=y,u&&c)t:{for(f=c,p=0,d=l=u;d;d=Wn(d))p++;for(d=0,y=f;y;y=Wn(y))d++;for(;0<p-d;)l=Wn(l),p--;for(;0<d-p;)f=Wn(f),d--;for(;p--;){if(l===f||null!==f&&l===f.alternate)break t;l=Wn(l),f=Wn(f)}l=null}else l=null;null!==u&&Zn(s,a,u,l,!1),null!==c&&null!==h&&Zn(s,h,c,l,!0)}if("select"===(u=(a=n?wi(n):window).nodeName&&a.nodeName.toLowerCase())||"input"===u&&"file"===a.type)var g=Yr;else if(qr(a))if(Xr)g=sn;else{g=nn;var m=rn}else(u=a.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=on);switch(g&&(g=g(t,n))?zr(s,g,r,i):(m&&m(t,a,n),"focusout"===t&&(m=a._wrapperState)&&m.controlled&&"number"===a.type&&tt(a,"number",a.value)),m=n?wi(n):window,t){case"focusin":(qr(m)||"true"===m.contentEditable)&&(gn=m,mn=n,bn=null);break;case"focusout":bn=mn=gn=null;break;case"mousedown":vn=!0;break;case"contextmenu":case"mouseup":case"dragend":vn=!1,wn(s,r,i);break;case"selectionchange":if(yn)break;case"keydown":case"keyup":wn(s,r,i)}var b;if(Or)t:{switch(t){case"compositionstart":var v="onCompositionStart";break t;case"compositionend":v="onCompositionEnd";break t;case"compositionupdate":v="onCompositionUpdate";break t}v=void 0}else Fr?jr(t,r)&&(v="onCompositionEnd"):"keydown"===t&&229===r.keyCode&&(v="onCompositionStart");v&&(xr&&"ko"!==r.locale&&(Fr||"onCompositionStart"!==v?"onCompositionEnd"===v&&Fr&&(b=tr()):(Je="value"in(Qe=i)?Qe.value:Qe.textContent,Fr=!0)),0<(m=Gn(n,v)).length&&(v=new vr(v,t,null,r,i),s.push({event:v,listeners:m}),b?v.data=b:null!==(b=Kr(r))&&(v.data=b))),(b=Dr?function(t,e){switch(t){case"compositionend":return Kr(e);case"keypress":return 32!==e.which?null:(Ur=!0,Lr);case"textInput":return(t=e.data)===Lr&&Ur?null:t;default:return null}}(t,r):function(t,e){if(Fr)return"compositionend"===t||!Or&&jr(t,e)?(t=tr(),$e=Je=Qe=null,Fr=!1,t):null;switch(t){case"paste":default:return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return xr&&"ko"!==e.locale?null:e.data}}(t,r))&&(0<(n=Gn(n,"onBeforeInput")).length&&(i=new vr("onBeforeInput","beforeinput",null,r,i),s.push({event:i,listeners:n}),i.data=b))}Un(s,e)}))}function Hn(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Gn(t,e){for(var r=e+"Capture",n=[];null!==t;){var i=t,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Bt(t,r))&&n.unshift(Hn(t,o,i)),null!=(o=Bt(t,e))&&n.push(Hn(t,o,i))),t=t.return}return n}function Wn(t){if(null===t)return null;do{t=t.return}while(t&&5!==t.tag);return t||null}function Zn(t,e,r,n,i){for(var o=e._reactName,s=[];null!==r&&r!==n;){var a=r,u=a.alternate,c=a.stateNode;if(null!==u&&u===n)break;5===a.tag&&null!==c&&(a=c,i?null!=(u=Bt(r,o))&&s.unshift(Hn(r,u,a)):i||null!=(u=Bt(r,o))&&s.push(Hn(r,u,a))),r=r.return}0!==s.length&&t.push({event:e,listeners:s})}var Yn=/\r\n?/g,Xn=/\u0000|\uFFFD/g;function Qn(t){return("string"===typeof t?t:""+t).replace(Yn,"\n").replace(Xn,"")}function Jn(t,e,r){if(e=Qn(e),Qn(t)!==e&&r)throw Error(o(425))}function $n(){}var ti=null,ei=null;function ri(t,e){return"textarea"===t||"noscript"===t||"string"===typeof e.children||"number"===typeof e.children||"object"===typeof e.dangerouslySetInnerHTML&&null!==e.dangerouslySetInnerHTML&&null!=e.dangerouslySetInnerHTML.__html}var ni="function"===typeof setTimeout?setTimeout:void 0,ii="function"===typeof clearTimeout?clearTimeout:void 0,oi="function"===typeof Promise?Promise:void 0,si="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof oi?function(t){return oi.resolve(null).then(t).catch(ai)}:ni;function ai(t){setTimeout((function(){throw t}))}function ui(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return t.removeChild(i),void Ve(e);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);Ve(e)}function ci(t){for(;null!=t;t=t.nextSibling){var e=t.nodeType;if(1===e||3===e)break;if(8===e){if("$"===(e=t.data)||"$!"===e||"$?"===e)break;if("/$"===e)return null}}return t}function li(t){t=t.previousSibling;for(var e=0;t;){if(8===t.nodeType){var r=t.data;if("$"===r||"$!"===r||"$?"===r){if(0===e)return t;e--}else"/$"===r&&e++}t=t.previousSibling}return null}var hi=Math.random().toString(36).slice(2),fi="__reactFiber$"+hi,di="__reactProps$"+hi,pi="__reactContainer$"+hi,yi="__reactEvents$"+hi,gi="__reactListeners$"+hi,mi="__reactHandles$"+hi;function bi(t){var e=t[fi];if(e)return e;for(var r=t.parentNode;r;){if(e=r[pi]||r[fi]){if(r=e.alternate,null!==e.child||null!==r&&null!==r.child)for(t=li(t);null!==t;){if(r=t[fi])return r;t=li(t)}return e}r=(t=r).parentNode}return null}function vi(t){return!(t=t[fi]||t[pi])||5!==t.tag&&6!==t.tag&&13!==t.tag&&3!==t.tag?null:t}function wi(t){if(5===t.tag||6===t.tag)return t.stateNode;throw Error(o(33))}function _i(t){return t[di]||null}var Ei=[],Si=-1;function Ii(t){return{current:t}}function Ai(t){0>Si||(t.current=Ei[Si],Ei[Si]=null,Si--)}function Mi(t,e){Si++,Ei[Si]=t.current,t.current=e}var Ti={},Ri=Ii(Ti),ki=Ii(!1),Ci=Ti;function Pi(t,e){var r=t.type.contextTypes;if(!r)return Ti;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=e[i];return n&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function Bi(t){return null!==(t=t.childContextTypes)&&void 0!==t}function Oi(){Ai(ki),Ai(Ri)}function Ni(t,e,r){if(Ri.current!==Ti)throw Error(o(168));Mi(Ri,e),Mi(ki,r)}function Di(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,"function"!==typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in e))throw Error(o(108,q(t)||"Unknown",i));return L({},r,n)}function xi(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ti,Ci=Ri.current,Mi(Ri,t),Mi(ki,ki.current),!0}function Li(t,e,r){var n=t.stateNode;if(!n)throw Error(o(169));r?(t=Di(t,e,Ci),n.__reactInternalMemoizedMergedChildContext=t,Ai(ki),Ai(Ri),Mi(Ri,t)):Ai(ki),Mi(ki,r)}var Ui=null,ji=!1,Ki=!1;function Fi(t){null===Ui?Ui=[t]:Ui.push(t)}function Vi(){if(!Ki&&null!==Ui){Ki=!0;var t=0,e=ve;try{var r=Ui;for(ve=1;t<r.length;t++){var n=r[t];do{n=n(!0)}while(null!==n)}Ui=null,ji=!1}catch(i){throw null!==Ui&&(Ui=Ui.slice(t+1)),Wt($t,Vi),i}finally{ve=e,Ki=!1}}return null}var qi=w.ReactCurrentBatchConfig;function zi(t,e){if(t&&t.defaultProps){for(var r in e=L({},e),t=t.defaultProps)void 0===e[r]&&(e[r]=t[r]);return e}return e}var Hi=Ii(null),Gi=null,Wi=null,Zi=null;function Yi(){Zi=Wi=Gi=null}function Xi(t){var e=Hi.current;Ai(Hi),t._currentValue=e}function Qi(t,e,r){for(;null!==t;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==n&&(n.childLanes|=e)):null!==n&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Ji(t,e){Gi=t,Zi=Wi=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!==(t.lanes&e)&&(_a=!0),t.firstContext=null)}function $i(t){var e=t._currentValue;if(Zi!==t)if(t={context:t,memoizedValue:e,next:null},null===Wi){if(null===Gi)throw Error(o(308));Wi=t,Gi.dependencies={lanes:0,firstContext:t}}else Wi=Wi.next=t;return e}var to=null,eo=!1;function ro(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function no(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function io(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function oo(t,e){var r=t.updateQueue;null!==r&&(r=r.shared,ec(t)?(null===(t=r.interleaved)?(e.next=e,null===to?to=[r]:to.push(r)):(e.next=t.next,t.next=e),r.interleaved=e):(null===(t=r.pending)?e.next=e:(e.next=t.next,t.next=e),r.pending=e))}function so(t,e,r){if(null!==(e=e.updateQueue)&&(e=e.shared,0!==(4194240&r))){var n=e.lanes;r|=n&=t.pendingLanes,e.lanes=r,be(t,r)}}function ao(t,e){var r=t.updateQueue,n=t.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,o=null;if(null!==(r=r.firstBaseUpdate)){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===o?i=o=s:o=o.next=s,r=r.next}while(null!==r);null===o?i=o=e:o=o.next=e}else i=o=e;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},void(t.updateQueue=r)}null===(t=r.lastBaseUpdate)?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function uo(t,e,r,n){var i=t.updateQueue;eo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var u=a,c=u.next;u.next=null,null===s?o=c:s.next=c,s=u;var l=t.alternate;null!==l&&((a=(l=l.updateQueue).lastBaseUpdate)!==s&&(null===a?l.firstBaseUpdate=c:a.next=c,l.lastBaseUpdate=u))}if(null!==o){var h=i.baseState;for(s=0,l=c=u=null,a=o;;){var f=a.lane,d=a.eventTime;if((n&f)===f){null!==l&&(l=l.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});t:{var p=t,y=a;switch(f=e,d=r,y.tag){case 1:if("function"===typeof(p=y.payload)){h=p.call(d,h,f);break t}h=p;break t;case 3:p.flags=-65537&p.flags|128;case 0:if(null===(f="function"===typeof(p=y.payload)?p.call(d,h,f):p)||void 0===f)break t;h=L({},h,f);break t;case 2:eo=!0}}null!==a.callback&&0!==a.lane&&(t.flags|=64,null===(f=i.effects)?i.effects=[a]:f.push(a))}else d={eventTime:d,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===l?(c=l=d,u=h):l=l.next=d,s|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(f=a).next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}if(null===l&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=l,null!==(e=i.shared.interleaved)){i=e;do{s|=i.lane,i=i.next}while(i!==e)}else null===o&&(i.shared.lanes=0);Ou|=s,t.lanes=s,t.memoizedState=h}}function co(t,e,r){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!==typeof i)throw Error(o(191,i));i.call(n)}}}var lo=(new n.Component).refs;function ho(t,e,r,n){r=null===(r=r(n,e=t.memoizedState))||void 0===r?e:L({},e,r),t.memoizedState=r,0===t.lanes&&(t.updateQueue.baseState=r)}var fo={isMounted:function(t){return!!(t=t._reactInternals)&&Vt(t)===t},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Qu(),i=Ju(t),o=io(n,i);o.payload=e,void 0!==r&&null!==r&&(o.callback=r),oo(t,o),null!==(e=$u(t,i,n))&&so(e,t,i)},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Qu(),i=Ju(t),o=io(n,i);o.tag=1,o.payload=e,void 0!==r&&null!==r&&(o.callback=r),oo(t,o),null!==(e=$u(t,i,n))&&so(e,t,i)},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Qu(),n=Ju(t),i=io(r,n);i.tag=2,void 0!==e&&null!==e&&(i.callback=e),oo(t,i),null!==(e=$u(t,n,r))&&so(e,t,n)}};function po(t,e,r,n,i,o,s){return"function"===typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(n,o,s):!e.prototype||!e.prototype.isPureReactComponent||(!un(r,n)||!un(i,o))}function yo(t,e,r){var n=!1,i=Ti,o=e.contextType;return"object"===typeof o&&null!==o?o=$i(o):(i=Bi(e)?Ci:Ri.current,o=(n=null!==(n=e.contextTypes)&&void 0!==n)?Pi(t,i):Ti),e=new e(r,o),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=fo,t.stateNode=e,e._reactInternals=t,n&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function go(t,e,r,n){t=e.state,"function"===typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(r,n),"function"===typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&fo.enqueueReplaceState(e,e.state,null)}function mo(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs=lo,ro(t);var o=e.contextType;"object"===typeof o&&null!==o?i.context=$i(o):(o=Bi(e)?Ci:Ri.current,i.context=Pi(t,o)),i.state=t.memoizedState,"function"===typeof(o=e.getDerivedStateFromProps)&&(ho(t,e,o,r),i.state=t.memoizedState),"function"===typeof e.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(e=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),e!==i.state&&fo.enqueueReplaceState(i,i.state,null),uo(t,r,i,n),i.state=t.memoizedState),"function"===typeof i.componentDidMount&&(t.flags|=4194308)}var bo=[],vo=0,wo=null,_o=0,Eo=[],So=0,Io=null,Ao=1,Mo="";function To(t,e){bo[vo++]=_o,bo[vo++]=wo,wo=t,_o=e}function Ro(t,e,r){Eo[So++]=Ao,Eo[So++]=Mo,Eo[So++]=Io,Io=t;var n=Ao;t=Mo;var i=32-se(n)-1;n&=~(1<<i),r+=1;var o=32-se(e)+i;if(30<o){var s=i-i%5;o=(n&(1<<s)-1).toString(32),n>>=s,i-=s,Ao=1<<32-se(e)+i|r<<i|n,Mo=o+t}else Ao=1<<o|r<<i|n,Mo=t}function ko(t){null!==t.return&&(To(t,1),Ro(t,1,0))}function Co(t){for(;t===wo;)wo=bo[--vo],bo[vo]=null,_o=bo[--vo],bo[vo]=null;for(;t===Io;)Io=Eo[--So],Eo[So]=null,Mo=Eo[--So],Eo[So]=null,Ao=Eo[--So],Eo[So]=null}var Po=null,Bo=null,Oo=!1,No=null;function Do(t,e){var r=Cc(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,null===(e=t.deletions)?(t.deletions=[r],t.flags|=16):e.push(r)}function xo(t,e){switch(t.tag){case 5:var r=t.type;return null!==(e=1!==e.nodeType||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e)&&(t.stateNode=e,Po=t,Bo=ci(e.firstChild),!0);case 6:return null!==(e=""===t.pendingProps||3!==e.nodeType?null:e)&&(t.stateNode=e,Po=t,Bo=null,!0);case 13:return null!==(e=8!==e.nodeType?null:e)&&(r=null!==Io?{id:Ao,overflow:Mo}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},(r=Cc(18,null,null,0)).stateNode=e,r.return=t,t.child=r,Po=t,Bo=null,!0);default:return!1}}function Lo(t){return 0!==(1&t.mode)&&0===(128&t.flags)}function Uo(t){if(Oo){var e=Bo;if(e){var r=e;if(!xo(t,e)){if(Lo(t))throw Error(o(418));e=ci(r.nextSibling);var n=Po;e&&xo(t,e)?Do(n,r):(t.flags=-4097&t.flags|2,Oo=!1,Po=t)}}else{if(Lo(t))throw Error(o(418));t.flags=-4097&t.flags|2,Oo=!1,Po=t}}}function jo(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;Po=t}function Ko(t){if(t!==Po)return!1;if(!Oo)return jo(t),Oo=!0,!1;var e;if((e=3!==t.tag)&&!(e=5!==t.tag)&&(e="head"!==(e=t.type)&&"body"!==e&&!ri(t.type,t.memoizedProps)),e&&(e=Bo)){if(Lo(t)){for(t=Bo;t;)t=ci(t.nextSibling);throw Error(o(418))}for(;e;)Do(t,e),e=ci(e.nextSibling)}if(jo(t),13===t.tag){if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(o(317));t:{for(t=t.nextSibling,e=0;t;){if(8===t.nodeType){var r=t.data;if("/$"===r){if(0===e){Bo=ci(t.nextSibling);break t}e--}else"$"!==r&&"$!"!==r&&"$?"!==r||e++}t=t.nextSibling}Bo=null}}else Bo=Po?ci(t.stateNode.nextSibling):null;return!0}function Fo(){Bo=Po=null,Oo=!1}function Vo(t){null===No?No=[t]:No.push(t)}function qo(t,e,r){if(null!==(t=r.ref)&&"function"!==typeof t&&"object"!==typeof t){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(o(309));var n=r.stateNode}if(!n)throw Error(o(147,t));var i=n,s=""+t;return null!==e&&null!==e.ref&&"function"===typeof e.ref&&e.ref._stringRef===s?e.ref:(e=function(t){var e=i.refs;e===lo&&(e=i.refs={}),null===t?delete e[s]:e[s]=t},e._stringRef=s,e)}if("string"!==typeof t)throw Error(o(284));if(!r._owner)throw Error(o(290,t))}return t}function zo(t,e){throw t=Object.prototype.toString.call(e),Error(o(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Ho(t){return(0,t._init)(t._payload)}function Go(t){function e(e,r){if(t){var n=e.deletions;null===n?(e.deletions=[r],e.flags|=16):n.push(r)}}function r(r,n){if(!t)return null;for(;null!==n;)e(r,n),n=n.sibling;return null}function n(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(t,e){return(t=Bc(t,e)).index=0,t.sibling=null,t}function s(e,r,n){return e.index=n,t?null!==(n=e.alternate)?(n=n.index)<r?(e.flags|=2,r):n:(e.flags|=2,r):(e.flags|=1048576,r)}function a(e){return t&&null===e.alternate&&(e.flags|=2),e}function u(t,e,r,n){return null===e||6!==e.tag?((e=xc(r,t.mode,n)).return=t,e):((e=i(e,r)).return=t,e)}function c(t,e,r,n){var o=r.type;return o===S?h(t,e,r.props.children,n,r.key):null!==e&&(e.elementType===o||"object"===typeof o&&null!==o&&o.$$typeof===B&&Ho(o)===e.type)?((n=i(e,r.props)).ref=qo(t,e,r),n.return=t,n):((n=Oc(r.type,r.key,r.props,null,t.mode,n)).ref=qo(t,e,r),n.return=t,n)}function l(t,e,r,n){return null===e||4!==e.tag||e.stateNode.containerInfo!==r.containerInfo||e.stateNode.implementation!==r.implementation?((e=Lc(r,t.mode,n)).return=t,e):((e=i(e,r.children||[])).return=t,e)}function h(t,e,r,n,o){return null===e||7!==e.tag?((e=Nc(r,t.mode,n,o)).return=t,e):((e=i(e,r)).return=t,e)}function f(t,e,r){if("string"===typeof e&&""!==e||"number"===typeof e)return(e=xc(""+e,t.mode,r)).return=t,e;if("object"===typeof e&&null!==e){switch(e.$$typeof){case _:return(r=Oc(e.type,e.key,e.props,null,t.mode,r)).ref=qo(t,null,e),r.return=t,r;case E:return(e=Lc(e,t.mode,r)).return=t,e;case B:return f(t,(0,e._init)(e._payload),r)}if(et(e)||D(e))return(e=Nc(e,t.mode,r,null)).return=t,e;zo(t,e)}return null}function d(t,e,r,n){var i=null!==e?e.key:null;if("string"===typeof r&&""!==r||"number"===typeof r)return null!==i?null:u(t,e,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case _:return r.key===i?c(t,e,r,n):null;case E:return r.key===i?l(t,e,r,n):null;case B:return d(t,e,(i=r._init)(r._payload),n)}if(et(r)||D(r))return null!==i?null:h(t,e,r,n,null);zo(t,r)}return null}function p(t,e,r,n,i){if("string"===typeof n&&""!==n||"number"===typeof n)return u(e,t=t.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case _:return c(e,t=t.get(null===n.key?r:n.key)||null,n,i);case E:return l(e,t=t.get(null===n.key?r:n.key)||null,n,i);case B:return p(t,e,r,(0,n._init)(n._payload),i)}if(et(n)||D(n))return h(e,t=t.get(r)||null,n,i,null);zo(e,n)}return null}function y(i,o,a,u){for(var c=null,l=null,h=o,y=o=0,g=null;null!==h&&y<a.length;y++){h.index>y?(g=h,h=null):g=h.sibling;var m=d(i,h,a[y],u);if(null===m){null===h&&(h=g);break}t&&h&&null===m.alternate&&e(i,h),o=s(m,o,y),null===l?c=m:l.sibling=m,l=m,h=g}if(y===a.length)return r(i,h),Oo&&To(i,y),c;if(null===h){for(;y<a.length;y++)null!==(h=f(i,a[y],u))&&(o=s(h,o,y),null===l?c=h:l.sibling=h,l=h);return Oo&&To(i,y),c}for(h=n(i,h);y<a.length;y++)null!==(g=p(h,i,y,a[y],u))&&(t&&null!==g.alternate&&h.delete(null===g.key?y:g.key),o=s(g,o,y),null===l?c=g:l.sibling=g,l=g);return t&&h.forEach((function(t){return e(i,t)})),Oo&&To(i,y),c}function g(i,a,u,c){var l=D(u);if("function"!==typeof l)throw Error(o(150));if(null==(u=l.call(u)))throw Error(o(151));for(var h=l=null,y=a,g=a=0,m=null,b=u.next();null!==y&&!b.done;g++,b=u.next()){y.index>g?(m=y,y=null):m=y.sibling;var v=d(i,y,b.value,c);if(null===v){null===y&&(y=m);break}t&&y&&null===v.alternate&&e(i,y),a=s(v,a,g),null===h?l=v:h.sibling=v,h=v,y=m}if(b.done)return r(i,y),Oo&&To(i,g),l;if(null===y){for(;!b.done;g++,b=u.next())null!==(b=f(i,b.value,c))&&(a=s(b,a,g),null===h?l=b:h.sibling=b,h=b);return Oo&&To(i,g),l}for(y=n(i,y);!b.done;g++,b=u.next())null!==(b=p(y,i,g,b.value,c))&&(t&&null!==b.alternate&&y.delete(null===b.key?g:b.key),a=s(b,a,g),null===h?l=b:h.sibling=b,h=b);return t&&y.forEach((function(t){return e(i,t)})),Oo&&To(i,g),l}return function t(n,o,s,u){if("object"===typeof s&&null!==s&&s.type===S&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case _:t:{for(var c=s.key,l=o;null!==l;){if(l.key===c){if((c=s.type)===S){if(7===l.tag){r(n,l.sibling),(o=i(l,s.props.children)).return=n,n=o;break t}}else if(l.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===B&&Ho(c)===l.type){r(n,l.sibling),(o=i(l,s.props)).ref=qo(n,l,s),o.return=n,n=o;break t}r(n,l);break}e(n,l),l=l.sibling}s.type===S?((o=Nc(s.props.children,n.mode,u,s.key)).return=n,n=o):((u=Oc(s.type,s.key,s.props,null,n.mode,u)).ref=qo(n,o,s),u.return=n,n=u)}return a(n);case E:t:{for(l=s.key;null!==o;){if(o.key===l){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){r(n,o.sibling),(o=i(o,s.children||[])).return=n,n=o;break t}r(n,o);break}e(n,o),o=o.sibling}(o=Lc(s,n.mode,u)).return=n,n=o}return a(n);case B:return t(n,o,(l=s._init)(s._payload),u)}if(et(s))return y(n,o,s,u);if(D(s))return g(n,o,s,u);zo(n,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==o&&6===o.tag?(r(n,o.sibling),(o=i(o,s)).return=n,n=o):(r(n,o),(o=xc(s,n.mode,u)).return=n,n=o),a(n)):r(n,o)}}var Wo=Go(!0),Zo=Go(!1),Yo={},Xo=Ii(Yo),Qo=Ii(Yo),Jo=Ii(Yo);function $o(t){if(t===Yo)throw Error(o(174));return t}function ts(t,e){switch(Mi(Jo,e),Mi(Qo,t),Mi(Xo,Yo),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ut(null,"");break;default:e=ut(e=(t=8===t?e.parentNode:e).namespaceURI||null,t=t.tagName)}Ai(Xo),Mi(Xo,e)}function es(){Ai(Xo),Ai(Qo),Ai(Jo)}function rs(t){$o(Jo.current);var e=$o(Xo.current),r=ut(e,t.type);e!==r&&(Mi(Qo,t),Mi(Xo,r))}function ns(t){Qo.current===t&&(Ai(Xo),Ai(Qo))}var is=Ii(0);function os(t){for(var e=t;null!==e;){if(13===e.tag){var r=e.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!==(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ss=[];function as(){for(var t=0;t<ss.length;t++)ss[t]._workInProgressVersionPrimary=null;ss.length=0}var us=w.ReactCurrentDispatcher,cs=w.ReactCurrentBatchConfig,ls=0,hs=null,fs=null,ds=null,ps=!1,ys=!1,gs=0,ms=0;function bs(){throw Error(o(321))}function vs(t,e){if(null===e)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!an(t[r],e[r]))return!1;return!0}function ws(t,e,r,n,i,s){if(ls=s,hs=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,us.current=null===t||null===t.memoizedState?na:ia,t=r(n,i),ys){s=0;do{if(ys=!1,gs=0,25<=s)throw Error(o(301));s+=1,ds=fs=null,e.updateQueue=null,us.current=oa,t=r(n,i)}while(ys)}if(us.current=ra,e=null!==fs&&null!==fs.next,ls=0,ds=fs=hs=null,ps=!1,e)throw Error(o(300));return t}function _s(){var t=0!==gs;return gs=0,t}function Es(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ds?hs.memoizedState=ds=t:ds=ds.next=t,ds}function Ss(){if(null===fs){var t=hs.alternate;t=null!==t?t.memoizedState:null}else t=fs.next;var e=null===ds?hs.memoizedState:ds.next;if(null!==e)ds=e,fs=t;else{if(null===t)throw Error(o(310));t={memoizedState:(fs=t).memoizedState,baseState:fs.baseState,baseQueue:fs.baseQueue,queue:fs.queue,next:null},null===ds?hs.memoizedState=ds=t:ds=ds.next=t}return ds}function Is(t,e){return"function"===typeof e?e(t):e}function As(t){var e=Ss(),r=e.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=t;var n=fs,i=n.baseQueue,s=r.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}n.baseQueue=i=s,r.pending=null}if(null!==i){s=i.next,n=n.baseState;var u=a=null,c=null,l=s;do{var h=l.lane;if((ls&h)===h)null!==c&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),n=l.hasEagerState?l.eagerState:t(n,l.action);else{var f={lane:h,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};null===c?(u=c=f,a=n):c=c.next=f,hs.lanes|=h,Ou|=h}l=l.next}while(null!==l&&l!==s);null===c?a=n:c.next=u,an(n,e.memoizedState)||(_a=!0),e.memoizedState=n,e.baseState=a,e.baseQueue=c,r.lastRenderedState=n}if(null!==(t=r.interleaved)){i=t;do{s=i.lane,hs.lanes|=s,Ou|=s,i=i.next}while(i!==t)}else null===i&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Ms(t){var e=Ss(),r=e.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{s=t(s,a.action),a=a.next}while(a!==i);an(s,e.memoizedState)||(_a=!0),e.memoizedState=s,null===e.baseQueue&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function Ts(){}function Rs(t,e){var r=hs,n=Ss(),i=e(),s=!an(n.memoizedState,i);if(s&&(n.memoizedState=i,_a=!0),n=n.queue,js(Ps.bind(null,r,n,t),[t]),n.getSnapshot!==e||s||null!==ds&&1&ds.memoizedState.tag){if(r.flags|=2048,Ns(9,Cs.bind(null,r,n,i,e),void 0,null),null===Mu)throw Error(o(349));0!==(30&ls)||ks(r,e,i)}return i}function ks(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},null===(e=hs.updateQueue)?(e={lastEffect:null,stores:null},hs.updateQueue=e,e.stores=[t]):null===(r=e.stores)?e.stores=[t]:r.push(t)}function Cs(t,e,r,n){e.value=r,e.getSnapshot=n,Bs(e)&&$u(t,1,-1)}function Ps(t,e,r){return r((function(){Bs(e)&&$u(t,1,-1)}))}function Bs(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!an(t,r)}catch(n){return!0}}function Os(t){var e=Es();return"function"===typeof t&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:t},e.queue=t,t=t.dispatch=Qs.bind(null,hs,t),[e.memoizedState,t]}function Ns(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},null===(e=hs.updateQueue)?(e={lastEffect:null,stores:null},hs.updateQueue=e,e.lastEffect=t.next=t):null===(r=e.lastEffect)?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t),t}function Ds(){return Ss().memoizedState}function xs(t,e,r,n){var i=Es();hs.flags|=t,i.memoizedState=Ns(1|e,r,void 0,void 0===n?null:n)}function Ls(t,e,r,n){var i=Ss();n=void 0===n?null:n;var o=void 0;if(null!==fs){var s=fs.memoizedState;if(o=s.destroy,null!==n&&vs(n,s.deps))return void(i.memoizedState=Ns(e,r,o,n))}hs.flags|=t,i.memoizedState=Ns(1|e,r,o,n)}function Us(t,e){return xs(8390656,8,t,e)}function js(t,e){return Ls(2048,8,t,e)}function Ks(t,e){return Ls(4,2,t,e)}function Fs(t,e){return Ls(4,4,t,e)}function Vs(t,e){return"function"===typeof e?(t=t(),e(t),function(){e(null)}):null!==e&&void 0!==e?(t=t(),e.current=t,function(){e.current=null}):void 0}function qs(t,e,r){return r=null!==r&&void 0!==r?r.concat([t]):null,Ls(4,4,Vs.bind(null,e,t),r)}function zs(){}function Hs(t,e){var r=Ss();e=void 0===e?null:e;var n=r.memoizedState;return null!==n&&null!==e&&vs(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function Gs(t,e){var r=Ss();e=void 0===e?null:e;var n=r.memoizedState;return null!==n&&null!==e&&vs(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function Ws(t,e,r){return 0===(21&ls)?(t.baseState&&(t.baseState=!1,_a=!0),t.memoizedState=r):(an(r,e)||(r=ye(),hs.lanes|=r,Ou|=r,t.baseState=!0),e)}function Zs(t,e){var r=ve;ve=0!==r&&4>r?r:4,t(!0);var n=cs.transition;cs.transition={};try{t(!1),e()}finally{ve=r,cs.transition=n}}function Ys(){return Ss().memoizedState}function Xs(t,e,r){var n=Ju(t);r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Js(t)?$s(e,r):(ta(t,e,r),null!==(t=$u(t,n,r=Qu()))&&ea(t,e,n))}function Qs(t,e,r){var n=Ju(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Js(t))$s(e,i);else{ta(t,e,i);var o=t.alternate;if(0===t.lanes&&(null===o||0===o.lanes)&&null!==(o=e.lastRenderedReducer))try{var s=e.lastRenderedState,a=o(s,r);if(i.hasEagerState=!0,i.eagerState=a,an(a,s))return}catch(u){}null!==(t=$u(t,n,r=Qu()))&&ea(t,e,n)}}function Js(t){var e=t.alternate;return t===hs||null!==e&&e===hs}function $s(t,e){ys=ps=!0;var r=t.pending;null===r?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function ta(t,e,r){ec(t)?(null===(t=e.interleaved)?(r.next=r,null===to?to=[e]:to.push(e)):(r.next=t.next,t.next=r),e.interleaved=r):(null===(t=e.pending)?r.next=r:(r.next=t.next,t.next=r),e.pending=r)}function ea(t,e,r){if(0!==(4194240&r)){var n=e.lanes;r|=n&=t.pendingLanes,e.lanes=r,be(t,r)}}var ra={readContext:$i,useCallback:bs,useContext:bs,useEffect:bs,useImperativeHandle:bs,useInsertionEffect:bs,useLayoutEffect:bs,useMemo:bs,useReducer:bs,useRef:bs,useState:bs,useDebugValue:bs,useDeferredValue:bs,useTransition:bs,useMutableSource:bs,useSyncExternalStore:bs,useId:bs,unstable_isNewReconciler:!1},na={readContext:$i,useCallback:function(t,e){return Es().memoizedState=[t,void 0===e?null:e],t},useContext:$i,useEffect:Us,useImperativeHandle:function(t,e,r){return r=null!==r&&void 0!==r?r.concat([t]):null,xs(4194308,4,Vs.bind(null,e,t),r)},useLayoutEffect:function(t,e){return xs(4194308,4,t,e)},useInsertionEffect:function(t,e){return xs(4,2,t,e)},useMemo:function(t,e){var r=Es();return e=void 0===e?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Es();return e=void 0!==r?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Xs.bind(null,hs,t),[n.memoizedState,t]},useRef:function(t){return t={current:t},Es().memoizedState=t},useState:Os,useDebugValue:zs,useDeferredValue:function(t){return Es().memoizedState=t},useTransition:function(){var t=Os(!1),e=t[0];return t=Zs.bind(null,t[1]),Es().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=hs,i=Es();if(Oo){if(void 0===r)throw Error(o(407));r=r()}else{if(r=e(),null===Mu)throw Error(o(349));0!==(30&ls)||ks(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,Us(Ps.bind(null,n,s,t),[t]),n.flags|=2048,Ns(9,Cs.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Es(),e=Mu.identifierPrefix;if(Oo){var r=Mo;e=":"+e+"R"+(r=(Ao&~(1<<32-se(Ao)-1)).toString(32)+r),0<(r=gs++)&&(e+="H"+r.toString(32)),e+=":"}else e=":"+e+"r"+(r=ms++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},ia={readContext:$i,useCallback:Hs,useContext:$i,useEffect:js,useImperativeHandle:qs,useInsertionEffect:Ks,useLayoutEffect:Fs,useMemo:Gs,useReducer:As,useRef:Ds,useState:function(){return As(Is)},useDebugValue:zs,useDeferredValue:function(t){return Ws(Ss(),fs.memoizedState,t)},useTransition:function(){return[As(Is)[0],Ss().memoizedState]},useMutableSource:Ts,useSyncExternalStore:Rs,useId:Ys,unstable_isNewReconciler:!1},oa={readContext:$i,useCallback:Hs,useContext:$i,useEffect:js,useImperativeHandle:qs,useInsertionEffect:Ks,useLayoutEffect:Fs,useMemo:Gs,useReducer:Ms,useRef:Ds,useState:function(){return Ms(Is)},useDebugValue:zs,useDeferredValue:function(t){var e=Ss();return null===fs?e.memoizedState=t:Ws(e,fs.memoizedState,t)},useTransition:function(){return[Ms(Is)[0],Ss().memoizedState]},useMutableSource:Ts,useSyncExternalStore:Rs,useId:Ys,unstable_isNewReconciler:!1};function sa(t,e){try{var r="",n=e;do{r+=F(n),n=n.return}while(n);var i=r}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:t,source:e,stack:i}}function aa(t,e){try{console.error(e.value)}catch(r){setTimeout((function(){throw r}))}}var ua,ca,la,ha="function"===typeof WeakMap?WeakMap:Map;function fa(t,e,r){(r=io(-1,r)).tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Fu||(Fu=!0,Vu=n),aa(0,e)},r}function da(t,e,r){(r=io(-1,r)).tag=3;var n=t.type.getDerivedStateFromError;if("function"===typeof n){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){aa(0,e)}}var o=t.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(r.callback=function(){aa(0,e),"function"!==typeof n&&(null===qu?qu=new Set([this]):qu.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),r}function pa(t,e,r){var n=t.pingCache;if(null===n){n=t.pingCache=new ha;var i=new Set;n.set(e,i)}else void 0===(i=n.get(e))&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=Ic.bind(null,t,e,r),e.then(t,t))}function ya(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function ga(t,e,r,n,i){return 0===(1&t.mode)?(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((e=io(-1,1)).tag=2,oo(r,e))),r.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}function ma(t,e){if(!Oo)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;null!==e;)null!==e.alternate&&(r=e),e=e.sibling;null===r?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?e||null===t.tail?t.tail=null:t.tail.sibling=null:n.sibling=null}}function ba(t){var e=null!==t.alternate&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=t,i=i.sibling;else for(i=t.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function va(t,e,r){var n=e.pendingProps;switch(Co(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ba(e),null;case 1:case 17:return Bi(e.type)&&Oi(),ba(e),null;case 3:return n=e.stateNode,es(),Ai(ki),Ai(Ri),as(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==t&&null!==t.child||(Ko(e)?e.flags|=4:null===t||t.memoizedState.isDehydrated&&0===(256&e.flags)||(e.flags|=1024,null!==No&&(oc(No),No=null))),ba(e),null;case 5:ns(e);var i=$o(Jo.current);if(r=e.type,null!==t&&null!=e.stateNode)ca(t,e,r,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(null===e.stateNode)throw Error(o(166));return ba(e),null}if(t=$o(Xo.current),Ko(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[fi]=e,n[di]=s,t=0!==(1&e.mode),r){case"dialog":jn("cancel",n),jn("close",n);break;case"iframe":case"object":case"embed":jn("load",n);break;case"video":case"audio":for(i=0;i<Dn.length;i++)jn(Dn[i],n);break;case"source":jn("error",n);break;case"img":case"image":case"link":jn("error",n),jn("load",n);break;case"details":jn("toggle",n);break;case"input":X(n,s),jn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},jn("invalid",n);break;case"textarea":it(n,s),jn("invalid",n)}for(var u in bt(r,s),i=null,s)if(s.hasOwnProperty(u)){var c=s[u];"children"===u?"string"===typeof c?n.textContent!==c&&(!0!==s.suppressHydrationWarning&&Jn(n.textContent,c,t),i=["children",c]):"number"===typeof c&&n.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Jn(n.textContent,c,t),i=["children",""+c]):a.hasOwnProperty(u)&&null!=c&&"onScroll"===u&&jn("scroll",n)}switch(r){case"input":G(n),$(n,s,!0);break;case"textarea":G(n),st(n);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(n.onclick=$n)}n=i,e.updateQueue=n,null!==n&&(e.flags|=4)}else{u=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===t&&(t=at(r)),"http://www.w3.org/1999/xhtml"===t?"script"===r?((t=u.createElement("div")).innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):"string"===typeof n.is?t=u.createElement(r,{is:n.is}):(t=u.createElement(r),"select"===r&&(u=t,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):t=u.createElementNS(t,r),t[fi]=e,t[di]=n,ua(t,e),e.stateNode=t;t:{switch(u=vt(r,n),r){case"dialog":jn("cancel",t),jn("close",t),i=n;break;case"iframe":case"object":case"embed":jn("load",t),i=n;break;case"video":case"audio":for(i=0;i<Dn.length;i++)jn(Dn[i],t);i=n;break;case"source":jn("error",t),i=n;break;case"img":case"image":case"link":jn("error",t),jn("load",t),i=n;break;case"details":jn("toggle",t),i=n;break;case"input":X(t,n),i=Y(t,n),jn("invalid",t);break;case"option":default:i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=L({},n,{value:void 0}),jn("invalid",t);break;case"textarea":it(t,n),i=nt(t,n),jn("invalid",t)}for(s in bt(r,i),c=i)if(c.hasOwnProperty(s)){var l=c[s];"style"===s?gt(t,l):"dangerouslySetInnerHTML"===s?null!=(l=l?l.__html:void 0)&&ht(t,l):"children"===s?"string"===typeof l?("textarea"!==r||""!==l)&&ft(t,l):"number"===typeof l&&ft(t,""+l):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(a.hasOwnProperty(s)?null!=l&&"onScroll"===s&&jn("scroll",t):null!=l&&v(t,s,l,u))}switch(r){case"input":G(t),$(t,n,!1);break;case"textarea":G(t),st(t);break;case"option":null!=n.value&&t.setAttribute("value",""+z(n.value));break;case"select":t.multiple=!!n.multiple,null!=(s=n.value)?rt(t,!!n.multiple,s,!1):null!=n.defaultValue&&rt(t,!!n.multiple,n.defaultValue,!0);break;default:"function"===typeof i.onClick&&(t.onclick=$n)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break t;case"img":n=!0;break t;default:n=!1}}n&&(e.flags|=4)}null!==e.ref&&(e.flags|=512,e.flags|=2097152)}return ba(e),null;case 6:if(t&&null!=e.stateNode)la(0,e,t.memoizedProps,n);else{if("string"!==typeof n&&null===e.stateNode)throw Error(o(166));if(r=$o(Jo.current),$o(Xo.current),Ko(e)){if(n=e.stateNode,r=e.memoizedProps,n[fi]=e,(s=n.nodeValue!==r)&&null!==(t=Po))switch(t.tag){case 3:Jn(n.nodeValue,r,0!==(1&t.mode));break;case 5:!0!==t.memoizedProps.suppressHydrationWarning&&Jn(n.nodeValue,r,0!==(1&t.mode))}s&&(e.flags|=4)}else(n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[fi]=e,e.stateNode=n}return ba(e),null;case 13:if(Ai(is),n=e.memoizedState,Oo&&null!==Bo&&0!==(1&e.mode)&&0===(128&e.flags)){for(n=Bo;n;)n=ci(n.nextSibling);return Fo(),e.flags|=98560,e}if(null!==n&&null!==n.dehydrated){if(n=Ko(e),null===t){if(!n)throw Error(o(318));if(!(n=null!==(n=e.memoizedState)?n.dehydrated:null))throw Error(o(317));n[fi]=e}else Fo(),0===(128&e.flags)&&(e.memoizedState=null),e.flags|=4;return ba(e),null}return null!==No&&(oc(No),No=null),0!==(128&e.flags)?(e.lanes=r,e):(n=null!==n,r=!1,null===t?Ko(e):r=null!==t.memoizedState,n!==r&&n&&(e.child.flags|=8192,0!==(1&e.mode)&&(null===t||0!==(1&is.current)?0===Pu&&(Pu=3):pc())),null!==e.updateQueue&&(e.flags|=4),ba(e),null);case 4:return es(),null===t&&Vn(e.stateNode.containerInfo),ba(e),null;case 10:return Xi(e.type._context),ba(e),null;case 19:if(Ai(is),null===(s=e.memoizedState))return ba(e),null;if(n=0!==(128&e.flags),null===(u=s.rendering))if(n)ma(s,!1);else{if(0!==Pu||null!==t&&0!==(128&t.flags))for(t=e.child;null!==t;){if(null!==(u=os(t))){for(e.flags|=128,ma(s,!1),null!==(n=u.updateQueue)&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;null!==r;)t=n,(s=r).flags&=14680066,null===(u=s.alternate)?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,t=u.dependencies,s.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Mi(is,1&is.current|2),e.child}t=t.sibling}null!==s.tail&&Qt()>ju&&(e.flags|=128,n=!0,ma(s,!1),e.lanes=4194304)}else{if(!n)if(null!==(t=os(u))){if(e.flags|=128,n=!0,null!==(r=t.updateQueue)&&(e.updateQueue=r,e.flags|=4),ma(s,!0),null===s.tail&&"hidden"===s.tailMode&&!u.alternate&&!Oo)return ba(e),null}else 2*Qt()-s.renderingStartTime>ju&&1073741824!==r&&(e.flags|=128,n=!0,ma(s,!1),e.lanes=4194304);s.isBackwards?(u.sibling=e.child,e.child=u):(null!==(r=s.last)?r.sibling=u:e.child=u,s.last=u)}return null!==s.tail?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Qt(),e.sibling=null,r=is.current,Mi(is,n?1&r|2:1&r),e):(ba(e),null);case 22:case 23:return lc(),n=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==n&&(e.flags|=8192),n&&0!==(1&e.mode)?0!==(1073741824&ku)&&(ba(e),6&e.subtreeFlags&&(e.flags|=8192)):ba(e),null;case 24:case 25:return null}throw Error(o(156,e.tag))}ua=function(t,e){for(var r=e.child;null!==r;){if(5===r.tag||6===r.tag)t.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},ca=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,$o(Xo.current);var o,s=null;switch(r){case"input":i=Y(t,i),n=Y(t,n),s=[];break;case"select":i=L({},i,{value:void 0}),n=L({},n,{value:void 0}),s=[];break;case"textarea":i=nt(t,i),n=nt(t,n),s=[];break;default:"function"!==typeof i.onClick&&"function"===typeof n.onClick&&(t.onclick=$n)}for(l in bt(r,n),r=null,i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if("style"===l){var u=i[l];for(o in u)u.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(a.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(u=null!=i?i[l]:void 0,n.hasOwnProperty(l)&&c!==u&&(null!=c||null!=u))if("style"===l)if(u){for(o in u)!u.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&u[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(l,r)),r=c;else"dangerouslySetInnerHTML"===l?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(s=s||[]).push(l,c)):"children"===l?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(l,""+c):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(a.hasOwnProperty(l)?(null!=c&&"onScroll"===l&&jn("scroll",t),s||u===c||(s=[])):(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(e.updateQueue=l)&&(e.flags|=4)}},la=function(t,e,r,n){r!==n&&(e.flags|=4)};var wa=w.ReactCurrentOwner,_a=!1;function Ea(t,e,r,n){e.child=null===t?Zo(e,null,r,n):Wo(e,t.child,r,n)}function Sa(t,e,r,n,i){r=r.render;var o=e.ref;return Ji(e,i),n=ws(t,e,r,n,o,i),r=_s(),null===t||_a?(Oo&&r&&ko(e),e.flags|=1,Ea(t,e,n,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,za(t,e,i))}function Ia(t,e,r,n,i){if(null===t){var o=r.type;return"function"!==typeof o||Pc(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((t=Oc(r.type,null,n,e,e.mode,i)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=o,Aa(t,e,o,n,i))}if(o=t.child,0===(t.lanes&i)){var s=o.memoizedProps;if((r=null!==(r=r.compare)?r:un)(s,n)&&t.ref===e.ref)return za(t,e,i)}return e.flags|=1,(t=Bc(o,n)).ref=e.ref,t.return=e,e.child=t}function Aa(t,e,r,n,i){if(null!==t){var o=t.memoizedProps;if(un(o,n)&&t.ref===e.ref){if(_a=!1,e.pendingProps=n=o,0===(t.lanes&i))return e.lanes=t.lanes,za(t,e,i);0!==(131072&t.flags)&&(_a=!0)}}return Ra(t,e,r,n,i)}function Ma(t,e,r){var n=e.pendingProps,i=n.children,o=null!==t?t.memoizedState:null;if("hidden"===n.mode)if(0===(1&e.mode))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mi(Cu,ku),ku|=r;else{if(0===(1073741824&r))return t=null!==o?o.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Mi(Cu,ku),ku|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==o?o.baseLanes:r,Mi(Cu,ku),ku|=n}else null!==o?(n=o.baseLanes|r,e.memoizedState=null):n=r,Mi(Cu,ku),ku|=n;return Ea(t,e,i,r),e.child}function Ta(t,e){var r=e.ref;(null===t&&null!==r||null!==t&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Ra(t,e,r,n,i){var o=Bi(r)?Ci:Ri.current;return o=Pi(e,o),Ji(e,i),r=ws(t,e,r,n,o,i),n=_s(),null===t||_a?(Oo&&n&&ko(e),e.flags|=1,Ea(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,za(t,e,i))}function ka(t,e,r,n,i){if(Bi(r)){var o=!0;xi(e)}else o=!1;if(Ji(e,i),null===e.stateNode)null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),yo(e,r,n),mo(e,r,n,i),n=!0;else if(null===t){var s=e.stateNode,a=e.memoizedProps;s.props=a;var u=s.context,c=r.contextType;"object"===typeof c&&null!==c?c=$i(c):c=Pi(e,c=Bi(r)?Ci:Ri.current);var l=r.getDerivedStateFromProps,h="function"===typeof l||"function"===typeof s.getSnapshotBeforeUpdate;h||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==n||u!==c)&&go(e,s,n,c),eo=!1;var f=e.memoizedState;s.state=f,uo(e,n,s,i),u=e.memoizedState,a!==n||f!==u||ki.current||eo?("function"===typeof l&&(ho(e,r,l,n),u=e.memoizedState),(a=eo||po(e,r,a,n,f,u,c))?(h||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(e.flags|=4194308)):("function"===typeof s.componentDidMount&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=u),s.props=n,s.state=u,s.context=c,n=a):("function"===typeof s.componentDidMount&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,no(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:zi(e.type,a),s.props=c,h=e.pendingProps,f=s.context,"object"===typeof(u=r.contextType)&&null!==u?u=$i(u):u=Pi(e,u=Bi(r)?Ci:Ri.current);var d=r.getDerivedStateFromProps;(l="function"===typeof d||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==h||f!==u)&&go(e,s,n,u),eo=!1,f=e.memoizedState,s.state=f,uo(e,n,s,i);var p=e.memoizedState;a!==h||f!==p||ki.current||eo?("function"===typeof d&&(ho(e,r,d,n),p=e.memoizedState),(c=eo||po(e,r,c,n,f,p,u)||!1)?(l||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(n,p,u),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,p,u)),"function"===typeof s.componentDidUpdate&&(e.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!==typeof s.componentDidUpdate||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),s.props=n,s.state=p,s.context=u,n=c):("function"!==typeof s.componentDidUpdate||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return Ca(t,e,r,n,o,i)}function Ca(t,e,r,n,i,o){Ta(t,e);var s=0!==(128&e.flags);if(!n&&!s)return i&&Li(e,r,!1),za(t,e,o);n=e.stateNode,wa.current=e;var a=s&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return e.flags|=1,null!==t&&s?(e.child=Wo(e,t.child,null,o),e.child=Wo(e,null,a,o)):Ea(t,e,a,o),e.memoizedState=n.state,i&&Li(e,r,!0),e.child}function Pa(t){var e=t.stateNode;e.pendingContext?Ni(0,e.pendingContext,e.pendingContext!==e.context):e.context&&Ni(0,e.context,!1),ts(t,e.containerInfo)}function Ba(t,e,r,n,i){return Fo(),Vo(i),e.flags|=256,Ea(t,e,r,n),e.child}var Oa={dehydrated:null,treeContext:null,retryLane:0};function Na(t){return{baseLanes:t,cachePool:null,transitions:null}}function Da(t,e){return{baseLanes:t.baseLanes|e,cachePool:null,transitions:t.transitions}}function xa(t,e,r){var n,i=e.pendingProps,s=is.current,a=!1,u=0!==(128&e.flags);if((n=u)||(n=(null===t||null!==t.memoizedState)&&0!==(2&s)),n?(a=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(s|=1),Mi(is,1&s),null===t)return Uo(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(0===(1&e.mode)?e.lanes=1:"$!"===t.data?e.lanes=8:e.lanes=1073741824,null):(s=i.children,t=i.fallback,a?(i=e.mode,a=e.child,s={mode:"hidden",children:s},0===(1&i)&&null!==a?(a.childLanes=0,a.pendingProps=s):a=Dc(s,i,0,null),t=Nc(t,i,r,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=Na(r),e.memoizedState=Oa,t):La(e,s));if(null!==(s=t.memoizedState)){if(null!==(n=s.dehydrated)){if(u)return 256&e.flags?(e.flags&=-257,Ka(t,e,r,Error(o(422)))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(a=i.fallback,s=e.mode,i=Dc({mode:"visible",children:i.children},s,0,null),(a=Nc(a,s,r,null)).flags|=2,i.return=e,a.return=e,i.sibling=a,e.child=i,0!==(1&e.mode)&&Wo(e,t.child,null,r),e.child.memoizedState=Na(r),e.memoizedState=Oa,a);if(0===(1&e.mode))e=Ka(t,e,r,null);else if("$!"===n.data)e=Ka(t,e,r,Error(o(419)));else if(i=0!==(r&t.childLanes),_a||i){if(null!==(i=Mu)){switch(r&-r){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(i=0!==(a&(i.suspendedLanes|r))?0:a)&&i!==s.retryLane&&(s.retryLane=i,$u(t,i,-1))}pc(),e=Ka(t,e,r,Error(o(421)))}else"$?"===n.data?(e.flags|=128,e.child=t.child,e=Mc.bind(null,t),n._reactRetry=e,e=null):(r=s.treeContext,Bo=ci(n.nextSibling),Po=e,Oo=!0,No=null,null!==r&&(Eo[So++]=Ao,Eo[So++]=Mo,Eo[So++]=Io,Ao=r.id,Mo=r.overflow,Io=e),(e=La(e,e.pendingProps.children)).flags|=4096);return e}return a?(i=ja(t,e,i.children,i.fallback,r),a=e.child,s=t.child.memoizedState,a.memoizedState=null===s?Na(r):Da(s,r),a.childLanes=t.childLanes&~r,e.memoizedState=Oa,i):(r=Ua(t,e,i.children,r),e.memoizedState=null,r)}return a?(i=ja(t,e,i.children,i.fallback,r),a=e.child,s=t.child.memoizedState,a.memoizedState=null===s?Na(r):Da(s,r),a.childLanes=t.childLanes&~r,e.memoizedState=Oa,i):(r=Ua(t,e,i.children,r),e.memoizedState=null,r)}function La(t,e){return(e=Dc({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Ua(t,e,r,n){var i=t.child;return t=i.sibling,r=Bc(i,{mode:"visible",children:r}),0===(1&e.mode)&&(r.lanes=n),r.return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r}function ja(t,e,r,n,i){var o=e.mode,s=(t=t.child).sibling,a={mode:"hidden",children:r};return 0===(1&o)&&e.child!==t?((r=e.child).childLanes=0,r.pendingProps=a,e.deletions=null):(r=Bc(t,a)).subtreeFlags=14680064&t.subtreeFlags,null!==s?n=Bc(s,n):(n=Nc(n,o,i,null)).flags|=2,n.return=e,r.return=e,r.sibling=n,e.child=r,n}function Ka(t,e,r,n){return null!==n&&Vo(n),Wo(e,t.child,null,r),(t=La(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Fa(t,e,r){t.lanes|=e;var n=t.alternate;null!==n&&(n.lanes|=e),Qi(t.return,e,r)}function Va(t,e,r,n,i){var o=t.memoizedState;null===o?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function qa(t,e,r){var n=e.pendingProps,i=n.revealOrder,o=n.tail;if(Ea(t,e,n.children,r),0!==(2&(n=is.current)))n=1&n|2,e.flags|=128;else{if(null!==t&&0!==(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Fa(t,r,e);else if(19===t.tag)Fa(t,r,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(Mi(is,n),0===(1&e.mode))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;null!==r;)null!==(t=r.alternate)&&null===os(t)&&(i=r),r=r.sibling;null===(r=i)?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Va(e,!1,i,r,o);break;case"backwards":for(r=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===os(t)){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Va(e,!0,r,null,o);break;case"together":Va(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function za(t,e,r){if(null!==t&&(e.dependencies=t.dependencies),Ou|=e.lanes,0===(r&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(o(153));if(null!==e.child){for(r=Bc(t=e.child,t.pendingProps),e.child=r,r.return=e;null!==t.sibling;)t=t.sibling,(r=r.sibling=Bc(t,t.pendingProps)).return=e;r.sibling=null}return e.child}function Ha(t,e){switch(Co(e),e.tag){case 1:return Bi(e.type)&&Oi(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return es(),Ai(ki),Ai(Ri),as(),0!==(65536&(t=e.flags))&&0===(128&t)?(e.flags=-65537&t|128,e):null;case 5:return ns(e),null;case 13:if(Ai(is),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(o(340));Fo()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return Ai(is),null;case 4:return es(),null;case 10:return Xi(e.type._context),null;case 22:case 23:return lc(),null;default:return null}}var Ga=!1,Wa=!1,Za="function"===typeof WeakSet?WeakSet:Set,Ya=null;function Xa(t,e){var r=t.ref;if(null!==r)if("function"===typeof r)try{r(null)}catch(n){Sc(t,e,n)}else r.current=null}function Qa(t,e,r){try{r()}catch(n){Sc(t,e,n)}}var Ja=!1;function $a(t,e,r){var n=e.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,void 0!==o&&Qa(e,r,o)}i=i.next}while(i!==n)}}function tu(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function eu(t){var e=t.ref;if(null!==e){var r=t.stateNode;t.tag,t=r,"function"===typeof e?e(t):e.current=t}}function ru(t){var e=t.alternate;null!==e&&(t.alternate=null,ru(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&(null!==(e=t.stateNode)&&(delete e[fi],delete e[di],delete e[yi],delete e[gi],delete e[mi])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function nu(t){return 5===t.tag||3===t.tag||4===t.tag}function iu(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||nu(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function ou(t,e,r){var n=t.tag;if(5===n||6===n)t=t.stateNode,e?8===r.nodeType?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(8===r.nodeType?(e=r.parentNode).insertBefore(t,r):(e=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==e.onclick||(e.onclick=$n));else if(4!==n&&null!==(t=t.child))for(ou(t,e,r),t=t.sibling;null!==t;)ou(t,e,r),t=t.sibling}function su(t,e,r){var n=t.tag;if(5===n||6===n)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(4!==n&&null!==(t=t.child))for(su(t,e,r),t=t.sibling;null!==t;)su(t,e,r),t=t.sibling}var au=null,uu=!1;function cu(t,e,r){for(r=r.child;null!==r;)lu(t,e,r),r=r.sibling}function lu(t,e,r){if(oe&&"function"===typeof oe.onCommitFiberUnmount)try{oe.onCommitFiberUnmount(ie,r)}catch(a){}switch(r.tag){case 5:Wa||Xa(r,e);case 6:var n=au,i=uu;au=null,cu(t,e,r),uu=i,null!==(au=n)&&(uu?(t=au,r=r.stateNode,8===t.nodeType?t.parentNode.removeChild(r):t.removeChild(r)):au.removeChild(r.stateNode));break;case 18:null!==au&&(uu?(t=au,r=r.stateNode,8===t.nodeType?ui(t.parentNode,r):1===t.nodeType&&ui(t,r),Ve(t)):ui(au,r.stateNode));break;case 4:n=au,i=uu,au=r.stateNode.containerInfo,uu=!0,cu(t,e,r),au=n,uu=i;break;case 0:case 11:case 14:case 15:if(!Wa&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!==(2&o)||0!==(4&o))&&Qa(r,e,s),i=i.next}while(i!==n)}cu(t,e,r);break;case 1:if(!Wa&&(Xa(r,e),"function"===typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Sc(r,e,a)}cu(t,e,r);break;case 21:cu(t,e,r);break;case 22:1&r.mode?(Wa=(n=Wa)||null!==r.memoizedState,cu(t,e,r),Wa=n):cu(t,e,r);break;default:cu(t,e,r)}}function hu(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var r=t.stateNode;null===r&&(r=t.stateNode=new Za),e.forEach((function(e){var n=Tc.bind(null,t,e);r.has(e)||(r.add(e),e.then(n,n))}))}}function fu(t,e){var r=e.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n];try{var s=t,a=e,u=a;t:for(;null!==u;){switch(u.tag){case 5:au=u.stateNode,uu=!1;break t;case 3:case 4:au=u.stateNode.containerInfo,uu=!0;break t}u=u.return}if(null===au)throw Error(o(160));lu(s,a,i),au=null,uu=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(l){Sc(i,e,l)}}if(12854&e.subtreeFlags)for(e=e.child;null!==e;)du(e,t),e=e.sibling}function du(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(fu(e,t),pu(t),4&n){try{$a(3,t,t.return),tu(3,t)}catch(y){Sc(t,t.return,y)}try{$a(5,t,t.return)}catch(y){Sc(t,t.return,y)}}break;case 1:fu(e,t),pu(t),512&n&&null!==r&&Xa(r,r.return);break;case 5:if(fu(e,t),pu(t),512&n&&null!==r&&Xa(r,r.return),32&t.flags){var i=t.stateNode;try{ft(i,"")}catch(y){Sc(t,t.return,y)}}if(4&n&&null!=(i=t.stateNode)){var s=t.memoizedProps,a=null!==r?r.memoizedProps:s,u=t.type,c=t.updateQueue;if(t.updateQueue=null,null!==c)try{"input"===u&&"radio"===s.type&&null!=s.name&&Q(i,s),vt(u,a);var l=vt(u,s);for(a=0;a<c.length;a+=2){var h=c[a],f=c[a+1];"style"===h?gt(i,f):"dangerouslySetInnerHTML"===h?ht(i,f):"children"===h?ft(i,f):v(i,h,f,l)}switch(u){case"input":J(i,s);break;case"textarea":ot(i,s);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;null!=p?rt(i,!!s.multiple,p,!1):d!==!!s.multiple&&(null!=s.defaultValue?rt(i,!!s.multiple,s.defaultValue,!0):rt(i,!!s.multiple,s.multiple?[]:"",!1))}i[di]=s}catch(y){Sc(t,t.return,y)}}break;case 6:if(fu(e,t),pu(t),4&n){if(null===t.stateNode)throw Error(o(162));l=t.stateNode,h=t.memoizedProps;try{l.nodeValue=h}catch(y){Sc(t,t.return,y)}}break;case 3:if(fu(e,t),pu(t),4&n&&null!==r&&r.memoizedState.isDehydrated)try{Ve(e.containerInfo)}catch(y){Sc(t,t.return,y)}break;case 4:default:fu(e,t),pu(t);break;case 13:fu(e,t),pu(t),8192&(l=t.child).flags&&null!==l.memoizedState&&(null===l.alternate||null===l.alternate.memoizedState)&&(Uu=Qt()),4&n&&hu(t);break;case 22:if(l=null!==r&&null!==r.memoizedState,1&t.mode?(Wa=(h=Wa)||l,fu(e,t),Wa=h):fu(e,t),pu(t),8192&n){h=null!==t.memoizedState;t:for(f=null,d=t;;){if(5===d.tag){if(null===f){f=d;try{i=d.stateNode,h?"function"===typeof(s=i.style).setProperty?s.setProperty("display","none","important"):s.display="none":(u=d.stateNode,a=void 0!==(c=d.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,u.style.display=yt("display",a))}catch(y){Sc(t,t.return,y)}}}else if(6===d.tag){if(null===f)try{d.stateNode.nodeValue=h?"":d.memoizedProps}catch(y){Sc(t,t.return,y)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===t)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===t)break t;for(;null===d.sibling;){if(null===d.return||d.return===t)break t;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}if(h&&!l&&0!==(1&t.mode))for(Ya=t,t=t.child;null!==t;){for(l=Ya=t;null!==Ya;){switch(f=(h=Ya).child,h.tag){case 0:case 11:case 14:case 15:$a(4,h,h.return);break;case 1:if(Xa(h,h.return),"function"===typeof(s=h.stateNode).componentWillUnmount){d=h,p=h.return;try{i=d,s.props=i.memoizedProps,s.state=i.memoizedState,s.componentWillUnmount()}catch(y){Sc(d,p,y)}}break;case 5:Xa(h,h.return);break;case 22:if(null!==h.memoizedState){bu(l);continue}}null!==f?(f.return=h,Ya=f):bu(l)}t=t.sibling}}break;case 19:fu(e,t),pu(t),4&n&&hu(t);case 21:}}function pu(t){var e=t.flags;if(2&e){try{t:{for(var r=t.return;null!==r;){if(nu(r)){var n=r;break t}r=r.return}throw Error(o(160))}switch(n.tag){case 5:var i=n.stateNode;32&n.flags&&(ft(i,""),n.flags&=-33),su(t,iu(t),i);break;case 3:case 4:var s=n.stateNode.containerInfo;ou(t,iu(t),s);break;default:throw Error(o(161))}}catch(a){Sc(t,t.return,a)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function yu(t,e,r){Ya=t,gu(t,e,r)}function gu(t,e,r){for(var n=0!==(1&t.mode);null!==Ya;){var i=Ya,o=i.child;if(22===i.tag&&n){var s=null!==i.memoizedState||Ga;if(!s){var a=i.alternate,u=null!==a&&null!==a.memoizedState||Wa;a=Ga;var c=Wa;if(Ga=s,(Wa=u)&&!c)for(Ya=i;null!==Ya;)u=(s=Ya).child,22===s.tag&&null!==s.memoizedState?vu(i):null!==u?(u.return=s,Ya=u):vu(i);for(;null!==o;)Ya=o,gu(o,e,r),o=o.sibling;Ya=i,Ga=a,Wa=c}mu(t)}else 0!==(8772&i.subtreeFlags)&&null!==o?(o.return=i,Ya=o):mu(t)}}function mu(t){for(;null!==Ya;){var e=Ya;if(0!==(8772&e.flags)){var r=e.alternate;try{if(0!==(8772&e.flags))switch(e.tag){case 0:case 11:case 15:Wa||tu(5,e);break;case 1:var n=e.stateNode;if(4&e.flags&&!Wa)if(null===r)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:zi(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;null!==s&&co(e,s,n);break;case 3:var a=e.updateQueue;if(null!==a){if(r=null,null!==e.child)switch(e.child.tag){case 5:case 1:r=e.child.stateNode}co(e,a,r)}break;case 5:var u=e.stateNode;if(null===r&&4&e.flags){r=u;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(null===e.memoizedState){var l=e.alternate;if(null!==l){var h=l.memoizedState;if(null!==h){var f=h.dehydrated;null!==f&&Ve(f)}}}break;default:throw Error(o(163))}Wa||512&e.flags&&eu(e)}catch(d){Sc(e,e.return,d)}}if(e===t){Ya=null;break}if(null!==(r=e.sibling)){r.return=e.return,Ya=r;break}Ya=e.return}}function bu(t){for(;null!==Ya;){var e=Ya;if(e===t){Ya=null;break}var r=e.sibling;if(null!==r){r.return=e.return,Ya=r;break}Ya=e.return}}function vu(t){for(;null!==Ya;){var e=Ya;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{tu(4,e)}catch(u){Sc(e,r,u)}break;case 1:var n=e.stateNode;if("function"===typeof n.componentDidMount){var i=e.return;try{n.componentDidMount()}catch(u){Sc(e,i,u)}}var o=e.return;try{eu(e)}catch(u){Sc(e,o,u)}break;case 5:var s=e.return;try{eu(e)}catch(u){Sc(e,s,u)}}}catch(u){Sc(e,e.return,u)}if(e===t){Ya=null;break}var a=e.sibling;if(null!==a){a.return=e.return,Ya=a;break}Ya=e.return}}var wu,_u=Math.ceil,Eu=w.ReactCurrentDispatcher,Su=w.ReactCurrentOwner,Iu=w.ReactCurrentBatchConfig,Au=0,Mu=null,Tu=null,Ru=0,ku=0,Cu=Ii(0),Pu=0,Bu=null,Ou=0,Nu=0,Du=0,xu=null,Lu=null,Uu=0,ju=1/0,Ku=null,Fu=!1,Vu=null,qu=null,zu=!1,Hu=null,Gu=0,Wu=0,Zu=null,Yu=-1,Xu=0;function Qu(){return 0!==(6&Au)?Qt():-1!==Yu?Yu:Yu=Qt()}function Ju(t){return 0===(1&t.mode)?1:0!==(2&Au)&&0!==Ru?Ru&-Ru:null!==qi.transition?(0===Xu&&(Xu=ye()),Xu):0!==(t=ve)?t:t=void 0===(t=window.event)?16:Xe(t.type)}function $u(t,e,r){if(50<Wu)throw Wu=0,Zu=null,Error(o(185));var n=tc(t,e);return null===n?null:(me(n,e,r),0!==(2&Au)&&n===Mu||(n===Mu&&(0===(2&Au)&&(Nu|=e),4===Pu&&sc(n,Ru)),rc(n,r),1===e&&0===Au&&0===(1&t.mode)&&(ju=Qt()+500,ji&&Vi())),n)}function tc(t,e){t.lanes|=e;var r=t.alternate;for(null!==r&&(r.lanes|=e),r=t,t=t.return;null!==t;)t.childLanes|=e,null!==(r=t.alternate)&&(r.childLanes|=e),r=t,t=t.return;return 3===r.tag?r.stateNode:null}function ec(t){return(null!==Mu||null!==to)&&0!==(1&t.mode)&&0===(2&Au)}function rc(t,e){var r=t.callbackNode;!function(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-se(o),a=1<<s,u=i[s];-1===u?0!==(a&r)&&0===(a&n)||(i[s]=de(a,e)):u<=e&&(t.expiredLanes|=a),o&=~a}}(t,e);var n=fe(t,t===Mu?Ru:0);if(0===n)null!==r&&Zt(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(null!=r&&Zt(r),1===e)0===t.tag?function(t){ji=!0,Fi(t)}(ac.bind(null,t)):Fi(ac.bind(null,t)),si((function(){0===Au&&Vi()})),r=null;else{switch(we(n)){case 1:r=$t;break;case 4:r=te;break;case 16:default:r=ee;break;case 536870912:r=ne}r=Rc(r,nc.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function nc(t,e){if(Yu=-1,Xu=0,0!==(6&Au))throw Error(o(327));var r=t.callbackNode;if(_c()&&t.callbackNode!==r)return null;var n=fe(t,t===Mu?Ru:0);if(0===n)return null;if(0!==(30&n)||0!==(n&t.expiredLanes)||e)e=yc(t,n);else{e=n;var i=Au;Au|=2;var s=dc();for(Mu===t&&Ru===e||(Ku=null,ju=Qt()+500,hc(t,e));;)try{mc();break}catch(u){fc(t,u)}Yi(),Eu.current=s,Au=i,null!==Tu?e=0:(Mu=null,Ru=0,e=Pu)}if(0!==e){if(2===e&&(0!==(i=pe(t))&&(n=i,e=ic(t,i))),1===e)throw r=Bu,hc(t,0),sc(t,n),rc(t,Qt()),r;if(6===e)sc(t,n);else{if(i=t.current.alternate,0===(30&n)&&!function(t){for(var e=t;;){if(16384&e.flags){var r=e.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var i=r[n],o=i.getSnapshot;i=i.value;try{if(!an(o(),i))return!1}catch(a){return!1}}}if(r=e.child,16384&e.subtreeFlags&&null!==r)r.return=e,e=r;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}(i)&&(2===(e=yc(t,n))&&(0!==(s=pe(t))&&(n=s,e=ic(t,s))),1===e))throw r=Bu,hc(t,0),sc(t,n),rc(t,Qt()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(o(345));case 2:case 5:wc(t,Lu,Ku);break;case 3:if(sc(t,n),(130023424&n)===n&&10<(e=Uu+500-Qt())){if(0!==fe(t,0))break;if(((i=t.suspendedLanes)&n)!==n){Qu(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=ni(wc.bind(null,t,Lu,Ku),e);break}wc(t,Lu,Ku);break;case 4:if(sc(t,n),(4194240&n)===n)break;for(e=t.eventTimes,i=-1;0<n;){var a=31-se(n);s=1<<a,(a=e[a])>i&&(i=a),n&=~s}if(n=i,10<(n=(120>(n=Qt()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_u(n/1960))-n)){t.timeoutHandle=ni(wc.bind(null,t,Lu,Ku),n);break}wc(t,Lu,Ku);break;default:throw Error(o(329))}}}return rc(t,Qt()),t.callbackNode===r?nc.bind(null,t):null}function ic(t,e){var r=xu;return t.current.memoizedState.isDehydrated&&(hc(t,e).flags|=256),2!==(t=yc(t,e))&&(e=Lu,Lu=r,null!==e&&oc(e)),t}function oc(t){null===Lu?Lu=t:Lu.push.apply(Lu,t)}function sc(t,e){for(e&=~Du,e&=~Nu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-se(e),n=1<<r;t[r]=-1,e&=~n}}function ac(t){if(0!==(6&Au))throw Error(o(327));_c();var e=fe(t,0);if(0===(1&e))return rc(t,Qt()),null;var r=yc(t,e);if(0!==t.tag&&2===r){var n=pe(t);0!==n&&(e=n,r=ic(t,n))}if(1===r)throw r=Bu,hc(t,0),sc(t,e),rc(t,Qt()),r;if(6===r)throw Error(o(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,wc(t,Lu,Ku),rc(t,Qt()),null}function uc(t,e){var r=Au;Au|=1;try{return t(e)}finally{0===(Au=r)&&(ju=Qt()+500,ji&&Vi())}}function cc(t){null!==Hu&&0===Hu.tag&&0===(6&Au)&&_c();var e=Au;Au|=1;var r=Iu.transition,n=ve;try{if(Iu.transition=null,ve=1,t)return t()}finally{ve=n,Iu.transition=r,0===(6&(Au=e))&&Vi()}}function lc(){ku=Cu.current,Ai(Cu)}function hc(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(-1!==r&&(t.timeoutHandle=-1,ii(r)),null!==Tu)for(r=Tu.return;null!==r;){var n=r;switch(Co(n),n.tag){case 1:null!==(n=n.type.childContextTypes)&&void 0!==n&&Oi();break;case 3:es(),Ai(ki),Ai(Ri),as();break;case 5:ns(n);break;case 4:es();break;case 13:case 19:Ai(is);break;case 10:Xi(n.type._context);break;case 22:case 23:lc()}r=r.return}if(Mu=t,Tu=t=Bc(t.current,null),Ru=ku=e,Pu=0,Bu=null,Du=Nu=Ou=0,Lu=xu=null,null!==to){for(e=0;e<to.length;e++)if(null!==(n=(r=to[e]).interleaved)){r.interleaved=null;var i=n.next,o=r.pending;if(null!==o){var s=o.next;o.next=i,n.next=s}r.pending=n}to=null}return t}function fc(t,e){for(;;){var r=Tu;try{if(Yi(),us.current=ra,ps){for(var n=hs.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}ps=!1}if(ls=0,ds=fs=hs=null,ys=!1,gs=0,Su.current=null,null===r||null===r.return){Pu=1,Bu=e,Tu=null;break}t:{var s=t,a=r.return,u=r,c=e;if(e=Ru,u.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var l=c,h=u,f=h.tag;if(0===(1&h.mode)&&(0===f||11===f||15===f)){var d=h.alternate;d?(h.updateQueue=d.updateQueue,h.memoizedState=d.memoizedState,h.lanes=d.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=ya(a);if(null!==p){p.flags&=-257,ga(p,a,u,0,e),1&p.mode&&pa(s,l,e),c=l;var y=(e=p).updateQueue;if(null===y){var g=new Set;g.add(c),e.updateQueue=g}else y.add(c);break t}if(0===(1&e)){pa(s,l,e),pc();break t}c=Error(o(426))}else if(Oo&&1&u.mode){var m=ya(a);if(null!==m){0===(65536&m.flags)&&(m.flags|=256),ga(m,a,u,0,e),Vo(c);break t}}s=c,4!==Pu&&(Pu=2),null===xu?xu=[s]:xu.push(s),c=sa(c,u),u=a;do{switch(u.tag){case 3:u.flags|=65536,e&=-e,u.lanes|=e,ao(u,fa(0,c,e));break t;case 1:s=c;var b=u.type,v=u.stateNode;if(0===(128&u.flags)&&("function"===typeof b.getDerivedStateFromError||null!==v&&"function"===typeof v.componentDidCatch&&(null===qu||!qu.has(v)))){u.flags|=65536,e&=-e,u.lanes|=e,ao(u,da(u,s,e));break t}}u=u.return}while(null!==u)}vc(r)}catch(w){e=w,Tu===r&&null!==r&&(Tu=r=r.return);continue}break}}function dc(){var t=Eu.current;return Eu.current=ra,null===t?ra:t}function pc(){0!==Pu&&3!==Pu&&2!==Pu||(Pu=4),null===Mu||0===(268435455&Ou)&&0===(268435455&Nu)||sc(Mu,Ru)}function yc(t,e){var r=Au;Au|=2;var n=dc();for(Mu===t&&Ru===e||(Ku=null,hc(t,e));;)try{gc();break}catch(i){fc(t,i)}if(Yi(),Au=r,Eu.current=n,null!==Tu)throw Error(o(261));return Mu=null,Ru=0,Pu}function gc(){for(;null!==Tu;)bc(Tu)}function mc(){for(;null!==Tu&&!Yt();)bc(Tu)}function bc(t){var e=wu(t.alternate,t,ku);t.memoizedProps=t.pendingProps,null===e?vc(t):Tu=e,Su.current=null}function vc(t){var e=t;do{var r=e.alternate;if(t=e.return,0===(32768&e.flags)){if(null!==(r=va(r,e,ku)))return void(Tu=r)}else{if(null!==(r=Ha(r,e)))return r.flags&=32767,void(Tu=r);if(null===t)return Pu=6,void(Tu=null);t.flags|=32768,t.subtreeFlags=0,t.deletions=null}if(null!==(e=e.sibling))return void(Tu=e);Tu=e=t}while(null!==e);0===Pu&&(Pu=5)}function wc(t,e,r){var n=ve,i=Iu.transition;try{Iu.transition=null,ve=1,function(t,e,r,n){do{_c()}while(null!==Hu);if(0!==(6&Au))throw Error(o(327));r=t.finishedWork;var i=t.finishedLanes;if(null===r)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(o(177));t.callbackNode=null,t.callbackPriority=0;var s=r.lanes|r.childLanes;if(function(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var i=31-se(r),o=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~o}}(t,s),t===Mu&&(Tu=Mu=null,Ru=0),0===(2064&r.subtreeFlags)&&0===(2064&r.flags)||zu||(zu=!0,Rc(ee,(function(){return _c(),null}))),s=0!==(15990&r.flags),0!==(15990&r.subtreeFlags)||s){s=Iu.transition,Iu.transition=null;var a=ve;ve=1;var u=Au;Au|=4,Su.current=null,function(t,e){if(ti=ze,dn(t=fn())){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else t:{var n=(r=(r=t.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch(E){r=null;break t}var a=0,u=-1,c=-1,l=0,h=0,f=t,d=null;e:for(;;){for(var p;f!==r||0!==i&&3!==f.nodeType||(u=a+i),f!==s||0!==n&&3!==f.nodeType||(c=a+n),3===f.nodeType&&(a+=f.nodeValue.length),null!==(p=f.firstChild);)d=f,f=p;for(;;){if(f===t)break e;if(d===r&&++l===i&&(u=a),d===s&&++h===n&&(c=a),null!==(p=f.nextSibling))break;d=(f=d).parentNode}f=p}r=-1===u||-1===c?null:{start:u,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ei={focusedElem:t,selectionRange:r},ze=!1,Ya=e;null!==Ya;)if(t=(e=Ya).child,0!==(1028&e.subtreeFlags)&&null!==t)t.return=e,Ya=t;else for(;null!==Ya;){e=Ya;try{var y=e.alternate;if(0!==(1024&e.flags))switch(e.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==y){var g=y.memoizedProps,m=y.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?g:zi(e.type,g),m);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;if(1===w.nodeType)w.textContent="";else if(9===w.nodeType){var _=w.body;null!=_&&(_.textContent="")}break;default:throw Error(o(163))}}catch(E){Sc(e,e.return,E)}if(null!==(t=e.sibling)){t.return=e.return,Ya=t;break}Ya=e.return}y=Ja,Ja=!1}(t,r),du(r,t),pn(ei),ze=!!ti,ei=ti=null,t.current=r,yu(r,t,i),Xt(),Au=u,ve=a,Iu.transition=s}else t.current=r;if(zu&&(zu=!1,Hu=t,Gu=i),0===(s=t.pendingLanes)&&(qu=null),function(t){if(oe&&"function"===typeof oe.onCommitFiberRoot)try{oe.onCommitFiberRoot(ie,t,void 0,128===(128&t.current.flags))}catch(e){}}(r.stateNode),rc(t,Qt()),null!==e)for(n=t.onRecoverableError,r=0;r<e.length;r++)n(e[r]);if(Fu)throw Fu=!1,t=Vu,Vu=null,t;0!==(1&Gu)&&0!==t.tag&&_c(),0!==(1&(s=t.pendingLanes))?t===Zu?Wu++:(Wu=0,Zu=t):Wu=0,Vi()}(t,e,r,n)}finally{Iu.transition=i,ve=n}return null}function _c(){if(null!==Hu){var t=we(Gu),e=Iu.transition,r=ve;try{if(Iu.transition=null,ve=16>t?16:t,null===Hu)var n=!1;else{if(t=Hu,Hu=null,Gu=0,0!==(6&Au))throw Error(o(331));var i=Au;for(Au|=4,Ya=t.current;null!==Ya;){var s=Ya,a=s.child;if(0!==(16&Ya.flags)){var u=s.deletions;if(null!==u){for(var c=0;c<u.length;c++){var l=u[c];for(Ya=l;null!==Ya;){var h=Ya;switch(h.tag){case 0:case 11:case 15:$a(8,h,s)}var f=h.child;if(null!==f)f.return=h,Ya=f;else for(;null!==Ya;){var d=(h=Ya).sibling,p=h.return;if(ru(h),h===l){Ya=null;break}if(null!==d){d.return=p,Ya=d;break}Ya=p}}}var y=s.alternate;if(null!==y){var g=y.child;if(null!==g){y.child=null;do{var m=g.sibling;g.sibling=null,g=m}while(null!==g)}}Ya=s}}if(0!==(2064&s.subtreeFlags)&&null!==a)a.return=s,Ya=a;else t:for(;null!==Ya;){if(0!==(2048&(s=Ya).flags))switch(s.tag){case 0:case 11:case 15:$a(9,s,s.return)}var b=s.sibling;if(null!==b){b.return=s.return,Ya=b;break t}Ya=s.return}}var v=t.current;for(Ya=v;null!==Ya;){var w=(a=Ya).child;if(0!==(2064&a.subtreeFlags)&&null!==w)w.return=a,Ya=w;else t:for(a=v;null!==Ya;){if(0!==(2048&(u=Ya).flags))try{switch(u.tag){case 0:case 11:case 15:tu(9,u)}}catch(E){Sc(u,u.return,E)}if(u===a){Ya=null;break t}var _=u.sibling;if(null!==_){_.return=u.return,Ya=_;break t}Ya=u.return}}if(Au=i,Vi(),oe&&"function"===typeof oe.onPostCommitFiberRoot)try{oe.onPostCommitFiberRoot(ie,t)}catch(E){}n=!0}return n}finally{ve=r,Iu.transition=e}}return!1}function Ec(t,e,r){oo(t,e=fa(0,e=sa(r,e),1)),e=Qu(),null!==(t=tc(t,1))&&(me(t,1,e),rc(t,e))}function Sc(t,e,r){if(3===t.tag)Ec(t,t,r);else for(;null!==e;){if(3===e.tag){Ec(e,t,r);break}if(1===e.tag){var n=e.stateNode;if("function"===typeof e.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===qu||!qu.has(n))){oo(e,t=da(e,t=sa(r,t),1)),t=Qu(),null!==(e=tc(e,1))&&(me(e,1,t),rc(e,t));break}}e=e.return}}function Ic(t,e,r){var n=t.pingCache;null!==n&&n.delete(e),e=Qu(),t.pingedLanes|=t.suspendedLanes&r,Mu===t&&(Ru&r)===r&&(4===Pu||3===Pu&&(130023424&Ru)===Ru&&500>Qt()-Uu?hc(t,0):Du|=r),rc(t,e)}function Ac(t,e){0===e&&(0===(1&t.mode)?e=1:(e=le,0===(130023424&(le<<=1))&&(le=4194304)));var r=Qu();null!==(t=tc(t,e))&&(me(t,e,r),rc(t,r))}function Mc(t){var e=t.memoizedState,r=0;null!==e&&(r=e.retryLane),Ac(t,r)}function Tc(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(o(314))}null!==n&&n.delete(e),Ac(t,r)}function Rc(t,e){return Wt(t,e)}function kc(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cc(t,e,r,n){return new kc(t,e,r,n)}function Pc(t){return!(!(t=t.prototype)||!t.isReactComponent)}function Bc(t,e){var r=t.alternate;return null===r?((r=Cc(t.tag,e,t.key,t.mode)).elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&t.flags,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Oc(t,e,r,n,i,s){var a=2;if(n=t,"function"===typeof t)Pc(t)&&(a=1);else if("string"===typeof t)a=5;else t:switch(t){case S:return Nc(r.children,i,s,e);case I:a=8,i|=8;break;case A:return(t=Cc(12,r,e,2|i)).elementType=A,t.lanes=s,t;case k:return(t=Cc(13,r,e,i)).elementType=k,t.lanes=s,t;case C:return(t=Cc(19,r,e,i)).elementType=C,t.lanes=s,t;case O:return Dc(r,i,s,e);default:if("object"===typeof t&&null!==t)switch(t.$$typeof){case M:a=10;break t;case T:a=9;break t;case R:a=11;break t;case P:a=14;break t;case B:a=16,n=null;break t}throw Error(o(130,null==t?t:typeof t,""))}return(e=Cc(a,r,e,i)).elementType=t,e.type=n,e.lanes=s,e}function Nc(t,e,r,n){return(t=Cc(7,t,n,e)).lanes=r,t}function Dc(t,e,r,n){return(t=Cc(22,t,n,e)).elementType=O,t.lanes=r,t.stateNode={},t}function xc(t,e,r){return(t=Cc(6,t,null,e)).lanes=r,t}function Lc(t,e,r){return(e=Cc(4,null!==t.children?t.children:[],t.key,e)).lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Uc(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ge(0),this.expirationTimes=ge(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ge(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function jc(t,e,r,n,i,o,s,a,u){return t=new Uc(t,e,r,a,u),1===e?(e=1,!0===o&&(e|=8)):e=0,o=Cc(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(o),t}function Kc(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==n?null:""+n,children:t,containerInfo:e,implementation:r}}function Fc(t){if(!t)return Ti;t:{if(Vt(t=t._reactInternals)!==t||1!==t.tag)throw Error(o(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(Bi(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(o(171))}if(1===t.tag){var r=t.type;if(Bi(r))return Di(t,r,e)}return e}function Vc(t,e,r,n,i,o,s,a,u){return(t=jc(r,n,!0,t,0,o,0,a,u)).context=Fc(null),r=t.current,(o=io(n=Qu(),i=Ju(r))).callback=void 0!==e&&null!==e?e:null,oo(r,o),t.current.lanes=i,me(t,i,n),rc(t,n),t}function qc(t,e,r,n){var i=e.current,o=Qu(),s=Ju(i);return r=Fc(r),null===e.context?e.context=r:e.pendingContext=r,(e=io(o,s)).payload={element:t},null!==(n=void 0===n?null:n)&&(e.callback=n),oo(i,e),null!==(t=$u(i,s,o))&&so(t,i,s),s}function zc(t){return(t=t.current).child?(t.child.tag,t.child.stateNode):null}function Hc(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var r=t.retryLane;t.retryLane=0!==r&&r<e?r:e}}function Gc(t,e){Hc(t,e),(t=t.alternate)&&Hc(t,e)}wu=function(t,e,r){if(null!==t)if(t.memoizedProps!==e.pendingProps||ki.current)_a=!0;else{if(0===(t.lanes&r)&&0===(128&e.flags))return _a=!1,function(t,e,r){switch(e.tag){case 3:Pa(e),Fo();break;case 5:rs(e);break;case 1:Bi(e.type)&&xi(e);break;case 4:ts(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;Mi(Hi,n._currentValue),n._currentValue=i;break;case 13:if(null!==(n=e.memoizedState))return null!==n.dehydrated?(Mi(is,1&is.current),e.flags|=128,null):0!==(r&e.child.childLanes)?xa(t,e,r):(Mi(is,1&is.current),null!==(t=za(t,e,r))?t.sibling:null);Mi(is,1&is.current);break;case 19:if(n=0!==(r&e.childLanes),0!==(128&t.flags)){if(n)return qa(t,e,r);e.flags|=128}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mi(is,is.current),n)break;return null;case 22:case 23:return e.lanes=0,Ma(t,e,r)}return za(t,e,r)}(t,e,r);_a=0!==(131072&t.flags)}else _a=!1,Oo&&0!==(1048576&e.flags)&&Ro(e,_o,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps;var i=Pi(e,Ri.current);Ji(e,r),i=ws(null,e,n,t,i,r);var s=_s();return e.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Bi(n)?(s=!0,xi(e)):s=!1,e.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,ro(e),i.updater=fo,e.stateNode=i,i._reactInternals=e,mo(e,n,t,r),e=Ca(null,e,n,!0,s,r)):(e.tag=0,Oo&&s&&ko(e),Ea(null,e,i,r),e=e.child),e;case 16:n=e.elementType;t:{switch(null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,n=(i=n._init)(n._payload),e.type=n,i=e.tag=function(t){if("function"===typeof t)return Pc(t)?1:0;if(void 0!==t&&null!==t){if((t=t.$$typeof)===R)return 11;if(t===P)return 14}return 2}(n),t=zi(n,t),i){case 0:e=Ra(null,e,n,t,r);break t;case 1:e=ka(null,e,n,t,r);break t;case 11:e=Sa(null,e,n,t,r);break t;case 14:e=Ia(null,e,n,zi(n.type,t),r);break t}throw Error(o(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,Ra(t,e,n,i=e.elementType===n?i:zi(n,i),r);case 1:return n=e.type,i=e.pendingProps,ka(t,e,n,i=e.elementType===n?i:zi(n,i),r);case 3:t:{if(Pa(e),null===t)throw Error(o(387));n=e.pendingProps,i=(s=e.memoizedState).element,no(t,e),uo(e,n,null,r);var a=e.memoizedState;if(n=a.element,s.isDehydrated){if(s={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,256&e.flags){e=Ba(t,e,n,r,i=Error(o(423)));break t}if(n!==i){e=Ba(t,e,n,r,i=Error(o(424)));break t}for(Bo=ci(e.stateNode.containerInfo.firstChild),Po=e,Oo=!0,No=null,r=Zo(e,null,n,r),e.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(Fo(),n===i){e=za(t,e,r);break t}Ea(t,e,n,r)}e=e.child}return e;case 5:return rs(e),null===t&&Uo(e),n=e.type,i=e.pendingProps,s=null!==t?t.memoizedProps:null,a=i.children,ri(n,i)?a=null:null!==s&&ri(n,s)&&(e.flags|=32),Ta(t,e),Ea(t,e,a,r),e.child;case 6:return null===t&&Uo(e),null;case 13:return xa(t,e,r);case 4:return ts(e,e.stateNode.containerInfo),n=e.pendingProps,null===t?e.child=Wo(e,null,n,r):Ea(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,Sa(t,e,n,i=e.elementType===n?i:zi(n,i),r);case 7:return Ea(t,e,e.pendingProps,r),e.child;case 8:case 12:return Ea(t,e,e.pendingProps.children,r),e.child;case 10:t:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,Mi(Hi,n._currentValue),n._currentValue=a,null!==s)if(an(s.value,a)){if(s.children===i.children&&!ki.current){e=za(t,e,r);break t}}else for(null!==(s=e.child)&&(s.return=e);null!==s;){var u=s.dependencies;if(null!==u){a=s.child;for(var c=u.firstContext;null!==c;){if(c.context===n){if(1===s.tag){(c=io(-1,r&-r)).tag=2;var l=s.updateQueue;if(null!==l){var h=(l=l.shared).pending;null===h?c.next=c:(c.next=h.next,h.next=c),l.pending=c}}s.lanes|=r,null!==(c=s.alternate)&&(c.lanes|=r),Qi(s.return,r,e),u.lanes|=r;break}c=c.next}}else if(10===s.tag)a=s.type===e.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(o(341));a.lanes|=r,null!==(u=a.alternate)&&(u.lanes|=r),Qi(a,r,e),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===e){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}Ea(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Ji(e,r),n=n(i=$i(i)),e.flags|=1,Ea(t,e,n,r),e.child;case 14:return i=zi(n=e.type,e.pendingProps),Ia(t,e,n,i=zi(n.type,i),r);case 15:return Aa(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:zi(n,i),null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),e.tag=1,Bi(n)?(t=!0,xi(e)):t=!1,Ji(e,r),yo(e,n,i),mo(e,n,i,r),Ca(null,e,n,!0,t,r);case 19:return qa(t,e,r);case 22:return Ma(t,e,r)}throw Error(o(156,e.tag))};var Wc="function"===typeof reportError?reportError:function(t){console.error(t)};function Zc(t){this._internalRoot=t}function Yc(t){this._internalRoot=t}function Xc(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)}function Qc(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType&&(8!==t.nodeType||" react-mount-point-unstable "!==t.nodeValue))}function Jc(){}function $c(t,e,r,n,i){var o=r._reactRootContainer;if(o){var s=o;if("function"===typeof i){var a=i;i=function(){var t=zc(s);a.call(t)}}qc(e,s,t,i)}else s=function(t,e,r,n,i){if(i){if("function"===typeof n){var o=n;n=function(){var t=zc(s);o.call(t)}}var s=Vc(e,n,t,0,null,!1,0,"",Jc);return t._reactRootContainer=s,t[pi]=s.current,Vn(8===t.nodeType?t.parentNode:t),cc(),s}for(;i=t.lastChild;)t.removeChild(i);if("function"===typeof n){var a=n;n=function(){var t=zc(u);a.call(t)}}var u=jc(t,0,!1,null,0,!1,0,"",Jc);return t._reactRootContainer=u,t[pi]=u.current,Vn(8===t.nodeType?t.parentNode:t),cc((function(){qc(e,u,r,n)})),u}(r,e,t,i,n);return zc(s)}Yc.prototype.render=Zc.prototype.render=function(t){var e=this._internalRoot;if(null===e)throw Error(o(409));qc(t,e,null,null)},Yc.prototype.unmount=Zc.prototype.unmount=function(){var t=this._internalRoot;if(null!==t){this._internalRoot=null;var e=t.containerInfo;cc((function(){qc(null,t,null,null)})),e[pi]=null}},Yc.prototype.unstable_scheduleHydration=function(t){if(t){var e=Ie();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Oe.length&&0!==e&&e<Oe[r].priority;r++);Oe.splice(r,0,t),0===r&&Le(t)}},_e=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=he(e.pendingLanes);0!==r&&(be(e,1|r),rc(e,Qt()),0===(6&Au)&&(ju=Qt()+500,Vi()))}break;case 13:var n=Qu();cc((function(){return $u(t,1,n)})),Gc(t,1)}},Ee=function(t){13===t.tag&&($u(t,134217728,Qu()),Gc(t,134217728))},Se=function(t){if(13===t.tag){var e=Qu(),r=Ju(t);$u(t,r,e),Gc(t,r)}},Ie=function(){return ve},Ae=function(t,e){var r=ve;try{return ve=t,e()}finally{ve=r}},Et=function(t,e,r){switch(e){case"input":if(J(t,r),e=r.name,"radio"===r.type&&null!=e){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=_i(n);if(!i)throw Error(o(90));W(n),J(n,i)}}}break;case"textarea":ot(t,r);break;case"select":null!=(e=r.value)&&rt(t,!!r.multiple,e,!1)}},Rt=uc,kt=cc;var tl={usingClientEntryPoint:!1,Events:[vi,wi,_i,Mt,Tt,uc]},el={findFiberByHostInstance:bi,bundleType:0,version:"18.1.0",rendererPackageName:"react-dom"},rl={bundleType:el.bundleType,version:el.version,rendererPackageName:el.rendererPackageName,rendererConfig:el.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return null===(t=Ht(t))?null:t.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.1.0-next-22edb9f77-20220426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nl.isDisabled&&nl.supportsFiber)try{ie=nl.inject(rl),oe=nl}catch(lt){}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tl,e.createPortal=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xc(e))throw Error(o(200));return Kc(t,e,null,r)},e.createRoot=function(t,e){if(!Xc(t))throw Error(o(299));var r=!1,n="",i=Wc;return null!==e&&void 0!==e&&(!0===e.unstable_strictMode&&(r=!0),void 0!==e.identifierPrefix&&(n=e.identifierPrefix),void 0!==e.onRecoverableError&&(i=e.onRecoverableError)),e=jc(t,1,!1,null,0,r,0,n,i),t[pi]=e.current,Vn(8===t.nodeType?t.parentNode:t),new Zc(e)},e.findDOMNode=function(t){if(null==t)return null;if(1===t.nodeType)return t;var e=t._reactInternals;if(void 0===e){if("function"===typeof t.render)throw Error(o(188));throw t=Object.keys(t).join(","),Error(o(268,t))}return t=null===(t=Ht(e))?null:t.stateNode},e.flushSync=function(t){return cc(t)},e.hydrate=function(t,e,r){if(!Qc(e))throw Error(o(200));return $c(null,t,e,!0,r)},e.hydrateRoot=function(t,e,r){if(!Xc(t))throw Error(o(405));var n=null!=r&&r.hydratedSources||null,i=!1,s="",a=Wc;if(null!==r&&void 0!==r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(s=r.identifierPrefix),void 0!==r.onRecoverableError&&(a=r.onRecoverableError)),e=Vc(e,null,t,1,null!=r?r:null,i,0,s,a),t[pi]=e.current,Vn(t),n)for(t=0;t<n.length;t++)i=(i=(r=n[t])._getVersion)(r._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new Yc(e)},e.render=function(t,e,r){if(!Qc(e))throw Error(o(200));return $c(null,t,e,!1,r)},e.unmountComponentAtNode=function(t){if(!Qc(t))throw Error(o(40));return!!t._reactRootContainer&&(cc((function(){$c(null,null,t,!1,(function(){t._reactRootContainer=null,t[pi]=null}))})),!0)},e.unstable_batchedUpdates=uc,e.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Qc(r))throw Error(o(200));if(null==t||void 0===t._reactInternals)throw Error(o(38));return $c(t,e,r,!1,n)},e.version="18.1.0-next-22edb9f77-20220426"},54164:(t,e,r)=>{"use strict";!function t(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}(),t.exports=r(34463)},66374:(t,e,r)=>{"use strict";var n=r(72791),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,r){var n,o={},c=null,l=null;for(n in void 0!==r&&(c=""+r),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(l=e.ref),e)s.call(e,n)&&!u.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===o[n]&&(o[n]=e[n]);return{$$typeof:i,type:t,key:c,ref:l,props:o,_owner:a.current}}e.jsx=c,e.jsxs=c},59117:(t,e)=>{"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,g={};function m(t,e,r){this.props=t,this.context=e,this.refs=g,this.updater=r||p}function b(){}function v(t,e,r){this.props=t,this.context=e,this.refs=g,this.updater=r||p}m.prototype.isReactComponent={},m.prototype.setState=function(t,e){if("object"!==typeof t&&"function"!==typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},m.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},b.prototype=m.prototype;var w=v.prototype=new b;w.constructor=v,y(w,m.prototype),w.isPureReactComponent=!0;var _=Array.isArray,E=Object.prototype.hasOwnProperty,S={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function A(t,e,n){var i,o={},s=null,a=null;if(null!=e)for(i in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(s=""+e.key),e)E.call(e,i)&&!I.hasOwnProperty(i)&&(o[i]=e[i]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];o.children=c}if(t&&t.defaultProps)for(i in u=t.defaultProps)void 0===o[i]&&(o[i]=u[i]);return{$$typeof:r,type:t,key:s,ref:a,props:o,_owner:S.current}}function M(t){return"object"===typeof t&&null!==t&&t.$$typeof===r}var T=/\/+/g;function R(t,e){return"object"===typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function k(t,e,i,o,s){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var u=!1;if(null===t)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case r:case n:u=!0}}if(u)return s=s(u=t),t=""===o?"."+R(u,0):o,_(s)?(i="",null!=t&&(i=t.replace(T,"$&/")+"/"),k(s,e,i,"",(function(t){return t}))):null!=s&&(M(s)&&(s=function(t,e){return{$$typeof:r,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(s,i+(!s.key||u&&u.key===s.key?"":(""+s.key).replace(T,"$&/")+"/")+t)),e.push(s)),1;if(u=0,o=""===o?".":o+":",_(t))for(var c=0;c<t.length;c++){var l=o+R(a=t[c],c);u+=k(a,e,i,l,s)}else if(l=function(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=d&&t[d]||t["@@iterator"])?t:null}(t),"function"===typeof l)for(t=l.call(t),c=0;!(a=t.next()).done;)u+=k(a=a.value,e,i,l=o+R(a,c++),s);else if("object"===a)throw e=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return u}function C(t,e,r){if(null==t)return t;var n=[],i=0;return k(t,n,"","",(function(t){return e.call(r,t,i++)})),n}function P(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var B={current:null},O={transition:null},N={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:O,ReactCurrentOwner:S};e.Children={map:C,forEach:function(t,e,r){C(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return C(t,(function(){e++})),e},toArray:function(t){return C(t,(function(t){return t}))||[]},only:function(t){if(!M(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},e.Component=m,e.Fragment=i,e.Profiler=s,e.PureComponent=v,e.StrictMode=o,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,e.cloneElement=function(t,e,n){if(null===t||void 0===t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=y({},t.props),o=t.key,s=t.ref,a=t._owner;if(null!=e){if(void 0!==e.ref&&(s=e.ref,a=S.current),void 0!==e.key&&(o=""+e.key),t.type&&t.type.defaultProps)var u=t.type.defaultProps;for(c in e)E.call(e,c)&&!I.hasOwnProperty(c)&&(i[c]=void 0===e[c]&&void 0!==u?u[c]:e[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){u=Array(c);for(var l=0;l<c;l++)u[l]=arguments[l+2];i.children=u}return{$$typeof:r,type:t.type,key:o,ref:s,props:i,_owner:a}},e.createContext=function(t){return(t={$$typeof:u,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:t},t.Consumer=t},e.createElement=A,e.createFactory=function(t){var e=A.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:c,render:t}},e.isValidElement=M,e.lazy=function(t){return{$$typeof:f,_payload:{_status:-1,_result:t},_init:P}},e.memo=function(t,e){return{$$typeof:h,type:t,compare:void 0===e?null:e}},e.startTransition=function(t){var e=O.transition;O.transition={};try{t()}finally{O.transition=e}},e.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},e.useCallback=function(t,e){return B.current.useCallback(t,e)},e.useContext=function(t){return B.current.useContext(t)},e.useDebugValue=function(){},e.useDeferredValue=function(t){return B.current.useDeferredValue(t)},e.useEffect=function(t,e){return B.current.useEffect(t,e)},e.useId=function(){return B.current.useId()},e.useImperativeHandle=function(t,e,r){return B.current.useImperativeHandle(t,e,r)},e.useInsertionEffect=function(t,e){return B.current.useInsertionEffect(t,e)},e.useLayoutEffect=function(t,e){return B.current.useLayoutEffect(t,e)},e.useMemo=function(t,e){return B.current.useMemo(t,e)},e.useReducer=function(t,e,r){return B.current.useReducer(t,e,r)},e.useRef=function(t){return B.current.useRef(t)},e.useState=function(t){return B.current.useState(t)},e.useSyncExternalStore=function(t,e,r){return B.current.useSyncExternalStore(t,e,r)},e.useTransition=function(){return B.current.useTransition()},e.version="18.1.0"},72791:(t,e,r)=>{"use strict";t.exports=r(59117)},80184:(t,e,r)=>{"use strict";t.exports=r(66374)},14003:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"===typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a;if("string"===typeof e&&(o="not ",e.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},48749:(t,e,r)=>{"use strict";var n=r(21964),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(26978),s=r(51704);r(12534)(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(t){if(!(this instanceof l))return new l(t);o.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||n.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},95627:(t,e,r)=>{"use strict";t.exports=i;var n=r(4784);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(12534)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},26978:(t,e,r)=>{"use strict";var n,i=r(21964);t.exports=A,A.ReadableState=I;r(47465).EventEmitter;var o=function(t,e){return t.listeners(e).length},s=r(76184),a=r(19778).Buffer,u=r.g.Uint8Array||function(){};var c,l=r(94616);c=l&&l.debuglog?l.debuglog("stream"):function(){};var h,f,d,p=r(25566),y=r(32644),g=r(5730).getHighWaterMark,m=r(14003).q,b=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(12534)(A,s);var E=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function I(t,e,i){n=n||r(48749),t=t||{},"boolean"!==typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=r(15948).s),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(48749),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new I(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function M(t,e,r,n,i){c("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,P(t)))}(t,s);else if(i||(o=function(t,e){var r;n=e,a.isBuffer(n)||n instanceof u||"string"===typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(s,e)),o)E(t,o);else if(s.objectMode||e&&e.length>0)if("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)s.endEmitted?E(t,new _):T(t,s,e,!0);else if(s.ended)E(t,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?T(t,s,e,!1):B(t,s)):T(t,s,e,!1)}else n||(s.reading=!1,B(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function T(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&C(t)),B(t,e)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"===typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),M(this,t,e,!1,r)},A.prototype.unshift=function(t){return M(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){h||(h=r(15948).s);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var R=1073741824;function k(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(P,t))}function P(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,L(t)}function B(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(c("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function N(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function D(t){c("readable nexttick read 0"),t.read(0)}function x(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),L(t),e.flowing&&!e.reading&&t.read(0)}function L(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function U(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function j(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(K,e,t))}function K(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}A.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):C(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=k(r,e))),null===(n=t>0?U(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){E(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,e);var s=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?u:g;function a(e,i){c("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),t.removeListener("close",p),t.removeListener("finish",y),t.removeListener("drain",l),t.removeListener("error",d),t.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",f),h=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function u(){c("onend"),t.end()}n.endEmitted?i.nextTick(s):r.once("end",s),t.on("unpipe",a);var l=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,L(t))}}(r);t.on("drain",l);var h=!1;function f(e){c("ondata");var i=t.write(e);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==F(n.pipes,t))&&!h&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){c("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&E(t,e)}function p(){t.removeListener("finish",y),g()}function y(){c("onfinish"),t.removeListener("close",p),g()}function g(){c("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",y),t.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},A.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?C(this):n.reading||i.nextTick(D,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(N,this),r},A.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(N,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(x,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){c("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"===typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(79150)),f(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=U,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(A.from=function(t,e){return void 0===d&&(d=r(74886)),d(A,t,e)})},4784:(t,e,r)=>{"use strict";t.exports=l;var n=r(14003).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(48749);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(t){if(!(this instanceof l))return new l(t);u.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"===typeof t.transform&&(this._transform=t.transform),"function"===typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!==typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(e,r){f(t,e,r)}))}function f(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(12534)(l,u),l.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},l.prototype._transform=function(t,e,r){r(new i("_transform()"))},l.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},l.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},51704:(t,e,r)=>{"use strict";var n,i=r(21964);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=I;var s={deprecate:r(89515)},a=r(76184),u=r(19778).Buffer,c=r.g.Uint8Array||function(){};var l,h=r(32644),f=r(5730).getHighWaterMark,d=r(14003).q,p=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,E=h.errorOrDestroy;function S(){}function I(t,e,s){n=n||r(48749),t=t||{},"boolean"!==typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!==typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(P,t,e),t._writableState.errorEmitted=!0,E(t,n)):(o(n),t._writableState.errorEmitted=!0,E(t,n),P(t,e))}(t,r,n,e,o);else{var s=k(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?i.nextTick(T,t,r,s,o):T(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(48749));if(!e&&!l.call(A,this))return new A(t);this._writableState=new I(t,this,e),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),a.call(this)}function M(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function T(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),P(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,M(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,h=r.callback;if(M(t,e,!1,e.objectMode?1:c.length,c,l,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final((function(r){e.pendingcb--,r&&E(t,r),e.prefinished=!0,t.emit("prefinish"),P(t,e)}))}function P(t,e){var r=k(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!==typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(C,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(12534)(A,a),I.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(I.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===A&&(t&&t._writableState instanceof I)}})):l=function(t){return t instanceof this},A.prototype.pipe=function(){E(this,new m)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,u.isBuffer(n)||n instanceof c);return a&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"===typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!==typeof r&&(r=S),o.ending?function(t,e){var r=new w;E(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"===typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=u.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else M(t,e,!1,a,n,i,o);return c}(this,o,a,t,e,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||R(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"===typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},79150:(t,e,r)=>{"use strict";var n,i=r(21964);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(45762),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[d].read();null!==r&&(t[h]=null,t[a]=null,t[u]=null,e(p(r,!1)))}}function g(t){i.nextTick(y,t)}var m=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(p(void 0,!0))}))}));var r,n=this[h];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[l]?r(p(void 0,!0)):e[f](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),m);t.exports=function(t){var e,r=Object.create(b,(o(e={},d,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,l,{value:t._readableState.endEmitted,writable:!0}),o(e,f,{value:function(t,e){var n=r[d].read();n?(r[h]=null,r[a]=null,r[u]=null,t(p(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[h]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[h]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0})),t.on("readable",g.bind(null,r)),r}},25566:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=r(19778).Buffer,a=r(52361).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,c;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],r&&o(e.prototype,r),c&&o(e,c),t}()},32644:(t,e,r)=>{"use strict";var n=r(21964);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},45762:(t,e,r)=>{"use strict";var n=r(14003).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||l()},c=e._writableState&&e._writableState.finished,l=function(){a=!1,c=!0,s||o.call(e)},h=e._readableState&&e._readableState.endEmitted,f=function(){s=!1,h=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!h?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!c?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},y=function(){e.req.on("finish",l)};return!function(t){return t.setHeader&&"function"===typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",u),e.on("close",u)):(e.on("complete",l),e.on("abort",p),e.req?y():e.on("request",y)),e.on("end",f),e.on("finish",l),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",l),e.removeListener("abort",p),e.removeListener("request",y),e.req&&e.req.removeListener("finish",l),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("end",f),e.removeListener("error",d),e.removeListener("close",p)}}},74886:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},34541:(t,e,r)=>{"use strict";var n;var i=r(14003).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(45762)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"===typeof t.abort}(t)?t.abort():"function"===typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function l(t,e){return t.pipe(e)}function h(t){return t.length?"function"!==typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=h(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(l)}},5730:(t,e,r)=>{"use strict";var n=r(14003).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},76184:(t,e,r)=>{t.exports=r(47465).EventEmitter},90723:(t,e,r)=>{(e=t.exports=r(26978)).Stream=e,e.Readable=e,e.Writable=r(51704),e.Duplex=r(48749),e.Transform=r(4784),e.PassThrough=r(95627),e.finished=r(45762),e.pipeline=r(34541)},449:(t,e,r)=>{"use strict";t.exports=s;var n=r(78193),i=s.prototype,o=new Date%1e9;function s(t){t=t||{},this.id=t.id||(1e9*Math.random()>>>0)+o++,this.max=t.max||1/0,this.items=t.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(t.lastModified||new Date);for(var e,r,n=this.items.length;n--;)e=this.items[n],r=new Date(e.expires)-new Date,this._lookup[e.key]=e,r>0?this.expire(e.key,r):r<=0&&this.delete(e.key)}i.has=function(t){return t in this._lookup},i.get=function(t){if(!this.has(t))return null;var e=this._lookup[t];return e.refresh&&this.expire(t,e.refresh),this.items.splice(this.items.indexOf(e),1),this.items.push(e),e.value},i.meta=function(t){if(!this.has(t))return null;var e=this._lookup[t];return"meta"in e?e.meta:null},i.set=function(t,e,r){var n=this._lookup[t],i=this._lookup[t]={key:t,value:e};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),r&&("ttl"in r&&this.expire(t,r.ttl),"meta"in r&&(i.meta=r.meta),r.refresh&&(i.refresh=r.ttl)),this},i.delete=function(t){var e=this._lookup[t];return!!e&&(this.lastModified=new Date,this.items.splice(this.items.indexOf(e),1),clearTimeout(e.timeout),delete this._lookup[t],this.size--,this)},i.expire=function(t,e){var r=e||0,i=this._lookup[t];if(!i)return this;if("string"===typeof r&&(r=n(e)),"number"!==typeof r)throw new TypeError("Expiration time must be a string or number.");return clearTimeout(i.timeout),i.timeout=setTimeout(this.delete.bind(this,i.key),r),i.expires=Number(new Date)+r,this},i.clear=function(){for(var t=this.items.length;t--;)this.delete(this.items[t].key);return this},i.toJSON=function(){for(var t,e=new Array(this.items.length),r=e.length;r--;)t=this.items[r],e[r]={key:t.key,meta:t.meta,value:t.value,expires:t.expires,refresh:t.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:e}}},31779:(t,e,r)=>{"use strict";const n=r(36222);class i{constructor(t,e,r){const i=this;this._started=n(),this._rescheduled=0,this._scheduled=e,this._args=r,this._triggered=!1,this._timerWrapper=()=>{i._rescheduled>0?(i._scheduled=i._rescheduled-(n()-i._started),i._schedule(i._scheduled)):(i._triggered=!0,t.apply(null,i._args))},this._timer=setTimeout(this._timerWrapper,e)}reschedule(t){t||(t=this._scheduled);const e=n();e+t-(this._started+this._scheduled)<0?(clearTimeout(this._timer),this._schedule(t)):this._triggered?this._schedule(t):(this._started=e,this._rescheduled=t)}_schedule(t){this._triggered=!1,this._started=n(),this._rescheduled=0,this._scheduled=t,this._timer=setTimeout(this._timerWrapper,t)}clear(){clearTimeout(this._timer)}}t.exports=function(){if("function"!==typeof arguments[0])throw new Error("callback needed");if("number"!==typeof arguments[1])throw new Error("timeout needed");let t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e<t.length;e++)t[e]=arguments[e+2]}return new i(arguments[0],arguments[1],t)}},36222:t=>{"use strict";t.exports=function(){return Date.now()}},99158:(t,e,r)=>{t.exports=r(95509)},95509:(t,e,r)=>{var n=r(1500);e.operation=function(t){var r=e.timeouts(t);return new n(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort((function(t,e){return t-e})),n},e.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout)},e.wrap=function(t,r,n){if(r instanceof Array&&(n=r,r=null),!n)for(var i in n=[],t)"function"===typeof t[i]&&n.push(i);for(var o=0;o<n.length;o++){var s=n[o],a=t[s];t[s]=function(n){var i=e.operation(r),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push((function(t){i.retry(t)||(t&&(arguments[0]=i.mainError()),s.apply(this,arguments))})),i.attempt((function(){n.apply(t,o)}))}.bind(t,a),t[s].options=r}}},1500:t=>{function e(t,e){"boolean"===typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),r),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}},83375:(t,e,r)=>{"use strict";var n=r(19778).Buffer,i=r(12534),o=r(86266),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function y(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function m(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function b(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function v(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,I=0|this._e,A=0;A<80;A+=1){var M,T;A<16?(M=y(r,n,i,o,d,t[a[A]],h[0],c[A]),T=v(w,_,E,S,I,t[u[A]],f[0],l[A])):A<32?(M=g(r,n,i,o,d,t[a[A]],h[1],c[A]),T=b(w,_,E,S,I,t[u[A]],f[1],l[A])):A<48?(M=m(r,n,i,o,d,t[a[A]],h[2],c[A]),T=m(w,_,E,S,I,t[u[A]],f[2],l[A])):A<64?(M=b(r,n,i,o,d,t[a[A]],h[3],c[A]),T=g(w,_,E,S,I,t[u[A]],f[3],l[A])):(M=v(r,n,i,o,d,t[a[A]],h[4],c[A]),T=y(w,_,E,S,I,t[u[A]],f[4],l[A])),r=d,d=o,o=p(i,10),i=n,n=M,w=I,I=S,S=p(E,10),E=_,_=T}var R=this._b+i+S|0;this._b=this._c+o+I|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=R},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},82543:(t,e,r)=>{var n=r(19778),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},39138:(t,e,r)=>{"use strict";var n,i=r(21964),o=r(19778),s=o.Buffer,a={};for(n in o)o.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=o[n]);var u=a.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(u[n]=s[n]);if(a.Buffer.prototype=s.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(t,e,r){if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&"undefined"===typeof t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return s(t,e,r)}),u.alloc||(u.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=s(t);return e&&0!==e.length?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(c){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a},6327:(t,e,r)=>{"use strict";var n=r(60206),i=/[\/\?<>\\:\*\|"]/g,o=/[\x00-\x1f\x80-\x9f]/g,s=/^\.+$/,a=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,u=/[\. ]+$/;function c(t,e){if("string"!==typeof t)throw new Error("Input must be string");var r=t.replace(i,e).replace(o,e).replace(s,e).replace(a,e).replace(u,e);return n(r,255)}t.exports=function(t,e){var r=e&&e.replacement||"",n=c(t,r);return""===r?n:c(n,"")}},36813:(t,e)=>{"use strict";function r(t,e){var r=t.length;t.push(e);t:for(;0<r;){var n=r-1>>>1,i=t[n];if(!(0<o(i,e)))break t;t[n]=e,t[r]=i,r=n}}function n(t){return 0===t.length?null:t[0]}function i(t){if(0===t.length)return null;var e=t[0],r=t.pop();if(r!==e){t[0]=r;t:for(var n=0,i=t.length,s=i>>>1;n<s;){var a=2*(n+1)-1,u=t[a],c=a+1,l=t[c];if(0>o(u,r))c<i&&0>o(l,u)?(t[n]=l,t[c]=r,n=c):(t[n]=u,t[a]=r,n=a);else{if(!(c<i&&0>o(l,r)))break t;t[n]=l,t[c]=r,n=c}}}return e}function o(t,e){var r=t.sortIndex-e.sortIndex;return 0!==r?r:t.id-e.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var c=[],l=[],h=1,f=null,d=3,p=!1,y=!1,g=!1,m="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,v="undefined"!==typeof setImmediate?setImmediate:null;function w(t){for(var e=n(l);null!==e;){if(null===e.callback)i(l);else{if(!(e.startTime<=t))break;i(l),e.sortIndex=e.expirationTime,r(c,e)}e=n(l)}}function _(t){if(g=!1,w(t),!y)if(null!==n(c))y=!0,O(E);else{var e=n(l);null!==e&&N(_,e.startTime-t)}}function E(t,r){y=!1,g&&(g=!1,b(M),M=-1),p=!0;var o=d;try{for(w(r),f=n(c);null!==f&&(!(f.expirationTime>r)||t&&!k());){var s=f.callback;if("function"===typeof s){f.callback=null,d=f.priorityLevel;var a=s(f.expirationTime<=r);r=e.unstable_now(),"function"===typeof a?f.callback=a:f===n(c)&&i(c),w(r)}else i(c);f=n(c)}if(null!==f)var u=!0;else{var h=n(l);null!==h&&N(_,h.startTime-r),u=!1}return u}finally{f=null,d=o,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,I=!1,A=null,M=-1,T=5,R=-1;function k(){return!(e.unstable_now()-R<T)}function C(){if(null!==A){var t=e.unstable_now();R=t;var r=!0;try{r=A(!0,t)}finally{r?S():(I=!1,A=null)}}else I=!1}if("function"===typeof v)S=function(){v(C)};else if("undefined"!==typeof MessageChannel){var P=new MessageChannel,B=P.port2;P.port1.onmessage=C,S=function(){B.postMessage(null)}}else S=function(){m(C,0)};function O(t){A=t,I||(I=!0,S())}function N(t,r){M=m((function(){t(e.unstable_now())}),r)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,O(E))},e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<t?Math.floor(1e3/t):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(t){switch(d){case 1:case 2:case 3:var e=3;break;default:e=d}var r=d;d=e;try{return t()}finally{d=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=d;d=t;try{return e()}finally{d=r}},e.unstable_scheduleCallback=function(t,i,o){var s=e.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?s+o:s:o=s,t){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return t={id:h++,callback:i,priorityLevel:t,startTime:o,expirationTime:a=o+a,sortIndex:-1},o>s?(t.sortIndex=o,r(l,t),null===n(c)&&t===n(l)&&(g?(b(M),M=-1):g=!0,N(_,o-s))):(t.sortIndex=a,r(c,t),y||p||(y=!0,O(E))),t},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(t){var e=d;return function(){var r=d;d=e;try{return t.apply(this,arguments)}finally{d=r}}}},45296:(t,e,r)=>{"use strict";t.exports=r(36813)},70621:(t,e,r)=>{t.exports=r(42899)(r(34513))},34513:(t,e,r)=>{const n=new(0,r(6289).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let s=new o(e),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===t||7===t)&&a.isOdd()!==(7===t))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function a(t,e){const r=e.encode(null,33===t.length);for(let n=0;n<t.length;++n)t[n]=r[n]}t.exports={contextRandomize:()=>0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===s(t)?1:0,publicKeyCreate(t,e){const r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;return a(t,n.keyFromPrivate(e).getPublic()),0},publicKeyConvert(t,e){const r=s(e);if(null===r)return 1;return a(t,r.getPublic()),0},publicKeyNegate(t,e){const r=s(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let i=0;i<e.length;++i)if(r[i]=s(e[i]),null===r[i])return 1;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?2:(a(t,n),0)},publicKeyTweakAdd(t,e,r){const n=s(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(t,u),0)},publicKeyTweakMul(t,e,r){const n=s(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return a(t,n.getPublic().mul(r)),0},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=t;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,c=0;for(;u>1&&0===a[c]&&!(128&a[c+1]);--u,++c);if(a=a.subarray(c),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(n,1);let h=33,f=0;for(;h>1&&0===l[f]&&!(128&l[f+1]);--h,++f);return l=l.subarray(f),128&l[0]||h>1&&0===l[0]&&!(128&l[1])?1:(t.outputlen=6+u+h,s[0]=48,s[1]=t.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=l.length,s.set(l,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let s=e.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=e.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(e.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,s,a){if(a){const t=a;a=n=>{const i=t(e,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(e,r,{canonical:!0,k:a,pers:s})}catch(l){return 1}return t.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),t.recid=c.recoveryParam,0},ecdsaVerify(t,e,r){const a={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(a.r),c=new o(a.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const l=s(r);if(null===l)return 2;const h=l.getPublic();return n.verify(e,a,h)?0:3},ecdsaRecover(t,e,r,s){const u={r:e.slice(0,32),s:e.slice(32,64)},c=new o(u.r),l=new o(u.s);if(c.cmp(i.n)>=0||l.cmp(i.n)>=0)return 1;if(c.isZero()||l.isZero())return 2;let h;try{h=n.recoverPubKey(s,u,r)}catch(f){return 2}return a(t,h),0},ecdh(t,e,r,a,u,c,l){const h=s(e);if(null===h)return 1;const f=new o(r);if(f.cmp(i.n)>=0||f.isZero())return 2;const d=h.getPublic().mul(f);if(void 0===u){const e=d.encode(null,!0),r=n.hash().update(e).digest();for(let n=0;n<32;++n)t[n]=r[n]}else{c||(c=new Uint8Array(32));const e=d.getX().toArray("be",32);for(let t=0;t<32;++t)c[t]=e[t];l||(l=new Uint8Array(32));const r=d.getY().toArray("be",32);for(let t=0;t<32;++t)l[t]=r[t];const n=u(c,l,a);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},42899:t=>{const e="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Unknow error on context randomization",o="Private Key is invalid",s="Public Key could not be parsed",a="Public Key serialization error",u="The sum of the public keys is not valid",c="Signature could not be parsed",l="The nonce generation function failed, or the private key was invalid",h="Public key could not be recover",f="Scalar was invalid (zero or overflow)";function d(t,e){if(!t)throw new Error(e)}function p(t,e,r){if(d(e instanceof Uint8Array,"Expected ".concat(t," to be an Uint8Array")),void 0!==r)if(Array.isArray(r)){const n=r.join(", "),i="Expected ".concat(t," to be an Uint8Array with length [").concat(n,"]");d(r.includes(e.length),i)}else{const n="Expected ".concat(t," to be an Uint8Array with length ").concat(r);d(e.length===r,n)}}function y(t){d("Boolean"===m(t),"Expected compressed to be a Boolean")}function g(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t=>new Uint8Array(t),e=arguments.length>1?arguments[1]:void 0;return"function"===typeof t&&(t=t(e)),p("output",t,e),t}function m(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){if(d(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&p("seed",e,32),1===t.contextRandomize(e))throw new Error(i)},privateKeyVerify:e=>(p("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(r){switch(p("private key",r,32),t.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(e)}},privateKeyTweakAdd(e,n){switch(p("private key",e,32),p("tweak",n,32),t.privateKeyTweakAdd(e,n)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakMul(e,r){switch(p("private key",e,32),p("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(n)}},publicKeyVerify:e=>(p("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(p("private key",e,32),y(r),n=g(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyConvert(e){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(p("public key",e,[33,65]),y(r),n=g(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(a)}},publicKeyNegate(r){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;switch(p("public key",r,[33,65]),y(n),i=g(i,n?33:65),t.publicKeyNegate(i,r)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(e);case 3:throw new Error(a)}},publicKeyCombine(e){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;d(Array.isArray(e),"Expected public keys to be an Array"),d(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)p("public key",t,[33,65]);switch(y(r),n=g(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(u);case 3:throw new Error(a)}},publicKeyTweakAdd(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0;switch(p("public key",e,[33,65]),p("tweak",n,32),y(i),o=g(o,i?33:65),t.publicKeyTweakAdd(o,e,n)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(r)}},publicKeyTweakMul(e,r){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0;switch(p("public key",e,[33,65]),p("tweak",r,32),y(i),o=g(o,i?33:65),t.publicKeyTweakMul(o,e,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(n)}},signatureNormalize(e){switch(p("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(r,n){p("signature",r,64);const i={output:n=g(n,72),outputlen:72};switch(t.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(r,n){switch(p("signature",r),n=g(n,64),t.signatureImport(n,r)){case 0:return n;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(r,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;p("message",r,32),p("private key",n,32),d("Object"===m(i),"Expected options to be an Object"),void 0!==i.data&&p("options.data",i.data),void 0!==i.noncefn&&d("Function"===m(i.noncefn),"Expected options.noncefn to be a Function"),o=g(o,64);const s={signature:o,recid:null};switch(t.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error(l);case 2:throw new Error(e)}},ecdsaVerify(e,r,n){switch(p("signature",e,64),p("message",r,32),p("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(s)}},ecdsaRecover(r,n,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4?arguments[4]:void 0;switch(p("signature",r,64),d("Number"===m(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),p("message",i,32),y(o),s=g(s,o?33:65),t.ecdsaRecover(s,r,n,i)){case 0:return s;case 1:throw new Error(c);case 2:throw new Error(h);case 3:throw new Error(e)}},ecdh(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;switch(p("public key",e,[33,65]),p("private key",r,32),d("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&p("options.data",n.data),void 0!==n.hashfn?(d("Function"===m(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&p("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&p("options.ybuf",n.ybuf,32),p("output",i)):i=g(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(f)}}})},18928:t=>{"use strict";const e=new Map;t.exports={setDelayedInterval:function(t,r,n){n=n||r;const i="".concat(Date.now(),":").concat(Math.floor(1e6*Math.random())),o=setTimeout((()=>{!async function(t,r,n){for(;e.get(n);){try{await t()}catch(i){setTimeout((()=>{throw i}),1);break}if(!e.get(n))break;await new Promise((t=>{const i=setTimeout(t,r);e.set(n,i)}))}}(t,r,i)}),n);return e.set(i,o),i},clearDelayedInterval:function(t){const r=e.get(t);r&&(clearTimeout(r),e.delete(t))}}},14454:(t,e,r)=>{var n=r(82543).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"===typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var u=s%i,c=Math.min(o-a,i-u),l=0;l<c;l++)r[u+l]=t[a+l];a+=c,(s+=c)%i===0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},85730:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(29940),n.sha1=r(97453),n.sha224=r(68633),n.sha256=r(97101),n.sha384=r(713),n.sha512=r(23884)},29940:(t,e,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function l(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var f=0;f<80;++f){var d=~~(f/20),p=0|((e=n)<<5|e>>>27)+l(d,i,o,a)+u+r[f]+s[d];u=a,a=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},97453:(t,e,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function l(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=(e=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),y=c(n)+h(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=l(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},68633:(t,e,r)=>{var n=r(12534),i=r(97101),o=r(14454),s=r(82543).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},97101:(t,e,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[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],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(t,e,r){return r^t&(e^r)}function l(t,e,r){return t&e|r&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function f(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,y=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+d(r[m-15])+r[m-16];for(var b=0;b<64;++b){var v=g+f(u)+c(u,p,y)+s[b]+r[b]|0,w=h(n)+l(n,i,o)|0;g=y,y=p,p=u,u=a+v|0,a=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},713:(t,e,r)=>{var n=r(12534),i=r(23884),o=r(14454),s=r(82543).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},23884:(t,e,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[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],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function l(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function f(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0<e>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,b=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,I=0|this._el,A=0|this._fl,M=0|this._gl,T=0|this._hl,R=0;R<32;R+=2)e[R]=t.readInt32BE(4*R),e[R+1]=t.readInt32BE(4*R+4);for(;R<160;R+=2){var k=e[R-30],C=e[R-30+1],P=d(k,C),B=p(C,k),O=y(k=e[R-4],C=e[R-4+1]),N=g(C,k),D=e[R-14],x=e[R-14+1],L=e[R-32],U=e[R-32+1],j=B+x|0,K=P+D+m(j,B)|0;K=(K=K+O+m(j=j+N|0,N)|0)+L+m(j=j+U|0,U)|0,e[R]=K,e[R+1]=j}for(var F=0;F<160;F+=2){K=e[F],j=e[F+1];var V=l(r,n,i),q=l(w,_,E),z=h(r,w),H=h(w,r),G=f(a,I),W=f(I,a),Z=s[F],Y=s[F+1],X=c(a,u,b),Q=c(I,A,M),J=T+W|0,$=v+G+m(J,T)|0;$=($=($=$+X+m(J=J+Q|0,Q)|0)+Z+m(J=J+Y|0,Y)|0)+K+m(J=J+j|0,j)|0;var tt=H+q|0,et=z+V+m(tt,H)|0;v=b,T=M,b=u,M=A,u=a,A=I,a=o+$+m(I=S+J|0,S)|0,o=i,S=E,i=n,E=_,n=r,_=w,r=$+et+m(w=J+tt|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+I|0,this._fl=this._fl+A|0,this._gl=this._gl+M|0,this._hl=this._hl+T|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+n+m(this._bl,_)|0,this._ch=this._ch+i+m(this._cl,E)|0,this._dh=this._dh+o+m(this._dl,S)|0,this._eh=this._eh+a+m(this._el,I)|0,this._fh=this._fh+u+m(this._fl,A)|0,this._gh=this._gh+b+m(this._gl,M)|0,this._hh=this._hh+v+m(this._hl,T)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},16872:(t,e,r)=>{var n=r(62175);e.encode=function t(e,r,i){e=e>=0?2*e:-2*e-1;var o=n.encode(e,r,i);return t.bytes=n.encode.bytes,o},e.decode=function t(e,r){var i=n.decode(e,r);return t.bytes=n.decode.bytes,1&i?(i+1)/-2:i/2},e.encodingLength=function(t){return n.encodingLength(t>=0?2*t:-2*t-1)}},14987:t=>{t.exports=function t(e,r){var n,i=0,o=0,s=r=r||0,a=e.length;do{if(s>=a)throw t.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=s-r,i}},8684:t=>{t.exports=function t(r,n,i){n=n||[];var o=i=i||0;for(;r>=e;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,t.bytes=i-o+1,n};var e=Math.pow(2,31)},62175:(t,e,r)=>{t.exports={encode:r(8684),decode:r(14987),encodingLength:r(92614)}},92614:t=>{var e=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),s=Math.pow(2,42),a=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);t.exports=function(t){return t<e?1:t<r?2:t<n?3:t<i?4:t<o?5:t<s?6:t<a?7:t<u?8:t<c?9:10}},41064:(t,e,r)=>{t.exports=i;var n=r(47465).EventEmitter;function i(){n.call(this)}r(12534)(i,n),i.Readable=r(26978),i.Writable=r(51704),i.Duplex=r(48749),i.Transform=r(4784),i.PassThrough=r(95627),i.finished=r(45762),i.pipeline=r(34541),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"===typeof t.destroy&&t.destroy())}function c(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",c),t.on("error",c),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},79755:function(t,e,r){var n=r(21964);!function(t){"use strict";async function*e(t,e){let r=[];for await(const n of e)r.push(n),r.length===t&&(yield r,r=[]);r.length>0&&(yield r)}function*r(t,e){let r=[];for(const n of e)r.push(n),r.length===t&&(yield r,r=[]);r.length>0&&(yield r)}function i(t,n){return void 0===n?e=>i(t,e):n[Symbol.asyncIterator]?e(t,n):r(t,n)}const o=Symbol("TIMEOUT"),s=t=>{let e;return[new Promise((r=>{e=setTimeout((()=>r(o)),t)})),()=>{clearTimeout(e)}]};async function*a(t,e,r){const n=r[Symbol.asyncIterator]();let i,a,u,c=[];const l=()=>{h(),[a,u]=s(e)},h=()=>{u&&u(),a=void 0};for(i=n.next();;){const e=await(a?Promise.race([i,a]):i);if(e===o||e.done){if(c.length&&(yield c,c=[]),h(),e!==o)break}else i=n.next(),c.push(e.value),1===c.length&&l(),c.length!==t||(yield c,c=[],h())}}function u(t,e,r){return void 0===r?r=>u(t,e,r):r[Symbol.asyncIterator]&&e!==1/0?a(t,e,r):i(t,r)}function c(t){if("function"===typeof t.next)return t;if("function"===typeof t[Symbol.iterator])return t[Symbol.iterator]();if("function"===typeof t[Symbol.asyncIterator])return t[Symbol.asyncIterator]();throw new TypeError('"values" does not to conform to any of the iterator or iterable protocols')}function l(){let t,e;return{promise:new Promise(((r,n)=>{e=r,t=n})),reject:t,resolve:e}}function h(t,e){const r=c(e),n=[],i=[];let o=!1,s=!1;function a(){for(;i.length>0&&n.length>0;){const t=i.shift(),{error:e,value:r}=n.shift();e?t.reject(e):t.resolve({done:!1,value:r})}for(;i.length>0&&s;){const{resolve:t}=i.shift();t({done:!0,value:void 0})}}async function u(){if(!s&&!o&&!(n.length>=t)){o=!0;try{const{done:t,value:e}=await r.next();t?s=!0:n.push({value:e})}catch(e){s=!0,n.push({error:e})}a(),o=!1,u()}}async function h(){if(n.length>0){const{error:t,value:e}=n.shift();if(t)throw t;return u(),{done:!1,value:e}}if(s)return{done:!0,value:void 0};const t=l();return i.push(t),u(),t.promise}const f={next:h,[Symbol.asyncIterator]:()=>f};return f}function*f(t,e){const r=[];let n;try{for(const n of e)r.push(n),r.length<=t||(yield r.shift())}catch(i){n=i}for(const o of r)yield o;if(n)throw n}function d(t,e){return void 0===e?e=>d(t,e):0===t?e:e[Symbol.asyncIterator]?h(t,e):f(t,e)}async function p(t){const e=[];for await(const r of t)e.push(r);return e}function y(t){return t[Symbol.asyncIterator]?p(t):Array.from(t)}async function*g(t){for await(const e of t)yield*e}function*m(t){for(const e of t)yield*e}function b(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.find((t=>void 0!==t[Symbol.asyncIterator]))?g(e):m(e)}async function v(t){for await(const e of t);}function w(t){if(t[Symbol.asyncIterator])return v(t);for(const e of t);}async function*_(t,e){for await(const r of e)await t(r)&&(yield r)}function E(t,e){return void 0===e?e=>_(t,e):_(t,e)}async function*S(t){for await(const e of t)e&&"string"!==typeof e&&(e[Symbol.iterator]||e[Symbol.asyncIterator])?yield*S(e):yield e}async function*I(t,e){for await(const r of e)yield await t(r)}function A(t,e){return void 0===e?e=>I(t,e):I(t,e)}function M(t,e){return void 0===e?e=>M(t,e):E((t=>void 0!==t&&null!==t),S(A(t,e)))}function T(t,e,r){const n=c(r),i=[],o=[];let s=!1,a=!1,u=0,h=null;function f(){for(;o.length>0&&i.length>0;){const{resolve:t}=o.shift();t({done:!1,value:i.shift()})}for(;o.length>0&&0===u&&s;){const{resolve:t,reject:e}=o.shift();h?(e(h),h=null):t({done:!0,value:void 0})}}async function d(){if(s)f();else if(!a&&!(u+i.length>=t)){a=!0,u++;try{const{done:t,value:e}=await n.next();t?(s=!0,u--,f()):p(e)}catch(e){s=!0,u--,h=e,f()}a=!1,d()}}async function p(t){try{const r=await e(t);if(r&&r[Symbol.asyncIterator])for await(const t of r)i.push(t);else i.push(r)}catch(r){s=!0,h=r}u--,f(),d()}async function y(){if(0===i.length){const t=l();return o.push(t),d(),t.promise}const t=i.shift();return d(),{done:!1,value:t}}const g={next:y,[Symbol.asyncIterator]:()=>g};return g}function R(t,e,r){return void 0===e?(e,r)=>r?R(t,e,r):R(t,e):void 0===r?r=>R(t,e,r):E((t=>void 0!==t&&null!==t),S(T(t,e,r)))}async function k(t){return new Promise((e=>{t.once("readable",(()=>{e()}))}))}async function*C(t){for(;;){const e=t.read();if(null===e){if(t._readableState.ended)break;await k(t)}else yield e}}function P(t){return"function"===typeof t[Symbol.asyncIterator]?t:C(t)}async function*B(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=new Set(e.map(c));for(;n.size>0;)for(const t of n){const e=await t.next();e.done?n.delete(t):yield e.value}}function O(t){let e=t();for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];for(const o of n)e=o(e);return e}async function*N(t,e,r){let n=null;const i=t=>({value:e(t)}),o=async function*(t){for await(const e of t){if(n)return;yield e}},s=c(O((()=>r),d(1),o,A(i),d(t-1)));for(;;){const{value:t,done:e}=await s.next();if(e)break;try{const e=await t.value;n||(yield e)}catch(a){n=a}}if(n)throw n}function D(t,e,r){return void 0===e?(e,r)=>D(t,e,r):void 0===r?r=>D(t,e,r):1===t?A(e,r):N(t,e,r)}function x(t,e,r){return void 0===e?(e,r)=>r?x(t,e,r):x(t,e):void 0===r?r=>x(t,e,r):E((t=>void 0!==t&&null!==t),S(D(t,e,r)))}async function*L(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e.map(c),i=new Set,o=new Map;let s=null,a=null,u=null;const l=t=>{s=t,a&&a(t)},h=t=>{u&&u(t)},f=()=>new Promise(((t,e)=>{if(s&&e(s),o.size>0)return t();u=t,a=e})),d=t=>{const e=Promise.resolve(t.next()).then((async r=>{let{done:n,value:s}=r;n||o.set(t,s),i.delete(e)}));i.add(e),e.then(h,l)};for(const c of n)d(c);for(;;){if(0===i.size&&0===o.size)return;await f();for(const[t,e]of o)o.delete(t),yield e,d(t)}}async function U(t,e,r){let n=e;for await(const i of r)n=await t(n,i);return n}function j(t,e,r){return void 0===e?(e,r)=>r?U(t,e,r):j(t,e):void 0===r?r=>j(t,e,r):U(t,e,r)}async function*K(t,e){let r=0;for await(const n of e)if(yield await n,r++,r>=t)break}function*F(t,e){let r=0;for(const n of e)if(yield n,r++,r>=t)break}function V(t,e){return void 0===e?e=>V(t,e):e[Symbol.asyncIterator]?K(t,e):F(t,e)}async function*q(t,e){for await(const r of e)await t(r),yield r}function z(t,e){return void 0===e?e=>q(t,e):q(t,e)}const H=t=>new Promise((e=>setTimeout(e,t)));function G(t,e,r){if(!Number.isFinite(t))throw new TypeError("Expected `limit` to be a finite number");if(t<=0)throw new TypeError("Expected `limit` to be greater than 0");if(!Number.isFinite(e))throw new TypeError("Expected `interval` to be a finite number");return async function*(){let n,i=0;for await(const o of r){if(i<t){"undefined"===typeof n&&(n=Date.now()),i++,yield o;continue}const r=Date.now()-n,s=e-r;s>0&&await H(s),n=Date.now(),i=1,yield o}}()}function W(t,e,r){return void 0===r?r=>G(t,e,r):G(t,e,r)}function Z(t,e){let r=t[0]+e[0],n=t[1]+e[1];if(n>=1e9){const t=n%1e9;r+=(n-t)/1e9,n=t}return[r,n]}async function*Y(t,e){const r=e[Symbol.asyncIterator]();let i=[0,0];for(;;){const e=n.hrtime(),{value:o,done:s}=await r.next(),a=n.hrtime(e);if(i=Z(i,a),t.progress&&t.progress(a,i),s)return t.total&&t.total(i),o;yield o}}function*X(t,e){const r=e[Symbol.iterator]();let i=[0,0];for(;;){const e=n.hrtime(),{value:o,done:s}=r.next(),a=n.hrtime(e);if(i=Z(i,a),t.progress&&t.progress(a,i),s)return t.total&&t.total(i),o;yield o}}function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return void 0===e?e=>Q(t,e):void 0!==e[Symbol.asyncIterator]?Y(t,e):X(t,e)}function J(t,e,r){const n=c(r),i=[],o=[];let s=!1,a=!1,u=0,h=null;function f(){for(;o.length>0&&i.length>0;){const{resolve:t}=o.shift();t({done:!1,value:i.shift()})}for(;o.length>0&&0===u&&s;){const{resolve:t,reject:e}=o.shift();h?(e(h),h=null):t({done:!0,value:void 0})}}async function d(){if(s)f();else if(!a&&!(u+i.length>=t)){a=!0,u++;try{const{done:t,value:e}=await n.next();t?(s=!0,u--,f()):p(e)}catch(e){s=!0,u--,h=e,f()}a=!1,d()}}async function p(t){try{const r=await e(t);i.push(r)}catch(r){s=!0,h=r}u--,f(),d()}async function y(){if(0===i.length){const t=l();return o.push(t),d(),t.promise}const t=i.shift();return d(),{done:!1,value:t}}const g={next:y,[Symbol.asyncIterator]:()=>g};return g}function $(t,e,r){return void 0===e?(e,r)=>r?$(t,e,r):$(t,e):void 0===r?r=>$(t,e,r):J(t,e,r)}async function tt(t,e){let r=null,n=null,i=null;const o=t=>{r=t,n&&n(t)},s=()=>{i&&i()},a=()=>{t.removeListener("error",o),t.removeListener("drain",s)};t.once("error",o);const u=()=>new Promise(((e,o)=>{if(r)return o(r);t.once("drain",s),i=e,n=o}));for await(const c of e)if(!1===t.write(c)&&await u(),r)break;if(a(),r)throw r}function et(t,e){return void 0===e?e=>tt(t,e):tt(t,e)}t.batch=i,t.batchWithTimeout=u,t.buffer=d,t.collect=y,t.concat=b,t.consume=w,t.filter=E,t.flatMap=M,t.flatTransform=R,t.flatten=S,t.fromStream=P,t.getIterator=c,t.map=A,t.merge=B,t.parallelFlatMap=x,t.parallelMap=D,t.parallelMerge=L,t.pipeline=O,t.reduce=j,t.take=V,t.tap=z,t.throttle=W,t.time=Q,t.transform=$,t.writeToStream=et,Object.defineProperty(t,"__esModule",{value:!0})}(e)},15948:(t,e,r)=>{"use strict";var n=r(14331).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=h,e=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\ufffd":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},14331:(t,e,r)=>{var n=r(19778),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},87683:(t,e,r)=>{"use strict";const{AbortController:n}=globalThis,i=r(31779);class o extends n{constructor(t){super(),this._ms=t,this._timer=i((()=>this.abort()),t),Object.setPrototypeOf(this,o.prototype)}abort(){return this._timer.clear(),super.abort()}clear(){this._timer.clear()}reset(){this._timer.clear(),this._timer=i((()=>this.abort()),this._ms)}}t.exports={TimeoutController:o}},60206:(t,e,r)=>{"use strict";var n=r(49022),i=r(34847);t.exports=n.bind(null,i)},49022:t=>{"use strict";function e(t){return t>=55296&&t<=56319}function r(t){return t>=56320&&t<=57343}t.exports=function(t,n,i){if("string"!==typeof n)throw new Error("Input must be string");for(var o,s,a=n.length,u=0,c=0;c<a;c+=1){if(o=n.charCodeAt(c),s=n[c],e(o)&&r(n.charCodeAt(c+1))&&(s+=n[c+=1]),(u+=t(s))===i)return n.slice(0,c+1);if(u>i)return n.slice(0,c-s.length+1)}return n}},34847:t=>{"use strict";function e(t){return t>=55296&&t<=56319}function r(t){return t>=56320&&t<=57343}t.exports=function(t){if("string"!==typeof t)throw new Error("Input must be string");for(var n=t.length,i=0,o=null,s=null,a=0;a<n;a++)r(o=t.charCodeAt(a))?null!=s&&e(s)?i+=1:i+=3:o<=127?i+=1:o>=128&&o<=2047?i+=2:o>=2048&&o<=65535&&(i+=3),s=o;return i}},89515:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(n){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},6794:t=>{t.exports=function(t){return t&&"object"===typeof t&&"function"===typeof t.copy&&"function"===typeof t.fill&&"function"===typeof t.readUInt8}},87374:(t,e,r)=>{"use strict";var n=r(65450),i=r(85718),o=r(58264),s=r(66218);function a(t){return t.call.bind(t)}var u="undefined"!==typeof BigInt,c="undefined"!==typeof Symbol,l=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var p=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!==typeof t)return!1;try{return e(t),!0}catch(r){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function _(t){return"[object ArrayBuffer]"===l(t)}function E(t){return"undefined"!==typeof ArrayBuffer&&(_.working?_(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===l(t)}function I(t){return"undefined"!==typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!==typeof Promise&&t instanceof Promise||null!==t&&"object"===typeof t&&"function"===typeof t.then&&"function"===typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||I(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!==typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!==typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!==typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!==typeof Set&&(b.working?b(t):t instanceof Set)},v.working="undefined"!==typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!==typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!==typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},_.working="undefined"!==typeof ArrayBuffer&&_(new ArrayBuffer),e.isArrayBuffer=E,S.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=I;var A="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function M(t){return"[object SharedArrayBuffer]"===l(t)}function T(t){return"undefined"!==typeof A&&("undefined"===typeof M.working&&(M.working=M(new A)),M.working?M(t):t instanceof A)}function R(t){return g(t,h)}function k(t){return g(t,f)}function C(t){return g(t,d)}function P(t){return u&&g(t,p)}function B(t){return c&&g(t,y)}e.isSharedArrayBuffer=T,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=k,e.isBooleanObject=C,e.isBigIntObject=P,e.isSymbolObject=B,e.isBoxedPrimitive=function(t){return R(t)||k(t)||C(t)||P(t)||B(t)},e.isAnyArrayBuffer=function(t){return"undefined"!==typeof Uint8Array&&(E(t)||T(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},49639:(t,e,r)=>{var n=r(21964),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}})),a=n[r];r<i;a=n[++r])m(a)||!E(a)?s+=" "+a:s+=" "+c(a);return s},e.deprecate=function(t,r){if("undefined"!==typeof n&&!0===n.noDeprecation)return t;if("undefined"===typeof n)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var s={},a=/^$/;if({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG){var u={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+u+"$","i")}function c(t,r){var n={seen:[],stylize:h};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),f(n,t,n.depth)}function l(t,e){var r=c.styles[e];return r?"\x1b["+c.colors[r][0]+"m"+t+"\x1b["+c.colors[r][1]+"m":t}function h(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=f(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(b(e))return t.stylize(""+e,"number");if(g(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),I(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(I(r))return d(r)}var c,l="",h=!1,E=["{","}"];(y(r)&&(h=!0,E=["[","]"]),A(r))&&(l=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),I(r)&&(l=" "+d(r)),0!==s.length||h&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)C(e,String(s))?o.push(p(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(t,e,r,n,i,!0))})),o}(t,r,n,a,s):s.map((function(e){return p(t,r,n,a,e,h)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,E)):E[0]+l+E[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),C(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=m(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"===typeof t}function m(t){return null===t}function b(t){return"number"===typeof t}function v(t){return"string"===typeof t}function w(t){return void 0===t}function _(t){return E(t)&&"[object RegExp]"===M(t)}function E(t){return"object"===typeof t&&null!==t}function S(t){return E(t)&&"[object Date]"===M(t)}function I(t){return E(t)&&("[object Error]"===M(t)||t instanceof Error)}function A(t){return"function"===typeof t}function M(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(87374),e.isArray=y,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=w,e.isRegExp=_,e.types.isRegExp=_,e.isObject=E,e.isDate=S,e.types.isDate=S,e.isError=I,e.types.isNativeError=I,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=r(6794);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",k(),e.format.apply(e,arguments))},e.inherits=r(12534),e._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var P="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');if(P&&t[P]){var e;if("function"!==typeof(e=t[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,P,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(s){r(s)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),P&&Object.defineProperty(e,P,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=P,e.callbackify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!==typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};t.apply(this,e).then((function(t){n.nextTick(s.bind(null,null,t))}),(function(t){n.nextTick(B.bind(null,t,s))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},75658:(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{NIL:()=>B,parse:()=>g,stringify:()=>l,v1:()=>y,v3:()=>M,v4:()=>T,v5:()=>P,validate:()=>a,version:()=>O});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(t){return"string"===typeof t&&s.test(t)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var h,f,d=0,p=0;const y=function(t,e,r){var n=e&&r||0,i=e||new Array(16),s=(t=t||{}).node||h,a=void 0!==t.clockseq?t.clockseq:f;if(null==s||null==a){var u=t.random||(t.rng||o)();null==s&&(s=h=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=f=16383&(u[6]<<8|u[7]))}var c=void 0!==t.msecs?t.msecs:Date.now(),y=void 0!==t.nsecs?t.nsecs:p+1,g=c-d+(y-p)/1e4;if(g<0&&void 0===t.clockseq&&(a=a+1&16383),(g<0||c>d)&&void 0===t.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=c,p=y,f=a;var m=(1e4*(268435455&(c+=122192928e5))+y)%4294967296;i[n++]=m>>>24&255,i[n++]=m>>>16&255,i[n++]=m>>>8&255,i[n++]=255&m;var b=c/4294967296*1e4&268435455;i[n++]=b>>>8&255,i[n++]=255&b,i[n++]=b>>>24&15|16,i[n++]=b>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var v=0;v<6;++v)i[n+v]=s[v];return e||l(i)};const g=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function m(t,e,r){function n(t,n,i,o){if("string"===typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"===typeof n&&(n=g(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+t.length);if(s.set(n),s.set(t,n.length),(s=r(s))[6]=15&s[6]|e,s[8]=63&s[8]|128,i){o=o||0;for(var a=0;a<16;++a)i[o+a]=s[a];return i}return l(s)}try{n.name=t}catch(i){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function b(t){return 14+(t+64>>>9<<4)+1}function v(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function w(t,e,r,n,i,o){return v((s=v(v(e,t),v(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function _(t,e,r,n,i,o,s){return w(e&r|~e&n,t,e,i,o,s)}function E(t,e,r,n,i,o,s){return w(e&n|r&~n,t,e,i,o,s)}function S(t,e,r,n,i,o,s){return w(e^r^n,t,e,i,o,s)}function I(t,e,r,n,i,o,s){return w(r^(e|~n),t,e,i,o,s)}const A=function(t){if("string"===typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=t[i>>5]>>>i%32&255,s=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[b(e)-1]=e;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,s=0;s<t.length;s+=16){var a=r,u=n,c=i,l=o;r=_(r,n,i,o,t[s],7,-680876936),o=_(o,r,n,i,t[s+1],12,-389564586),i=_(i,o,r,n,t[s+2],17,606105819),n=_(n,i,o,r,t[s+3],22,-1044525330),r=_(r,n,i,o,t[s+4],7,-176418897),o=_(o,r,n,i,t[s+5],12,1200080426),i=_(i,o,r,n,t[s+6],17,-1473231341),n=_(n,i,o,r,t[s+7],22,-45705983),r=_(r,n,i,o,t[s+8],7,1770035416),o=_(o,r,n,i,t[s+9],12,-1958414417),i=_(i,o,r,n,t[s+10],17,-42063),n=_(n,i,o,r,t[s+11],22,-1990404162),r=_(r,n,i,o,t[s+12],7,1804603682),o=_(o,r,n,i,t[s+13],12,-40341101),i=_(i,o,r,n,t[s+14],17,-1502002290),r=E(r,n=_(n,i,o,r,t[s+15],22,1236535329),i,o,t[s+1],5,-165796510),o=E(o,r,n,i,t[s+6],9,-1069501632),i=E(i,o,r,n,t[s+11],14,643717713),n=E(n,i,o,r,t[s],20,-373897302),r=E(r,n,i,o,t[s+5],5,-701558691),o=E(o,r,n,i,t[s+10],9,38016083),i=E(i,o,r,n,t[s+15],14,-660478335),n=E(n,i,o,r,t[s+4],20,-405537848),r=E(r,n,i,o,t[s+9],5,568446438),o=E(o,r,n,i,t[s+14],9,-1019803690),i=E(i,o,r,n,t[s+3],14,-187363961),n=E(n,i,o,r,t[s+8],20,1163531501),r=E(r,n,i,o,t[s+13],5,-1444681467),o=E(o,r,n,i,t[s+2],9,-51403784),i=E(i,o,r,n,t[s+7],14,1735328473),r=S(r,n=E(n,i,o,r,t[s+12],20,-1926607734),i,o,t[s+5],4,-378558),o=S(o,r,n,i,t[s+8],11,-2022574463),i=S(i,o,r,n,t[s+11],16,1839030562),n=S(n,i,o,r,t[s+14],23,-35309556),r=S(r,n,i,o,t[s+1],4,-1530992060),o=S(o,r,n,i,t[s+4],11,1272893353),i=S(i,o,r,n,t[s+7],16,-155497632),n=S(n,i,o,r,t[s+10],23,-1094730640),r=S(r,n,i,o,t[s+13],4,681279174),o=S(o,r,n,i,t[s],11,-358537222),i=S(i,o,r,n,t[s+3],16,-722521979),n=S(n,i,o,r,t[s+6],23,76029189),r=S(r,n,i,o,t[s+9],4,-640364487),o=S(o,r,n,i,t[s+12],11,-421815835),i=S(i,o,r,n,t[s+15],16,530742520),r=I(r,n=S(n,i,o,r,t[s+2],23,-995338651),i,o,t[s],6,-198630844),o=I(o,r,n,i,t[s+7],10,1126891415),i=I(i,o,r,n,t[s+14],15,-1416354905),n=I(n,i,o,r,t[s+5],21,-57434055),r=I(r,n,i,o,t[s+12],6,1700485571),o=I(o,r,n,i,t[s+3],10,-1894986606),i=I(i,o,r,n,t[s+10],15,-1051523),n=I(n,i,o,r,t[s+1],21,-2054922799),r=I(r,n,i,o,t[s+8],6,1873313359),o=I(o,r,n,i,t[s+15],10,-30611744),i=I(i,o,r,n,t[s+6],15,-1560198380),n=I(n,i,o,r,t[s+13],21,1309151649),r=I(r,n,i,o,t[s+4],6,-145523070),o=I(o,r,n,i,t[s+11],10,-1120210379),i=I(i,o,r,n,t[s+2],15,718787259),n=I(n,i,o,r,t[s+9],21,-343485551),r=v(r,a),n=v(n,u),i=v(i,c),o=v(o,l)}return[r,n,i,o]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(b(e)),n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}(t),8*t.length))};const M=m("v3",48,A);const T=function(t,e,r){var n=(t=t||{}).random||(t.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return l(n)};function R(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function k(t,e){return t<<e|t>>>32-e}const C=function(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var i=0;i<n.length;++i)t.push(n.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,s=Math.ceil(o/16),a=new Array(s),u=0;u<s;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=t[64*u+4*l]<<24|t[64*u+4*l+1]<<16|t[64*u+4*l+2]<<8|t[64*u+4*l+3];a[u]=c}a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295;for(var h=0;h<s;++h){for(var f=new Uint32Array(80),d=0;d<16;++d)f[d]=a[h][d];for(var p=16;p<80;++p)f[p]=k(f[p-3]^f[p-8]^f[p-14]^f[p-16],1);for(var y=r[0],g=r[1],m=r[2],b=r[3],v=r[4],w=0;w<80;++w){var _=Math.floor(w/20),E=k(y,5)+R(_,g,m,b)+v+e[_]+f[w]>>>0;v=b,b=m,m=k(g,30)>>>0,g=y,y=E}r[0]=r[0]+y>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};const P=m("v5",80,C),B="00000000-0000-0000-0000-000000000000";const O=function(t){if(!a(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}},23522:t=>{t.exports=function t(e,r){var n,i=0,o=0,s=r=r||0,a=e.length;do{if(s>=a||o>49)throw t.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=s-r,i}},26993:t=>{t.exports=function t(r,n,i){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw t.bytes=0,new RangeError("Could not encode varint");n=n||[];var o=i=i||0;for(;r>=e;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,t.bytes=i-o+1,n};var e=Math.pow(2,31)},74561:(t,e,r)=>{t.exports={encode:r(26993),decode:r(23522),encodingLength:r(12570)}},12570:t=>{var e=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),s=Math.pow(2,42),a=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);t.exports=function(t){return t<e?1:t<r?2:t<n?3:t<i?4:t<o?5:t<s?6:t<a?7:t<u?8:t<c?9:10}},3227:(t,e,r)=>{"use strict";const n=r(82193),i="object"===typeof window&&"object"===typeof document&&9===document.nodeType,o=n(),s=i&&!o,a=o&&!i,u=o&&i,c="undefined"!==typeof globalThis.process&&"undefined"!==typeof globalThis.process.release&&"node"===globalThis.process.release.name&&!o,l="function"===typeof importScripts&&"undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,h="undefined"!==typeof globalThis.process&&"undefined"!==typeof globalThis.process.env&&"test"===globalThis.process.env.NODE_ENV,f="undefined"!==typeof navigator&&"ReactNative"===navigator.product;t.exports={isTest:h,isElectron:o,isElectronMain:a,isElectronRenderer:u,isNode:c,isBrowser:s,isWebWorker:l,isEnvWithDom:i,isReactNative:f}},58264:(t,e,r)=>{"use strict";var n=r(27910),i=r(30306),o=r(44037),s=o("Object.prototype.toString"),a=r(4707)(),u="undefined"===typeof globalThis?r.g:globalThis,c=i(),l=o("String.prototype.slice"),h={},f=r(40636),d=Object.getPrototypeOf;a&&f&&d&&n(c,(function(t){if("function"===typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=d(e),n=f(r,Symbol.toStringTag);if(!n){var i=d(r);n=f(i,Symbol.toStringTag)}h[t]=n.get}}}));var p=r(66218);t.exports=function(t){return!!p(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(h,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(o){}})),e}(t):l(s(t),8,-1))}},21964:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"===typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,u=[],c=!1,l=-1;function h(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&f())}function f(){if(!c){var t=s(h);c=!0;for(var e=u.length;e;){for(a=u,u=[];++l<e;)a&&a[l].run();l=-1,e=u.length}a=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||c||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},43094:()=>{},69159:()=>{},35883:()=>{},80950:()=>{},46601:()=>{},89214:()=>{},5696:()=>{},8623:()=>{},7748:()=>{},85568:()=>{},89408:()=>{},82161:()=>{},17111:()=>{},30285:()=>{},71381:()=>{},47956:()=>{},56619:()=>{},21724:()=>{},77108:()=>{},52361:()=>{},94616:()=>{},30306:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"===typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"===typeof i[n[e]]&&(t[t.length]=n[e]);return t}},40636:(t,e,r)=>{"use strict";var n=r(52506)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(i){n=null}t.exports=n},78932:(t,e,r)=>{"use strict";r.r(e),r.d(e,{MemoryDatastore:()=>l});var n=r(50464);const i=(t,e)=>async function*(){const r=await n(t);yield*r.sort(e)}();var o=r(79272),s=r(12393),a=r(35959);var u=r(3450),c=r(67963);class l extends class{open(){return Promise.reject(new Error(".open is not implemented"))}close(){return Promise.reject(new Error(".close is not implemented"))}put(t,e,r){return Promise.reject(new Error(".put is not implemented"))}get(t,e){return Promise.reject(new Error(".get is not implemented"))}has(t,e){return Promise.reject(new Error(".has is not implemented"))}delete(t,e){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const{key:r,value:n}of t)await this.put(r,n,e),yield{key:r,value:n}}async*getMany(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const r of t)yield this.get(r,e)}async*deleteMany(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const r of t)await this.delete(r,e),yield r}batch(){let t=[],e=[];return{put(e,r){t.push({key:e,value:r})},delete(t){e.push(t)},commit:async r=>{await o(this.putMany(t,r)),t=[],await o(this.deleteMany(e,r)),e=[]}}}async*_all(t,e){throw new Error("._all is not implemented")}async*_allKeys(t,e){throw new Error("._allKeys is not implemented")}query(t,e){let r=this._all(t,e);if(null!=t.prefix&&(r=s(r,(e=>e.key.toString().startsWith(t.prefix)))),Array.isArray(t.filters)&&(r=t.filters.reduce(((t,e)=>s(t,e)),r)),Array.isArray(t.orders)&&(r=t.orders.reduce(((t,e)=>i(t,e)),r)),null!=t.offset){let e=0;r=s(r,(()=>e++>=t.offset))}return null!=t.limit&&(r=a(r,t.limit)),r}queryKeys(t,e){let r=this._allKeys(t,e);if(null!=t.prefix&&(r=s(r,(e=>e.toString().startsWith(t.prefix)))),Array.isArray(t.filters)&&(r=t.filters.reduce(((t,e)=>s(t,e)),r)),Array.isArray(t.orders)&&(r=t.orders.reduce(((t,e)=>i(t,e)),r)),null!=t.offset){let e=0;r=s(r,(()=>e++>=t.offset))}return null!=t.limit&&(r=a(r,t.limit)),r}}{constructor(){super(),this.data={}}open(){return Promise.resolve()}close(){return Promise.resolve()}async put(t,e){this.data[t.toString()]=e}async get(t){if(!await this.has(t))throw e=e||new Error("Not Found"),c(e,"ERR_NOT_FOUND");var e;return this.data[t.toString()]}async has(t){return void 0!==this.data[t.toString()]}async delete(t){delete this.data[t.toString()]}async*_all(){yield*Object.entries(this.data).map((t=>{let[e,r]=t;return{key:new u.Key(e),value:r}}))}async*_allKeys(){yield*Object.entries(this.data).map((t=>{let[e]=t;return new u.Key(e)}))}}},3450:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Key:()=>c});var n=r(75926),i=r(82051),o=r(46765);const s="/",a=(new TextEncoder).encode(s),u=a[0];class c{constructor(t,e){if("string"===typeof t)this._buf=(0,o.fromString)(t);else{if(!(t instanceof Uint8Array))throw new Error("Invalid key, should be String of Uint8Array");this._buf=t}if(null==e&&(e=!0),e&&this.clean(),0===this._buf.byteLength||this._buf[0]!==u)throw new Error("Invalid key")}toString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return(0,i.toString)(this._buf,t)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return"Key(".concat(this.toString(),")")}static withNamespaces(t){return new c(t.join(s))}static random(){return new c((0,n.nanoid)().replace(/-/g,""))}static asKey(t){return t instanceof Uint8Array||"string"===typeof t?new c(t):t.uint8Array?new c(t.uint8Array()):null}clean(){if(this._buf&&0!==this._buf.byteLength||(this._buf=a),this._buf[0]!==u){const t=new Uint8Array(this._buf.byteLength+1);t.fill(u,0,1),t.set(this._buf,1),this._buf=t}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===u;)this._buf=this._buf.subarray(0,-1)}less(t){const e=this.list(),r=t.list();for(let n=0;n<e.length;n++){if(r.length<n+1)return!1;const t=e[n],i=r[n];if(t<i)return!0;if(t>i)return!1}return e.length<r.length}reverse(){return c.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const t=this.namespaces();return t[t.length-1]}list(){return this.toString().split(s).slice(1)}type(){return function(t){const e=t.split(":");if(e.length<2)return"";return e.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(t){const e=t.split(":");return e[e.length-1]}(this.baseNamespace())}instance(t){return new c(this.toString()+":"+t)}path(){let t=this.parent().toString();return t.endsWith(s)||(t+=s),t+=this.type(),new c(t)}parent(){const t=this.list();return 1===t.length?new c(s):new c(t.slice(0,-1).join(s))}child(t){return this.toString()===s?t:t.toString()===s?this:new c(this.toString()+t.toString(),!1)}isAncestorOf(t){return t.toString()!==this.toString()&&t.toString().startsWith(this.toString())}isDecendantOf(t){return t.toString()!==this.toString()&&this.toString().startsWith(t.toString())}isTopLevel(){return 1===this.list().length}concat(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return c.withNamespaces([...this.namespaces(),...(n=e.map((t=>t.namespaces())),[].concat(...n))]);var n}}},52087:(t,e,r)=>{"use strict";r.d(e,{kU:()=>h,Dp:()=>l,ET:()=>f});const n=function(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 o=t.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,u=t.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(t){if("string"!==typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;var e=0;if(" "!==t[e]){for(var n=0,i=0;t[e]===u;)n++,e++;for(var o=(t.length-e)*c+1>>>0,s=new Uint8Array(o);t[e];){var l=r[t.charCodeAt(e)];if(255===l)return;for(var h=0,f=o-1;(0!==l||h<i)&&-1!==f;f--,h++)l+=a*s[f]>>>0,s[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,e++}if(" "!==t[e]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=s[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var s=(o-i)*l+1>>>0,c=new Uint8Array(s);i!==o;){for(var h=e[i],f=0,d=s-1;(0!==h||f<n)&&-1!==d;d--,f++)h+=256*c[d]>>>0,c[d]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=f,i++}for(var p=s-n;p!==s&&0===c[p];)p++;for(var y=u.repeat(r);p<s;++p)y+=t.charAt(c[p]);return y},decodeUnsafe:h,decode:function(t){var r=h(t);if(r)return r;throw new Error("Non-".concat(e," character"))}}};var i=r(71250);class o{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(t));throw Error("Unknown type, must be binary type")}}class s{constructor(t,e,r){this.name=t,this.prefix=e,this.baseDecode=r}decode(t){if("string"===typeof t){if(t[0]===this.prefix)return this.baseDecode(t.slice(1));throw Error("Unable to decode multibase string ".concat(JSON.stringify(t),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix))}throw Error("Can only multibase decode strings")}or(t){return u(this,t)}}class a{constructor(t){this.decoders=t}or(t){return u(this,t)}decode(t){const e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(t),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const u=(t,e)=>new a({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class c{constructor(t,e,r,n){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=n,this.encoder=new o(t,e,r),this.decoder=new s(t,e,n)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const l=t=>{let{name:e,prefix:r,encode:n,decode:i}=t;return new c(e,r,n,i)},h=t=>{let{prefix:e,name:r,alphabet:o}=t;const{encode:s,decode:a}=n(o,r);return l({prefix:e,name:r,encode:s,decode:t=>(0,i.oQ)(a(t))})},f=t=>{let{name:e,prefix:r,bitsPerChar:n,alphabet:i}=t;return l({prefix:r,name:e,encode:t=>((t,e,r)=>{const n="="===e[e.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(t,i,n),decode:t=>((t,e,r,n)=>{const i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let o=t.length;for(;"="===t[o-1];)--o;const s=new Uint8Array(o*r/8|0);let a=0,u=0,c=0;for(let l=0;l<o;++l){const e=i[t[l]];if(void 0===e)throw new SyntaxError("Non-".concat(n," character"));u=u<<r|e,a+=r,a>=8&&(a-=8,s[c++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,i,n,e)})}},24031:(t,e,r)=>{"use strict";r.r(e),r.d(e,{base16:()=>i,base16upper:()=>o});var n=r(52087);const i=(0,n.ET)({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),o=(0,n.ET)({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})},71128:(t,e,r)=>{"use strict";r.r(e),r.d(e,{base32:()=>i,base32upper:()=>o,base32pad:()=>s,base32padupper:()=>a,base32hex:()=>u,base32hexupper:()=>c,base32hexpad:()=>l,base32hexpadupper:()=>h,base32z:()=>f});var n=r(52087);const i=(0,n.ET)({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),o=(0,n.ET)({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),s=(0,n.ET)({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),a=(0,n.ET)({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u=(0,n.ET)({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),c=(0,n.ET)({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),l=(0,n.ET)({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),h=(0,n.ET)({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),f=(0,n.ET)({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})},45645:(t,e,r)=>{"use strict";r.r(e),r.d(e,{base36:()=>i,base36upper:()=>o});var n=r(52087);const i=(0,n.kU)({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),o=(0,n.kU)({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})},86898:(t,e,r)=>{"use strict";r.r(e),r.d(e,{base58btc:()=>i,base58flickr:()=>o});var n=r(52087);const i=(0,n.kU)({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o=(0,n.kU)({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})},24426:(t,e,r)=>{"use strict";r.r(e),r.d(e,{base64:()=>i,base64pad:()=>o,base64url:()=>s,base64urlpad:()=>a});var n=r(52087);const i=(0,n.ET)({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o=(0,n.ET)({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s=(0,n.ET)({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),a=(0,n.ET)({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})},71250:(t,e,r)=>{"use strict";r.d(e,{fS:()=>n,oQ:()=>i,mL:()=>o,BB:()=>s});new Uint8Array(0);const n=(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},i=t=>{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)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")},o=t=>(new TextEncoder).encode(t),s=t=>(new TextDecoder).decode(t)},16629:(t,e,r)=>{"use strict";r.r(e),r.d(e,{CID:()=>u});var n=r(65136),i=r(8315),o=r(86898),s=r(71128),a=r(71250);class u{constructor(t,e,r,n){this.code=e,this.version=t,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:m,byteLength:m,code:g,version:g,multihash:g,bytes:g,_baseCache:m,asCID:m})}toV0(){if(0===this.version)return this;{const{code:t,multihash:e}=this;if(t!==f)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==d)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return u.createV0(e)}}toV1(){switch(this.version){case 0:{const{code:t,digest:e}=this.multihash,r=i.create(t,e);return u.createV1(this.code,r)}case 1:return this;default:throw Error("Can not convert CID version ".concat(this.version," to version 0. This is a bug please report"))}}equals(t){return t&&this.code===t.code&&this.version===t.version&&i.equals(this.multihash,t.multihash)}toString(t){const{bytes:e,version:r,_baseCache:n}=this;return 0===r?l(e,n,t||o.base58btc.encoder):h(e,n,t||s.base32.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(t){return b(/^0\.0/,v),!(!t||!t[y]&&t.asCID!==t)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(t){if(t instanceof u)return t;if(null!=t&&t.asCID===t){const{version:e,code:r,multihash:n,bytes:i}=t;return new u(e,r,n,i||p(e,r,n.bytes))}if(null!=t&&!0===t[y]){const{version:e,multihash:r,code:n}=t,o=i.decode(r);return u.create(e,n,o)}return null}static create(t,e,r){if("number"!==typeof e)throw new Error("String codecs are no longer supported");switch(t){case 0:if(e!==f)throw new Error("Version 0 CID must use dag-pb (code: ".concat(f,") block encoding"));return new u(t,e,r,r.bytes);case 1:{const n=p(t,e,r.bytes);return new u(t,e,r,n)}default:throw new Error("Invalid version")}}static createV0(t){return u.create(0,f,t)}static createV1(t,e){return u.create(1,t,e)}static decode(t){const[e,r]=u.decodeFirst(t);if(r.length)throw new Error("Incorrect length");return e}static decodeFirst(t){const e=u.inspectBytes(t),r=e.size-e.multihashSize,n=(0,a.oQ)(t.subarray(r,r+e.multihashSize));if(n.byteLength!==e.multihashSize)throw new Error("Incorrect length");const o=n.subarray(e.multihashSize-e.digestSize),s=new i.Digest(e.multihashCode,e.digestSize,o,n);return[0===e.version?u.createV0(s):u.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0;const r=()=>{const[r,i]=n.Jx(t.subarray(e));return e+=i,r};let i=r(),o=f;if(18===i?(i=0,e=0):1===i&&(o=r()),0!==i&&1!==i)throw new RangeError("Invalid CID version ".concat(i));const s=e,a=r(),u=r(),c=e+u;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:c-s,size:c}}static parse(t,e){const[r,n]=c(t,e),i=u.decode(n);return i._baseCache.set(r,t),i}}const c=(t,e)=>{switch(t[0]){case"Q":{const r=e||o.base58btc;return[o.base58btc.prefix,r.decode("".concat(o.base58btc.prefix).concat(t))]}case o.base58btc.prefix:{const r=e||o.base58btc;return[o.base58btc.prefix,r.decode(t)]}case s.base32.prefix:{const r=e||s.base32;return[s.base32.prefix,r.decode(t)]}default:if(null==e)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}},l=(t,e,r)=>{const{prefix:n}=r;if(n!==o.base58btc.prefix)throw Error("Cannot string encode V0 in ".concat(r.name," encoding"));const i=e.get(n);if(null==i){const i=r.encode(t).slice(1);return e.set(n,i),i}return i},h=(t,e,r)=>{const{prefix:n}=r,i=e.get(n);if(null==i){const i=r.encode(t);return e.set(n,i),i}return i},f=112,d=18,p=(t,e,r)=>{const i=n.P$(t),o=i+n.P$(e),s=new Uint8Array(o+r.byteLength);return n.mL(t,s,0),n.mL(e,s,i),s.set(r,o),s},y=Symbol.for("@ipld/js-cid/CID"),g={writable:!1,configurable:!1,enumerable:!0},m={writable:!1,enumerable:!1,configurable:!1},b=(t,e)=>{if(!t.test("0.0.0-dev"))throw new Error(e);console.warn(e)},v="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n"},8315:(t,e,r)=>{"use strict";r.r(e),r.d(e,{create:()=>o,decode:()=>s,equals:()=>a,Digest:()=>u});var n=r(71250),i=r(65136);const o=(t,e)=>{const r=e.byteLength,n=i.P$(t),o=n+i.P$(r),s=new Uint8Array(o+r);return i.mL(t,s,0),i.mL(r,s,n),s.set(e,o),new u(t,r,e,s)},s=t=>{const e=(0,n.oQ)(t),[r,o]=i.Jx(e),[s,a]=i.Jx(e.subarray(o)),c=e.subarray(o+a);if(c.byteLength!==s)throw new Error("Incorrect length");return new u(r,s,c,e)},a=(t,e)=>t===e||t.code===e.code&&t.size===e.size&&(0,n.fS)(t.bytes,e.bytes);class u{constructor(t,e,r,n){this.code=t,this.size=e,this.digest=r,this.bytes=n}}},42231:(t,e,r)=>{"use strict";r.d(e,{D:()=>i});var n=r(8315);const i=t=>{let{name:e,code:r,encode:n}=t;return new o(e,r,n)};class o{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}async digest(t){if(t instanceof Uint8Array){const e=await this.encode(t);return n.create(this.code,e)}throw Error("Unknown type, must be binary type")}}},60173:(t,e,r)=>{"use strict";r.r(e),r.d(e,{identity:()=>o});var n=r(42231),i=r(71250);const o=(0,n.D)({name:"identity",code:0,encode:t=>(0,i.oQ)(t)})},19400:(t,e,r)=>{"use strict";r.r(e),r.d(e,{sha256:()=>o,sha512:()=>s});var n=r(42231);const i=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),o=(0,n.D)({name:"sha2-256",code:18,encode:i("SHA-256")}),s=(0,n.D)({name:"sha2-512",code:19,encode:i("SHA-512")})},65136:(t,e,r)=>{"use strict";r.d(e,{Jx:()=>g,mL:()=>m,P$:()=>b});var n=function t(e,r,n){r=r||[];var o=n=n||0;for(;e>=i;)r[n++]=255&e|128,e/=128;for(;-128&e;)r[n++]=255&e|128,e>>>=7;return r[n]=0|e,t.bytes=n-o+1,r},i=Math.pow(2,31);var o=function t(e,r){var n,i=0,o=0,s=r=r||0,a=e.length;do{if(s>=a)throw t.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=s-r,i};var s=Math.pow(2,7),a=Math.pow(2,14),u=Math.pow(2,21),c=Math.pow(2,28),l=Math.pow(2,35),h=Math.pow(2,42),f=Math.pow(2,49),d=Math.pow(2,56),p=Math.pow(2,63);const y={encode:n,decode:o,encodingLength:function(t){return t<s?1:t<a?2:t<u?3:t<c?4:t<l?5:t<h?6:t<f?7:t<d?8:t<p?9:10}},g=t=>[y.decode(t),y.decode.bytes],m=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return y.encode(t,e,r),e},b=t=>y.encodingLength(t)},75926:(t,e,r)=>{"use strict";r.r(e),r.d(e,{customAlphabet:()=>s,customRandom:()=>o,nanoid:()=>a,random:()=>i,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let i=t=>crypto.getRandomValues(new Uint8Array(t)),o=(t,e,r)=>{let n=(2<<Math.log(t.length-1)/Math.LN2)-1,i=-~(1.6*n*e/t.length);return()=>{let o="";for(;;){let s=r(i),a=i;for(;a--;)if(o+=t[s[a]&n]||"",o.length===e)return o}}},s=(t,e)=>o(t,e,i),a=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21,e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=63&r[t];e+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return e}},62110:(t,e,r)=>{"use strict";function n(t,e){e||(e=t.reduce(((t,e)=>t+e.length),0));const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}r.r(e),r.d(e,{concat:()=>n})},98779:(t,e,r)=>{"use strict";function n(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}r.r(e),r.d(e,{equals:()=>n})},46765:(t,e,r)=>{"use strict";r.r(e),r.d(e,{fromString:()=>i});var n=r(65341);function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return r.decoder.decode("".concat(r.prefix).concat(t))}},79421:(t,e,r)=>{"use strict";function n(t,e){for(let r=0;r<t.byteLength;r++){if(t[r]<e[r])return-1;if(t[r]>e[r])return 1}return t.byteLength>e.byteLength?1:t.byteLength<e.byteLength?-1:0}r.r(e),r.d(e,{compare:()=>n,concat:()=>i.concat,equals:()=>o.equals,fromString:()=>s.fromString,toString:()=>a.toString,xor:()=>u});var i=r(62110),o=r(98779),s=r(46765),a=r(82051);function u(t,e){if(t.length!==e.length)throw new Error("Inputs should have the same length");const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}},82051:(t,e,r)=>{"use strict";r.r(e),r.d(e,{toString:()=>i});var n=r(65341);function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[e];if(!r)throw new Error('Unsupported encoding "'.concat(e,'"'));return r.encoder.encode(t).substring(1)}},65341:(t,e,r)=>{"use strict";r.d(e,{Z:()=>x});var n={};r.r(n),r.d(n,{identity:()=>h});var i={};r.r(i),r.d(i,{base2:()=>f});var o={};r.r(o),r.d(o,{base8:()=>d});var s={};r.r(s),r.d(s,{base10:()=>p});var a={};r.r(a),r.d(a,{code:()=>S,decode:()=>A,encode:()=>I,name:()=>E});var u={};r.r(u),r.d(u,{code:()=>k,decode:()=>P,encode:()=>C,name:()=>R});var c=r(52087),l=r(71250);const h=(0,c.Dp)({prefix:"\0",name:"identity",encode:t=>(0,l.BB)(t),decode:t=>(0,l.mL)(t)}),f=(0,c.ET)({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),d=(0,c.ET)({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),p=(0,c.kU)({prefix:"9",name:"base10",alphabet:"0123456789"});var y=r(24031),g=r(71128),m=r(45645),b=r(86898),v=r(24426),w=r(19400),_=r(60173);const E="raw",S=85,I=t=>(0,l.oQ)(t),A=t=>(0,l.oQ)(t),M=new TextEncoder,T=new TextDecoder,R="json",k=512,C=t=>M.encode(JSON.stringify(t)),P=t=>JSON.parse(T.decode(t));r(16629),r(65136),r(42231),r(8315);const B={...n,...i,...o,...s,...y,...g,...m,...b,...v};function O(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const N=O("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),D=O("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);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e})),x={utf8:N,"utf-8":N,hex:B.base16,latin1:D,ascii:D,binary:D,...B}},44946:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},75207:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},29799:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},35438:t=>{"use strict";t.exports=JSON.parse('{"cloudflare":{"host":"cloudflare-dns.com","docs":"https://developers.cloudflare.com/1.1.1.1/dns-over-https","cors":true},"cloudflareFamily":{"host":"family.cloudflare-dns.com","docs":"https://developers.cloudflare.com/1.1.1.1/1.1.1.1-for-families/setup-instructions/dns-over-https","cors":true,"filter":true},"cloudflareSecurity":{"host":"security.cloudflare-dns.com","docs":"https://developers.cloudflare.com/1.1.1.1/1.1.1.1-for-families/setup-instructions/dns-over-https","cors":true,"filter":true},"cloudflareEth":{"host":"eth.resolver.cloudflare-eth.com","docs":"https://www.cloudflare.com/distributed-web-gateway/#ethereum-gateway","cors":true,"filter":true},"aAndA":{"host":"dns.aa.net.uk","docs":"https://www.aa.net.uk/legal/dohdot-disclaimer/","filter":true},"usablePrivacy":{"host":"adfree.usableprivacy.net","docs":"https://docs.usableprivacy.com","filter":true},"adguard":{"host":"dns.adguard.com","docs":"https://adguard.com/en/adguard-dns/overview.html","filter":true},"adguardFamily":{"host":"dns-family.adguard.com","docs":"https://adguard.com/en/adguard-dns/overview.html","filter":true},"adguardUnfiltered":{"host":"dns-unfiltered.adguard.com","docs":"https://adguard.com/en/adguard-dns/overview.html"},"ahadnsIn":{"host":"doh.in.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"India"},"ahadnsIt":{"host":"doh.it.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Italy"},"ahadnsEs":{"host":"doh.es.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Spain"},"ahadnsNo":{"host":"doh.no.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Norway"},"ahadnsNl":{"host":"doh.nl.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Netherlands"},"ahadnsPl":{"host":"doh.pl.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Poland"},"ahadnsNy":{"host":"doh.ny.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"New York"},"ahadnsChi":{"host":"doh.chi.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Chicago"},"ahadnsAu":{"host":"doh.au.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Australia"},"ahadnsLa":{"host":"doh.la.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Los Angeles"},"alidns":{"host":"dns.alidns.com","docs":"https://alidns.com/knowledge?type=SETTING_DOCS#umpt6","cors":true,"filter":true,"location":"China"},"amsNl":{"host":"dnsnl.alekberg.net","docs":"https://alekberg.net/doh","location":"Amsterdam"},"amsSe":{"host":"dnsse.alekberg.net","docs":"https://alekberg.net/doh","location":"Sweden"},"amsEs":{"host":"dnses.alekberg.net","docs":"https://alekberg.net/doh","location":"Spain"},"arapurayil":{"host":"dns.arapurayil.com","docs":"https://www.dns.arapurayil.com/","filter":true},"digitaleGesellschaft":{"host":"dns.digitale-gesellschaft.ch","docs":"https://www.digitale-gesellschaft.ch/dns","cors":true,"location":"Switzerland"},"dnsForFamily":{"host":"dns-doh.dnsforfamily.com","docs":"https://dnsforfamily.com/","filter":true},"dnsHome":{"host":"dns.dnshome.de","docs":"https://www.dnshome.de/doh-dot-public-resolver.php","location":"Germany"},"blahDnsCh":{"host":"doh-ch.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Switzerland"},"blahDnsJp":{"host":"doh-jp.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Japan"},"blahDnsDe":{"host":"doh-de.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Germany"},"blahDnsFi":{"host":"doh-fi.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Finland"},"cleanBrowsingSecurity":{"host":"doh.cleanbrowsing.org","docs":"https://cleanbrowsing.org/guides/dnsoverhttps","path":"/doh/security-filter/","cors":true,"filter":true},"cleanBrowsingFamily":{"host":"doh.cleanbrowsing.org","docs":"https://cleanbrowsing.org/guides/dnsoverhttps","path":"/doh/family-filter/","cors":true,"filter":true},"cleanBrowsingAdult":{"host":"doh.cleanbrowsing.org","docs":"https://cleanbrowsing.org/guides/dnsoverhttps","path":"/doh/adult-filter/","cors":true,"filter":true},"appliedPrivacy":{"host":"doh.applied-privacy.net","docs":"https://applied-privacy.net/services/dns/","path":"/query","location":"Austria"},"ffmuc":{"host":"doh.ffmuc.net","docs":"https://ffmuc.net/wiki/doku.php?id=knb:dohdot","location":"Germany"},"tiarap":{"host":"doh.tiar.app","docs":"https://tiarap.org/","filter":true},"tiarapJp":{"host":"jp.tiar.app","docs":"https://jp.tiar.app/","filter":true,"location":"Japan"},"google":{"host":"dns.google","docs":"https://developers.google.com/speed/public-dns/docs/doh/","cors":true},"he":{"host":"ordns.he.net","docs":"https://dns.he.net/","log":true},"iij":{"host":"public.dns.iij.jp","docs":"https://public.dns.iij.jp/","filter":true,"log":true,"location":"Japan"},"libredns":{"host":"doh.libredns.gr","docs":"https://libredns.gr/","location":"Germany"},"librednsAds":{"host":"doh.libredns.gr","docs":"https://libredns.gr/","path":"/ads","filter":true,"location":"Germany"},"njalla":{"host":"dns.njal.la","docs":"https://dns.njal.la/","location":"Sweden"},"opendns":{"host":"doh.opendns.com","docs":"https://support.opendns.com/hc/en-us/articles/360038086532-Using-DNS-over-HTTPS-DoH-with-OpenDNS"},"opendnsFamily":{"host":"doh.familyshield.opendns.com","docs":"https://support.opendns.com/hc/en-us/articles/360038086532-Using-DNS-over-HTTPS-DoH-with-OpenDNS","filter":true},"sebyVultr":{"host":"doh.seby.io","docs":"https://dns.seby.io/","port":8443,"cors":true,"filter":true,"location":"Sydney"},"sebyOVH":{"host":"doh-2.seby.io","docs":"https://dns.seby.io/","cors":true,"filter":true,"location":"Sydney"},"quad9":{"host":"dns10.quad9.net","docs":"https://quad9.net/service/service-addresses-and-features"},"quad9Ads":{"host":"dns.quad9.net","docs":"https://quad9.net/service/service-addresses-and-features","filter":true},"switchCh":{"host":"dns.switch.ch","docs":"https://www.switch.ch/security/info/public-dns/","filter":true,"location":"Switzerland"},"yepdns":{"host":"sg.yepdns.com","docs":"https://get.yepdns.com/","filter":true,"location":"Singapore"},"lavaDnsEU1":{"host":"eu1.dns.lavate.ch","docs":"https://dns.lavate.ch/","location":"Helsinki"},"controlId":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p0"},"controlIdMw":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p1","filter":true},"controlIdAds":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p2","filter":true},"controlIdSoc":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p3","filter":true},"uncensoredAny":{"host":"anycast.censurfridns.dk","docs":"https://blog.uncensoreddns.org/"},"uncensoredUni":{"host":"unicast.censurfridns.dk","docs":"https://blog.uncensoreddns.org/","location":"Copenhagen"},"dnssbGlobal":{"host":"doh.dns.sb","docs":"https://dns.sb/doh/","cors":true},"dbssbDeDus":{"host":"de-dus.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"D\xfcsseldorf"},"dnssbDeFra":{"host":"de-fra.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Frankfurt"},"dnssbNlAms":{"host":"nl-ams.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Amsterdam"},"dnssbNlAms2":{"host":"nl-ams2.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Amsterdam"},"dnssbEeTll":{"host":"ee-tll.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Tallinn"},"dnssbJpKix":{"host":"jp-kix.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Osaka"},"dnssbHkHkg":{"host":"hk-hkg.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Hong Kong"},"dnssbAuSyd":{"host":"au-syd.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Sydney"},"dnssbUsChi":{"host":"us-chi.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Chicago"},"dnssbInBlr":{"host":"in-blr.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Bengaluru"},"dnssbSgSin":{"host":"sg-sin.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Singapore"},"dnssbKrSel":{"host":"kr-sel.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Seoul"},"dnssbRuMow":{"host":"ru-mow.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Moscow"},"ethlink":{"host":"eth.link","docs":"https://eth.link/","cors":true},"handshake":{"host":"query.hdns.io","docs":"https://docs.namebase.io/guides-1/resolving-handshake-1/hdns.io#dns-over-https-doh","cors":true}}')},18597:t=>{"use strict";t.exports={i8:"6.5.4"}},28362:t=>{"use strict";t.exports=JSON.parse('{"name":"libp2p","version":"0.36.2","description":"JavaScript implementation of libp2p, a modular peer to peer network stack","leadMaintainer":"Jacob Heun <jacobheun@gmail.com>","main":"src/index.js","types":"dist/src/index.d.ts","typesVersions":{"*":{"src/*":["dist/src/*","dist/src/*/index"]}},"files":["dist","src"],"scripts":{"lint":"aegir lint","build":"aegir build","build:proto":"npm run build:proto:circuit && npm run build:proto:fetch && npm run build:proto:identify && npm run build:proto:plaintext && npm run build:proto:address-book && npm run build:proto:proto-book && npm run build:proto:peer && npm run build:proto:peer-record && npm run build:proto:envelope","build:proto:circuit":"pbjs -t static-module -w commonjs -r libp2p-circuit --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/circuit/protocol/index.js ./src/circuit/protocol/index.proto","build:proto:fetch":"pbjs -t static-module -w commonjs -r libp2p-fetch --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/fetch/proto.js ./src/fetch/proto.proto","build:proto:identify":"pbjs -t static-module -w commonjs -r libp2p-identify --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/identify/message.js ./src/identify/message.proto","build:proto:plaintext":"pbjs -t static-module -w commonjs -r libp2p-plaintext --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/insecure/proto.js ./src/insecure/proto.proto","build:proto:peer":"pbjs -t static-module -w commonjs -r libp2p-peer --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/peer-store/pb/peer.js ./src/peer-store/pb/peer.proto","build:proto:peer-record":"pbjs -t static-module -w commonjs -r libp2p-peer-record --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/record/peer-record/peer-record.js ./src/record/peer-record/peer-record.proto","build:proto:envelope":"pbjs -t static-module -w commonjs -r libp2p-envelope --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/record/envelope/envelope.js ./src/record/envelope/envelope.proto","build:proto-types":"npm run build:proto-types:circuit && npm run build:proto-types:fetch && npm run build:proto-types:identify && npm run build:proto-types:plaintext && npm run build:proto-types:address-book && npm run build:proto-types:proto-book && npm run build:proto-types:peer && npm run build:proto-types:peer-record && npm run build:proto-types:envelope","build:proto-types:circuit":"pbts -o src/circuit/protocol/index.d.ts src/circuit/protocol/index.js","build:proto-types:fetch":"pbts -o src/fetch/proto.d.ts src/fetch/proto.js","build:proto-types:identify":"pbts -o src/identify/message.d.ts src/identify/message.js","build:proto-types:plaintext":"pbts -o src/insecure/proto.d.ts src/insecure/proto.js","build:proto-types:peer":"pbts -o src/peer-store/pb/peer.d.ts src/peer-store/pb/peer.js","build:proto-types:peer-record":"pbts -o src/record/peer-record/peer-record.d.ts src/record/peer-record/peer-record.js","build:proto-types:envelope":"pbts -o src/record/envelope/envelope.d.ts src/record/envelope/envelope.js","test":"aegir test","test:ts":"aegir build --no-bundle && npm run test --prefix test/ts-use","test:node":"aegir test -t node -f \\"./test/**/*.{node,spec}.js\\"","test:browser":"aegir test -t browser","test:examples":"cd examples && npm run test:all","test:interop":"LIBP2P_JS=$PWD npx aegir test -t node -f ./node_modules/libp2p-interop/test/*","prepare":"npm run build","coverage":"nyc --reporter=text --reporter=lcov npm run test:node"},"repository":{"type":"git","url":"https://github.com/libp2p/js-libp2p.git"},"keywords":["libp2p","network","p2p","peer","peer-to-peer","IPFS"],"bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"homepage":"https://libp2p.io","license":"MIT","engines":{"node":">=15.0.0"},"browser":{"nat-api":false},"eslintConfig":{"extends":"ipfs","ignorePatterns":["!.aegir.js","test/ts-use","*.d.ts"]},"dependencies":{"@vascosantos/moving-average":"^1.1.0","abortable-iterator":"^3.0.0","aggregate-error":"^3.1.0","any-signal":"^3.0.0","bignumber.js":"^9.0.1","class-is":"^1.1.0","datastore-core":"^7.0.0","debug":"^4.3.1","err-code":"^3.0.0","es6-promisify":"^7.0.0","events":"^3.3.0","hashlru":"^2.3.0","interface-datastore":"^6.0.2","it-all":"^1.0.4","it-buffer":"^0.1.2","it-drain":"^1.0.3","it-filter":"^1.0.1","it-first":"^1.0.4","it-foreach":"^0.1.1","it-handshake":"^2.0.0","it-length-prefixed":"^5.0.2","it-map":"^1.0.4","it-merge":"^1.0.0","it-pipe":"^1.1.0","it-sort":"^1.0.1","it-take":"^1.0.0","libp2p-crypto":"^0.21.2","libp2p-interfaces":"^4.0.0","libp2p-utils":"^0.4.0","mafmt":"^10.0.0","merge-options":"^3.0.4","mortice":"^2.0.1","multiaddr":"^10.0.0","multiformats":"^9.0.0","multistream-select":"^3.0.0","mutable-proxy":"^1.0.0","nat-api":"^0.3.1","node-forge":"^1.2.1","p-any":"^3.0.0","p-fifo":"^1.0.0","p-retry":"^4.4.0","p-settle":"^4.1.1","peer-id":"^0.16.0","private-ip":"^2.1.0","protobufjs":"^6.10.2","retimer":"^3.0.0","sanitize-filename":"^1.6.3","set-delayed-interval":"^1.0.0","streaming-iterables":"^6.0.0","timeout-abort-controller":"^3.0.0","uint8arrays":"^3.0.0","varint":"^6.0.0","wherearewe":"^1.0.0","xsalsa20":"^1.1.0"},"devDependencies":{"@chainsafe/libp2p-noise":"^5.0.0","@nodeutils/defaults-deep":"^1.1.0","@types/es6-promisify":"^6.0.0","@types/node":"^16.0.1","@types/node-forge":"^1.0.0","@types/varint":"^6.0.0","aegir":"^36.0.0","buffer":"^6.0.3","delay":"^5.0.0","into-stream":"^6.0.0","ipfs-http-client":"^54.0.2","it-concat":"^2.0.0","it-pair":"^1.0.0","it-pushable":"^1.4.0","libp2p":".","libp2p-bootstrap":"^0.14.0","libp2p-delegated-content-routing":"^0.11.0","libp2p-delegated-peer-routing":"^0.11.1","libp2p-interfaces-compliance-tests":"^4.0.8","libp2p-interop":"^0.7.1","libp2p-kad-dht":"^0.28.6","libp2p-mdns":"^0.18.0","libp2p-mplex":"^0.10.4","libp2p-tcp":"^0.17.0","libp2p-webrtc-star":"^0.25.0","libp2p-websockets":"^0.16.0","nock":"^13.0.3","p-defer":"^3.0.0","p-times":"^3.0.0","p-wait-for":"^3.2.0","rimraf":"^3.0.2","sinon":"^12.0.1","util":"^0.12.3"},"contributors":["Vasco Santos <vasco.santos@moxy.studio>","David Dias <daviddias.p@gmail.com>","Jacob Heun <jacobheun@gmail.com>","Alex Potsides <alex@achingbrain.net>","Alan Shaw <alan@tableflip.io>","Cayman <caymannava@gmail.com>","Pedro Teixeira <i@pgte.me>","Friedel Ziegelmayer <dignifiedquire@gmail.com>","Maciej Kr\xfcger <mkg20001@gmail.com>","Hugo Dias <mail@hugodias.me>","dirkmc <dirkmdev@gmail.com>","Volker Mische <volker.mische@gmail.com>","Chris Dostert <chrisdostert@users.noreply.github.com>","zeim839 <50573884+zeim839@users.noreply.github.com>","Robert Kiel <robert.kiel@hoprnet.org>","Richard Littauer <richard.littauer@gmail.com>","a1300 <matthias-knopp@gmx.net>","Ryan Bell <ryan@piing.net>","\u1d20\u026a\u1d04\u1d1b\u1d0f\u0280 \u0299\u1d0a\u1d07\u029f\u1d0b\u029c\u1d0f\u029f\u1d0d <victorbjelkholm@gmail.com>","Andrew Nesbitt <andrewnez@gmail.com>","Franck Royer <franck@royer.one>","Thomas Eizinger <thomas@eizinger.io>","V\xedt Habada <vithabada93@gmail.com>","Giovanni T. Parra <fiatjaf@gmail.com>","acolytec3 <17355484+acolytec3@users.noreply.github.com>","Alan Smithee <ggnore.alan.smithee@gmail.com>","Elven <mon.samuel@qq.com>","Samlior <samlior@foxmail.com>","Didrik Nordstr\xf6m <didrik.nordstrom@gmail.com>","Aditya Bose <13054902+adbose@users.noreply.github.com>","TJKoury <TJKoury@gmail.com>","TheStarBoys <41286328+TheStarBoys@users.noreply.github.com>","Tiago Alves <alvesjtiago@gmail.com>","Tim Daubensch\xfctz <tim@daubenschuetz.de>","XiaoZhang <zxinmyth@gmail.com>","Yusef Napora <yusef@napora.org>","Zane Starr <zcstarr@gmail.com>","ebinks <elizabethjbinks@gmail.com>","greenSnot <greenSnot@users.noreply.github.com>","isan_rivkin <isanrivkin@gmail.com>","mayerwin <mayerwin@users.noreply.github.com>","mcclure <andi.m.mcclure@gmail.com>","patrickwoodhead <91056047+patrickwoodhead@users.noreply.github.com>","phillmac <phillmac@users.noreply.github.com>","robertkiel <robert.kiel@validitylabs.org>","shresthagrawal <34920931+shresthagrawal@users.noreply.github.com>","swedneck <40505480+swedneck@users.noreply.github.com>","tuyennhv <vutuyen2636@gmail.com>","S\xf6nke Hahn <soenkehahn@gmail.com>","Aleksei <vozhdb@gmail.com>","Bernd Strehl <bernd.strehl@gmail.com>","Chris Bratlien <chrisbratlien@gmail.com>","Cindy Wu <ciindy.wu@gmail.com>","Daijiro Wachi <daijiro.wachi@gmail.com>","Diogo Silva <fsdiogo@gmail.com>","Dmitriy Ryajov <dryajov@gmail.com>","Ethan Lam <elmemphis2000@gmail.com>","Fei Liu <liu.feiwood@gmail.com>","Felipe Martins <felipebrasil93@gmail.com>","Florian-Merle <florian.david.merle@gmail.com>","Francis Gulotta <wizard@roborooter.com>","Guy Sviry <32539816+guysv@users.noreply.github.com>","Henrique Dias <hacdias@gmail.com>","Irakli Gozalishvili <rfobic@gmail.com>","Joel Gustafson <joelg@mit.edu>","John Rees <johnrees@users.noreply.github.com>","Jo\xe3o Santos <joaosantos15@users.noreply.github.com>","Julien Bouquillon <contact@revolunet.com>","Kevin Kwok <antimatter15@gmail.com>","Kevin Lacker <lacker@gmail.com>","Lars Gierth <lgierth@users.noreply.github.com>","Leask Wong <i@leaskh.com>","Marcin Tojek <mtojek@users.noreply.github.com>","Marston Connell <34043723+TheMarstonConnell@users.noreply.github.com>","Michael Burns <5170+mburns@users.noreply.github.com>","Miguel Mota <miguelmota2@gmail.com>","Nuno Nogueira <nunofmn@gmail.com>","Philipp Muens <raute1337@gmx.de>","RasmusErik Voel Jensen <github@solsort.com>","Smite Chow <xiaopengyou@live.com>","Soeren <nikorpoulsen@gmail.com>"]}')},22562:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__={};(()=>{"use strict";var t=__webpack_require__(72791),e=__webpack_require__(54164),r=__webpack_require__(12738),n=__webpack_require__(69145),i=__webpack_require__.n(n),o=__webpack_require__(80184),s=__webpack_require__(19778).Buffer;const a=i()("\nmessage ChatMessage {\n uint64 timestamp = 1;\n string nick = 2;\n bytes text = 3;\n}\n");const u=function(){const[e,n]=t.useState(void 0),[i,s]=t.useState("None"),[a,u]=t.useState([]);return t.useEffect((()=>{"None"===i&&(s("Starting"),r.Waku.create({bootstrap:{default:!0}}).then((t=>{n(t),s("Connecting")})))}),[e,i]),t.useEffect((()=>{e&&"Connected"!==i&&e.waitForRemotePeer().then((()=>{s("Connected")}))}),[e,i]),t.useEffect((()=>{if("Connected"!==i)return;const t=new Date;t.setTime(t.getTime()-6048e5),e.store.queryHistory(["/toy-chat/2/huilong/proto"],{callback:t=>{const e=t.map(c).filter(Boolean);u((t=>t.concat(e.reverse())))},timeFilter:{startTime:t,endTime:new Date}}).catch((t=>{console.log("Failed to retrieve messages",t)}))}),[e,i]),(0,o.jsx)("div",{className:"App",children:(0,o.jsxs)("header",{className:"App-header",children:[(0,o.jsx)("h2",{children:i}),(0,o.jsx)("h3",{children:"Messages"}),(0,o.jsx)("ul",{children:(0,o.jsx)(l,{messages:a})})]})})};function c(t){if(!t.payload)return;const{timestamp:e,nick:r,text:n}=a.ChatMessage.decode(t.payload);if(!e||!n||!r)return;const i=new Date;i.setTime(e);return{text:s.from(n).toString("utf-8"),timestamp:i,nick:r}}function l(t){return t.messages.map((t=>{let{text:e,timestamp:r,nick:n}=t;return(0,o.jsxs)("li",{children:["(",h(r),") ",n,": ",e]})}))}function h(t){return t.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!1})}e.render((0,o.jsx)(t.StrictMode,{children:(0,o.jsx)(u,{})}),document.getElementById("root"))})()})();
//# sourceMappingURL=main.4b3f1bf8.js.map