From 7553ae45e02620718b46de7deb7caee6d3b9369b Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Thu, 17 Oct 2024 18:02:51 +0300 Subject: [PATCH] feat(SIWE): Add siwe support to the webSdk integration This PR implements the functions needed for siwe in the webSdk integration, updates the WC version and fixes an issue where the webpack does not automatically inject `Buffer` plugin needed by the SIWE impl in WC. --- .../services/dapps/WalletConnectSDK.qml | 125 + .../services/dapps/WalletConnectSDKBase.qml | 30 +- .../services/dapps/sdk/generated/bundle.js | 2 +- .../dapps/sdk/generated/bundle.js.LICENSE.txt | 9 + .../services/dapps/sdk/package-lock.json | 3160 ++++++++--------- .../Wallet/services/dapps/sdk/package.json | 8 +- .../Wallet/services/dapps/sdk/src/index.js | 52 +- .../services/dapps/sdk/webpack.config.js | 14 + 8 files changed, 1627 insertions(+), 1773 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDK.qml b/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDK.qml index 445e46652e..17b1d87d4d 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDK.qml +++ b/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDK.qml @@ -69,6 +69,26 @@ WalletConnectSDKBase { wcCalls.rejectSessionRequest(topic, id, error) } + populateAuthPayload: function(id, authPayload, chains, methods) { + wcCalls.populateAuthPayload(id, authPayload, chains, methods) + } + + formatAuthMessage: function(id, request, iss) { + wcCalls.formatAuthMessage(id, request, iss) + } + + acceptSessionAuthenticate: function(id, auths) { + wcCalls.acceptSessionAuthenticate(id, auths) + } + + rejectSessionAuthenticate: function(id, error) { + wcCalls.rejectSessionAuthenticate(id, error) + } + + buildAuthObject: function(id, authPayload, signature, iss) { + wcCalls.buildAuthObject(id, authPayload, signature, iss) + } + QtObject { id: d @@ -253,6 +273,81 @@ WalletConnectSDKBase { ` ) } + + function populateAuthPayload(id, authPayload, chains, methods) { + console.debug(`WC WalletConnectSDK.wcCall.populateAuthPayload; id: "${id}", authPayload: ${JSON.stringify(authPayload)}, chains: ${JSON.stringify(chains)}, methods: ${JSON.stringify(methods)}`) + + d.engine.runJavaScript(` + wc.populateAuthPayload(${JSON.stringify(authPayload)}, ${JSON.stringify(chains)}, ${JSON.stringify(methods)}) + .then((value) => { + wc.statusObject.onPopulateAuthPayloadResponse("${id}", value, "") + }) + .catch((e) => { + wc.statusObject.onPopulateAuthPayloadResponse("${id}", "", e.message) + }) + ` + ) + } + + function formatAuthMessage(id, request, iss) { + console.debug(`WC WalletConnectSDK.wcCall.formatAuthMessage; id: ${id}, request: ${JSON.stringify(request)}, iss: ${iss}`) + + d.engine.runJavaScript(` + wc.formatAuthMessage(${JSON.stringify(request)}, "${iss}") + .then((value) => { + wc.statusObject.onFormatAuthMessageResponse(${id}, value, "") + }) + .catch((e) => { + wc.statusObject.onFormatAuthMessageResponse(${id}, "", e.message) + }) + ` + ) + } + + function buildAuthObject(id, authPayload, signature, iss) { + console.debug(`WC WalletConnectSDK.wcCall.buildAuthObject; id: ${id}, authPayload: ${JSON.stringify(authPayload)}, signature: ${signature}, iss: ${iss}`) + + d.engine.runJavaScript(` + wc.buildAuthObject(${JSON.stringify(authPayload)}, "${signature}", "${iss}") + .then((value) => { + wc.statusObject.onBuildAuthObjectResponse(${id}, value, "") + }) + .catch((e) => { + wc.statusObject.onBuildAuthObjectResponse(${id}, "", e.message) + }) + ` + ) + } + + function acceptSessionAuthenticate(id, auths) { + console.debug(`WC WalletConnectSDK.wcCall.acceptSessionAuthenticate; id: ${id}, auths: ${JSON.stringify(auths)}`) + + d.engine.runJavaScript(` + wc.acceptSessionAuthenticate(${id}, ${JSON.stringify(auths)}) + .then((value) => { + wc.statusObject.onAcceptSessionAuthenticateResult(${id}, value, "") + }) + .catch((e) => { + wc.statusObject.onAcceptSessionAuthenticateResult(${id}, "", e.message) + }) + ` + ) + } + + function rejectSessionAuthenticate(id, error) { + console.debug(`WC WalletConnectSDK.wcCall.rejectSessionAuthenticate; id: ${id}, error: "${error}"`) + + d.engine.runJavaScript(` + wc.rejectSessionAuthenticate(${id}, ${error}) + .then((value) => { + wc.statusObject.onRejectSessionAuthenticateResult(${id}, value, "") + }) + .catch((e) => { + wc.statusObject.onRejectSessionAuthenticateResult(${id}, "", e.message) + }) + ` + ) + } } QtObject { @@ -371,6 +466,36 @@ WalletConnectSDKBase { console.debug(`WC WalletConnectSDK.onSessionRequestExpire; id: ${id}`) root.sessionRequestExpired(id) } + + function onPopulateAuthPayloadResponse(id, payload, error) { + console.debug(`WC WalletConnectSDK.onPopulateAuthPayloadResponse; id: ${id}, payload: ${JSON.stringify(payload)}, error: ${error}`) + root.populateAuthPayloadResult(id, payload, error) + } + + function onFormatAuthMessageResponse(id, message, error) { + console.debug(`WC WalletConnectSDK.onFormatAuthMessageResponse; id: ${id}, message: ${JSON.stringify(message)}, error: ${error}`) + root.formatAuthMessageResult(id, message, error) + } + + function onBuildAuthObjectResponse(id, authObject, error) { + console.debug(`WC WalletConnectSDK.onBuildAuthObjectResponse; id: ${id}, authObject: ${JSON.stringify(authObject)}, error: ${error}`) + root.buildAuthObjectResult(id, authObject, error) + } + + function onSessionAuthenticate(details) { + console.debug(`WC WalletConnectSDK.onSessionAuthenticate; details: ${JSON.stringify(details)}`) + root.sessionAuthenticateRequest(details) + } + + function onAcceptSessionAuthenticateResult(id, result, error) { + console.debug(`WC WalletConnectSDK.onAcceptSessionAuthenticateResult; id: ${id}, result: ${JSON.stringify(result)}, error: ${error}`) + root.acceptSessionAuthenticateResult(id, result, error) + } + + function onRejectSessionAuthenticateResult(id, result, error) { + //console.debug(`WC WalletConnectSDK.onRejectSessionAuthenticateResult; id: ${id}, result: ${result}, error: ${error}`) + root.rejectSessionAuthenticateResult(id, result, error) + } } WebEngineLoader { diff --git a/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDKBase.qml b/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDKBase.qml index f34f089475..8ceba96209 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDKBase.qml +++ b/ui/app/AppLayouts/Wallet/services/dapps/WalletConnectSDKBase.qml @@ -15,10 +15,12 @@ Item { signal sessionRequestExpired(var id) signal sessionRequestEvent(var sessionRequest) signal sessionRequestUserAnswerResult(string topic, string id, bool accept /* not reject */, string error) - - signal authRequest(var request) - signal authMessageFormated(string formatedMessage, string address) - signal authRequestUserAnswerResult(bool accept, string error) + signal sessionAuthenticateRequest(var sessionData) + signal populateAuthPayloadResult(var id, var authPayload, string error) + signal formatAuthMessageResult(var id, var request, string error) + signal acceptSessionAuthenticateResult(var id, var result, string error) + signal rejectSessionAuthenticateResult(var id, var result, string error) + signal buildAuthObjectResult(var id, var authObject, string error) signal sessionDelete(var topic, string error) @@ -60,4 +62,24 @@ Item { property var rejectSessionRequest: function(topic, id, error) { console.error("rejectSessionRequest not implemented") } + + property var populateAuthPayload: function (id, authPayload, chains, methods) { + console.error("populateAuthPayload not implemented") + } + + property var formatAuthMessage: function(id, request, iss) { + console.error("formatAuthMessage not implemented") + } + + property var buildAuthObject: function(id, authPayload, signature, iss) { + console.error("buildAuthObject not implemented") + } + + property var acceptSessionAuthenticate: function(id, auths) { + console.error("acceptSessionAuthenticate not implemented") + } + + property var rejectSessionAuthenticate: function(id, error) { + console.error("rejectSessionAuthenticate not implemented") + } } diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js b/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js index 834dcc2f9f..f93eeb66ce 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js @@ -1,2 +1,2 @@ /*! For license information please see bundle.js.LICENSE.txt */ -var e={972:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var i=r(4512);function n(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function s(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function o(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function h(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function c(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function f(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function u(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),f(e/4294967296>>>0,t,r),f(e>>>0,t,r+4),t}function l(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),u(e>>>0,t,r),u(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=n,t.writeInt16BE=n,t.writeUint16LE=s,t.writeInt16LE=s,t.readInt32BE=o,t.readUint32BE=a,t.readInt32LE=h,t.readUint32LE=c,t.writeUint32BE=f,t.writeInt32BE=f,t.writeUint32LE=u,t.writeInt32LE=u,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=o(e,t),i=o(e,t+4);return 4294967296*r+i-4294967296*(i>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=h(e,t);return 4294967296*h(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=l,t.writeInt64LE=l,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=e/8+r-1;s>=r;s--)i+=t[s]*n,n*=256;return i},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s=n;o--)r[o]=t/s&255,s*=256;return r},t.writeUintLE=function(e,t,r,n){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===n&&(n=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o{Object.defineProperty(t,"__esModule",{value:!0});var i=r(972),n=r(6228),s=20;function o(e,t,r){for(var n=1634760805,o=857760878,a=2036477234,h=1797285236,c=r[3]<<24|r[2]<<16|r[1]<<8|r[0],f=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],l=r[19]<<24|r[18]<<16|r[17]<<8|r[16],p=r[23]<<24|r[22]<<16|r[21]<<8|r[20],g=r[27]<<24|r[26]<<16|r[25]<<8|r[24],b=r[31]<<24|r[30]<<16|r[29]<<8|r[28],m=t[3]<<24|t[2]<<16|t[1]<<8|t[0],y=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],w=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=n,A=o,S=a,E=h,M=c,I=f,x=u,O=d,N=l,P=p,R=g,T=b,C=m,k=y,L=v,q=w,D=0;D>>16|C<<16)|0)>>>20|M<<12,I=(I^=P=P+(k=(k^=A=A+I|0)>>>16|k<<16)|0)>>>20|I<<12,x=(x^=R=R+(L=(L^=S=S+x|0)>>>16|L<<16)|0)>>>20|x<<12,O=(O^=T=T+(q=(q^=E=E+O|0)>>>16|q<<16)|0)>>>20|O<<12,x=(x^=R=R+(L=(L^=S=S+x|0)>>>24|L<<8)|0)>>>25|x<<7,O=(O^=T=T+(q=(q^=E=E+O|0)>>>24|q<<8)|0)>>>25|O<<7,I=(I^=P=P+(k=(k^=A=A+I|0)>>>24|k<<8)|0)>>>25|I<<7,M=(M^=N=N+(C=(C^=_=_+M|0)>>>24|C<<8)|0)>>>25|M<<7,I=(I^=R=R+(q=(q^=_=_+I|0)>>>16|q<<16)|0)>>>20|I<<12,x=(x^=T=T+(C=(C^=A=A+x|0)>>>16|C<<16)|0)>>>20|x<<12,O=(O^=N=N+(k=(k^=S=S+O|0)>>>16|k<<16)|0)>>>20|O<<12,M=(M^=P=P+(L=(L^=E=E+M|0)>>>16|L<<16)|0)>>>20|M<<12,O=(O^=N=N+(k=(k^=S=S+O|0)>>>24|k<<8)|0)>>>25|O<<7,M=(M^=P=P+(L=(L^=E=E+M|0)>>>24|L<<8)|0)>>>25|M<<7,x=(x^=T=T+(C=(C^=A=A+x|0)>>>24|C<<8)|0)>>>25|x<<7,I=(I^=R=R+(q=(q^=_=_+I|0)>>>24|q<<8)|0)>>>25|I<<7;i.writeUint32LE(_+n|0,e,0),i.writeUint32LE(A+o|0,e,4),i.writeUint32LE(S+a|0,e,8),i.writeUint32LE(E+h|0,e,12),i.writeUint32LE(M+c|0,e,16),i.writeUint32LE(I+f|0,e,20),i.writeUint32LE(x+u|0,e,24),i.writeUint32LE(O+d|0,e,28),i.writeUint32LE(N+l|0,e,32),i.writeUint32LE(P+p|0,e,36),i.writeUint32LE(R+g|0,e,40),i.writeUint32LE(T+b|0,e,44),i.writeUint32LE(C+m|0,e,48),i.writeUint32LE(k+y|0,e,52),i.writeUint32LE(L+v|0,e,56),i.writeUint32LE(q+w|0,e,60)}function a(e,t,r,i,s){if(void 0===s&&(s=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(i.length>>=8,t++;if(i>0)throw new Error("ChaCha: counter overflow")}t.streamXOR=a,t.stream=function(e,t,r,i){return void 0===i&&(i=0),n.wipe(r),a(e,t,r,r,i)}},1612:(e,t,r)=>{var i=r(9918),n=r(7360),s=r(6228),o=r(972),a=r(6452);t.J4=32,t.PX=12,t.iW=16;var h=new Uint8Array(16),c=function(){function e(e){if(this.nonceLength=t.PX,this.tagLength=t.iW,e.length!==t.J4)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,n){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(e,o.length-e.length);var a=new Uint8Array(32);i.stream(this._key,o,a,4);var h,c=t.length+this.tagLength;if(n){if(n.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");h=n}else h=new Uint8Array(c);return i.streamXOR(this._key,o,t,h,4),this._authenticate(h.subarray(h.length-this.tagLength,h.length),a,h.subarray(0,h.length-this.tagLength),r),s.wipe(o),h},e.prototype.open=function(e,t,r,n){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&a.update(h.subarray(i.length%16))),a.update(r),r.length%16>0&&a.update(h.subarray(r.length%16));var c=new Uint8Array(8);i&&o.writeUint64LE(i.length,c),a.update(c),o.writeUint64LE(r.length,c),a.update(c);for(var f=a.digest(),u=0;u{function r(e,t){if(e.length!==t.length)return 0;for(var r=0,i=0;i>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},4904:(e,t,r)=>{t._S=t.K=t.TP=t.wE=t.Ee=void 0;r(7052);const i=r(4974);r(6228);function n(e){const t=new Float64Array(16);if(e)for(let r=0;r>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,d(i,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}function p(e){const t=new Uint8Array(32);return l(t,e),1&t[0]}function g(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]+r[i]}function b(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]-r[i]}function m(e,t,r){let i,n,s=0,o=0,a=0,h=0,c=0,f=0,u=0,d=0,l=0,p=0,g=0,b=0,m=0,y=0,v=0,w=0,_=0,A=0,S=0,E=0,M=0,I=0,x=0,O=0,N=0,P=0,R=0,T=0,C=0,k=0,L=0,q=r[0],D=r[1],U=r[2],B=r[3],z=r[4],j=r[5],F=r[6],K=r[7],H=r[8],V=r[9],W=r[10],G=r[11],Y=r[12],J=r[13],$=r[14],Q=r[15];i=t[0],s+=i*q,o+=i*D,a+=i*U,h+=i*B,c+=i*z,f+=i*j,u+=i*F,d+=i*K,l+=i*H,p+=i*V,g+=i*W,b+=i*G,m+=i*Y,y+=i*J,v+=i*$,w+=i*Q,i=t[1],o+=i*q,a+=i*D,h+=i*U,c+=i*B,f+=i*z,u+=i*j,d+=i*F,l+=i*K,p+=i*H,g+=i*V,b+=i*W,m+=i*G,y+=i*Y,v+=i*J,w+=i*$,_+=i*Q,i=t[2],a+=i*q,h+=i*D,c+=i*U,f+=i*B,u+=i*z,d+=i*j,l+=i*F,p+=i*K,g+=i*H,b+=i*V,m+=i*W,y+=i*G,v+=i*Y,w+=i*J,_+=i*$,A+=i*Q,i=t[3],h+=i*q,c+=i*D,f+=i*U,u+=i*B,d+=i*z,l+=i*j,p+=i*F,g+=i*K,b+=i*H,m+=i*V,y+=i*W,v+=i*G,w+=i*Y,_+=i*J,A+=i*$,S+=i*Q,i=t[4],c+=i*q,f+=i*D,u+=i*U,d+=i*B,l+=i*z,p+=i*j,g+=i*F,b+=i*K,m+=i*H,y+=i*V,v+=i*W,w+=i*G,_+=i*Y,A+=i*J,S+=i*$,E+=i*Q,i=t[5],f+=i*q,u+=i*D,d+=i*U,l+=i*B,p+=i*z,g+=i*j,b+=i*F,m+=i*K,y+=i*H,v+=i*V,w+=i*W,_+=i*G,A+=i*Y,S+=i*J,E+=i*$,M+=i*Q,i=t[6],u+=i*q,d+=i*D,l+=i*U,p+=i*B,g+=i*z,b+=i*j,m+=i*F,y+=i*K,v+=i*H,w+=i*V,_+=i*W,A+=i*G,S+=i*Y,E+=i*J,M+=i*$,I+=i*Q,i=t[7],d+=i*q,l+=i*D,p+=i*U,g+=i*B,b+=i*z,m+=i*j,y+=i*F,v+=i*K,w+=i*H,_+=i*V,A+=i*W,S+=i*G,E+=i*Y,M+=i*J,I+=i*$,x+=i*Q,i=t[8],l+=i*q,p+=i*D,g+=i*U,b+=i*B,m+=i*z,y+=i*j,v+=i*F,w+=i*K,_+=i*H,A+=i*V,S+=i*W,E+=i*G,M+=i*Y,I+=i*J,x+=i*$,O+=i*Q,i=t[9],p+=i*q,g+=i*D,b+=i*U,m+=i*B,y+=i*z,v+=i*j,w+=i*F,_+=i*K,A+=i*H,S+=i*V,E+=i*W,M+=i*G,I+=i*Y,x+=i*J,O+=i*$,N+=i*Q,i=t[10],g+=i*q,b+=i*D,m+=i*U,y+=i*B,v+=i*z,w+=i*j,_+=i*F,A+=i*K,S+=i*H,E+=i*V,M+=i*W,I+=i*G,x+=i*Y,O+=i*J,N+=i*$,P+=i*Q,i=t[11],b+=i*q,m+=i*D,y+=i*U,v+=i*B,w+=i*z,_+=i*j,A+=i*F,S+=i*K,E+=i*H,M+=i*V,I+=i*W,x+=i*G,O+=i*Y,N+=i*J,P+=i*$,R+=i*Q,i=t[12],m+=i*q,y+=i*D,v+=i*U,w+=i*B,_+=i*z,A+=i*j,S+=i*F,E+=i*K,M+=i*H,I+=i*V,x+=i*W,O+=i*G,N+=i*Y,P+=i*J,R+=i*$,T+=i*Q,i=t[13],y+=i*q,v+=i*D,w+=i*U,_+=i*B,A+=i*z,S+=i*j,E+=i*F,M+=i*K,I+=i*H,x+=i*V,O+=i*W,N+=i*G,P+=i*Y,R+=i*J,T+=i*$,C+=i*Q,i=t[14],v+=i*q,w+=i*D,_+=i*U,A+=i*B,S+=i*z,E+=i*j,M+=i*F,I+=i*K,x+=i*H,O+=i*V,N+=i*W,P+=i*G,R+=i*Y,T+=i*J,C+=i*$,k+=i*Q,i=t[15],w+=i*q,_+=i*D,A+=i*U,S+=i*B,E+=i*z,M+=i*j,I+=i*F,x+=i*K,O+=i*H,N+=i*V,P+=i*W,R+=i*G,T+=i*Y,C+=i*J,k+=i*$,L+=i*Q,s+=38*_,o+=38*A,a+=38*S,h+=38*E,c+=38*M,f+=38*I,u+=38*x,d+=38*O,l+=38*N,p+=38*P,g+=38*R,b+=38*T,m+=38*C,y+=38*k,v+=38*L,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),e[0]=s,e[1]=o,e[2]=a,e[3]=h,e[4]=c,e[5]=f,e[6]=u,e[7]=d,e[8]=l,e[9]=p,e[10]=g,e[11]=b,e[12]=m,e[13]=y,e[14]=v,e[15]=w}function y(e,t){m(e,t,t)}function v(e,t){const r=n(),i=n(),s=n(),o=n(),h=n(),c=n(),f=n(),u=n(),d=n();b(r,e[1],e[0]),b(d,t[1],t[0]),m(r,r,d),g(i,e[0],e[1]),g(d,t[0],t[1]),m(i,i,d),m(s,e[3],t[3]),m(s,s,a),m(o,e[2],t[2]),g(o,o,o),b(h,i,r),b(c,o,s),g(f,o,s),g(u,i,r),m(e[0],h,c),m(e[1],u,f),m(e[2],f,c),m(e[3],h,u)}function w(e,t,r){for(let i=0;i<4;i++)d(e[i],t[i],r)}function _(e,t){const r=n(),i=n(),s=n();(function(e,t){const r=n();let i;for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)y(r,r),2!==i&&4!==i&&m(r,r,t);for(i=0;i<16;i++)e[i]=r[i]})(s,t[2]),m(r,t[0],s),m(i,t[1],s),l(e,i),e[31]^=p(r)<<7}function A(e,t){const r=[n(),n(),n(),n()];f(r[0],h),f(r[1],c),f(r[2],o),m(r[3],h,c),function(e,t,r){f(e[0],s),f(e[1],o),f(e[2],o),f(e[3],s);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;w(e,t,n),v(t,e),v(e,e),w(e,t,n)}}(e,r,t)}t.K=function(e){if(e.length!==t.TP)throw new Error(`ed25519: seed must be ${t.TP} bytes`);const r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const s=new Uint8Array(32),o=[n(),n(),n(),n()];A(o,r),_(s,o);const a=new Uint8Array(64);return a.set(e),a.set(s,32),{publicKey:s,secretKey:a}};const S=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function E(e,t){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n>4)*S[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*S[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function M(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;E(e,t)}t._S=function(e,t){const r=new Float64Array(64),s=[n(),n(),n(),n()],o=(0,i.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;const a=new Uint8Array(64);a.set(o.subarray(32),32);const h=new i.SHA512;h.update(a.subarray(32)),h.update(t);const c=h.digest();h.clean(),M(c),A(s,c),_(a,s),h.reset(),h.update(a.subarray(0,32)),h.update(e.subarray(32)),h.update(t);const f=h.digest();M(f);for(let e=0;e<32;e++)r[e]=c[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=f[e]*o[t];return E(a.subarray(32),r),a}},2670:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},6804:(e,t,r)=>{var i=r(2412),n=r(6228),s=function(){function e(e,t,r,n){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var s=i.hmac(this._hash,r,t);this._hmac=new i.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>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},e.prototype.expand=function(e){for(var t=new Uint8Array(e),r=0;r{Object.defineProperty(t,"__esModule",{value:!0});var i=r(2670),n=r(6452),s=r(6228),o=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,i=65535&t;return r*i+((e>>>16&65535)*i+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},7360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var i=r(6452),n=r(6228);t.DIGEST_LENGTH=16;var s=function(){function e(e){this.digestLength=t.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=e[0]|e[1]<<8;this._r[0]=8191&r;var i=e[2]|e[3]<<8;this._r[1]=8191&(r>>>13|i<<3);var n=e[4]|e[5]<<8;this._r[2]=7939&(i>>>10|n<<6);var s=e[6]|e[7]<<8;this._r[3]=8191&(n>>>7|s<<9);var o=e[8]|e[9]<<8;this._r[4]=255&(s>>>4|o<<12),this._r[5]=o>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=8191&(o>>>14|a<<2);var h=e[12]|e[13]<<8;this._r[7]=8065&(a>>>11|h<<5);var c=e[14]|e[15]<<8;this._r[8]=8191&(h>>>8|c<<8),this._r[9]=c>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var i=this._fin?0:2048,n=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],h=this._h[4],c=this._h[5],f=this._h[6],u=this._h[7],d=this._h[8],l=this._h[9],p=this._r[0],g=this._r[1],b=this._r[2],m=this._r[3],y=this._r[4],v=this._r[5],w=this._r[6],_=this._r[7],A=this._r[8],S=this._r[9];r>=16;){var E=e[t+0]|e[t+1]<<8;n+=8191&E;var M=e[t+2]|e[t+3]<<8;s+=8191&(E>>>13|M<<3);var I=e[t+4]|e[t+5]<<8;o+=8191&(M>>>10|I<<6);var x=e[t+6]|e[t+7]<<8;a+=8191&(I>>>7|x<<9);var O=e[t+8]|e[t+9]<<8;h+=8191&(x>>>4|O<<12),c+=O>>>1&8191;var N=e[t+10]|e[t+11]<<8;f+=8191&(O>>>14|N<<2);var P=e[t+12]|e[t+13]<<8;u+=8191&(N>>>11|P<<5);var R=e[t+14]|e[t+15]<<8,T=0,C=T;C+=n*p,C+=s*(5*S),C+=o*(5*A),C+=a*(5*_),T=(C+=h*(5*w))>>>13,C&=8191,C+=c*(5*v),C+=f*(5*y),C+=u*(5*m),C+=(d+=8191&(P>>>8|R<<8))*(5*b);var k=T+=(C+=(l+=R>>>5|i)*(5*g))>>>13;k+=n*g,k+=s*p,k+=o*(5*S),k+=a*(5*A),T=(k+=h*(5*_))>>>13,k&=8191,k+=c*(5*w),k+=f*(5*v),k+=u*(5*y),k+=d*(5*m),T+=(k+=l*(5*b))>>>13,k&=8191;var L=T;L+=n*b,L+=s*g,L+=o*p,L+=a*(5*S),T=(L+=h*(5*A))>>>13,L&=8191,L+=c*(5*_),L+=f*(5*w),L+=u*(5*v),L+=d*(5*y);var q=T+=(L+=l*(5*m))>>>13;q+=n*m,q+=s*b,q+=o*g,q+=a*p,T=(q+=h*(5*S))>>>13,q&=8191,q+=c*(5*A),q+=f*(5*_),q+=u*(5*w),q+=d*(5*v);var D=T+=(q+=l*(5*y))>>>13;D+=n*y,D+=s*m,D+=o*b,D+=a*g,T=(D+=h*p)>>>13,D&=8191,D+=c*(5*S),D+=f*(5*A),D+=u*(5*_),D+=d*(5*w);var U=T+=(D+=l*(5*v))>>>13;U+=n*v,U+=s*y,U+=o*m,U+=a*b,T=(U+=h*g)>>>13,U&=8191,U+=c*p,U+=f*(5*S),U+=u*(5*A),U+=d*(5*_);var B=T+=(U+=l*(5*w))>>>13;B+=n*w,B+=s*v,B+=o*y,B+=a*m,T=(B+=h*b)>>>13,B&=8191,B+=c*g,B+=f*p,B+=u*(5*S),B+=d*(5*A);var z=T+=(B+=l*(5*_))>>>13;z+=n*_,z+=s*w,z+=o*v,z+=a*y,T=(z+=h*m)>>>13,z&=8191,z+=c*b,z+=f*g,z+=u*p,z+=d*(5*S);var j=T+=(z+=l*(5*A))>>>13;j+=n*A,j+=s*_,j+=o*w,j+=a*v,T=(j+=h*y)>>>13,j&=8191,j+=c*m,j+=f*b,j+=u*g,j+=d*p;var F=T+=(j+=l*(5*S))>>>13;F+=n*S,F+=s*A,F+=o*_,F+=a*w,T=(F+=h*v)>>>13,F&=8191,F+=c*y,F+=f*m,F+=u*b,F+=d*g,n=C=8191&(T=(T=((T+=(F+=l*p)>>>13)<<2)+T|0)+(C&=8191)|0),s=k+=T>>>=13,o=L&=8191,a=q&=8191,h=D&=8191,c=U&=8191,f=B&=8191,u=z&=8191,d=j&=8191,l=F&=8191,t+=16,r-=16}this._h[0]=n,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=h,this._h[5]=c,this._h[6]=f,this._h[7]=u,this._h[8]=d,this._h[9]=l},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,i,n,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=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,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^r)-1,s=0;s<10;s++)o[s]&=i;for(i=~i,s=0;s<10;s++)this._h[s]=this._h[s]&i|o[s];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),n=this._h[0]+this._pad[0],this._h[0]=65535&n,s=1;s<8;s++)n=(this._h[s]+this._pad[s]|0)+(n>>>16)|0,this._h[s]=65535&n;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,i=e.length;if(this._leftover){(t=16-this._leftover)>i&&(t=i);for(var n=0;n=16&&(t=i-i%16,this._blocks(e,r,t),r+=t,i-=t),i){for(n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const i=r(5492),n=r(972),s=r(6228);function o(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new i.SystemRandomSource,t.randomBytes=o,t.randomUint32=function(e=t.defaultRandomSource){const r=o(4,e),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function h(e,r=a,i=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let n="";const h=r.length,c=256-256%h;for(;e>0;){const t=o(Math.ceil(256*e/c),i);for(let i=0;i0;i++){const s=t[i];s{Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0,t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const i=r(6228);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(9432);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const i=r(7029),n=r(5821);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new n.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},204:(e,t,r)=>{var i=r(972),n=r(6228);t.On=32,t.cS=64;var s=function(){function e(){this.digestLength=t.On,this.blockSize=t.cS,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 e.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},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,n=t/536870912|0,s=t<<3,o=t%64<56?64:128;this._buffer[r]=128;for(var h=r+1;h0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.aD=s;var o=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(e,t,r,n,s){for(;s>=64;){for(var a=t[0],h=t[1],c=t[2],f=t[3],u=t[4],d=t[5],l=t[6],p=t[7],g=0;g<16;g++){var b=n+4*g;e[g]=i.readUint32BE(r,b)}for(g=16;g<64;g++){var m=e[g-2],y=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,v=((m=e[g-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;e[g]=(y+e[g-7]|0)+(v+e[g-16]|0)}for(g=0;g<64;g++)y=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&d^~u&l)|0)+(p+(o[g]+e[g]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&h^a&c^h&c)|0,p=l,l=d,d=u,u=f+y|0,f=c,c=h,h=a,a=y+v|0;t[0]+=a,t[1]+=h,t[2]+=c,t[3]+=f,t[4]+=u,t[5]+=d,t[6]+=l,t[7]+=p,n+=64,s-=64}return n}t.tW=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},4974:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var i=r(972),n=r(6228);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var s=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[i++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(i=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[i++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,n=t/536870912|0,s=t<<3,o=t%128<112?128:256;this._buffer[r]=128;for(var h=r+1;h0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.stateHi),n.wipe(e.stateLo),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=s;var o=new Int32Array([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 a(e,t,r,n,s,a,h){for(var c,f,u,d,l,p,g,b,m=r[0],y=r[1],v=r[2],w=r[3],_=r[4],A=r[5],S=r[6],E=r[7],M=n[0],I=n[1],x=n[2],O=n[3],N=n[4],P=n[5],R=n[6],T=n[7];h>=128;){for(var C=0;C<16;C++){var k=8*C+a;e[C]=i.readUint32BE(s,k),t[C]=i.readUint32BE(s,k+4)}for(C=0;C<80;C++){var L,q,D=m,U=y,B=v,z=w,j=_,F=A,K=S,H=M,V=I,W=x,G=O,Y=N,J=P,$=R;if(l=65535&(f=T),p=f>>>16,g=65535&(c=E),b=c>>>16,l+=65535&(f=(N>>>14|_<<18)^(N>>>18|_<<14)^(_>>>9|N<<23)),p+=f>>>16,g+=65535&(c=(_>>>14|N<<18)^(_>>>18|N<<14)^(N>>>9|_<<23)),b+=c>>>16,l+=65535&(f=N&P^~N&R),p+=f>>>16,g+=65535&(c=_&A^~_&S),b+=c>>>16,c=o[2*C],l+=65535&(f=o[2*C+1]),p+=f>>>16,g+=65535&c,b+=c>>>16,c=e[C%16],p+=(f=t[C%16])>>>16,g+=65535&c,b+=c>>>16,g+=(p+=(l+=65535&f)>>>16)>>>16,l=65535&(f=d=65535&l|p<<16),p=f>>>16,g=65535&(c=u=65535&g|(b+=g>>>16)<<16),b=c>>>16,l+=65535&(f=(M>>>28|m<<4)^(m>>>2|M<<30)^(m>>>7|M<<25)),p+=f>>>16,g+=65535&(c=(m>>>28|M<<4)^(M>>>2|m<<30)^(M>>>7|m<<25)),b+=c>>>16,p+=(f=M&I^M&x^I&x)>>>16,g+=65535&(c=m&y^m&v^y&v),b+=c>>>16,L=65535&(g+=(p+=(l+=65535&f)>>>16)>>>16)|(b+=g>>>16)<<16,q=65535&l|p<<16,l=65535&(f=G),p=f>>>16,g=65535&(c=z),b=c>>>16,p+=(f=d)>>>16,g+=65535&(c=u),b+=c>>>16,y=D,v=U,w=B,_=z=65535&(g+=(p+=(l+=65535&f)>>>16)>>>16)|(b+=g>>>16)<<16,A=j,S=F,E=K,m=L,I=H,x=V,O=W,N=G=65535&l|p<<16,P=Y,R=J,T=$,M=q,C%16==15)for(k=0;k<16;k++)c=e[k],l=65535&(f=t[k]),p=f>>>16,g=65535&c,b=c>>>16,c=e[(k+9)%16],l+=65535&(f=t[(k+9)%16]),p+=f>>>16,g+=65535&c,b+=c>>>16,u=e[(k+1)%16],l+=65535&(f=((d=t[(k+1)%16])>>>1|u<<31)^(d>>>8|u<<24)^(d>>>7|u<<25)),p+=f>>>16,g+=65535&(c=(u>>>1|d<<31)^(u>>>8|d<<24)^u>>>7),b+=c>>>16,u=e[(k+14)%16],p+=(f=((d=t[(k+14)%16])>>>19|u<<13)^(u>>>29|d<<3)^(d>>>6|u<<26))>>>16,g+=65535&(c=(u>>>19|d<<13)^(d>>>29|u<<3)^u>>>6),b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,e[k]=65535&g|b<<16,t[k]=65535&l|p<<16}l=65535&(f=M),p=f>>>16,g=65535&(c=m),b=c>>>16,c=r[0],p+=(f=n[0])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[0]=m=65535&g|b<<16,n[0]=M=65535&l|p<<16,l=65535&(f=I),p=f>>>16,g=65535&(c=y),b=c>>>16,c=r[1],p+=(f=n[1])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[1]=y=65535&g|b<<16,n[1]=I=65535&l|p<<16,l=65535&(f=x),p=f>>>16,g=65535&(c=v),b=c>>>16,c=r[2],p+=(f=n[2])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[2]=v=65535&g|b<<16,n[2]=x=65535&l|p<<16,l=65535&(f=O),p=f>>>16,g=65535&(c=w),b=c>>>16,c=r[3],p+=(f=n[3])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[3]=w=65535&g|b<<16,n[3]=O=65535&l|p<<16,l=65535&(f=N),p=f>>>16,g=65535&(c=_),b=c>>>16,c=r[4],p+=(f=n[4])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[4]=_=65535&g|b<<16,n[4]=N=65535&l|p<<16,l=65535&(f=P),p=f>>>16,g=65535&(c=A),b=c>>>16,c=r[5],p+=(f=n[5])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[5]=A=65535&g|b<<16,n[5]=P=65535&l|p<<16,l=65535&(f=R),p=f>>>16,g=65535&(c=S),b=c>>>16,c=r[6],p+=(f=n[6])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[6]=S=65535&g|b<<16,n[6]=R=65535&l|p<<16,l=65535&(f=T),p=f>>>16,g=65535&(c=E),b=c>>>16,c=r[7],p+=(f=n[7])>>>16,g+=65535&c,b+=c>>>16,b+=(g+=(p+=(l+=65535&f)>>>16)>>>16)>>>16,r[7]=E=65535&g|b<<16,n[7]=T=65535&l|p<<16,a+=128,h-=128}return a}t.hash=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},6228:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t{t.Tc=t.TZ=t.wE=t.Xx=void 0;const i=r(7052),n=r(6228);function s(e){const t=new Float64Array(16);if(e)for(let r=0;r=0;--e){const t=r[e>>>3]>>>(7&e)&1;c(n,o,t),c(p,g,t),f(b,n,p),u(n,n,p),f(p,o,g),u(o,o,g),l(g,b),l(m,n),d(n,p,n),d(p,o,b),f(b,n,p),u(n,n,p),l(o,n),u(p,g,m),d(n,p,a),f(n,n,g),d(p,p,n),d(n,g,m),d(g,o,i),l(o,b),c(n,o,t),c(p,g,t)}for(let e=0;e<16;e++)i[e+16]=n[e],i[e+32]=p[e],i[e+48]=o[e],i[e+64]=g[e];const y=i.subarray(32),v=i.subarray(16);!function(e,t){const r=s();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)l(r,r),2!==e&&4!==e&&d(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(y,y),d(v,v,y);const w=new Uint8Array(32);return function(e,t){const r=s(),i=s();for(let e=0;e<16;e++)i[e]=t[e];h(i),h(i),h(i);for(let e=0;e<2;e++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,c(i,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}(w,v),w}function g(e){return p(e,o)}t.TZ=function(e){const r=(0,i.randomBytes)(32,e),s=function(e){if(e.length!==t.wE)throw new Error(`x25519: seed must be ${t.wE} bytes`);const r=new Uint8Array(e);return{publicKey:g(r),secretKey:r}}(r);return(0,n.wipe)(r),s},t.Tc=function(e,r,i=!1){if(e.length!==t.Xx)throw new Error("X25519: incorrect secret key length");if(r.length!==t.Xx)throw new Error("X25519: incorrect public key length");const n=p(e,r);if(i){let e=0;for(let t=0;t{function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){const e=i();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=i,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},1089:(e,t)=>{function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=r,t.isNode=i,t.isBrowser=function(){return!r()&&!i()}},5682:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(7173),t),i.__exportStar(r(1089),t)},5665:()=>{},9026:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(9244),t),i.__exportStar(r(1861),t)},9244:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},1861:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},8900:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(9606),t),i.__exportStar(r(9883),t),i.__exportStar(r(2010),t),i.__exportStar(r(9026),t)},2010:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),r(5215).__exportStar(r(3093),t)},3093:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0,t.IWatch=class{}},221:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;const i=r(9026);t.toMiliseconds=function(e){return e*i.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/i.ONE_THOUSAND)}},2985:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t(!0)}),e)}))}},9606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(2985),t),i.__exportStar(r(221),t)},9883:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if(void 0!==t.elapsed)throw new Error(`Watch already stopped for label: ${e}`);const r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){const t=this.timestamps.get(e);if(void 0===t)throw new Error(`No timestamp found for label: ${e}`);return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},8196:(e,t)=>{function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){const t=r(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},2063:(e,t,r)=>{t.g=void 0;const i=r(8196);t.g=function(){let e,t;try{e=i.getDocumentOrThrow(),t=i.getLocationOrThrow()}catch(e){return null}function r(...t){const r=e.getElementsByTagName("meta");for(let e=0;ei.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(n.length&&n){const e=i.getAttribute("content");if(e)return e}}return""}const n=function(){let t=r("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}(),s=r("description","og:description","twitter:description","keywords"),o=t.origin,a=function(){const r=e.getElementsByTagName("link"),i=[];for(let e=0;e-1){const e=n.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{const i=t.pathname.split("/");i.pop(),r+=i.join("/")+"/"+e}i.push(r)}else if(0===e.indexOf("//")){const r=t.protocol+e;i.push(r)}else i.push(e)}}return i}();return{description:s,url:o,icons:a,name:n}}},9404:function(e,t,r){!function(e,t){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function h(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=h(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var c=1;c>>26,u=67108863&h,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;f+=(o=(n=0|e.words[p])*(s=0|t.words[l])+u)/67108864|0,u=67108863&o}r.words[c]=0|u,h=0|f}return 0!==h?r.words[c]=0|h:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?f[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=u[e],l=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?g+r:f[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===t,c=new e(s),f=this.clone();if(h){for(a=0;!f.isZero();a++)o=f.andln(255),f.iushrn(8),c[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,l=0|o[1],p=8191&l,g=l>>>13,b=0|o[2],m=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,A=0|o[4],S=8191&A,E=A>>>13,M=0|o[5],I=8191&M,x=M>>>13,O=0|o[6],N=8191&O,P=O>>>13,R=0|o[7],T=8191&R,C=R>>>13,k=0|o[8],L=8191&k,q=k>>>13,D=0|o[9],U=8191&D,B=D>>>13,z=0|a[0],j=8191&z,F=z>>>13,K=0|a[1],H=8191&K,V=K>>>13,W=0|a[2],G=8191&W,Y=W>>>13,J=0|a[3],$=8191&J,Q=J>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],he=8191&ae,ce=ae>>>13,fe=0|a[8],ue=8191&fe,de=fe>>>13,le=0|a[9],pe=8191&le,ge=le>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(i=Math.imul(u,j))|0)+((8191&(n=(n=Math.imul(u,F))+Math.imul(d,j)|0))<<13)|0;c=((s=Math.imul(d,F))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,F))+Math.imul(g,j)|0,s=Math.imul(g,F);var me=(c+(i=i+Math.imul(u,H)|0)|0)+((8191&(n=(n=n+Math.imul(u,V)|0)+Math.imul(d,H)|0))<<13)|0;c=((s=s+Math.imul(d,V)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,j),n=(n=Math.imul(m,F))+Math.imul(y,j)|0,s=Math.imul(y,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,V)|0;var ye=(c+(i=i+Math.imul(u,G)|0)|0)+((8191&(n=(n=n+Math.imul(u,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,F))+Math.imul(_,j)|0,s=Math.imul(_,F),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,V)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,Y)|0;var ve=(c+(i=i+Math.imul(u,$)|0)|0)+((8191&(n=(n=n+Math.imul(u,Q)|0)+Math.imul(d,$)|0))<<13)|0;c=((s=s+Math.imul(d,Q)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,j),n=(n=Math.imul(S,F))+Math.imul(E,j)|0,s=Math.imul(E,F),i=i+Math.imul(w,H)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,Q)|0;var we=(c+(i=i+Math.imul(u,Z)|0)|0)+((8191&(n=(n=n+Math.imul(u,ee)|0)+Math.imul(d,Z)|0))<<13)|0;c=((s=s+Math.imul(d,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,j),n=(n=Math.imul(I,F))+Math.imul(x,j)|0,s=Math.imul(x,F),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,s=s+Math.imul(E,V)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,Q)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,ee)|0;var _e=(c+(i=i+Math.imul(u,re)|0)|0)+((8191&(n=(n=n+Math.imul(u,ie)|0)+Math.imul(d,re)|0))<<13)|0;c=((s=s+Math.imul(d,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(N,j),n=(n=Math.imul(N,F))+Math.imul(P,j)|0,s=Math.imul(P,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,Y)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,Q)|0,i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(y,Z)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(g,re)|0,s=s+Math.imul(g,ie)|0;var Ae=(c+(i=i+Math.imul(u,se)|0)|0)+((8191&(n=(n=n+Math.imul(u,oe)|0)+Math.imul(d,se)|0))<<13)|0;c=((s=s+Math.imul(d,oe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,F))+Math.imul(C,j)|0,s=Math.imul(C,F),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(P,H)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,Y)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,Q)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,oe)|0;var Se=(c+(i=i+Math.imul(u,he)|0)|0)+((8191&(n=(n=n+Math.imul(u,ce)|0)+Math.imul(d,he)|0))<<13)|0;c=((s=s+Math.imul(d,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(L,j),n=(n=Math.imul(L,F))+Math.imul(q,j)|0,s=Math.imul(q,F),i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(C,H)|0,s=s+Math.imul(C,V)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(P,G)|0,s=s+Math.imul(P,Y)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,Q)|0,i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,Z)|0,s=s+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(m,se)|0,n=(n=n+Math.imul(m,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,he)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(g,he)|0,s=s+Math.imul(g,ce)|0;var Ee=(c+(i=i+Math.imul(u,ue)|0)|0)+((8191&(n=(n=n+Math.imul(u,de)|0)+Math.imul(d,ue)|0))<<13)|0;c=((s=s+Math.imul(d,de)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(U,j),n=(n=Math.imul(U,F))+Math.imul(B,j)|0,s=Math.imul(B,F),i=i+Math.imul(L,H)|0,n=(n=n+Math.imul(L,V)|0)+Math.imul(q,H)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(C,G)|0,s=s+Math.imul(C,Y)|0,i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,Q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,s=s+Math.imul(E,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(m,he)|0,n=(n=n+Math.imul(m,ce)|0)+Math.imul(y,he)|0,s=s+Math.imul(y,ce)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(g,ue)|0,s=s+Math.imul(g,de)|0;var Me=(c+(i=i+Math.imul(u,pe)|0)|0)+((8191&(n=(n=n+Math.imul(u,ge)|0)+Math.imul(d,pe)|0))<<13)|0;c=((s=s+Math.imul(d,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(U,H),n=(n=Math.imul(U,V))+Math.imul(B,H)|0,s=Math.imul(B,V),i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(q,G)|0,s=s+Math.imul(q,Y)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Q)|0)+Math.imul(C,$)|0,s=s+Math.imul(C,Q)|0,i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(x,re)|0,s=s+Math.imul(x,ie)|0,i=i+Math.imul(S,se)|0,n=(n=n+Math.imul(S,oe)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,oe)|0,i=i+Math.imul(w,he)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,he)|0,s=s+Math.imul(_,ce)|0,i=i+Math.imul(m,ue)|0,n=(n=n+Math.imul(m,de)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,de)|0;var Ie=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((s=s+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Y))+Math.imul(B,G)|0,s=Math.imul(B,Y),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(q,$)|0,s=s+Math.imul(q,Q)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(C,Z)|0,s=s+Math.imul(C,ee)|0,i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,oe)|0,i=i+Math.imul(S,he)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,he)|0,s=s+Math.imul(E,ce)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,de)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,de)|0;var xe=(c+(i=i+Math.imul(m,pe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ge)|0)+Math.imul(y,pe)|0))<<13)|0;c=((s=s+Math.imul(y,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Q))+Math.imul(B,$)|0,s=Math.imul(B,Q),i=i+Math.imul(L,Z)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(q,Z)|0,s=s+Math.imul(q,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(C,re)|0,s=s+Math.imul(C,ie)|0,i=i+Math.imul(N,se)|0,n=(n=n+Math.imul(N,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(I,he)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(x,he)|0,s=s+Math.imul(x,ce)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,de)|0)+Math.imul(E,ue)|0,s=s+Math.imul(E,de)|0;var Oe=(c+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,ge)|0)+Math.imul(_,pe)|0))<<13)|0;c=((s=s+Math.imul(_,ge)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(U,Z),n=(n=Math.imul(U,ee))+Math.imul(B,Z)|0,s=Math.imul(B,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(q,re)|0,s=s+Math.imul(q,ie)|0,i=i+Math.imul(T,se)|0,n=(n=n+Math.imul(T,oe)|0)+Math.imul(C,se)|0,s=s+Math.imul(C,oe)|0,i=i+Math.imul(N,he)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(P,he)|0,s=s+Math.imul(P,ce)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,de)|0)+Math.imul(x,ue)|0,s=s+Math.imul(x,de)|0;var Ne=(c+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,ge)|0)+Math.imul(E,pe)|0))<<13)|0;c=((s=s+Math.imul(E,ge)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,i=Math.imul(U,re),n=(n=Math.imul(U,ie))+Math.imul(B,re)|0,s=Math.imul(B,ie),i=i+Math.imul(L,se)|0,n=(n=n+Math.imul(L,oe)|0)+Math.imul(q,se)|0,s=s+Math.imul(q,oe)|0,i=i+Math.imul(T,he)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(C,he)|0,s=s+Math.imul(C,ce)|0,i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,de)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,de)|0;var Pe=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(x,pe)|0))<<13)|0;c=((s=s+Math.imul(x,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(U,se),n=(n=Math.imul(U,oe))+Math.imul(B,se)|0,s=Math.imul(B,oe),i=i+Math.imul(L,he)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(q,he)|0,s=s+Math.imul(q,ce)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,de)|0)+Math.imul(C,ue)|0,s=s+Math.imul(C,de)|0;var Re=(c+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,ge)|0)+Math.imul(P,pe)|0))<<13)|0;c=((s=s+Math.imul(P,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(U,he),n=(n=Math.imul(U,ce))+Math.imul(B,he)|0,s=Math.imul(B,ce),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,de)|0)+Math.imul(q,ue)|0,s=s+Math.imul(q,de)|0;var Te=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ge)|0)+Math.imul(C,pe)|0))<<13)|0;c=((s=s+Math.imul(C,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(U,ue),n=(n=Math.imul(U,de))+Math.imul(B,ue)|0,s=Math.imul(B,de);var Ce=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ge)|0)+Math.imul(q,pe)|0))<<13)|0;c=((s=s+Math.imul(q,ge)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var ke=(c+(i=Math.imul(U,pe))|0)+((8191&(n=(n=Math.imul(U,ge))+Math.imul(B,pe)|0))<<13)|0;return c=((s=Math.imul(B,ge))+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,h[0]=be,h[1]=me,h[2]=ye,h[3]=ve,h[4]=we,h[5]=_e,h[6]=Ae,h[7]=Se,h[8]=Ee,h[9]=Me,h[10]=Ie,h[11]=xe,h[12]=Oe,h[13]=Ne,h[14]=Pe,h[15]=Re,h[16]=Te,h[17]=Ce,h[18]=ke,0!==c&&(h[19]=c,r.length++),r};function g(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=l),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):i<63?l(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):g(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},b.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,c=0;c=0&&(0!==f||c>=n);c--){var u=0|this.words[c];this.words[c]=f<<26-s|u>>>s,f=u&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(h/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==t){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var c=0;c=0;u--){var d=67108864*(0|i.words[n.length+u])+(0|i.words[n.length+u-1]);for(d=Math.min(d/o|0,67108863),i._ishlnsubmul(n,d,u);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,u),i.isZero()||(i.negative^=1);a&&(a.words[u]=d)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),u=t.clone();!t.isZero();){for(var d=0,l=1;!(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(u)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(u)),a.iushrn(1),h.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(h)):(r.isub(t),a.isub(n),h.isub(o))}return{a,b:h,gcd:r.iushln(c)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),h=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;!(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var u=0,d=1;!(r.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new S(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}y.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(v,y),v.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return m[e]=t,t},S.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){i(!(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);0!==this.pow(f,c).cmp(h);)f.redIAdd(h);for(var u=this.pow(f,n),d=this.pow(e,n.addn(1).iushrn(1)),l=this.pow(e,n),p=o;0!==l.cmp(a);){for(var g=l,b=0;0!==g.cmp(a);b++)g=g.redSqr();i(b=0;i--){for(var c=t.words[i],f=h-1;f>=0;f--){var u=c>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4==++a||0===i&&0===f)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}h=26}return n},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,S),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5037:(e,t,r)=>{var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r{var t="%[a-f0-9]{2}",r=new RegExp("("+t+")|([^%]+?)","gi"),i=new RegExp("("+t+")+","gi");function n(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],n(r),n(i))}function s(e){try{return decodeURIComponent(e)}catch(s){for(var t=e.match(r)||[],i=1;i{var i=t;i.version=r(1636).rE,i.utils=r(7011),i.rand=r(5037),i.curve=r(894),i.curves=r(480),i.ec=r(7447),i.eddsa=r(8650)},6677:(e,t,r)=>{var i=r(9404),n=r(7011),s=n.getNAF,o=n.getJSF,a=n.assert;function h(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),i=s(t,1,this._bitLength),n=(1<=o;f--)h=(h<<1)+i[f];c.push(h)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o=0;c--){for(var f=0;c>=0&&0===o[c];c--)f++;if(c>=0&&f++,h=h.dblp(f),c<0)break;var u=o[c];a(0!==u),h="affine"===e.type?u>0?h.mixedAdd(n[u-1>>1]):h.mixedAdd(n[-u-1>>1].neg()):u>0?h.add(n[u-1>>1]):h.add(n[-u-1>>1].neg())}return"affine"===e.type?h.toP():h},h.prototype._wnafMulAdd=function(e,t,r,i,n){var a,h,c,f=this._wnafT1,u=this._wnafT2,d=this._wnafT3,l=0;for(a=0;a=1;a-=2){var g=a-1,b=a;if(1===f[g]&&1===f[b]){var m=[t[g],null,null,t[b]];0===t[g].y.cmp(t[b].y)?(m[1]=t[g].add(t[b]),m[2]=t[g].toJ().mixedAdd(t[b].neg())):0===t[g].y.cmp(t[b].y.redNeg())?(m[1]=t[g].toJ().mixedAdd(t[b]),m[2]=t[g].add(t[b].neg())):(m[1]=t[g].toJ().mixedAdd(t[b]),m[2]=t[g].toJ().mixedAdd(t[b].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[g],r[b]);for(l=Math.max(v[0].length,l),d[g]=new Array(l),d[b]=new Array(l),h=0;h=0;a--){for(var E=0;a>=0;){var M=!0;for(h=0;h=0&&E++,A=A.dblp(E),a<0)break;for(h=0;h0?c=u[h][I-1>>1]:I<0&&(c=u[h][-I-1>>1].neg()),A="affine"===c.type?A.mixedAdd(c):A.add(c))}}for(a=0;a=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n{var i=r(7011),n=r(9404),s=r(6698),o=r(6677),a=i.assert;function h(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.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|e.c)}function c(e,t,r,i,s){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(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 n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,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()))))}s(h,o),e.exports=h,h.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},h.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},h.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},h.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(t&&!h||!t&&h)&&(a=a.redNeg()),this.point(e,a)},h.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},h.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},s(c,o.BasePoint),h.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},h.prototype.point=function(e,t,r,i){return new c(this,e,t,r,i)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},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 e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=i.redAdd(t),o=s.redSub(r),a=i.redSub(t),h=n.redMul(o),c=s.redMul(a),f=n.redMul(a),u=o.redMul(s);return this.curve.point(h,c,u,f)},c.prototype._projDbl=function(){var e,t,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),h=this.y.redSqr();if(this.curve.twisted){var c=(i=this.curve._mulA(a)).redAdd(h);this.zOne?(e=o.redSub(a).redSub(h).redMul(c.redSub(this.curve.two)),t=c.redMul(i.redSub(h)),r=c.redSqr().redSub(c).redSub(c)):(n=this.z.redSqr(),s=c.redSub(n).redISub(n),e=o.redSub(a).redISub(h).redMul(s),t=c.redMul(i.redSub(h)),r=c.redMul(s))}else i=a.redAdd(h),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(i)).redMul(s),t=this.curve._mulC(i).redMul(a.redISub(h)),r=i.redMul(s);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),s=r.redSub(t),o=n.redSub(i),a=n.redAdd(i),h=r.redAdd(t),c=s.redMul(o),f=a.redMul(h),u=s.redMul(h),d=o.redMul(a);return this.curve.point(c,f,d,u)},c.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(o),h=n.redSub(a),c=n.redAdd(a),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),u=i.redMul(h).redMul(f);return this.curve.twisted?(t=i.redMul(c).redMul(o.redSub(this.curve._mulA(s))),r=h.redMul(c)):(t=i.redMul(c).redMul(o.redSub(s)),r=this.curve._mulC(h).redMul(c)),this.curve.point(u,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},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(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},894:(e,t,r)=>{var i=t;i.base=r(6677),i.short=r(9188),i.mont=r(370),i.edwards=r(1298)},370:(e,t,r)=>{var i=r(9404),n=r(6698),s=r(6677),o=r(7011);function a(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},n(h,s.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new h(this,e,t)},a.prototype.pointFromJSON=function(e){return h.fromJSON(this,e)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(e,t){return new h(e,t[0],t[1]||e.one)},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(r),o=n.redMul(i),a=t.z.redMul(s.redAdd(o).redSqr()),h=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},9188:(e,t,r)=>{var i=r(7011),n=r(9404),s=r(6698),o=r(6677),a=i.assert;function h(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(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 f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(h,o),e.exports=h,h.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),s=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},h.prototype._getEndoBasis=function(e){for(var t,r,i,s,o,a,h,c,f,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,l=this.n.clone(),p=new n(1),g=new n(0),b=new n(0),m=new n(1),y=0;0!==d.cmpn(0);){var v=l.div(d);c=l.sub(v.mul(d)),f=b.sub(v.mul(p));var w=m.sub(v.mul(g));if(!i&&c.cmp(u)<0)t=h.neg(),r=p,i=c.neg(),s=f;else if(i&&2==++y)break;h=c,l=d,d=c,b=p,p=f,m=g,g=w}o=c.neg(),a=f;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=t,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},h.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),h=n.mul(r.b),c=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:h.add(c).neg()}},h.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},h.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(f,o.BasePoint),h.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),f=c.redMul(a),u=i.redMul(c),d=h.redSqr().redIAdd(f).redISub(u).redISub(u),l=h.redMul(u.redISub(d)).redISub(s.redMul(f)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,l,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),c=h.redMul(o),f=r.redMul(h),u=a.redSqr().redIAdd(c).redISub(f).redISub(f),d=a.redMul(f.redISub(u)).redISub(n.redMul(c)),l=this.z.redMul(o);return this.curve.jpoint(u,d,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},480:(e,t,r)=>{var i,n=t,s=r(7952),o=r(894),a=r(7011).assert;function h(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new h(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,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:s.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:s.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:s.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:s.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:s.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:s.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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(4011)}catch(e){i=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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},7447:(e,t,r)=>{var i=r(9404),n=r(2723),s=r(7011),o=r(480),a=r(5037),h=s.assert,c=r(1200),f=r(8545);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(h(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=u,u.prototype.keyPair=function(e){return new c(this,e)},u.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),h=e.toArray("be",o),c=new n({hash:this.hash,entropy:a,nonce:h,pers:s.pers,persEnc:s.persEnc||"utf8"}),u=this.n.sub(new i(1)),d=0;;d++){var l=s.k?s.k(d):new i(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var g=p.getX(),b=g.umod(this.n);if(0!==b.cmpn(0)){var m=l.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==g.cmp(b)?2:0);return s.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new f({r:b,s:m,recoveryParam:y})}}}}}},u.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var s=(t=new f(t,"hex")).r,o=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,h=o.invm(this.n),c=h.mul(e).umod(this.n),u=h.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},u.prototype.recoverPubKey=function(e,t,r,n){h((3&r)===r,"The recovery param is more than two bits"),t=new f(t,n);var s=this.n,o=new i(e),a=t.r,c=t.s,u=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(s),p=s.sub(o).mul(l).umod(s),g=c.mul(l).umod(s);return this.g.mulAdd(p,a,g)},u.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new f(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(e,t,n)}catch(e){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},1200:(e,t,r)=>{var i=r(9404),n=r(7011).assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=s,s.fromPublic=function(e,t,r){return t instanceof s?t:new s(e,{pub:t,pubEnc:r})},s.fromPrivate=function(e,t,r){return t instanceof s?t:new s(e,{priv:t,privEnc:r})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return""}},8545:(e,t,r)=>{var i=r(9404),n=r(7011),s=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function h(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===e[t.place])return!1;for(var n=0,s=0,o=t.place;s>>=0;return!(n<=127)&&(t.place=o,n)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var s=h(e,r);if(!1===s)return!1;if(s+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=h(e,r);if(!1===o)return!1;if(128&e[r.place])return!1;var c=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var f=h(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;if(128&e[r.place])return!1;var u=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new i(c),this.s=new i(u),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var s=i.concat(r),o=[48];return f(o,s.length),o=o.concat(s),n.encode(o,e)}},8650:(e,t,r)=>{var i=r(7952),n=r(480),s=r(7011),o=s.assert,a=s.parseBytes,h=r(6661),c=r(220);function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}e.exports=f,f.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),h=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:s})},f.prototype.verify=function(e,t,r){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(s)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{var i=r(7011),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(e,t){this.eddsa=e,this._secret=s(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=s(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},e.exports=a},220:(e,t,r)=>{var i=r(9404),n=r(7011),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function h(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(s(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),s(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(h,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(h,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(h,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(h,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=h},4011:e=>{e.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"]]}}},7011:(e,t,r)=>{var i=t,n=r(9404),s=r(3349),o=r(4367);i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(e,t,r){var i,n=new Array(Math.max(e.bitLength(),r)+1);for(i=0;i(s>>1)-1?(s>>1)-h:h,o.isubn(a)):a=0,n[i]=a,o.iushrn(1)}return n},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,s=0;e.cmpn(-n)>0||t.cmpn(-s)>0;){var o,a,h=e.andln(3)+n&3,c=t.andln(3)+s&3;3===h&&(h=-1),3===c&&(c=-1),o=1&h?3!=(i=e.andln(7)+n&7)&&5!==i||2!==c?h:-h:0,r[0].push(o),a=1&c?3!=(i=t.andln(7)+s&7)&&5!==i||2!==h?c:-c:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},7007:e=>{var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,n)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var n,s,o,c;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=h(e))>0&&o.length>n&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){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 u(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=f.bind(i);return n.listener=r,i.wrapFn=n,n}function d(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var c=h.length,f=p(h,c);for(r=0;r=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},s.prototype.listenerCount=l,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3055:e=>{e.exports=function(e,t){for(var r={},i=Object.keys(e),n=Array.isArray(t),s=0;s{var i=t;i.utils=r(7426),i.common=r(6166),i.sha=r(6229),i.ripemd=r(6784),i.hmac=r(8948),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},6166:(e,t,r)=>{var i=r(7426),n=r(3349);function s(){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}t.BlockHash=s,s.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s{var i=r(7426),n=r(3349);function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t{var i=r(7426),n=r(6166),s=i.rotl32,o=i.sum32,a=i.sum32_3,h=i.sum32_4,c=n.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],c=this.h[3],f=this.h[4],y=r,v=i,w=n,_=c,A=f,S=0;S<80;S++){var E=o(s(h(r,u(S,i,n,c),e[p[S]+t],d(S)),b[S]),f);r=f,f=c,c=s(n,10),n=i,i=E,E=o(s(h(y,u(79-S,v,w,_),e[g[S]+t],l(S)),m[S]),A),y=A,A=_,_=s(w,10),w=v,v=E}E=a(this.h[1],n,_),this.h[1]=a(this.h[2],c,A),this.h[2]=a(this.h[3],f,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],i,w),this.h[0]=E},f.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.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],g=[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],b=[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]},6229:(e,t,r)=>{t.sha1=r(3917),t.sha224=r(7714),t.sha256=r(2287),t.sha384=r(1911),t.sha512=r(7766)},3917:(e,t,r)=>{var i=r(7426),n=r(6166),s=r(6225),o=i.rotl32,a=i.sum32,h=i.sum32_5,c=s.ft_1,f=n.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i{var i=r(7426),n=r(2287);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},2287:(e,t,r)=>{var i=r(7426),n=r(6166),s=r(6225),o=r(3349),a=i.sum32,h=i.sum32_4,c=i.sum32_5,f=s.ch32,u=s.maj32,d=s.s0_256,l=s.s1_256,p=s.g0_256,g=s.g1_256,b=n.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 y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(y,b),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i{var i=r(7426),n=r(7766);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},7766:(e,t,r)=>{var i=r(7426),n=r(6166),s=r(3349),o=i.rotr64_hi,a=i.rotr64_lo,h=i.shr64_hi,c=i.shr64_lo,f=i.sum64,u=i.sum64_hi,d=i.sum64_lo,l=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,b=i.sum64_5_lo,m=n.BlockHash,y=[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=y,this.W=new Array(160)}function w(e,t,r,i,n){var s=e&r^~e&n;return s<0&&(s+=4294967296),s}function _(e,t,r,i,n,s){var o=t&i^~t&s;return o<0&&(o+=4294967296),o}function A(e,t,r,i,n){var s=e&r^e&n^r&n;return s<0&&(s+=4294967296),s}function S(e,t,r,i,n,s){var o=t&i^t&s^i&s;return o<0&&(o+=4294967296),o}function E(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function x(e,t){var r=o(e,t,1)^o(e,t,8)^h(e,t,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function N(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i{var i=r(7426).rotr32;function n(e,t,r){return e&t^~e&r}function s(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?o(t,r,i):2===e?s(t,r,i):void 0},t.ch32=n,t.maj32=s,t.p32=o,t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},7426:(e,t,r)=>{var i=r(3349),n=r(6698);function s(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function h(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,r[i++]=63&o|128):s(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],s=i+e[t+1]>>>0,o=(s>>0,e[t+1]=s},t.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,s,o,a){var h=0,c=t;return h+=(c=c+i>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,i,n,s,o,a){return t+i+s+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,s,o,a,h,c){var f=0,u=t;return f+=(u=u+i>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,i,n,s,o,a,h,c){return t+i+s+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2723:(e,t,r)=>{var i=r(7952),n=r(4367),s=r(3349);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),i=n.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}e.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},8142:(e,t,r)=>{e=r.nmd(e);var i="__lodash_hash_undefined__",n=1,s=2,o=9007199254740991,a="[object Arguments]",h="[object Array]",c="[object AsyncFunction]",f="[object Boolean]",u="[object Date]",d="[object Error]",l="[object Function]",p="[object GeneratorFunction]",g="[object Map]",b="[object Number]",m="[object Null]",y="[object Object]",v="[object Promise]",w="[object Proxy]",_="[object RegExp]",A="[object Set]",S="[object String]",E="[object Undefined]",M="[object WeakMap]",I="[object ArrayBuffer]",x="[object DataView]",O=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[a]=P[h]=P[I]=P[f]=P[x]=P[u]=P[d]=P[l]=P[g]=P[b]=P[y]=P[_]=P[A]=P[S]=P[M]=!1;var R="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,C=R||T||Function("return this")(),k=t&&!t.nodeType&&t,L=k&&e&&!e.nodeType&&e,q=L&&L.exports===k,D=q&&R.process,U=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),B=U&&U.isTypedArray;function z(e,t){for(var r=-1,i=null==e?0:e.length;++rc))return!1;var u=a.get(e);if(u&&a.get(t))return u==t;var d=-1,l=!0,p=r&s?new Ie:void 0;for(a.set(e,t),a.set(t,e);++d-1},Ee.prototype.set=function(e,t){var r=this.__data__,i=Oe(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},Me.prototype.clear=function(){this.size=0,this.__data__={hash:new Se,map:new(ue||Ee),string:new Se}},Me.prototype.delete=function(e){var t=ke(this,e).delete(e);return this.size-=t?1:0,t},Me.prototype.get=function(e){return ke(this,e).get(e)},Me.prototype.has=function(e){return ke(this,e).has(e)},Me.prototype.set=function(e,t){var r=ke(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},Ie.prototype.add=Ie.prototype.push=function(e){return this.__data__.set(e,i),this},Ie.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.clear=function(){this.__data__=new Ee,this.size=0},xe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},xe.prototype.get=function(e){return this.__data__.get(e)},xe.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ee){var i=r.__data__;if(!ue||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Me(i)}return r.set(e,t),this.size=r.size,this};var qe=ae?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var i=-1,n=null==t?0:t.length,s=0,o=[];++i-1&&e%1==0&&e-1&&e%1==0&&e<=o}function We(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ge(e){return null!=e&&"object"==typeof e}var Ye=B?function(e){return function(t){return e(t)}}(B):function(e){return Ge(e)&&Ve(e.length)&&!!P[Ne(e)]};function Je(e){return null!=(t=e)&&Ve(t.length)&&!He(t)?function(e,t){var r=Fe(e),i=!r&&je(e),n=!r&&!i&&Ke(e),s=!r&&!i&&!n&&Ye(e),o=r||i||n||s,a=o?function(e,t){for(var r=-1,i=Array(e);++r{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4367:(e,t)=>{var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},6663:(e,t,r)=>{const i=r(4280),n=r(454),s=r(528),o=r(3055),a=Symbol("encodeFragmentIdentifier");function h(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?i(e):encodeURIComponent(e):e}function f(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function l(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function g(e,t){h((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,i)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===i[e]&&(i[e]={}),i[e][t[1]]=r):i[e]=r};case"bracket":return(e,r,i)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==i[e]?i[e]=[].concat(i[e],r):i[e]=[r]:i[e]=r};case"colon-list-separator":return(e,r,i)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==i[e]?i[e]=[].concat(i[e],r):i[e]=[r]:i[e]=r};case"comma":case"separator":return(t,r,i)=>{const n="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!n&&f(r,e).includes(e.arrayFormatSeparator);r=s?f(r,e):r;const o=n||s?r.split(e.arrayFormatSeparator).map((t=>f(t,e))):null===r?r:f(r,e);i[t]=o};case"bracket-separator":return(t,r,i)=>{const n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n)return void(i[t]=r?f(r,e):r);const s=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>f(t,e)));void 0!==i[t]?i[t]=[].concat(i[t],s):i[t]=s};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const n of e.split("&")){if(""===n)continue;let[e,o]=s(t.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:f(o,t),r(f(e,t),o,i)}for(const e of Object.keys(i)){const r=i[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=p(r[e],t);else i[e]=p(r,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const r=i[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}t.extract=l,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";h((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],i=function(e){switch(e.arrayFormat){case"index":return t=>(r,i)=>{const n=r.length;return void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[c(t,e),"[",n,"]"].join("")]:[...r,[c(t,e),"[",c(n,e),"]=",c(i,e)].join("")]};case"bracket":return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[c(t,e),"[]"].join("")]:[...r,[c(t,e),"[]=",c(i,e)].join("")];case"colon-list-separator":return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[c(t,e),":list="].join("")]:[...r,[c(t,e),":list=",c(i,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(i,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:(n=null===n?"":n,0===i.length?[[c(r,e),t,c(n,e)].join("")]:[[i,c(n,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,c(t,e)]:[...r,[c(t,e),"=",c(i,e)].join("")]}}(t),n={};for(const t of Object.keys(e))r(t)||(n[t]=e[t]);const s=Object.keys(n);return!1!==t.sort&&s.sort(t.sort),s.map((r=>{const n=e[r];return void 0===n?"":null===n?c(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?c(r,t)+"[]":n.reduce(i(r),[]).join("&"):c(r,t)+"="+c(n,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,i]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(l(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:f(i,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const i=d(e.url).split("?")[0]||"",n=t.extract(e.url),s=t.parse(n,{sort:!1}),o=Object.assign(s,e.query);let h=t.stringify(o,r);h&&(h=`?${h}`);let f=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(f=`#${r[a]?c(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${i}${h}${f}`},t.pick=(e,r,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[a]:!1},i);const{url:n,query:s,fragmentIdentifier:h}=t.parseUrl(e,i);return t.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:h},i)},t.exclude=(e,r,i)=>{const n=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,n,i)}},793:e=>{function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,i){var n=i&&i.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var o=new Array(s);o[0]=n(e);for(var a=1;a-1?u:0,e.charCodeAt(l+1)){case 100:case 102:if(f>=h)break;if(null==r[f])break;u=h)break;if(null==r[f])break;u=h)break;if(void 0===r[f])break;u",u=l+2,l++;break}c+=n(r[f]),u=l+2,l++;break;case 115:if(f>=h)break;u{e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},4280:e=>{e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},5215:(e,t,r)=>{r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>w,__asyncGenerator:()=>v,__asyncValues:()=>_,__await:()=>y,__awaiter:()=>f,__classPrivateFieldGet:()=>M,__classPrivateFieldSet:()=>I,__createBinding:()=>d,__decorate:()=>a,__exportStar:()=>l,__extends:()=>n,__generator:()=>u,__importDefault:()=>E,__importStar:()=>S,__makeTemplateObject:()=>A,__metadata:()=>c,__param:()=>h,__read:()=>g,__rest:()=>o,__spread:()=>b,__spreadArrays:()=>m,__values:()=>p});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},i(e,t)};function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function h(e,t){return function(r,i){t(r,i,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{h(i.next(e))}catch(e){s(e)}}function a(e){try{h(i.throw(e))}catch(e){s(e)}}function h(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}h((i=i.apply(e,t||[])).next())}))}function u(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function b(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(r=n[e](t)).value instanceof y?Promise.resolve(r.value.v).then(h,c):f(s[0][2],r)}catch(e){f(s[0][3],e)}var r}function h(e){a("next",e)}function c(e){a("throw",e)}function f(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:y(e[i](t)),done:"return"===i}:n?n(t):t}:n}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise((function(i,n){!function(e,t,r,i){Promise.resolve(i).then((function(t){e({value:t,done:r})}),t)}(i,n,(t=e[r](t)).done,t.value)}))}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function M(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},1591:e=>{e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},9432:()=>{},7790:()=>{},3776:()=>{},4874:(e,t,r)=>{const i=r(793);e.exports=o;const n=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},s={mapHttpRequest:d,mapHttpResponse:d,wrapRequestSerializer:l,wrapResponseSerializer:l,wrapErrorSerializer:l,req:d,res:d,err:function(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}};function o(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);const i=e.serializers||{},s=function(e,t){if(Array.isArray(e)){const t=e.filter((function(e){return"!stdSerializers.err"!==e}));return t}return!0===e&&Object.keys(t)}(e.browser.serialize,i);let d=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1),"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===e.enabled&&(e.level="silent");const l=e.level||"info",g=Object.create(r);g.log||(g.log=p),Object.defineProperty(g,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(g,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,a(b,g,"error","log"),a(b,g,"fatal","error"),a(b,g,"warn","error"),a(b,g,"info","log"),a(b,g,"debug","log"),a(b,g,"trace","log")}});const b={transmit:t,serialize:s,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:u(e)};return g.levels=o.levels,g.level=l,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=p,g.serializers=i,g._serialize=s,g._stdErrSerialize=d,g.child=function(r,n){if(!r)throw new Error("missing bindings for child Pino");n=n||{},s&&r.serializers&&(n.serializers=r.serializers);const o=n.serializers;if(s&&o){var a=Object.assign({},i,o),u=!0===e.browser.serialize?Object.keys(a):s;delete r.serializers,h([r],u,a,this._stdErrSerialize)}function d(e){this._childLevel=1+(0|e._childLevel),this.error=c(e,r,"error"),this.fatal=c(e,r,"fatal"),this.warn=c(e,r,"warn"),this.info=c(e,r,"info"),this.debug=c(e,r,"debug"),this.trace=c(e,r,"trace"),a&&(this.serializers=a,this._serialize=u),t&&(this._logEvent=f([].concat(e._logEvent.bindings,r)))}return d.prototype=this,new d(this)},t&&(g._logEvent=f()),g}function a(e,t,r,s){const a=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?p:a[r]?a[r]:n[r]||n[s]||p,function(e,t,r){var s;(e.transmit||t[r]!==p)&&(t[r]=(s=t[r],function(){const a=e.timestamp(),c=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var d=0;d-1&&i in r&&(e[n][i]=r[i](e[n][i]))}function c(e,t,r){return function(){const i=new Array(1+arguments.length);i[0]=t;for(var n=1;n{e.exports={rE:"6.5.7"}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};r.r(i),r.d(i,{identity:()=>ot});var n={};r.r(n),r.d(n,{base2:()=>at});var s={};r.r(s),r.d(s,{base8:()=>ht});var o={};r.r(o),r.d(o,{base10:()=>ct});var a={};r.r(a),r.d(a,{base16:()=>ft,base16upper:()=>ut});var h={};r.r(h),r.d(h,{base32:()=>dt,base32hex:()=>bt,base32hexpad:()=>yt,base32hexpadupper:()=>vt,base32hexupper:()=>mt,base32pad:()=>pt,base32padupper:()=>gt,base32upper:()=>lt,base32z:()=>wt});var c={};r.r(c),r.d(c,{base36:()=>_t,base36upper:()=>At});var f={};r.r(f),r.d(f,{base58btc:()=>St,base58flickr:()=>Et});var u={};r.r(u),r.d(u,{base64:()=>Mt,base64pad:()=>It,base64url:()=>xt,base64urlpad:()=>Ot});var d={};r.r(d),r.d(d,{base256emoji:()=>Tt});var l={};r.r(l),r.d(l,{sha256:()=>er,sha512:()=>tr});var p={};r.r(p),r.d(p,{identity:()=>ir});var g={};r.r(g),r.d(g,{code:()=>sr,decode:()=>ar,encode:()=>or,name:()=>nr});var b={};r.r(b),r.d(b,{code:()=>ur,decode:()=>lr,encode:()=>dr,name:()=>fr});var m=r(7007),y=r.n(m),v=r(8900);class w{}class _ extends w{constructor(e){super()}}const A=v.FIVE_SECONDS,S="heartbeat_pulse";class E extends _{constructor(e){super(e),this.events=new m.EventEmitter,this.interval=A,this.interval=e?.interval||A}static async init(e){const t=new E(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval((()=>this.pulse()),(0,v.toMiliseconds)(this.interval))}pulse(){this.events.emit(S)}}const M=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,I=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,x=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function O(e,t){if(!("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t))return t;!function(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}(e)}function N(e,t={}){if("string"!=typeof e)return e;const r=e.trim();if('"'===e[0]&&'"'===e.at(-1)&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){const e=r.toLowerCase();if("true"===e)return!0;if("false"===e)return!1;if("undefined"===e)return;if("null"===e)return null;if("nan"===e)return Number.NaN;if("infinity"===e)return Number.POSITIVE_INFINITY;if("-infinity"===e)return Number.NEGATIVE_INFINITY}if(!x.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(M.test(e)||I.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,O)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}function P(e,...t){try{return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}var r}function R(e){if(function(e){const t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return R(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function T(){if(void 0===typeof Buffer)throw new TypeError("[unstorage] Buffer is not supported!")}const C="base64:";function k(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function L(...e){return k(e.join(":"))}function q(e){return(e=k(e))?e+":":""}const D=()=>{const e=new Map;return{name:"memory",options:{},hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>Array.from(e.keys()),clear(){e.clear()},dispose(){e.clear()}}};function U(e,t,r){return e.watch?e.watch(((e,i)=>t(e,r+i))):()=>{}}async function B(e){"function"==typeof e.dispose&&await P(e.dispose)}function z(e){return new Promise(((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)}))}function j(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const i=z(r);return(e,r)=>i.then((i=>r(i.transaction(t,e).objectStore(t))))}let F;function K(){return F||(F=j("keyval-store","keyval")),F}function H(e,t=K()){return t("readonly",(t=>z(t.get(e))))}const V=e=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString()+"n":t)),W=e=>{const t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,((e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t))};function G(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return W(e)}catch(t){return e}}function Y(e){return"string"==typeof e?e:V(e)||""}var J=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=e=>t+e;let i;return e.dbName&&e.storeName&&(i=j(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await H(r(e),i)>"u"),getItem:async e=>await H(r(e),i)??null,setItem:(e,t)=>function(e,t,r=K()){return r("readwrite",(r=>(r.put(t,e),z(r.transaction))))}(r(e),t,i),removeItem:e=>function(e,t=K()){return t("readwrite",(t=>(t.delete(e),z(t.transaction))))}(r(e),i),getKeys:()=>function(e=K()){return e("readonly",(e=>{if(e.getAllKeys)return z(e.getAllKeys());const t=[];return function(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},z(e.transaction)}(e,(e=>t.push(e.key))).then((()=>t))}))}(i),clear:()=>function(e=K()){return e("readwrite",(e=>(e.clear(),z(e.transaction))))}(i)}};class ${constructor(){this.indexedDb=function(e={}){const t={mounts:{"":e.driver||D()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(const r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},i=(e,r)=>t.mountpoints.filter((t=>t.startsWith(e)||r&&e.startsWith(t))).map((r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]}))),n=(e,r)=>{if(t.watching){r=k(r);for(const i of t.watchListeners)i(e,r)}},s=async()=>{if(t.watching){for(const e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},o=(e,t,i)=>{const n=new Map,s=e=>{let t=n.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},n.set(e.base,t)),t};for(const i of e){const e="string"==typeof i,n=k(e?i:i.key),o=e?void 0:i.value,a=e||!i.options?t:{...t,...i.options},h=r(n);s(h).items.push({key:n,value:o,relativeKey:h.relativeKey,options:a})}return Promise.all([...n.values()].map((e=>i(e)))).then((e=>e.flat()))},a={hasItem(e,t={}){e=k(e);const{relativeKey:i,driver:n}=r(e);return P(n.hasItem,i,t)},getItem(e,t={}){e=k(e);const{relativeKey:i,driver:n}=r(e);return P(n.getItem,i,t).then((e=>N(e)))},getItems:(e,t)=>o(e,t,(e=>e.driver.getItems?P(e.driver.getItems,e.items.map((e=>({key:e.relativeKey,options:e.options}))),t).then((t=>t.map((t=>({key:L(e.base,t.key),value:N(t.value)}))))):Promise.all(e.items.map((t=>P(e.driver.getItem,t.relativeKey,t.options).then((e=>({key:t.key,value:N(e)})))))))),getItemRaw(e,t={}){e=k(e);const{relativeKey:i,driver:n}=r(e);return n.getItemRaw?P(n.getItemRaw,i,t):P(n.getItem,i,t).then((e=>function(e){return"string"!=typeof e?e:e.startsWith(C)?(T(),Buffer.from(e.slice(7),"base64")):e}(e)))},async setItem(e,t,i={}){if(void 0===t)return a.removeItem(e);e=k(e);const{relativeKey:s,driver:o}=r(e);o.setItem&&(await P(o.setItem,s,R(t),i),o.watch||n("update",e))},async setItems(e,t){await o(e,t,(async e=>{e.driver.setItems&&await P(e.driver.setItems,e.items.map((e=>({key:e.relativeKey,value:R(e.value),options:e.options}))),t),e.driver.setItem&&await Promise.all(e.items.map((t=>P(e.driver.setItem,t.relativeKey,R(t.value),t.options))))}))},async setItemRaw(e,t,i={}){if(void 0===t)return a.removeItem(e,i);e=k(e);const{relativeKey:s,driver:o}=r(e);if(o.setItemRaw)await P(o.setItemRaw,s,t,i);else{if(!o.setItem)return;await P(o.setItem,s,function(e){if("string"==typeof e)return e;T();const t=Buffer.from(e).toString("base64");return C+t}(t),i)}o.watch||n("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t}),e=k(e);const{relativeKey:i,driver:s}=r(e);s.removeItem&&(await P(s.removeItem,i,t),(t.removeMeta||t.removeMata)&&await P(s.removeItem,i+"$",t),s.watch||n("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t}),e=k(e);const{relativeKey:i,driver:n}=r(e),s=Object.create(null);if(n.getMeta&&Object.assign(s,await P(n.getMeta,i,t)),!t.nativeOnly){const e=await P(n.getItem,i+"$",t).then((e=>N(e)));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){e=q(e);const r=i(e,!0);let n=[];const s=[];for(const e of r){const r=(await P(e.driver.getKeys,e.relativeBase,t)).map((t=>e.mountpoint+k(t))).filter((e=>!n.some((t=>e.startsWith(t)))));s.push(...r),n=[e.mountpoint,...n.filter((t=>!t.startsWith(e.mountpoint)))]}return e?s.filter((t=>t.startsWith(e)&&!t.endsWith("$"))):s.filter((e=>!e.endsWith("$")))},async clear(e,t={}){e=q(e),await Promise.all(i(e,!1).map((async e=>{if(e.driver.clear)return P(e.driver.clear,e.relativeBase,t);if(e.driver.removeItem){const r=await e.driver.getKeys(e.relativeBase||"",t);return Promise.all(r.map((r=>e.driver.removeItem(r,t))))}})))},async dispose(){await Promise.all(Object.values(t.mounts).map((e=>B(e))))},watch:async e=>(await(async()=>{if(!t.watching){t.watching=!0;for(const e in t.mounts)t.unwatch[e]=await U(t.mounts[e],n,e)}})(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter((t=>t!==e)),0===t.watchListeners.length&&await s()}),async unwatch(){t.watchListeners=[],await s()},mount(e,r){if((e=q(e))&&t.mounts[e])throw new Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort(((e,t)=>t.length-e.length))),t.mounts[e]=r,t.watching&&Promise.resolve(U(r,n,e)).then((r=>{t.unwatch[e]=r})).catch(console.error),a},async unmount(e,r=!0){(e=q(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e](),delete t.unwatch[e]),r&&await B(t.mounts[e]),t.mountpoints=t.mountpoints.filter((t=>t!==e)),delete t.mounts[e])},getMount(e=""){e=k(e)+":";const t=r(e);return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>(e=k(e),i(e,t.parents).map((e=>({driver:e.driver,base:e.mountpoint}))))};return a}({driver:J({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((e=>[e.key,e.value]))}async getItem(e){const t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,Y(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Q=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},X={exports:{}};function Z(e){var t;return[e[0],G(null!=(t=e[1])?t:"")]}!function(){let e;function t(){}e=t,e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){const e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),typeof Q<"u"&&Q.localStorage?X.exports=Q.localStorage:typeof window<"u"&&window.localStorage?X.exports=window.localStorage:X.exports=new t}();class ee{constructor(){this.localStorage=X.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Z)}async getItem(e){const t=this.localStorage.getItem(e);if(null!==t)return G(t)}async setItem(e,t){this.localStorage.setItem(e,Y(t))}async removeItem(e){this.localStorage.removeItem(e)}}class te{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};const e=new ee;this.storage=e;try{(async(e,t,r)=>{const i="wc_storage_version",n=await t.getItem(i);if(n&&n>=1)return void r(t);const s=await e.getKeys();if(!s.length)return void r(t);const o=[];for(;s.length;){const r=s.shift();if(!r)continue;const i=r.toLowerCase();if(i.includes("wc@")||i.includes("walletconnect")||i.includes("wc_")||i.includes("wallet_connect")){const i=await e.getItem(r);await t.setItem(r,i),o.push(r)}}await t.setItem(i,1),r(t),(async(e,t)=>{t.length&&t.forEach((async t=>{await e.removeItem(t)}))})(e,o)})(e,new $,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise((e=>{const t=setInterval((()=>{this.initialized&&(clearInterval(t),e())}),20)}))}}var re=r(4874),ie=r.n(re);const ne="custom_context";class se{constructor(e){this.nodeValue=e,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class oe{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new se(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}}class ae{constructor(e,t=1024e3){this.level=e??"error",this.levelValue=re.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new oe(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===re.levels.values.error?console.error(e):t===re.levels.values.warn?console.warn(e):t===re.levels.values.debug?console.debug(e):t===re.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Y({timestamp:(new Date).toISOString(),log:e}));const t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new oe(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(Y({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class he{constructor(e,t=1024e3){this.baseChunkLogger=new ae(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${(new Date).toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class ce{constructor(e,t=1024e3){this.baseChunkLogger=new ae(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var fe=Object.defineProperty,ue=Object.defineProperties,de=Object.getOwnPropertyDescriptors,le=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,be=(e,t,r)=>t in e?fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,me=(e,t)=>{for(var r in t||(t={}))pe.call(t,r)&&be(e,r,t[r]);if(le)for(var r of le(t))ge.call(t,r)&&be(e,r,t[r]);return e},ye=(e,t)=>ue(e,de(t));function ve(e){return ye(me({},e),{level:e?.level||"info"})}function we(e,t=ne){let r="";return r=typeof e.bindings>"u"?function(e,t=ne){return e[t]||""}(e,t):e.bindings().context||"",r}function _e(e,t,r=ne){const i=function(e,t,r=ne){const i=we(e,r);return i.trim()?`${i}/${t}`:t}(e,t,r);return function(e,t,r=ne){return e[r]=t,e}(e.child({context:i}),i,r)}function Ae(e){return typeof e.loggerOverride<"u"&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?function(e){var t,r;const i=new he(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:ie()(ye(me({},e.opts),{level:"trace",browser:ye(me({},null==(r=e.opts)?void 0:r.browser),{write:e=>i.write(e)})})),chunkLoggerController:i}}(e):function(e){var t;const r=new ce(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:ie()(ye(me({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(e)}class Se extends w{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Ee extends w{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class Me{constructor(e,t){this.logger=e,this.core=t}}class Ie extends w{constructor(e,t){super(),this.relayer=e,this.logger=t}}class xe extends w{constructor(e){super()}}class Oe{constructor(e,t,r,i){this.core=e,this.logger=t,this.name=r}}class Ne extends w{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Pe extends w{constructor(e,t){super(),this.core=e,this.logger=t}}class Re{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class Te{constructor(e,t){this.projectId=e,this.logger=t}}class Ce{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}y();class ke{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}m.EventEmitter;class Le{constructor(e){this.client=e}}var qe=r(4904),De=r(7052);const Ue=".",Be="base64url",ze="utf8",je="utf8",Fe=":",Ke="did",He="key",Ve="base58btc",We="z",Ge="K36";function Ye(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Je(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Ye(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}const $e=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);e[t];){var f=r[e.charCodeAt(t)];if(255===f)return;for(var u=0,d=s-1;(0!==f||u>>0,o[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");n=u,t++}if(" "!==e[t]){for(var l=s-n;l!==s&&0===o[l];)l++;for(var p=new Uint8Array(i+(s-l)),g=i;l!==s;)p[g++]=o[l++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*f+1>>>0,c=new Uint8Array(o);n!==s;){for(var u=t[n],d=0,l=o-1;(0!==u||d>>0,c[l]=u%a>>>0,u=u/a>>>0;if(0!==u)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var g=h.repeat(r);p{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class Xe{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Ze{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return tt(this,e)}}class et{constructor(e){this.decoders=e}or(e){return tt(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const tt=(e,t)=>new et({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class rt{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new Xe(e,t,r),this.decoder=new Ze(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const it=({name:e,prefix:t,encode:r,decode:i})=>new rt(e,t,r,i),nt=({prefix:e,name:t,alphabet:r})=>{const{encode:i,decode:n}=$e(r,t);return it({prefix:e,name:t,encode:i,decode:e=>Qe(n(e))})},st=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>it({prefix:t,name:e,encode:e=>((e,t,r)=>{const i="="===t[t.length-1],n=(1<r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<((e,t,r,i)=>{const n={};for(let e=0;e=8&&(a-=8,o[c++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(t,i,r,e)}),ot=it({prefix:"\0",name:"identity",encode:e=>{return t=e,(new TextDecoder).decode(t);var t},decode:e=>(e=>(new TextEncoder).encode(e))(e)}),at=st({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ht=st({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ct=nt({prefix:"9",name:"base10",alphabet:"0123456789"}),ft=st({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ut=st({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),dt=st({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),lt=st({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pt=st({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),gt=st({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bt=st({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),mt=st({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),yt=st({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vt=st({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),wt=st({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),_t=nt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),At=nt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),St=nt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Et=nt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Mt=st({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),It=st({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),xt=st({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ot=st({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Nt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Pt=Nt.reduce(((e,t,r)=>(e[r]=t,e)),[]),Rt=Nt.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),Tt=it({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+Pt[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Rt[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Ct=128,kt=-128,Lt=Math.pow(2,31),qt=Math.pow(2,7),Dt=Math.pow(2,14),Ut=Math.pow(2,21),Bt=Math.pow(2,28),zt=Math.pow(2,35),jt=Math.pow(2,42),Ft=Math.pow(2,49),Kt=Math.pow(2,56),Ht=Math.pow(2,63);const Vt=function e(t,r,i){r=r||[];for(var n=i=i||0;t>=Lt;)r[i++]=255&t|Ct,t/=128;for(;t&kt;)r[i++]=255&t|Ct,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},Wt=function(e){return e(Vt(e,t,r),t),Yt=e=>Wt(e),Jt=(e,t)=>{const r=t.byteLength,i=Yt(e),n=i+Yt(r),s=new Uint8Array(n+r);return Gt(e,s,0),Gt(r,s,i),s.set(t,n),new $t(e,r,t,s)};class $t{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}const Qt=({name:e,code:t,encode:r})=>new Xt(e,t,r);class Xt{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Jt(this.code,t):t.then((e=>Jt(this.code,e)))}throw Error("Unknown type, must be binary type")}}const Zt=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),er=Qt({name:"sha2-256",code:18,encode:Zt("SHA-256")}),tr=Qt({name:"sha2-512",code:19,encode:Zt("SHA-512")}),rr=Qe,ir={code:0,name:"identity",encode:rr,digest:e=>Jt(0,rr(e))},nr="raw",sr=85,or=e=>Qe(e),ar=e=>Qe(e),hr=new TextEncoder,cr=new TextDecoder,fr="json",ur=512,dr=e=>hr.encode(JSON.stringify(e)),lr=e=>JSON.parse(cr.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const pr={...i,...n,...s,...o,...a,...h,...c,...f,...u,...d};function gr(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const br=gr("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),mr=gr("ascii","a",(e=>{let t="a";for(let r=0;r{const t=Je((e=e.substring(1)).length);for(let r=0;re+t.length),0));const r=Je(t);let i=0;for(const t of e)r.set(t,i),i+=t.length;return Ye(r)}([t,e]),Ve);return[Ke,He,r].join(Fe)}function Er(e){const t=e.split(Ue);return{header:_r(t[0]),payload:_r(t[1]),signature:wr(t[2],Be),data:wr(t.slice(0,2).join(Ue),je)}}function Mr(e=(0,De.randomBytes)(32)){return qe.K(e)}r(5665);var Ir=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;ne+t.length),0));const r=Hr(t);let i=0;for(const t of e)r.set(t,i),i+=t.length;return r}function Wr(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const Gr=Wr("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Yr=Wr("ascii","a",(e=>{let t="a";for(let r=0;r{const t=Hr((e=e.substring(1)).length);for(let r=0;rt in e?ri(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ai=(e,t)=>{for(var r in t||(t={}))ni.call(t,r)&&oi(e,r,t[r]);if(ii)for(var r of ii(t))si.call(t,r)&&oi(e,r,t[r]);return e};const hi="ReactNative",ci={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},fi="js";function ui(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function di(){return!(0,Dr.getDocument)()&&!!(0,Dr.getNavigator)()&&navigator.product===hi}function li(){return!ui()&&!!(0,Dr.getNavigator)()&&!!(0,Dr.getDocument)()}function pi(){return di()?ci.reactNative:ui()?ci.node:li()?ci.browser:ci.unknown}function gi(){return(0,Ur.g)()||{name:"",description:"",url:"",icons:[""]}}function bi(e,t,i){const n=function(){if(pi()===ci.reactNative&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}const e=t?qr(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new Rr:"undefined"!=typeof navigator?qr(navigator.userAgent):"undefined"!=typeof process&&process.version?new Or(process.version.slice(1)):null;var t;if(null===e)return"unknown";const i=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[i,e.name,e.version].join("-"):[i,e.version].join("-")}(),s=function(){var e;const t=pi();return t===ci.browser?[t,(null==(e=(0,Dr.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[fi,i].join("-"),n,s].join("/")}function mi(e,t){return e.filter((e=>t.includes(e))).length===e.length}function yi(e){return Object.fromEntries(e.entries())}function vi(e){return new Map(Object.entries(e))}function wi(e=v.FIVE_MINUTES,t){const r=(0,v.toMiliseconds)(e||v.FIVE_MINUTES);let i,n,s;return{resolve:e=>{s&&i&&(clearTimeout(s),i(e))},reject:e=>{s&&n&&(clearTimeout(s),n(e))},done:()=>new Promise(((e,o)=>{s=setTimeout((()=>{o(new Error(t))}),r),i=e,n=o}))}}function _i(e,t,r){return new Promise((async(i,n)=>{const s=setTimeout((()=>n(new Error(r))),t);try{i(await e)}catch(e){n(e)}clearTimeout(s)}))}function Ai(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function Si(e){const[t,r]=e.split(":"),i={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)i.topic=r;else{if("id"!==t||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);i.id=Number(r)}return i}function Ei(e,t){return(0,v.fromMiliseconds)((t||Date.now())+(0,v.toMiliseconds)(e))}function Mi(e){return Date.now()>=(0,v.toMiliseconds)(e)}function Ii(e,t){return`${e}${t?`:${t}`:""}`}function xi(e=[],t=[]){return[...new Set([...e,...t])]}function Oi(e,t){if(!e.includes(t))return null;const r=e.split(/([&,?,=])/),i=r.indexOf(t);return r[i+2]}function Ni(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function Pi(){return typeof process<"u"&&"true"===process.env.IS_VITEST}function Ri(e){return Buffer.from(e,"base64").toString("utf-8")}var Ti,Ci=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},ki={exports:{}};Ti=ki,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA3_NO_WINDOW&&(t=!1);var i=!t&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=Ci:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&Ti.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",o="0123456789abcdef".split(""),a=[4,1024,262144,67108864],h=[0,8,16,24],c=[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],f=[224,256,384,512],u=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],l={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var p=function(e,t,r){return function(i){return new N(e,t,e).update(i)[r]()}},g=function(e,t,r){return function(i,n){return new N(e,t,n).update(i)[r]()}},b=function(e,t,r){return function(t,i,n,s){return _["cshake"+e].update(t,i,n,s)[r]()}},m=function(e,t,r){return function(t,i,n,s){return _["kmac"+e].update(t,i,n,s)[r]()}},y=function(e,t,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function P(e,t,r){N.call(this,e,t,r)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,i=typeof t;if("string"!==i){if("object"!==i)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var n,o,a=this.blocks,c=this.byteCount,f=t.length,u=this.blockCount,d=0,l=this.s;d>2]|=t[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[n>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=n-c,this.block=a[u],n=0;n>=8);r>0;)n.unshift(r),r=255&(e>>=8),++i;return t?n.push(i):n.unshift(i),this.update(n),n.length},N.prototype.encodeString=function(t){var r,i=typeof t;if("string"!==i){if("object"!==i)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var n=0,o=t.length;if(r)n=o;else for(var a=0;a=57344?n+=3:(h=65536+((1023&h)<<10|1023&t.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(t),n},N.prototype.bytepad=function(e,t){for(var r=this.encode(t),i=0;i>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];a%t==0&&(R(r),s=0)}return n&&(e=r[s],h+=o[e>>4&15]+o[15&e],n>1&&(h+=o[e>>12&15]+o[e>>8&15]),n>2&&(h+=o[e>>20&15]+o[e>>16&15])),h},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;e=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(e);o>8&255,h[e+2]=t>>16&255,h[e+3]=t>>24&255;a%r==0&&R(i)}return s&&(e=a<<2,t=i[o],h[e]=255&t,s>1&&(h[e+1]=t>>8&255),s>2&&(h[e+2]=t>>16&255)),h},P.prototype=new N,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var R=function(e){var t,r,i,n,s,o,a,h,f,u,d,l,p,g,b,m,y,v,w,_,A,S,E,M,I,x,O,N,P,R,T,C,k,L,q,D,U,B,z,j,F,K,H,V,W,G,Y,J,$,Q,X,Z,ee,te,re,ie,ne,se,oe,ae,he,ce,fe;for(i=0;i<48;i+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],h=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=n^(h<<1|f>>>31),r=s^(f<<1|h>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(u<<1|d>>>31),r=a^(d<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=h^(l<<1|p>>>31),r=f^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(n<<1|s>>>31),r=d^(s<<1|n>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,g=e[0],b=e[1],G=e[11]<<4|e[10]>>>28,Y=e[10]<<4|e[11]>>>28,N=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,he=e[30]<<9|e[31]>>>23,K=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,q=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Q=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,C=e[45]<<29|e[44]>>>3,k=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ie=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,x=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,se=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=g^~m&v,e[1]=b^~y&w,e[10]=M^~x&N,e[11]=I^~O&P,e[20]=L^~D&B,e[21]=q^~U&z,e[30]=V^~G&J,e[31]=W^~Y&$,e[40]=te^~ie&se,e[41]=re^~ne&oe,e[2]=m^~v&_,e[3]=y^~w&A,e[12]=x^~N&R,e[13]=O^~P&T,e[22]=D^~B&j,e[23]=U^~z&F,e[32]=G^~J&Q,e[33]=Y^~$&X,e[42]=ie^~se&ae,e[43]=ne^~oe&he,e[4]=v^~_&S,e[5]=w^~A&E,e[14]=N^~R&C,e[15]=P^~T&k,e[24]=B^~j&K,e[25]=z^~F&H,e[34]=J^~Q&Z,e[35]=$^~X&ee,e[44]=se^~ae&ce,e[45]=oe^~he&fe,e[6]=_^~S&g,e[7]=A^~E&b,e[16]=R^~C&M,e[17]=T^~k&I,e[26]=j^~K&L,e[27]=F^~H&q,e[36]=Q^~Z&V,e[37]=X^~ee&W,e[46]=ae^~ce&te,e[47]=he^~fe&re,e[8]=S^~g&m,e[9]=E^~b&y,e[18]=C^~M&x,e[19]=k^~I&O,e[28]=K^~L&D,e[29]=H^~q&U,e[38]=Z^~V&G,e[39]=ee^~W&Y,e[48]=ce^~te&ie,e[49]=fe^~re&ne,e[0]^=c[i],e[1]^=c[i+1]};if(n)Ti.exports=_;else for(S=0;S{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch{e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Fi,Ki;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Fi||(Fi={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Ki||(Ki={}));const Hi="0123456789abcdef";class Vi{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==Ui[r]&&this.throwArgumentError("invalid log level name","logLevel",e),!(Bi>Ui[r])&&console.log.apply(console,t)}debug(...e){this._log(Vi.levels.DEBUG,e)}info(...e){this._log(Vi.levels.INFO,e)}warn(...e){this._log(Vi.levels.WARNING,e)}makeError(e,t,r){if(Di)return this.makeError("censored error",t,{});t||(t=Vi.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=Hi[15&t[e]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch{i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${t}`),i.push(`version=${this.version}`);const n=e;let s="";switch(t){case Ki.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Ki.CALL_EXCEPTION:case Ki.INSUFFICIENT_FUNDS:case Ki.MISSING_NEW:case Ki.NONCE_EXPIRED:case Ki.REPLACEMENT_UNDERPRICED:case Ki.TRANSACTION_REPLACED:case Ki.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const o=new Error(e);return o.reason=n,o.code=t,Object.keys(r).forEach((function(e){o[e]=r[e]})),o}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,Vi.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,i){e||this.throwError(t,r,i)}assertArgument(e,t,r,i){e||this.throwArgumentError(t,r,i)}checkNormalize(e){ji&&this.throwError("platform missing String.prototype.normalize",Vi.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ji})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Vi.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Vi.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,Vi.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||null==e)&&this.throwError("missing new",Vi.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Vi.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||null==e)&&this.throwError("missing new",Vi.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return zi||(zi=new Vi("logger/5.7.0")),zi}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Vi.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),qi){if(!e)return;this.globalLogger().throwError("error censorship permanent",Vi.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Di=!!e,qi=!!t}static setLogLevel(e){const t=Ui[e.toLowerCase()];null!=t?Bi=t:Vi.globalLogger().warn("invalid log level - "+e)}static from(e){return new Vi(e)}}Vi.errors=Ki,Vi.levels=Fi;const Wi=new Vi("bytes/5.7.0");function Gi(e){return!!e.toHexString}function Yi(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Yi(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Ji(e){return"number"==typeof e&&e==e&&e%1==0}function $i(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e||!Ji(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Qi(e,t){if(t||(t={}),"number"==typeof e){Wi.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),Yi(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Gi(e)&&(e=e.toHexString()),Xi(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":Wi.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;e>4]+Zi[15&i]}return t}return Wi.throwArgumentError("invalid hexlify value","value",e)}function tn(e,t,r){return"string"!=typeof e?e=en(e):(!Xi(e)||e.length%2)&&Wi.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function rn(e,t){for("string"!=typeof e?e=en(e):Xi(e)||Wi.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Wi.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function nn(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(function(e){return Xi(e)&&!(e.length%2)||$i(e)}(e)){let r=Qi(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=en(r.slice(0,32)),t.s=en(r.slice(32,64))):65===r.length?(t.r=en(r.slice(0,32)),t.s=en(r.slice(32,64)),t.v=r[64]):Wi.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:Wi.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=en(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=function(e,t){(e=Qi(e)).length>t&&Wi.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),Yi(r)}(Qi(t._vs),32);t._vs=en(r);const i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&Wi.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const n=en(r);null==t.s?t.s=n:t.s!==n&&Wi.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?Wi.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&Wi.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Xi(t.r)?t.r=rn(t.r,32):Wi.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Xi(t.s)?t.s=rn(t.s,32):Wi.throwArgumentError("signature missing or invalid s","signature",e);const r=Qi(t.s);r[0]>=128&&Wi.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=en(r);t._vs&&(Xi(t._vs)||Wi.throwArgumentError("signature invalid _vs","signature",e),t._vs=rn(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&Wi.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function sn(e){return"0x"+Li.keccak_256(Qi(e))}var on={exports:{}},an=function(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),r}(Object.freeze({__proto__:null,default:{}}));!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof on?on.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{s=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:an.Buffer}catch{}function o(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function h(e,t,i,n){for(var s=0,o=0,a=Math.min(e.length,i),h=t;h=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&o0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{n.prototype.inspect=f}else n.prototype.inspect=f;function f(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],l=[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 p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var c=1;c>>26,u=67108863&h,d=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=d;l++){var p=c-l|0;f+=(o=(n=0|e.words[p])*(s=0|t.words[l])+u)/67108864|0,u=67108863&o}r.words[c]=0|u,h=0|f}return 0!==h?r.words[c]=0|h:r.length--,r._strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,s=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?u[6-h.length]+h+i:h+i}for(0!==s&&(i=s.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],f=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(f).toString(e);i=(p=p.idivn(f)).isZero()?g+i:u[c-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},s&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){this._strip();var n=this.byteLength(),s=i||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===s?(r>=0&&(e[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,l=0|o[1],p=8191&l,g=l>>>13,b=0|o[2],m=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,A=0|o[4],S=8191&A,E=A>>>13,M=0|o[5],I=8191&M,x=M>>>13,O=0|o[6],N=8191&O,P=O>>>13,R=0|o[7],T=8191&R,C=R>>>13,k=0|o[8],L=8191&k,q=k>>>13,D=0|o[9],U=8191&D,B=D>>>13,z=0|a[0],j=8191&z,F=z>>>13,K=0|a[1],H=8191&K,V=K>>>13,W=0|a[2],G=8191&W,Y=W>>>13,J=0|a[3],$=8191&J,Q=J>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],he=8191&ae,ce=ae>>>13,fe=0|a[8],ue=8191&fe,de=fe>>>13,le=0|a[9],pe=8191&le,ge=le>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(i=Math.imul(u,j))|0)+((8191&(n=(n=Math.imul(u,F))+Math.imul(d,j)|0))<<13)|0;c=((s=Math.imul(d,F))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,F))+Math.imul(g,j)|0,s=Math.imul(g,F);var me=(c+(i=i+Math.imul(u,H)|0)|0)+((8191&(n=(n=n+Math.imul(u,V)|0)+Math.imul(d,H)|0))<<13)|0;c=((s=s+Math.imul(d,V)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,j),n=(n=Math.imul(m,F))+Math.imul(y,j)|0,s=Math.imul(y,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,V)|0;var ye=(c+(i=i+Math.imul(u,G)|0)|0)+((8191&(n=(n=n+Math.imul(u,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,F))+Math.imul(_,j)|0,s=Math.imul(_,F),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,V)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,Y)|0;var ve=(c+(i=i+Math.imul(u,$)|0)|0)+((8191&(n=(n=n+Math.imul(u,Q)|0)+Math.imul(d,$)|0))<<13)|0;c=((s=s+Math.imul(d,Q)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,j),n=(n=Math.imul(S,F))+Math.imul(E,j)|0,s=Math.imul(E,F),i=i+Math.imul(w,H)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,Q)|0;var we=(c+(i=i+Math.imul(u,Z)|0)|0)+((8191&(n=(n=n+Math.imul(u,ee)|0)+Math.imul(d,Z)|0))<<13)|0;c=((s=s+Math.imul(d,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,j),n=(n=Math.imul(I,F))+Math.imul(x,j)|0,s=Math.imul(x,F),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,s=s+Math.imul(E,V)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,Q)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,ee)|0;var _e=(c+(i=i+Math.imul(u,re)|0)|0)+((8191&(n=(n=n+Math.imul(u,ie)|0)+Math.imul(d,re)|0))<<13)|0;c=((s=s+Math.imul(d,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(N,j),n=(n=Math.imul(N,F))+Math.imul(P,j)|0,s=Math.imul(P,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,Y)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,Q)|0,i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(y,Z)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(g,re)|0,s=s+Math.imul(g,ie)|0;var Ae=(c+(i=i+Math.imul(u,se)|0)|0)+((8191&(n=(n=n+Math.imul(u,oe)|0)+Math.imul(d,se)|0))<<13)|0;c=((s=s+Math.imul(d,oe)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,F))+Math.imul(C,j)|0,s=Math.imul(C,F),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(P,H)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,Y)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,Q)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,oe)|0;var Se=(c+(i=i+Math.imul(u,he)|0)|0)+((8191&(n=(n=n+Math.imul(u,ce)|0)+Math.imul(d,he)|0))<<13)|0;c=((s=s+Math.imul(d,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(L,j),n=(n=Math.imul(L,F))+Math.imul(q,j)|0,s=Math.imul(q,F),i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(C,H)|0,s=s+Math.imul(C,V)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(P,G)|0,s=s+Math.imul(P,Y)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,Q)|0,i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,Z)|0,s=s+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(m,se)|0,n=(n=n+Math.imul(m,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,he)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(g,he)|0,s=s+Math.imul(g,ce)|0;var Ee=(c+(i=i+Math.imul(u,ue)|0)|0)+((8191&(n=(n=n+Math.imul(u,de)|0)+Math.imul(d,ue)|0))<<13)|0;c=((s=s+Math.imul(d,de)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(U,j),n=(n=Math.imul(U,F))+Math.imul(B,j)|0,s=Math.imul(B,F),i=i+Math.imul(L,H)|0,n=(n=n+Math.imul(L,V)|0)+Math.imul(q,H)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(C,G)|0,s=s+Math.imul(C,Y)|0,i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,Q)|0,i=i+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,s=s+Math.imul(E,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(m,he)|0,n=(n=n+Math.imul(m,ce)|0)+Math.imul(y,he)|0,s=s+Math.imul(y,ce)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(g,ue)|0,s=s+Math.imul(g,de)|0;var Me=(c+(i=i+Math.imul(u,pe)|0)|0)+((8191&(n=(n=n+Math.imul(u,ge)|0)+Math.imul(d,pe)|0))<<13)|0;c=((s=s+Math.imul(d,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(U,H),n=(n=Math.imul(U,V))+Math.imul(B,H)|0,s=Math.imul(B,V),i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(q,G)|0,s=s+Math.imul(q,Y)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Q)|0)+Math.imul(C,$)|0,s=s+Math.imul(C,Q)|0,i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(x,re)|0,s=s+Math.imul(x,ie)|0,i=i+Math.imul(S,se)|0,n=(n=n+Math.imul(S,oe)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,oe)|0,i=i+Math.imul(w,he)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,he)|0,s=s+Math.imul(_,ce)|0,i=i+Math.imul(m,ue)|0,n=(n=n+Math.imul(m,de)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,de)|0;var Ie=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((s=s+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Y))+Math.imul(B,G)|0,s=Math.imul(B,Y),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(q,$)|0,s=s+Math.imul(q,Q)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(C,Z)|0,s=s+Math.imul(C,ee)|0,i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,oe)|0,i=i+Math.imul(S,he)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,he)|0,s=s+Math.imul(E,ce)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,de)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,de)|0;var xe=(c+(i=i+Math.imul(m,pe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ge)|0)+Math.imul(y,pe)|0))<<13)|0;c=((s=s+Math.imul(y,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,Q))+Math.imul(B,$)|0,s=Math.imul(B,Q),i=i+Math.imul(L,Z)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(q,Z)|0,s=s+Math.imul(q,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(C,re)|0,s=s+Math.imul(C,ie)|0,i=i+Math.imul(N,se)|0,n=(n=n+Math.imul(N,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(I,he)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(x,he)|0,s=s+Math.imul(x,ce)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,de)|0)+Math.imul(E,ue)|0,s=s+Math.imul(E,de)|0;var Oe=(c+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,ge)|0)+Math.imul(_,pe)|0))<<13)|0;c=((s=s+Math.imul(_,ge)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(U,Z),n=(n=Math.imul(U,ee))+Math.imul(B,Z)|0,s=Math.imul(B,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(q,re)|0,s=s+Math.imul(q,ie)|0,i=i+Math.imul(T,se)|0,n=(n=n+Math.imul(T,oe)|0)+Math.imul(C,se)|0,s=s+Math.imul(C,oe)|0,i=i+Math.imul(N,he)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(P,he)|0,s=s+Math.imul(P,ce)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,de)|0)+Math.imul(x,ue)|0,s=s+Math.imul(x,de)|0;var Ne=(c+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,ge)|0)+Math.imul(E,pe)|0))<<13)|0;c=((s=s+Math.imul(E,ge)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,i=Math.imul(U,re),n=(n=Math.imul(U,ie))+Math.imul(B,re)|0,s=Math.imul(B,ie),i=i+Math.imul(L,se)|0,n=(n=n+Math.imul(L,oe)|0)+Math.imul(q,se)|0,s=s+Math.imul(q,oe)|0,i=i+Math.imul(T,he)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(C,he)|0,s=s+Math.imul(C,ce)|0,i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,de)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,de)|0;var Pe=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(x,pe)|0))<<13)|0;c=((s=s+Math.imul(x,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(U,se),n=(n=Math.imul(U,oe))+Math.imul(B,se)|0,s=Math.imul(B,oe),i=i+Math.imul(L,he)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(q,he)|0,s=s+Math.imul(q,ce)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,de)|0)+Math.imul(C,ue)|0,s=s+Math.imul(C,de)|0;var Re=(c+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,ge)|0)+Math.imul(P,pe)|0))<<13)|0;c=((s=s+Math.imul(P,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(U,he),n=(n=Math.imul(U,ce))+Math.imul(B,he)|0,s=Math.imul(B,ce),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,de)|0)+Math.imul(q,ue)|0,s=s+Math.imul(q,de)|0;var Te=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ge)|0)+Math.imul(C,pe)|0))<<13)|0;c=((s=s+Math.imul(C,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(U,ue),n=(n=Math.imul(U,de))+Math.imul(B,ue)|0,s=Math.imul(B,de);var Ce=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ge)|0)+Math.imul(q,pe)|0))<<13)|0;c=((s=s+Math.imul(q,ge)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var ke=(c+(i=Math.imul(U,pe))|0)+((8191&(n=(n=Math.imul(U,ge))+Math.imul(B,pe)|0))<<13)|0;return c=((s=Math.imul(B,ge))+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,h[0]=be,h[1]=me,h[2]=ye,h[3]=ve,h[4]=we,h[5]=_e,h[6]=Ae,h[7]=Se,h[8]=Ee,h[9]=Me,h[10]=Ie,h[11]=xe,h[12]=Oe,h[13]=Ne,h[14]=Pe,h[15]=Re,h[16]=Te,h[17]=Ce,h[18]=ke,0!==c&&(h[19]=c,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function m(e,t,r){return b(e,t,r)}Math.imul||(g=p),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?p(this,e,t):r<1024?b(this,e,t):m(this,e,t)},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),m(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var i=0,n=0;n>=26,i+=s/67108864|0,i+=o>>>26,this.words[n]=67108863&o}return 0!==i&&(this.words[n]=i,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,i=e%26,n=(e-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(t=0;t>>26-i}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,c=0;c=0&&(0!==f||c>=n);c--){var u=0|this.words[c];this.words[c]=f<<26-s|u>>>s,f=u&a}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(h/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),s=e,o=0|s.words[s.length-1];0!=(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,h=i.length-s.length;if("mod"!==t){(a=new n(null)).length=h+1,a.words=new Array(a.length);for(var c=0;c=0;u--){var d=67108864*(0|i.words[s.length+u])+(0|i.words[s.length+u-1]);for(d=Math.min(d/o|0,67108863),i._ishlnsubmul(s,d,u);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(s,1,u),i.isZero()||(i.negative^=1);a&&(a.words[u]=d)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(s=a.div.neg()),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(e)),{div:s,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var s,o,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=(1<<26)%e,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*i;this.words[n]=s/e|0,i=s%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s=new n(1),o=new n(0),a=new n(0),h=new n(1),c=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++c;for(var f=i.clone(),u=t.clone();!t.isZero();){for(var d=0,l=1;!(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(f),o.isub(u)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(f),h.isub(u)),a.iushrn(1),h.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a),o.isub(h)):(i.isub(t),a.isub(s),h.isub(o))}return{a,b:h,gcd:i.iushln(c)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,s=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var o=new n(1),a=new n(0),h=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var c=0,f=1;!(i.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(i.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var u=0,d=1;!(s.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(s.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return(t=0===i.cmpn(1)?o:a).cmpn(0)<0&&t.iadd(e),t},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(w,v),w.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),h=a.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,c).cmp(h);)f.redIAdd(h);for(var u=this.pow(f,s),d=this.pow(e,s.addn(1).iushrn(1)),l=this.pow(e,s),p=o;0!==l.cmp(a);){for(var g=l,b=0;0!==g.cmp(a);b++)g=g.redSqr();r(b=0;i--){for(var c=t.words[i],f=h-1;f>=0;f--){var u=c>>f&1;s!==r[0]&&(s=this.sqr(s)),0!==u||0!==o?(o<<=1,o|=u,(4==++a||0===i&&0===f)&&(s=this.mul(s,r[o]),a=0,o=0)):a=0}h=26}return s},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new M(e)},i(M,E),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(0,Ci);var hn=on.exports;const cn="bignumber/5.7.0";var fn=hn.BN;const un=new Vi(cn),dn={},ln=9007199254740991;let pn=!1;class gn{constructor(e,t){e!==dn&&un.throwError("cannot call constructor directly; use BigNumber.from",Vi.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return mn(yn(this).fromTwos(e))}toTwos(e){return mn(yn(this).toTwos(e))}abs(){return"-"===this._hex[0]?gn.from(this._hex.substring(1)):this}add(e){return mn(yn(this).add(yn(e)))}sub(e){return mn(yn(this).sub(yn(e)))}div(e){return gn.from(e).isZero()&&vn("division-by-zero","div"),mn(yn(this).div(yn(e)))}mul(e){return mn(yn(this).mul(yn(e)))}mod(e){const t=yn(e);return t.isNeg()&&vn("division-by-zero","mod"),mn(yn(this).umod(t))}pow(e){const t=yn(e);return t.isNeg()&&vn("negative-power","pow"),mn(yn(this).pow(t))}and(e){const t=yn(e);return(this.isNegative()||t.isNeg())&&vn("unbound-bitwise-result","and"),mn(yn(this).and(t))}or(e){const t=yn(e);return(this.isNegative()||t.isNeg())&&vn("unbound-bitwise-result","or"),mn(yn(this).or(t))}xor(e){const t=yn(e);return(this.isNegative()||t.isNeg())&&vn("unbound-bitwise-result","xor"),mn(yn(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&vn("negative-width","mask"),mn(yn(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&vn("negative-width","shl"),mn(yn(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&vn("negative-width","shr"),mn(yn(this).shrn(e))}eq(e){return yn(this).eq(yn(e))}lt(e){return yn(this).lt(yn(e))}lte(e){return yn(this).lte(yn(e))}gt(e){return yn(this).gt(yn(e))}gte(e){return yn(this).gte(yn(e))}isNegative(){return"-"===this._hex[0]}isZero(){return yn(this).isZero()}toNumber(){try{return yn(this).toNumber()}catch{vn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return un.throwError("this platform does not support BigInt",Vi.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?pn||(pn=!0,un.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?un.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Vi.errors.UNEXPECTED_ARGUMENT,{}):un.throwError("BigNumber.toString does not accept parameters",Vi.errors.UNEXPECTED_ARGUMENT,{})),yn(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof gn)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new gn(dn,bn(e)):e.match(/^-?[0-9]+$/)?new gn(dn,bn(new fn(e))):un.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&vn("underflow","BigNumber.from",e),(e>=ln||e<=-ln)&&vn("overflow","BigNumber.from",e),gn.from(String(e));const t=e;if("bigint"==typeof t)return gn.from(t.toString());if($i(t))return gn.from(en(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return gn.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Xi(e)||"-"===e[0]&&Xi(e.substring(1))))return gn.from(e)}return un.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function bn(e){if("string"!=typeof e)return bn(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&un.throwArgumentError("invalid hex","value",e),"0x00"===(e=bn(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function mn(e){return gn.from(bn(e))}function yn(e){const t=gn.from(e).toHexString();return"-"===t[0]?new fn("-"+t.substring(3),16):new fn(t.substring(2),16)}function vn(e,t,r){const i={fault:e,operation:t};return null!=r&&(i.value=r),un.throwError(e,Vi.errors.NUMERIC_FAULT,i)}const wn=new Vi(cn),_n={},An=gn.from(0),Sn=gn.from(-1);function En(e,t,r,i){const n={fault:t,operation:r};return void 0!==i&&(n.value=i),wn.throwError(e,Vi.errors.NUMERIC_FAULT,n)}let Mn="0";for(;Mn.length<256;)Mn+=Mn;function In(e){if("number"!=typeof e)try{e=gn.from(e).toNumber()}catch{}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Mn.substring(0,e):wn.throwArgumentError("invalid decimal size","decimals",e)}function xn(e,t){null==t&&(t=0);const r=In(t),i=(e=gn.from(e)).lt(An);i&&(e=e.mul(Sn));let n=e.mod(r).toString();for(;n.length2&&wn.throwArgumentError("too many decimal points","value",e);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&En("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==e[t]?i:(typeof e[t]!==r&&wn.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=n("signed","boolean",t),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&wn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&wn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Nn(_n,t,r,i)}}class Pn{constructor(e,t,r,i){e!==_n&&wn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Vi.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&wn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=On(this._value,this.format.decimals),r=On(e._value,e.format.decimals);return Pn.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=On(this._value,this.format.decimals),r=On(e._value,e.format.decimals);return Pn.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=On(this._value,this.format.decimals),r=On(e._value,e.format.decimals);return Pn.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=On(this._value,this.format.decimals),r=On(e._value,e.format.decimals);return Pn.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Pn.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(Rn.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Pn.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(Rn.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&wn.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=Pn.from("1"+Mn.substring(0,e),this.format),i=Tn.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){return null==e?this._hex:(e%8&&wn.throwArgumentError("invalid byte width","width",e),rn(gn.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Pn.fromString(this._value,e)}static fromValue(e,t,r){return null==r&&null!=t&&!function(e){return null!=e&&(gn.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Xi(e)||"bigint"==typeof e||$i(e))}(t)&&(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),Pn.fromString(xn(e,t),Nn.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=Nn.from(t),i=On(e,r.decimals);!r.signed&&i.lt(An)&&En("unsigned value cannot be negative","overflow","value",e);let n=null;r.signed?n=i.toTwos(r.width).toHexString():(n=i.toHexString(),n=rn(n,r.width/8));const s=xn(i,r.decimals);return new Pn(_n,n,s,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=Nn.from(t);if(Qi(e).length>r.width/8)throw new Error("overflow");let i=gn.from(e);r.signed&&(i=i.fromTwos(r.width));const n=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=xn(i,r.decimals);return new Pn(_n,n,s,r)}static from(e,t){if("string"==typeof e)return Pn.fromString(e,t);if($i(e))return Pn.fromBytes(e,t);try{return Pn.fromValue(e,0,t)}catch(e){if(e.code!==Vi.errors.INVALID_ARGUMENT)throw e}return wn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Rn=Pn.from(1),Tn=Pn.from("0.5"),Cn=new Vi("strings/5.7.0");var kn,Ln;function qn(e,t,r,i,n){if(e===Ln.BAD_PREFIX||e===Ln.UNEXPECTED_CONTINUE){let e=0;for(let i=t+1;i>6==2;i++)e++;return e}return e===Ln.OVERRUN?r.length-t-1:0}function Dn(e,t=kn.current){t!=kn.current&&(Cn.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&i|128);else if(55296==(64512&i)){t++;const n=e.charCodeAt(t);if(t>=e.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Qi(r)}function Un(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,i={};return e.split(",").forEach((e=>{let n=e.split(":");r+=parseInt(n[0],16),i[r]=t(n[1])})),i}function Bn(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let i=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:i,h:t}}))}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(kn||(kn={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Ln||(Ln={})),Object.freeze({error:function(e,t,r,i,n){return Cn.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:qn,replace:function(e,t,r,i,n){return e===Ln.OVERLONG?(i.push(n),0):(i.push(65533),qn(e,t,r))}}),Bn("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),Un("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Un("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Un("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r0&&Array.isArray(e)?n(e,t-1):r.push(e)}))};return n(e,t),r}function Fn(e){return 1&e?~e>>1:e>>1}function Kn(e,t){let r=Array(e);for(let i=0,n=-1;it[e])):r}function Wn(e,t,r){let i=Array(e).fill(void 0).map((()=>[]));for(let n=0;ni[t].push(e)));return i}function Gn(e,t){let r=1+t(),i=t(),n=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return jn(Wn(n.length,1+e,t).map(((e,t)=>{const s=e[0],o=e.slice(1);return Array(n[t]).fill(void 0).map(((e,t)=>{let n=t*i;return[s+t*r,o.map((e=>e+n))]}))})))}function Yn(e,t){return Wn(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Jn=function(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let i=r(),n=1,s=[0,1];for(let e=1;e>--h&1}const u=Math.pow(2,31),d=u>>>1,l=d>>1,p=u-1;let g=0;for(let e=0;e<31;e++)g=g<<1|f();let b=[],m=0,y=u;for(;;){let e=Math.floor(((g-m+1)*n-1)/y),t=0,r=i;for(;r-t>1;){let i=t+r>>>1;e>>1|f(),o=o<<1^d,a=(a^d)<<1|d|1;m=o,y=1+a-o}let v=i-4;return b.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}(function(e){e=atob(e);const t=[];for(let r=0;re-t));!function r(){let i=[];for(;;){let n=Vn(e,t);if(0==n.length)break;i.push({set:new Set(n),node:r()})}i.sort(((e,t)=>t.set.size-e.set.size));let n=e(),s=n%3;n=n/3|0;let o=!!(1&n);return n>>=1,{branches:i,valid:s,fe0f:o,save:1==n,check:2==n}}()}(Jn),new Vi(zn),new Uint8Array(32).fill(0);const $n="Ethereum Signed Message:\n";function Qn(e){return"string"==typeof e&&(e=Dn(e)),sn(function(e){const t=e.map((e=>Qi(e))),r=t.reduce(((e,t)=>e+t.length),0),i=new Uint8Array(r);return t.reduce(((e,t)=>(i.set(t,e),e+t.length)),0),Yi(i)}([Dn($n),Dn(String(e.length)),e]))}new Vi("rlp/5.7.0");const Xn=new Vi("address/5.7.0");function Zn(e){Xi(e,20)||Xn.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const i=Qi(sn(r));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const es={};for(let e=0;e<10;e++)es[String(e)]=String(e);for(let e=0;e<26;e++)es[String.fromCharCode(65+e)]=String(10+e);const ts=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function rs(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}new Vi("properties/5.7.0"),new Vi(zn),new Uint8Array(32).fill(0),gn.from(-1);const is=gn.from(0),ns=gn.from(1);gn.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),rn(ns.toHexString(),32),rn(is.toHexString(),32);var ss={},os={},as=hs;function hs(e,t){if(!e)throw new Error(t||"Assertion failed")}hs.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var cs={exports:{}};"function"==typeof Object.create?cs.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:cs.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var fs=as,us=cs.exports;function ds(e,t){return!(55296!=(64512&e.charCodeAt(t))||t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function ls(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function ps(e){return 1===e.length?"0"+e:e}function gs(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}os.inherits=us,os.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,r[i++]=63&s|128):ds(e,n)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n>>0}return s},os.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},os.rotr32=function(e,t){return e>>>t|e<<32-t},os.rotl32=function(e,t){return e<>>32-t},os.sum32=function(e,t){return e+t>>>0},os.sum32_3=function(e,t,r){return e+t+r>>>0},os.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},os.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},os.sum64=function(e,t,r,i){var n=e[t],s=i+e[t+1]>>>0,o=(s>>0,e[t+1]=s},os.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},os.sum64_lo=function(e,t,r,i){return t+i>>>0},os.sum64_4_hi=function(e,t,r,i,n,s,o,a){var h=0,c=t;return h+=(c=c+i>>>0)>>0)>>0)>>0},os.sum64_4_lo=function(e,t,r,i,n,s,o,a){return t+i+s+a>>>0},os.sum64_5_hi=function(e,t,r,i,n,s,o,a,h,c){var f=0,u=t;return f+=(u=u+i>>>0)>>0)>>0)>>0)>>0},os.sum64_5_lo=function(e,t,r,i,n,s,o,a,h,c){return t+i+s+a+c>>>0},os.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},os.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},os.shr64_hi=function(e,t,r){return e>>>r},os.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var bs={},ms=os,ys=as;function vs(){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}bs.BlockHash=vs,vs.prototype.update=function(e,t){if(e=ms.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=ms.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s>>3},_s.g1_256=function(e){return As(e,17)^As(e,19)^e>>>10};var Is=os,xs=bs,Os=_s,Ns=Is.rotl32,Ps=Is.sum32,Rs=Is.sum32_5,Ts=Os.ft_1,Cs=xs.BlockHash,ks=[1518500249,1859775393,2400959708,3395469782];function Ls(){if(!(this instanceof Ls))return new Ls;Cs.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Is.inherits(Ls,Cs);var qs=Ls;Ls.blockSize=512,Ls.outSize=160,Ls.hmacStrength=80,Ls.padLength=64,Ls.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;ithis.blockSize&&(e=(new this.Hash).update(e).digest()),ra(e.length<=this.blockSize);for(var t=e.length;t>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}})),fa=oa((function(e,t){var r=t;r.assert=aa,r.toArray=ca.toArray,r.zero2=ca.zero2,r.toHex=ca.toHex,r.encode=ca.encode,r.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-h:h,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,s=0;e.cmpn(-n)>0||t.cmpn(-s)>0;){var o,a,h=e.andln(3)+n&3,c=t.andln(3)+s&3;3===h&&(h=-1),3===c&&(c=-1),o=1&h?3!=(i=e.andln(7)+n&7)&&5!==i||2!==c?h:-h:0,r[0].push(o),a=1&c?3!=(i=t.andln(7)+s&7)&&5!==i||2!==h?c:-c:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new hn(e,"hex","le")}})),ua=fa.getNAF,da=fa.getJSF,la=fa.assert;function pa(e,t){this.type=e,this.p=new hn(t.p,16),this.red=t.prime?hn.red(t.prime):hn.mont(this.p),this.zero=new hn(0).toRed(this.red),this.one=new hn(1).toRed(this.red),this.two=new hn(2).toRed(this.red),this.n=t.n&&new hn(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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))}var ga=pa;function ba(e,t){this.curve=e,this.type=t,this.precomputed=null}pa.prototype.point=function(){throw new Error("Not implemented")},pa.prototype.validate=function(){throw new Error("Not implemented")},pa.prototype._fixedNafMul=function(e,t){la(e.precomputed);var r=e._getDoubles(),i=ua(t,1,this._bitLength),n=(1<=s;h--)o=(o<<1)+i[h];a.push(o)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),u=n;u>0;u--){for(s=0;s=0;a--){for(var h=0;a>=0&&0===s[a];a--)h++;if(a>=0&&h++,o=o.dblp(h),a<0)break;var c=s[a];la(0!==c),o="affine"===e.type?c>0?o.mixedAdd(n[c-1>>1]):o.mixedAdd(n[-c-1>>1].neg()):c>0?o.add(n[c-1>>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},pa.prototype._wnafMulAdd=function(e,t,r,i,n){var s,o,a,h=this._wnafT1,c=this._wnafT2,f=this._wnafT3,u=0;for(s=0;s=1;s-=2){var l=s-1,p=s;if(1===h[l]&&1===h[p]){var g=[t[l],null,null,t[p]];0===t[l].y.cmp(t[p].y)?(g[1]=t[l].add(t[p]),g[2]=t[l].toJ().mixedAdd(t[p].neg())):0===t[l].y.cmp(t[p].y.redNeg())?(g[1]=t[l].toJ().mixedAdd(t[p]),g[2]=t[l].add(t[p].neg())):(g[1]=t[l].toJ().mixedAdd(t[p]),g[2]=t[l].toJ().mixedAdd(t[p].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],m=da(r[l],r[p]);for(u=Math.max(m[0].length,u),f[l]=new Array(u),f[p]=new Array(u),o=0;o=0;s--){for(var A=0;s>=0;){var S=!0;for(o=0;o=0&&A++,w=w.dblp(A),s<0)break;for(o=0;o0?a=c[o][E-1>>1]:E<0&&(a=c[o][-E-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},ba.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(s=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},va.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),h=n.mul(r.b),c=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:h.add(c).neg()}},va.prototype.pointFromX=function(e,t){(e=new hn(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},va.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},va.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},_a.prototype.isInfinity=function(){return this.inf},_a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},_a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},_a.prototype.getX=function(){return this.x.fromRed()},_a.prototype.getY=function(){return this.y.fromRed()},_a.prototype.mul=function(e){return e=new hn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},_a.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},_a.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},_a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},_a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},_a.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ma(Aa,ga.BasePoint),va.prototype.jpoint=function(e,t,r){return new Aa(this,e,t,r)},Aa.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},Aa.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Aa.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),f=c.redMul(a),u=i.redMul(c),d=h.redSqr().redIAdd(f).redISub(u).redISub(u),l=h.redMul(u.redISub(d)).redISub(s.redMul(f)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,l,p)},Aa.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),c=h.redMul(o),f=r.redMul(h),u=a.redSqr().redIAdd(c).redISub(f).redISub(f),d=a.redMul(f.redISub(u)).redISub(n.redMul(c)),l=this.z.redMul(o);return this.curve.jpoint(u,d,l)},Aa.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Aa.prototype.inspect=function(){return this.isInfinity()?"":""},Aa.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Sa=oa((function(e,t){var r=t;r.base=ga,r.short=wa,r.mont=null,r.edwards=null})),Ea=oa((function(e,t){var r,i=t,n=fa.assert;function s(e){"short"===e.type?this.curve=new Sa.short(e):"edwards"===e.type?this.curve=new Sa.edwards(e):this.curve=new Sa.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new s(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=s,o("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:ss.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:ss.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:ss.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:ss.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"]}),o("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:ss.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ss.sha256,gRed:!1,g:["9"]}),o("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:ss.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}o("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:ss.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Ma(e){if(!(this instanceof Ma))return new Ma(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ca.toArray(e.entropy,e.entropyEnc||"hex"),r=ca.toArray(e.nonce,e.nonceEnc||"hex"),i=ca.toArray(e.pers,e.persEnc||"hex");aa(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var Ia=Ma;Ma.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Ma.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=ca.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var Pa=fa.assert;function Ra(e,t){if(e instanceof Ra)return e;this._importDER(e,t)||(Pa(e.r&&e.s,"Signature without r or s"),this.r=new hn(e.r,16),this.s=new hn(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Ta=Ra;function Ca(){this.place=0}function ka(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=t.place;s>>=0;return!(n<=127)&&(t.place=o,n)}function La(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Ra.prototype._importDER=function(e,t){e=fa.toArray(e,t);var r=new Ca;if(48!==e[r.place++])return!1;var i=ka(e,r);if(!1===i||i+r.place!==e.length||2!==e[r.place++])return!1;var n=ka(e,r);if(!1===n)return!1;var s=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var o=ka(e,r);if(!1===o||e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new hn(s),this.s=new hn(a),this.recoveryParam=null,!0},Ra.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=La(t),r=La(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];qa(i,t.length),(i=i.concat(t)).push(2),qa(i,r.length);var n=i.concat(r),s=[48];return qa(s,n.length),s=s.concat(n),fa.encode(s,e)};var Da=function(){throw new Error("unsupported")},Ua=fa.assert;function Ba(e){if(!(this instanceof Ba))return new Ba(e);"string"==typeof e&&(Ua(Object.prototype.hasOwnProperty.call(Ea,e),"Unknown curve "+e),e=Ea[e]),e instanceof Ea.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var za=Ba;Ba.prototype.keyPair=function(e){return new Na(this,e)},Ba.prototype.keyFromPrivate=function(e,t){return Na.fromPrivate(this,e,t)},Ba.prototype.keyFromPublic=function(e,t){return Na.fromPublic(this,e,t)},Ba.prototype.genKeyPair=function(e){e||(e={});for(var t=new Ia({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Da(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new hn(2));;){var n=new hn(t.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Ba.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ba.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new hn(e,16));for(var n=this.n.byteLength(),s=t.getPrivate().toArray("be",n),o=e.toArray("be",n),a=new Ia({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new hn(1)),c=0;;c++){var f=i.k?i.k(c):new hn(a.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(h)>=0)){var u=this.g.mul(f);if(!u.isInfinity()){var d=u.getX(),l=d.umod(this.n);if(0!==l.cmpn(0)){var p=f.invm(this.n).mul(l.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(u.getY().isOdd()?1:0)|(0!==d.cmp(l)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new Ta({r:l,s:p,recoveryParam:g})}}}}}},Ba.prototype.verify=function(e,t,r,i){e=this._truncateToN(new hn(e,16)),r=this.keyFromPublic(r,i);var n=(t=new Ta(t,"hex")).r,s=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),h=a.mul(e).umod(this.n),c=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(h,r.getPublic(),c)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(h,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},Ba.prototype.recoverPubKey=function(e,t,r,i){Ua((3&r)===r,"The recovery param is more than two bits"),t=new Ta(t,i);var n=this.n,s=new hn(e),o=t.r,a=t.s,h=1&r,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");o=c?this.curve.pointFromX(o.add(this.curve.n),h):this.curve.pointFromX(o,h);var f=t.r.invm(n),u=n.sub(s).mul(f).umod(n),d=a.mul(f).umod(n);return this.g.mulAdd(u,o,d)},Ba.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new Ta(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(e,t,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var ja=oa((function(e,t){var r=t;r.version="6.5.4",r.utils=fa,r.rand=function(){throw new Error("unsupported")},r.curve=Sa,r.curves=Ea,r.ec=za,r.eddsa=null})),Fa=ja.ec;const Ka=new Vi("signing-key/5.7.0");let Ha=null;function Va(){return Ha||(Ha=new Fa("secp256k1")),Ha}class Wa{constructor(e){rs(this,"curve","secp256k1"),rs(this,"privateKey",en(e)),32!==function(e){if("string"!=typeof e)e=en(e);else if(!Xi(e)||e.length%2)return null;return(e.length-2)/2}(this.privateKey)&&Ka.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Va().keyFromPrivate(Qi(this.privateKey));rs(this,"publicKey","0x"+t.getPublic(!1,"hex")),rs(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),rs(this,"_isSigningKey",!0)}_addPoint(e){const t=Va().keyFromPublic(Qi(this.publicKey)),r=Va().keyFromPublic(Qi(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Va().keyFromPrivate(Qi(this.privateKey)),r=Qi(e);32!==r.length&&Ka.throwArgumentError("bad digest length","digest",e);const i=t.sign(r,{canonical:!0});return nn({recoveryParam:i.recoveryParam,r:rn("0x"+i.r.toString(16),32),s:rn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const t=Va().keyFromPrivate(Qi(this.privateKey)),r=Va().keyFromPublic(Qi(Ga(e)));return rn("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Ga(e,t){const r=Qi(e);if(32===r.length){const e=new Wa(r);return t?"0x"+Va().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?en(r):"0x"+Va().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Va().keyFromPublic(r).getPublic(!0,"hex"):en(r):Ka.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Ya;function Ja(e,t){return function(e){return function(e){let t=null;if("string"!=typeof e&&Xn.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Zn(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Xn.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>es[e])).join("");for(;t.length>=ts;){let e=t.substring(0,ts);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&Xn.throwArgumentError("bad icap checksum","address",e),t=function(e){return new fn(e,36).toString(16)}(e.substring(4));t.length<40;)t="0"+t;t=Zn("0x"+t)}else Xn.throwArgumentError("invalid address","address",e);return t}(tn(sn(tn(Ga(e),1)),12))}(function(e,t){const r=nn(t),i={r:Qi(r.r),s:Qi(r.s)};return"0x"+Va().recoverPubKey(Qi(e),i,r.recoveryParam).encode("hex",!1)}(Qi(e),t))}new Vi("transactions/5.7.0"),function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Ya||(Ya={}));const $a="https://rpc.walletconnect.org/v1";var Qa=Object.defineProperty,Xa=Object.defineProperties,Za=Object.getOwnPropertyDescriptors,eh=Object.getOwnPropertySymbols,th=Object.prototype.hasOwnProperty,rh=Object.prototype.propertyIsEnumerable,ih=(e,t,r)=>t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const nh=e=>e?.split(":"),sh=e=>{const t=e&&nh(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]},oh=e=>{const t=e&&nh(e);if(t)return t[2]+":"+t[3]},ah=e=>{const t=e&&nh(e);if(t)return t.pop()};async function hh(e){const{cacao:t,projectId:r}=e,{s:i,p:n}=t,s=ch(n,n.iss),o=ah(n.iss);return await async function(e,t,r,i,n,s){switch(r.t){case"eip191":return function(e,t,r){return Ja(Qn(t),r).toLowerCase()===e.toLowerCase()}(e,t,r.s);case"eip1271":return await async function(e,t,r,i,n,s){try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",h="0000000000000000000000000000000000000000000000000000000000000041",c=r.substring(2),f=o+Qn(t).substring(2)+a+h+c,u=await fetch(`${s||$a}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:f},"latest"]})}),{result:d}=await u.json();return!!d&&d.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}(e,t,r.s,i,n,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}(o,s,i,sh(n.iss),r)}const ch=(e,t)=>{const r=`${e.domain} wants you to sign in with your Ethereum account:`,i=ah(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=e.statement||void 0;const s=`URI: ${e.aud||e.uri}`,o=`Version: ${e.version}`,a=`Chain ID: ${sh(t)}`,h=`Nonce: ${e.nonce}`,c=`Issued At: ${e.iat}`,f=e.exp?`Expiration Time: ${e.exp}`:void 0,u=e.nbf?`Not Before: ${e.nbf}`:void 0,d=e.requestId?`Request ID: ${e.requestId}`:void 0,l=e.resources?`Resources:${e.resources.map((e=>`\n- ${e}`)).join("")}`:void 0,p=mh(e.resources);return p&&(n=function(e="",t){fh(t);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;const i=[];let n=0;return Object.keys(t.att).forEach((e=>{const r=Object.keys(t.att[e]).map((e=>({ability:e.split("/")[0],action:e.split("/")[1]})));r.sort(((e,t)=>e.action.localeCompare(t.action)));const s={};r.forEach((e=>{s[e.ability]||(s[e.ability]=[]),s[e.ability].push(e.action)}));const o=Object.keys(s).map((t=>(n++,`(${n}) '${t}': '${s[t].join("', '")}' for '${e}'.`)));i.push(o.join(", ").replace(".,","."))})),`${e?e+" ":""}${r}${i.join(" ")}`}(n,lh(p))),[r,i,"",n,"",s,o,a,h,c,f,u,d,l].filter((e=>null!=e)).join("\n")};function fh(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(null==t||!t.length)throw new Error("No resources found in `att` property");t.forEach((t=>{const r=e.att[t];if(Array.isArray(r))throw new Error(`Resource must be an object: ${t}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(r).forEach((e=>{const t=r[e];if(!Array.isArray(t))throw new Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw new Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach((t=>{if("object"!=typeof t)throw new Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)}))}))}))}function uh(e,t,r={}){t=t?.sort(((e,t)=>e.localeCompare(t)));const i=t.map((t=>({[`${e}/${t}`]:[r]})));return Object.assign({},...i)}function dh(e){return fh(e),`urn:recap:${function(e){return Buffer.from(JSON.stringify(e)).toString("base64")}(e).replace(/=/g,"")}`}function lh(e){const t=function(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}(e.replace("urn:recap:",""));return fh(t),t}function ph(e,t){const r=function(e,t){fh(e),fh(t);const r=Object.keys(e.att).concat(Object.keys(t.att)).sort(((e,t)=>e.localeCompare(t))),i={att:{}};return r.forEach((r=>{var n,s;Object.keys((null==(n=e.att)?void 0:n[r])||{}).concat(Object.keys((null==(s=t.att)?void 0:s[r])||{})).sort(((e,t)=>e.localeCompare(t))).forEach((n=>{var s,o;i.att[r]=((e,t)=>Xa(e,Za(t)))(((e,t)=>{for(var r in t||(t={}))th.call(t,r)&&ih(e,r,t[r]);if(eh)for(var r of eh(t))rh.call(t,r)&&ih(e,r,t[r]);return e})({},i.att[r]),{[n]:(null==(s=e.att[r])?void 0:s[n])||(null==(o=t.att[r])?void 0:o[n])})}))})),i}(lh(e),lh(t));return dh(r)}function gh(e){var t;const r=lh(e);fh(r);const i=null==(t=r.att)?void 0:t.eip155;return i?Object.keys(i).map((e=>e.split("/")[1])):[]}function bh(e){const t=lh(e);fh(t);const r=[];return Object.values(t.att).forEach((e=>{Object.values(e).forEach((e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)}))})),[...new Set(r.flat())]}function mh(e){if(!e)return;const t=e?.[e.length-1];return function(e){return e&&e.includes("urn:recap:")}(t)?t:void 0}const yh="base10",vh="base16",wh="base64pad",_h="base64url",Ah="utf8";function Sh(){return Qr((0,De.randomBytes)(32),vh)}function Eh(e){return Qr((0,Fr.tW)($r(e,vh)),vh)}function Mh(e){return Qr((0,Fr.tW)($r(e,Ah)),vh)}function Ih(e){return $r(`${e}`,yh)}function xh(e){return Number(Qr(e,yh))}function Oh(e){const{encoding:t=wh}=e;if(2===xh(e.type))return Qr(Vr([e.type,e.sealed]),t);if(1===xh(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Qr(Vr([e.type,e.senderPublicKey,e.iv,e.sealed]),t)}return Qr(Vr([e.type,e.iv,e.sealed]),t)}function Nh(e){const{encoded:t,encoding:r=wh}=e,i=$r(t,r),n=i.slice(0,1);if(1===xh(n)){const e=33,t=e+12,r=i.slice(1,e),s=i.slice(e,t);return{type:n,sealed:i.slice(t),iv:s,senderPublicKey:r}}if(2===xh(n))return{type:n,sealed:i.slice(1),iv:(0,De.randomBytes)(12)};const s=i.slice(1,13);return{type:n,sealed:i.slice(13),iv:s}}function Ph(e){const t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function Rh(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function Th(e){return 2===e.type}function Ch(e){return e?.relay||{protocol:"irn"}}function kh(e){const t=Zr[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}var Lh=Object.defineProperty,qh=Object.defineProperties,Dh=Object.getOwnPropertyDescriptors,Uh=Object.getOwnPropertySymbols,Bh=Object.prototype.hasOwnProperty,zh=Object.prototype.propertyIsEnumerable,jh=(e,t,r)=>t in e?Lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fh=(e,t)=>{for(var r in t||(t={}))Bh.call(t,r)&&jh(e,r,t[r]);if(Uh)for(var r of Uh(t))zh.call(t,r)&&jh(e,r,t[r]);return e};function Kh(e,t="-"){const r={},i="relay"+t;return Object.keys(e).forEach((t=>{if(t.startsWith(i)){const n=t.replace(i,""),s=e[t];r[n]=s}})),r}function Hh(e){if(!e.includes("wc:")){const t=Ri(e);null!=t&&t.includes("wc:")&&(e=t)}const t=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,i=e.substring(0,t),n=e.substring(t+1,r).split("@"),s=typeof r<"u"?e.substring(r):"",o=Br.parse(s),a="string"==typeof o.methods?o.methods.split(","):void 0;return{protocol:i,topic:Vh(n[0]),version:parseInt(n[1],10),symKey:o.symKey,relay:Kh(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Vh(e){return e.startsWith("//")?e.substring(2):e}function Wh(e){return`${e.protocol}:${e.topic}@${e.version}?`+Br.stringify(Fh(((e,t)=>qh(e,Dh(t)))(Fh({symKey:e.symKey},function(e,t="-"){const r={};return Object.keys(e).forEach((i=>{const n="relay"+t+i;e[i]&&(r[n]=e[i])})),r}(e.relay)),{expiryTimestamp:e.expiryTimestamp}),e.methods?{methods:e.methods.join(",")}:{}))}function Gh(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var Yh=Object.defineProperty,Jh=Object.defineProperties,$h=Object.getOwnPropertyDescriptors,Qh=Object.getOwnPropertySymbols,Xh=Object.prototype.hasOwnProperty,Zh=Object.prototype.propertyIsEnumerable,ec=(e,t,r)=>t in e?Yh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tc=(e,t)=>{for(var r in t||(t={}))Xh.call(t,r)&&ec(e,r,t[r]);if(Qh)for(var r of Qh(t))Zh.call(t,r)&&ec(e,r,t[r]);return e},rc=(e,t)=>Jh(e,$h(t));function ic(e){const t=[];return e.forEach((e=>{const[r,i]=e.split(":");t.push(`${r}:${i}`)})),t}function nc(e){return e.includes(":")}function sc(e){return nc(e)?e.split(":")[0]:e}function oc(e){var t,r,i;const n={};if(!lc(e))return n;for(const[s,o]of Object.entries(e)){const e=nc(s)?[s]:o.chains,a=o.methods||[],h=o.events||[],c=sc(s);n[c]=rc(tc({},n[c]),{chains:xi(e,null==(t=n[c])?void 0:t.chains),methods:xi(a,null==(r=n[c])?void 0:r.methods),events:xi(h,null==(i=n[c])?void 0:i.events)})}return n}function ac(e,t){t=t.map((e=>e.replace("did:pkh:","")));const r=function(e){const t={};return e?.forEach((e=>{const[r,i]=e.split(":");t[r]||(t[r]={accounts:[],chains:[],events:[]}),t[r].accounts.push(e),t[r].chains.push(`${r}:${i}`)})),t}(t);for(const[t,i]of Object.entries(r))i.methods?i.methods=xi(i.methods,e):i.methods=e,i.events=["chainChanged","accountsChanged"];return r}const hc={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},cc={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function fc(e,t){const{message:r,code:i}=cc[e];return{message:t?`${r} ${t}`:r,code:i}}function uc(e,t){const{message:r,code:i}=hc[e];return{message:t?`${r} ${t}`:r,code:i}}function dc(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function lc(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function pc(e){return typeof e>"u"}function gc(e,t){return!(!t||!pc(e))||"string"==typeof e&&!!e.trim().length}function bc(e,t){return!(!t||!pc(e))||"number"==typeof e&&!isNaN(e)}function mc(e){return!(!gc(e,!1)||!e.includes(":"))&&2===e.split(":").length}function yc(e){let t=!0;return dc(e)?e.length&&(t=e.every((e=>gc(e,!1)))):t=!1,t}function vc(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const i=function(e,t){let r=null;return yc(e?.methods)?yc(e?.events)||(r=uc("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=uc("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}(e,`${t}, namespace`);i&&(r=i)})),r}function _c(e,t){let r=null;if(e&&lc(e)){const i=vc(e,t);i&&(r=i);const n=function(e,t){let r=null;return Object.values(e).forEach((e=>{if(r)return;const i=function(e,t){let r=null;return dc(e)?e.forEach((e=>{r||function(e){if(gc(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&mc(e)}}return!1}(e)||(r=uc("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))})):r=uc("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}(e?.accounts,`${t} namespace`);i&&(r=i)})),r}(e,t);n&&(r=n)}else r=fc("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function Ac(e){return gc(e.protocol,!0)}function Sc(e){return typeof e<"u"&&null!==typeof e}function Ec(e,t){return!(!mc(t)||!function(e){const t=[];return Object.values(e).forEach((e=>{t.push(...ic(e.accounts))})),t}(e).includes(t))}function Mc(e,t,r){let i=null;const n=function(e){const t={};return Object.keys(e).forEach((r=>{var i;r.includes(":")?t[r]=e[r]:null==(i=e[r].chains)||i.forEach((i=>{t[i]={methods:e[r].methods,events:e[r].events}}))})),t}(e),s=function(e){const t={};return Object.keys(e).forEach((r=>{if(r.includes(":"))t[r]=e[r];else{const i=ic(e[r].accounts);i?.forEach((i=>{t[i]={accounts:e[r].accounts.filter((e=>e.includes(`${i}:`))),methods:e[r].methods,events:e[r].events}}))}})),t}(t),o=Object.keys(n),a=Object.keys(s),h=Ic(Object.keys(e)),c=Ic(Object.keys(t)),f=h.filter((e=>!c.includes(e)));return f.length&&(i=fc("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${f.toString()}\n Received: ${Object.keys(t).toString()}`)),mi(o,a)||(i=fc("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${o.toString()}\n Approved: ${a.toString()}`)),Object.keys(t).forEach((e=>{if(!e.includes(":")||i)return;const n=ic(t[e].accounts);n.includes(e)||(i=fc("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}\n Required: ${e}\n Approved: ${n.toString()}`))})),o.forEach((e=>{i||(mi(n[e].methods,s[e].methods)?mi(n[e].events,s[e].events)||(i=fc("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):i=fc("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))})),i}function Ic(e){return[...new Set(e.map((e=>e.includes(":")?e.split(":")[0]:e)))]}function xc(){const e=pi();return new Promise((t=>{switch(e){case ci.browser:t(li()&&navigator?.onLine);break;case ci.reactNative:t(async function(){if(di()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo){const e=await(null==r.g?void 0:r.g.NetInfo.fetch());return e?.isConnected}return!0}());break;case ci.node:default:t(!0)}}))}const Oc={};class Nc{static get(e){return Oc[e]}static set(e,t){Oc[e]=t}static delete(e){delete Oc[e]}}function Pc(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const Rc=Pc("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Tc=Pc("ascii","a",(e=>{let t="a";for(let r=0;r{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;rt.code===e));return t||jc[Fc]}(e.code)),e);var r}class Qc{}class Xc extends Qc{constructor(){super()}}class Zc extends Xc{constructor(e){super()}}function ef(e){return function(e,t){const r=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}(e,"^wss?:")}function tf(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function rf(e){return tf(e)&&"method"in e}function nf(e){return tf(e)&&(sf(e)||of(e))}function sf(e){return"result"in e}function of(e){return"error"in e}class af extends Zc{constructor(e){super(e),this.events=new m.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Gc(e.method,e.params||[],e.id||Wc().toString()),t)}async requestStrict(e,t){return new Promise((async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(e){i(e)}this.events.on(`${e.id}`,(e=>{of(e)?i(e.error):r(e.result)}));try{await this.connection.send(e,t)}catch(e){i(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),nf(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(e=>this.onPayload(e))),this.connection.on("close",(e=>this.onClose(e))),this.connection.on("error",(e=>this.events.emit("error",e))),this.connection.on("register_error",(e=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const hf=e=>e.split("?")[0],cf=typeof WebSocket<"u"?WebSocket:typeof r.g<"u"&&typeof r.g.WebSocket<"u"?r.g.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:r(1591);class ff{constructor(e){if(this.url=e,this.events=new m.EventEmitter,this.registering=!1,!ef(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise(((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())}))}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Y(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!ef(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)}))}))}return this.url=e,this.registering=!0,new Promise(((t,i)=>{const n=new URLSearchParams(e).get("origin"),s=(0,Hc.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:(a=e,!new RegExp("wss?://localhost(:d{2,5})?").test(a))},o=new cf(e,[],s);var a;typeof WebSocket<"u"||typeof r.g<"u"&&typeof r.g.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=e=>{const t=e;i(this.emitError(t.error))}:o.on("error",(e=>{i(this.emitError(e))})),o.onopen=()=>{this.onOpen(o),t(o)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?G(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),i=Jc(e,r.message||r.toString());this.events.emit("payload",i)}parseError(e,t=this.url){return function(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable WS RPC url at ${t}`):e}(e,hf(t))}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${hf(this.url)}`));return this.events.emit("register_error",t),t}}var uf=r(8142),df=r.n(uf);const lf="core",pf=`wc@2:${lf}:`,gf={database:":memory:"},bf="client_ed25519_seed",mf=v.ONE_DAY,yf=v.SIX_HOURS,vf="wss://relay.walletconnect.org",wf="relayer_message",_f="relayer_message_ack",Af="relayer_connection_stalled",Sf="relayer_publish",Ef="payload",Mf="connect",If="disconnect",xf="error",Of="2.17.0",Nf={link_mode:"link_mode",relay:"relay"},Pf="WALLETCONNECT_LINK_MODE_APPS",Rf="subscription_created",Tf="subscription_deleted",Cf=1e3*v.FIVE_SECONDS,kf={wc_pairingDelete:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:v.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:v.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:v.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:v.ONE_DAY,prompt:!1,tag:0},res:{ttl:v.ONE_DAY,prompt:!1,tag:0}}},Lf="pairing_create",qf="pairing_delete",Df="history_created",Uf="history_updated",Bf="history_deleted",zf="expirer_created",jf="expirer_deleted",Ff="expirer_expired",Kf="https://verify.walletconnect.org",Hf=Kf,Vf=`${Hf}/v3`,Wf=["https://verify.walletconnect.com",Kf],Gf="malformed_pairing_uri",Yf="session_approve_started";var Jf=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);e[t];){var f=r[e.charCodeAt(t)];if(255===f)return;for(var u=0,d=s-1;(0!==f||u>>0,o[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");n=u,t++}if(" "!==e[t]){for(var l=s-n;l!==s&&0===o[l];)l++;for(var p=new Uint8Array(i+(s-l)),g=i;l!==s;)p[g++]=o[l++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*f+1>>>0,c=new Uint8Array(o);n!==s;){for(var u=t[n],d=0,l=o-1;(0!==u||d>>0,c[l]=u%a>>>0,u=u/a>>>0;if(0!==u)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var g=h.repeat(r);p{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class Qf{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Xf{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return eu(this,e)}}class Zf{constructor(e){this.decoders=e}or(e){return eu(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const eu=(e,t)=>new Zf({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class tu{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new Qf(e,t,r),this.decoder=new Xf(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ru=({name:e,prefix:t,encode:r,decode:i})=>new tu(e,t,r,i),iu=({prefix:e,name:t,alphabet:r})=>{const{encode:i,decode:n}=Jf(r,t);return ru({prefix:e,name:t,encode:i,decode:e=>$f(n(e))})},nu=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>ru({prefix:t,name:e,encode:e=>((e,t,r)=>{const i="="===t[t.length-1],n=(1<r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<((e,t,r,i)=>{const n={};for(let e=0;e=8&&(a-=8,o[c++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(t,i,r,e)}),su=ru({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var ou=Object.freeze({__proto__:null,identity:su});const au=nu({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var hu=Object.freeze({__proto__:null,base2:au});const cu=nu({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var fu=Object.freeze({__proto__:null,base8:cu});const uu=iu({prefix:"9",name:"base10",alphabet:"0123456789"});var du=Object.freeze({__proto__:null,base10:uu});const lu=nu({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),pu=nu({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var gu=Object.freeze({__proto__:null,base16:lu,base16upper:pu});const bu=nu({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),mu=nu({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yu=nu({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vu=nu({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wu=nu({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),_u=nu({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Au=nu({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Su=nu({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Eu=nu({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Mu=Object.freeze({__proto__:null,base32:bu,base32upper:mu,base32pad:yu,base32padupper:vu,base32hex:wu,base32hexupper:_u,base32hexpad:Au,base32hexpadupper:Su,base32z:Eu});const Iu=iu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),xu=iu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ou=Object.freeze({__proto__:null,base36:Iu,base36upper:xu});const Nu=iu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Pu=iu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ru=Object.freeze({__proto__:null,base58btc:Nu,base58flickr:Pu});const Tu=nu({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Cu=nu({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ku=nu({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Lu=nu({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var qu=Object.freeze({__proto__:null,base64:Tu,base64pad:Cu,base64url:ku,base64urlpad:Lu});const Du=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Uu=Du.reduce(((e,t,r)=>(e[r]=t,e)),[]),Bu=Du.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),zu=ru({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+Uu[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Bu[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var ju=Object.freeze({__proto__:null,base256emoji:zu}),Fu=128,Ku=-128,Hu=Math.pow(2,31),Vu=128,Wu=127,Gu=Math.pow(2,7),Yu=Math.pow(2,14),Ju=Math.pow(2,21),$u=Math.pow(2,28),Qu=Math.pow(2,35),Xu=Math.pow(2,42),Zu=Math.pow(2,49),ed=Math.pow(2,56),td=Math.pow(2,63),rd={encode:function e(t,r,i){r=r||[];for(var n=i=i||0;t>=Hu;)r[i++]=255&t|Fu,t/=128;for(;t&Ku;)r[i++]=255&t|Fu,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},decode:function e(t,r){var i,n=0,s=(r=r||0,0),o=r,a=t.length;do{if(o>=a)throw e.bytes=0,new RangeError("Could not decode varint");i=t[o++],n+=s<28?(i&Wu)<=Vu);return e.bytes=o-r,n},encodingLength:function(e){return e(id.encode(e,t,r),t),sd=e=>id.encodingLength(e),od=(e,t)=>{const r=t.byteLength,i=sd(e),n=i+sd(r),s=new Uint8Array(n+r);return nd(e,s,0),nd(r,s,i),s.set(t,n),new ad(e,r,t,s)};class ad{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}const hd=({name:e,code:t,encode:r})=>new cd(e,t,r);class cd{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?od(this.code,t):t.then((e=>od(this.code,e)))}throw Error("Unknown type, must be binary type")}}const fd=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ud=hd({name:"sha2-256",code:18,encode:fd("SHA-256")}),dd=hd({name:"sha2-512",code:19,encode:fd("SHA-512")});Object.freeze({__proto__:null,sha256:ud,sha512:dd});const ld=$f,pd={code:0,name:"identity",encode:ld,digest:e=>od(0,ld(e))};Object.freeze({__proto__:null,identity:pd}),new TextEncoder,new TextDecoder;const gd={...ou,...hu,...fu,...du,...gu,...Mu,...Ou,...Ru,...qu,...ju};function bd(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const md=bd("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),yd=bd("ascii","a",(e=>{let t="a";for(let r=0;r{const t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=fc("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=_e(t,this.name)}get context(){return we(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,yi(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?vi(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}}class _d{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.randomSessionIdentifier=Sh(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),Sr(Mr(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const e=function(){const e=Kr.TZ();return{privateKey:Qr(e.secretKey,vh),publicKey:Qr(e.publicKey,vh)}}();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();const t=Mr(await this.getClientSeed()),r=this.randomSessionIdentifier,i=mf;return await async function(e,t,r,i,n=(0,v.fromMiliseconds)(Date.now())){const s={alg:"EdDSA",typ:"JWT"},o={iss:Sr(i.publicKey),sub:e,aud:t,iat:n,exp:n+r},a=wr([Ar((h={header:s,payload:o}).header),Ar(h.payload)].join(Ue),je);var h;return function(e){return[Ar(e.header),Ar(e.payload),(t=e.signature,vr(t,Be))].join(Ue);var t}({header:s,payload:o,signature:qe._S(i.secretKey,a)})}(r,e,i,t)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();const i=function(e,t){const r=Kr.Tc($r(e,vh),$r(t,vh),!0);return Qr(new jr.i(Fr.aD,r).expand(32),vh)}(this.getPrivateKey(e),t);return this.setSymKey(i,r)},this.setSymKey=async(e,t)=>{this.isInitialized();const r=t||Eh(e);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();const i=Ph(r),n=Y(t);if(Th(i))return function(e,t){const r=Ih(2),i=(0,De.randomBytes)(12);return Oh({type:r,sealed:$r(e,Ah),iv:i,encoding:t})}(n,r?.encoding);if(Rh(i)){const t=i.senderPublicKey,r=i.receiverPublicKey;e=await this.generateSharedKey(t,r)}const s=this.getSymKey(e),{type:o,senderPublicKey:a}=i;return function(e){const t=Ih(typeof e.type<"u"?e.type:0);if(1===xh(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof e.senderPublicKey<"u"?$r(e.senderPublicKey,vh):void 0,i=typeof e.iv<"u"?$r(e.iv,vh):(0,De.randomBytes)(12);return Oh({type:t,sealed:new zr.g6($r(e.symKey,vh)).seal(i,$r(e.message,Ah)),iv:i,senderPublicKey:r,encoding:e.encoding})}({type:o,symKey:s,message:n,senderPublicKey:a,encoding:r?.encoding})},this.decode=async(e,t,r)=>{this.isInitialized();const i=function(e,t){const r=Nh({encoded:e,encoding:t?.encoding});return Ph({type:xh(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Qr(r.senderPublicKey,vh):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(Th(i)){const e=function(e,t){const{sealed:r}=Nh({encoded:e,encoding:t});return Qr(r,Ah)}(t,r?.encoding);return G(e)}if(Rh(i)){const t=i.receiverPublicKey,r=i.senderPublicKey;e=await this.generateSharedKey(t,r)}try{const i=function(e){const t=new zr.g6($r(e.symKey,vh)),{sealed:r,iv:i}=Nh({encoded:e.encoded,encoding:e?.encoding}),n=t.open(i,r);if(null===n)throw new Error("Failed to decrypt");return Qr(n,Ah)}({symKey:this.getSymKey(e),encoded:t,encoding:r?.encoding});return G(i)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=wh)=>xh(Nh({encoded:e,encoding:t}).type),this.getPayloadSenderPublicKey=(e,t=wh)=>{const r=Nh({encoded:e,encoding:t});return r.senderPublicKey?function(e,t="utf8"){const r=Cc[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}(r.senderPublicKey,vh):void 0},this.core=e,this.logger=_e(t,this.name),this.keychain=r||new wd(this.core,this.logger)}get context(){return we(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(bf)}catch{e=Sh(),await this.keychain.set(bf,e)}return function(e,t="utf8"){const r=vd[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):globalThis.Buffer.from(e,"utf8")}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Ad extends Me{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=pf,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();const r=Mh(t);let i=this.messages.get(e);return typeof i>"u"&&(i={}),typeof i[r]<"u"||(i[r]=t,this.messages.set(e,i),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[Mh(t)]<"u"),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=_e(e,this.name),this.core=t}get context(){return we(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,yi(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?vi(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Sd extends Ie{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new m.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,v.toMiliseconds)(v.ONE_MINUTE),this.failedPublishTimeout=(0,v.toMiliseconds)(v.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});const n=r?.ttl||yf,s=Ch(r),o=r?.prompt||!1,a=r?.tag||0,h=r?.id||Wc().toString(),c={topic:e,message:t,opts:{ttl:n,relay:s,prompt:o,tag:a,id:h,attestation:r?.attestation}},f=`Failed to publish payload, please try again. id:${h} tag:${a}`,u=Date.now();let d,l=1;try{for(;void 0===d;){if(Date.now()-u>this.publishTimeout)throw new Error(f);this.logger.trace({id:h,attempts:l},`publisher.publish - attempt ${l}`),d=await await _i(this.rpcPublish(e,t,n,s,o,a,h,r?.attestation).catch((e=>this.logger.warn(e))),this.publishTimeout,f),l++,d||await new Promise((e=>setTimeout(e,this.failedPublishTimeout)))}this.relayer.events.emit(Sf,c),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:h,topic:e,message:t,opts:r}})}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(i=r?.internal)&&i.throwOnFailedPublish)throw e;this.queue.set(h,c)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=_e(t,this.name),this.registerEventListeners()}get context(){return we(this.logger)}rpcPublish(e,t,r,i,n,s,o,a){var h,c,f,u;const d={method:kh(i.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:n,tag:s,attestation:a},id:o};return pc(null==(h=d.params)?void 0:h.prompt)&&(null==(c=d.params)||delete c.prompt),pc(null==(f=d.params)?void 0:f.tag)&&(null==(u=d.params)||delete u.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:d}),this.relayer.request(d)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach((async e=>{const{topic:t,message:r,opts:i}=e;await this.publish(t,r,i)}))}registerEventListeners(){this.relayer.core.heartbeat.on(S,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(Af);this.checkQueue()})),this.relayer.on(_f,(e=>{this.removeRequestFromQueue(e.id.toString())}))}}class Ed{constructor(){this.map=new Map,this.set=(e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const i=r.filter((e=>e!==t));i.length?this.map.set(e,i):this.map.delete(e)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Md=Object.defineProperty,Id=Object.defineProperties,xd=Object.getOwnPropertyDescriptors,Od=Object.getOwnPropertySymbols,Nd=Object.prototype.hasOwnProperty,Pd=Object.prototype.propertyIsEnumerable,Rd=(e,t,r)=>t in e?Md(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Td=(e,t)=>{for(var r in t||(t={}))Nd.call(t,r)&&Rd(e,r,t[r]);if(Od)for(var r of Od(t))Pd.call(t,r)&&Rd(e,r,t[r]);return e},Cd=(e,t)=>Id(e,xd(t));class kd extends Ne{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new Ed,this.events=new m.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=pf,this.subscribeTimeout=(0,v.toMiliseconds)(v.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const r=Ch(t),i={topic:e,relay:r,transportType:t?.transportType};this.pending.set(e,i);const n=await this.rpcSubscribe(e,r,t?.transportType);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),n}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),typeof t?.id<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>{if(this.topics.includes(e))return!0;const t=`${this.pendingSubscriptionWatchLabel}_${e}`;return await new Promise(((r,i)=>{const n=new v.Watch;n.start(t);const s=setInterval((()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(s),n.stop(t),r(!0)),n.elapsed(t)>=Cf&&(clearInterval(s),n.stop(t),i(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1))},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=_e(t,this.name),this.clientId=""}get context(){return we(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map((async r=>await this.unsubscribeById(e,r,t))))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const i=Ch(r);await this.rpcUnsubscribe(e,t,i);const n=uc("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r=Nf.relay){r===Nf.relay&&await this.restartToComplete();const i={method:kh(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{const t=Mh(e+this.clientId);return r===Nf.link_mode?(setTimeout((()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch((e=>this.logger.warn(e)))}),(0,v.toMiliseconds)(v.ONE_SECOND)),t):await await _i(this.relayer.request(i).catch((e=>this.logger.warn(e))),this.subscribeTimeout)?t:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Af)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:kh(e[0].relay.protocol).batchSubscribe,params:{topics:e.map((e=>e.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await _i(this.relayer.request(t).catch((e=>this.logger.warn(e))),this.subscribeTimeout)}catch{this.relayer.events.emit(Af)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t={method:kh(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map((e=>e.topic))}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{r=await await _i(this.relayer.request(t).catch((e=>this.logger.warn(e))),this.subscribeTimeout)}catch{this.relayer.events.emit(Af)}return r}rpcUnsubscribe(e,t,r){const i={method:kh(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,Cd(Td({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach((e=>{this.setSubscription(e.id,Td({},e)),this.pending.delete(e.topic)}))}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,Td({},t)),this.topicMap.set(t.topic,e),this.events.emit(Rf,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=fc("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(Tf,Cd(Td({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit("subscription_sync")}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:e}=fc("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);dc(t)&&this.onBatchSubscribe(t.map(((t,r)=>Cd(Td({},e[r]),{id:t}))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach((t=>{e.push(t)})),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(S,(async()=>{await this.checkPending()})),this.events.on(Rf,(async e=>{const t=Rf;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})),this.events.on(Tf,(async e=>{const t=Tf;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise((e=>{const t=setInterval((()=>{this.restartInProgress||(clearInterval(t),e())}),this.pollingInterval)}))}}var Ld=Object.defineProperty,qd=Object.getOwnPropertySymbols,Dd=Object.prototype.hasOwnProperty,Ud=Object.prototype.propertyIsEnumerable,Bd=(e,t,r)=>t in e?Ld(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class zd extends xe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new m.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,v.toMiliseconds)(v.THIRTY_SECONDS+v.ONE_SECOND),this.request=async e=>{var t,r;this.logger.debug("Publishing Request Payload");const i=e.id||Wc().toString();await this.toEstablishConnection();try{const n=this.provider.request(e);this.requestsInFlight.set(i,{promise:n,request:e}),this.logger.trace({id:i,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - attempt to publish...");const s=await new Promise((async(e,t)=>{const r=()=>{t(new Error(`relayer.request - publish interrupted, id: ${i}`))};this.provider.on(If,r);const s=await n;this.provider.off(If,r),e(s)}));return this.logger.trace({id:i,method:e.method,topic:null==(r=e.params)?void 0:r.topic},"relayer.request - published"),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${i}`),e}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if(ui())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((()=>{var e,t,r;null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)||r.terminate()}),this.heartBeatTimeout)}catch(e){this.logger.warn(e)}},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit("relayer_connect")},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.error(e),this.events.emit("relayer_error",e),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Ef,this.onPayloadHandler),this.provider.on(Mf,this.onConnectHandler),this.provider.on(If,this.onDisconnectHandler),this.provider.on(xf,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?_e(e.logger,this.name):ie()(ve({level:e.logger||"error"})),this.messages=new Ad(this.logger,e.core),this.subscriber=new kd(this,this.logger),this.publisher=new Sd(this,this.logger),this.relayUrl=e?.relayUrl||vf,this.projectId=e.projectId,this.bundleId=function(){var e;try{return di()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Application)<"u"?null==(e=r.g.Application)?void 0:e.applicationId:void 0}catch{return}}(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return we(this.logger)}get connected(){var e,t,r;return 1===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)}get connecting(){var e,t,r;return 0===(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Nf.relay})}async subscribe(e,t){var r;this.isInitialized(),"relay"===t?.transportType&&await this.toEstablishConnection();let i,n=(null==(r=this.subscriber.topicMap.get(e))?void 0:r[0])||"";const s=t=>{t.topic===e&&(this.subscriber.off(Rf,s),i())};return await Promise.all([new Promise((e=>{i=e,this.subscriber.on(Rf,s)})),new Promise((async r=>{n=await this.subscriber.subscribe(e,t)||n,r()}))]),n}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map((e=>e.promise)))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await _i(this.provider.disconnect(),2e3,"provider.disconnect()").catch((()=>this.onProviderDisconnect())):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise((async(e,t)=>{const r=()=>{this.provider.off(If,r),t(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(If,r),await _i(this.provider.connect(),(0,v.toMiliseconds)(v.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch((e=>{t(e)})).finally((()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0})),this.subscriber.start().catch((e=>{this.logger.error(e),this.onDisconnectHandler()})),this.hasExperiencedNetworkDisruption=!1,e()}))}catch(e){this.logger.error(e);const t=e;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(t.message))throw e}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await xc())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(0===e?.length)return void this.logger.trace("Batch message events is empty. Ignoring...");const t=e.sort(((e,t)=>e.publishedAt-t.publishedAt));this.logger.trace(`Batch of ${t.length} message events sorted`);for(const e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:r}=e;if(!t.sessionExists){const e={topic:r,expiry:Ei(v.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,e)}this.events.emit(wf,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,r,i,n;if(ui())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",(()=>{this.resetPingTimeout()}))),this.resetPingTimeout()}catch(e){this.logger.warn(e)}}isConnectionStalled(e){return this.staleConnectionErrors.some((t=>e.includes(t)))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new af(new ff(function({protocol:e,version:t,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:o,bundleId:a}){const h=r.split("?"),c={auth:n,ua:bi(e,t,i),projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},f=function(e,t){let r=Br.parse(e);return r=ai(ai({},r),t),Br.stringify(r)}(h[1]||"",c);return h[0]+"?"+f}({sdkVersion:Of,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const i=this.messages.has(t,r);return i&&this.logger.debug(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),rf(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:r,message:i,publishedAt:n,attestation:s}=t.data,o={topic:r,message:i,publishedAt:n,transportType:Nf.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(((e,t)=>{for(var r in t||(t={}))Dd.call(t,r)&&Bd(e,r,t[r]);if(qd)for(var r of qd(t))Ud.call(t,r)&&Bd(e,r,t[r]);return e})({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else nf(e)&&this.events.emit(_f,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(wf,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Yc(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Ef,this.onPayloadHandler),this.provider.off(Mf,this.onConnectHandler),this.provider.off(If,this.onDisconnectHandler),this.provider.off(xf,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await xc();!function(e){switch(pi()){case ci.browser:!function(e){!di()&&li()&&(window.addEventListener("online",(()=>e(!0))),window.addEventListener("offline",(()=>e(!1))))}(e);break;case ci.reactNative:!function(e){di()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener((t=>e(t?.isConnected)))}(e);case ci.node:}}((async t=>{e!==t&&(e=t,t?await this.restartTransport().catch((e=>this.logger.error(e))):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}))}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit("relayer_disconnect"),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout((async()=>{await this.transportOpen().catch((e=>this.logger.error(e)))}),(0,v.toMiliseconds)(.1))))}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise((e=>{const t=setInterval((()=>{this.connected&&(clearInterval(t),e())}),this.connectionStatusPollingInterval)})),await this.transportOpen())}}var jd=Object.defineProperty,Fd=Object.getOwnPropertySymbols,Kd=Object.prototype.hasOwnProperty,Hd=Object.prototype.propertyIsEnumerable,Vd=(e,t,r)=>t in e?jd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wd=(e,t)=>{for(var r in t||(t={}))Kd.call(t,r)&&Vd(e,r,t[r]);if(Fd)for(var r of Fd(t))Hd.call(t,r)&&Vd(e,r,t[r]);return e};class Gd extends Oe{constructor(e,t,r,i=pf,n=void 0){super(e,t,r,i),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=pf,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>{this.getKey&&null!==e&&!pc(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return e?.topic}(e)&&this.map.set(e.topic,e)})),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter((t=>Object.keys(e).every((r=>df()(t[r],e[r]))))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const r=Wd(Wd({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=_e(t,this.name),this.storagePrefix=i,this.getKey=n}get context(){return we(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:t}=fc("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}const{message:t}=fc("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=fc("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Yd{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(y()),this.initialized=!1,this.storagePrefix=pf,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();const t=Sh(),r=await this.core.crypto.setSymKey(t),i=Ei(v.FIVE_MINUTES),n={protocol:"irn"},s={topic:r,expiry:i,relay:n,active:!1,methods:e?.methods},o=Wh({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:n,expiryTimestamp:i,methods:e?.methods});return this.events.emit(Lf,s),this.core.expirer.set(r,i),await this.pairings.set(r,s),await this.core.relayer.subscribe(r,{transportType:e?.transportType}),{topic:r,uri:o}},this.pair=async e=>{this.isInitialized();const t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:["pairing_started"]}});this.isValidPair(e,t);const{topic:r,symKey:i,relay:n,expiryTimestamp:s,methods:o}=Hh(e.uri);let a;if(t.props.properties.topic=r,t.addTrace("pairing_uri_validation_success"),t.addTrace("pairing_uri_not_expired"),this.pairings.keys.includes(r)){if(a=this.pairings.get(r),t.addTrace("existing_pairing"),a.active)throw t.setError("active_pairing_already_exists"),new Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);t.addTrace("pairing_not_expired")}const h=s||Ei(v.FIVE_MINUTES),c={topic:r,relay:n,expiry:h,active:!1,methods:o};this.core.expirer.set(r,h),await this.pairings.set(r,c),t.addTrace("store_new_pairing"),e.activatePairing&&await this.activate({topic:r}),this.events.emit(Lf,c),t.addTrace("emit_inactive_pairing"),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(i,r),t.addTrace("subscribing_pairing_topic");try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError("no_internet_connection")}try{await this.core.relayer.subscribe(r,{relay:n})}catch(e){throw t.setError("subscribe_pairing_topic_failure"),e}return t.addTrace("subscribe_pairing_topic_success"),c},this.activate=async({topic:e})=>{this.isInitialized();const t=Ei(v.THIRTY_DAYS);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=wi();this.events.once(Ii("pairing_ping",e),(({error:e})=>{e?n(e):i()})),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",uc("USER_DISCONNECTED")),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();const{topic:t,relay:r,expiry:i,methods:n}=e,s=this.core.crypto.keychain.get(t);return Wh({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:r,expiryTimestamp:i,methods:n})},this.sendRequest=async(e,t,r)=>{const i=Gc(t,r),n=await this.core.crypto.encode(e,i),s=kf[t].req;return this.core.history.set(e,i),this.core.relayer.publish(e,n,s),i.id},this.sendResult=async(e,t,r)=>{const i=Yc(e,r),n=await this.core.crypto.encode(t,i),s=await this.core.history.get(t,e),o=kf[s.request.method].res;await this.core.relayer.publish(t,n,o),await this.core.history.resolve(i)},this.sendError=async(e,t,r)=>{const i=Jc(e,r),n=await this.core.crypto.encode(t,i),s=await this.core.history.get(t,e),o=kf[s.request.method]?kf[s.request.method].res:kf.unregistered_method.res;await this.core.relayer.publish(t,n,o),await this.core.history.resolve(i)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,uc("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{const e=this.pairings.getAll().filter((e=>Mi(e.expiry)));await Promise.all(e.map((e=>this.deletePairing(e.topic))))},this.onRelayEventRequest=e=>{const{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:r}=e,i=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===i?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit("pairing_ping",{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{const{id:r}=t;setTimeout((()=>{sf(t)?this.events.emit(Ii("pairing_ping",r),{}):of(t)&&this.events.emit(Ii("pairing_ping",r),{error:t.error})}),500)},this.onPairingDeleteRequest=async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(qf,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{const{id:r,method:i}=t;try{if(this.registeredMethods.includes(i))return;const t=uc("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(uc("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=(e,t)=>{var r;if(!Sc(e)){const{message:r}=fc("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(Gf),new Error(r)}if(!function(e){function t(e){try{return typeof new URL(e)<"u"}catch{return!1}}try{if(gc(e,!1))return!!t(e)||t(Ri(e))}catch{}return!1}(e.uri)){const{message:r}=fc("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(Gf),new Error(r)}const i=Hh(e?.uri);if(null==(r=i?.relay)||!r.protocol){const{message:e}=fc("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(Gf),new Error(e)}if(null==i||!i.symKey){const{message:e}=fc("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(Gf),new Error(e)}if(null!=i&&i.expiryTimestamp&&(0,v.toMiliseconds)(i?.expiryTimestamp){if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!gc(e,!1)){const{message:t}=fc("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=fc("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=fc("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}},this.core=e,this.logger=_e(t,this.name),this.pairings=new Gd(this.core,this.logger,this.name,this.storagePrefix)}get context(){return we(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(wf,(async e=>{const{topic:t,message:r,transportType:i}=e;if(!this.pairings.keys.includes(t)||i===Nf.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const n=await this.core.crypto.decode(t,r);try{rf(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):nf(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(e){this.logger.error(e)}}))}registerExpirerEvents(){this.core.expirer.on(Ff,(async e=>{const{topic:t}=Si(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit("pairing_expire",{topic:t}))}))}}class Jd extends Ee{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new m.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=pf,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.records.set(e.id,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;const i={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:Ei(v.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(Df,i)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=of(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(Uf,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach((r=>{if(r.topic===e){if(typeof t<"u"&&r.id!==t)return;this.records.delete(r.id),this.events.emit(Bf,r)}})),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=_e(t,this.name)}get context(){return we(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach((t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:Gc(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)})),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=fc("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit("history_sync")}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=fc("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Df,(e=>{const t=Df;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})})),this.events.on(Uf,(e=>{const t=Uf;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})})),this.events.on(Bf,(e=>{const t=Bf;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})})),this.core.heartbeat.on(S,(()=>{this.cleanup()}))}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach((t=>{(0,v.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(Bf,t,!1),e=!0)})),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $d extends Pe{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new m.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=pf,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((e=>this.expirations.set(e.target,e))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch{return!1}},this.set=(e,t)=>{this.isInitialized();const r=this.formatTarget(e),i={target:r,expiry:t};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit(zf,{target:r,expiration:i})},this.get=e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(jf,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=_e(t,this.name)}get context(){return we(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return Ai("topic",e)}(e);if("number"==typeof e)return function(e){return Ai("id",e)}(e);const{message:t}=fc("UNKNOWN_TYPE","Target type: "+typeof e);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit("expirer_sync")}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=fc("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=fc("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:r}=t;(0,v.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Ff,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((e,t)=>this.checkExpiry(t,e)))}registerEventListeners(){this.core.heartbeat.on(S,(()=>this.checkExpirations())),this.events.on(zf,(e=>{const t=zf;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(Ff,(e=>{const t=Ff;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})),this.events.on(jf,(e=>{const t=jf;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Qd={};function Xd(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}function Zd(e){const t=Xd(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.getLocalStorage=Qd.getLocalStorageOrThrow=Qd.getCrypto=Qd.getCryptoOrThrow=Qd.getLocation=Qd.getLocationOrThrow=Qd.getNavigator=Qd.getNavigatorOrThrow=el=Qd.getDocument=Qd.getDocumentOrThrow=Qd.getFromWindowOrThrow=Qd.getFromWindow=void 0,Qd.getFromWindow=Xd,Qd.getFromWindowOrThrow=Zd,Qd.getDocumentOrThrow=function(){return Zd("document")};var el=Qd.getDocument=function(){return Xd("document")};Qd.getNavigatorOrThrow=function(){return Zd("navigator")},Qd.getNavigator=function(){return Xd("navigator")},Qd.getLocationOrThrow=function(){return Zd("location")},Qd.getLocation=function(){return Xd("location")},Qd.getCryptoOrThrow=function(){return Zd("crypto")},Qd.getCrypto=function(){return Xd("crypto")},Qd.getLocalStorageOrThrow=function(){return Zd("localStorage")},Qd.getLocalStorage=function(){return Xd("localStorage")};class tl extends Re{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,this.name="verify-api",this.verifyUrlV3=Vf,this.storagePrefix=pf,this.version=2,this.init=async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,v.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt){if(!li()||this.isDevEnv)return;const t=window.location.origin,{id:r,decryptedId:i}=e,n=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${i}`;try{const e=el(),t=this.startAbortTimer(5*v.ONE_SECOND),i=await new Promise(((i,s)=>{const o=()=>{window.removeEventListener("message",h),e.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",o);const a=e.createElement("iframe");a.src=n,a.style.display="none",a.addEventListener("error",o,{signal:this.abortController.signal});const h=n=>{if(n.data&&"string"==typeof n.data)try{const s=JSON.parse(n.data);if("verify_attestation"===s.type){if(Er(s.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",h),i(null===s.attestation?"":s.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",h,{signal:this.abortController.signal})}));return this.logger.debug("jwt attestation",i),i}catch(e){this.logger.warn(e)}return""},this.resolve=async e=>{if(this.isDevEnv)return"";const{attestationId:t,hash:r,encryptedId:i}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if(Er(t).payload.id!==i)return;const e=await this.isValidJwtAttestation(t);if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;const n=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,n)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);const r=this.startAbortTimer(5*v.ONE_SECOND),i=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.getVerifyUrl=e=>{let t=e||Hf;return Wf.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${Hf}`),t=Hf),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const e=this.startAbortTimer(v.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{const t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}const r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise((async e=>{const t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))}));const e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{const r=function(e,t){const[r,i,n]=e.split("."),s=function(e){return Buffer.from(function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");const r=t.length%4;return r>0&&(t+="=".repeat(4-r)),t}(e),"base64")}(n);if(64!==s.length)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),h=`${r}.${i}`,c=(new Fr.aD).update(Buffer.from(h)).digest(),f=function(e){return new Xr.ec("p256").keyFromPublic({x:Buffer.from(e.x,"base64").toString("hex"),y:Buffer.from(e.y,"base64").toString("hex")},"hex")}(t),u=Buffer.from(c).toString("hex");if(!f.verify(u,{r:o,s:a}))throw new Error("Invalid signature");return Er(e).payload}(e,t.publicKey),i={hasExpired:(0,v.toMiliseconds)(r.exp)this.abortController.abort()),(0,v.toMiliseconds)(e))}}class rl extends Te{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context="echo",this.registerDeviceToken=async e=>{const{clientId:t,token:r,notificationType:i,enableEncrypted:n=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:i,token:r,always_raw:n})})},this.logger=_e(t,this.context)}}var il=Object.defineProperty,nl=Object.getOwnPropertySymbols,sl=Object.prototype.hasOwnProperty,ol=Object.prototype.propertyIsEnumerable,al=(e,t,r)=>t in e?il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hl=(e,t)=>{for(var r in t||(t={}))sl.call(t,r)&&al(e,r,t[r]);if(nl)for(var r of nl(t))ol.call(t,r)&&al(e,r,t[r]);return e};class cl extends Ce{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,this.context="event-client",this.storagePrefix=pf,this.storageVersion=.1,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!Pi())try{const e={eventId:Ni(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:bi(this.core.relayer.protocol,this.core.relayer.version,Of)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{const{event:t="ERROR",type:r="",properties:{topic:i,trace:n}}=e,s=Ni(),o=this.core.projectId||"",a=Date.now(),h=hl({eventId:s,timestamp:a,props:{event:t,type:r,properties:{topic:i,trace:n}},bundleId:o,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,h),this.shouldPersist=!0),h},this.getEvent=e=>{const{eventId:t,topic:r}=e;if(t)return this.events.get(t);const i=Array.from(this.events.values()).find((e=>e.props.properties.topic===r));return i?hl(hl({},i),this.setMethods(i.eventId)):void 0},this.deleteEvent=e=>{const{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(S,(async()=>{this.shouldPersist&&await this.persist(),this.events.forEach((e=>{(0,v.fromMiliseconds)(Date.now())-(0,v.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)}))}))},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{const r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)},this.setError=(e,t)=>{const r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach((e=>{this.events.set(e.eventId,hl(hl({},e),this.setMethods(e.eventId)))}))}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const e=[];for(const[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(const t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{const t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Of}${t}`,{method:"POST",body:JSON.stringify(e)})},this.getAppDomain=()=>gi().url,this.logger=_e(t,this.context),this.telemetryEnabled=r,r?this.restore().then((async()=>{await this.submit(),this.setEventListeners()})):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var fl=Object.defineProperty,ul=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,ll=Object.prototype.propertyIsEnumerable,pl=(e,t,r)=>t in e?fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gl=(e,t)=>{for(var r in t||(t={}))dl.call(t,r)&&pl(e,r,t[r]);if(ul)for(var r of ul(t))ll.call(t,r)&&pl(e,r,t[r]);return e};class bl extends Se{constructor(e){var t;super(e),this.protocol="wc",this.version=2,this.name=lf,this.events=new m.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;const i={topic:e,message:t,publishedAt:Date.now(),transportType:Nf.link_mode};this.relayer.onLinkMessageEvent(i,{sessionExists:r})},this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||vf,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const r=ve({level:"string"==typeof e?.logger&&e.logger?e.logger:"error"}),{logger:i,chunkLoggerController:n}=Ae({opts:r,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=n,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=_e(i,this.name),this.heartbeat=new E,this.crypto=new _d(this,this.logger,e?.keychain),this.history=new Jd(this,this.logger),this.expirer=new $d(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new te(gl(gl({},gf),e?.storageOptions)),this.relayer=new zd({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Yd(this,this.logger),this.verify=new tl(this,this.logger,this.storage),this.echoClient=new rl(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new cl(this,this.logger,e?.telemetryEnabled)}static async init(e){const t=new bl(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return we(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(Pf,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Pf)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const ml=bl,yl="client",vl=`wc@2:${yl}:`,wl=yl,_l="WALLETCONNECT_DEEPLINK_CHOICE",Al=v.SEVEN_DAYS,Sl={wc_sessionPropose:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1104},res:{ttl:v.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1106},res:{ttl:v.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1112},res:{ttl:v.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1114},res:{ttl:v.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:v.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:v.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1119}}},El={min:v.FIVE_MINUTES,max:v.SEVEN_DAYS},Ml="IDLE",Il="ACTIVE",xl=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],Ol="wc@1.5:auth:",Nl=`${Ol}:PUB_KEY`;var Pl=Object.defineProperty,Rl=Object.defineProperties,Tl=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,kl=Object.prototype.hasOwnProperty,Ll=Object.prototype.propertyIsEnumerable,ql=(e,t,r)=>t in e?Pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dl=(e,t)=>{for(var r in t||(t={}))kl.call(t,r)&&ql(e,r,t[r]);if(Cl)for(var r of Cl(t))Ll.call(t,r)&&ql(e,r,t[r]);return e},Ul=(e,t)=>Rl(e,Tl(t));class Bl extends Le{constructor(e){super(e),this.name="engine",this.events=new(y()),this.initialized=!1,this.requestQueue={state:Ml,queue:[]},this.sessionRequestQueue={state:Ml,queue:[]},this.requestQueueDelay=v.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Sl)}),this.initialized=!0,setTimeout((()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()}),(0,v.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const t=Ul(Dl({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=t;let a,h=r,c=!1;try{h&&(c=this.client.core.pairing.pairings.get(h).active)}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),e}if(!h||!c){const{topic:e,uri:t}=await this.client.core.pairing.create();h=e,a=t}if(!h){const{message:e}=fc("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(e)}const f=await this.client.core.crypto.generateKeyPair(),u=Sl.wc_sessionPropose.req.ttl||v.FIVE_MINUTES,d=Ei(u),l=Dl({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:f,metadata:this.client.metadata},expiryTimestamp:d,pairingTopic:h},s&&{sessionProperties:s}),{reject:p,resolve:g,done:b}=wi(u,"Proposal expired");this.events.once(Ii("session_connect"),(async({error:e,session:t})=>{if(e)p(e);else if(t){t.self.publicKey=f;const e=Ul(Dl({},t),{pairingTopic:l.pairingTopic,requiredNamespaces:l.requiredNamespaces,optionalNamespaces:l.optionalNamespaces,transportType:Nf.relay});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:t.peer.metadata}),this.cleanupDuplicatePairings(e),g(e)}}));const m=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:l,throwOnFailedPublish:!0});return await this.setProposal(m,Dl({id:m},l)),{uri:a,approval:b}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}},this.approve=async e=>{var t,r,i;const n=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[Yf]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw n.setError("no_internet_connection"),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),n.setError("proposal_not_found"),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError("session_approve_namespace_validation_failure"),e}const{id:s,relayProtocol:o,namespaces:a,sessionProperties:h,sessionConfig:c}=e,f=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:n.eventId});const{pairingTopic:u,proposer:d,requiredNamespaces:l,optionalNamespaces:p}=f;let g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:u});g||(g=null==(i=this.client.core.eventClient)?void 0:i.createEvent({type:Yf,properties:{topic:u,trace:[Yf,"session_namespaces_validation_success"]}}));const b=await this.client.core.crypto.generateKeyPair(),m=d.publicKey,y=await this.client.core.crypto.generateSharedKey(b,m),v=Dl(Dl({relay:{protocol:o??"irn"},namespaces:a,controller:{publicKey:b,metadata:this.client.metadata},expiry:Ei(Al)},h&&{sessionProperties:h}),c&&{sessionConfig:c}),w=Nf.relay;g.addTrace("subscribing_session_topic");try{await this.client.core.relayer.subscribe(y,{transportType:w})}catch(e){throw g.setError("subscribe_session_topic_failure"),e}g.addTrace("subscribe_session_topic_success");const _=Ul(Dl({},v),{topic:y,requiredNamespaces:l,optionalNamespaces:p,pairingTopic:u,acknowledged:!1,self:v.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:b,transportType:Nf.relay});await this.client.session.set(y,_),g.addTrace("store_session");try{g.addTrace("publishing_session_settle"),await this.sendRequest({topic:y,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0}).catch((e=>{throw g?.setError("session_settle_publish_failure"),e})),g.addTrace("session_settle_publish_success"),g.addTrace("publishing_session_approve"),await this.sendResult({id:s,topic:u,result:{relay:{protocol:o??"irn"},responderPublicKey:b},throwOnFailedPublish:!0}).catch((e=>{throw g?.setError("session_approve_publish_failure"),e})),g.addTrace("session_approve_publish_success")}catch(e){throw this.client.logger.error(e),this.client.session.delete(y,uc("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(y),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:u,metadata:d.metadata}),await this.client.proposal.delete(s,uc("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:u}),await this.setExpiry(y,Ei(Al)),{topic:y,acknowledged:()=>Promise.resolve(this.client.session.get(y))}},this.reject=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}const{id:t,reason:r}=e;let i;try{i=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}i&&(await this.sendError({id:t,topic:i,error:r,rpcOpts:Sl.wc_sessionPropose.reject}),await this.client.proposal.delete(t,uc("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}const{topic:t,namespaces:r}=e,{done:i,resolve:n,reject:s}=wi(),o=Vc(),a=Wc().toString(),h=this.client.session.get(t).namespaces;return this.events.once(Ii("session_update",o),(({error:e})=>{e?s(e):n()})),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch((e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:h}),s(e)})),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}const{topic:t}=e,r=Vc(),{done:i,resolve:n,reject:s}=wi();return this.events.once(Ii("session_extend",r),(({error:e})=>{e?s(e):n()})),await this.setExpiry(t,Ei(Al)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch((e=>{s(e)})),{acknowledged:i}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}const{chainId:t,request:i,topic:n,expiry:s=Sl.wc_sessionRequest.req.ttl}=e,o=this.client.session.get(n);o?.transportType===Nf.relay&&await this.confirmOnlineStateOrThrow();const a=Vc(),h=Wc().toString(),{done:c,resolve:f,reject:u}=wi(s,"Request expired. Please try again.");this.events.once(Ii("session_request",a),(({error:e,result:t})=>{e?u(e):f(t)}));const d=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);return d?(await this.sendRequest({clientRpcId:a,relayRpcId:h,topic:n,method:"wc_sessionRequest",params:{request:Ul(Dl({},i),{expiryTimestamp:Ei(s)}),chainId:t},expiry:s,throwOnFailedPublish:!0,appLink:d}).catch((e=>u(e))),this.client.events.emit("session_request_sent",{topic:n,request:i,chainId:t,id:a}),await c()):await Promise.all([new Promise((async e=>{await this.sendRequest({clientRpcId:a,relayRpcId:h,topic:n,method:"wc_sessionRequest",params:{request:Ul(Dl({},i),{expiryTimestamp:Ei(s)}),chainId:t},expiry:s,throwOnFailedPublish:!0}).catch((e=>u(e))),this.client.events.emit("session_request_sent",{topic:n,request:i,chainId:t,id:a}),e()})),new Promise((async e=>{var t;if(null==(t=o.sessionConfig)||!t.disableDeepLink){const e=await async function(e,t){let r="";try{if(li()&&(r=localStorage.getItem(t),r))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}(this.client.core.storage,_l);await async function({id:e,topic:t,wcDeepLink:i}){var n;try{if(!i)return;const s="string"==typeof i?JSON.parse(i):i,o=s?.href;if("string"!=typeof o)return;const a=function(e,t,r){const i=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let n=`${e}`;return n=e.startsWith("https://t.me")?`${n}${e.includes("?")?"&startapp=":"?startapp="}${function(e,t=!1){const r=Buffer.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(i,!0)}`:`${n}/wc?${i}`,n}(o,e,t),h=pi();if(h===ci.browser){if(null==(n=(0,Dr.getDocument)())||!n.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");a.startsWith("https://")||a.startsWith("http://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,typeof window<"u"&&(window.TelegramWebviewProxy||window.Telegram||window.TelegramWebviewProxyProto)?"_blank":"_self","noreferrer noopener")}else h===ci.reactNative&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(a)}catch(e){console.error(e)}}({id:a,topic:n,wcDeepLink:e})}e()})),c()]).then((e=>e[2]))},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);const{topic:t,response:r}=e,{id:i}=r,n=this.client.session.get(t);n.transportType===Nf.relay&&await this.confirmOnlineStateOrThrow();const s=this.getAppLinkIfEnabled(n.peer.metadata,n.transportType);sf(r)?await this.sendResult({id:i,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:s}):of(r)&&await this.sendError({id:i,topic:t,error:r.error,appLink:s}),this.cleanupAfterResponse(e)},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=Vc(),r=Wc().toString(),{done:i,resolve:n,reject:s}=wi();this.events.once(Ii("session_ping",e),(({error:e})=>{e?s(e):n()})),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);const{topic:t,event:r,chainId:i}=e,n=Wc().toString();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:uc("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=fc("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw new Error(e)}await this.client.core.pairing.disconnect({topic:t})}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter((t=>function(e,t){const{requiredNamespaces:r}=t,i=Object.keys(e.namespaces),n=Object.keys(r);let s=!0;return!!mi(n,i)&&(i.forEach((t=>{const{accounts:i,methods:n,events:o}=e.namespaces[t],a=ic(i),h=r[t];mi(ti(t,h),a)&&mi(h.methods,n)&&mi(h.events,o)||(s=!1)})),s)}(t,e)))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{var r;this.isInitialized(),this.isValidAuthenticate(e);const i=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),n=i?Nf.link_mode:Nf.relay;n===Nf.relay&&await this.confirmOnlineStateOrThrow();const{chains:s,statement:o="",uri:a,domain:h,nonce:c,type:f,exp:u,nbf:d,methods:l=[],expiry:p}=e,g=[...e.resources||[]],{topic:b,uri:m}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:n});this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:m}});const y=await this.client.core.crypto.generateKeyPair(),v=Eh(y);if(await Promise.all([this.client.auth.authKeys.set(Nl,{responseTopic:v,publicKey:y}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:b})]),await this.client.core.relayer.subscribe(v,{transportType:n}),this.client.logger.info(`sending request to new pairing topic: ${b}`),l.length>0){const{namespace:e}=ei(s[0]);let t=function(e,t,r){const i=function(e,t,r,i={}){return r?.sort(((e,t)=>e.localeCompare(t))),{att:{[e]:uh(t,r,i)}}}(e,t,r);return dh(i)}(e,"request",l);mh(g)&&(t=ph(t,g.pop())),g.push(t)}const w=p&&p>Sl.wc_sessionAuthenticate.req.ttl?p:Sl.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:f??"caip122",chains:s,statement:o,aud:a,domain:h,version:"1",nonce:c,iat:(new Date).toISOString(),exp:u,nbf:d,resources:g},requester:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:Ei(w)},A={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:s,methods:[...new Set(["personal_sign",...l])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:Ei(Sl.wc_sessionPropose.req.ttl)},{done:S,resolve:E,reject:M}=wi(w,"Request expired"),I=async({error:e,session:t})=>{if(this.events.off(Ii("session_request",O),x),e)M(e);else if(t){t.self.publicKey=y,await this.client.session.set(t.topic,t),await this.setExpiry(t.topic,t.expiry),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:t.peer.metadata});const e=this.client.session.get(t.topic);await this.deleteProposal(N),E({session:e})}},x=async e=>{var r,i,s;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),e.error){const t=uc("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(Ii("session_connect"),I),M(e.error.message))}await this.deleteProposal(N),this.events.off(Ii("session_connect"),I);const{cacaos:o,responder:a}=e.result,h=[],c=[];for(const e of o){await hh({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),M(uc("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:t}=e,r=mh(t.resources),i=[oh(t.iss)],n=ah(t.iss);if(r){const e=gh(r),t=bh(r);h.push(...e),i.push(...t)}for(const e of i)c.push(`${e}:${n}`)}const f=await this.client.core.crypto.generateSharedKey(y,a.publicKey);let u;h.length>0&&(u={topic:f,acknowledged:!0,self:{publicKey:y,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:Ei(Al),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:ac([...new Set(h)],[...new Set(c)]),transportType:n},await this.client.core.relayer.subscribe(f,{transportType:n}),await this.client.session.set(f,u),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:a.metadata}),u=this.client.session.get(f)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(i=a.metadata.redirect)&&i.linkMode&&null!=(s=a.metadata.redirect)&&s.universal&&t&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(f,{transportType:Nf.link_mode})),E({auths:o,session:u})},O=Vc(),N=Vc();let P;this.events.once(Ii("session_connect"),I),this.events.once(Ii("session_request",O),x);try{if(i){const e=Gc("wc_sessionAuthenticate",_,O);this.client.core.history.set(b,e);const r=await this.client.core.crypto.encode("",e,{type:2,encoding:_h});P=Gh(t,b,r)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:_,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:A,expiry:Sl.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:N})])}catch(e){throw this.events.off(Ii("session_connect"),I),this.events.off(Ii("session_request",O),x),e}return await this.setProposal(N,Dl({id:N},A)),await this.setAuthRequest(O,{request:Ul(Dl({},_),{verifyContext:{}}),pairingTopic:b,transportType:n}),{uri:P??m,response:S}},this.approveSessionAuthenticate=async e=>{const{id:t,auths:r}=e,i=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:["authenticated_session_approve_started"]}});try{this.isInitialized()}catch(e){throw i.setError("no_internet_connection"),e}const n=this.getPendingAuthRequest(t);if(!n)throw i.setError("authenticated_session_pending_request_not_found"),new Error(`Could not find pending auth request with id ${t}`);const s=n.transportType||Nf.relay;s===Nf.relay&&await this.confirmOnlineStateOrThrow();const o=n.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),h=Eh(o),c={type:1,receiverPublicKey:o,senderPublicKey:a},f=[],u=[];for(const e of r){if(!await hh({cacao:e,projectId:this.client.core.projectId})){i.setError("invalid_cacao");const e=uc("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:t,topic:h,error:e,encodeOpts:c}),new Error(e.message)}i.addTrace("cacaos_verified");const{p:r}=e,n=mh(r.resources),s=[oh(r.iss)],o=ah(r.iss);if(n){const e=gh(n),t=bh(n);f.push(...e),s.push(...t)}for(const e of s)u.push(`${e}:${o}`)}const d=await this.client.core.crypto.generateSharedKey(a,o);let l;if(i.addTrace("create_authenticated_session_topic"),f?.length>0){l={topic:d,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:o,metadata:n.requester.metadata},controller:o,expiry:Ei(Al),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:n.pairingTopic,namespaces:ac([...new Set(f)],[...new Set(u)]),transportType:s},i.addTrace("subscribing_authenticated_session_topic");try{await this.client.core.relayer.subscribe(d,{transportType:s})}catch(e){throw i.setError("subscribe_authenticated_session_topic_failure"),e}i.addTrace("subscribe_authenticated_session_topic_success"),await this.client.session.set(d,l),i.addTrace("store_authenticated_session"),await this.client.core.pairing.updateMetadata({topic:n.pairingTopic,metadata:n.requester.metadata})}i.addTrace("publishing_authenticated_session_approve");try{await this.sendResult({topic:h,id:t,result:{cacaos:r,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:c,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(n.requester.metadata,s)})}catch(e){throw i.setError("authenticated_session_approve_publish_failure"),e}return await this.client.auth.requests.delete(t,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:n.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:l}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();const{id:t,reason:r}=e,i=this.getPendingAuthRequest(t);if(!i)throw new Error(`Could not find pending auth request with id ${t}`);i.transportType===Nf.relay&&await this.confirmOnlineStateOrThrow();const n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=Eh(n),a={type:1,receiverPublicKey:n,senderPublicKey:s};await this.sendError({id:t,topic:o,error:r,encodeOpts:a,rpcOpts:Sl.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(i.requester.metadata,i.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.client.proposal.delete(t,uc("USER_DISCONNECTED"))},this.formatAuthMessage=e=>{this.isInitialized();const{request:t,iss:r}=e;return ch(t,r)},this.processRelayMessageCache=()=>{setTimeout((async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}}),50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic}));if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map((e=>this.client.core.pairing.disconnect({topic:e.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{var t;const{topic:r,expirerHasDeleted:i=!1,emitEvent:n=!0,id:s=0}=e,{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,uc("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),i||this.client.core.expirer.del(r),this.client.core.storage.removeItem(_l).catch((e=>this.client.logger.warn(e))),this.getPendingSessionRequests().forEach((e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,uc("USER_DISCONNECTED"))})),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=Ml),n&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(e,t)=>{if(t)try{const t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError("proposal_expired")}catch{}await Promise.all([this.client.proposal.delete(e,uc("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")},this.deletePendingSessionRequest=async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter((t=>t.id!==e)),r&&(this.sessionRequestQueue.state=Ml,this.client.events.emit("session_request_expire",{id:e}))},this.deletePendingAuthRequest=async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,Ei(Sl.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{const{request:r,pairingTopic:i,transportType:n=Nf.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:i,verifyContext:r.verifyContext,transportType:n})},this.setPendingSessionRequest=async e=>{const{id:t,topic:r,params:i,verifyContext:n}=e,s=i.request.expiryTimestamp||Ei(Sl.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:r,params:i,verifyContext:n})},this.sendRequest=async e=>{const{topic:t,method:i,params:n,expiry:s,relayRpcId:o,clientRpcId:a,throwOnFailedPublish:h,appLink:c}=e,f=Gc(i,n,a);let u;const d=!!c;try{const e=d?_h:wh;u=await this.client.core.crypto.encode(t,f,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let l;if(xl.includes(i)){const e=Mh(JSON.stringify(f)),t=Mh(u);l=await this.client.core.verify.register({id:t,decryptedId:e})}const p=Sl[i].req;if(p.attestation=l,s&&(p.ttl=s),o&&(p.id=o),this.client.core.history.set(t,f),d){const e=Gh(c,t,u);await r.g.Linking.openURL(e,this.client.name)}else{const e=Sl[i].req;s&&(e.ttl=s),o&&(e.id=o),h?(e.internal=Ul(Dl({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(t,u,e)):this.client.core.relayer.publish(t,u,e).catch((e=>this.client.logger.error(e)))}return f.id},this.sendResult=async e=>{const{id:t,topic:i,result:n,throwOnFailedPublish:s,encodeOpts:o,appLink:a}=e,h=Yc(t,n);let c;const f=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const e=f?_h:wh;c=await this.client.core.crypto.encode(i,h,Ul(Dl({},o||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),e}let u;try{u=await this.client.core.history.get(i,t)}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${t}) failed`),e}if(f){const e=Gh(a,i,c);await r.g.Linking.openURL(e,this.client.name)}else{const e=Sl[u.request.method].res;s?(e.internal=Ul(Dl({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,c,e)):this.client.core.relayer.publish(i,c,e).catch((e=>this.client.logger.error(e)))}await this.client.core.history.resolve(h)},this.sendError=async e=>{const{id:t,topic:i,error:n,encodeOpts:s,rpcOpts:o,appLink:a}=e,h=Jc(t,n);let c;const f=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const e=f?_h:wh;c=await this.client.core.crypto.encode(i,h,Ul(Dl({},s||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),e}let u;try{u=await this.client.core.history.get(i,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${i}, ${t}) failed`),e}if(f){const e=Gh(a,i,c);await r.g.Linking.openURL(e,this.client.name)}else{const e=o||Sl[u.request.method].res;this.client.core.relayer.publish(i,c,e)}await this.client.core.history.resolve(h)},this.cleanup=async()=>{const e=[],t=[];this.client.session.getAll().forEach((t=>{let r=!1;Mi(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)})),this.client.proposal.getAll().forEach((e=>{Mi(e.expiryTimestamp)&&t.push(e.id)})),await Promise.all([...e.map((e=>this.deleteSession({topic:e}))),...t.map((e=>this.deleteProposal(e)))])},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state!==Il){for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Il;const e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=Ml}else this.client.logger.info("Request queue already active, skipping...")},this.processRequest=async e=>{const{topic:t,payload:r,attestation:i,transportType:n,encryptedId:s}=e,o=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:t,payload:r,attestation:i,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:i,encryptedId:s,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:i,encryptedId:s,transportType:n});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{const{topic:t,payload:r,transportType:i}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,i);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{const{topic:t}=e,{message:r}=fc("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)},this.shouldIgnorePairingRequest=e=>{const{topic:t,requestMethod:r}=e,i=this.expectedPairingMethodMap.get(t);return!(!i||i.includes(r)||!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0))},this.onSessionProposeRequest=async e=>{const{topic:t,payload:r,attestation:i,encryptedId:n}=e,{params:s,id:o}=r;try{const e=this.client.core.eventClient.getEvent({topic:t});this.isValidConnect(Dl({},r.params));const a=s.expiryTimestamp||Ei(Sl.wc_sessionPropose.req.ttl),h=Dl({id:o,pairingTopic:t,expiryTimestamp:a},s);await this.setProposal(o,h);const c=await this.getVerifyContext({attestationId:i,hash:Mh(JSON.stringify(r)),encryptedId:n,metadata:h.proposer.metadata});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError("proposal_listener_not_found")),e?.addTrace("emit_session_proposal"),this.client.events.emit("session_proposal",{id:o,params:h,verifyContext:c})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:Sl.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,r)=>{const{id:i}=t;if(sf(t)){const{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});const s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const o=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const a=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const h=await this.client.core.crypto.generateSharedKey(o,a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const c=await this.client.core.relayer.subscribe(h,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else if(of(t)){await this.client.proposal.delete(i,uc("USER_DISCONNECTED"));const e=Ii("session_connect");if(0===this.events.listenerCount(e))throw new Error(`emitting ${e} without any listeners, 954`);this.events.emit(Ii("session_connect"),{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{const{id:r,params:i}=t;try{this.isValidSessionSettleRequest(i);const{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,sessionConfig:h}=t.params,c=Ul(Dl(Dl({topic:e,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),h&&{sessionConfig:h}),{transportType:Nf.relay}),f=Ii("session_connect");if(0===this.events.listenerCount(f))throw new Error(`emitting ${f} without any listeners 997`);this.events.emit(Ii("session_connect"),{session:c}),await this.sendResult({id:t.id,topic:e,result:!0,throwOnFailedPublish:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{const{id:r}=t;sf(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(Ii("session_approve",r),{})):of(t)&&(await this.client.session.delete(e,uc("USER_DISCONNECTED")),this.events.emit(Ii("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{const{params:r,id:i}=t;try{const t=`${e}_session_update`,n=Nc.get(t);if(n&&this.isRequestOutOfSync(n,i))return this.client.logger.info(`Discarding out of sync request - ${i}`),void this.sendError({id:i,topic:e,error:uc("INVALID_UPDATE_REQUEST")});this.isValidUpdate(Dl({topic:e},r));try{Nc.set(t,i),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0})}catch(e){throw Nc.delete(t),e}this.client.events.emit("session_update",{id:i,topic:e,params:r})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>parseInt(t.toString().slice(0,-3))<=parseInt(e.toString().slice(0,-3)),this.onSessionUpdateResponse=(e,t)=>{const{id:r}=t,i=Ii("session_update",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);sf(t)?this.events.emit(Ii("session_update",r),{}):of(t)&&this.events.emit(Ii("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{const{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Ei(Al)),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{const{id:r}=t,i=Ii("session_extend",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);sf(t)?this.events.emit(Ii("session_extend",r),{}):of(t)&&this.events.emit(Ii("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{const{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{const{id:r}=t,i=Ii("session_ping",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);setTimeout((()=>{sf(t)?this.events.emit(Ii("session_ping",r),{}):of(t)&&this.events.emit(Ii("session_ping",r),{error:t.error})}),500)},this.onSessionDeleteRequest=async(e,t)=>{const{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),Promise.all([new Promise((t=>{this.client.core.relayer.once(Sf,(async()=>{t(await this.deleteSession({topic:e,id:r}))}))})),this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:uc("USER_DISCONNECTED")})]).catch((e=>this.client.logger.error(e)))}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{var t,r,i;const{topic:n,payload:s,attestation:o,encryptedId:a,transportType:h}=e,{id:c,params:f}=s;try{await this.isValidRequest(Dl({topic:n},f));const e=this.client.session.get(n),s={id:c,topic:n,params:f,verifyContext:await this.getVerifyContext({attestationId:o,hash:Mh(JSON.stringify(Gc("wc_sessionRequest",f,c))),encryptedId:a,metadata:e.peer.metadata,transportType:h})};await this.setPendingSessionRequest(s),h===Nf.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(i=this.client.signConfig)&&i.disableRequestQueue?this.emitSessionRequest(s):(this.addSessionRequestToSessionRequestQueue(s),this.processSessionRequestQueue())}catch(e){await this.sendError({id:c,topic:n,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{const{id:r}=t,i=Ii("session_request",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);sf(t)?this.events.emit(Ii("session_request",r),{result:t.result}):of(t)&&this.events.emit(Ii("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{const{id:r,params:i}=t;try{const t=`${e}_session_event_${i.event.name}`,n=Nc.get(t);if(n&&this.isRequestOutOfSync(n,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(Dl({topic:e},i)),this.client.events.emit("session_event",{id:r,topic:e,params:i}),Nc.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{const{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),sf(t)?this.events.emit(Ii("session_request",r),{result:t.result}):of(t)&&this.events.emit(Ii("session_request",r),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{var t;const{topic:r,payload:i,attestation:n,encryptedId:s,transportType:o}=e;try{const{requester:e,authPayload:a,expiryTimestamp:h}=i.params,c=await this.getVerifyContext({attestationId:n,hash:Mh(JSON.stringify(i)),encryptedId:s,metadata:e.metadata,transportType:o}),f={requester:e,pairingTopic:r,id:i.id,authPayload:a,verifyContext:c,expiryTimestamp:h};await this.setAuthRequest(i.id,{request:f,pairingTopic:r,transportType:o}),o===Nf.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:i.params,id:i.id,verifyContext:c})}catch(e){this.client.logger.error(e);const t=i.params.requester.publicKey,n=await this.client.core.crypto.generateKeyPair(),s=this.getAppLinkIfEnabled(i.params.requester.metadata,o),a={type:1,receiverPublicKey:t,senderPublicKey:n};await this.sendError({id:i.id,topic:r,error:e,encodeOpts:a,rpcOpts:Sl.wc_sessionAuthenticate.autoReject,appLink:s})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout((()=>{this.sessionRequestQueue.state=Ml,this.processSessionRequestQueue()}),(0,v.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{const r=this.client.core.history.pending;r.length>0&&r.filter((t=>t.topic===e&&"wc_sessionRequest"===t.request.method)).forEach((e=>{const r=Ii("session_request",e.request.id);if(0===this.events.listenerCount(r))throw new Error(`emitting ${r} without any listeners`);this.events.emit(Ii("session_request",e.request.id),{error:t})}))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Il)return void this.client.logger.info("session request queue is already active.");const e=this.sessionRequestQueue.queue[0];if(e)try{this.sessionRequestQueue.state=Il,this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}else this.client.logger.info("session request queue is empty.")},this.emitSessionRequest=e=>{this.client.events.emit("session_request",e)},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;const t=this.client.proposal.getAll().find((t=>t.pairingTopic===e.topic));t&&this.onSessionProposeRequest({topic:e.topic,payload:Gc("wc_sessionPropose",{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties},t.id)})},this.isValidConnect=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw new Error(t)}const{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=e;if(pc(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return e?e&&dc(e)&&e.length&&e.forEach((e=>{r=Ac(e)})):r=!0,r}(s)){const{message:e}=fc("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(e)}!pc(r)&&0!==lc(r)&&this.validateNamespaces(r,"requiredNamespaces"),!pc(i)&&0!==lc(i)&&this.validateNamespaces(i,"optionalNamespaces"),pc(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(e,t)=>{const r=function(e,t,r){let i=null;if(e&&lc(e)){const n=vc(e,t);n&&(i=n);const s=function(e,t,r){let i=null;return Object.entries(e).forEach((([e,n])=>{if(i)return;const s=function(e,t,r){let i=null;return dc(t)&&t.length?t.forEach((e=>{i||mc(e)||(i=uc("UNSUPPORTED_CHAINS",`${r}, chain ${e} should be a string and conform to "namespace:chainId" format`))})):mc(e)||(i=uc("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}(e,ti(e,n),`${t} ${r}`);s&&(i=s)})),i}(e,t,r);s&&(i=s)}else i=fc("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return i}(e,"connect()",t);if(r)throw new Error(r.message)},this.isValidApprove=async e=>{if(!Sc(e))throw new Error(fc("MISSING_OR_INVALID",`approve() params: ${e}`).message);const{id:t,namespaces:r,relayProtocol:i,sessionProperties:n}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);const s=this.client.proposal.get(t),o=_c(r,"approve()");if(o)throw new Error(o.message);const a=Mc(s.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!gc(i,!0)){const{message:e}=fc("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw new Error(e)}pc(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`reject() params: ${e}`);throw new Error(t)}const{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!!(e&&"object"==typeof e&&e.code&&bc(e.code,!1)&&e.message&&gc(e.message,!1))}(r)){const{message:e}=fc("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidSessionSettleRequest=e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw new Error(t)}const{relay:t,controller:r,namespaces:i,expiry:n}=e;if(!Ac(t)){const{message:e}=fc("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const s=function(e,t){let r=null;return gc(e?.publicKey,!1)||(r=fc("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),r}(r);if(s)throw new Error(s.message);const o=_c(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);if(Mi(n)){const{message:e}=fc("EXPIRED","onSessionSettleRequest()");throw new Error(e)}},this.isValidUpdate=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`update() params: ${e}`);throw new Error(t)}const{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const i=this.client.session.get(t),n=_c(r,"update()");if(n)throw new Error(n.message);const s=Mc(i.requiredNamespaces,r,"update()");if(s)throw new Error(s.message)},this.isValidExtend=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`extend() params: ${e}`);throw new Error(t)}const{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`request() params: ${e}`);throw new Error(t)}const{topic:t,request:r,chainId:i,expiry:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const{namespaces:s}=this.client.session.get(t);if(!Ec(s,i)){const{message:e}=fc("MISSING_OR_INVALID",`request() chainId: ${i}`);throw new Error(e)}if(!function(e){return!(pc(e)||!gc(e.method,!1))}(r)){const{message:e}=fc("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(e)}if(!function(e,t,r){return!!gc(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{ic(e.accounts).includes(t)&&r.push(...e.methods)})),r}(e,t).includes(r)}(s,i,r.method)){const{message:e}=fc("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(e)}if(n&&!function(e,t){return bc(e,!1)&&e<=t.max&&e>=t.min}(n,El)){const{message:e}=fc("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${El.min} and ${El.max}`);throw new Error(e)}},this.isValidRespond=async e=>{var t;if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`respond() params: ${e}`);throw new Error(t)}const{topic:r,response:i}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!function(e){return!(pc(e)||pc(e.result)&&pc(e.error)||!bc(e.id,!1)||!gc(e.jsonrpc,!1))}(i)){const{message:e}=fc("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(e)}},this.isValidPing=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`ping() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`emit() params: ${e}`);throw new Error(t)}const{topic:t,event:r,chainId:i}=e;await this.isValidSessionTopic(t);const{namespaces:n}=this.client.session.get(t);if(!Ec(n,i)){const{message:e}=fc("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw new Error(e)}if(!function(e){return!(pc(e)||!gc(e.name,!1))}(r)){const{message:e}=fc("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}if(!function(e,t,r){return!!gc(r,!1)&&function(e,t){const r=[];return Object.values(e).forEach((e=>{ic(e.accounts).includes(t)&&r.push(...e.events)})),r}(e,t).includes(r)}(n,i,r.name)){const{message:e}=fc("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(e)}},this.isValidDisconnect=async e=>{if(!Sc(e)){const{message:t}=fc("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{const{chains:t,uri:r,domain:i,nonce:n}=e;if(!Array.isArray(t)||0===t.length)throw new Error("chains is required and must be a non-empty array");if(!gc(r,!1))throw new Error("uri is required parameter");if(!gc(i,!1))throw new Error("domain is required parameter");if(!gc(n,!1))throw new Error("nonce is required parameter");if([...new Set(t.map((e=>ei(e).namespace)))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=ei(t[0]);if("eip155"!==s)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async e=>{const{attestationId:t,hash:r,encryptedId:i,metadata:n,transportType:s}=e,o={verified:{verifyUrl:n.verifyUrl||Hf,validation:"UNKNOWN",origin:n.url||""}};try{if(s===Nf.link_mode){const e=this.getAppLinkIfEnabled(n,s);return o.verified.validation=e&&new URL(e).origin===new URL(n.url).origin?"VALID":"INVALID",o}const e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:i,verifyUrl:n.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((e=>{if(!gc(e,!1)){const{message:r}=fc("MISSING_OR_INVALID",`${t} must be in Record format. Received: ${JSON.stringify(e)}`);throw new Error(r)}}))},this.getPendingAuthRequest=e=>{const t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0;const t=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=e=>{const t=this.recentlyDeletedMap.get(e);if(t){const{message:r}=fc("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw new Error(r)}},this.isLinkModeEnabled=(e,t)=>{var i,n,s,o,a,h,c,f,u;return!(!e||t!==Nf.link_mode)&&!0===(null==(n=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:n.linkMode)&&void 0!==(null==(o=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:o.universal)&&""!==(null==(h=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:h.universal)&&void 0!==(null==(c=e?.redirect)?void 0:c.universal)&&""!==(null==(f=e?.redirect)?void 0:f.universal)&&!0===(null==(u=e?.redirect)?void 0:u.linkMode)&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof(null==r.g?void 0:r.g.Linking)<"u"},this.getAppLinkIfEnabled=(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0},this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;const t=Oi(e,"topic")||"",r=decodeURIComponent(Oi(e,"wc_ev")||""),i=this.client.session.keys.includes(t);i&&this.client.session.update(t,{transportType:Nf.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:i})},this.registerLinkModeListeners=async()=>{var e;if(Pi()||di()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){const e=null==r.g?void 0:r.g.Linking;if(typeof e<"u"){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);const t=await e.getInitialURL();t&&setTimeout((()=>{this.handleLinkModeMessage({url:t})}),50)}}}}isInitialized(){if(!this.initialized){const{message:e}=fc("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(wf,(e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)}))}async onRelayMessage(e){const{topic:t,message:r,attestation:i,transportType:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(Nl)?this.client.auth.authKeys.get(Nl):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(t,r,{receiverPublicKey:s,encoding:n===Nf.link_mode?_h:wh});try{rf(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o,attestation:i,transportType:n,encryptedId:Mh(r)})):nf(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o,transportType:n}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o,transportType:n})}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(Ff,(async e=>{const{topic:t,id:r}=Si(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,fc("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,fc("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))}))}registerPairingEvents(){this.client.core.pairing.events.on(Lf,(e=>this.onPairingCreated(e))),this.client.core.pairing.events.on(qf,(e=>{this.addToRecentlyDeleted(e.topic,"pairing")}))}isValidPairingTopic(e){if(!gc(e,!1)){const{message:t}=fc("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=fc("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=fc("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!gc(e,!1)){const{message:t}=fc("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=fc("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=fc("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=fc("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(gc(e,!1)){const{message:t}=fc("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}{const{message:t}=fc("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!function(e){return"number"==typeof e}(e)){const{message:t}=fc("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=fc("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=fc("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class zl extends Gd{constructor(e,t){super(e,t,"proposal",vl),this.core=e,this.logger=t}}class jl extends Gd{constructor(e,t){super(e,t,"session",vl),this.core=e,this.logger=t}}class Fl extends Gd{constructor(e,t){super(e,t,"request",vl,(e=>e.id)),this.core=e,this.logger=t}}class Kl extends Gd{constructor(e,t){super(e,t,"authKeys",Ol,(()=>Nl)),this.core=e,this.logger=t}}class Hl extends Gd{constructor(e,t){super(e,t,"pairingTopics",Ol),this.core=e,this.logger=t}}class Vl extends Gd{constructor(e,t){super(e,t,"requests",Ol,(e=>e.id)),this.core=e,this.logger=t}}class Wl{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new Kl(this.core,this.logger),this.pairingTopics=new Hl(this.core,this.logger),this.requests=new Vl(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class Gl extends ke{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=wl,this.events=new m.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||wl,this.metadata=e?.metadata||gi(),this.signConfig=e?.signConfig;const t=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:ie()(ve({level:e?.logger||"error"}));this.core=e?.core||new ml(e),this.logger=_e(t,this.name),this.session=new jl(this.core,this.logger),this.proposal=new zl(this.core,this.logger),this.pendingRequest=new Fl(this.core,this.logger),this.engine=new Bl(this),this.auth=new Wl(this.core,this.logger)}static async init(e){const t=new Gl(e);return await t.initialize(),t}get context(){return we(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}const Yl=jl,Jl=Gl;var $l,Ql={exports:{}},Xl="object"==typeof Reflect?Reflect:null,Zl=Xl&&"function"==typeof Xl.apply?Xl.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};$l=Xl&&"function"==typeof Xl.ownKeys?Xl.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var ep=Number.isNaN||function(e){return e!=e};function tp(){tp.init.call(this)}Ql.exports=tp,Ql.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}up(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&up(e,"error",t,{once:!0})}(e,n)}))},tp.EventEmitter=tp,tp.prototype._events=void 0,tp.prototype._eventsCount=0,tp.prototype._maxListeners=void 0;var rp=10;function ip(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function np(e){return void 0===e._maxListeners?tp.defaultMaxListeners:e._maxListeners}function sp(e,t,r,i){var n,s,o;if(ip(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=np(e))>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,function(e){console&&console.warn&&console.warn(e)}(a)}return e}function op(){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 ap(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=op.bind(i);return n.listener=r,i.wrapFn=n,n}function hp(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[e];if(void 0===a)return!1;if("function"==typeof a)Zl(a,this,t);else{var h=a.length,c=fp(a,h);for(r=0;r=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},tp.prototype.listeners=function(e){return hp(this,e,!0)},tp.prototype.rawListeners=function(e){return hp(this,e,!1)},tp.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):cp.call(e,t)},tp.prototype.listenerCount=cp,tp.prototype.eventNames=function(){return this._eventsCount>0?$l(this._events):[]};Ql.exports;class dp{constructor(e){this.opts=e}}class lp{constructor(e){this.client=e}}var pp=Object.defineProperty,gp=Object.defineProperties,bp=Object.getOwnPropertyDescriptors,mp=Object.getOwnPropertySymbols,yp=Object.prototype.hasOwnProperty,vp=Object.prototype.propertyIsEnumerable,wp=(e,t,r)=>t in e?pp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class _p extends lp{constructor(e){super(e),this.init=async()=>{this.signClient=await Jl.init({core:this.client.core,metadata:this.client.metadata,signConfig:this.client.signConfig})},this.pair=async e=>{await this.client.core.pairing.pair(e)},this.approveSession=async e=>{const{topic:t,acknowledged:r}=await this.signClient.approve(((e,t)=>gp(e,bp(t)))(((e,t)=>{for(var r in t||(t={}))yp.call(t,r)&&wp(e,r,t[r]);if(mp)for(var r of mp(t))vp.call(t,r)&&wp(e,r,t[r]);return e})({},e),{id:e.id,namespaces:e.namespaces,sessionProperties:e.sessionProperties,sessionConfig:e.sessionConfig}));return await r(),this.signClient.session.get(t)},this.rejectSession=async e=>await this.signClient.reject(e),this.updateSession=async e=>await this.signClient.update(e),this.extendSession=async e=>await this.signClient.extend(e),this.respondSessionRequest=async e=>await this.signClient.respond(e),this.disconnectSession=async e=>await this.signClient.disconnect(e),this.emitSessionEvent=async e=>await this.signClient.emit(e),this.getActiveSessions=()=>this.signClient.session.getAll().reduce(((e,t)=>(e[t.topic]=t,e)),{}),this.getPendingSessionProposals=()=>this.signClient.proposal.getAll(),this.getPendingSessionRequests=()=>this.signClient.getPendingSessionRequests(),this.approveSessionAuthenticate=async e=>await this.signClient.approveSessionAuthenticate(e),this.rejectSessionAuthenticate=async e=>await this.signClient.rejectSessionAuthenticate(e),this.formatAuthMessage=e=>this.signClient.formatAuthMessage(e),this.registerDeviceToken=e=>this.client.core.echoClient.registerDeviceToken(e),this.on=(e,t)=>(this.setEvent(e,"off"),this.setEvent(e,"on"),this.client.events.on(e,t)),this.once=(e,t)=>(this.setEvent(e,"off"),this.setEvent(e,"once"),this.client.events.once(e,t)),this.off=(e,t)=>(this.setEvent(e,"off"),this.client.events.off(e,t)),this.removeListener=(e,t)=>(this.setEvent(e,"removeListener"),this.client.events.removeListener(e,t)),this.onSessionRequest=e=>{this.client.events.emit("session_request",e)},this.onSessionProposal=e=>{this.client.events.emit("session_proposal",e)},this.onSessionDelete=e=>{this.client.events.emit("session_delete",e)},this.onProposalExpire=e=>{this.client.events.emit("proposal_expire",e)},this.onSessionRequestExpire=e=>{this.client.events.emit("session_request_expire",e)},this.onSessionRequestAuthenticate=e=>{this.client.events.emit("session_authenticate",e)},this.setEvent=(e,t)=>{switch(e){case"session_request":this.signClient.events[t]("session_request",this.onSessionRequest);break;case"session_proposal":this.signClient.events[t]("session_proposal",this.onSessionProposal);break;case"session_delete":this.signClient.events[t]("session_delete",this.onSessionDelete);break;case"proposal_expire":this.signClient.events[t]("proposal_expire",this.onProposalExpire);break;case"session_request_expire":this.signClient.events[t]("session_request_expire",this.onSessionRequestExpire);break;case"session_authenticate":this.signClient.events[t]("session_authenticate",this.onSessionRequestAuthenticate)}},this.signClient={}}}const Ap={decryptMessage:async e=>{const t={core:new ml({storageOptions:e.storageOptions,storage:e.storage})};await t.core.crypto.init();const r=t.core.crypto.decode(e.topic,e.encryptedMessage);return t.core=null,r},getMetadata:async e=>{const t={core:new ml({storageOptions:e.storageOptions,storage:e.storage}),sessionStore:null};t.sessionStore=new Yl(t.core,t.core.logger),await t.sessionStore.init();const r=t.sessionStore.get(e.topic),i=r?.peer.metadata;return t.core=null,t.sessionStore=null,i}},Sp=class extends dp{constructor(e){super(e),this.events=new Ql.exports,this.on=(e,t)=>this.engine.on(e,t),this.once=(e,t)=>this.engine.once(e,t),this.off=(e,t)=>this.engine.off(e,t),this.removeListener=(e,t)=>this.engine.removeListener(e,t),this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSession=async e=>{try{return await this.engine.approveSession(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSession=async e=>{try{return await this.engine.rejectSession(e)}catch(e){throw this.logger.error(e.message),e}},this.updateSession=async e=>{try{return await this.engine.updateSession(e)}catch(e){throw this.logger.error(e.message),e}},this.extendSession=async e=>{try{return await this.engine.extendSession(e)}catch(e){throw this.logger.error(e.message),e}},this.respondSessionRequest=async e=>{try{return await this.engine.respondSessionRequest(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnectSession=async e=>{try{return await this.engine.disconnectSession(e)}catch(e){throw this.logger.error(e.message),e}},this.emitSessionEvent=async e=>{try{return await this.engine.emitSessionEvent(e)}catch(e){throw this.logger.error(e.message),e}},this.getActiveSessions=()=>{try{return this.engine.getActiveSessions()}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionProposals=()=>{try{return this.engine.getPendingSessionProposals()}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.registerDeviceToken=e=>{try{return this.engine.registerDeviceToken(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=e=>{try{return this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=e=>{try{return this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.metadata=e.metadata,this.name=e.name||"WalletKit",this.signConfig=e.signConfig,this.core=e.core,this.logger=this.core.logger,this.engine=new _p(this)}static async init(e){const t=new Sp(e);return await t.initialize(),t}async initialize(){this.logger.trace("Initialized");try{await this.engine.init(),this.logger.info("WalletKit Initialization Success")}catch(e){throw this.logger.info("WalletKit Initialization Failure"),this.logger.error(e.message),e}}};let Ep=Sp;Ep.notifications=Ap;const Mp=Ep;window.wc={core:null,walletKit:null,statusObject:null,init:function(e){return new Promise((async(t,r)=>{if(!window.statusq){const e='missing window.statusq! Forgot to execute "ui/app/AppLayouts/Wallet/services/dapps/helpers.js" first?';console.error(e),r(e)}if(window.statusq.error){const e="Failed initializing WebChannel: "+window.statusq.error;console.error(e),r(e)}if(wc.statusObject=window.statusq.channel.objects.statusObject,!wc.statusObject){const e="Failed initializing WebChannel or initialization not run";console.error(e),r(e)}try{const r=new ml({projectId:e});window.wc.walletKit=await Mp.init({core:r,metadata:{name:"Status",description:"Status Wallet",url:"http://localhost",icons:["https://avatars.githubusercontent.com/u/11767950"]}}),window.wc.core=r,window.wc.walletKit.on("session_proposal",(e=>{wc.statusObject.onSessionProposal(e)})),window.wc.walletKit.on("session_update",(e=>{wc.statusObject.onSessionUpdate(e)})),window.wc.walletKit.on("session_extend",(e=>{wc.statusObject.onSessionExtend(e)})),window.wc.walletKit.on("session_ping",(e=>{wc.statusObject.onSessionPing(e)})),window.wc.walletKit.on("session_delete",(e=>{wc.statusObject.onSessionDelete(e)})),window.wc.walletKit.on("session_expire",(e=>{wc.statusObject.onSessionExpire(e)})),window.wc.walletKit.on("session_request",(e=>{wc.statusObject.onSessionRequest(e)})),window.wc.walletKit.on("session_request_sent",(e=>{wc.statusObject.onSessionRequestSent(e)})),window.wc.walletKit.on("session_event",(e=>{wc.statusObject.onSessionEvent(e)})),window.wc.walletKit.on("proposal_expire",(e=>{wc.statusObject.onProposalExpire(e)})),window.wc.walletKit.on("pairing_expire",(e=>{wc.statusObject.echo("debug",`WC unhandled event: "pairing_expire" ${JSON.stringify(e)}`)})),window.wc.walletKit.on("session_request_expire",(e=>{const{id:t}=e;wc.statusObject.onSessionRequestExpire(t)})),window.wc.core.relayer.on("relayer_connect",(()=>{wc.statusObject.echo("debug",'WC unhandled event: "relayer_connect" connection to the relay server is established')})),window.wc.core.relayer.on("relayer_disconnect",(()=>{wc.statusObject.echo("debug",'WC unhandled event: "relayer_disconnect" connection to the relay server is lost')})),t("")}catch(e){r(e)}}))},pair:async function(e){await window.wc.walletKit.pair({uri:e})},getPairings:function(){return window.wc.walletKit.core.pairing.getPairings()},getActiveSessions:function(){return window.wc.walletKit.getActiveSessions()},disconnect:async function(e){await window.wc.walletKit.disconnectSession({topic:e,reason:uc("USER_DISCONNECTED")})},ping:async function(e){await window.wc.walletKit.engine.signClient.ping({topic:e})},buildApprovedNamespaces:async function(e,t){return function(e){const{proposal:{requiredNamespaces:t,optionalNamespaces:r={}},supportedNamespaces:i}=e,n=oc(t),s=oc(r),o={};Object.keys(i).forEach((e=>{const t=i[e].chains,r=i[e].methods,n=i[e].events,s=i[e].accounts;t.forEach((t=>{if(!s.some((e=>e.includes(t))))throw new Error(`No accounts provided for chain ${t} in namespace ${e}`)})),o[e]={chains:t,methods:r,events:n,accounts:s}}));const a=Mc(t,o,"approve()");if(a)throw new Error(a.message);const h={};return Object.keys(t).length||Object.keys(r).length?(Object.keys(n).forEach((e=>{const t=i[e].chains.filter((t=>{var r,i;return null==(i=null==(r=n[e])?void 0:r.chains)?void 0:i.includes(t)})),r=i[e].methods.filter((t=>{var r,i;return null==(i=null==(r=n[e])?void 0:r.methods)?void 0:i.includes(t)})),s=i[e].events.filter((t=>{var r,i;return null==(i=null==(r=n[e])?void 0:r.events)?void 0:i.includes(t)})),o=t.map((t=>i[e].accounts.filter((e=>e.includes(`${t}:`))))).flat();h[e]={chains:t,methods:r,events:s,accounts:o}})),Object.keys(s).forEach((e=>{var t,r,n,o,a,c;if(!i[e])return;const f=null==(r=null==(t=s[e])?void 0:t.chains)?void 0:r.filter((t=>i[e].chains.includes(t))),u=i[e].methods.filter((t=>{var r,i;return null==(i=null==(r=s[e])?void 0:r.methods)?void 0:i.includes(t)})),d=i[e].events.filter((t=>{var r,i;return null==(i=null==(r=s[e])?void 0:r.events)?void 0:i.includes(t)})),l=f?.map((t=>i[e].accounts.filter((e=>e.includes(`${t}:`))))).flat();h[e]={chains:xi(null==(n=h[e])?void 0:n.chains,f),methods:xi(null==(o=h[e])?void 0:o.methods,u),events:xi(null==(a=h[e])?void 0:a.events,d),accounts:xi(null==(c=h[e])?void 0:c.accounts,l)}})),h):o}({proposal:e,supportedNamespaces:t})},approveSession:async function(e,t){const{id:r,params:i}=e,{relays:n}=i;return await window.wc.walletKit.approveSession({id:r,relayProtocol:n[0].protocol,namespaces:t})},rejectSession:async function(e){await window.wc.walletKit.rejectSession({id:e,reason:uc("USER_REJECTED")})},respondSessionRequest:async function(e,t,r){const i=Yc(t,r);await window.wc.walletKit.respondSessionRequest({topic:e,response:i})},rejectSessionRequest:async function(e,t,r=!1){const i=r?"SESSION_SETTLEMENT_FAILED":"USER_REJECTED";await window.wc.walletKit.respondSessionRequest({topic:e,response:Jc(t,uc(i))})}}; \ No newline at end of file +var t={2046:function(t,e,r){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.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 o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(1848).Buffer}catch(t){}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 i(!1,"Invalid character in "+t)}function h(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function c(t,e,r,n){for(var s=0,o=0,a=Math.min(t.length,r),h=e;h=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&o0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.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),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=h(t,e,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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];function g(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&h,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;u+=(o=(n=0|t.words[p])*(s=0|e.words[l])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,h=0|u}return 0!==h?r.words[c]=0|h:r.length--,r._strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?d[6-h.length]+h+r:h+r}for(0!==s&&(r=s.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=l[t],u=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(u).toString(t);r=(f=f.idivn(u)).isZero()?g+r:d[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.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},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},s.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,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==s&&o>26,this.words[o]=67108863&e;if(0===s&&o>>13,l=0|o[1],p=8191&l,g=l>>>13,m=0|o[2],b=8191&m,y=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,I=0|o[5],A=8191&I,x=I>>>13,O=0|o[6],R=8191&O,P=O>>>13,N=0|o[7],T=8191&N,k=N>>>13,L=0|o[8],C=8191&L,q=L>>>13,U=0|o[9],j=8191&U,z=U>>>13,D=0|a[0],B=8191&D,$=D>>>13,K=0|a[1],F=8191&K,V=K>>>13,H=0|a[2],W=8191&H,G=H>>>13,J=0|a[3],Z=8191&J,Y=J>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ct=at>>>13,ut=0|a[8],ft=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191<,gt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(i=Math.imul(f,B))|0)+((8191&(n=(n=Math.imul(f,$))+Math.imul(d,B)|0))<<13)|0;c=((s=Math.imul(d,$))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,B),n=(n=Math.imul(p,$))+Math.imul(g,B)|0,s=Math.imul(g,$);var bt=(c+(i=i+Math.imul(f,F)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(d,F)|0))<<13)|0;c=((s=s+Math.imul(d,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(b,B),n=(n=Math.imul(b,$))+Math.imul(y,B)|0,s=Math.imul(y,$),i=i+Math.imul(p,F)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,F)|0,s=s+Math.imul(g,V)|0;var yt=(c+(i=i+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((s=s+Math.imul(d,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,B),n=(n=Math.imul(w,$))+Math.imul(_,B)|0,s=Math.imul(_,$),i=i+Math.imul(b,F)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,F)|0,s=s+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,G)|0;var vt=(c+(i=i+Math.imul(f,Z)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(d,Z)|0))<<13)|0;c=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(E,B),n=(n=Math.imul(E,$))+Math.imul(S,B)|0,s=Math.imul(S,$),i=i+Math.imul(w,F)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,F)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,Y)|0;var wt=(c+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(d,Q)|0))<<13)|0;c=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,B),n=(n=Math.imul(A,$))+Math.imul(x,B)|0,s=Math.imul(x,$),i=i+Math.imul(E,F)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,F)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,Z)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,tt)|0;var _t=(c+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(d,rt)|0))<<13)|0;c=((s=s+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,B),n=(n=Math.imul(R,$))+Math.imul(P,B)|0,s=Math.imul(P,$),i=i+Math.imul(A,F)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(x,F)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,W)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var Mt=(c+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(d,st)|0))<<13)|0;c=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(T,B),n=(n=Math.imul(T,$))+Math.imul(k,B)|0,s=Math.imul(k,$),i=i+Math.imul(R,F)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(P,F)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,G)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(y,rt)|0,s=s+Math.imul(y,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(c+(i=i+Math.imul(f,ht)|0)|0)+((8191&(n=(n=n+Math.imul(f,ct)|0)+Math.imul(d,ht)|0))<<13)|0;c=((s=s+Math.imul(d,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(C,B),n=(n=Math.imul(C,$))+Math.imul(q,B)|0,s=Math.imul(q,$),i=i+Math.imul(T,F)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(k,F)|0,s=s+Math.imul(k,V)|0,i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,Y)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,ot)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(g,ht)|0,s=s+Math.imul(g,ct)|0;var St=(c+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,dt)|0)+Math.imul(d,ft)|0))<<13)|0;c=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(j,B),n=(n=Math.imul(j,$))+Math.imul(z,B)|0,s=Math.imul(z,$),i=i+Math.imul(C,F)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(q,F)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(k,W)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,Y)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(y,ht)|0,s=s+Math.imul(y,ct)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(g,ft)|0,s=s+Math.imul(g,dt)|0;var It=(c+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((s=s+Math.imul(d,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,V))+Math.imul(z,F)|0,s=Math.imul(z,V),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(q,W)|0,s=s+Math.imul(q,G)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(k,Z)|0,s=s+Math.imul(k,Y)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ct)|0,i=i+Math.imul(b,ft)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(y,ft)|0,s=s+Math.imul(y,dt)|0;var At=(c+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(j,W),n=(n=Math.imul(j,G))+Math.imul(z,W)|0,s=Math.imul(z,G),i=i+Math.imul(C,Z)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(q,Z)|0,s=s+Math.imul(q,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,it)|0,i=i+Math.imul(A,st)|0,n=(n=n+Math.imul(A,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(S,ht)|0,s=s+Math.imul(S,ct)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,dt)|0;var xt=(c+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,gt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((s=s+Math.imul(y,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(z,Z)|0,s=Math.imul(z,Y),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(q,Q)|0,s=s+Math.imul(q,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(k,rt)|0,s=s+Math.imul(k,it)|0,i=i+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ct)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(S,ft)|0,s=s+Math.imul(S,dt)|0;var Ot=(c+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((s=s+Math.imul(_,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(z,Q)|0,s=Math.imul(z,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(q,rt)|0,s=s+Math.imul(q,it)|0,i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(k,st)|0,s=s+Math.imul(k,ot)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ct)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,dt)|0;var Rt=(c+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(j,rt),n=(n=Math.imul(j,it))+Math.imul(z,rt)|0,s=Math.imul(z,it),i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(q,st)|0,s=s+Math.imul(q,ot)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(k,ht)|0,s=s+Math.imul(k,ct)|0,i=i+Math.imul(R,ft)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ft)|0,s=s+Math.imul(P,dt)|0;var Pt=(c+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(z,st)|0,s=Math.imul(z,ot),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(q,ht)|0,s=s+Math.imul(q,ct)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(k,ft)|0,s=s+Math.imul(k,dt)|0;var Nt=(c+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((s=s+Math.imul(P,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(j,ht),n=(n=Math.imul(j,ct))+Math.imul(z,ht)|0,s=Math.imul(z,ct),i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(q,ft)|0,s=s+Math.imul(q,dt)|0;var Tt=(c+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((s=s+Math.imul(k,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(j,ft),n=(n=Math.imul(j,dt))+Math.imul(z,ft)|0,s=Math.imul(z,dt);var kt=(c+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(q,pt)|0))<<13)|0;c=((s=s+Math.imul(q,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(c+(i=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,gt))+Math.imul(z,pt)|0))<<13)|0;return c=((s=Math.imul(z,gt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=mt,h[1]=bt,h[2]=yt,h[3]=vt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=Et,h[8]=St,h[9]=It,h[10]=At,h[11]=xt,h[12]=Ot,h[13]=Rt,h[14]=Pt,h[15]=Nt,h[16]=Tt,h[17]=kt,h[18]=Lt,0!==c&&(h[19]=c,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function y(t,e,r){return b(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(m=g),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?g(this,t,e):r<1024?b(this,t,e):y(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o>=26,r+=s/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=n);c--){var f=0|this.words[c];this.words[c]=u<<26-s|f>>>s,u=f&a}return h&&0!==u&&(h.words[h.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(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 n=67108863^67108863>>>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},s.prototype.isubn=function(t){if(i("number"==typeof t),i(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>26)-(h/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var d=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(d=Math.min(d/o|0,67108863),i._ishlnsubmul(n,d,f);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=d)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.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,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%t;return e?-n:n},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*r;this.words[n]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var d=0,l=1;!(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(u),h.isub(f)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(h)):(r.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:r.iushln(c)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;!(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var f=0,d=1;!(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.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 i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.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),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new A(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(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 s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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 s(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 i=e0?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)},n(M,_),M.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},M.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>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new M;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new I}return w[t]=e,e},A.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.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)},A.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},A.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)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,c).cmp(h);)u.redIAdd(h);for(var f=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=o;0!==l.cmp(a);){for(var g=l,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m=0;i--){for(var c=e.words[i],u=h-1;u>=0;u--){var f=c>>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==o?(o<<=1,o|=f,(4==++a||0===i&&0===u)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}h=26}return n},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},5280:function(t,e,r){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.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 o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8954).Buffer}catch(t){}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 i(!1,"Invalid character in "+t)}function h(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function c(t,e,r,n){for(var s=0,o=0,a=Math.min(t.length,r),h=e;h=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&o0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.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),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=h(t,e,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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];function g(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&h,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;u+=(o=(n=0|t.words[p])*(s=0|e.words[l])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,h=0|u}return 0!==h?r.words[c]=0|h:r.length--,r._strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?d[6-h.length]+h+r:h+r}for(0!==s&&(r=s.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=l[t],u=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(u).toString(t);r=(f=f.idivn(u)).isZero()?g+r:d[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.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},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},s.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,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==s&&o>26,this.words[o]=67108863&e;if(0===s&&o>>13,l=0|o[1],p=8191&l,g=l>>>13,m=0|o[2],b=8191&m,y=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,I=0|o[5],A=8191&I,x=I>>>13,O=0|o[6],R=8191&O,P=O>>>13,N=0|o[7],T=8191&N,k=N>>>13,L=0|o[8],C=8191&L,q=L>>>13,U=0|o[9],j=8191&U,z=U>>>13,D=0|a[0],B=8191&D,$=D>>>13,K=0|a[1],F=8191&K,V=K>>>13,H=0|a[2],W=8191&H,G=H>>>13,J=0|a[3],Z=8191&J,Y=J>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ct=at>>>13,ut=0|a[8],ft=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191<,gt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(i=Math.imul(f,B))|0)+((8191&(n=(n=Math.imul(f,$))+Math.imul(d,B)|0))<<13)|0;c=((s=Math.imul(d,$))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,B),n=(n=Math.imul(p,$))+Math.imul(g,B)|0,s=Math.imul(g,$);var bt=(c+(i=i+Math.imul(f,F)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(d,F)|0))<<13)|0;c=((s=s+Math.imul(d,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(b,B),n=(n=Math.imul(b,$))+Math.imul(y,B)|0,s=Math.imul(y,$),i=i+Math.imul(p,F)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,F)|0,s=s+Math.imul(g,V)|0;var yt=(c+(i=i+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((s=s+Math.imul(d,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,B),n=(n=Math.imul(w,$))+Math.imul(_,B)|0,s=Math.imul(_,$),i=i+Math.imul(b,F)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,F)|0,s=s+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,G)|0;var vt=(c+(i=i+Math.imul(f,Z)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(d,Z)|0))<<13)|0;c=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(E,B),n=(n=Math.imul(E,$))+Math.imul(S,B)|0,s=Math.imul(S,$),i=i+Math.imul(w,F)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,F)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,Y)|0;var wt=(c+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(d,Q)|0))<<13)|0;c=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,B),n=(n=Math.imul(A,$))+Math.imul(x,B)|0,s=Math.imul(x,$),i=i+Math.imul(E,F)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,F)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,Z)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,tt)|0;var _t=(c+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(d,rt)|0))<<13)|0;c=((s=s+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,B),n=(n=Math.imul(R,$))+Math.imul(P,B)|0,s=Math.imul(P,$),i=i+Math.imul(A,F)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(x,F)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,W)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var Mt=(c+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(d,st)|0))<<13)|0;c=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(T,B),n=(n=Math.imul(T,$))+Math.imul(k,B)|0,s=Math.imul(k,$),i=i+Math.imul(R,F)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(P,F)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,G)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(y,rt)|0,s=s+Math.imul(y,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(c+(i=i+Math.imul(f,ht)|0)|0)+((8191&(n=(n=n+Math.imul(f,ct)|0)+Math.imul(d,ht)|0))<<13)|0;c=((s=s+Math.imul(d,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(C,B),n=(n=Math.imul(C,$))+Math.imul(q,B)|0,s=Math.imul(q,$),i=i+Math.imul(T,F)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(k,F)|0,s=s+Math.imul(k,V)|0,i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,Y)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,ot)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(g,ht)|0,s=s+Math.imul(g,ct)|0;var St=(c+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,dt)|0)+Math.imul(d,ft)|0))<<13)|0;c=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(j,B),n=(n=Math.imul(j,$))+Math.imul(z,B)|0,s=Math.imul(z,$),i=i+Math.imul(C,F)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(q,F)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(k,W)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,Y)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(y,ht)|0,s=s+Math.imul(y,ct)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(g,ft)|0,s=s+Math.imul(g,dt)|0;var It=(c+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((s=s+Math.imul(d,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,V))+Math.imul(z,F)|0,s=Math.imul(z,V),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(q,W)|0,s=s+Math.imul(q,G)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(k,Z)|0,s=s+Math.imul(k,Y)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ct)|0,i=i+Math.imul(b,ft)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(y,ft)|0,s=s+Math.imul(y,dt)|0;var At=(c+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(j,W),n=(n=Math.imul(j,G))+Math.imul(z,W)|0,s=Math.imul(z,G),i=i+Math.imul(C,Z)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(q,Z)|0,s=s+Math.imul(q,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,it)|0,i=i+Math.imul(A,st)|0,n=(n=n+Math.imul(A,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(S,ht)|0,s=s+Math.imul(S,ct)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,dt)|0;var xt=(c+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,gt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((s=s+Math.imul(y,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(z,Z)|0,s=Math.imul(z,Y),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(q,Q)|0,s=s+Math.imul(q,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(k,rt)|0,s=s+Math.imul(k,it)|0,i=i+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ct)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(S,ft)|0,s=s+Math.imul(S,dt)|0;var Ot=(c+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((s=s+Math.imul(_,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(z,Q)|0,s=Math.imul(z,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(q,rt)|0,s=s+Math.imul(q,it)|0,i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(k,st)|0,s=s+Math.imul(k,ot)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ct)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,dt)|0;var Rt=(c+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(j,rt),n=(n=Math.imul(j,it))+Math.imul(z,rt)|0,s=Math.imul(z,it),i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(q,st)|0,s=s+Math.imul(q,ot)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(k,ht)|0,s=s+Math.imul(k,ct)|0,i=i+Math.imul(R,ft)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ft)|0,s=s+Math.imul(P,dt)|0;var Pt=(c+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(z,st)|0,s=Math.imul(z,ot),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(q,ht)|0,s=s+Math.imul(q,ct)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(k,ft)|0,s=s+Math.imul(k,dt)|0;var Nt=(c+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((s=s+Math.imul(P,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(j,ht),n=(n=Math.imul(j,ct))+Math.imul(z,ht)|0,s=Math.imul(z,ct),i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(q,ft)|0,s=s+Math.imul(q,dt)|0;var Tt=(c+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((s=s+Math.imul(k,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(j,ft),n=(n=Math.imul(j,dt))+Math.imul(z,ft)|0,s=Math.imul(z,dt);var kt=(c+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(q,pt)|0))<<13)|0;c=((s=s+Math.imul(q,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(c+(i=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,gt))+Math.imul(z,pt)|0))<<13)|0;return c=((s=Math.imul(z,gt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=mt,h[1]=bt,h[2]=yt,h[3]=vt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=Et,h[8]=St,h[9]=It,h[10]=At,h[11]=xt,h[12]=Ot,h[13]=Rt,h[14]=Pt,h[15]=Nt,h[16]=Tt,h[17]=kt,h[18]=Lt,0!==c&&(h[19]=c,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function y(t,e,r){return b(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(m=g),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?g(this,t,e):r<1024?b(this,t,e):y(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o>=26,r+=s/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=n);c--){var f=0|this.words[c];this.words[c]=u<<26-s|f>>>s,u=f&a}return h&&0!==u&&(h.words[h.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(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 n=67108863^67108863>>>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},s.prototype.isubn=function(t){if(i("number"==typeof t),i(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>26)-(h/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var d=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(d=Math.min(d/o|0,67108863),i._ishlnsubmul(n,d,f);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=d)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.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,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%t;return e?-n:n},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*r;this.words[n]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var d=0,l=1;!(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(u),h.isub(f)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(h)):(r.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:r.iushln(c)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;!(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var f=0,d=1;!(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.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 i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.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),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new A(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(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 s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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 s(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 i=e0?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)},n(M,_),M.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},M.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>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new M;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new I}return w[t]=e,e},A.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.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)},A.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},A.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)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,c).cmp(h);)u.redIAdd(h);for(var f=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=o;0!==l.cmp(a);){for(var g=l,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m=0;i--){for(var c=e.words[i],u=h-1;u>=0;u--){var f=c>>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==o?(o<<=1,o|=f,(4==++a||0===i&&0===u)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}h=26}return n},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},972:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=r(4512);function n(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 s(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 o(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 h(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 u(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 f(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 d(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),u(t/4294967296>>>0,e,r),u(t>>>0,e,r+4),e}function l(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),f(t>>>0,e,r),f(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=n,e.writeInt16BE=n,e.writeUint16LE=s,e.writeInt16LE=s,e.readInt32BE=o,e.readUint32BE=a,e.readInt32LE=h,e.readUint32LE=c,e.writeUint32BE=u,e.writeInt32BE=u,e.writeUint32LE=f,e.writeInt32LE=f,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=o(t,e),i=o(t,e+4);return 4294967296*r+i-4294967296*(i>>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=h(t,e);return 4294967296*h(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=d,e.writeInt64BE=d,e.writeUint64LE=l,e.writeInt64LE=l,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 i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i},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 i=0,n=1,s=r;s=n;o--)r[o]=e/s&255,s*=256;return r},e.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o{Object.defineProperty(e,"__esModule",{value:!0});var i=r(972),n=r(6228);function s(t,e,r){for(var n=1634760805,s=857760878,o=2036477234,a=1797285236,h=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],d=r[19]<<24|r[18]<<16|r[17]<<8|r[16],l=r[23]<<24|r[22]<<16|r[21]<<8|r[20],p=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],m=e[3]<<24|e[2]<<16|e[1]<<8|e[0],b=e[7]<<24|e[6]<<16|e[5]<<8|e[4],y=e[11]<<24|e[10]<<16|e[9]<<8|e[8],v=e[15]<<24|e[14]<<16|e[13]<<8|e[12],w=n,_=s,M=o,E=a,S=h,I=c,A=u,x=f,O=d,R=l,P=p,N=g,T=m,k=b,L=y,C=v,q=0;q<20;q+=2)S=(S^=O=O+(T=(T^=w=w+S|0)>>>16|T<<16)|0)>>>20|S<<12,I=(I^=R=R+(k=(k^=_=_+I|0)>>>16|k<<16)|0)>>>20|I<<12,A=(A^=P=P+(L=(L^=M=M+A|0)>>>16|L<<16)|0)>>>20|A<<12,x=(x^=N=N+(C=(C^=E=E+x|0)>>>16|C<<16)|0)>>>20|x<<12,A=(A^=P=P+(L=(L^=M=M+A|0)>>>24|L<<8)|0)>>>25|A<<7,x=(x^=N=N+(C=(C^=E=E+x|0)>>>24|C<<8)|0)>>>25|x<<7,I=(I^=R=R+(k=(k^=_=_+I|0)>>>24|k<<8)|0)>>>25|I<<7,S=(S^=O=O+(T=(T^=w=w+S|0)>>>24|T<<8)|0)>>>25|S<<7,I=(I^=P=P+(C=(C^=w=w+I|0)>>>16|C<<16)|0)>>>20|I<<12,A=(A^=N=N+(T=(T^=_=_+A|0)>>>16|T<<16)|0)>>>20|A<<12,x=(x^=O=O+(k=(k^=M=M+x|0)>>>16|k<<16)|0)>>>20|x<<12,S=(S^=R=R+(L=(L^=E=E+S|0)>>>16|L<<16)|0)>>>20|S<<12,x=(x^=O=O+(k=(k^=M=M+x|0)>>>24|k<<8)|0)>>>25|x<<7,S=(S^=R=R+(L=(L^=E=E+S|0)>>>24|L<<8)|0)>>>25|S<<7,A=(A^=N=N+(T=(T^=_=_+A|0)>>>24|T<<8)|0)>>>25|A<<7,I=(I^=P=P+(C=(C^=w=w+I|0)>>>24|C<<8)|0)>>>25|I<<7;i.writeUint32LE(w+n|0,t,0),i.writeUint32LE(_+s|0,t,4),i.writeUint32LE(M+o|0,t,8),i.writeUint32LE(E+a|0,t,12),i.writeUint32LE(S+h|0,t,16),i.writeUint32LE(I+c|0,t,20),i.writeUint32LE(A+u|0,t,24),i.writeUint32LE(x+f|0,t,28),i.writeUint32LE(O+d|0,t,32),i.writeUint32LE(R+l|0,t,36),i.writeUint32LE(P+p|0,t,40),i.writeUint32LE(N+g|0,t,44),i.writeUint32LE(T+m|0,t,48),i.writeUint32LE(k+b|0,t,52),i.writeUint32LE(L+y|0,t,56),i.writeUint32LE(C+v|0,t,60)}function o(t,e,r,i,o){if(void 0===o&&(o=0),32!==t.length)throw new Error("ChaCha: key size must be 32 bytes");if(i.length>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}e.streamXOR=o,e.stream=function(t,e,r,i){return void 0===i&&(i=0),n.wipe(r),o(t,e,r,r,i)}},1612:(t,e,r)=>{var i=r(9918),n=r(7360),s=r(6228),o=r(972),a=r(6452);e.J4=32,e.PX=12,e.iW=16;var h=new Uint8Array(16),c=function(){function t(t){if(this.nonceLength=e.PX,this.tagLength=e.iW,t.length!==e.J4)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return t.prototype.seal=function(t,e,r,n){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(t,o.length-t.length);var a=new Uint8Array(32);i.stream(this._key,o,a,4);var h,c=e.length+this.tagLength;if(n){if(n.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");h=n}else h=new Uint8Array(c);return i.streamXOR(this._key,o,e,h,4),this._authenticate(h.subarray(h.length-this.tagLength,h.length),a,h.subarray(0,h.length-this.tagLength),r),s.wipe(o),h},t.prototype.open=function(t,e,r,n){if(t.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(e.length0&&a.update(h.subarray(i.length%16))),a.update(r),r.length%16>0&&a.update(h.subarray(r.length%16));var c=new Uint8Array(8);i&&o.writeUint64LE(i.length,c),a.update(c),o.writeUint64LE(r.length,c),a.update(c);for(var u=a.digest(),f=0;f{function r(t,e){if(t.length!==e.length)return 0;for(var r=0,i=0;i>>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)}},4904:(t,e,r)=>{e._S=e.K=e.TP=e.wE=e.Ee=void 0;r(7052);const i=r(4974);r(6228);function n(t){const e=new Float64Array(16);if(t)for(let r=0;r>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,d(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}function p(t){const e=new Uint8Array(32);return l(e,t),1&e[0]}function g(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function m(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function b(t,e,r){let i,n,s=0,o=0,a=0,h=0,c=0,u=0,f=0,d=0,l=0,p=0,g=0,m=0,b=0,y=0,v=0,w=0,_=0,M=0,E=0,S=0,I=0,A=0,x=0,O=0,R=0,P=0,N=0,T=0,k=0,L=0,C=0,q=r[0],U=r[1],j=r[2],z=r[3],D=r[4],B=r[5],$=r[6],K=r[7],F=r[8],V=r[9],H=r[10],W=r[11],G=r[12],J=r[13],Z=r[14],Y=r[15];i=e[0],s+=i*q,o+=i*U,a+=i*j,h+=i*z,c+=i*D,u+=i*B,f+=i*$,d+=i*K,l+=i*F,p+=i*V,g+=i*H,m+=i*W,b+=i*G,y+=i*J,v+=i*Z,w+=i*Y,i=e[1],o+=i*q,a+=i*U,h+=i*j,c+=i*z,u+=i*D,f+=i*B,d+=i*$,l+=i*K,p+=i*F,g+=i*V,m+=i*H,b+=i*W,y+=i*G,v+=i*J,w+=i*Z,_+=i*Y,i=e[2],a+=i*q,h+=i*U,c+=i*j,u+=i*z,f+=i*D,d+=i*B,l+=i*$,p+=i*K,g+=i*F,m+=i*V,b+=i*H,y+=i*W,v+=i*G,w+=i*J,_+=i*Z,M+=i*Y,i=e[3],h+=i*q,c+=i*U,u+=i*j,f+=i*z,d+=i*D,l+=i*B,p+=i*$,g+=i*K,m+=i*F,b+=i*V,y+=i*H,v+=i*W,w+=i*G,_+=i*J,M+=i*Z,E+=i*Y,i=e[4],c+=i*q,u+=i*U,f+=i*j,d+=i*z,l+=i*D,p+=i*B,g+=i*$,m+=i*K,b+=i*F,y+=i*V,v+=i*H,w+=i*W,_+=i*G,M+=i*J,E+=i*Z,S+=i*Y,i=e[5],u+=i*q,f+=i*U,d+=i*j,l+=i*z,p+=i*D,g+=i*B,m+=i*$,b+=i*K,y+=i*F,v+=i*V,w+=i*H,_+=i*W,M+=i*G,E+=i*J,S+=i*Z,I+=i*Y,i=e[6],f+=i*q,d+=i*U,l+=i*j,p+=i*z,g+=i*D,m+=i*B,b+=i*$,y+=i*K,v+=i*F,w+=i*V,_+=i*H,M+=i*W,E+=i*G,S+=i*J,I+=i*Z,A+=i*Y,i=e[7],d+=i*q,l+=i*U,p+=i*j,g+=i*z,m+=i*D,b+=i*B,y+=i*$,v+=i*K,w+=i*F,_+=i*V,M+=i*H,E+=i*W,S+=i*G,I+=i*J,A+=i*Z,x+=i*Y,i=e[8],l+=i*q,p+=i*U,g+=i*j,m+=i*z,b+=i*D,y+=i*B,v+=i*$,w+=i*K,_+=i*F,M+=i*V,E+=i*H,S+=i*W,I+=i*G,A+=i*J,x+=i*Z,O+=i*Y,i=e[9],p+=i*q,g+=i*U,m+=i*j,b+=i*z,y+=i*D,v+=i*B,w+=i*$,_+=i*K,M+=i*F,E+=i*V,S+=i*H,I+=i*W,A+=i*G,x+=i*J,O+=i*Z,R+=i*Y,i=e[10],g+=i*q,m+=i*U,b+=i*j,y+=i*z,v+=i*D,w+=i*B,_+=i*$,M+=i*K,E+=i*F,S+=i*V,I+=i*H,A+=i*W,x+=i*G,O+=i*J,R+=i*Z,P+=i*Y,i=e[11],m+=i*q,b+=i*U,y+=i*j,v+=i*z,w+=i*D,_+=i*B,M+=i*$,E+=i*K,S+=i*F,I+=i*V,A+=i*H,x+=i*W,O+=i*G,R+=i*J,P+=i*Z,N+=i*Y,i=e[12],b+=i*q,y+=i*U,v+=i*j,w+=i*z,_+=i*D,M+=i*B,E+=i*$,S+=i*K,I+=i*F,A+=i*V,x+=i*H,O+=i*W,R+=i*G,P+=i*J,N+=i*Z,T+=i*Y,i=e[13],y+=i*q,v+=i*U,w+=i*j,_+=i*z,M+=i*D,E+=i*B,S+=i*$,I+=i*K,A+=i*F,x+=i*V,O+=i*H,R+=i*W,P+=i*G,N+=i*J,T+=i*Z,k+=i*Y,i=e[14],v+=i*q,w+=i*U,_+=i*j,M+=i*z,E+=i*D,S+=i*B,I+=i*$,A+=i*K,x+=i*F,O+=i*V,R+=i*H,P+=i*W,N+=i*G,T+=i*J,k+=i*Z,L+=i*Y,i=e[15],w+=i*q,_+=i*U,M+=i*j,E+=i*z,S+=i*D,I+=i*B,A+=i*$,x+=i*K,O+=i*F,R+=i*V,P+=i*H,N+=i*W,T+=i*G,k+=i*J,L+=i*Z,C+=i*Y,s+=38*_,o+=38*M,a+=38*E,h+=38*S,c+=38*I,u+=38*A,f+=38*x,d+=38*O,l+=38*R,p+=38*P,g+=38*N,m+=38*T,b+=38*k,y+=38*L,v+=38*C,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),t[0]=s,t[1]=o,t[2]=a,t[3]=h,t[4]=c,t[5]=u,t[6]=f,t[7]=d,t[8]=l,t[9]=p,t[10]=g,t[11]=m,t[12]=b,t[13]=y,t[14]=v,t[15]=w}function y(t,e){b(t,e,e)}function v(t,e){const r=n(),i=n(),s=n(),o=n(),h=n(),c=n(),u=n(),f=n(),d=n();m(r,t[1],t[0]),m(d,e[1],e[0]),b(r,r,d),g(i,t[0],t[1]),g(d,e[0],e[1]),b(i,i,d),b(s,t[3],e[3]),b(s,s,a),b(o,t[2],e[2]),g(o,o,o),m(h,i,r),m(c,o,s),g(u,o,s),g(f,i,r),b(t[0],h,c),b(t[1],f,u),b(t[2],u,c),b(t[3],h,f)}function w(t,e,r){for(let i=0;i<4;i++)d(t[i],e[i],r)}function _(t,e){const r=n(),i=n(),s=n();(function(t,e){const r=n();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=253;i>=0;i--)y(r,r),2!==i&&4!==i&&b(r,r,e);for(i=0;i<16;i++)t[i]=r[i]})(s,e[2]),b(r,e[0],s),b(i,e[1],s),l(t,i),t[31]^=p(r)<<7}function M(t,e){const r=[n(),n(),n(),n()];u(r[0],h),u(r[1],c),u(r[2],o),b(r[3],h,c),function(t,e,r){u(t[0],s),u(t[1],o),u(t[2],o),u(t[3],s);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;w(t,e,n),v(e,t),v(t,t),w(t,e,n)}}(t,r,e)}e.K=function(t){if(t.length!==e.TP)throw new Error(`ed25519: seed must be ${e.TP} bytes`);const r=(0,i.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const s=new Uint8Array(32),o=[n(),n(),n(),n()];M(o,r),_(s,o);const a=new Uint8Array(64);return a.set(t),a.set(s,32),{publicKey:s,secretKey:a}};const E=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function S(t,e){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n>4)*E[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*E[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function I(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;S(t,e)}e._S=function(t,e){const r=new Float64Array(64),s=[n(),n(),n(),n()],o=(0,i.hash)(t.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;const a=new Uint8Array(64);a.set(o.subarray(32),32);const h=new i.SHA512;h.update(a.subarray(32)),h.update(e);const c=h.digest();h.clean(),I(c),M(s,c),_(a,s),h.reset(),h.update(a.subarray(0,32)),h.update(t.subarray(32)),h.update(e);const u=h.digest();I(u);for(let t=0;t<32;t++)r[t]=c[t];for(let t=0;t<32;t++)for(let e=0;e<32;e++)r[t+e]+=u[t]*o[e];return S(a.subarray(32),r),a}},2670:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSerializableHash=function(t){return void 0!==t.saveState&&void 0!==t.restoreState&&void 0!==t.cleanSavedState}},6804:(t,e,r)=>{var i=r(2412),n=r(6228),s=function(){function t(t,e,r,n){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=n;var s=i.hmac(this._hash,r,e);this._hmac=new i.HMAC(t,s),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{Object.defineProperty(e,"__esModule",{value:!0});var i=r(2670),n=r(6452),s=r(6228),o=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 n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,i=65535&e;return r*i+((t>>>16&65535)*i+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<>>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}},7360:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=r(6452),n=r(6228);e.DIGEST_LENGTH=16;var s=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 i=t[2]|t[3]<<8;this._r[1]=8191&(r>>>13|i<<3);var n=t[4]|t[5]<<8;this._r[2]=7939&(i>>>10|n<<6);var s=t[6]|t[7]<<8;this._r[3]=8191&(n>>>7|s<<9);var o=t[8]|t[9]<<8;this._r[4]=255&(s>>>4|o<<12),this._r[5]=o>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(o>>>14|a<<2);var h=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|h<<5);var c=t[14]|t[15]<<8;this._r[8]=8191&(h>>>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 i=this._fin?0:2048,n=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],h=this._h[4],c=this._h[5],u=this._h[6],f=this._h[7],d=this._h[8],l=this._h[9],p=this._r[0],g=this._r[1],m=this._r[2],b=this._r[3],y=this._r[4],v=this._r[5],w=this._r[6],_=this._r[7],M=this._r[8],E=this._r[9];r>=16;){var S=t[e+0]|t[e+1]<<8;n+=8191&S;var I=t[e+2]|t[e+3]<<8;s+=8191&(S>>>13|I<<3);var A=t[e+4]|t[e+5]<<8;o+=8191&(I>>>10|A<<6);var x=t[e+6]|t[e+7]<<8;a+=8191&(A>>>7|x<<9);var O=t[e+8]|t[e+9]<<8;h+=8191&(x>>>4|O<<12),c+=O>>>1&8191;var R=t[e+10]|t[e+11]<<8;u+=8191&(O>>>14|R<<2);var P=t[e+12]|t[e+13]<<8;f+=8191&(R>>>11|P<<5);var N=t[e+14]|t[e+15]<<8,T=0,k=T;k+=n*p,k+=s*(5*E),k+=o*(5*M),k+=a*(5*_),T=(k+=h*(5*w))>>>13,k&=8191,k+=c*(5*v),k+=u*(5*y),k+=f*(5*b),k+=(d+=8191&(P>>>8|N<<8))*(5*m);var L=T+=(k+=(l+=N>>>5|i)*(5*g))>>>13;L+=n*g,L+=s*p,L+=o*(5*E),L+=a*(5*M),T=(L+=h*(5*_))>>>13,L&=8191,L+=c*(5*w),L+=u*(5*v),L+=f*(5*y),L+=d*(5*b),T+=(L+=l*(5*m))>>>13,L&=8191;var C=T;C+=n*m,C+=s*g,C+=o*p,C+=a*(5*E),T=(C+=h*(5*M))>>>13,C&=8191,C+=c*(5*_),C+=u*(5*w),C+=f*(5*v),C+=d*(5*y);var q=T+=(C+=l*(5*b))>>>13;q+=n*b,q+=s*m,q+=o*g,q+=a*p,T=(q+=h*(5*E))>>>13,q&=8191,q+=c*(5*M),q+=u*(5*_),q+=f*(5*w),q+=d*(5*v);var U=T+=(q+=l*(5*y))>>>13;U+=n*y,U+=s*b,U+=o*m,U+=a*g,T=(U+=h*p)>>>13,U&=8191,U+=c*(5*E),U+=u*(5*M),U+=f*(5*_),U+=d*(5*w);var j=T+=(U+=l*(5*v))>>>13;j+=n*v,j+=s*y,j+=o*b,j+=a*m,T=(j+=h*g)>>>13,j&=8191,j+=c*p,j+=u*(5*E),j+=f*(5*M),j+=d*(5*_);var z=T+=(j+=l*(5*w))>>>13;z+=n*w,z+=s*v,z+=o*y,z+=a*b,T=(z+=h*m)>>>13,z&=8191,z+=c*g,z+=u*p,z+=f*(5*E),z+=d*(5*M);var D=T+=(z+=l*(5*_))>>>13;D+=n*_,D+=s*w,D+=o*v,D+=a*y,T=(D+=h*b)>>>13,D&=8191,D+=c*m,D+=u*g,D+=f*p,D+=d*(5*E);var B=T+=(D+=l*(5*M))>>>13;B+=n*M,B+=s*_,B+=o*w,B+=a*v,T=(B+=h*y)>>>13,B&=8191,B+=c*b,B+=u*m,B+=f*g,B+=d*p;var $=T+=(B+=l*(5*E))>>>13;$+=n*E,$+=s*M,$+=o*_,$+=a*w,T=($+=h*v)>>>13,$&=8191,$+=c*y,$+=u*b,$+=f*m,$+=d*g,n=k=8191&(T=(T=((T+=($+=l*p)>>>13)<<2)+T|0)+(k&=8191)|0),s=L+=T>>>=13,o=C&=8191,a=q&=8191,h=U&=8191,c=j&=8191,u=z&=8191,f=D&=8191,d=B&=8191,l=$&=8191,e+=16,r-=16}this._h[0]=n,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=h,this._h[5]=c,this._h[6]=u,this._h[7]=f,this._h[8]=d,this._h[9]=l},t.prototype.finish=function(t,e){void 0===e&&(e=0);var r,i,n,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=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,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^r)-1,s=0;s<10;s++)o[s]&=i;for(i=~i,s=0;s<10;s++)this._h[s]=this._h[s]&i|o[s];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),n=this._h[0]+this._pad[0],this._h[0]=65535&n,s=1;s<8;s++)n=(this._h[s]+this._pad[s]|0)+(n>>>16)|0,this._h[s]=65535&n;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,i=t.length;if(this._leftover){(e=16-this._leftover)>i&&(e=i);for(var n=0;n=16&&(e=i-i%16,this._blocks(t,r,e),r+=e,i-=e),i){for(n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(5492),n=r(972),s=r(6228);function o(t,r=e.defaultRandomSource){return r.randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(t=e.defaultRandomSource){const r=o(4,t),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function h(t,r=a,i=e.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let n="";const h=r.length,c=256-256%h;for(;t>0;){const e=o(Math.ceil(256*t/c),i);for(let i=0;i0;i++){const s=e[i];s{Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0,e.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(6228);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(9432);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(7029),n=r(5821);e.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new n.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}},204:(t,e,r)=>{var i=r(972),n=r(6228);e.On=32,e.cS=64;var s=function(){function t(){this.digestLength=e.On,this.blockSize=e.cS,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(){n.wipe(this._buffer),n.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._bufferLength0;)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,n=e/536870912|0,s=e<<3,o=e%64<56?64:128;this._buffer[r]=128;for(var h=r+1;h0?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){n.wipe(t.state),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.aD=s;var o=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,n,s){for(;s>=64;){for(var a=e[0],h=e[1],c=e[2],u=e[3],f=e[4],d=e[5],l=e[6],p=e[7],g=0;g<16;g++){var m=n+4*g;t[g]=i.readUint32BE(r,m)}for(g=16;g<64;g++){var b=t[g-2],y=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10,v=((b=t[g-15])>>>7|b<<25)^(b>>>18|b<<14)^b>>>3;t[g]=(y+t[g-7]|0)+(v+t[g-16]|0)}for(g=0;g<64;g++)y=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&d^~f&l)|0)+(p+(o[g]+t[g]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&h^a&c^h&c)|0,p=l,l=d,d=f,f=u+y|0,u=c,c=h,h=a,a=y+v|0;e[0]+=a,e[1]+=h,e[2]+=c,e[3]+=u,e[4]+=f,e[5]+=d,e[6]+=l,e[7]+=p,n+=64,s-=64}return n}e.tW=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},4974:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=r(972),n=r(6228);e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var s=function(){function t(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=t[i++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(i=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,t,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=t[i++],r--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%128<112?128:256;this._buffer[r]=128;for(var h=r+1;h0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.stateHi),n.wipe(t.stateLo),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.SHA512=s;var o=new Int32Array([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 a(t,e,r,n,s,a,h){for(var c,u,f,d,l,p,g,m,b=r[0],y=r[1],v=r[2],w=r[3],_=r[4],M=r[5],E=r[6],S=r[7],I=n[0],A=n[1],x=n[2],O=n[3],R=n[4],P=n[5],N=n[6],T=n[7];h>=128;){for(var k=0;k<16;k++){var L=8*k+a;t[k]=i.readUint32BE(s,L),e[k]=i.readUint32BE(s,L+4)}for(k=0;k<80;k++){var C,q,U=b,j=y,z=v,D=w,B=_,$=M,K=E,F=I,V=A,H=x,W=O,G=R,J=P,Z=N;if(l=65535&(u=T),p=u>>>16,g=65535&(c=S),m=c>>>16,l+=65535&(u=(R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23)),p+=u>>>16,g+=65535&(c=(_>>>14|R<<18)^(_>>>18|R<<14)^(R>>>9|_<<23)),m+=c>>>16,l+=65535&(u=R&P^~R&N),p+=u>>>16,g+=65535&(c=_&M^~_&E),m+=c>>>16,c=o[2*k],l+=65535&(u=o[2*k+1]),p+=u>>>16,g+=65535&c,m+=c>>>16,c=t[k%16],p+=(u=e[k%16])>>>16,g+=65535&c,m+=c>>>16,g+=(p+=(l+=65535&u)>>>16)>>>16,l=65535&(u=d=65535&l|p<<16),p=u>>>16,g=65535&(c=f=65535&g|(m+=g>>>16)<<16),m=c>>>16,l+=65535&(u=(I>>>28|b<<4)^(b>>>2|I<<30)^(b>>>7|I<<25)),p+=u>>>16,g+=65535&(c=(b>>>28|I<<4)^(I>>>2|b<<30)^(I>>>7|b<<25)),m+=c>>>16,p+=(u=I&A^I&x^A&x)>>>16,g+=65535&(c=b&y^b&v^y&v),m+=c>>>16,C=65535&(g+=(p+=(l+=65535&u)>>>16)>>>16)|(m+=g>>>16)<<16,q=65535&l|p<<16,l=65535&(u=W),p=u>>>16,g=65535&(c=D),m=c>>>16,p+=(u=d)>>>16,g+=65535&(c=f),m+=c>>>16,y=U,v=j,w=z,_=D=65535&(g+=(p+=(l+=65535&u)>>>16)>>>16)|(m+=g>>>16)<<16,M=B,E=$,S=K,b=C,A=F,x=V,O=H,R=W=65535&l|p<<16,P=G,N=J,T=Z,I=q,k%16==15)for(L=0;L<16;L++)c=t[L],l=65535&(u=e[L]),p=u>>>16,g=65535&c,m=c>>>16,c=t[(L+9)%16],l+=65535&(u=e[(L+9)%16]),p+=u>>>16,g+=65535&c,m+=c>>>16,f=t[(L+1)%16],l+=65535&(u=((d=e[(L+1)%16])>>>1|f<<31)^(d>>>8|f<<24)^(d>>>7|f<<25)),p+=u>>>16,g+=65535&(c=(f>>>1|d<<31)^(f>>>8|d<<24)^f>>>7),m+=c>>>16,f=t[(L+14)%16],p+=(u=((d=e[(L+14)%16])>>>19|f<<13)^(f>>>29|d<<3)^(d>>>6|f<<26))>>>16,g+=65535&(c=(f>>>19|d<<13)^(d>>>29|f<<3)^f>>>6),m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,t[L]=65535&g|m<<16,e[L]=65535&l|p<<16}l=65535&(u=I),p=u>>>16,g=65535&(c=b),m=c>>>16,c=r[0],p+=(u=n[0])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[0]=b=65535&g|m<<16,n[0]=I=65535&l|p<<16,l=65535&(u=A),p=u>>>16,g=65535&(c=y),m=c>>>16,c=r[1],p+=(u=n[1])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[1]=y=65535&g|m<<16,n[1]=A=65535&l|p<<16,l=65535&(u=x),p=u>>>16,g=65535&(c=v),m=c>>>16,c=r[2],p+=(u=n[2])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[2]=v=65535&g|m<<16,n[2]=x=65535&l|p<<16,l=65535&(u=O),p=u>>>16,g=65535&(c=w),m=c>>>16,c=r[3],p+=(u=n[3])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[3]=w=65535&g|m<<16,n[3]=O=65535&l|p<<16,l=65535&(u=R),p=u>>>16,g=65535&(c=_),m=c>>>16,c=r[4],p+=(u=n[4])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[4]=_=65535&g|m<<16,n[4]=R=65535&l|p<<16,l=65535&(u=P),p=u>>>16,g=65535&(c=M),m=c>>>16,c=r[5],p+=(u=n[5])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[5]=M=65535&g|m<<16,n[5]=P=65535&l|p<<16,l=65535&(u=N),p=u>>>16,g=65535&(c=E),m=c>>>16,c=r[6],p+=(u=n[6])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[6]=E=65535&g|m<<16,n[6]=N=65535&l|p<<16,l=65535&(u=T),p=u>>>16,g=65535&(c=S),m=c>>>16,c=r[7],p+=(u=n[7])>>>16,g+=65535&c,m+=c>>>16,m+=(g+=(p+=(l+=65535&u)>>>16)>>>16)>>>16,r[7]=S=65535&g|m<<16,n[7]=T=65535&l|p<<16,a+=128,h-=128}return a}e.hash=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},6228:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e{e.Tc=e.TZ=e.wE=e.Xx=void 0;const i=r(7052),n=r(6228);function s(t){const e=new Float64Array(16);if(t)for(let r=0;r=0;--t){const e=r[t>>>3]>>>(7&t)&1;c(n,o,e),c(p,g,e),u(m,n,p),f(n,n,p),u(p,o,g),f(o,o,g),l(g,m),l(b,n),d(n,p,n),d(p,o,m),u(m,n,p),f(n,n,p),l(o,n),f(p,g,b),d(n,p,a),u(n,n,g),d(p,p,n),d(n,g,b),d(g,o,i),l(o,m),c(n,o,e),c(p,g,e)}for(let t=0;t<16;t++)i[t+16]=n[t],i[t+32]=p[t],i[t+48]=o[t],i[t+64]=g[t];const y=i.subarray(32),v=i.subarray(16);!function(t,e){const r=s();for(let t=0;t<16;t++)r[t]=e[t];for(let t=253;t>=0;t--)l(r,r),2!==t&&4!==t&&d(r,r,e);for(let e=0;e<16;e++)t[e]=r[e]}(y,y),d(v,v,y);const w=new Uint8Array(32);return function(t,e){const r=s(),i=s();for(let t=0;t<16;t++)i[t]=e[t];h(i),h(i),h(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,c(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}(w,v),w}function g(t){return p(t,o)}e.TZ=function(t){const r=(0,i.randomBytes)(32,t),s=function(t){if(t.length!==e.wE)throw new Error(`x25519: seed must be ${e.wE} bytes`);const r=new Uint8Array(t);return{publicKey:g(r),secretKey:r}}(r);return(0,n.wipe)(r),s},e.Tc=function(t,r,i=!1){if(t.length!==e.Xx)throw new Error("X25519: incorrect secret key length");if(r.length!==e.Xx)throw new Error("X25519: incorrect public key length");const n=p(t,r);if(i){let t=0;for(let e=0;e{function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){const t=i();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=i,e.getSubtleCrypto=n,e.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},1089:(t,e)=>{function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=r,e.isNode=i,e.isBrowser=function(){return!r()&&!i()}},5682:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(7173),e),i.__exportStar(r(1089),e)},796:t=>{t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},5665:()=>{},9026:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(9244),e),i.__exportStar(r(1861),e)},9244:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_THOUSAND=e.ONE_HUNDRED=void 0,e.ONE_HUNDRED=100,e.ONE_THOUSAND=1e3},1861:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=5*e.ONE_MINUTE,e.TEN_MINUTES=10*e.ONE_MINUTE,e.THIRTY_MINUTES=30*e.ONE_MINUTE,e.SIXTY_MINUTES=60*e.ONE_MINUTE,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=3*e.ONE_HOUR,e.SIX_HOURS=6*e.ONE_HOUR,e.TWELVE_HOURS=12*e.ONE_HOUR,e.TWENTY_FOUR_HOURS=24*e.ONE_HOUR,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=3*e.ONE_DAY,e.FIVE_DAYS=5*e.ONE_DAY,e.SEVEN_DAYS=7*e.ONE_DAY,e.THIRTY_DAYS=30*e.ONE_DAY,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=2*e.ONE_WEEK,e.THREE_WEEKS=3*e.ONE_WEEK,e.FOUR_WEEKS=4*e.ONE_WEEK,e.ONE_YEAR=365*e.ONE_DAY},8900:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(9606),e),i.__exportStar(r(9883),e),i.__exportStar(r(2010),e),i.__exportStar(r(9026),e)},2010:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),r(5215).__exportStar(r(3093),e)},3093:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IWatch=void 0,e.IWatch=class{}},221:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fromMiliseconds=e.toMiliseconds=void 0;const i=r(9026);e.toMiliseconds=function(t){return t*i.ONE_THOUSAND},e.fromMiliseconds=function(t){return Math.floor(t/i.ONE_THOUSAND)}},2985:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t){return new Promise((e=>{setTimeout((()=>{e(!0)}),t)}))}},9606:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(5215);i.__exportStar(r(2985),e),i.__exportStar(r(221),e)},9883:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const e=this.get(t);if(void 0!==e.elapsed)throw new Error(`Watch already stopped for label: ${t}`);const r=Date.now()-e.started;this.timestamps.set(t,{started:e.started,elapsed:r})}get(t){const e=this.timestamps.get(t);if(void 0===e)throw new Error(`No timestamp found for label: ${t}`);return e}elapsed(t){const e=this.get(t);return e.elapsed||Date.now()-e.started}}e.Watch=r,e.default=r},8196:(t,e)=>{function r(t){let e;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function i(t){const e=r(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=i,e.getDocumentOrThrow=function(){return i("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return i("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return i("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return i("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return i("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},2063:(t,e,r)=>{e.g=void 0;const i=r(8196);e.g=function(){let t,e;try{t=i.getDocumentOrThrow(),e=i.getLocationOrThrow()}catch(t){return null}function r(...e){const r=t.getElementsByTagName("meta");for(let t=0;ti.getAttribute(t))).filter((t=>!!t&&e.includes(t)));if(n.length&&n){const t=i.getAttribute("content");if(t)return t}}return""}const n=function(){let e=r("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}(),s=r("description","og:description","twitter:description","keywords"),o=e.origin,a=function(){const r=t.getElementsByTagName("link"),i=[];for(let t=0;t-1){const t=n.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let r=e.protocol+"//"+e.host;if(0===t.indexOf("/"))r+=t;else{const i=e.pathname.split("/");i.pop(),r+=i.join("/")+"/"+t}i.push(r)}else if(0===t.indexOf("//")){const r=e.protocol+t;i.push(r)}else i.push(t)}}return i}();return{description:s,url:o,icons:a,name:n}}},7526:(t,e)=>{e.byteLength=function(t){var e=a(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],h=s[1],c=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,h)),u=0,f=h>0?o-4:o;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===h&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===h&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;ac?c:a+o));return 1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(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 h(t,e,i){for(var n,s,o=[],a=e;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},9404:function(t,e,r){!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.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 o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}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 h(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function c(t,e,r,i){for(var n=0,s=Math.min(t.length,r),o=e;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.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),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=h(t,e,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&h,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;u+=(o=(n=0|t.words[p])*(s=0|e.words[l])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,h=0|u}return 0!==h?r.words[c]=0|h:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.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=f[t],l=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?g+r:u[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,c=new t(s),u=this.clone();if(h){for(a=0;!u.isZero();a++)o=u.andln(255),u.iushrn(8),c[a]=o;for(;a=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},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},s.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,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==s&&o>26,this.words[o]=67108863&e;if(0===s&&o>>13,l=0|o[1],p=8191&l,g=l>>>13,m=0|o[2],b=8191&m,y=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,I=0|o[5],A=8191&I,x=I>>>13,O=0|o[6],R=8191&O,P=O>>>13,N=0|o[7],T=8191&N,k=N>>>13,L=0|o[8],C=8191&L,q=L>>>13,U=0|o[9],j=8191&U,z=U>>>13,D=0|a[0],B=8191&D,$=D>>>13,K=0|a[1],F=8191&K,V=K>>>13,H=0|a[2],W=8191&H,G=H>>>13,J=0|a[3],Z=8191&J,Y=J>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,ct=at>>>13,ut=0|a[8],ft=8191&ut,dt=ut>>>13,lt=0|a[9],pt=8191<,gt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(i=Math.imul(f,B))|0)+((8191&(n=(n=Math.imul(f,$))+Math.imul(d,B)|0))<<13)|0;c=((s=Math.imul(d,$))+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(p,B),n=(n=Math.imul(p,$))+Math.imul(g,B)|0,s=Math.imul(g,$);var bt=(c+(i=i+Math.imul(f,F)|0)|0)+((8191&(n=(n=n+Math.imul(f,V)|0)+Math.imul(d,F)|0))<<13)|0;c=((s=s+Math.imul(d,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(b,B),n=(n=Math.imul(b,$))+Math.imul(y,B)|0,s=Math.imul(y,$),i=i+Math.imul(p,F)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,F)|0,s=s+Math.imul(g,V)|0;var yt=(c+(i=i+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((s=s+Math.imul(d,G)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,B),n=(n=Math.imul(w,$))+Math.imul(_,B)|0,s=Math.imul(_,$),i=i+Math.imul(b,F)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,F)|0,s=s+Math.imul(y,V)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,G)|0;var vt=(c+(i=i+Math.imul(f,Z)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(d,Z)|0))<<13)|0;c=((s=s+Math.imul(d,Y)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(E,B),n=(n=Math.imul(E,$))+Math.imul(S,B)|0,s=Math.imul(S,$),i=i+Math.imul(w,F)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(_,F)|0,s=s+Math.imul(_,V)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,Y)|0;var wt=(c+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(d,Q)|0))<<13)|0;c=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(A,B),n=(n=Math.imul(A,$))+Math.imul(x,B)|0,s=Math.imul(x,$),i=i+Math.imul(E,F)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(S,F)|0,s=s+Math.imul(S,V)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,Z)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,tt)|0;var _t=(c+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(d,rt)|0))<<13)|0;c=((s=s+Math.imul(d,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,B),n=(n=Math.imul(R,$))+Math.imul(P,B)|0,s=Math.imul(P,$),i=i+Math.imul(A,F)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(x,F)|0,s=s+Math.imul(x,V)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,W)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(g,rt)|0,s=s+Math.imul(g,it)|0;var Mt=(c+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(d,st)|0))<<13)|0;c=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(T,B),n=(n=Math.imul(T,$))+Math.imul(k,B)|0,s=Math.imul(k,$),i=i+Math.imul(R,F)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(P,F)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,G)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(y,rt)|0,s=s+Math.imul(y,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,st)|0,s=s+Math.imul(g,ot)|0;var Et=(c+(i=i+Math.imul(f,ht)|0)|0)+((8191&(n=(n=n+Math.imul(f,ct)|0)+Math.imul(d,ht)|0))<<13)|0;c=((s=s+Math.imul(d,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(C,B),n=(n=Math.imul(C,$))+Math.imul(q,B)|0,s=Math.imul(q,$),i=i+Math.imul(T,F)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(k,F)|0,s=s+Math.imul(k,V)|0,i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,Y)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,ot)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(g,ht)|0,s=s+Math.imul(g,ct)|0;var St=(c+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,dt)|0)+Math.imul(d,ft)|0))<<13)|0;c=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(j,B),n=(n=Math.imul(j,$))+Math.imul(z,B)|0,s=Math.imul(z,$),i=i+Math.imul(C,F)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(q,F)|0,s=s+Math.imul(q,V)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(k,W)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,Y)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(y,ht)|0,s=s+Math.imul(y,ct)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(g,ft)|0,s=s+Math.imul(g,dt)|0;var It=(c+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((s=s+Math.imul(d,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,V))+Math.imul(z,F)|0,s=Math.imul(z,V),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(q,W)|0,s=s+Math.imul(q,G)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(k,Z)|0,s=s+Math.imul(k,Y)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,ct)|0,i=i+Math.imul(b,ft)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(y,ft)|0,s=s+Math.imul(y,dt)|0;var At=(c+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((s=s+Math.imul(g,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(j,W),n=(n=Math.imul(j,G))+Math.imul(z,W)|0,s=Math.imul(z,G),i=i+Math.imul(C,Z)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(q,Z)|0,s=s+Math.imul(q,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,it)|0,i=i+Math.imul(A,st)|0,n=(n=n+Math.imul(A,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(S,ht)|0,s=s+Math.imul(S,ct)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,dt)|0;var xt=(c+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,gt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((s=s+Math.imul(y,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(j,Z),n=(n=Math.imul(j,Y))+Math.imul(z,Z)|0,s=Math.imul(z,Y),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(q,Q)|0,s=s+Math.imul(q,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(k,rt)|0,s=s+Math.imul(k,it)|0,i=i+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(x,ht)|0,s=s+Math.imul(x,ct)|0,i=i+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(S,ft)|0,s=s+Math.imul(S,dt)|0;var Ot=(c+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((s=s+Math.imul(_,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(j,Q),n=(n=Math.imul(j,tt))+Math.imul(z,Q)|0,s=Math.imul(z,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(q,rt)|0,s=s+Math.imul(q,it)|0,i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(k,st)|0,s=s+Math.imul(k,ot)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ct)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,dt)|0;var Rt=(c+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,gt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((s=s+Math.imul(S,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(j,rt),n=(n=Math.imul(j,it))+Math.imul(z,rt)|0,s=Math.imul(z,it),i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(q,st)|0,s=s+Math.imul(q,ot)|0,i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(k,ht)|0,s=s+Math.imul(k,ct)|0,i=i+Math.imul(R,ft)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(P,ft)|0,s=s+Math.imul(P,dt)|0;var Pt=(c+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((s=s+Math.imul(x,gt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(j,st),n=(n=Math.imul(j,ot))+Math.imul(z,st)|0,s=Math.imul(z,ot),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(q,ht)|0,s=s+Math.imul(q,ct)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(k,ft)|0,s=s+Math.imul(k,dt)|0;var Nt=(c+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((s=s+Math.imul(P,gt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(j,ht),n=(n=Math.imul(j,ct))+Math.imul(z,ht)|0,s=Math.imul(z,ct),i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(q,ft)|0,s=s+Math.imul(q,dt)|0;var Tt=(c+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((s=s+Math.imul(k,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(j,ft),n=(n=Math.imul(j,dt))+Math.imul(z,ft)|0,s=Math.imul(z,dt);var kt=(c+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(q,pt)|0))<<13)|0;c=((s=s+Math.imul(q,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(c+(i=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,gt))+Math.imul(z,pt)|0))<<13)|0;return c=((s=Math.imul(z,gt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h[0]=mt,h[1]=bt,h[2]=yt,h[3]=vt,h[4]=wt,h[5]=_t,h[6]=Mt,h[7]=Et,h[8]=St,h[9]=It,h[10]=At,h[11]=xt,h[12]=Ot,h[13]=Rt,h[14]=Pt,h[15]=Nt,h[16]=Tt,h[17]=kt,h[18]=Lt,0!==c&&(h[19]=c,r.length++),r};function g(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=l),s.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?l(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,t,e):g(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o>=26,e+=n/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=n);c--){var f=0|this.words[c];this.words[c]=u<<26-s|f>>>s,u=f&a}return h&&0!==u&&(h.words[h.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(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 n=67108863^67108863>>>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},s.prototype.isubn=function(t){if(i("number"==typeof t),i(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>26)-(h/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,h=i.length-n.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var d=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(d=Math.min(d/o|0,67108863),i._ishlnsubmul(n,d,f);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=d)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.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,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var d=0,l=1;!(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(u),h.isub(f)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(h)):(r.isub(e),a.isub(n),h.isub(o))}return{a,b:h,gcd:r.iushln(c)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;!(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var f=0,d=1;!(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.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 i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.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),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new E(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}y.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},n(v,y),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&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>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(b[t])return b[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 M}return b[t]=e,e},E.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.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)},E.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},E.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)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,c).cmp(h);)u.redIAdd(h);for(var f=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=o;0!==l.cmp(a);){for(var g=l,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m=0;i--){for(var c=e.words[i],u=h-1;u>=0;u--){var f=c>>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==o?(o<<=1,o|=f,(4==++a||0===i&&0===u)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}h=26}return n},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new S(t)},n(S,E),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},5037:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{const i=r(7526),n=r(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=h,e.IS=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,h.prototype),e}function h(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 f(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let i=a(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return h.from(i,e,r);const n=function(t){if(h.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Z(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.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 u(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 f(t){return u(t),a(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function g(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(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(n)return i?-1:H(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){let i=!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 P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){let s,o=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,h/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(s=r;sa&&(r=a-h),s=r;s>=0;s--){let r=!0;for(let i=0;in&&(i=n):i=n;const s=e.length;let o;for(i>s/2&&(i=s/2),o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function I(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,a,h;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[n+1],128==(192&r)&&(h=(31&e)<<6|63&r,h>127&&(s=h));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(h=(15&e)<<12|(63&r)<<6|63&i,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(h=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii.length?(h.isBuffer(e)||(e=h.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!h.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},h.byteLength=g,h.prototype._isBuffer=!0,h.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;er&&(t+=" ... "),""},s&&(h.prototype[s]=h.prototype.inspect),h.prototype.compare=function(t,e,r,i,n){if(J(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.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===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(s,o),c=this.slice(i,n),u=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){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 M(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function O(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;ni)&&(r=i);let n="";for(let i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,i,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function L(t,e,r,i,n){$(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function C(t,e,r,i,n){$(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function q(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,i,s){return e=+e,r>>>=0,s||q(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function j(t,e,r,i,s){return e=+e,r>>>=0,s||q(t,0,r,8),n.write(t,e,r,i,52,8),r+8}h.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>>=0,e>>>=0,r||T(t,e,this.length);let i=this[t],n=1,s=0;for(;++s>>=0,e>>>=0,r||T(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUint8=h.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readBigUInt64LE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<>>=0,e>>>=0,r||T(t,e,this.length);let i=this[t],n=1,s=0;for(;++s=n&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let i=e,n=1,s=this[t+--i];for(;i>0&&(n*=256);)s+=this[t+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},h.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readBigInt64LE=X((function(t){K(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<>>=0,e||T(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||k(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,i||k(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(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},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(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},h.prototype.writeBigUInt64LE=X((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeBigUInt64BE=X((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=0,s=1,o=0;for(this[e]=255&t;++n>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[e+n]=255&t;--n>=0&&(s*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/s|0)-o&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(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},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(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},h.prototype.writeBigInt64LE=X((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeBigInt64BE=X((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,i,n,s){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new z.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){K(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||F(e,t.length-(r+1))}(i,n,s)}function K(t,e){if("number"!=typeof t)throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function F(t,e,r){if(Math.floor(t)!==t)throw K(t,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=B(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=B(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function H(t,e){let r;e=e||1/0;const i=t.length;let n=null;const s=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function W(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const Y=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},454:t=>{var e="%[a-f0-9]{2}",r=new RegExp("("+e+")|([^%]+?)","gi"),i=new RegExp("("+e+")+","gi");function n(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],n(r),n(i))}function s(t){try{return decodeURIComponent(t)}catch(s){for(var e=t.match(r)||[],i=1;i{var i=e;i.version=r(1636).rE,i.utils=r(7011),i.rand=r(5037),i.curve=r(894),i.curves=r(480),i.ec=r(7447),i.eddsa=r(8650)},6677:(t,e,r)=>{var i=r(9404),n=r(7011),s=n.getNAF,o=n.getJSF,a=n.assert;function h(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(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=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=s(e,1,this._bitLength),n=(1<=o;u--)h=(h<<1)+i[u];c.push(h)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o=0;c--){for(var u=0;c>=0&&0===o[c];c--)u++;if(c>=0&&u++,h=h.dblp(u),c<0)break;var f=o[c];a(0!==f),h="affine"===t.type?f>0?h.mixedAdd(n[f-1>>1]):h.mixedAdd(n[-f-1>>1].neg()):f>0?h.add(n[f-1>>1]):h.add(n[-f-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,r,i,n){var a,h,c,u=this._wnafT1,f=this._wnafT2,d=this._wnafT3,l=0;for(a=0;a=1;a-=2){var g=a-1,m=a;if(1===u[g]&&1===u[m]){var b=[e[g],null,null,e[m]];0===e[g].y.cmp(e[m].y)?(b[1]=e[g].add(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg())):0===e[g].y.cmp(e[m].y.redNeg())?(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].add(e[m].neg())):(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[g],r[m]);for(l=Math.max(v[0].length,l),d[g]=new Array(l),d[m]=new Array(l),h=0;h=0;a--){for(var S=0;a>=0;){var I=!0;for(h=0;h=0&&S++,M=M.dblp(S),a<0)break;for(h=0;h0?c=f[h][A-1>>1]:A<0&&(c=f[h][-A-1>>1].neg()),M="affine"===c.type?M.mixedAdd(c):M.add(c))}}for(a=0;a=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],i=this,n=0;n{var i=r(7011),n=r(9404),s=r(6698),o=r(6677),a=i.assert;function h(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(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,i,s){o.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(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 n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,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()))))}s(h,o),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var h=a.fromRed().isOdd();return(e&&!h||!e&&h)&&(a=a.redNeg()),this.point(t,a)},h.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},h.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},s(c,o.BasePoint),h.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},h.prototype.point=function(t,e,r,i){return new c(this,t,e,r,i)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},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 i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=i.redAdd(e),o=s.redSub(r),a=i.redSub(e),h=n.redMul(o),c=s.redMul(a),u=n.redMul(a),f=o.redMul(s);return this.curve.point(h,c,f,u)},c.prototype._projDbl=function(){var t,e,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),h=this.y.redSqr();if(this.curve.twisted){var c=(i=this.curve._mulA(a)).redAdd(h);this.zOne?(t=o.redSub(a).redSub(h).redMul(c.redSub(this.curve.two)),e=c.redMul(i.redSub(h)),r=c.redSqr().redSub(c).redSub(c)):(n=this.z.redSqr(),s=c.redSub(n).redISub(n),t=o.redSub(a).redISub(h).redMul(s),e=c.redMul(i.redSub(h)),r=c.redMul(s))}else i=a.redAdd(h),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(s),e=this.curve._mulC(i).redMul(a.redISub(h)),r=i.redMul(s);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)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=n.redSub(i),a=n.redAdd(i),h=r.redAdd(e),c=s.redMul(o),u=a.redMul(h),f=s.redMul(h),d=o.redMul(a);return this.curve.point(c,u,d,f)},c.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),h=n.redSub(a),c=n.redAdd(a),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),f=i.redMul(h).redMul(u);return this.curve.twisted?(e=i.redMul(c).redMul(o.redSub(this.curve._mulA(s))),r=h.redMul(c)):(e=i.redMul(c).redMul(o.redSub(s)),r=this.curve._mulC(h).redMul(c)),this.curve.point(f,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(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},894:(t,e,r)=>{var i=e;i.base=r(6677),i.short=r(9188),i.mont=r(370),i.edwards=r(1298)},370:(t,e,r)=>{var i=r(9404),n=r(6698),s=r(6677),o=r(7011);function a(t){s.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(t,e,r){s.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(h,s.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new h(this,t,e)},a.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(r),o=n.redMul(i),a=e.z.redMul(s.redAdd(o).redSqr()),h=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,h)},h.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},9188:(t,e,r)=>{var i=r(7011),n=r(9404),s=r(6698),o=r(6677),a=i.assert;function h(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(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,i){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(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 u(t,e,r,i){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(h,o),t.exports=h,h.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[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 n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),s=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},h.prototype._getEndoBasis=function(t){for(var e,r,i,s,o,a,h,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new n(1),g=new n(0),m=new n(0),b=new n(1),y=0;0!==d.cmpn(0);){var v=l.div(d);c=l.sub(v.mul(d)),u=m.sub(v.mul(p));var w=b.sub(v.mul(g));if(!i&&c.cmp(f)<0)e=h.neg(),r=p,i=c.neg(),s=u;else if(i&&2==++y)break;h=c,l=d,d=c,m=p,p=u,b=g,g=w}o=c.neg(),a=u;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},h.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),h=n.mul(r.b),c=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:h.add(c).neg()}},h.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(e&&!s||!e&&s)&&(i=i.redNeg()),this.point(t,i)},h.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},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),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},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(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new n(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 i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,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,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}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)},s(u,o.BasePoint),h.prototype.jpoint=function(t,e,r){return new u(this,t,e,r)},u.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),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=i.redMul(c),d=h.redSqr().redIAdd(u).redISub(f).redISub(f),l=h.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},u.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),c=h.redMul(o),u=r.redMul(h),f=a.redSqr().redIAdd(c).redISub(u).redISub(u),d=a.redMul(u.redISub(f)).redISub(n.redMul(c)),l=this.z.redMul(o);return this.curve.jpoint(f,d,l)},u.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=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},480:(t,e,r)=>{var i,n=e,s=r(7952),o=r(894),a=r(7011).assert;function h(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.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(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,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:s.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:s.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:s.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:s.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:s.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:s.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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(4011)}catch(t){i=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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},7447:(t,e,r)=>{var i=r(9404),n=r(2723),s=r(7011),o=r(480),a=r(5037),h=s.assert,c=r(1200),u=r(8545);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(h(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.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=f,f.prototype.keyPair=function(t){return new c(this,t)},f.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({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(),s=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.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},f.prototype.sign=function(t,e,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),h=t.toArray("be",o),c=new n({hash:this.hash,entropy:a,nonce:h,pers:s.pers,persEnc:s.persEnc||"utf8"}),f=this.n.sub(new i(1)),d=0;;d++){var l=s.k?s.k(d):new i(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(f)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var g=p.getX(),m=g.umod(this.n);if(0!==m.cmpn(0)){var b=l.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==g.cmp(m)?2:0);return s.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new u({r:m,s:b,recoveryParam:y})}}}}}},f.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var s=(e=new u(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,h=o.invm(this.n),c=h.mul(t).umod(this.n),f=h.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},f.prototype.recoverPubKey=function(t,e,r,n){h((3&r)===r,"The recovery param is more than two bits"),e=new u(e,n);var s=this.n,o=new i(t),a=e.r,c=e.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var l=e.r.invm(s),p=s.sub(o).mul(l).umod(s),g=c.mul(l).umod(s);return this.g.mulAdd(p,a,g)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new u(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},1200:(t,e,r)=>{var i=r(9404),n=r(7011).assert;function s(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=s,s.fromPublic=function(t,e,r){return e instanceof s?e:new s(t,{pub:e,pubEnc:r})},s.fromPrivate=function(t,e,r){return e instanceof s?e:new s(t,{priv:e,privEnc:r})},s.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"}},s.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},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(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)},s.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},s.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},s.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},s.prototype.inspect=function(){return""}},8545:(t,e,r)=>{var i=r(9404),n=r(7011),s=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===t[e.place])return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var s=h(t,r);if(!1===s)return!1;if(s+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=h(t,r);if(!1===o)return!1;if(128&t[r.place])return!1;var c=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=h(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;if(128&t[r.place])return!1;var f=t.slice(r.place,u+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new i(c),this.s=new i(f),this.recoveryParam=null,!0},o.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 i=[2];u(i,e.length),(i=i.concat(e)).push(2),u(i,r.length);var s=i.concat(r),o=[48];return u(o,s.length),o=o.concat(s),n.encode(o,t)}},8650:(t,e,r)=>{var i=r(7952),n=r(480),s=r(7011),o=s.assert,a=s.parseBytes,h=r(6661),c=r(220);function u(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof u))return new u(t);t=n[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=i.sha512}t.exports=u,u.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),h=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:s})},u.prototype.verify=function(t,e,r){if(t=a(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(s)},u.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{var i=r(7011),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(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},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return n(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 n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},220:(t,e,r)=>{var i=r(9404),n=r(7011),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function h(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(s(e.length===2*t.encodingLength,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(h,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(h,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(h,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(h,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h},4011: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"]]}}},7011:(t,e,r)=>{var i=e,n=r(9404),s=r(3349),o=r(4367);i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(t,e,r){var i,n=new Array(Math.max(t.bitLength(),r)+1);for(i=0;i(s>>1)-1?(s>>1)-h:h,o.isubn(a)):a=0,n[i]=a,o.iushrn(1)}return n},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,h=t.andln(3)+n&3,c=e.andln(3)+s&3;3===h&&(h=-1),3===c&&(c=-1),o=1&h?3!=(i=t.andln(7)+n&7)&&5!==i||2!==c?h:-h:0,r[0].push(o),a=1&c?3!=(i=e.andln(7)+s&7)&&5!==i||2!==h?c:-c:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},7007:t=>{var e,r="object"==typeof Reflect?Reflect:null,i=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 n=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}g(t,e,s,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,n)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function c(t,e,r,i){var n,s,o,c;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=h(t))>0&&o.length>n&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,c=u,console&&console.warn&&console.warn(c)}return t}function u(){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 f(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=u.bind(i);return n.listener=r,i.wrapFn=n,n}function d(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var c=h.length,u=p(h,c);for(r=0;r=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):l.call(t,e)},s.prototype.listenerCount=l,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},3055:t=>{t.exports=function(t,e){for(var r={},i=Object.keys(t),n=Array.isArray(e),s=0;s{var i=e;i.utils=r(7426),i.common=r(6166),i.sha=r(6229),i.ripemd=r(6784),i.hmac=r(8948),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},6166:(t,e,r)=>{var i=r(7426),n=r(3349);function s(){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=s,s.prototype.update=function(t,e){if(t=i.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=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s{var i=r(7426),n=r(3349);function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e{var i=r(7426),n=r(6166),s=i.rotl32,o=i.sum32,a=i.sum32_3,h=i.sum32_4,c=n.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(u,c),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],c=this.h[3],u=this.h[4],y=r,v=i,w=n,_=c,M=u,E=0;E<80;E++){var S=o(s(h(r,f(E,i,n,c),t[p[E]+e],d(E)),m[E]),u);r=u,u=c,c=s(n,10),n=i,i=S,S=o(s(h(y,f(79-E,v,w,_),t[g[E]+e],l(E)),b[E]),M),y=M,M=_,_=s(w,10),w=v,v=S}S=a(this.h[1],n,_),this.h[1]=a(this.h[2],c,M),this.h[2]=a(this.h[3],u,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],i,w),this.h[0]=S},u.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.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],g=[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],m=[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],b=[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]},6229:(t,e,r)=>{e.sha1=r(3917),e.sha224=r(7714),e.sha256=r(2287),e.sha384=r(1911),e.sha512=r(7766)},3917:(t,e,r)=>{var i=r(7426),n=r(6166),s=r(6225),o=i.rotl32,a=i.sum32,h=i.sum32_5,c=s.ft_1,u=n.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(d,u),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{var i=r(7426),n=r(2287);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},2287:(t,e,r)=>{var i=r(7426),n=r(6166),s=r(6225),o=r(3349),a=i.sum32,h=i.sum32_4,c=i.sum32_5,u=s.ch32,f=s.maj32,d=s.s0_256,l=s.s1_256,p=s.g0_256,g=s.g1_256,m=n.BlockHash,b=[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 y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}i.inherits(y,m),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{var i=r(7426),n=r(7766);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},7766:(t,e,r)=>{var i=r(7426),n=r(6166),s=r(3349),o=i.rotr64_hi,a=i.rotr64_lo,h=i.shr64_hi,c=i.shr64_lo,u=i.sum64,f=i.sum64_hi,d=i.sum64_lo,l=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,m=i.sum64_5_lo,b=n.BlockHash,y=[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;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function _(t,e,r,i,n,s){var o=e&i^~e&s;return o<0&&(o+=4294967296),o}function M(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function E(t,e,r,i,n,s){var o=e&i^e&s^i&s;return o<0&&(o+=4294967296),o}function S(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=o(t,e,1)^o(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,1)^a(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,19)^a(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(v,b),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,i=0;i<32;i++)r[i]=t[e+i];for(;i{var i=r(7426).rotr32;function n(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?s(e,r,i):void 0},e.ch32=n,e.maj32=s,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},7426:(t,e,r)=>{var i=r(3349),n=r(6698);function s(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(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 h(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=n,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),n=0;n>6|192,r[i++]=63&o|128):s(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return 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,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s>>0,t[e+1]=s},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,s,o,a){var h=0,c=e;return h+=(c=c+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,s,o,a,h,c){var u=0,f=e;return u+=(f=f+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,s,o,a,h,c){return e+i+s+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}},2723:(t,e,r)=>{var i=r(7952),n=r(4367),s=r(3349);function o(t){if(!(this instanceof o))return new o(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=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=o,o.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,h=(1<>1,u=-7,f=r?n-1:0,d=r?-1:1,l=t[e+f];for(f+=d,s=l&(1<<-u)-1,l>>=-u,u+=a;u>0;s=256*s+t[e+f],f+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+t[e+f],f+=d,u-=8);if(0===s)s=1-c;else{if(s===h)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,i),s-=c}return(l?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,h,c=8*s-n-1,u=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:s-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),(e+=o+f>=1?d/h:d*Math.pow(2,1-f))*h>=2&&(o++,h/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*h-1)*Math.pow(2,n),o+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[r+l]=255&a,l+=p,a/=256,n-=8);for(o=o<0;t[r+l]=255&o,l+=p,o/=256,c-=8);t[r+l-p]|=128*g}},6698: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}}},1176:(t,e,r)=>{var i;!function(){var n="input is invalid type",s="object"==typeof window,o=s?window:{};o.JS_SHA3_NO_WINDOW&&(s=!1);var a=!s&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=r.g:a&&(o=self);var h=!o.JS_SHA3_NO_COMMON_JS&&t.exports,c=r.amdO,u=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],l=[0,8,16,24],p=[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"],y={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!u||!o.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 v=function(t,e,r){return function(i){return new L(t,e,t).update(i)[r]()}},w=function(t,e,r){return function(i,n){return new L(t,e,n).update(i)[r]()}},_=function(t,e,r){return function(e,i,n,s){return A["cshake"+t].update(e,i,n,s)[r]()}},M=function(t,e,r){return function(e,i,n,s){return A["kmac"+t].update(e,i,n,s)[r]()}},E=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function C(t,e,r){L.call(this,t,e,r)}L.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(n);if(null===t)throw new Error(n);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(n);e=!0}for(var i,s,o=this.blocks,a=this.byteCount,h=t.length,c=this.blockCount,f=0,d=this.s;f>2]|=t[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(o[i>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=a){for(this.start=i-a,this.block=o[c],i=0;i>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},L.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(n);if(null===t)throw new Error(n);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(n);e=!0}var i=0,s=t.length;if(e)i=s;else for(var o=0;o=57344?i+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},L.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>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];o%e==0&&(q(r),s=0)}return n&&(t=r[s],a+=f[t>>4&15]+f[15&t],n>1&&(a+=f[t>>12&15]+f[t>>8&15]),n>2&&(a+=f[t>>20&15]+f[t>>16&15])),a},L.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var h=new Uint32Array(t);o>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;a%r==0&&q(i)}return s&&(t=a<<2,e=i[o],h[t]=255&e,s>1&&(h[t+1]=e>>8&255),s>2&&(h[t+2]=e>>16&255)),h},C.prototype=new L,C.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var q=function(t){var e,r,i,n,s,o,a,h,c,u,f,d,l,g,m,b,y,v,w,_,M,E,S,I,A,x,O,R,P,N,T,k,L,C,q,U,j,z,D,B,$,K,F,V,H,W,G,J,Z,Y,X,Q,tt,et,rt,it,nt,st,ot,at,ht,ct,ut;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(o<<1|a>>>31),r=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|o>>>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=n^(h<<1|c>>>31),r=s^(c<<1|h>>>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=o^(u<<1|f>>>31),r=a^(f<<1|u>>>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=h^(d<<1|l>>>31),r=c^(l<<1|d>>>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=u^(n<<1|s>>>31),r=f^(s<<1|n>>>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,g=t[0],m=t[1],W=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,R=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,K=t[40]<<18|t[41]>>>14,F=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,q=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,N=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,ut=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Y=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,A=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,z=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,H=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,st=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,B=t[38]<<8|t[39]>>>24,$=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=g^~b&v,t[1]=m^~y&w,t[10]=I^~x&R,t[11]=A^~O&P,t[20]=C^~U&z,t[21]=q^~j&D,t[30]=V^~W&J,t[31]=H^~G&Z,t[40]=et^~it&st,t[41]=rt^~nt&ot,t[2]=b^~v&_,t[3]=y^~w&M,t[12]=x^~R&N,t[13]=O^~P&T,t[22]=U^~z&B,t[23]=j^~D&$,t[32]=W^~J&Y,t[33]=G^~Z&X,t[42]=it^~st&at,t[43]=nt^~ot&ht,t[4]=v^~_&E,t[5]=w^~M&S,t[14]=R^~N&k,t[15]=P^~T&L,t[24]=z^~B&K,t[25]=D^~$&F,t[34]=J^~Y&Q,t[35]=Z^~X&tt,t[44]=st^~at&ct,t[45]=ot^~ht&ut,t[6]=_^~E&g,t[7]=M^~S&m,t[16]=N^~k&I,t[17]=T^~L&A,t[26]=B^~K&C,t[27]=$^~F&q,t[36]=Y^~Q&V,t[37]=X^~tt&H,t[46]=at^~ct&et,t[47]=ht^~ut&rt,t[8]=E^~g&b,t[9]=S^~m&y,t[18]=k^~I&x,t[19]=L^~A&O,t[28]=K^~C&U,t[29]=F^~q&j,t[38]=Q^~V&W,t[39]=tt^~H&G,t[48]=ct^~et&it,t[49]=ut^~rt&nt,t[0]^=p[i],t[1]^=p[i+1]};if(h)t.exports=A;else{for(O=0;O{t=r.nmd(t);var i="__lodash_hash_undefined__",n=9007199254740991,s="[object Arguments]",o="[object Array]",a="[object Boolean]",h="[object Date]",c="[object Error]",u="[object Function]",f="[object Map]",d="[object Number]",l="[object Object]",p="[object Promise]",g="[object RegExp]",m="[object Set]",b="[object String]",y="[object WeakMap]",v="[object ArrayBuffer]",w="[object DataView]",_=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,E={};E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E[s]=E[o]=E[v]=E[a]=E[w]=E[h]=E[c]=E[u]=E[f]=E[d]=E[l]=E[g]=E[m]=E[b]=E[y]=!1;var S="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,A=S||I||Function("return this")(),x=e&&!e.nodeType&&e,O=x&&t&&!t.nodeType&&t,R=O&&O.exports===x,P=R&&S.process,N=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),T=N&&N.isTypedArray;function k(t,e){for(var r=-1,i=null==t?0:t.length;++ra))return!1;var c=s.get(t);if(c&&s.get(e))return c==e;var u=-1,f=!0,d=2&r?new wt:void 0;for(s.set(t,e),s.set(e,t);++u-1},yt.prototype.set=function(t,e){var r=this.__data__,i=Mt(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},vt.prototype.clear=function(){this.size=0,this.__data__={hash:new bt,map:new(st||yt),string:new bt}},vt.prototype.delete=function(t){var e=Ot(this,t).delete(t);return this.size-=e?1:0,e},vt.prototype.get=function(t){return Ot(this,t).get(t)},vt.prototype.has=function(t){return Ot(this,t).has(t)},vt.prototype.set=function(t,e){var r=Ot(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},wt.prototype.add=wt.prototype.push=function(t){return this.__data__.set(t,i),this},wt.prototype.has=function(t){return this.__data__.has(t)},_t.prototype.clear=function(){this.__data__=new yt,this.size=0},_t.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},_t.prototype.get=function(t){return this.__data__.get(t)},_t.prototype.has=function(t){return this.__data__.has(t)},_t.prototype.set=function(t,e){var r=this.__data__;if(r instanceof yt){var i=r.__data__;if(!st||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new vt(i)}return r.set(t,e),this.size=r.size,this};var Pt=et?function(t){return null==t?[]:(t=Object(t),function(e){for(var r=-1,i=null==e?0:e.length,n=0,s=[];++r-1&&t%1==0&&t-1&&t%1==0&&t<=n}function Dt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Bt(t){return null!=t&&"object"==typeof t}var $t=T?function(t){return function(e){return t(e)}}(T):function(t){return Bt(t)&&zt(t.length)&&!!E[Et(t)]};function Kt(t){return null!=(e=t)&&zt(e.length)&&!jt(e)?function(t,e){var r=qt(t),i=!r&&Ct(t),n=!r&&!i&&Ut(t),s=!r&&!i&&!n&&$t(t),o=r||i||n||s,a=o?function(t,e){for(var r=-1,i=Array(t);++r{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)}},4367:(t,e)=>{var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},6663:(t,e,r)=>{const i=r(4280),n=r(454),s=r(528),o=r(3055),a=Symbol("encodeFragmentIdentifier");function h(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(t,e){return e.encode?e.strict?i(t):encodeURIComponent(t):t}function u(t,e){return e.decode?n(t):t}function f(t){return Array.isArray(t)?t.sort():"object"==typeof t?f(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function d(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function l(t){const e=(t=d(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function p(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function g(t,e){h((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=r):i[t]=r};case"bracket":return(t,r,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],r):i[t]=[r]:i[t]=r};case"colon-list-separator":return(t,r,i)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],r):i[t]=[r]:i[t]=r};case"comma":case"separator":return(e,r,i)=>{const n="string"==typeof r&&r.includes(t.arrayFormatSeparator),s="string"==typeof r&&!n&&u(r,t).includes(t.arrayFormatSeparator);r=s?u(r,t):r;const o=n||s?r.split(t.arrayFormatSeparator).map((e=>u(e,t))):null===r?r:u(r,t);i[e]=o};case"bracket-separator":return(e,r,i)=>{const n=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!n)return void(i[e]=r?u(r,t):r);const s=null===r?[]:r.split(t.arrayFormatSeparator).map((e=>u(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],s):i[e]=s};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),i=Object.create(null);if("string"!=typeof t)return i;if(!(t=t.trim().replace(/^[?#&]/,"")))return i;for(const n of t.split("&")){if(""===n)continue;let[t,o]=s(e.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?o:u(o,e),r(u(t,e),o,i)}for(const t of Object.keys(i)){const r=i[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=p(r[t],e);else i[t]=p(r,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{const r=i[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=f(r):t[e]=r,t}),Object.create(null))}e.extract=l,e.parse=g,e.stringify=(t,e)=>{if(!t)return"";h((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],i=function(t){switch(t.arrayFormat){case"index":return e=>(r,i)=>{const n=r.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[c(e,t),"[",n,"]"].join("")]:[...r,[c(e,t),"[",c(n,t),"]=",c(i,t)].join("")]};case"bracket":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[c(e,t),"[]"].join("")]:[...r,[c(e,t),"[]=",c(i,t)].join("")];case"colon-list-separator":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[c(e,t),":list="].join("")]:[...r,[c(e,t),":list=",c(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return r=>(i,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?i:(n=null===n?"":n,0===i.length?[[c(r,t),e,c(n,t)].join("")]:[[i,c(n,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,c(e,t)]:[...r,[c(e,t),"=",c(i,t)].join("")]}}(e),n={};for(const e of Object.keys(t))r(e)||(n[e]=t[e]);const s=Object.keys(n);return!1!==e.sort&&s.sort(e.sort),s.map((r=>{const n=t[r];return void 0===n?"":null===n?c(r,e):Array.isArray(n)?0===n.length&&"bracket-separator"===e.arrayFormat?c(r,e)+"[]":n.reduce(i(r),[]).join("&"):c(r,e)+"="+c(n,e)})).filter((t=>t.length>0)).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,i]=s(t,"#");return Object.assign({url:r.split("?")[0]||"",query:g(l(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:u(i,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const i=d(t.url).split("?")[0]||"",n=e.extract(t.url),s=e.parse(n,{sort:!1}),o=Object.assign(s,t.query);let h=e.stringify(o,r);h&&(h=`?${h}`);let u=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(u=`#${r[a]?c(t.fragmentIdentifier,r):t.fragmentIdentifier}`),`${i}${h}${u}`},e.pick=(t,r,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[a]:!1},i);const{url:n,query:s,fragmentIdentifier:h}=e.parseUrl(t,i);return e.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:h},i)},e.exclude=(t,r,i)=>{const n=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,n,i)}},793:t=>{function e(t){try{return JSON.stringify(t)}catch(t){return'"[Circular]"'}}t.exports=function(t,r,i){var n=i&&i.stringify||e;if("object"==typeof t&&null!==t){var s=r.length+1;if(1===s)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?f:0,t.charCodeAt(l+1)){case 100:case 102:if(u>=h)break;if(null==r[u])break;f=h)break;if(null==r[u])break;f=h)break;if(void 0===r[u])break;f",f=l+2,l++;break}c+=n(r[u]),f=l+2,l++;break;case 115:if(u>=h)break;f{t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},4280:t=>{t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))},5215:(t,e,r)=>{r.r(e),r.d(e,{__assign:()=>s,__asyncDelegator:()=>w,__asyncGenerator:()=>v,__asyncValues:()=>_,__await:()=>y,__awaiter:()=>u,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>A,__createBinding:()=>d,__decorate:()=>a,__exportStar:()=>l,__extends:()=>n,__generator:()=>f,__importDefault:()=>S,__importStar:()=>E,__makeTemplateObject:()=>M,__metadata:()=>c,__param:()=>h,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>b,__values:()=>p});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return s=Object.assign||function(t){for(var e,r=1,i=arguments.length;r=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,r,o):n(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o}function h(t,e){return function(r,i){e(r,i,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{h(i.next(t))}catch(t){s(t)}}function a(t){try{h(i.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))}function f(t,e){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function m(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(r=n[t](e)).value instanceof y?Promise.resolve(r.value.v).then(h,c):u(s[0][2],r)}catch(t){u(s[0][3],t)}var r}function h(t){a("next",t)}function c(t){a("throw",t)}function u(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(t){var e,r;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:y(t[i](e)),done:"return"===i}:n?n(e):e}:n}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise((function(i,n){!function(t,e,r,i){Promise.resolve(i).then((function(e){t({value:e,done:r})}),e)}(i,n,(e=t[r](e)).done,e.value)}))}}}function M(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}function I(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function A(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},1848:()=>{},8954:()=>{},9432:()=>{},7790:()=>{},3776:()=>{},4874:(t,e,r)=>{const i=r(793);t.exports=o;const n=function(){function t(t){return void 0!==t&&t}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(e){return t(self)||t(window)||t(this)||{}}}().console||{},s={mapHttpRequest:d,mapHttpResponse:d,wrapRequestSerializer:l,wrapResponseSerializer:l,wrapErrorSerializer:l,req:d,res:d,err:function(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)void 0===e[r]&&(e[r]=t[r]);return e}};function o(t){(t=t||{}).browser=t.browser||{};const e=t.browser.transmit;if(e&&"function"!=typeof e.send)throw Error("pino: transmit option must have a send function");const r=t.browser.write||n;t.browser.write&&(t.browser.asObject=!0);const i=t.serializers||{},s=function(t,e){if(Array.isArray(t)){const e=t.filter((function(t){return"!stdSerializers.err"!==t}));return e}return!0===t&&Object.keys(e)}(t.browser.serialize,i);let d=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(d=!1),"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===t.enabled&&(t.level="silent");const l=t.level||"info",g=Object.create(r);g.log||(g.log=p),Object.defineProperty(g,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(g,"level",{get:function(){return this._level},set:function(t){if("silent"!==t&&!this.levels.values[t])throw Error("unknown level "+t);this._level=t,a(m,g,"error","log"),a(m,g,"fatal","error"),a(m,g,"warn","error"),a(m,g,"info","log"),a(m,g,"debug","log"),a(m,g,"trace","log")}});const m={transmit:e,serialize:s,asObject:t.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:f(t)};return g.levels=o.levels,g.level=l,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=p,g.serializers=i,g._serialize=s,g._stdErrSerialize=d,g.child=function(r,n){if(!r)throw new Error("missing bindings for child Pino");n=n||{},s&&r.serializers&&(n.serializers=r.serializers);const o=n.serializers;if(s&&o){var a=Object.assign({},i,o),f=!0===t.browser.serialize?Object.keys(a):s;delete r.serializers,h([r],f,a,this._stdErrSerialize)}function d(t){this._childLevel=1+(0|t._childLevel),this.error=c(t,r,"error"),this.fatal=c(t,r,"fatal"),this.warn=c(t,r,"warn"),this.info=c(t,r,"info"),this.debug=c(t,r,"debug"),this.trace=c(t,r,"trace"),a&&(this.serializers=a,this._serialize=f),e&&(this._logEvent=u([].concat(t._logEvent.bindings,r)))}return d.prototype=this,new d(this)},e&&(g._logEvent=u()),g}function a(t,e,r,s){const a=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?p:a[r]?a[r]:n[r]||n[s]||p,function(t,e,r){var s;(t.transmit||e[r]!==p)&&(e[r]=(s=e[r],function(){const a=t.timestamp(),c=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var d=0;d-1&&i in r&&(t[n][i]=r[i](t[n][i]))}function c(t,e,r){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n{t.exports={rE:"6.5.7"}}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};r.r(i),r.d(i,{identity:()=>re});var n={};r.r(n),r.d(n,{base2:()=>ie});var s={};r.r(s),r.d(s,{base8:()=>ne});var o={};r.r(o),r.d(o,{base10:()=>se});var a={};r.r(a),r.d(a,{base16:()=>oe,base16upper:()=>ae});var h={};r.r(h),r.d(h,{base32:()=>he,base32hex:()=>de,base32hexpad:()=>pe,base32hexpadupper:()=>ge,base32hexupper:()=>le,base32pad:()=>ue,base32padupper:()=>fe,base32upper:()=>ce,base32z:()=>me});var c={};r.r(c),r.d(c,{base36:()=>be,base36upper:()=>ye});var u={};r.r(u),r.d(u,{base58btc:()=>ve,base58flickr:()=>we});var f={};r.r(f),r.d(f,{base64:()=>_e,base64pad:()=>Me,base64url:()=>Ee,base64urlpad:()=>Se});var d={};r.r(d),r.d(d,{base256emoji:()=>Oe});var l={};r.r(l),r.d(l,{sha256:()=>Ze,sha512:()=>Ye});var p={};r.r(p),r.d(p,{identity:()=>Qe});var g={};r.r(g),r.d(g,{code:()=>er,decode:()=>ir,encode:()=>rr,name:()=>tr});var m={};r.r(m),r.d(m,{code:()=>ar,decode:()=>cr,encode:()=>hr,name:()=>or});var b=r(7007),y=r.n(b),v=r(8900);class w{}class _ extends w{constructor(t){super()}}const M=v.FIVE_SECONDS,E="heartbeat_pulse";class S extends _{constructor(t){super(t),this.events=new b.EventEmitter,this.interval=M,this.interval=t?.interval||M}static async init(t){const e=new S(t);return await e.init(),e}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async initialize(){this.intervalRef=setInterval((()=>this.pulse()),(0,v.toMiliseconds)(this.interval))}pulse(){this.events.emit(E)}}const I=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,A=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,x=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function O(t,e){if(!("__proto__"===t||"constructor"===t&&e&&"object"==typeof e&&"prototype"in e))return e;!function(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}(t)}function R(t,e={}){if("string"!=typeof t)return t;const r=t.trim();if('"'===t[0]&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const t=r.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;if("undefined"===t)return;if("null"===t)return null;if("nan"===t)return Number.NaN;if("infinity"===t)return Number.POSITIVE_INFINITY;if("-infinity"===t)return Number.NEGATIVE_INFINITY}if(!x.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(I.test(t)||A.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,O)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}var P=r(8287).hp;function N(t,...e){try{return(r=t(...e))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(t){return Promise.reject(t)}var r}function T(t){if(function(t){const e=typeof t;return null===t||"object"!==e&&"function"!==e}(t))return String(t);if(function(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}(t)||Array.isArray(t))return JSON.stringify(t);if("function"==typeof t.toJSON)return T(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function k(){if(void 0===P)throw new TypeError("[unstorage] Buffer is not supported!")}const L="base64:";function C(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function q(...t){return C(t.join(":"))}function U(t){return(t=C(t))?t+":":""}const j=()=>{const t=new Map;return{name:"memory",getInstance:()=>t,hasItem:e=>t.has(e),getItem:e=>t.get(e)??null,getItemRaw:e=>t.get(e)??null,setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys:()=>[...t.keys()],clear(){t.clear()},dispose(){t.clear()}}};function z(t,e,r){return t.watch?t.watch(((t,i)=>e(t,r+i))):()=>{}}async function D(t){"function"==typeof t.dispose&&await N(t.dispose)}function B(t){return new Promise(((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)}))}function $(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const i=B(r);return(t,r)=>i.then((i=>r(i.transaction(e,t).objectStore(e))))}let K;function F(){return K||(K=$("keyval-store","keyval")),K}function V(t,e=F()){return e("readonly",(e=>B(e.get(t))))}function H(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return(t=>{const e=t.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(e,((t,e)=>"string"==typeof e&&e.match(/^\d+n$/)?BigInt(e.substring(0,e.length-1)):e))})(t)}catch(e){return t}}function W(t){return"string"==typeof t?t:(e=t,JSON.stringify(e,((t,e)=>"bigint"==typeof e?e.toString()+"n":e))||"");var e}var G=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=t=>e+t;let i;return t.dbName&&t.storeName&&(i=$(t.dbName,t.storeName)),{name:"idb-keyval",options:t,hasItem:async t=>!(typeof await V(r(t),i)>"u"),getItem:async t=>await V(r(t),i)??null,setItem:(t,e)=>function(t,e,r=F()){return r("readwrite",(r=>(r.put(e,t),B(r.transaction))))}(r(t),e,i),removeItem:t=>function(t,e=F()){return e("readwrite",(e=>(e.delete(t),B(e.transaction))))}(r(t),i),getKeys:()=>function(t=F()){return t("readonly",(t=>{if(t.getAllKeys)return B(t.getAllKeys());const e=[];return function(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},B(t.transaction)}(t,(t=>e.push(t.key))).then((()=>e))}))}(i),clear:()=>function(t=F()){return t("readwrite",(t=>(t.clear(),B(t.transaction))))}(i)}};class J{constructor(){this.indexedDb=function(t={}){const e={mounts:{"":t.driver||j()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=t=>{for(const r of e.mountpoints)if(t.startsWith(r))return{base:r,relativeKey:t.slice(r.length),driver:e.mounts[r]};return{base:"",relativeKey:t,driver:e.mounts[""]}},i=(t,r)=>e.mountpoints.filter((e=>e.startsWith(t)||r&&t.startsWith(e))).map((r=>({relativeBase:t.length>r.length?t.slice(r.length):void 0,mountpoint:r,driver:e.mounts[r]}))),n=(t,r)=>{if(e.watching){r=C(r);for(const i of e.watchListeners)i(t,r)}},s=async()=>{if(e.watching){for(const t in e.unwatch)await e.unwatch[t]();e.unwatch={},e.watching=!1}},o=(t,e,i)=>{const n=new Map,s=t=>{let e=n.get(t.base);return e||(e={driver:t.driver,base:t.base,items:[]},n.set(t.base,e)),e};for(const i of t){const t="string"==typeof i,n=C(t?i:i.key),o=t?void 0:i.value,a=t||!i.options?e:{...e,...i.options},h=r(n);s(h).items.push({key:n,value:o,relativeKey:h.relativeKey,options:a})}return Promise.all([...n.values()].map((t=>i(t)))).then((t=>t.flat()))},a={hasItem(t,e={}){t=C(t);const{relativeKey:i,driver:n}=r(t);return N(n.hasItem,i,e)},getItem(t,e={}){t=C(t);const{relativeKey:i,driver:n}=r(t);return N(n.getItem,i,e).then((t=>R(t)))},getItems:(t,e)=>o(t,e,(t=>t.driver.getItems?N(t.driver.getItems,t.items.map((t=>({key:t.relativeKey,options:t.options}))),e).then((e=>e.map((e=>({key:q(t.base,e.key),value:R(e.value)}))))):Promise.all(t.items.map((e=>N(t.driver.getItem,e.relativeKey,e.options).then((t=>({key:e.key,value:R(t)})))))))),getItemRaw(t,e={}){t=C(t);const{relativeKey:i,driver:n}=r(t);return n.getItemRaw?N(n.getItemRaw,i,e):N(n.getItem,i,e).then((t=>function(t){return"string"!=typeof t?t:t.startsWith(L)?(k(),P.from(t.slice(7),"base64")):t}(t)))},async setItem(t,e,i={}){if(void 0===e)return a.removeItem(t);t=C(t);const{relativeKey:s,driver:o}=r(t);o.setItem&&(await N(o.setItem,s,T(e),i),o.watch||n("update",t))},async setItems(t,e){await o(t,e,(async t=>{if(t.driver.setItems)return N(t.driver.setItems,t.items.map((t=>({key:t.relativeKey,value:T(t.value),options:t.options}))),e);t.driver.setItem&&await Promise.all(t.items.map((e=>N(t.driver.setItem,e.relativeKey,T(e.value),e.options))))}))},async setItemRaw(t,e,i={}){if(void 0===e)return a.removeItem(t,i);t=C(t);const{relativeKey:s,driver:o}=r(t);if(o.setItemRaw)await N(o.setItemRaw,s,e,i);else{if(!o.setItem)return;await N(o.setItem,s,function(t){if("string"==typeof t)return t;k();const e=P.from(t).toString("base64");return L+e}(e),i)}o.watch||n("update",t)},async removeItem(t,e={}){"boolean"==typeof e&&(e={removeMeta:e}),t=C(t);const{relativeKey:i,driver:s}=r(t);s.removeItem&&(await N(s.removeItem,i,e),(e.removeMeta||e.removeMata)&&await N(s.removeItem,i+"$",e),s.watch||n("remove",t))},async getMeta(t,e={}){"boolean"==typeof e&&(e={nativeOnly:e}),t=C(t);const{relativeKey:i,driver:n}=r(t),s=Object.create(null);if(n.getMeta&&Object.assign(s,await N(n.getMeta,i,e)),!e.nativeOnly){const t=await N(n.getItem,i+"$",e).then((t=>R(t)));t&&"object"==typeof t&&("string"==typeof t.atime&&(t.atime=new Date(t.atime)),"string"==typeof t.mtime&&(t.mtime=new Date(t.mtime)),Object.assign(s,t))}return s},setMeta(t,e,r={}){return this.setItem(t+"$",e,r)},removeMeta(t,e={}){return this.removeItem(t+"$",e)},async getKeys(t,e={}){t=U(t);const r=i(t,!0);let n=[];const s=[];for(const t of r){const r=await N(t.driver.getKeys,t.relativeBase,e);for(const e of r){const r=t.mountpoint+C(e);n.some((t=>r.startsWith(t)))||s.push(r)}n=[t.mountpoint,...n.filter((e=>!e.startsWith(t.mountpoint)))]}return t?s.filter((e=>e.startsWith(t)&&"$"!==e[e.length-1])):s.filter((t=>"$"!==t[t.length-1]))},async clear(t,e={}){t=U(t),await Promise.all(i(t,!1).map((async t=>{if(t.driver.clear)return N(t.driver.clear,t.relativeBase,e);if(t.driver.removeItem){const r=await t.driver.getKeys(t.relativeBase||"",e);return Promise.all(r.map((r=>t.driver.removeItem(r,e))))}})))},async dispose(){await Promise.all(Object.values(e.mounts).map((t=>D(t))))},watch:async t=>(await(async()=>{if(!e.watching){e.watching=!0;for(const t in e.mounts)e.unwatch[t]=await z(e.mounts[t],n,t)}})(),e.watchListeners.push(t),async()=>{e.watchListeners=e.watchListeners.filter((e=>e!==t)),0===e.watchListeners.length&&await s()}),async unwatch(){e.watchListeners=[],await s()},mount(t,r){if((t=U(t))&&e.mounts[t])throw new Error(`already mounted at ${t}`);return t&&(e.mountpoints.push(t),e.mountpoints.sort(((t,e)=>e.length-t.length))),e.mounts[t]=r,e.watching&&Promise.resolve(z(r,n,t)).then((r=>{e.unwatch[t]=r})).catch(console.error),a},async unmount(t,r=!0){(t=U(t))&&e.mounts[t]&&(e.watching&&t in e.unwatch&&(e.unwatch[t](),delete e.unwatch[t]),r&&await D(e.mounts[t]),e.mountpoints=e.mountpoints.filter((e=>e!==t)),delete e.mounts[t])},getMount(t=""){t=C(t)+":";const e=r(t);return{driver:e.driver,base:e.base}},getMounts:(t="",e={})=>(t=C(t),i(t,e.parents).map((t=>({driver:t.driver,base:t.mountpoint})))),keys:(t,e={})=>a.getKeys(t,e),get:(t,e={})=>a.getItem(t,e),set:(t,e,r={})=>a.setItem(t,e,r),has:(t,e={})=>a.hasItem(t,e),del:(t,e={})=>a.removeItem(t,e),remove:(t,e={})=>a.removeItem(t,e)};return a}({driver:G({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((t=>[t.key,t.value]))}async getItem(t){const e=await this.indexedDb.getItem(t);if(null!==e)return e}async setItem(t,e){await this.indexedDb.setItem(t,W(e))}async removeItem(t){await this.indexedDb.removeItem(t)}}var Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{},Y={exports:{}};function X(t){var e;return[t[0],H(null!=(e=t[1])?e:"")]}!function(){let t;function e(){}t=e,t.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},t.prototype.setItem=function(t,e){this[t]=String(e)},t.prototype.removeItem=function(t){delete this[t]},t.prototype.clear=function(){const t=this;Object.keys(t).forEach((function(e){t[e]=void 0,delete t[e]}))},t.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),typeof Z<"u"&&Z.localStorage?Y.exports=Z.localStorage:typeof window<"u"&&window.localStorage?Y.exports=window.localStorage:Y.exports=new e}();class Q{constructor(){this.localStorage=Y.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(X)}async getItem(t){const e=this.localStorage.getItem(t);if(null!==e)return H(e)}async setItem(t,e){this.localStorage.setItem(t,W(e))}async removeItem(t){this.localStorage.removeItem(t)}}class tt{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const t=new Q;this.storage=t;try{(async(t,e,r)=>{const i="wc_storage_version",n=await e.getItem(i);if(n&&n>=1)return void r(e);const s=await t.getKeys();if(!s.length)return void r(e);const o=[];for(;s.length;){const r=s.shift();if(!r)continue;const i=r.toLowerCase();if(i.includes("wc@")||i.includes("walletconnect")||i.includes("wc_")||i.includes("wallet_connect")){const i=await t.getItem(r);await e.setItem(r,i),o.push(r)}}await e.setItem(i,1),r(e),(async(t,e)=>{e.length&&e.forEach((async e=>{await t.removeItem(e)}))})(t,o)})(t,new J,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,e){return await this.initialize(),this.storage.setItem(t,e)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise((t=>{const e=setInterval((()=>{this.initialized&&(clearInterval(e),t())}),20)}))}}var et=r(4874),rt=r.n(et);const it="custom_context";class nt{constructor(t){this.nodeValue=t,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class st{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const e=new nt(t);if(e.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${e.size}`);for(;this.size+e.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=e),this.tail=e):(this.head=e,this.tail=e),this.lengthInNodes++,this.sizeInBytes+=e.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let e=this.head;for(;null!==e;)t.push(e.value),e=e.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const e=t.value;return t=t.next,{done:!1,value:e}}}}}class ot{constructor(t,e=1024e3){this.level=t??"error",this.levelValue=et.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=e,this.logs=new st(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,e){e===et.levels.values.error?console.error(t):e===et.levels.values.warn?console.warn(t):e===et.levels.values.debug?console.debug(t):e===et.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(W({timestamp:(new Date).toISOString(),log:t}));const e="string"==typeof t?JSON.parse(t).level:t.level;e>=this.levelValue&&this.forwardToConsole(t,e)}getLogs(){return this.logs}clearLogs(){this.logs=new st(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const e=this.getLogArray();return e.push(W({extraMetadata:t})),new Blob(e,{type:"application/json"})}}class at{constructor(t,e=1024e3){this.baseChunkLogger=new ot(t,e)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const e=URL.createObjectURL(this.logsToBlob(t)),r=document.createElement("a");r.href=e,r.download=`walletconnect-logs-${(new Date).toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)}}class ht{constructor(t,e=1024e3){this.baseChunkLogger=new ot(t,e)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var ct=Object.defineProperty,ut=Object.defineProperties,ft=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,gt=(t,e,r)=>e in t?ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mt=(t,e)=>{for(var r in e||(e={}))lt.call(e,r)&>(t,r,e[r]);if(dt)for(var r of dt(e))pt.call(e,r)&>(t,r,e[r]);return t},bt=(t,e)=>ut(t,ft(e));function yt(t){return bt(mt({},t),{level:t?.level||"info"})}function vt(t,e=it){let r="";return r=typeof t.bindings>"u"?function(t,e=it){return t[e]||""}(t,e):t.bindings().context||"",r}function wt(t,e,r=it){const i=function(t,e,r=it){const i=vt(t,r);return i.trim()?`${i}/${e}`:e}(t,e,r);return function(t,e,r=it){return t[r]=e,t}(t.child({context:i}),i,r)}function _t(t){return typeof t.loggerOverride<"u"&&"string"!=typeof t.loggerOverride?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?function(t){var e,r;const i=new at(null==(e=t.opts)?void 0:e.level,t.maxSizeInBytes);return{logger:rt()(bt(mt({},t.opts),{level:"trace",browser:bt(mt({},null==(r=t.opts)?void 0:r.browser),{write:t=>i.write(t)})})),chunkLoggerController:i}}(t):function(t){var e;const r=new ht(null==(e=t.opts)?void 0:e.level,t.maxSizeInBytes);return{logger:rt()(bt(mt({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}(t)}class Mt extends w{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class Et extends w{constructor(t,e){super(),this.core=t,this.logger=e,this.records=new Map}}class St{constructor(t,e){this.logger=t,this.core=e}}class It extends w{constructor(t,e){super(),this.relayer=t,this.logger=e}}class At extends w{constructor(t){super()}}class xt{constructor(t,e,r,i){this.core=t,this.logger=e,this.name=r}}class Ot extends w{constructor(t,e){super(),this.relayer=t,this.logger=e}}class Rt extends w{constructor(t,e){super(),this.core=t,this.logger=e}}class Pt{constructor(t,e,r){this.core=t,this.logger=e,this.store=r}}class Nt{constructor(t,e){this.projectId=t,this.logger=e}}class Tt{constructor(t,e,r){this.core=t,this.logger=e,this.telemetryEnabled=r}}y();class kt{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}b.EventEmitter;class Lt{constructor(t){this.client=t}}var Ct=r(4904),qt=r(7052);const Ut=".",jt="base64url",zt="utf8",Dt="utf8",Bt="did",$t="key",Kt="base58btc";function Ft(t){return null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Vt(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Ft(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}const Ht=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);t[e];){var u=r[t.charCodeAt(e)];if(255===u)return;for(var f=0,d=s-1;(0!==u||f>>0,o[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");n=f,e++}if(" "!==t[e]){for(var l=s-n;l!==s&&0===o[l];)l++;for(var p=new Uint8Array(i+(s-l)),g=i;l!==s;)p[g++]=o[l++];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,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*u+1>>>0,c=new Uint8Array(o);n!==s;){for(var f=e[n],d=0,l=o-1;(0!==f||d>>0,c[l]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var g=h.repeat(r);p{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")});class Gt{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Jt{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return Yt(this,t)}}class Zt{constructor(t){this.decoders=t}or(t){return Yt(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 ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Yt=(t,e)=>new Zt({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Xt{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new Gt(t,e,r),this.decoder=new Jt(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Qt=({name:t,prefix:e,encode:r,decode:i})=>new Xt(t,e,r,i),te=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=Ht(r,e);return Qt({prefix:t,name:e,encode:i,decode:t=>Wt(n(t))})},ee=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Qt({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<((t,e,r,i)=>{const n={};for(let t=0;t=8&&(a-=8,o[c++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)}),re=Qt({prefix:"\0",name:"identity",encode:t=>{return e=t,(new TextDecoder).decode(e);var e},decode:t=>(t=>(new TextEncoder).encode(t))(t)}),ie=ee({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ne=ee({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),se=te({prefix:"9",name:"base10",alphabet:"0123456789"}),oe=ee({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ae=ee({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),he=ee({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ce=ee({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ue=ee({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),fe=ee({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),de=ee({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),le=ee({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),pe=ee({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ge=ee({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),me=ee({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),be=te({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ye=te({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ve=te({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),we=te({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),_e=ee({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Me=ee({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ee=ee({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Se=ee({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Ie=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ae=Ie.reduce(((t,e,r)=>(t[r]=e,t)),[]),xe=Ie.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]),Oe=Qt({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+Ae[e]),"")},decode:function(t){const e=[];for(const r of t){const t=xe[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var Re=128,Pe=-128,Ne=Math.pow(2,31),Te=Math.pow(2,7),ke=Math.pow(2,14),Le=Math.pow(2,21),Ce=Math.pow(2,28),qe=Math.pow(2,35),Ue=Math.pow(2,42),je=Math.pow(2,49),ze=Math.pow(2,56),De=Math.pow(2,63);const Be=function t(e,r,i){r=r||[];for(var n=i=i||0;e>=Ne;)r[i++]=255&e|Re,e/=128;for(;e&Pe;)r[i++]=255&e|Re,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},$e=function(t){return t(Be(t,e,r),e),Fe=t=>$e(t),Ve=(t,e)=>{const r=e.byteLength,i=Fe(t),n=i+Fe(r),s=new Uint8Array(n+r);return Ke(t,s,0),Ke(r,s,i),s.set(e,n),new He(t,r,e,s)};class He{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const We=({name:t,code:e,encode:r})=>new Ge(t,e,r);class Ge{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?Ve(this.code,e):e.then((t=>Ve(this.code,t)))}throw Error("Unknown type, must be binary type")}}const Je=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ze=We({name:"sha2-256",code:18,encode:Je("SHA-256")}),Ye=We({name:"sha2-512",code:19,encode:Je("SHA-512")}),Xe=Wt,Qe={code:0,name:"identity",encode:Xe,digest:t=>Ve(0,Xe(t))},tr="raw",er=85,rr=t=>Wt(t),ir=t=>Wt(t),nr=new TextEncoder,sr=new TextDecoder,or="json",ar=512,hr=t=>nr.encode(JSON.stringify(t)),cr=t=>JSON.parse(sr.decode(t));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const ur={...i,...n,...s,...o,...a,...h,...c,...u,...f,...d};function fr(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const dr=fr("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),lr=fr("ascii","a",(t=>{let e="a";for(let r=0;r{const e=Vt((t=t.substring(1)).length);for(let r=0;rt+e.length),0));const r=Vt(e);let i=0;for(const e of t)r.set(e,i),i+=e.length;return Ft(r)}([mr("K36",Kt),t]),Kt);return[Bt,$t,e].join(":")}function wr(t){const e=t.split(Ut);return{header:br(e[0]),payload:br(e[1]),signature:mr(e[2],jt),data:mr(e.slice(0,2).join(Ut),Dt)}}function _r(t=(0,qt.randomBytes)(32)){return Ct.K(t)}r(5665);var Mr=function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;n{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 Br,$r;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(Br||(Br={})),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",t.ACTION_REJECTED="ACTION_REJECTED"}($r||($r={}));const Kr="0123456789abcdef";class Fr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==Ur[r]&&this.throwArgumentError("invalid log level name","logLevel",t),jr>Ur[r]||console.log.apply(console,e)}debug(...t){this._log(Fr.levels.DEBUG,t)}info(...t){this._log(Fr.levels.INFO,t)}warn(...t){this._log(Fr.levels.WARNING,t)}makeError(t,e,r){if(qr)return this.makeError("censored error",e,{});e||(e=Fr.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=Kr[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch(e){i.push(t+"="+JSON.stringify(r[t].toString()))}})),i.push(`code=${e}`),i.push(`version=${this.version}`);const n=t;let s="";switch(e){case $r.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 $r.CALL_EXCEPTION:case $r.INSUFFICIENT_FUNDS:case $r.MISSING_NEW:case $r.NONCE_EXPIRED:case $r.REPLACEMENT_UNDERPRICED:case $r.TRANSACTION_REPLACED:case $r.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const o=new Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,Fr.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),Dr&&this.throwError("platform missing String.prototype.normalize",Fr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Dr})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Fr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Fr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,Fr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",Fr.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",Fr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",Fr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return zr||(zr=new Fr("logger/5.7.0")),zr}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Fr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Cr){if(!t)return;this.globalLogger().throwError("error censorship permanent",Fr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}qr=!!t,Cr=!!e}static setLogLevel(t){const e=Ur[t.toLowerCase()];null!=e?jr=e:Fr.globalLogger().warn("invalid log level - "+t)}static from(t){return new Fr(t)}}Fr.errors=$r,Fr.levels=Br;const Vr=new Fr("bytes/5.7.0");function Hr(t){return!!t.toHexString}function Wr(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Wr(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Gr(t){return"number"==typeof t&&t==t&&t%1==0}function Jr(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!Gr(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function Zr(t,e){if(e||(e={}),"number"==typeof t){Vr.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),Wr(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Hr(t)&&(t=t.toHexString()),Yr(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":Vr.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;t>4]+Xr[15&i]}return e}return Vr.throwArgumentError("invalid hexlify value","value",t)}function ti(t,e,r){return"string"!=typeof t?t=Qr(t):(!Yr(t)||t.length%2)&&Vr.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ei(t,e){for("string"!=typeof t?t=Qr(t):Yr(t)||Vr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Vr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function ri(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Yr(r=t)&&!(r.length%2)||Jr(r)){let r=Zr(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Qr(r.slice(0,32)),e.s=Qr(r.slice(32,64))):65===r.length?(e.r=Qr(r.slice(0,32)),e.s=Qr(r.slice(32,64)),e.v=r[64]):Vr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:Vr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Qr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=function(t,e){(t=Zr(t)).length>e&&Vr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Wr(r)}(Zr(e._vs),32);e._vs=Qr(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&Vr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const n=Qr(r);null==e.s?e.s=n:e.s!==n&&Vr.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?Vr.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&Vr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&Yr(e.r)?e.r=ei(e.r,32):Vr.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&Yr(e.s)?e.s=ei(e.s,32):Vr.throwArgumentError("signature missing or invalid s","signature",t);const r=Zr(e.s);r[0]>=128&&Vr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=Qr(r);e._vs&&(Yr(e._vs)||Vr.throwArgumentError("signature invalid _vs","signature",t),e._vs=ei(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&Vr.throwArgumentError("signature _vs mismatch v and s","signature",t)}var r;return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var ii=r(1176),ni=r.n(ii);function si(t){return"0x"+ni().keccak_256(Zr(t))}const oi=new Fr("strings/5.7.0");var ai,hi;function ci(t,e,r,i,n){if(t===hi.BAD_PREFIX||t===hi.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===hi.OVERRUN?r.length-e-1:0}function ui(t,e=ai.current){e!=ai.current&&(oi.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&i|128);else if(55296==(64512&i)){e++;const n=t.charCodeAt(e);if(e>=t.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Zr(r)}function fi(t){return"string"==typeof t&&(t=ui(t)),si(function(t){const e=t.map((t=>Zr(t))),r=e.reduce(((t,e)=>t+e.length),0),i=new Uint8Array(r);return e.reduce(((t,e)=>(i.set(e,t),t+e.length)),0),Wr(i)}([ui("Ethereum Signed Message:\n"),ui(String(t.length)),t]))}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(ai||(ai={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(hi||(hi={})),Object.freeze({error:function(t,e,r,i,n){return oi.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:ci,replace:function(t,e,r,i,n){return t===hi.OVERLONG?(i.push(n),0):(i.push(65533),ci(t,e,r))}});var di=r(2046),li=r.n(di)().BN;new Fr("bignumber/5.7.0");const pi=new Fr("address/5.7.0");function gi(t){Yr(t,20)||pi.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=Zr(si(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const mi={};for(let t=0;t<10;t++)mi[String(t)]=String(t);for(let t=0;t<26;t++)mi[String.fromCharCode(65+t)]=String(10+t);const bi=Math.floor((yi=9007199254740991,Math.log10?Math.log10(yi):Math.log(yi)/Math.LN10));var yi;function vi(t){let e=null;if("string"!=typeof t&&pi.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=gi(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&pi.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>mi[t])).join("");for(;e.length>=bi;){let t=e.substring(0,bi);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&pi.throwArgumentError("bad icap checksum","address",t),r=t.substring(4),e=new li(r,36).toString(16);e.length<40;)e="0"+e;e=gi("0x"+e)}else pi.throwArgumentError("invalid address","address",t);var r;return e}var wi=r(5280),_i=r.n(wi),Mi=r(7952),Ei=r.n(Mi);function Si(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var Ii=Ai;function Ai(t,e){if(!t)throw new Error(e||"Assertion failed")}Ai.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var xi=Si((function(t,e){var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}})),Oi=Si((function(t,e){var r=e;r.assert=Ii,r.toArray=xi.toArray,r.zero2=xi.zero2,r.toHex=xi.toHex,r.encode=xi.encode,r.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-h:h,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,h=t.andln(3)+n&3,c=e.andln(3)+s&3;3===h&&(h=-1),3===c&&(c=-1),o=1&h?3!=(i=t.andln(7)+n&7)&&5!==i||2!==c?h:-h:0,r[0].push(o),a=1&c?3!=(i=e.andln(7)+s&7)&&5!==i||2!==h?c:-c:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(_i())(t,"hex","le")}})),Ri=Oi.getNAF,Pi=Oi.getJSF,Ni=Oi.assert;function Ti(t,e){this.type=t,this.p=new(_i())(e.p,16),this.red=e.prime?_i().red(e.prime):_i().mont(this.p),this.zero=new(_i())(0).toRed(this.red),this.one=new(_i())(1).toRed(this.red),this.two=new(_i())(2).toRed(this.red),this.n=e.n&&new(_i())(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))}var ki=Ti;function Li(t,e){this.curve=t,this.type=e,this.precomputed=null}Ti.prototype.point=function(){throw new Error("Not implemented")},Ti.prototype.validate=function(){throw new Error("Not implemented")},Ti.prototype._fixedNafMul=function(t,e){Ni(t.precomputed);var r=t._getDoubles(),i=Ri(e,1,this._bitLength),n=(1<=s;h--)o=(o<<1)+i[h];a.push(o)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),f=n;f>0;f--){for(s=0;s=0;a--){for(var h=0;a>=0&&0===s[a];a--)h++;if(a>=0&&h++,o=o.dblp(h),a<0)break;var c=s[a];Ni(0!==c),o="affine"===t.type?c>0?o.mixedAdd(n[c-1>>1]):o.mixedAdd(n[-c-1>>1].neg()):c>0?o.add(n[c-1>>1]):o.add(n[-c-1>>1].neg())}return"affine"===t.type?o.toP():o},Ti.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,h=this._wnafT1,c=this._wnafT2,u=this._wnafT3,f=0;for(s=0;s=1;s-=2){var l=s-1,p=s;if(1===h[l]&&1===h[p]){var g=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(g[1]=e[l].add(e[p]),g[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(g[1]=e[l].toJ().mixedAdd(e[p]),g[2]=e[l].add(e[p].neg())):(g[1]=e[l].toJ().mixedAdd(e[p]),g[2]=e[l].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=Pi(r[l],r[p]);for(f=Math.max(b[0].length,f),u[l]=new Array(f),u[p]=new Array(f),o=0;o=0;s--){for(var M=0;s>=0;){var E=!0;for(o=0;o=0&&M++,w=w.dblp(M),s<0)break;for(o=0;o0?a=c[o][S-1>>1]:S<0&&(a=c[o][-S-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},Li.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},Ui.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),h=n.mul(r.b),c=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:h.add(c).neg()}},Ui.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),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},Ui.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},Ui.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},zi.prototype.isInfinity=function(){return this.inf},zi.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),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},zi.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(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},zi.prototype.getX=function(){return this.x.fromRed()},zi.prototype.getY=function(){return this.y.fromRed()},zi.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)},zi.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},zi.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},zi.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))},zi.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,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},zi.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Ci(Di,ki.BasePoint),Ui.prototype.jpoint=function(t,e,r){return new Di(this,t,e,r)},Di.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),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},Di.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Di.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),h=s.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=i.redMul(c),d=h.redSqr().redIAdd(u).redISub(f).redISub(f),l=h.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},Di.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=o.redSqr(),c=h.redMul(o),u=r.redMul(h),f=a.redSqr().redIAdd(c).redISub(u).redISub(u),d=a.redMul(u.redISub(f)).redISub(n.redMul(c)),l=this.z.redMul(o);return this.curve.jpoint(f,d,l)},Di.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=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},Di.prototype.inspect=function(){return this.isInfinity()?"":""},Di.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Bi=Si((function(t,e){var r=e;r.base=ki,r.short=ji,r.mont=null,r.edwards=null})),$i=Si((function(t,e){var r,i=e,n=Oi.assert;function s(t){"short"===t.type?this.curve=new Bi.short(t):"edwards"===t.type?this.curve=new Bi.edwards(t):this.curve=new Bi.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=s,o("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:Ei().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:Ei().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:Ei().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:Ei().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"]}),o("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:Ei().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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ei().sha256,gRed:!1,g:["9"]}),o("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:Ei().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(t){r=void 0}o("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:Ei().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Ki(t){if(!(this instanceof Ki))return new Ki(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=xi.toArray(t.entropy,t.entropyEnc||"hex"),r=xi.toArray(t.nonce,t.nonceEnc||"hex"),i=xi.toArray(t.pers,t.persEnc||"hex");Ii(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var Fi=Ki;Ki.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Ki.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=xi.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var Gi=Oi.assert;function Ji(t,e){if(t instanceof Ji)return t;this._importDER(t,e)||(Gi(t.r&&t.s,"Signature without r or s"),this.r=new(_i())(t.r,16),this.s=new(_i())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Zi=Ji;function Yi(){this.place=0}function Xi(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function Qi(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}Ji.prototype._importDER=function(t,e){t=Oi.toArray(t,e);var r=new Yi;if(48!==t[r.place++])return!1;var i=Xi(t,r);if(!1===i)return!1;if(i+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=Xi(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=Xi(t,r);if(!1===o)return!1;if(t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(_i())(s),this.s=new(_i())(a),this.recoveryParam=null,!0},Ji.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=Qi(e),r=Qi(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];tn(i,e.length),(i=i.concat(e)).push(2),tn(i,r.length);var n=i.concat(r),s=[48];return tn(s,n.length),s=s.concat(n),Oi.encode(s,t)};var en=function(){throw new Error("unsupported")},rn=Oi.assert;function nn(t){if(!(this instanceof nn))return new nn(t);"string"==typeof t&&(rn(Object.prototype.hasOwnProperty.call($i,t),"Unknown curve "+t),t=$i[t]),t instanceof $i.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}var sn=nn;nn.prototype.keyPair=function(t){return new Wi(this,t)},nn.prototype.keyFromPrivate=function(t,e){return Wi.fromPrivate(this,t,e)},nn.prototype.keyFromPublic=function(t,e){return Wi.fromPublic(this,t,e)},nn.prototype.genKeyPair=function(t){t||(t={});for(var e=new Fi({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||en(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new(_i())(2));;){var n=new(_i())(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},nn.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},nn.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(_i())(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new Fi({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new(_i())(1)),c=0;;c++){var u=i.k?i.k(c):new(_i())(a.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(h)>=0)){var f=this.g.mul(u);if(!f.isInfinity()){var d=f.getX(),l=d.umod(this.n);if(0!==l.cmpn(0)){var p=u.invm(this.n).mul(l.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==d.cmp(l)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new Zi({r:l,s:p,recoveryParam:g})}}}}}},nn.prototype.verify=function(t,e,r,i){t=this._truncateToN(new(_i())(t,16)),r=this.keyFromPublic(r,i);var n=(e=new Zi(e,"hex")).r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),h=a.mul(t).umod(this.n),c=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(h,r.getPublic(),c)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(h,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},nn.prototype.recoverPubKey=function(t,e,r,i){rn((3&r)===r,"The recovery param is more than two bits"),e=new Zi(e,i);var n=this.n,s=new(_i())(t),o=e.r,a=e.s,h=1&r,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");o=c?this.curve.pointFromX(o.add(this.curve.n),h):this.curve.pointFromX(o,h);var u=e.r.invm(n),f=n.sub(s).mul(u).umod(n),d=a.mul(u).umod(n);return this.g.mulAdd(f,o,d)},nn.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new Zi(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var on=Si((function(t,e){var r=e;r.version="6.5.4",r.utils=Oi,r.rand=function(){throw new Error("unsupported")},r.curve=Bi,r.curves=$i,r.ec=sn,r.eddsa=null})),an=on.ec;function hn(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new Fr("properties/5.7.0");const cn=new Fr("signing-key/5.7.0");let un=null;function fn(){return un||(un=new an("secp256k1")),un}class dn{constructor(t){hn(this,"curve","secp256k1"),hn(this,"privateKey",Qr(t)),32!==function(t){if("string"!=typeof t)t=Qr(t);else if(!Yr(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&cn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=fn().keyFromPrivate(Zr(this.privateKey));hn(this,"publicKey","0x"+e.getPublic(!1,"hex")),hn(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),hn(this,"_isSigningKey",!0)}_addPoint(t){const e=fn().keyFromPublic(Zr(this.publicKey)),r=fn().keyFromPublic(Zr(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=fn().keyFromPrivate(Zr(this.privateKey)),r=Zr(t);32!==r.length&&cn.throwArgumentError("bad digest length","digest",t);const i=e.sign(r,{canonical:!0});return ri({recoveryParam:i.recoveryParam,r:ei("0x"+i.r.toString(16),32),s:ei("0x"+i.s.toString(16),32)})}computeSharedSecret(t){const e=fn().keyFromPrivate(Zr(this.privateKey)),r=fn().keyFromPublic(Zr(ln(t)));return ei("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function ln(t,e){const r=Zr(t);if(32===r.length){const t=new dn(r);return e?"0x"+fn().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?Qr(r):"0x"+fn().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+fn().keyFromPublic(r).getPublic(!0,"hex"):Qr(r):cn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var pn;new Fr("transactions/5.7.0"),function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(pn||(pn={}));var gn=r(1612),mn=r(6804),bn=r(204),yn=r(774);function vn(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function wn(t,e){e||(e=t.reduce(((t,e)=>t+e.length),0));const r=vn(e);let i=0;for(const e of t)r.set(e,i),i+=e.length;return r}function _n(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Mn=_n("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),En=_n("ascii","a",(t=>{let e="a";for(let r=0;r{const e=vn((t=t.substring(1)).length);for(let r=0;re in t?Tn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Un=(t,e)=>{for(var r in e||(e={}))Ln.call(e,r)&&qn(t,r,e[r]);if(kn)for(var r of kn(e))Cn.call(e,r)&&qn(t,r,e[r]);return t};const jn="react-native",zn="browser",Dn="js";function Bn(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function $n(){return!(0,Tr.getDocument)()&&!!(0,Tr.getNavigator)()&&"ReactNative"===navigator.product}function Kn(){return!Bn()&&!!(0,Tr.getNavigator)()&&!!(0,Tr.getDocument)()}function Fn(){return $n()?jn:Bn()?"node":Kn()?zn:"unknown"}function Vn(){return(0,kr.g)()||{name:"",description:"",url:"",icons:[""]}}function Hn(t,e,i){const n=function(){if(Fn()===jn&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Platform)<"u"){const{OS:t,Version:e}=r.g.Platform;return[t,e].join("-")}const t=e?Nr(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new xr:"undefined"!=typeof navigator?Nr(navigator.userAgent):"undefined"!=typeof process&&process.version?new Sr(process.version.slice(1)):null;var e;if(null===t)return"unknown";const i=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[i,t.name,t.version].join("-"):[i,t.version].join("-")}(),s=function(){var t;const e=Fn();return e===zn?[e,(null==(t=(0,Tr.getLocation)())?void 0:t.host)||"unknown"].join(":"):e}();return[[t,e].join("-"),[Dn,i].join("-"),n,s].join("/")}function Wn(t,e){return t.filter((t=>e.includes(t))).length===t.length}function Gn(t){return Object.fromEntries(t.entries())}function Jn(t){return new Map(Object.entries(t))}function Zn(t=v.FIVE_MINUTES,e){const r=(0,v.toMiliseconds)(t||v.FIVE_MINUTES);let i,n,s;return{resolve:t=>{s&&i&&(clearTimeout(s),i(t))},reject:t=>{s&&n&&(clearTimeout(s),n(t))},done:()=>new Promise(((t,o)=>{s=setTimeout((()=>{o(new Error(e))}),r),i=t,n=o}))}}function Yn(t,e,r){return new Promise((async(i,n)=>{const s=setTimeout((()=>n(new Error(r))),e);try{i(await t)}catch(t){n(t)}clearTimeout(s)}))}function Xn(t,e){if("string"==typeof e&&e.startsWith(`${t}:`))return e;if("topic"===t.toLowerCase()){if("string"!=typeof e)throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}if("id"===t.toLowerCase()){if("number"!=typeof e)throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Qn(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)i.topic=r;else{if("id"!==e||!Number.isInteger(Number(r)))throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);i.id=Number(r)}return i}function ts(t,e){return(0,v.fromMiliseconds)((e||Date.now())+(0,v.toMiliseconds)(t))}function es(t){return Date.now()>=(0,v.toMiliseconds)(t)}function rs(t,e){return`${t}${e?`:${e}`:""}`}function is(t=[],e=[]){return[...new Set([...t,...e])]}function ns(t,e){return t.filter((t=>e.includes(t)))}function ss(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),i=r.indexOf(e);return r[i+2]}function os(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,(t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function as(){return typeof process<"u"&&"true"===process.env.IS_VITEST}function hs(t){return Rn.from(t,"base64").toString("utf-8")}async function cs(t,e,r,i,n,s){switch(r.t){case"eip191":return function(t,e,r){return function(t,e){return function(t){return vi(ti(si(ti(ln(t),1)),12))}(function(t,e){const r=ri(e),i={r:Zr(r.r),s:Zr(r.s)};return"0x"+fn().recoverPubKey(Zr(t),i,r.recoveryParam).encode("hex",!1)}(Zr(t),e))}(fi(e),r).toLowerCase()===t.toLowerCase()}(t,e,r.s);case"eip1271":return await async function(t,e,r,i,n,s){const o=Pn(i);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",h="0000000000000000000000000000000000000000000000000000000000000041",c=r.substring(2),u=o+fi(e).substring(2)+a+h+c,f=await fetch(`${s||"https://rpc.walletconnect.org/v1"}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:u},"latest"]})}),{result:d}=await f.json();return!!d&&d.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(t){return console.error("isValidEip1271Signature: ",t),!1}}(t,e,r.s,i,n,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}var us=Object.defineProperty,fs=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,ms=(t,e,r)=>e in t?us(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bs=(t,e)=>{for(var r in e||(e={}))ps.call(e,r)&&ms(t,r,e[r]);if(ls)for(var r of ls(e))gs.call(e,r)&&ms(t,r,e[r]);return t},ys=(t,e)=>fs(t,ds(e));const vs=t=>t?.split(":"),ws=t=>{const e=t&&vs(t);if(e)return e[2]+":"+e[3]},_s=t=>{const e=t&&vs(t);if(e)return e.pop()};async function Ms(t){const{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=Es(n,n.iss),o=_s(n.iss);return await cs(o,s,i,ws(n.iss),r)}const Es=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=_s(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${(t=>{const e=t&&vs(t);if(e)return t.includes("did:pkh:")?e[3]:e[1]})(e)}`,h=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,d=t.requestId?`Request ID: ${t.requestId}`:void 0,l=t.resources?`Resources:${t.resources.map((t=>`\n- ${t}`)).join("")}`:void 0,p=Cs(t.resources);return p&&(n=Ns(n,xs(p))),[r,i,"",n,"",s,o,a,h,c,u,f,d,l].filter((t=>null!=t)).join("\n")};function Ss(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(null==e||!e.length)throw new Error("No resources found in `att` property");e.forEach((e=>{const r=t.att[e];if(Array.isArray(r))throw new Error(`Resource must be an object: ${e}`);if("object"!=typeof r)throw new Error(`Resource must be an object: ${e}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${e}`);Object.keys(r).forEach((t=>{const e=r[t];if(!Array.isArray(e))throw new Error(`Ability limits ${t} must be an array of objects, found: ${e}`);if(!e.length)throw new Error(`Value of ${t} is empty array, must be an array with objects`);e.forEach((e=>{if("object"!=typeof e)throw new Error(`Ability limits (${t}) must be an array of objects, found: ${e}`)}))}))}))}function Is(t,e,r={}){e=e?.sort(((t,e)=>t.localeCompare(e)));const i=e.map((e=>({[`${t}/${e}`]:[r]})));return Object.assign({},...i)}function As(t){return Ss(t),`urn:recap:${function(t){return Rn.from(JSON.stringify(t)).toString("base64")}(t).replace(/=/g,"")}`}function xs(t){const e=function(t){return JSON.parse(Rn.from(t,"base64").toString("utf-8"))}(t.replace("urn:recap:",""));return Ss(e),e}function Os(t,e,r){const i=function(t,e,r,i={}){return r?.sort(((t,e)=>t.localeCompare(e))),{att:{[t]:Is(e,r,i)}}}(t,e,r);return As(i)}function Rs(t){return t&&t.includes("urn:recap:")}function Ps(t,e){const r=function(t,e){Ss(t),Ss(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort(((t,e)=>t.localeCompare(e))),i={att:{}};return r.forEach((r=>{var n,s;Object.keys((null==(n=t.att)?void 0:n[r])||{}).concat(Object.keys((null==(s=e.att)?void 0:s[r])||{})).sort(((t,e)=>t.localeCompare(e))).forEach((n=>{var s,o;i.att[r]=ys(bs({},i.att[r]),{[n]:(null==(s=t.att[r])?void 0:s[n])||(null==(o=e.att[r])?void 0:o[n])})}))})),i}(xs(t),xs(e));return As(r)}function Ns(t="",e){Ss(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let n=0;return Object.keys(e.att).forEach((t=>{const r=Object.keys(e.att[t]).map((t=>({ability:t.split("/")[0],action:t.split("/")[1]})));r.sort(((t,e)=>t.action.localeCompare(e.action)));const s={};r.forEach((t=>{s[t.ability]||(s[t.ability]=[]),s[t.ability].push(t.action)}));const o=Object.keys(s).map((e=>(n++,`(${n}) '${e}': '${s[e].join("', '")}' for '${t}'.`)));i.push(o.join(", ").replace(".,","."))})),`${t?t+" ":""}${r}${i.join(" ")}`}function Ts(t){var e;const r=xs(t);Ss(r);const i=null==(e=r.att)?void 0:e.eip155;return i?Object.keys(i).map((t=>t.split("/")[1])):[]}function ks(t){const e=xs(t);Ss(e);const r=[];return Object.values(e.att).forEach((t=>{Object.values(t).forEach((t=>{var e;null!=(e=t?.[0])&&e.chains&&r.push(t[0].chains)}))})),[...new Set(r.flat())]}function Ls(t,e){if(!e)return t;const r=xs(e);return Ss(r),Ns(t,r)}function Cs(t){if(!t)return;const e=t?.[t.length-1];return Rs(e)?e:void 0}const qs="base10",Us="base16",js="base64pad",zs="base64url",Ds="utf8";function Bs(){return An((0,qt.randomBytes)(32),Us)}function $s(t){return An((0,bn.tW)(In(t,Us)),Us)}function Ks(t){return An((0,bn.tW)(In(t,Ds)),Us)}function Fs(t){return In(`${t}`,qs)}function Vs(t){return Number(An(t,qs))}function Hs(t){const{encoding:e=js}=t;if(2===Vs(t.type))return An(wn([t.type,t.sealed]),e);if(1===Vs(t.type)){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return An(wn([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return An(wn([t.type,t.iv,t.sealed]),e)}function Ws(t){const{encoded:e,encoding:r=js}=t,i=In(e,r),n=i.slice(0,1);if(1===Vs(n)){const t=33,e=t+12,r=i.slice(1,t),s=i.slice(t,e);return{type:n,sealed:i.slice(e),iv:s,senderPublicKey:r}}if(2===Vs(n))return{type:n,sealed:i.slice(1),iv:(0,qt.randomBytes)(12)};const s=i.slice(1,13);return{type:n,sealed:i.slice(13),iv:s}}function Gs(t){const e=t?.type||0;if(1===e){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function Js(t){return 1===t.type&&"string"==typeof t.senderPublicKey&&"string"==typeof t.receiverPublicKey}function Zs(t){return 2===t.type}function Ys(t){return t?.relay||{protocol:"irn"}}function Xs(t){const e=On[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Qs=Object.defineProperty,to=Object.defineProperties,eo=Object.getOwnPropertyDescriptors,ro=Object.getOwnPropertySymbols,io=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable,so=(t,e,r)=>e in t?Qs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oo=(t,e)=>{for(var r in e||(e={}))io.call(e,r)&&so(t,r,e[r]);if(ro)for(var r of ro(e))no.call(e,r)&&so(t,r,e[r]);return t};function ao(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach((e=>{if(e.startsWith(i)){const n=e.replace(i,""),s=t[e];r[n]=s}})),r}function ho(t){if(!t.includes("wc:")){const e=hs(t);null!=e&&e.includes("wc:")&&(t=e)}const e=(t=(t=t.includes("wc://")?t.replace("wc://",""):t).includes("wc:")?t.replace("wc:",""):t).indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=Lr.parse(s),a="string"==typeof o.methods?o.methods.split(","):void 0;return{protocol:i,topic:co(n[0]),version:parseInt(n[1],10),symKey:o.symKey,relay:ao(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function co(t){return t.startsWith("//")?t.substring(2):t}function uo(t){return`${t.protocol}:${t.topic}@${t.version}?`+Lr.stringify(oo(((t,e)=>to(t,eo(e)))(oo({symKey:t.symKey},function(t,e="-"){const r={};return Object.keys(t).forEach((i=>{const n="relay"+e+i;t[i]&&(r[n]=t[i])})),r}(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function fo(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}var lo=Object.defineProperty,po=Object.defineProperties,go=Object.getOwnPropertyDescriptors,mo=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,vo=(t,e,r)=>e in t?lo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wo=(t,e)=>{for(var r in e||(e={}))bo.call(e,r)&&vo(t,r,e[r]);if(mo)for(var r of mo(e))yo.call(e,r)&&vo(t,r,e[r]);return t},_o=(t,e)=>po(t,go(e));function Mo(t){const e=[];return t.forEach((t=>{const[r,i]=t.split(":");e.push(`${r}:${i}`)})),e}function Eo(t){return t.includes(":")}function So(t){return Eo(t)?t.split(":")[0]:t}function Io(t){var e,r,i;const n={};if(!To(t))return n;for(const[s,o]of Object.entries(t)){const t=Eo(s)?[s]:o.chains,a=o.methods||[],h=o.events||[],c=So(s);n[c]=_o(wo({},n[c]),{chains:is(t,null==(e=n[c])?void 0:e.chains),methods:is(a,null==(r=n[c])?void 0:r.methods),events:is(h,null==(i=n[c])?void 0:i.events)})}return n}function Ao(t,e){const r=function(t){const e={};return t?.forEach((t=>{const[r,i]=t.split(":");e[r]||(e[r]={accounts:[],chains:[],events:[]}),e[r].accounts.push(t),e[r].chains.push(`${r}:${i}`)})),e}(e=e.map((t=>t.replace("did:pkh:",""))));for(const[e,i]of Object.entries(r))i.methods?i.methods=is(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const xo={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Oo={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ro(t,e){const{message:r,code:i}=Oo[t];return{message:e?`${r} ${e}`:r,code:i}}function Po(t,e){const{message:r,code:i}=xo[t];return{message:e?`${r} ${e}`:r,code:i}}function No(t,e){return!!Array.isArray(t)&&(!(typeof e<"u"&&t.length)||t.every(e))}function To(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function ko(t){return typeof t>"u"}function Lo(t,e){return!(!e||!ko(t))||"string"==typeof t&&!!t.trim().length}function Co(t,e){return!(!e||!ko(t))||"number"==typeof t&&!isNaN(t)}function qo(t){return!(!Lo(t,!1)||!t.includes(":"))&&2===t.split(":").length}function Uo(t){let e=!0;return No(t)?t.length&&(e=t.every((t=>Lo(t,!1)))):e=!1,e}function jo(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=function(t,e){let r=null;return Uo(t?.methods)?Uo(t?.events)||(r=Po("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Po("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}(t,`${e}, namespace`);i&&(r=i)})),r}function zo(t,e){let r=null;if(t&&To(t)){const i=jo(t,e);i&&(r=i);const n=function(t,e){let r=null;return Object.values(t).forEach((t=>{if(r)return;const i=function(t,e){let r=null;return No(t)?t.forEach((t=>{r||function(t){if(Lo(t,!1)&&t.includes(":")){const e=t.split(":");if(3===e.length){const t=e[0]+":"+e[1];return!!e[2]&&qo(t)}}return!1}(t)||(r=Po("UNSUPPORTED_ACCOUNTS",`${e}, account ${t} should be a string and conform to "namespace:chainId:address" format`))})):r=Po("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}(t?.accounts,`${e} namespace`);i&&(r=i)})),r}(t,e);n&&(r=n)}else r=Ro("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Do(t){return Lo(t.protocol,!0)}function Bo(t){return typeof t<"u"&&null!==typeof t}function $o(t,e){return!(!qo(e)||!function(t){const e=[];return Object.values(t).forEach((t=>{e.push(...Mo(t.accounts))})),e}(t).includes(e))}function Ko(t,e,r){let i=null;const n=function(t){const e={};return Object.keys(t).forEach((r=>{var i;r.includes(":")?e[r]=t[r]:null==(i=t[r].chains)||i.forEach((i=>{e[i]={methods:t[r].methods,events:t[r].events}}))})),e}(t),s=function(t){const e={};return Object.keys(t).forEach((r=>{if(r.includes(":"))e[r]=t[r];else{const i=Mo(t[r].accounts);i?.forEach((i=>{e[i]={accounts:t[r].accounts.filter((t=>t.includes(`${i}:`))),methods:t[r].methods,events:t[r].events}}))}})),e}(e),o=Object.keys(n),a=Object.keys(s),h=Fo(Object.keys(t)),c=Fo(Object.keys(e)),u=h.filter((t=>!c.includes(t)));return u.length&&(i=Ro("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.\n Required: ${u.toString()}\n Received: ${Object.keys(e).toString()}`)),Wn(o,a)||(i=Ro("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.\n Required: ${o.toString()}\n Approved: ${a.toString()}`)),Object.keys(e).forEach((t=>{if(!t.includes(":")||i)return;const n=Mo(e[t].accounts);n.includes(t)||(i=Ro("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${t}\n Required: ${t}\n Approved: ${n.toString()}`))})),o.forEach((t=>{i||(Wn(n[t].methods,s[t].methods)?Wn(n[t].events,s[t].events)||(i=Ro("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${t}`)):i=Ro("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${t}`))})),i}function Fo(t){return[...new Set(t.map((t=>t.includes(":")?t.split(":")[0]:t)))]}function Vo(){const t=Fn();return new Promise((e=>{switch(t){case zn:e(Kn()&&navigator?.onLine);break;case jn:e(async function(){if($n()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo){const t=await(null==r.g?void 0:r.g.NetInfo.fetch());return t?.isConnected}return!0}());break;default:e(!0)}}))}const Ho={};class Wo{static get(t){return Ho[t]}static set(t,e){Ho[t]=e}static delete(t){delete Ho[t]}}const Go="PARSE_ERROR",Jo="INVALID_REQUEST",Zo="METHOD_NOT_FOUND",Yo="INVALID_PARAMS",Xo="INTERNAL_ERROR",Qo="SERVER_ERROR",ta=[-32700,-32600,-32601,-32602,-32603],ea={[Go]:{code:-32700,message:"Parse error"},[Jo]:{code:-32600,message:"Invalid Request"},[Zo]:{code:-32601,message:"Method not found"},[Yo]:{code:-32602,message:"Invalid params"},[Xo]:{code:-32603,message:"Internal error"},[Qo]:{code:-32e3,message:"Server error"}},ra=Qo;function ia(t){return Object.keys(ea).includes(t)?ea[t]:ea[ra]}var na=r(5682);function sa(t=3){return Date.now()*Math.pow(10,t)+Math.floor(Math.random()*Math.pow(10,t))}function oa(t=6){return BigInt(sa(t))}function aa(t,e,r){return{id:r||sa(),jsonrpc:"2.0",method:t,params:e}}function ha(t,e){return{id:t,jsonrpc:"2.0",result:e}}function ca(t,e,r){return{id:t,jsonrpc:"2.0",error:ua(e,r)}}function ua(t,e){return void 0===t?ia(Xo):("string"==typeof t&&(t=Object.assign(Object.assign({},ia(Qo)),{message:t})),void 0!==e&&(t.data=e),r=t.code,ta.includes(r)&&(t=function(t){return Object.values(ea).find((e=>e.code===t))||ea[ra]}(t.code)),t);var r}class fa{}class da extends fa{constructor(){super()}}class la extends da{constructor(t){super()}}function pa(t){return function(t,e){const r=function(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return void 0!==r&&new RegExp(e).test(r)}(t,"^wss?:")}function ga(t){return"object"==typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function ma(t){return ga(t)&&"method"in t}function ba(t){return ga(t)&&(ya(t)||va(t))}function ya(t){return"result"in t}function va(t){return"error"in t}class wa extends la{constructor(t){super(t),this.events=new b.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async request(t,e){return this.requestStrict(aa(t.method,t.params||[],t.id||oa().toString()),e)}async requestStrict(t,e){return new Promise((async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(t){i(t)}this.events.on(`${t.id}`,(t=>{va(t)?i(t.error):r(t.result)}));try{await this.connection.send(t,e)}catch(t){i(t)}}))}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),ba(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&3e3===t.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(t=>this.onPayload(t))),this.connection.on("close",(t=>this.onClose(t))),this.connection.on("error",(t=>this.events.emit("error",t))),this.connection.on("register_error",(t=>this.onClose())),this.hasRegisteredEventListeners=!0)}}const _a=t=>t.split("?")[0],Ma=typeof WebSocket<"u"?WebSocket:typeof r.g<"u"&&typeof r.g.WebSocket<"u"?r.g.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:r(796);class Ea{constructor(t){if(this.url=t,this.events=new b.EventEmitter,this.registering=!1,!pa(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t=this.url){await this.register(t)}async close(){return new Promise(((t,e)=>{typeof this.socket>"u"?e(new Error("Connection already closed")):(this.socket.onclose=e=>{this.onClose(e),t()},this.socket.close())}))}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(W(t))}catch(e){this.onError(t.id,e)}}register(t=this.url){if(!pa(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise(((t,e)=>{this.events.once("register_error",(t=>{this.resetMaxListeners(),e(t)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return e(new Error("WebSocket connection is missing or invalid"));t(this.socket)}))}))}return this.url=t,this.registering=!0,new Promise(((e,i)=>{const n=new URLSearchParams(t).get("origin"),s=(0,na.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:(a=t,!new RegExp("wss?://localhost(:d{2,5})?").test(a))},o=new Ma(t,[],s);var a;typeof WebSocket<"u"||typeof r.g<"u"&&typeof r.g.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=t=>{const e=t;i(this.emitError(e.error))}:o.on("error",(t=>{i(this.emitError(t))})),o.onopen=()=>{this.onOpen(o),e(o)}}))}onOpen(t){t.onmessage=t=>this.onPayload(t),t.onclose=t=>this.onClose(t),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const e="string"==typeof t.data?H(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const r=this.parseError(e),i=ca(t,r.message||r.toString());this.events.emit("payload",i)}parseError(t,e=this.url){return function(t,e){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable WS RPC url at ${e}`):t}(t,_a(e))}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(t){const e=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${_a(this.url)}`));return this.events.emit("register_error",e),e}}var Sa=r(8142),Ia=r.n(Sa);const Aa="core",xa=`wc@2:${Aa}:`,Oa={database:":memory:"},Ra="client_ed25519_seed",Pa=v.ONE_DAY,Na=v.SIX_HOURS,Ta="wss://relay.walletconnect.org",ka="relayer_message",La="relayer_message_ack",Ca="relayer_connection_stalled",qa="relayer_publish",Ua="payload",ja="connect",za="disconnect",Da="error",Ba="2.17.1",$a={link_mode:"link_mode",relay:"relay"},Ka="WALLETCONNECT_LINK_MODE_APPS",Fa="subscription_created",Va="subscription_deleted",Ha=1e3*v.FIVE_SECONDS,Wa={wc_pairingDelete:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:v.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:v.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:v.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:v.ONE_DAY,prompt:!1,tag:0},res:{ttl:v.ONE_DAY,prompt:!1,tag:0}}},Ga="pairing_create",Ja="pairing_delete",Za="history_created",Ya="history_updated",Xa="history_deleted",Qa="expirer_created",th="expirer_deleted",eh="expirer_expired",rh="https://verify.walletconnect.org",ih=rh,nh=`${ih}/v3`,sh=["https://verify.walletconnect.com",rh],oh="malformed_pairing_uri",ah="session_approve_started";var hh=function(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);t[e];){var u=r[t.charCodeAt(e)];if(255===u)return;for(var f=0,d=s-1;(0!==u||f>>0,o[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");n=f,e++}if(" "!==t[e]){for(var l=s-n;l!==s&&0===o[l];)l++;for(var p=new Uint8Array(i+(s-l)),g=i;l!==s;)p[g++]=o[l++];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,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*u+1>>>0,c=new Uint8Array(o);n!==s;){for(var f=e[n],d=0,l=o-1;(0!==f||d>>0,c[l]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");i=d,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var g=h.repeat(r);p{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")};class uh{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class fh{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return lh(this,t)}}class dh{constructor(t){this.decoders=t}or(t){return lh(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 ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const lh=(t,e)=>new dh({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class ph{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new uh(t,e,r),this.decoder=new fh(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const gh=({name:t,prefix:e,encode:r,decode:i})=>new ph(t,e,r,i),mh=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=hh(r,e);return gh({prefix:t,name:e,encode:i,decode:t=>ch(n(t))})},bh=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>gh({prefix:e,name:t,encode:t=>((t,e,r)=>{const i="="===e[e.length-1],n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<((t,e,r,i)=>{const n={};for(let t=0;t=8&&(a-=8,o[c++]=255&h>>a)}if(a>=r||255&h<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)}),yh=gh({prefix:"\0",name:"identity",encode:t=>(t=>(new TextDecoder).decode(t))(t),decode:t=>(t=>(new TextEncoder).encode(t))(t)});var vh=Object.freeze({__proto__:null,identity:yh});const wh=bh({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var _h=Object.freeze({__proto__:null,base2:wh});const Mh=bh({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Eh=Object.freeze({__proto__:null,base8:Mh});const Sh=mh({prefix:"9",name:"base10",alphabet:"0123456789"});var Ih=Object.freeze({__proto__:null,base10:Sh});const Ah=bh({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),xh=bh({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Oh=Object.freeze({__proto__:null,base16:Ah,base16upper:xh});const Rh=bh({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ph=bh({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Nh=bh({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Th=bh({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),kh=bh({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Lh=bh({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ch=bh({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),qh=bh({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Uh=bh({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var jh=Object.freeze({__proto__:null,base32:Rh,base32upper:Ph,base32pad:Nh,base32padupper:Th,base32hex:kh,base32hexupper:Lh,base32hexpad:Ch,base32hexpadupper:qh,base32z:Uh});const zh=mh({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Dh=mh({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Bh=Object.freeze({__proto__:null,base36:zh,base36upper:Dh});const $h=mh({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Kh=mh({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Fh=Object.freeze({__proto__:null,base58btc:$h,base58flickr:Kh});const Vh=bh({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Hh=bh({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Wh=bh({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Gh=bh({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Jh=Object.freeze({__proto__:null,base64:Vh,base64pad:Hh,base64url:Wh,base64urlpad:Gh});const Zh=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Yh=Zh.reduce(((t,e,r)=>(t[r]=e,t)),[]),Xh=Zh.reduce(((t,e,r)=>(t[e.codePointAt(0)]=r,t)),[]),Qh=gh({prefix:"🚀",name:"base256emoji",encode:function(t){return t.reduce(((t,e)=>t+Yh[e]),"")},decode:function(t){const e=[];for(const r of t){const t=Xh[r.codePointAt(0)];if(void 0===t)throw new Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}});var tc=Object.freeze({__proto__:null,base256emoji:Qh}),ec=128,rc=-128,ic=Math.pow(2,31),nc=128,sc=127,oc=Math.pow(2,7),ac=Math.pow(2,14),hc=Math.pow(2,21),cc=Math.pow(2,28),uc=Math.pow(2,35),fc=Math.pow(2,42),dc=Math.pow(2,49),lc=Math.pow(2,56),pc=Math.pow(2,63),gc={encode:function t(e,r,i){r=r||[];for(var n=i=i||0;e>=ic;)r[i++]=255&e|ec,e/=128;for(;e&rc;)r[i++]=255&e|ec,e>>>=7;return r[i]=0|e,t.bytes=i-n+1,r},decode:function t(e,r){var i,n=0,s=(r=r||0,0),o=r,a=e.length;do{if(o>=a)throw t.bytes=0,new RangeError("Could not decode varint");i=e[o++],n+=s<28?(i&sc)<=nc);return t.bytes=o-r,n},encodingLength:function(t){return t(mc.encode(t,e,r),e),yc=t=>mc.encodingLength(t),vc=(t,e)=>{const r=e.byteLength,i=yc(t),n=i+yc(r),s=new Uint8Array(n+r);return bc(t,s,0),bc(r,s,i),s.set(e,n),new _c(t,r,e,s)};class _c{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}const Mc=({name:t,code:e,encode:r})=>new Ec(t,e,r);class Ec{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){const e=this.encode(t);return e instanceof Uint8Array?vc(this.code,e):e.then((t=>vc(this.code,t)))}throw Error("Unknown type, must be binary type")}}const Sc=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Ic=Mc({name:"sha2-256",code:18,encode:Sc("SHA-256")}),Ac=Mc({name:"sha2-512",code:19,encode:Sc("SHA-512")});Object.freeze({__proto__:null,sha256:Ic,sha512:Ac});const xc=ch,Oc={code:0,name:"identity",encode:xc,digest:t=>vc(0,xc(t))};Object.freeze({__proto__:null,identity:Oc}),new TextEncoder,new TextDecoder;const Rc={...vh,..._h,...Eh,...Ih,...Oh,...jh,...Bh,...Fh,...Jh,...tc};function Pc(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Nc=Pc("utf8","u",(t=>"u"+new TextDecoder("utf8").decode(t)),(t=>(new TextEncoder).encode(t.substring(1)))),Tc=Pc("ascii","a",(t=>{let e="a";for(let r=0;r{const e=function(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}((t=t.substring(1)).length);for(let r=0;r{if(!this.initialized){const t=await this.getKeyChain();typeof t<"u"&&(this.keychain=t),this.initialized=!0}},this.has=t=>(this.isInitialized(),this.keychain.has(t)),this.set=async(t,e)=>{this.isInitialized(),this.keychain.set(t,e),await this.persist()},this.get=t=>{this.isInitialized();const e=this.keychain.get(t);if(typeof e>"u"){const{message:e}=Ro("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e},this.del=async t=>{this.isInitialized(),this.keychain.delete(t),await this.persist()},this.core=t,this.logger=wt(e,this.name)}get context(){return vt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,Gn(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?Jn(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Cc{constructor(t,e,r){this.core=t,this.logger=e,this.name="crypto",this.randomSessionIdentifier=Bs(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=t=>(this.isInitialized(),this.keychain.has(t)),this.getClientId=async()=>(this.isInitialized(),vr(_r(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();const t=function(){const t=yn.TZ();return{privateKey:An(t.secretKey,Us),publicKey:An(t.publicKey,Us)}}();return this.setPrivateKey(t.publicKey,t.privateKey)},this.signJWT=async t=>{this.isInitialized();const e=_r(await this.getClientSeed()),r=this.randomSessionIdentifier,i=Pa;return await async function(t,e,r,i,n=(0,v.fromMiliseconds)(Date.now())){const s={alg:"EdDSA",typ:"JWT"},o={iss:vr(i.publicKey),sub:t,aud:e,iat:n,exp:n+r},a=mr([yr((h={header:s,payload:o}).header),yr(h.payload)].join(Ut),Dt);var h;return function(t){return[yr(t.header),yr(t.payload),(e=t.signature,gr(e,jt))].join(Ut);var e}({header:s,payload:o,signature:Ct._S(i.secretKey,a)})}(r,t,i,e)},this.generateSharedKey=(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=yn.Tc(In(t,Us),In(e,Us),!0);return An(new mn.i(bn.aD,r).expand(32),Us)}(this.getPrivateKey(t),e);return this.setSymKey(i,r)},this.setSymKey=async(t,e)=>{this.isInitialized();const r=e||$s(t);return await this.keychain.set(r,t),r},this.deleteKeyPair=async t=>{this.isInitialized(),await this.keychain.del(t)},this.deleteSymKey=async t=>{this.isInitialized(),await this.keychain.del(t)},this.encode=async(t,e,r)=>{this.isInitialized();const i=Gs(r),n=W(e);if(Zs(i))return function(t,e){const r=Fs(2),i=(0,qt.randomBytes)(12);return Hs({type:r,sealed:In(t,Ds),iv:i,encoding:e})}(n,r?.encoding);if(Js(i)){const e=i.senderPublicKey,r=i.receiverPublicKey;t=await this.generateSharedKey(e,r)}const s=this.getSymKey(t),{type:o,senderPublicKey:a}=i;return function(t){const e=Fs(typeof t.type<"u"?t.type:0);if(1===Vs(e)&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?In(t.senderPublicKey,Us):void 0,i=typeof t.iv<"u"?In(t.iv,Us):(0,qt.randomBytes)(12);return Hs({type:e,sealed:new gn.g6(In(t.symKey,Us)).seal(i,In(t.message,Ds)),iv:i,senderPublicKey:r,encoding:t.encoding})}({type:o,symKey:s,message:n,senderPublicKey:a,encoding:r?.encoding})},this.decode=async(t,e,r)=>{this.isInitialized();const i=function(t,e){const r=Ws({encoded:t,encoding:e?.encoding});return Gs({type:Vs(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?An(r.senderPublicKey,Us):void 0,receiverPublicKey:e?.receiverPublicKey})}(e,r);if(Zs(i)){const t=function(t,e){const{sealed:r}=Ws({encoded:t,encoding:e});return An(r,Ds)}(e,r?.encoding);return H(t)}if(Js(i)){const e=i.receiverPublicKey,r=i.senderPublicKey;t=await this.generateSharedKey(e,r)}try{const i=function(t){const e=new gn.g6(In(t.symKey,Us)),{sealed:r,iv:i}=Ws({encoded:t.encoded,encoding:t?.encoding}),n=e.open(i,r);if(null===n)throw new Error("Failed to decrypt");return An(n,Ds)}({symKey:this.getSymKey(t),encoded:e,encoding:r?.encoding});return H(i)}catch(e){this.logger.error(`Failed to decode message from topic: '${t}', clientId: '${await this.getClientId()}'`),this.logger.error(e)}},this.getPayloadType=(t,e=js)=>Vs(Ws({encoded:t,encoding:e}).type),this.getPayloadSenderPublicKey=(t,e=js)=>{const r=Ws({encoded:t,encoding:e});return r.senderPublicKey?An(r.senderPublicKey,Us):void 0},this.core=t,this.logger=wt(e,this.name),this.keychain=r||new Lc(this.core,this.logger)}get context(){return vt(this.logger)}async setPrivateKey(t,e){return await this.keychain.set(t,e),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(Ra)}catch{t=Bs(),await this.keychain.set(Ra,t)}return function(t,e="utf8"){const r=kc[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return"utf8"!==e&&"utf-8"!==e||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${t}`):globalThis.Buffer.from(t,"utf8")}(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}}class qc extends St{constructor(t,e){super(t,e),this.logger=t,this.core=e,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=xa,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const t=await this.getRelayerMessages();typeof t<"u"&&(this.messages=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}finally{this.initialized=!0}}},this.set=async(t,e)=>{this.isInitialized();const r=Ks(e);let i=this.messages.get(t);return typeof i>"u"&&(i={}),typeof i[r]<"u"||(i[r]=e,this.messages.set(t,i),await this.persist()),r},this.get=t=>{this.isInitialized();let e=this.messages.get(t);return typeof e>"u"&&(e={}),e},this.has=(t,e)=>(this.isInitialized(),typeof this.get(t)[Ks(e)]<"u"),this.del=async t=>{this.isInitialized(),this.messages.delete(t),await this.persist()},this.logger=wt(t,this.name),this.core=e}get context(){return vt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,Gn(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?Jn(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}}class Uc extends It{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.events=new b.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,v.toMiliseconds)(v.ONE_MINUTE),this.failedPublishTimeout=(0,v.toMiliseconds)(v.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(t,e,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:t,message:e,opts:r}});const n=r?.ttl||Na,s=Ys(r),o=r?.prompt||!1,a=r?.tag||0,h=r?.id||oa().toString(),c={topic:t,message:e,opts:{ttl:n,relay:s,prompt:o,tag:a,id:h,attestation:r?.attestation}},u=`Failed to publish payload, please try again. id:${h} tag:${a}`,f=Date.now();let d,l=1;try{for(;void 0===d;){if(Date.now()-f>this.publishTimeout)throw new Error(u);this.logger.trace({id:h,attempts:l},`publisher.publish - attempt ${l}`),d=await await Yn(this.rpcPublish(t,e,n,s,o,a,h,r?.attestation).catch((t=>this.logger.warn(t))),this.publishTimeout,u),l++,d||await new Promise((t=>setTimeout(t,this.failedPublishTimeout)))}this.relayer.events.emit(qa,c),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:h,topic:t,message:e,opts:r}})}catch(t){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(t),null!=(i=r?.internal)&&i.throwOnFailedPublish)throw t;this.queue.set(h,c)}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.relayer=t,this.logger=wt(e,this.name),this.registerEventListeners()}get context(){return vt(this.logger)}rpcPublish(t,e,r,i,n,s,o,a){var h,c,u,f;const d={method:Xs(i.protocol).publish,params:{topic:t,message:e,ttl:r,prompt:n,tag:s,attestation:a},id:o};return ko(null==(h=d.params)?void 0:h.prompt)&&(null==(c=d.params)||delete c.prompt),ko(null==(u=d.params)?void 0:u.tag)&&(null==(f=d.params)||delete f.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:d}),this.relayer.request(d)}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach((async t=>{const{topic:e,message:r,opts:i}=t;await this.publish(e,r,i)}))}registerEventListeners(){this.relayer.core.heartbeat.on(E,(()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(Ca);this.checkQueue()})),this.relayer.on(La,(t=>{this.removeRequestFromQueue(t.id.toString())}))}}class jc{constructor(){this.map=new Map,this.set=(t,e)=>{const r=this.get(t);this.exists(t,e)||this.map.set(t,[...r,e])},this.get=t=>this.map.get(t)||[],this.exists=(t,e)=>this.get(t).includes(e),this.delete=(t,e)=>{if(typeof e>"u")return void this.map.delete(t);if(!this.map.has(t))return;const r=this.get(t);if(!this.exists(t,e))return;const i=r.filter((t=>t!==e));i.length?this.map.set(t,i):this.map.delete(t)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var zc=Object.defineProperty,Dc=Object.defineProperties,Bc=Object.getOwnPropertyDescriptors,$c=Object.getOwnPropertySymbols,Kc=Object.prototype.hasOwnProperty,Fc=Object.prototype.propertyIsEnumerable,Vc=(t,e,r)=>e in t?zc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hc=(t,e)=>{for(var r in e||(e={}))Kc.call(e,r)&&Vc(t,r,e[r]);if($c)for(var r of $c(e))Fc.call(e,r)&&Vc(t,r,e[r]);return t},Wc=(t,e)=>Dc(t,Bc(e));class Gc extends Ot{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.subscriptions=new Map,this.topicMap=new jc,this.events=new b.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=xa,this.subscribeTimeout=(0,v.toMiliseconds)(v.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(t,e)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}});try{const r=Ys(e),i={topic:t,relay:r,transportType:e?.transportType};this.pending.set(t,i);const n=await this.rpcSubscribe(t,r,e);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}})),n}catch(t){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(t),t}},this.unsubscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),typeof e?.id<"u"?await this.unsubscribeById(t,e.id,e):await this.unsubscribeByTopic(t,e)},this.isSubscribed=async t=>{if(this.topics.includes(t))return!0;const e=`${this.pendingSubscriptionWatchLabel}_${t}`;return await new Promise(((r,i)=>{const n=new v.Watch;n.start(e);const s=setInterval((()=>{!this.pending.has(t)&&this.topics.includes(t)&&(clearInterval(s),n.stop(e),r(!0)),n.elapsed(e)>=Ha&&(clearInterval(s),n.stop(e),i(new Error("Subscription resolution timeout")))}),this.pollingInterval)})).catch((()=>!1))},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=wt(e,this.name),this.clientId=""}get context(){return vt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(t,e){let r=!1;try{r=this.getSubscription(t).topic===e}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,e){const r=this.topicMap.get(t);await Promise.all(r.map((async r=>await this.unsubscribeById(t,r,e))))}async unsubscribeById(t,e,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}});try{const i=Ys(r);await this.rpcUnsubscribe(t,e,i);const n=Po("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,e,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}})}catch(t){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(t),t}}async rpcSubscribe(t,e,r){var i;r?.transportType===$a.relay&&await this.restartToComplete();const n={method:Xs(e.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});const s=null==(i=r?.internal)?void 0:i.throwOnFailedPublish;try{const e=Ks(t+this.clientId);if(r?.transportType===$a.link_mode)return setTimeout((()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(n).catch((t=>this.logger.warn(t)))}),(0,v.toMiliseconds)(v.ONE_SECOND)),e;const i=await Yn(this.relayer.request(n).catch((t=>this.logger.warn(t))),this.subscribeTimeout,`Subscribing to ${t} failed, please try again`);if(!i&&s)throw new Error(`Subscribing to ${t} failed, please try again`);return i?e:null}catch(t){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ca),s)throw t}return null}async rpcBatchSubscribe(t){if(!t.length)return;const e={method:Xs(t[0].relay.protocol).batchSubscribe,params:{topics:t.map((t=>t.topic))}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{return await await Yn(this.relayer.request(e).catch((t=>this.logger.warn(t))),this.subscribeTimeout)}catch{this.relayer.events.emit(Ca)}}async rpcBatchFetchMessages(t){if(!t.length)return;const e={method:Xs(t[0].relay.protocol).batchFetchMessages,params:{topics:t.map((t=>t.topic))}};let r;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{r=await await Yn(this.relayer.request(e).catch((t=>this.logger.warn(t))),this.subscribeTimeout)}catch{this.relayer.events.emit(Ca)}return r}rpcUnsubscribe(t,e,r){const i={method:Xs(r.protocol).unsubscribe,params:{topic:t,id:e}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(t,e){this.setSubscription(t,Wc(Hc({},e),{id:t})),this.pending.delete(e.topic)}onBatchSubscribe(t){t.length&&t.forEach((t=>{this.setSubscription(t.id,Hc({},t)),this.pending.delete(t.topic)}))}async onUnsubscribe(t,e,r){this.events.removeAllListeners(e),this.hasSubscription(e,t)&&this.deleteSubscription(e,r),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,e){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:e}),this.addSubscription(t,e)}addSubscription(t,e){this.subscriptions.set(t,Hc({},e)),this.topicMap.set(e.topic,t),this.events.emit(Fa,e)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const e=this.subscriptions.get(t);if(!e){const{message:e}=Ro("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e}deleteSubscription(t,e){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:e});const r=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(r.topic,t),this.events.emit(Va,Wc(Hc({},r),{reason:e}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit("subscription_sync")}async reset(){if(this.cached.length){const t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let e=0;e"u"||!t.length)return;if(this.subscriptions.size){const{message:t}=Ro("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(!t.length)return;const e=await this.rpcBatchSubscribe(t);No(e)&&this.onBatchSubscribe(e.map(((e,r)=>Wc(Hc({},t[r]),{id:e}))))}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);const e=await this.rpcBatchFetchMessages(t);e&&e.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(e.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const t=[];this.pending.forEach((e=>{t.push(e)})),await this.batchSubscribe(t),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(E,(async()=>{await this.checkPending()})),this.events.on(Fa,(async t=>{const e=Fa;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()})),this.events.on(Va,(async t=>{const e=Va;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.restartInProgress||(clearInterval(e),t())}),this.pollingInterval)}))}}var Jc=Object.defineProperty,Zc=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,Xc=Object.prototype.propertyIsEnumerable,Qc=(t,e,r)=>e in t?Jc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tu=(t,e)=>{for(var r in e||(e={}))Yc.call(e,r)&&Qc(t,r,e[r]);if(Zc)for(var r of Zc(e))Xc.call(e,r)&&Qc(t,r,e[r]);return t};class eu extends At{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new b.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,v.toMiliseconds)(v.THIRTY_SECONDS+v.ONE_SECOND),this.request=async t=>{var e,r;this.logger.debug("Publishing Request Payload");const i=t.id||oa().toString();await this.toEstablishConnection();try{const n=this.provider.request(t);this.requestsInFlight.set(i,{promise:n,request:t}),this.logger.trace({id:i,method:t.method,topic:null==(e=t.params)?void 0:e.topic},"relayer.request - attempt to publish...");const s=await new Promise((async(t,e)=>{const r=()=>{e(new Error(`relayer.request - publish interrupted, id: ${i}`))};this.provider.on(za,r);const s=await n;this.provider.off(za,r),t(s)}));return this.logger.trace({id:i,method:t.method,topic:null==(r=t.params)?void 0:r.topic},"relayer.request - published"),s}catch(t){throw this.logger.debug(`Failed to Publish Request: ${i}`),t}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if(Bn())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((()=>{var t,e,r;null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)||r.terminate()}),this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit("relayer_connect")},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit("relayer_error",t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Ua,this.onPayloadHandler),this.provider.on(ja,this.onConnectHandler),this.provider.on(za,this.onDisconnectHandler),this.provider.on(Da,this.onProviderErrorHandler)},this.core=t.core,this.logger=typeof t.logger<"u"&&"string"!=typeof t.logger?wt(t.logger,this.name):rt()(yt({level:t.logger||"error"})),this.messages=new qc(this.logger,t.core),this.subscriber=new Gc(this,this.logger),this.publisher=new Uc(this,this.logger),this.relayUrl=t?.relayUrl||Ta,this.projectId=t.projectId,this.bundleId=function(){var t;try{return $n()&&typeof r.g<"u"&&typeof(null==r.g?void 0:r.g.Application)<"u"?null==(t=r.g.Application)?void 0:t.applicationId:void 0}catch{return}}(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(t){this.logger.warn(t)}}get context(){return vt(this.logger)}get connected(){var t,e,r;return 1===(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)}get connecting(){var t,e,r;return 0===(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)}async publish(t,e,r){this.isInitialized(),await this.publisher.publish(t,e,r),await this.recordMessageEvent({topic:t,message:e,publishedAt:Date.now(),transportType:$a.relay})}async subscribe(t,e){var r,i,n;this.isInitialized(),"relay"===e?.transportType&&await this.toEstablishConnection();const s=typeof(null==(r=e?.internal)?void 0:r.throwOnFailedPublish)>"u"||(null==(i=e?.internal)?void 0:i.throwOnFailedPublish);let o,a=(null==(n=this.subscriber.topicMap.get(t))?void 0:n[0])||"";const h=e=>{e.topic===t&&(this.subscriber.off(Fa,h),o())};return await Promise.all([new Promise((t=>{o=t,this.subscriber.on(Fa,h)})),new Promise((async(r,i)=>{a=await this.subscriber.subscribe(t,tu({internal:{throwOnFailedPublish:s}},e)).catch((t=>{s&&i(t)}))||a,r()}))]),a}async unsubscribe(t,e){this.isInitialized(),await this.subscriber.unsubscribe(t,e)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map((t=>t.promise)))}catch(t){this.logger.warn(t)}this.hasExperiencedNetworkDisruption||this.connected?await Yn(this.provider.disconnect(),2e3,"provider.disconnect()").catch((()=>this.onProviderDisconnect())):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise((async(t,e)=>{const r=()=>{this.provider.off(za,r),e(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(za,r),await Yn(this.provider.connect(),(0,v.toMiliseconds)(v.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch((t=>{e(t)})).finally((()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0})),this.subscriber.start().catch((t=>{this.logger.error(t),this.onDisconnectHandler()})),this.hasExperiencedNetworkDisruption=!1,t()}))}catch(t){this.logger.error(t);const e=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(e.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(t){this.connectionAttemptInProgress||(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Vo())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if(0===t?.length)return void this.logger.trace("Batch message events is empty. Ignoring...");const e=t.sort(((t,e)=>t.publishedAt-e.publishedAt));this.logger.trace(`Batch of ${e.length} message events sorted`);for(const t of e)try{await this.onMessageEvent(t)}catch(t){this.logger.warn(t)}this.logger.trace(`Batch of ${e.length} message events processed`)}async onLinkMessageEvent(t,e){const{topic:r}=t;if(!e.sessionExists){const t={topic:r,expiry:ts(v.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,t)}this.events.emit(ka,t),await this.recordMessageEvent(t)}startPingTimeout(){var t,e,r,i,n;if(Bn())try{null!=(e=null==(t=this.provider)?void 0:t.connection)&&e.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",(()=>{this.resetPingTimeout()}))),this.resetPingTimeout()}catch(t){this.logger.warn(t)}}isConnectionStalled(t){return this.staleConnectionErrors.some((e=>t.includes(e)))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new wa(new Ea(function({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:o,bundleId:a}){const h=r.split("?"),c={auth:n,ua:Hn(t,e,i),projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},u=function(t,e){let r=Lr.parse(t);return r=Un(Un({},r),e),Lr.stringify(r)}(h[1]||"",c);return h[0]+"?"+u}({sdkVersion:Ba,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(t){const{topic:e,message:r}=t;await this.messages.set(e,r)}async shouldIgnoreMessageEvent(t){const{topic:e,message:r}=t;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(e))return this.logger.debug(`Ignoring message for non-subscribed topic ${e}`),!0;const i=this.messages.has(e,r);return i&&this.logger.debug(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),ma(t)){if(!t.method.endsWith("_subscription"))return;const e=t.params,{topic:r,message:i,publishedAt:n,attestation:s}=e.data,o={topic:r,message:i,publishedAt:n,transportType:$a.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(tu({type:"event",event:e.id},o)),this.events.emit(e.id,o),await this.acknowledgePayload(t),await this.onMessageEvent(o)}else ba(t)&&this.events.emit(La,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(ka,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){const e=ha(t.id,!0);await this.provider.connection.send(e)}unregisterProviderListeners(){this.provider.off(Ua,this.onPayloadHandler),this.provider.off(ja,this.onConnectHandler),this.provider.off(za,this.onDisconnectHandler),this.provider.off(Da,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await Vo();!function(t){switch(Fn()){case zn:!function(t){!$n()&&Kn()&&(window.addEventListener("online",(()=>t(!0))),window.addEventListener("offline",(()=>t(!1))))}(t);break;case jn:!function(t){$n()&&typeof r.g<"u"&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener((e=>t(e?.isConnected)))}(t)}}((async e=>{t!==e&&(t=e,e?await this.restartTransport().catch((t=>this.logger.error(t))):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}))}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit("relayer_disconnect"),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout((async()=>{await this.transportOpen().catch((t=>this.logger.error(t)))}),(0,v.toMiliseconds)(.1))))}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise((t=>{const e=setInterval((()=>{this.connected&&(clearInterval(e),t())}),this.connectionStatusPollingInterval)})),await this.transportOpen())}}var ru=Object.defineProperty,iu=Object.getOwnPropertySymbols,nu=Object.prototype.hasOwnProperty,su=Object.prototype.propertyIsEnumerable,ou=(t,e,r)=>e in t?ru(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,au=(t,e)=>{for(var r in e||(e={}))nu.call(e,r)&&ou(t,r,e[r]);if(iu)for(var r of iu(e))su.call(e,r)&&ou(t,r,e[r]);return t};class hu extends xt{constructor(t,e,r,i=xa,n=void 0){super(t,e,r,i),this.core=t,this.logger=e,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=xa,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>{this.getKey&&null!==t&&!ko(t)?this.map.set(this.getKey(t),t):function(t){var e;return null==(e=t?.proposer)?void 0:e.publicKey}(t)?this.map.set(t.id,t):function(t){return t?.topic}(t)&&this.map.set(t.topic,t)})),this.cached=[],this.initialized=!0)},this.set=async(t,e)=>{this.isInitialized(),this.map.has(t)?await this.update(t,e):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:t,value:e}),this.map.set(t,e),await this.persist())},this.get=t=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:t}),this.getData(t)),this.getAll=t=>(this.isInitialized(),t?this.values.filter((e=>Object.keys(t).every((r=>Ia()(e[r],t[r]))))):this.values),this.update=async(t,e)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:t,update:e});const r=au(au({},this.getData(t)),e);this.map.set(t,r),await this.persist()},this.delete=async(t,e)=>{this.isInitialized(),this.map.has(t)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:t,reason:e}),this.map.delete(t),this.addToRecentlyDeleted(t),await this.persist())},this.logger=wt(e,this.name),this.storagePrefix=i,this.getKey=n}get context(){return vt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const e=this.map.get(t);if(!e){if(this.recentlyDeleted.includes(t)){const{message:e}=Ro("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(e),new Error(e)}const{message:e}=Ro("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(e),new Error(e)}return e}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:t}=Ro("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}}class cu{constructor(t,e){this.core=t,this.logger=e,this.name="pairing",this.version="0.3",this.events=new(y()),this.initialized=!1,this.storagePrefix=xa,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:t})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...t])]},this.create=async t=>{this.isInitialized();const e=Bs(),r=await this.core.crypto.setSymKey(e),i=ts(v.FIVE_MINUTES),n={protocol:"irn"},s={topic:r,expiry:i,relay:n,active:!1,methods:t?.methods},o=uo({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:e,relay:n,expiryTimestamp:i,methods:t?.methods});return this.events.emit(Ga,s),this.core.expirer.set(r,i),await this.pairings.set(r,s),await this.core.relayer.subscribe(r,{transportType:t?.transportType}),{topic:r,uri:o}},this.pair=async t=>{this.isInitialized();const e=this.core.eventClient.createEvent({properties:{topic:t?.uri,trace:["pairing_started"]}});this.isValidPair(t,e);const{topic:r,symKey:i,relay:n,expiryTimestamp:s,methods:o}=ho(t.uri);let a;if(e.props.properties.topic=r,e.addTrace("pairing_uri_validation_success"),e.addTrace("pairing_uri_not_expired"),this.pairings.keys.includes(r)){if(a=this.pairings.get(r),e.addTrace("existing_pairing"),a.active)throw e.setError("active_pairing_already_exists"),new Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);e.addTrace("pairing_not_expired")}const h=s||ts(v.FIVE_MINUTES),c={topic:r,relay:n,expiry:h,active:!1,methods:o};this.core.expirer.set(r,h),await this.pairings.set(r,c),e.addTrace("store_new_pairing"),t.activatePairing&&await this.activate({topic:r}),this.events.emit(Ga,c),e.addTrace("emit_inactive_pairing"),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(i,r),e.addTrace("subscribing_pairing_topic");try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{e.setError("no_internet_connection")}try{await this.core.relayer.subscribe(r,{relay:n})}catch(t){throw e.setError("subscribe_pairing_topic_failure"),t}return e.addTrace("subscribe_pairing_topic_success"),c},this.activate=async({topic:t})=>{this.isInitialized();const e=ts(v.THIRTY_DAYS);this.core.expirer.set(t,e),await this.pairings.update(t,{active:!0,expiry:e})},this.ping=async t=>{this.isInitialized(),await this.isValidPing(t);const{topic:e}=t;if(this.pairings.keys.includes(e)){const t=await this.sendRequest(e,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=Zn();this.events.once(rs("pairing_ping",t),(({error:t})=>{t?n(t):i()})),await r()}},this.updateExpiry=async({topic:t,expiry:e})=>{this.isInitialized(),await this.pairings.update(t,{expiry:e})},this.updateMetadata=async({topic:t,metadata:e})=>{this.isInitialized(),await this.pairings.update(t,{peerMetadata:e})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async t=>{this.isInitialized(),await this.isValidDisconnect(t);const{topic:e}=t;this.pairings.keys.includes(e)&&(await this.sendRequest(e,"wc_pairingDelete",Po("USER_DISCONNECTED")),await this.deletePairing(e))},this.formatUriFromPairing=t=>{this.isInitialized();const{topic:e,relay:r,expiry:i,methods:n}=t,s=this.core.crypto.keychain.get(e);return uo({protocol:this.core.protocol,version:this.core.version,topic:e,symKey:s,relay:r,expiryTimestamp:i,methods:n})},this.sendRequest=async(t,e,r)=>{const i=aa(e,r),n=await this.core.crypto.encode(t,i),s=Wa[e].req;return this.core.history.set(t,i),this.core.relayer.publish(t,n,s),i.id},this.sendResult=async(t,e,r)=>{const i=ha(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=Wa[s.request.method].res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.sendError=async(t,e,r)=>{const i=ca(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=Wa[s.request.method]?Wa[s.request.method].res:Wa.unregistered_method.res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.deletePairing=async(t,e)=>{await this.core.relayer.unsubscribe(t),await Promise.all([this.pairings.delete(t,Po("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(t),e?Promise.resolve():this.core.expirer.del(t)])},this.cleanup=async()=>{const t=this.pairings.getAll().filter((t=>es(t.expiry)));await Promise.all(t.map((t=>this.deletePairing(t.topic))))},this.onRelayEventRequest=t=>{const{topic:e,payload:r}=t;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(e,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(e,r);default:return this.onUnknownRpcMethodRequest(e,r)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r}=t,i=(await this.core.history.get(e,r.id)).request.method;return"wc_pairingPing"===i?this.onPairingPingResponse(e,r):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult(r,t,!0),this.events.emit("pairing_ping",{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onPairingPingResponse=(t,e)=>{const{id:r}=e;setTimeout((()=>{ya(e)?this.events.emit(rs("pairing_ping",r),{}):va(e)&&this.events.emit(rs("pairing_ping",r),{error:e.error})}),500)},this.onPairingDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t}),await this.deletePairing(t),this.events.emit(Ja,{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodRequest=async(t,e)=>{const{id:r,method:i}=e;try{if(this.registeredMethods.includes(i))return;const e=Po("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,t,e),this.logger.error(e)}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodResponse=t=>{this.registeredMethods.includes(t)||this.logger.error(Po("WC_METHOD_UNSUPPORTED",t))},this.isValidPair=(t,e)=>{var r;if(!Bo(t)){const{message:r}=Ro("MISSING_OR_INVALID",`pair() params: ${t}`);throw e.setError(oh),new Error(r)}if(!function(t){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(Lo(t,!1))return!!e(t)||e(hs(t))}catch{}return!1}(t.uri)){const{message:r}=Ro("MISSING_OR_INVALID",`pair() uri: ${t.uri}`);throw e.setError(oh),new Error(r)}const i=ho(t?.uri);if(null==(r=i?.relay)||!r.protocol){const{message:t}=Ro("MISSING_OR_INVALID","pair() uri#relay-protocol");throw e.setError(oh),new Error(t)}if(null==i||!i.symKey){const{message:t}=Ro("MISSING_OR_INVALID","pair() uri#symKey");throw e.setError(oh),new Error(t)}if(null!=i&&i.expiryTimestamp&&(0,v.toMiliseconds)(i?.expiryTimestamp){if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidDisconnect=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidPairingTopic=async t=>{if(!Lo(t,!1)){const{message:e}=Ro("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(e)}if(!this.pairings.keys.includes(t)){const{message:e}=Ro("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(e)}if(es(this.pairings.get(t).expiry)){await this.deletePairing(t);const{message:e}=Ro("EXPIRED",`pairing topic: ${t}`);throw new Error(e)}},this.core=t,this.logger=wt(e,this.name),this.pairings=new hu(this.core,this.logger,this.name,this.storagePrefix)}get context(){return vt(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(ka,(async t=>{const{topic:e,message:r,transportType:i}=t;if(!this.pairings.keys.includes(e)||i===$a.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;const n=await this.core.crypto.decode(e,r);try{ma(n)?(this.core.history.set(e,n),this.onRelayEventRequest({topic:e,payload:n})):ba(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:e,payload:n}),this.core.history.delete(e,n.id))}catch(t){this.logger.error(t)}}))}registerExpirerEvents(){this.core.expirer.on(eh,(async t=>{const{topic:e}=Qn(t.target);e&&this.pairings.keys.includes(e)&&(await this.deletePairing(e,!0),this.events.emit("pairing_expire",{topic:e}))}))}}class uu extends Et{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.records=new Map,this.events=new b.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=xa,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>this.records.set(t.id,t))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(t,e,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:t,request:e,chainId:r}),this.records.has(e.id))return;const i={id:e.id,topic:t,request:{method:e.method,params:e.params||null},chainId:r,expiry:ts(v.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(Za,i)},this.resolve=async t=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:t}),!this.records.has(t.id))return;const e=await this.getRecord(t.id);typeof e.response>"u"&&(e.response=va(t)?{error:t.error}:{result:t.result},this.records.set(e.id,e),this.persist(),this.events.emit(Ya,e))},this.get=async(t,e)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:t,id:e}),await this.getRecord(e)),this.delete=(t,e)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:e}),this.values.forEach((r=>{if(r.topic===t){if(typeof e<"u"&&r.id!==e)return;this.records.delete(r.id),this.events.emit(Xa,r)}})),this.persist()},this.exists=async(t,e)=>(this.isInitialized(),!!this.records.has(e)&&(await this.getRecord(e)).topic===t),this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=wt(e,this.name)}get context(){return vt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const t=[];return this.values.forEach((e=>{if(typeof e.response<"u")return;const r={topic:e.topic,request:aa(e.request.method,e.request.params,e.id),chainId:e.chainId};return t.push(r)})),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const e=this.records.get(t);if(!e){const{message:e}=Ro("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(e)}return e}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit("history_sync")}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:t}=Ro("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(Za,(t=>{const e=Za;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})})),this.events.on(Ya,(t=>{const e=Ya;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})})),this.events.on(Xa,(t=>{const e=Xa;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})})),this.core.heartbeat.on(E,(()=>{this.cleanup()}))}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach((e=>{(0,v.toMiliseconds)(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.records.delete(e.id),this.events.emit(Xa,e,!1),t=!0)})),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}}class fu extends Rt{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.expirations=new Map,this.events=new b.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=xa,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach((t=>this.expirations.set(t.target,t))),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=t=>{try{const e=this.formatTarget(t);return typeof this.getExpiration(e)<"u"}catch{return!1}},this.set=(t,e)=>{this.isInitialized();const r=this.formatTarget(t),i={target:r,expiry:e};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit(Qa,{target:r,expiration:i})},this.get=t=>{this.isInitialized();const e=this.formatTarget(t);return this.getExpiration(e)},this.del=t=>{if(this.isInitialized(),this.has(t)){const e=this.formatTarget(t),r=this.getExpiration(e);this.expirations.delete(e),this.events.emit(th,{target:e,expiration:r})}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=wt(e,this.name)}get context(){return vt(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if("string"==typeof t)return function(t){return Xn("topic",t)}(t);if("number"==typeof t)return function(t){return Xn("id",t)}(t);const{message:e}=Ro("UNKNOWN_TYPE","Target type: "+typeof t);throw new Error(e)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit("expirer_sync")}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:t}=Ro("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const e=this.expirations.get(t);if(!e){const{message:e}=Ro("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(e),new Error(e)}return e}checkExpiry(t,e){const{expiry:r}=e;(0,v.toMiliseconds)(r)-Date.now()<=0&&this.expire(t,e)}expire(t,e){this.expirations.delete(t),this.events.emit(eh,{target:t,expiration:e})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach(((t,e)=>this.checkExpiry(e,t)))}registerEventListeners(){this.core.heartbeat.on(E,(()=>this.checkExpirations())),this.events.on(Qa,(t=>{const e=Qa;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(eh,(t=>{const e=eh;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})),this.events.on(th,(t=>{const e=th;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()}))}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}}class du extends Pt{constructor(t,e,r){super(t,e,r),this.core=t,this.logger=e,this.store=r,this.name="verify-api",this.verifyUrlV3=nh,this.storagePrefix=xa,this.version=2,this.init=async()=>{var t;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,v.toMiliseconds)(null==(t=this.publicKey)?void 0:t.expiresAt){if(!Kn()||this.isDevEnv)return;const e=window.location.origin,{id:r,decryptedId:i}=t,n=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${e}&id=${r}&decryptedId=${i}`;try{const t=(0,Tr.getDocument)(),e=this.startAbortTimer(5*v.ONE_SECOND),i=await new Promise(((i,s)=>{const o=()=>{window.removeEventListener("message",h),t.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",o);const a=t.createElement("iframe");a.src=n,a.style.display="none",a.addEventListener("error",o,{signal:this.abortController.signal});const h=n=>{if(n.data&&"string"==typeof n.data)try{const s=JSON.parse(n.data);if("verify_attestation"===s.type){if(wr(s.attestation).payload.id!==r)return;clearInterval(e),t.body.removeChild(a),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",h),i(null===s.attestation?"":s.attestation)}}catch(t){this.logger.warn(t)}};t.body.appendChild(a),window.addEventListener("message",h,{signal:this.abortController.signal})}));return this.logger.debug("jwt attestation",i),i}catch(t){this.logger.warn(t)}return""},this.resolve=async t=>{if(this.isDevEnv)return"";const{attestationId:e,hash:r,encryptedId:i}=t;if(""===e)return void this.logger.debug("resolve: attestationId is empty, skipping");if(e){if(wr(e).payload.id!==i)return;const t=await this.isValidJwtAttestation(e);if(t)return t.isVerified?t:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;const n=this.getVerifyUrl(t?.verifyUrl);return this.fetchAttestation(r,n)},this.fetchAttestation=async(t,e)=>{this.logger.debug(`resolving attestation: ${t} from url: ${e}`);const r=this.startAbortTimer(5*v.ONE_SECOND),i=await fetch(`${e}/attestation/${t}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.getVerifyUrl=t=>{let e=t||ih;return sh.includes(e)||(this.logger.info(`verify url: ${e}, not included in trusted list, assigning default: ${ih}`),e=ih),e},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const t=this.startAbortTimer(v.FIVE_SECONDS),e=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(t),await e.json()}catch(t){this.logger.warn(t)}},this.persistPublicKey=async t=>{this.logger.debug("persisting public key to local storage",t),await this.store.setItem(this.storeKey,t),this.publicKey=t},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async t=>{const e=await this.getPublicKey();try{if(e)return this.validateAttestation(t,e)}catch(t){this.logger.error(t),this.logger.warn("error validating attestation")}const r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(t,r)}catch(t){this.logger.error(t),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise((async t=>{const e=await this.fetchPublicKey();e&&(await this.persistPublicKey(e),t(e))}));const t=await this.fetchPromise;return this.fetchPromise=void 0,t},this.validateAttestation=(t,e)=>{const r=function(t,e){const[r,i,n]=t.split("."),s=function(t){return Rn.from(function(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}(t),"base64")}(n);if(64!==s.length)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),h=`${r}.${i}`,c=(new bn.aD).update(Rn.from(h)).digest(),u=function(t){return new xn.ec("p256").keyFromPublic({x:Rn.from(t.x,"base64").toString("hex"),y:Rn.from(t.y,"base64").toString("hex")},"hex")}(e),f=Rn.from(c).toString("hex");if(!u.verify(f,{r:o,s:a}))throw new Error("Invalid signature");return wr(t).payload}(t,e.publicKey),i={hasExpired:(0,v.toMiliseconds)(r.exp)this.abortController.abort()),(0,v.toMiliseconds)(t))}}class lu extends Nt{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.context="echo",this.registerDeviceToken=async t=>{const{clientId:e,token:r,notificationType:i,enableEncrypted:n=!1}=t,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:e,type:i,token:r,always_raw:n})})},this.logger=wt(e,this.context)}}var pu=Object.defineProperty,gu=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,bu=Object.prototype.propertyIsEnumerable,yu=(t,e,r)=>e in t?pu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vu=(t,e)=>{for(var r in e||(e={}))mu.call(e,r)&&yu(t,r,e[r]);if(gu)for(var r of gu(e))bu.call(e,r)&&yu(t,r,e[r]);return t};class wu extends Tt{constructor(t,e,r=!0){super(t,e,r),this.core=t,this.logger=e,this.context="event-client",this.storagePrefix=xa,this.storageVersion=.1,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!as())try{const t={eventId:os(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Hn(this.core.relayer.protocol,this.core.relayer.version,Ba)}}};await this.sendEvent([t])}catch(t){this.logger.warn(t)}},this.createEvent=t=>{const{event:e="ERROR",type:r="",properties:{topic:i,trace:n}}=t,s=os(),o=this.core.projectId||"",a=Date.now(),h=vu({eventId:s,timestamp:a,props:{event:e,type:r,properties:{topic:i,trace:n}},bundleId:o,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,h),this.shouldPersist=!0),h},this.getEvent=t=>{const{eventId:e,topic:r}=t;if(e)return this.events.get(e);const i=Array.from(this.events.values()).find((t=>t.props.properties.topic===r));return i?vu(vu({},i),this.setMethods(i.eventId)):void 0},this.deleteEvent=t=>{const{eventId:e}=t;this.events.delete(e),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(E,(async()=>{this.shouldPersist&&await this.persist(),this.events.forEach((t=>{(0,v.fromMiliseconds)(Date.now())-(0,v.fromMiliseconds)(t.timestamp)>86400&&(this.events.delete(t.eventId),this.shouldPersist=!0)}))}))},this.setMethods=t=>({addTrace:e=>this.addTrace(t,e),setError:e=>this.setError(t,e)}),this.addTrace=(t,e)=>{const r=this.events.get(t);r&&(r.props.properties.trace.push(e),this.events.set(t,r),this.shouldPersist=!0)},this.setError=(t,e)=>{const r=this.events.get(t);r&&(r.props.type=e,r.timestamp=Date.now(),this.events.set(t,r),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const t=await this.core.storage.getItem(this.storageKey)||[];if(!t.length)return;t.forEach((t=>{this.events.set(t.eventId,vu(vu({},t),this.setMethods(t.eventId)))}))}catch(t){this.logger.warn(t)}},this.submit=async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const t=[];for(const[e,r]of this.events)r.props.type&&t.push(r);if(0!==t.length)try{if((await this.sendEvent(t)).ok)for(const e of t)this.events.delete(e.eventId),this.shouldPersist=!0}catch(t){this.logger.warn(t)}},this.sendEvent=async t=>{const e=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Ba}${e}`,{method:"POST",body:JSON.stringify(t)})},this.getAppDomain=()=>Vn().url,this.logger=wt(e,this.context),this.telemetryEnabled=r,r?this.restore().then((async()=>{await this.submit(),this.setEventListeners()})):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var _u=Object.defineProperty,Mu=Object.getOwnPropertySymbols,Eu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,Iu=(t,e,r)=>e in t?_u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Au=(t,e)=>{for(var r in e||(e={}))Eu.call(e,r)&&Iu(t,r,e[r]);if(Mu)for(var r of Mu(e))Su.call(e,r)&&Iu(t,r,e[r]);return t};class xu extends Mt{constructor(t){var e;super(t),this.protocol="wc",this.version=2,this.name=Aa,this.events=new b.EventEmitter,this.initialized=!1,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.dispatchEnvelope=({topic:t,message:e,sessionExists:r})=>{if(!t||!e)return;const i={topic:t,message:e,publishedAt:Date.now(),transportType:$a.link_mode};this.relayer.onLinkMessageEvent(i,{sessionExists:r})},this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||Ta,this.customStoragePrefix=null!=t&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";const r=yt({level:"string"==typeof t?.logger&&t.logger?t.logger:"error"}),{logger:i,chunkLoggerController:n}=_t({opts:r,maxSizeInBytes:t?.maxLogBlobSizeInBytes,loggerOverride:t?.logger});this.logChunkController=n,null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var t,e;null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(null==(e=this.logChunkController)||e.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=wt(i,this.name),this.heartbeat=new S,this.crypto=new Cc(this,this.logger,t?.keychain),this.history=new uu(this,this.logger),this.expirer=new fu(this,this.logger),this.storage=null!=t&&t.storage?t.storage:new tt(Au(Au({},Oa),t?.storageOptions)),this.relayer=new eu({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new cu(this,this.logger),this.verify=new du(this,this.logger,this.storage),this.echoClient=new lu(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new wu(this,this.logger,t?.telemetryEnabled)}static async init(t){const e=new xu(t);await e.initialize();const r=await e.crypto.getClientId();return await e.storage.setItem("WALLETCONNECT_CLIENT_ID",r),e}get context(){return vt(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return null==(t=this.logChunkController)?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(t){this.linkModeSupportedApps.includes(t)||(this.linkModeSupportedApps.push(t),await this.storage.setItem(Ka,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Ka)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}}const Ou=xu,Ru="client",Pu=`wc@2:${Ru}:`,Nu=Ru,Tu="WALLETCONNECT_DEEPLINK_CHOICE",ku=v.SEVEN_DAYS,Lu={wc_sessionPropose:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1104},res:{ttl:v.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1106},res:{ttl:v.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:v.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1112},res:{ttl:v.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:v.ONE_DAY,prompt:!1,tag:1114},res:{ttl:v.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:v.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:v.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:v.FIVE_MINUTES,prompt:!1,tag:1119}}},Cu={min:v.FIVE_MINUTES,max:v.SEVEN_DAYS},qu="IDLE",Uu="ACTIVE",ju=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],zu="wc@1.5:auth:",Du=`${zu}:PUB_KEY`;var Bu=Object.defineProperty,$u=Object.defineProperties,Ku=Object.getOwnPropertyDescriptors,Fu=Object.getOwnPropertySymbols,Vu=Object.prototype.hasOwnProperty,Hu=Object.prototype.propertyIsEnumerable,Wu=(t,e,r)=>e in t?Bu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gu=(t,e)=>{for(var r in e||(e={}))Vu.call(e,r)&&Wu(t,r,e[r]);if(Fu)for(var r of Fu(e))Hu.call(e,r)&&Wu(t,r,e[r]);return t},Ju=(t,e)=>$u(t,Ku(e));class Zu extends Lt{constructor(t){super(t),this.name="engine",this.events=new(y()),this.initialized=!1,this.requestQueue={state:qu,queue:[]},this.sessionRequestQueue={state:qu,queue:[]},this.requestQueueDelay=v.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Lu)}),this.initialized=!0,setTimeout((()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()}),(0,v.toMiliseconds)(this.requestQueueDelay)))},this.connect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const e=Ju(Gu({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(e);const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=e;let a,h=r,c=!1;try{h&&(c=this.client.core.pairing.pairings.get(h).active)}catch(t){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),t}if(!h||!c){const{topic:t,uri:e}=await this.client.core.pairing.create();h=t,a=e}if(!h){const{message:t}=Ro("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(t)}const u=await this.client.core.crypto.generateKeyPair(),f=Lu.wc_sessionPropose.req.ttl||v.FIVE_MINUTES,d=ts(f),l=Gu({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:u,metadata:this.client.metadata},expiryTimestamp:d,pairingTopic:h},s&&{sessionProperties:s}),{reject:p,resolve:g,done:m}=Zn(f,"Proposal expired");this.events.once(rs("session_connect"),(async({error:t,session:e})=>{if(t)p(t);else if(e){e.self.publicKey=u;const t=Ju(Gu({},e),{pairingTopic:l.pairingTopic,requiredNamespaces:l.requiredNamespaces,optionalNamespaces:l.optionalNamespaces,transportType:$a.relay});await this.client.session.set(e.topic,t),await this.setExpiry(e.topic,e.expiry),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:e.peer.metadata}),this.cleanupDuplicatePairings(t),g(t)}}));const b=await this.sendRequest({topic:h,method:"wc_sessionPropose",params:l,throwOnFailedPublish:!0});return await this.setProposal(b,Gu({id:b},l)),{uri:a,approval:m}},this.pair=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(t){throw this.client.logger.error("pair() failed"),t}},this.approve=async t=>{var e,r,i;const n=this.client.core.eventClient.createEvent({properties:{topic:null==(e=t?.id)?void 0:e.toString(),trace:[ah]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(t){throw n.setError("no_internet_connection"),t}try{await this.isValidProposalId(t?.id)}catch(e){throw this.client.logger.error(`approve() -> proposal.get(${t?.id}) failed`),n.setError("proposal_not_found"),e}try{await this.isValidApprove(t)}catch(t){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError("session_approve_namespace_validation_failure"),t}const{id:s,relayProtocol:o,namespaces:a,sessionProperties:h,sessionConfig:c}=t,u=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:n.eventId});const{pairingTopic:f,proposer:d,requiredNamespaces:l,optionalNamespaces:p}=u;let g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:f});g||(g=null==(i=this.client.core.eventClient)?void 0:i.createEvent({type:ah,properties:{topic:f,trace:[ah,"session_namespaces_validation_success"]}}));const m=await this.client.core.crypto.generateKeyPair(),b=d.publicKey,y=await this.client.core.crypto.generateSharedKey(m,b),v=Gu(Gu({relay:{protocol:o??"irn"},namespaces:a,controller:{publicKey:m,metadata:this.client.metadata},expiry:ts(ku)},h&&{sessionProperties:h}),c&&{sessionConfig:c}),w=$a.relay;g.addTrace("subscribing_session_topic");try{await this.client.core.relayer.subscribe(y,{transportType:w})}catch(t){throw g.setError("subscribe_session_topic_failure"),t}g.addTrace("subscribe_session_topic_success");const _=Ju(Gu({},v),{topic:y,requiredNamespaces:l,optionalNamespaces:p,pairingTopic:f,acknowledged:!1,self:v.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:m,transportType:$a.relay});await this.client.session.set(y,_),g.addTrace("store_session");try{g.addTrace("publishing_session_settle"),await this.sendRequest({topic:y,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0}).catch((t=>{throw g?.setError("session_settle_publish_failure"),t})),g.addTrace("session_settle_publish_success"),g.addTrace("publishing_session_approve"),await this.sendResult({id:s,topic:f,result:{relay:{protocol:o??"irn"},responderPublicKey:m},throwOnFailedPublish:!0}).catch((t=>{throw g?.setError("session_approve_publish_failure"),t})),g.addTrace("session_approve_publish_success")}catch(t){throw this.client.logger.error(t),this.client.session.delete(y,Po("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(y),t}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:f,metadata:d.metadata}),await this.client.proposal.delete(s,Po("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}),await this.setExpiry(y,ts(ku)),{topic:y,acknowledged:()=>Promise.resolve(this.client.session.get(y))}},this.reject=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(t){throw this.client.logger.error("reject() -> isValidReject() failed"),t}const{id:e,reason:r}=t;let i;try{i=this.client.proposal.get(e).pairingTopic}catch(t){throw this.client.logger.error(`reject() -> proposal.get(${e}) failed`),t}i&&(await this.sendError({id:e,topic:i,error:r,rpcOpts:Lu.wc_sessionPropose.reject}),await this.client.proposal.delete(e,Po("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(t){throw this.client.logger.error("update() -> isValidUpdate() failed"),t}const{topic:e,namespaces:r}=t,{done:i,resolve:n,reject:s}=Zn(),o=sa(),a=oa().toString(),h=this.client.session.get(e).namespaces;return this.events.once(rs("session_update",o),(({error:t})=>{t?s(t):n()})),await this.client.session.update(e,{namespaces:r}),await this.sendRequest({topic:e,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch((t=>{this.client.logger.error(t),this.client.session.update(e,{namespaces:h}),s(t)})),{acknowledged:i}},this.extend=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(t){throw this.client.logger.error("extend() -> isValidExtend() failed"),t}const{topic:e}=t,r=sa(),{done:i,resolve:n,reject:s}=Zn();return this.events.once(rs("session_extend",r),(({error:t})=>{t?s(t):n()})),await this.setExpiry(e,ts(ku)),this.sendRequest({topic:e,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch((t=>{s(t)})),{acknowledged:i}},this.request=async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(t){throw this.client.logger.error("request() -> isValidRequest() failed"),t}const{chainId:e,request:i,topic:n,expiry:s=Lu.wc_sessionRequest.req.ttl}=t,o=this.client.session.get(n);o?.transportType===$a.relay&&await this.confirmOnlineStateOrThrow();const a=sa(),h=oa().toString(),{done:c,resolve:u,reject:f}=Zn(s,"Request expired. Please try again.");this.events.once(rs("session_request",a),(({error:t,result:e})=>{t?f(t):u(e)}));const d=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);return d?(await this.sendRequest({clientRpcId:a,relayRpcId:h,topic:n,method:"wc_sessionRequest",params:{request:Ju(Gu({},i),{expiryTimestamp:ts(s)}),chainId:e},expiry:s,throwOnFailedPublish:!0,appLink:d}).catch((t=>f(t))),this.client.events.emit("session_request_sent",{topic:n,request:i,chainId:e,id:a}),await c()):await Promise.all([new Promise((async t=>{await this.sendRequest({clientRpcId:a,relayRpcId:h,topic:n,method:"wc_sessionRequest",params:{request:Ju(Gu({},i),{expiryTimestamp:ts(s)}),chainId:e},expiry:s,throwOnFailedPublish:!0}).catch((t=>f(t))),this.client.events.emit("session_request_sent",{topic:n,request:i,chainId:e,id:a}),t()})),new Promise((async t=>{var e;if(null==(e=o.sessionConfig)||!e.disableDeepLink){const t=await async function(t,e){let r="";try{if(Kn()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(t){console.error(t)}return r}(this.client.core.storage,Tu);await async function({id:t,topic:e,wcDeepLink:i}){var n;try{if(!i)return;const s="string"==typeof i?JSON.parse(i):i,o=s?.href;if("string"!=typeof o)return;const a=function(t,e,r){const i=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let n=`${t}`;return n=t.startsWith("https://t.me")?`${n}${t.includes("?")?"&startapp=":"?startapp="}${function(t,e=!1){const r=Rn.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}(i,!0)}`:`${n}/wc?${i}`,n}(o,t,e),h=Fn();if(h===zn){if(null==(n=(0,Tr.getDocument)())||!n.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");a.startsWith("https://")||a.startsWith("http://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,typeof window<"u"&&(window.TelegramWebviewProxy||window.Telegram||window.TelegramWebviewProxyProto)?"_blank":"_self","noreferrer noopener")}else h===jn&&typeof(null==r.g?void 0:r.g.Linking)<"u"&&await r.g.Linking.openURL(a)}catch(t){console.error(t)}}({id:a,topic:n,wcDeepLink:t})}t()})),c()]).then((t=>t[2]))},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:e,response:r}=t,{id:i}=r,n=this.client.session.get(e);n.transportType===$a.relay&&await this.confirmOnlineStateOrThrow();const s=this.getAppLinkIfEnabled(n.peer.metadata,n.transportType);ya(r)?await this.sendResult({id:i,topic:e,result:r.result,throwOnFailedPublish:!0,appLink:s}):va(r)&&await this.sendError({id:i,topic:e,error:r.error,appLink:s}),this.cleanupAfterResponse(t)},this.ping=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(t){throw this.client.logger.error("ping() -> isValidPing() failed"),t}const{topic:e}=t;if(this.client.session.keys.includes(e)){const t=sa(),r=oa().toString(),{done:i,resolve:n,reject:s}=Zn();this.events.once(rs("session_ping",t),(({error:t})=>{t?s(t):n()})),await Promise.all([this.sendRequest({topic:e,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:t,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(e)&&await this.client.core.pairing.ping({topic:e})},this.emit=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:e,event:r,chainId:i}=t,n=oa().toString();await this.sendRequest({topic:e,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:e}=t;if(this.client.session.keys.includes(e))await this.sendRequest({topic:e,method:"wc_sessionDelete",params:Po("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:e,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=Ro("MISMATCHED_TOPIC",`Session or pairing topic not found: ${e}`);throw new Error(t)}await this.client.core.pairing.disconnect({topic:e})}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter((e=>function(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r);let s=!0;return!!Wn(n,i)&&(i.forEach((e=>{const{accounts:i,methods:n,events:o}=t.namespaces[e],a=Mo(i),h=r[e];Wn(Nn(e,h),a)&&Wn(h.methods,n)&&Wn(h.events,o)||(s=!1)})),s)}(e,t)))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(t,e)=>{var r;this.isInitialized(),this.isValidAuthenticate(t);const i=e&&this.client.core.linkModeSupportedApps.includes(e)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),n=i?$a.link_mode:$a.relay;n===$a.relay&&await this.confirmOnlineStateOrThrow();const{chains:s,statement:o="",uri:a,domain:h,nonce:c,type:u,exp:f,nbf:d,methods:l=[],expiry:p}=t,g=[...t.resources||[]],{topic:m,uri:b}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:n});this.client.logger.info({message:"Generated new pairing",pairing:{topic:m,uri:b}});const y=await this.client.core.crypto.generateKeyPair(),v=$s(y);if(await Promise.all([this.client.auth.authKeys.set(Du,{responseTopic:v,publicKey:y}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:m})]),await this.client.core.relayer.subscribe(v,{transportType:n}),this.client.logger.info(`sending request to new pairing topic: ${m}`),l.length>0){const{namespace:t}=Pn(s[0]);let e=Os(t,"request",l);Cs(g)&&(e=Ps(e,g.pop())),g.push(e)}const w=p&&p>Lu.wc_sessionAuthenticate.req.ttl?p:Lu.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:u??"caip122",chains:s,statement:o,aud:a,domain:h,version:"1",nonce:c,iat:(new Date).toISOString(),exp:f,nbf:d,resources:g},requester:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:ts(w)},M={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:s,methods:[...new Set(["personal_sign",...l])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:m,proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:ts(Lu.wc_sessionPropose.req.ttl)},{done:E,resolve:S,reject:I}=Zn(w,"Request expired"),A=async({error:t,session:e})=>{if(this.events.off(rs("session_request",O),x),t)I(t);else if(e){e.self.publicKey=y,await this.client.session.set(e.topic,e),await this.setExpiry(e.topic,e.expiry),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:e.peer.metadata});const t=this.client.session.get(e.topic);await this.deleteProposal(R),S({session:t})}},x=async t=>{var r,i,s;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),t.error){const e=Po("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return t.error.code===e.code?void 0:(this.events.off(rs("session_connect"),A),I(t.error.message))}await this.deleteProposal(R),this.events.off(rs("session_connect"),A);const{cacaos:o,responder:a}=t.result,h=[],c=[];for(const t of o){await Ms({cacao:t,projectId:this.client.core.projectId})||(this.client.logger.error(t,"Signature verification failed"),I(Po("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:e}=t,r=Cs(e.resources),i=[ws(e.iss)],n=_s(e.iss);if(r){const t=Ts(r),e=ks(r);h.push(...t),i.push(...e)}for(const t of i)c.push(`${t}:${n}`)}const u=await this.client.core.crypto.generateSharedKey(y,a.publicKey);let f;h.length>0&&(f={topic:u,acknowledged:!0,self:{publicKey:y,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:ts(ku),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:m,namespaces:Ao([...new Set(h)],[...new Set(c)]),transportType:n},await this.client.core.relayer.subscribe(u,{transportType:n}),await this.client.session.set(u,f),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:a.metadata}),f=this.client.session.get(u)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(i=a.metadata.redirect)&&i.linkMode&&null!=(s=a.metadata.redirect)&&s.universal&&e&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(u,{transportType:$a.link_mode})),S({auths:o,session:f})},O=sa(),R=sa();let P;this.events.once(rs("session_connect"),A),this.events.once(rs("session_request",O),x);try{if(i){const t=aa("wc_sessionAuthenticate",_,O);this.client.core.history.set(m,t);const r=await this.client.core.crypto.encode("",t,{type:2,encoding:zs});P=fo(e,m,r)}else await Promise.all([this.sendRequest({topic:m,method:"wc_sessionAuthenticate",params:_,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:m,method:"wc_sessionPropose",params:M,expiry:Lu.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:R})])}catch(t){throw this.events.off(rs("session_connect"),A),this.events.off(rs("session_request",O),x),t}return await this.setProposal(R,Gu({id:R},M)),await this.setAuthRequest(O,{request:Ju(Gu({},_),{verifyContext:{}}),pairingTopic:m,transportType:n}),{uri:P??b,response:E}},this.approveSessionAuthenticate=async t=>{const{id:e,auths:r}=t,i=this.client.core.eventClient.createEvent({properties:{topic:e.toString(),trace:["authenticated_session_approve_started"]}});try{this.isInitialized()}catch(t){throw i.setError("no_internet_connection"),t}const n=this.getPendingAuthRequest(e);if(!n)throw i.setError("authenticated_session_pending_request_not_found"),new Error(`Could not find pending auth request with id ${e}`);const s=n.transportType||$a.relay;s===$a.relay&&await this.confirmOnlineStateOrThrow();const o=n.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),h=$s(o),c={type:1,receiverPublicKey:o,senderPublicKey:a},u=[],f=[];for(const t of r){if(!await Ms({cacao:t,projectId:this.client.core.projectId})){i.setError("invalid_cacao");const t=Po("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:e,topic:h,error:t,encodeOpts:c}),new Error(t.message)}i.addTrace("cacaos_verified");const{p:r}=t,n=Cs(r.resources),s=[ws(r.iss)],o=_s(r.iss);if(n){const t=Ts(n),e=ks(n);u.push(...t),s.push(...e)}for(const t of s)f.push(`${t}:${o}`)}const d=await this.client.core.crypto.generateSharedKey(a,o);let l;if(i.addTrace("create_authenticated_session_topic"),u?.length>0){l={topic:d,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:o,metadata:n.requester.metadata},controller:o,expiry:ts(ku),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:n.pairingTopic,namespaces:Ao([...new Set(u)],[...new Set(f)]),transportType:s},i.addTrace("subscribing_authenticated_session_topic");try{await this.client.core.relayer.subscribe(d,{transportType:s})}catch(t){throw i.setError("subscribe_authenticated_session_topic_failure"),t}i.addTrace("subscribe_authenticated_session_topic_success"),await this.client.session.set(d,l),i.addTrace("store_authenticated_session"),await this.client.core.pairing.updateMetadata({topic:n.pairingTopic,metadata:n.requester.metadata})}i.addTrace("publishing_authenticated_session_approve");try{await this.sendResult({topic:h,id:e,result:{cacaos:r,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:c,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(n.requester.metadata,s)})}catch(t){throw i.setError("authenticated_session_approve_publish_failure"),t}return await this.client.auth.requests.delete(e,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:n.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:l}},this.rejectSessionAuthenticate=async t=>{this.isInitialized();const{id:e,reason:r}=t,i=this.getPendingAuthRequest(e);if(!i)throw new Error(`Could not find pending auth request with id ${e}`);i.transportType===$a.relay&&await this.confirmOnlineStateOrThrow();const n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=$s(n),a={type:1,receiverPublicKey:n,senderPublicKey:s};await this.sendError({id:e,topic:o,error:r,encodeOpts:a,rpcOpts:Lu.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(i.requester.metadata,i.transportType)}),await this.client.auth.requests.delete(e,{message:"rejected",code:0}),await this.client.proposal.delete(e,Po("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:e,iss:r}=t;return Es(e,r)},this.processRelayMessageCache=()=>{setTimeout((async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}}),50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const e=this.client.core.pairing.pairings.get(t.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter((r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===t.peer.metadata.url&&r.topic&&r.topic!==e.topic}));if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map((t=>this.client.core.pairing.disconnect({topic:t.topic})))),this.client.logger.info("Duplicate pairings clean up finished")}catch(t){this.client.logger.error(t)}},this.deleteSession=async t=>{var e;const{topic:r,expirerHasDeleted:i=!1,emitEvent:n=!0,id:s=0}=t,{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,Po("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),i||this.client.core.expirer.del(r),this.client.core.storage.removeItem(Tu).catch((t=>this.client.logger.warn(t))),this.getPendingSessionRequests().forEach((t=>{t.topic===r&&this.deletePendingSessionRequest(t.id,Po("USER_DISCONNECTED"))})),r===(null==(e=this.sessionRequestQueue.queue[0])?void 0:e.topic)&&(this.sessionRequestQueue.state=qu),n&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(t,e)=>{if(e)try{const e=this.client.proposal.get(t),r=this.client.core.eventClient.getEvent({topic:e.pairingTopic});r?.setError("proposal_expired")}catch{}await Promise.all([this.client.proposal.delete(t,Po("USER_DISCONNECTED")),e?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,e,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,e),r?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter((e=>e.id!==t)),r&&(this.sessionRequestQueue.state=qu,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,e,r=!1)=>{await Promise.all([this.client.auth.requests.delete(t,e),r?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,e)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,e),await this.client.session.update(t,{expiry:e}))},this.setProposal=async(t,e)=>{this.client.core.expirer.set(t,ts(Lu.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,e)},this.setAuthRequest=async(t,e)=>{const{request:r,pairingTopic:i,transportType:n=$a.relay}=e;this.client.core.expirer.set(t,r.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:t,pairingTopic:i,verifyContext:r.verifyContext,transportType:n})},this.setPendingSessionRequest=async t=>{const{id:e,topic:r,params:i,verifyContext:n}=t,s=i.request.expiryTimestamp||ts(Lu.wc_sessionRequest.req.ttl);this.client.core.expirer.set(e,s),await this.client.pendingRequest.set(e,{id:e,topic:r,params:i,verifyContext:n})},this.sendRequest=async t=>{const{topic:e,method:i,params:n,expiry:s,relayRpcId:o,clientRpcId:a,throwOnFailedPublish:h,appLink:c}=t,u=aa(i,n,a);let f;const d=!!c;try{const t=d?zs:js;f=await this.client.core.crypto.encode(e,u,{encoding:t})}catch(t){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${e} failed`),t}let l;if(ju.includes(i)){const t=Ks(JSON.stringify(u)),e=Ks(f);l=await this.client.core.verify.register({id:e,decryptedId:t})}const p=Lu[i].req;if(p.attestation=l,s&&(p.ttl=s),o&&(p.id=o),this.client.core.history.set(e,u),d){const t=fo(c,e,f);await r.g.Linking.openURL(t,this.client.name)}else{const t=Lu[i].req;s&&(t.ttl=s),o&&(t.id=o),h?(t.internal=Ju(Gu({},t.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(e,f,t)):this.client.core.relayer.publish(e,f,t).catch((t=>this.client.logger.error(t)))}return u.id},this.sendResult=async t=>{const{id:e,topic:i,result:n,throwOnFailedPublish:s,encodeOpts:o,appLink:a}=t,h=ha(e,n);let c;const u=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const t=u?zs:js;c=await this.client.core.crypto.encode(i,h,Ju(Gu({},o||{}),{encoding:t}))}catch(t){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),t}let f;try{f=await this.client.core.history.get(i,e)}catch(t){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${e}) failed`),t}if(u){const t=fo(a,i,c);await r.g.Linking.openURL(t,this.client.name)}else{const t=Lu[f.request.method].res;s?(t.internal=Ju(Gu({},t.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,c,t)):this.client.core.relayer.publish(i,c,t).catch((t=>this.client.logger.error(t)))}await this.client.core.history.resolve(h)},this.sendError=async t=>{const{id:e,topic:i,error:n,encodeOpts:s,rpcOpts:o,appLink:a}=t,h=ca(e,n);let c;const u=a&&typeof(null==r.g?void 0:r.g.Linking)<"u";try{const t=u?zs:js;c=await this.client.core.crypto.encode(i,h,Ju(Gu({},s||{}),{encoding:t}))}catch(t){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),t}let f;try{f=await this.client.core.history.get(i,e)}catch(t){throw this.client.logger.error(`sendError() -> history.get(${i}, ${e}) failed`),t}if(u){const t=fo(a,i,c);await r.g.Linking.openURL(t,this.client.name)}else{const t=o||Lu[f.request.method].res;this.client.core.relayer.publish(i,c,t)}await this.client.core.history.resolve(h)},this.cleanup=async()=>{const t=[],e=[];this.client.session.getAll().forEach((e=>{let r=!1;es(e.expiry)&&(r=!0),this.client.core.crypto.keychain.has(e.topic)||(r=!0),r&&t.push(e.topic)})),this.client.proposal.getAll().forEach((t=>{es(t.expiryTimestamp)&&e.push(t.id)})),await Promise.all([...t.map((t=>this.deleteSession({topic:t}))),...e.map((t=>this.deleteProposal(t)))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state!==Uu){for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Uu;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(t){this.client.logger.warn(t)}}this.requestQueue.state=qu}else this.client.logger.info("Request queue already active, skipping...")},this.processRequest=async t=>{const{topic:e,payload:r,attestation:i,transportType:n,encryptedId:s}=t,o=r.method;if(!this.shouldIgnorePairingRequest({topic:e,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:e,payload:r,attestation:i,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(e,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(e,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(e,r);case"wc_sessionPing":return await this.onSessionPingRequest(e,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(e,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:e,payload:r,attestation:i,encryptedId:s,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(e,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:e,payload:r,attestation:i,encryptedId:s,transportType:n});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async t=>{const{topic:e,payload:r,transportType:i}=t,n=(await this.client.core.history.get(e,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(e,r,i);case"wc_sessionSettle":return this.onSessionSettleResponse(e,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(e,r);case"wc_sessionExtend":return this.onSessionExtendResponse(e,r);case"wc_sessionPing":return this.onSessionPingResponse(e,r);case"wc_sessionRequest":return this.onSessionRequestResponse(e,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(e,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:e}=t,{message:r}=Ro("MISSING_OR_INVALID",`Decoded payload on topic ${e} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)},this.shouldIgnorePairingRequest=t=>{const{topic:e,requestMethod:r}=t,i=this.expectedPairingMethodMap.get(e);return!(!i||i.includes(r)||!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0))},this.onSessionProposeRequest=async t=>{const{topic:e,payload:r,attestation:i,encryptedId:n}=t,{params:s,id:o}=r;try{const t=this.client.core.eventClient.getEvent({topic:e});this.isValidConnect(Gu({},r.params));const a=s.expiryTimestamp||ts(Lu.wc_sessionPropose.req.ttl),h=Gu({id:o,pairingTopic:e,expiryTimestamp:a},s);await this.setProposal(o,h);const c=await this.getVerifyContext({attestationId:i,hash:Ks(JSON.stringify(r)),encryptedId:n,metadata:h.proposer.metadata});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),t?.setError("proposal_listener_not_found")),t?.addTrace("emit_session_proposal"),this.client.events.emit("session_proposal",{id:o,params:h,verifyContext:c})}catch(t){await this.sendError({id:o,topic:e,error:t,rpcOpts:Lu.wc_sessionPropose.autoReject}),this.client.logger.error(t)}},this.onSessionProposeResponse=async(t,e,r)=>{const{id:i}=e;if(ya(e)){const{result:n}=e;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});const s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const o=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const a=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const h=await this.client.core.crypto.generateSharedKey(o,a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:h});const c=await this.client.core.relayer.subscribe(h,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:t})}else if(va(e)){await this.client.proposal.delete(i,Po("USER_DISCONNECTED"));const t=rs("session_connect");if(0===this.events.listenerCount(t))throw new Error(`emitting ${t} without any listeners, 954`);this.events.emit(rs("session_connect"),{error:e.error})}},this.onSessionSettleRequest=async(t,e)=>{const{id:r,params:i}=e;try{this.isValidSessionSettleRequest(i);const{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,sessionConfig:h}=e.params,c=Ju(Gu(Gu({topic:t,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),h&&{sessionConfig:h}),{transportType:$a.relay}),u=rs("session_connect");if(0===this.events.listenerCount(u))throw new Error(`emitting ${u} without any listeners 997`);this.events.emit(rs("session_connect"),{session:c}),await this.sendResult({id:e.id,topic:t,result:!0,throwOnFailedPublish:!0})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionSettleResponse=async(t,e)=>{const{id:r}=e;ya(e)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(rs("session_approve",r),{})):va(e)&&(await this.client.session.delete(t,Po("USER_DISCONNECTED")),this.events.emit(rs("session_approve",r),{error:e.error}))},this.onSessionUpdateRequest=async(t,e)=>{const{params:r,id:i}=e;try{const e=`${t}_session_update`,n=Wo.get(e);if(n&&this.isRequestOutOfSync(n,i))return this.client.logger.info(`Discarding out of sync request - ${i}`),void this.sendError({id:i,topic:t,error:Po("INVALID_UPDATE_REQUEST")});this.isValidUpdate(Gu({topic:t},r));try{Wo.set(e,i),await this.client.session.update(t,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0})}catch(t){throw Wo.delete(e),t}this.client.events.emit("session_update",{id:i,topic:t,params:r})}catch(e){await this.sendError({id:i,topic:t,error:e}),this.client.logger.error(e)}},this.isRequestOutOfSync=(t,e)=>parseInt(e.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,e)=>{const{id:r}=e,i=rs("session_update",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);ya(e)?this.events.emit(rs("session_update",r),{}):va(e)&&this.events.emit(rs("session_update",r),{error:e.error})},this.onSessionExtendRequest=async(t,e)=>{const{id:r}=e;try{this.isValidExtend({topic:t}),await this.setExpiry(t,ts(ku)),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:t})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionExtendResponse=(t,e)=>{const{id:r}=e,i=rs("session_extend",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);ya(e)?this.events.emit(rs("session_extend",r),{}):va(e)&&this.events.emit(rs("session_extend",r),{error:e.error})},this.onSessionPingRequest=async(t,e)=>{const{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:t})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionPingResponse=(t,e)=>{const{id:r}=e,i=rs("session_ping",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);setTimeout((()=>{ya(e)?this.events.emit(rs("session_ping",r),{}):va(e)&&this.events.emit(rs("session_ping",r),{error:e.error})}),500)},this.onSessionDeleteRequest=async(t,e)=>{const{id:r}=e;try{this.isValidDisconnect({topic:t,reason:e.params}),Promise.all([new Promise((e=>{this.client.core.relayer.once(qa,(async()=>{e(await this.deleteSession({topic:t,id:r}))}))})),this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:Po("USER_DISCONNECTED")})]).catch((t=>this.client.logger.error(t)))}catch(t){this.client.logger.error(t)}},this.onSessionRequest=async t=>{var e,r,i;const{topic:n,payload:s,attestation:o,encryptedId:a,transportType:h}=t,{id:c,params:u}=s;try{await this.isValidRequest(Gu({topic:n},u));const t=this.client.session.get(n),s={id:c,topic:n,params:u,verifyContext:await this.getVerifyContext({attestationId:o,hash:Ks(JSON.stringify(aa("wc_sessionRequest",u,c))),encryptedId:a,metadata:t.peer.metadata,transportType:h})};await this.setPendingSessionRequest(s),h===$a.link_mode&&null!=(e=t.peer.metadata.redirect)&&e.universal&&this.client.core.addLinkModeSupportedApp(null==(r=t.peer.metadata.redirect)?void 0:r.universal),null!=(i=this.client.signConfig)&&i.disableRequestQueue?this.emitSessionRequest(s):(this.addSessionRequestToSessionRequestQueue(s),this.processSessionRequestQueue())}catch(t){await this.sendError({id:c,topic:n,error:t}),this.client.logger.error(t)}},this.onSessionRequestResponse=(t,e)=>{const{id:r}=e,i=rs("session_request",r);if(0===this.events.listenerCount(i))throw new Error(`emitting ${i} without any listeners`);ya(e)?this.events.emit(rs("session_request",r),{result:e.result}):va(e)&&this.events.emit(rs("session_request",r),{error:e.error})},this.onSessionEventRequest=async(t,e)=>{const{id:r,params:i}=e;try{const e=`${t}_session_event_${i.event.name}`,n=Wo.get(e);if(n&&this.isRequestOutOfSync(n,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(Gu({topic:t},i)),this.client.events.emit("session_event",{id:r,topic:t,params:i}),Wo.set(e,r)}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionAuthenticateResponse=(t,e)=>{const{id:r}=e;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:e}),ya(e)?this.events.emit(rs("session_request",r),{result:e.result}):va(e)&&this.events.emit(rs("session_request",r),{error:e.error})},this.onSessionAuthenticateRequest=async t=>{var e;const{topic:r,payload:i,attestation:n,encryptedId:s,transportType:o}=t;try{const{requester:t,authPayload:a,expiryTimestamp:h}=i.params,c=await this.getVerifyContext({attestationId:n,hash:Ks(JSON.stringify(i)),encryptedId:s,metadata:t.metadata,transportType:o}),u={requester:t,pairingTopic:r,id:i.id,authPayload:a,verifyContext:c,expiryTimestamp:h};await this.setAuthRequest(i.id,{request:u,pairingTopic:r,transportType:o}),o===$a.link_mode&&null!=(e=t.metadata.redirect)&&e.universal&&this.client.core.addLinkModeSupportedApp(t.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:i.params,id:i.id,verifyContext:c})}catch(t){this.client.logger.error(t);const e=i.params.requester.publicKey,n=await this.client.core.crypto.generateKeyPair(),s=this.getAppLinkIfEnabled(i.params.requester.metadata,o),a={type:1,receiverPublicKey:e,senderPublicKey:n};await this.sendError({id:i.id,topic:r,error:t,encodeOpts:a,rpcOpts:Lu.wc_sessionAuthenticate.autoReject,appLink:s})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout((()=>{this.sessionRequestQueue.state=qu,this.processSessionRequestQueue()}),(0,v.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:e})=>{const r=this.client.core.history.pending;r.length>0&&r.filter((e=>e.topic===t&&"wc_sessionRequest"===e.request.method)).forEach((t=>{const r=rs("session_request",t.request.id);if(0===this.events.listenerCount(r))throw new Error(`emitting ${r} without any listeners`);this.events.emit(rs("session_request",t.request.id),{error:e})}))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Uu)return void this.client.logger.info("session request queue is already active.");const t=this.sessionRequestQueue.queue[0];if(t)try{this.sessionRequestQueue.state=Uu,this.emitSessionRequest(t)}catch(t){this.client.logger.error(t)}else this.client.logger.info("session request queue is empty.")},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const e=this.client.proposal.getAll().find((e=>e.pairingTopic===t.topic));e&&this.onSessionProposeRequest({topic:t.topic,payload:aa("wc_sessionPropose",{requiredNamespaces:e.requiredNamespaces,optionalNamespaces:e.optionalNamespaces,relays:e.relays,proposer:e.proposer,sessionProperties:e.sessionProperties},e.id)})},this.isValidConnect=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(e)}const{pairingTopic:e,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=t;if(ko(e)||await this.isValidPairingTopic(e),!function(t){let e=!1;return t?t&&No(t)&&t.length&&t.forEach((t=>{e=Do(t)})):e=!0,e}(s)){const{message:t}=Ro("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(t)}!ko(r)&&0!==To(r)&&this.validateNamespaces(r,"requiredNamespaces"),!ko(i)&&0!==To(i)&&this.validateNamespaces(i,"optionalNamespaces"),ko(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(t,e)=>{const r=function(t,e,r){let i=null;if(t&&To(t)){const n=jo(t,e);n&&(i=n);const s=function(t,e,r){let i=null;return Object.entries(t).forEach((([t,n])=>{if(i)return;const s=function(t,e,r){let i=null;return No(e)&&e.length?e.forEach((t=>{i||qo(t)||(i=Po("UNSUPPORTED_CHAINS",`${r}, chain ${t} should be a string and conform to "namespace:chainId" format`))})):qo(t)||(i=Po("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}(t,Nn(t,n),`${e} ${r}`);s&&(i=s)})),i}(t,e,r);s&&(i=s)}else i=Ro("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}(t,"connect()",e);if(r)throw new Error(r.message)},this.isValidApprove=async t=>{if(!Bo(t))throw new Error(Ro("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:e,namespaces:r,relayProtocol:i,sessionProperties:n}=t;this.checkRecentlyDeleted(e),await this.isValidProposalId(e);const s=this.client.proposal.get(e),o=zo(r,"approve()");if(o)throw new Error(o.message);const a=Ko(s.requiredNamespaces,r,"approve()");if(a)throw new Error(a.message);if(!Lo(i,!0)){const{message:t}=Ro("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw new Error(t)}ko(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(e)}const{id:e,reason:r}=t;if(this.checkRecentlyDeleted(e),await this.isValidProposalId(e),!function(t){return!!(t&&"object"==typeof t&&t.code&&Co(t.code,!1)&&t.message&&Lo(t.message,!1))}(r)){const{message:t}=Ro("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidSessionSettleRequest=t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(e)}const{relay:e,controller:r,namespaces:i,expiry:n}=t;if(!Do(e)){const{message:t}=Ro("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(t)}const s=function(t){let e=null;return Lo(t?.publicKey,!1)||(e=Ro("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),e}(r);if(s)throw new Error(s.message);const o=zo(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);if(es(n)){const{message:t}=Ro("EXPIRED","onSessionSettleRequest()");throw new Error(t)}},this.isValidUpdate=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(e)}const{topic:e,namespaces:r}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const i=this.client.session.get(e),n=zo(r,"update()");if(n)throw new Error(n.message);const s=Ko(i.requiredNamespaces,r,"update()");if(s)throw new Error(s.message)},this.isValidExtend=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(e)}const{topic:e}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e)},this.isValidRequest=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(e)}const{topic:e,request:r,chainId:i,expiry:n}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);const{namespaces:s}=this.client.session.get(e);if(!$o(s,i)){const{message:t}=Ro("MISSING_OR_INVALID",`request() chainId: ${i}`);throw new Error(t)}if(!function(t){return!(ko(t)||!Lo(t.method,!1))}(r)){const{message:t}=Ro("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(t)}if(!function(t,e,r){return!!Lo(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{Mo(t.accounts).includes(e)&&r.push(...t.methods)})),r}(t,e).includes(r)}(s,i,r.method)){const{message:t}=Ro("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(t)}if(n&&!function(t,e){return Co(t,!1)&&t<=e.max&&t>=e.min}(n,Cu)){const{message:t}=Ro("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${Cu.min} and ${Cu.max}`);throw new Error(t)}},this.isValidRespond=async t=>{var e;if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(e)}const{topic:r,response:i}=t;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(e=t?.response)&&e.id&&this.cleanupAfterResponse(t),r}if(!function(t){return!(ko(t)||ko(t.result)&&ko(t.error)||!Co(t.id,!1)||!Lo(t.jsonrpc,!1))}(i)){const{message:t}=Ro("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(t)}},this.isValidPing=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidEmit=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(e)}const{topic:e,event:r,chainId:i}=t;await this.isValidSessionTopic(e);const{namespaces:n}=this.client.session.get(e);if(!$o(n,i)){const{message:t}=Ro("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw new Error(t)}if(!function(t){return!(ko(t)||!Lo(t.name,!1))}(r)){const{message:t}=Ro("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(t)}if(!function(t,e,r){return!!Lo(r,!1)&&function(t,e){const r=[];return Object.values(t).forEach((t=>{Mo(t.accounts).includes(e)&&r.push(...t.events)})),r}(t,e).includes(r)}(n,i,r.name)){const{message:t}=Ro("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(t)}},this.isValidDisconnect=async t=>{if(!Bo(t)){const{message:e}=Ro("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(e)}const{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidAuthenticate=t=>{const{chains:e,uri:r,domain:i,nonce:n}=t;if(!Array.isArray(e)||0===e.length)throw new Error("chains is required and must be a non-empty array");if(!Lo(r,!1))throw new Error("uri is required parameter");if(!Lo(i,!1))throw new Error("domain is required parameter");if(!Lo(n,!1))throw new Error("nonce is required parameter");if([...new Set(e.map((t=>Pn(t).namespace)))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=Pn(e[0]);if("eip155"!==s)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async t=>{const{attestationId:e,hash:r,encryptedId:i,metadata:n,transportType:s}=t,o={verified:{verifyUrl:n.verifyUrl||ih,validation:"UNKNOWN",origin:n.url||""}};try{if(s===$a.link_mode){const t=this.getAppLinkIfEnabled(n,s);return o.verified.validation=t&&new URL(t).origin===new URL(n.url).origin?"VALID":"INVALID",o}const t=await this.client.core.verify.resolve({attestationId:e,hash:r,encryptedId:i,verifyUrl:n.verifyUrl});t&&(o.verified.origin=t.origin,o.verified.isScam=t.isScam,o.verified.validation=t.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(t){this.client.logger.warn(t)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(t,e)=>{Object.values(t).forEach((t=>{if(!Lo(t,!1)){const{message:r}=Ro("MISSING_OR_INVALID",`${e} must be in Record format. Received: ${JSON.stringify(t)}`);throw new Error(r)}}))},this.getPendingAuthRequest=t=>{const e=this.client.auth.requests.get(t);return"object"==typeof e?e:void 0},this.addToRecentlyDeleted=(t,e)=>{if(this.recentlyDeletedMap.set(t,e),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let t=0;const e=this.recentlyDeletedLimit/2;for(const r of this.recentlyDeletedMap.keys()){if(t++>=e)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=t=>{const e=this.recentlyDeletedMap.get(t);if(e){const{message:r}=Ro("MISSING_OR_INVALID",`Record was recently deleted - ${e}: ${t}`);throw new Error(r)}},this.isLinkModeEnabled=(t,e)=>{var i,n,s,o,a,h,c,u,f;return!(!t||e!==$a.link_mode)&&!0===(null==(n=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:n.linkMode)&&void 0!==(null==(o=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:o.universal)&&""!==(null==(h=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:h.universal)&&void 0!==(null==(c=t?.redirect)?void 0:c.universal)&&""!==(null==(u=t?.redirect)?void 0:u.universal)&&!0===(null==(f=t?.redirect)?void 0:f.linkMode)&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(null==r.g?void 0:r.g.Linking)<"u"},this.getAppLinkIfEnabled=(t,e)=>{var r;return this.isLinkModeEnabled(t,e)?null==(r=t?.redirect)?void 0:r.universal:void 0},this.handleLinkModeMessage=({url:t})=>{if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const e=ss(t,"topic")||"",r=decodeURIComponent(ss(t,"wc_ev")||""),i=this.client.session.keys.includes(e);i&&this.client.session.update(e,{transportType:$a.link_mode}),this.client.core.dispatchEnvelope({topic:e,message:r,sessionExists:i})},this.registerLinkModeListeners=async()=>{var t;if(as()||$n()&&null!=(t=this.client.metadata.redirect)&&t.linkMode){const t=null==r.g?void 0:r.g.Linking;if(typeof t<"u"){t.addEventListener("url",this.handleLinkModeMessage,this.client.name);const e=await t.getInitialURL();e&&setTimeout((()=>{this.handleLinkModeMessage({url:e})}),50)}}}}isInitialized(){if(!this.initialized){const{message:t}=Ro("NOT_INITIALIZED",this.name);throw new Error(t)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(ka,(t=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(t):this.onRelayMessage(t)}))}async onRelayMessage(t){const{topic:e,message:r,attestation:i,transportType:n}=t,{publicKey:s}=this.client.auth.authKeys.keys.includes(Du)?this.client.auth.authKeys.get(Du):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(e,r,{receiverPublicKey:s,encoding:n===$a.link_mode?zs:js});try{ma(o)?(this.client.core.history.set(e,o),this.onRelayEventRequest({topic:e,payload:o,attestation:i,transportType:n,encryptedId:Ks(r)})):ba(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:e,payload:o,transportType:n}),this.client.core.history.delete(e,o.id)):this.onRelayEventUnknownPayload({topic:e,payload:o,transportType:n})}catch(t){this.client.logger.error(t)}}registerExpirerEvents(){this.client.core.expirer.on(eh,(async t=>{const{topic:e,id:r}=Qn(t.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,Ro("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,Ro("EXPIRED"),!0):void(e?this.client.session.keys.includes(e)&&(await this.deleteSession({topic:e,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:e})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))}))}registerPairingEvents(){this.client.core.pairing.events.on(Ga,(t=>this.onPairingCreated(t))),this.client.core.pairing.events.on(Ja,(t=>{this.addToRecentlyDeleted(t.topic,"pairing")}))}isValidPairingTopic(t){if(!Lo(t,!1)){const{message:e}=Ro("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(e)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=Ro("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(e)}if(es(this.client.core.pairing.pairings.get(t).expiry)){const{message:e}=Ro("EXPIRED",`pairing topic: ${t}`);throw new Error(e)}}async isValidSessionTopic(t){if(!Lo(t,!1)){const{message:e}=Ro("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(e)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){const{message:e}=Ro("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(e)}if(es(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});const{message:e}=Ro("EXPIRED",`session topic: ${t}`);throw new Error(e)}if(!this.client.core.crypto.keychain.has(t)){const{message:e}=Ro("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(e)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else{if(!this.client.core.pairing.pairings.keys.includes(t)){if(Lo(t,!1)){const{message:e}=Ro("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(e)}{const{message:e}=Ro("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(e)}}this.isValidPairingTopic(t)}}async isValidProposalId(t){if("number"!=typeof t){const{message:e}=Ro("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(e)}if(!this.client.proposal.keys.includes(t)){const{message:e}=Ro("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(e)}if(es(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);const{message:e}=Ro("EXPIRED",`proposal id: ${t}`);throw new Error(e)}}}class Yu extends hu{constructor(t,e){super(t,e,"proposal",Pu),this.core=t,this.logger=e}}class Xu extends hu{constructor(t,e){super(t,e,"session",Pu),this.core=t,this.logger=e}}class Qu extends hu{constructor(t,e){super(t,e,"request",Pu,(t=>t.id)),this.core=t,this.logger=e}}class tf extends hu{constructor(t,e){super(t,e,"authKeys",zu,(()=>Du)),this.core=t,this.logger=e}}class ef extends hu{constructor(t,e){super(t,e,"pairingTopics",zu),this.core=t,this.logger=e}}class rf extends hu{constructor(t,e){super(t,e,"requests",zu,(t=>t.id)),this.core=t,this.logger=e}}class nf{constructor(t,e){this.core=t,this.logger=e,this.authKeys=new tf(this.core,this.logger),this.pairingTopics=new ef(this.core,this.logger),this.requests=new rf(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class sf extends kt{constructor(t){super(t),this.protocol="wc",this.version=2,this.name=Nu,this.events=new b.EventEmitter,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.removeAllListeners=t=>this.events.removeAllListeners(t),this.connect=async t=>{try{return await this.engine.connect(t)}catch(t){throw this.logger.error(t.message),t}},this.pair=async t=>{try{return await this.engine.pair(t)}catch(t){throw this.logger.error(t.message),t}},this.approve=async t=>{try{return await this.engine.approve(t)}catch(t){throw this.logger.error(t.message),t}},this.reject=async t=>{try{return await this.engine.reject(t)}catch(t){throw this.logger.error(t.message),t}},this.update=async t=>{try{return await this.engine.update(t)}catch(t){throw this.logger.error(t.message),t}},this.extend=async t=>{try{return await this.engine.extend(t)}catch(t){throw this.logger.error(t.message),t}},this.request=async t=>{try{return await this.engine.request(t)}catch(t){throw this.logger.error(t.message),t}},this.respond=async t=>{try{return await this.engine.respond(t)}catch(t){throw this.logger.error(t.message),t}},this.ping=async t=>{try{return await this.engine.ping(t)}catch(t){throw this.logger.error(t.message),t}},this.emit=async t=>{try{return await this.engine.emit(t)}catch(t){throw this.logger.error(t.message),t}},this.disconnect=async t=>{try{return await this.engine.disconnect(t)}catch(t){throw this.logger.error(t.message),t}},this.find=t=>{try{return this.engine.find(t)}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.authenticate=async(t,e)=>{try{return await this.engine.authenticate(t,e)}catch(t){throw this.logger.error(t.message),t}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSessionAuthenticate=async t=>{try{return await this.engine.approveSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSessionAuthenticate=async t=>{try{return await this.engine.rejectSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.name=t?.name||Nu,this.metadata=t?.metadata||Vn(),this.signConfig=t?.signConfig;const e=typeof t?.logger<"u"&&"string"!=typeof t?.logger?t.logger:rt()(yt({level:t?.logger||"error"}));this.core=t?.core||new Ou(t),this.logger=wt(e,this.name),this.session=new Xu(this.core,this.logger),this.proposal=new Yu(this.core,this.logger),this.pendingRequest=new Qu(this.core,this.logger),this.engine=new Zu(this),this.auth=new nf(this.core,this.logger)}static async init(t){const e=new sf(t);return await e.initialize(),e}get context(){return vt(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}const of=Xu,af=sf;var hf,cf={exports:{}},uf="object"==typeof Reflect?Reflect:null,ff=uf&&"function"==typeof uf.apply?uf.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};hf=uf&&"function"==typeof uf.ownKeys?uf.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var df=Number.isNaN||function(t){return t!=t};function lf(){lf.init.call(this)}cf.exports=lf,cf.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}Ef(t,e,s,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&Ef(t,"error",e,{once:!0})}(t,n)}))},lf.EventEmitter=lf,lf.prototype._events=void 0,lf.prototype._eventsCount=0,lf.prototype._maxListeners=void 0;var pf=10;function gf(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function mf(t){return void 0===t._maxListeners?lf.defaultMaxListeners:t._maxListeners}function bf(t,e,r,i){var n,s,o;if(gf(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=mf(t))>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,function(t){console&&console.warn&&console.warn(t)}(a)}return t}function yf(){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 vf(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=yf.bind(i);return n.listener=r,i.wrapFn=n,n}function wf(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)ff(a,this,e);else{var h=a.length,c=Mf(a,h);for(r=0;r=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},lf.prototype.listeners=function(t){return wf(this,t,!0)},lf.prototype.rawListeners=function(t){return wf(this,t,!1)},lf.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):_f.call(t,e)},lf.prototype.listenerCount=_f,lf.prototype.eventNames=function(){return this._eventsCount>0?hf(this._events):[]};cf.exports;class Sf{constructor(t){this.opts=t}}class If{constructor(t){this.client=t}}var Af=Object.defineProperty,xf=Object.defineProperties,Of=Object.getOwnPropertyDescriptors,Rf=Object.getOwnPropertySymbols,Pf=Object.prototype.hasOwnProperty,Nf=Object.prototype.propertyIsEnumerable,Tf=(t,e,r)=>e in t?Af(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;class kf extends If{constructor(t){super(t),this.init=async()=>{this.signClient=await af.init({core:this.client.core,metadata:this.client.metadata,signConfig:this.client.signConfig})},this.pair=async t=>{await this.client.core.pairing.pair(t)},this.approveSession=async t=>{const{topic:e,acknowledged:r}=await this.signClient.approve(((t,e)=>xf(t,Of(e)))(((t,e)=>{for(var r in e||(e={}))Pf.call(e,r)&&Tf(t,r,e[r]);if(Rf)for(var r of Rf(e))Nf.call(e,r)&&Tf(t,r,e[r]);return t})({},t),{id:t.id,namespaces:t.namespaces,sessionProperties:t.sessionProperties,sessionConfig:t.sessionConfig}));return await r(),this.signClient.session.get(e)},this.rejectSession=async t=>await this.signClient.reject(t),this.updateSession=async t=>await this.signClient.update(t),this.extendSession=async t=>await this.signClient.extend(t),this.respondSessionRequest=async t=>await this.signClient.respond(t),this.disconnectSession=async t=>await this.signClient.disconnect(t),this.emitSessionEvent=async t=>await this.signClient.emit(t),this.getActiveSessions=()=>this.signClient.session.getAll().reduce(((t,e)=>(t[e.topic]=e,t)),{}),this.getPendingSessionProposals=()=>this.signClient.proposal.getAll(),this.getPendingSessionRequests=()=>this.signClient.getPendingSessionRequests(),this.approveSessionAuthenticate=async t=>await this.signClient.approveSessionAuthenticate(t),this.rejectSessionAuthenticate=async t=>await this.signClient.rejectSessionAuthenticate(t),this.formatAuthMessage=t=>this.signClient.formatAuthMessage(t),this.registerDeviceToken=t=>this.client.core.echoClient.registerDeviceToken(t),this.on=(t,e)=>(this.setEvent(t,"off"),this.setEvent(t,"on"),this.client.events.on(t,e)),this.once=(t,e)=>(this.setEvent(t,"off"),this.setEvent(t,"once"),this.client.events.once(t,e)),this.off=(t,e)=>(this.setEvent(t,"off"),this.client.events.off(t,e)),this.removeListener=(t,e)=>(this.setEvent(t,"removeListener"),this.client.events.removeListener(t,e)),this.onSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onSessionProposal=t=>{this.client.events.emit("session_proposal",t)},this.onSessionDelete=t=>{this.client.events.emit("session_delete",t)},this.onProposalExpire=t=>{this.client.events.emit("proposal_expire",t)},this.onSessionRequestExpire=t=>{this.client.events.emit("session_request_expire",t)},this.onSessionRequestAuthenticate=t=>{this.client.events.emit("session_authenticate",t)},this.setEvent=(t,e)=>{switch(t){case"session_request":this.signClient.events[e]("session_request",this.onSessionRequest);break;case"session_proposal":this.signClient.events[e]("session_proposal",this.onSessionProposal);break;case"session_delete":this.signClient.events[e]("session_delete",this.onSessionDelete);break;case"proposal_expire":this.signClient.events[e]("proposal_expire",this.onProposalExpire);break;case"session_request_expire":this.signClient.events[e]("session_request_expire",this.onSessionRequestExpire);break;case"session_authenticate":this.signClient.events[e]("session_authenticate",this.onSessionRequestAuthenticate)}},this.signClient={}}}const Lf={decryptMessage:async t=>{const e={core:new Ou({storageOptions:t.storageOptions,storage:t.storage})};await e.core.crypto.init();const r=e.core.crypto.decode(t.topic,t.encryptedMessage);return e.core=null,r},getMetadata:async t=>{const e={core:new Ou({storageOptions:t.storageOptions,storage:t.storage}),sessionStore:null};e.sessionStore=new of(e.core,e.core.logger),await e.sessionStore.init();const r=e.sessionStore.get(t.topic),i=r?.peer.metadata;return e.core=null,e.sessionStore=null,i}},Cf=class extends Sf{constructor(t){super(t),this.events=new cf.exports,this.on=(t,e)=>this.engine.on(t,e),this.once=(t,e)=>this.engine.once(t,e),this.off=(t,e)=>this.engine.off(t,e),this.removeListener=(t,e)=>this.engine.removeListener(t,e),this.pair=async t=>{try{return await this.engine.pair(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSession=async t=>{try{return await this.engine.approveSession(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSession=async t=>{try{return await this.engine.rejectSession(t)}catch(t){throw this.logger.error(t.message),t}},this.updateSession=async t=>{try{return await this.engine.updateSession(t)}catch(t){throw this.logger.error(t.message),t}},this.extendSession=async t=>{try{return await this.engine.extendSession(t)}catch(t){throw this.logger.error(t.message),t}},this.respondSessionRequest=async t=>{try{return await this.engine.respondSessionRequest(t)}catch(t){throw this.logger.error(t.message),t}},this.disconnectSession=async t=>{try{return await this.engine.disconnectSession(t)}catch(t){throw this.logger.error(t.message),t}},this.emitSessionEvent=async t=>{try{return await this.engine.emitSessionEvent(t)}catch(t){throw this.logger.error(t.message),t}},this.getActiveSessions=()=>{try{return this.engine.getActiveSessions()}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionProposals=()=>{try{return this.engine.getPendingSessionProposals()}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.registerDeviceToken=t=>{try{return this.engine.registerDeviceToken(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSessionAuthenticate=t=>{try{return this.engine.approveSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSessionAuthenticate=t=>{try{return this.engine.rejectSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(t){throw this.logger.error(t.message),t}},this.metadata=t.metadata,this.name=t.name||"WalletKit",this.signConfig=t.signConfig,this.core=t.core,this.logger=this.core.logger,this.engine=new kf(this)}static async init(t){const e=new Cf(t);return await e.initialize(),e}async initialize(){this.logger.trace("Initialized");try{await this.engine.init(),this.logger.info("WalletKit Initialization Success")}catch(t){throw this.logger.info("WalletKit Initialization Failure"),this.logger.error(t.message),t}}};let qf=Cf;qf.notifications=Lf;const Uf=qf;window.wc={core:null,walletKit:null,statusObject:null,init:function(t){return new Promise((async(e,r)=>{if(!window.statusq){const t='missing window.statusq! Forgot to execute "ui/app/AppLayouts/Wallet/services/dapps/helpers.js" first?';console.error(t),r(t)}if(window.statusq.error){const t="Failed initializing WebChannel: "+window.statusq.error;console.error(t),r(t)}if(wc.statusObject=window.statusq.channel.objects.statusObject,!wc.statusObject){const t="Failed initializing WebChannel or initialization not run";console.error(t),r(t)}try{const r=new Ou({projectId:t});window.wc.walletKit=await Uf.init({core:r,metadata:{name:"Status",description:"Status Wallet",url:"http://localhost",icons:["https://avatars.githubusercontent.com/u/11767950"]}}),window.wc.core=r,window.wc.walletKit.on("session_proposal",(t=>{wc.statusObject.onSessionProposal(t)})),window.wc.walletKit.on("session_update",(t=>{wc.statusObject.onSessionUpdate(t)})),window.wc.walletKit.on("session_extend",(t=>{wc.statusObject.onSessionExtend(t)})),window.wc.walletKit.on("session_ping",(t=>{wc.statusObject.onSessionPing(t)})),window.wc.walletKit.on("session_delete",(t=>{wc.statusObject.onSessionDelete(t)})),window.wc.walletKit.on("session_expire",(t=>{wc.statusObject.onSessionExpire(t)})),window.wc.walletKit.on("session_request",(t=>{wc.statusObject.onSessionRequest(t)})),window.wc.walletKit.on("session_request_sent",(t=>{wc.statusObject.onSessionRequestSent(t)})),window.wc.walletKit.on("session_event",(t=>{wc.statusObject.onSessionEvent(t)})),window.wc.walletKit.on("proposal_expire",(t=>{wc.statusObject.onProposalExpire(t)})),window.wc.walletKit.on("pairing_expire",(t=>{wc.statusObject.echo("debug",`WC unhandled event: "pairing_expire" ${JSON.stringify(t)}`)})),window.wc.walletKit.on("session_request_expire",(t=>{const{id:e}=t;wc.statusObject.onSessionRequestExpire(e)})),window.wc.core.relayer.on("relayer_connect",(()=>{wc.statusObject.echo("debug",'WC unhandled event: "relayer_connect" connection to the relay server is established')})),window.wc.core.relayer.on("relayer_disconnect",(()=>{wc.statusObject.echo("debug",'WC unhandled event: "relayer_disconnect" connection to the relay server is lost')})),window.wc.walletKit.on("session_authenticate",(t=>{wc.statusObject.onSessionAuthenticate(t)})),e("")}catch(t){r(t)}}))},pair:async function(t){await window.wc.walletKit.pair({uri:t})},getPairings:function(){return window.wc.walletKit.core.pairing.getPairings()},getActiveSessions:function(){return window.wc.walletKit.getActiveSessions()},disconnect:async function(t){await window.wc.walletKit.disconnectSession({topic:t,reason:Po("USER_DISCONNECTED")})},ping:async function(t){await window.wc.walletKit.engine.signClient.ping({topic:t})},buildApprovedNamespaces:async function(t,e){return function(t){const{proposal:{requiredNamespaces:e,optionalNamespaces:r={}},supportedNamespaces:i}=t,n=Io(e),s=Io(r),o={};Object.keys(i).forEach((t=>{const e=i[t].chains,r=i[t].methods,n=i[t].events,s=i[t].accounts;e.forEach((e=>{if(!s.some((t=>t.includes(e))))throw new Error(`No accounts provided for chain ${e} in namespace ${t}`)})),o[t]={chains:e,methods:r,events:n,accounts:s}}));const a=Ko(e,o,"approve()");if(a)throw new Error(a.message);const h={};return Object.keys(e).length||Object.keys(r).length?(Object.keys(n).forEach((t=>{const e=i[t].chains.filter((e=>{var r,i;return null==(i=null==(r=n[t])?void 0:r.chains)?void 0:i.includes(e)})),r=i[t].methods.filter((e=>{var r,i;return null==(i=null==(r=n[t])?void 0:r.methods)?void 0:i.includes(e)})),s=i[t].events.filter((e=>{var r,i;return null==(i=null==(r=n[t])?void 0:r.events)?void 0:i.includes(e)})),o=e.map((e=>i[t].accounts.filter((t=>t.includes(`${e}:`))))).flat();h[t]={chains:e,methods:r,events:s,accounts:o}})),Object.keys(s).forEach((t=>{var e,r,n,o,a,c;if(!i[t])return;const u=null==(r=null==(e=s[t])?void 0:e.chains)?void 0:r.filter((e=>i[t].chains.includes(e))),f=i[t].methods.filter((e=>{var r,i;return null==(i=null==(r=s[t])?void 0:r.methods)?void 0:i.includes(e)})),d=i[t].events.filter((e=>{var r,i;return null==(i=null==(r=s[t])?void 0:r.events)?void 0:i.includes(e)})),l=u?.map((e=>i[t].accounts.filter((t=>t.includes(`${e}:`))))).flat();h[t]={chains:is(null==(n=h[t])?void 0:n.chains,u),methods:is(null==(o=h[t])?void 0:o.methods,f),events:is(null==(a=h[t])?void 0:a.events,d),accounts:is(null==(c=h[t])?void 0:c.accounts,l)}})),h):o}({proposal:t,supportedNamespaces:e})},approveSession:async function(t,e){const{id:r,params:i}=t,{relays:n}=i;return await window.wc.walletKit.approveSession({id:r,relayProtocol:n[0].protocol,namespaces:e})},rejectSession:async function(t){await window.wc.walletKit.rejectSession({id:t,reason:Po("USER_REJECTED")})},respondSessionRequest:async function(t,e,r){const i=ha(e,r);await window.wc.walletKit.respondSessionRequest({topic:t,response:i})},rejectSessionRequest:async function(t,e,r=!1){const i=r?"SESSION_SETTLEMENT_FAILED":"USER_REJECTED";await window.wc.walletKit.respondSessionRequest({topic:t,response:ca(e,Po(i))})},populateAuthPayload:async function(t,e,r){return function(t){var e;const{authPayload:r,chains:i,methods:n}=t,s=r.statement||"";if(null==i||!i.length)return r;const o=ns(r.chains,i);if(null==o||!o.length)throw new Error("No supported chains");const a=function(t){const e=Cs(t);if(e&&Rs(e))return xs(e)}(r.resources);if(!a)return r;Ss(a);const h=function(t,e){var r,i;return null!=(r=t?.att)&&r[e]?Object.keys(null==(i=t?.att)?void 0:i[e]):[]}(a,"eip155");let c=r?.resources||[];if(null!=h&&h.length){const t=function(t){return t?.map((t=>{var e;return null==(e=t.split("/"))?void 0:e[1]}))||[]}(h),i=ns(t,n);if(null==i||!i.length)throw new Error(`Supported methods don't satisfy the requested: ${JSON.stringify(t)}, supported: ${JSON.stringify(n)}`);const s=function(t,e,r){var i;return t.att.eip155=bs({},r),(null==(i=Object.keys(t.att))?void 0:i.sort(((t,e)=>t.localeCompare(e)))).reduce(((e,r)=>(e.att[r]=t.att[r],e)),{att:{}})}(a,0,Is("request",i,{chains:o}));c=(null==(e=r?.resources)?void 0:e.slice(0,-1))||[],c.push(As(s))}return ys(bs({},r),{statement:Ls(s,Cs(c)),chains:o,resources:null!=r&&r.resources||c.length>0?c:void 0})}({authPayload:t,chains:e,methods:r})},formatAuthMessage:async function(t,e){return wc.walletKit.formatAuthMessage({request:t,iss:e})},buildAuthObject:async function(t,e,r){return function(t,e,r){return r.includes("did:pkh:")||(r=`did:pkh:${r}`),{h:{t:"caip122"},p:{iss:r,domain:t.domain,aud:t.aud,version:t.version,nonce:t.nonce,iat:t.iat,statement:t.statement,requestId:t.requestId,resources:t.resources,nbf:t.nbf,exp:t.exp},s:e}}(t,{t:"eip191",s:e},r)},acceptSessionAuthenticate:async function(t,e){await window.wc.walletKit.approveSessionAuthenticate({id:t,auths:e})},rejectSessionAuthenticate:async function(t,e){await window.wc.walletKit.rejectSessionAuthenticate({id:t,reason:Po("USER_REJECTED")})}}; \ No newline at end of file diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js.LICENSE.txt b/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js.LICENSE.txt index 91bb8bbcaf..50b4af984e 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js.LICENSE.txt +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/generated/bundle.js.LICENSE.txt @@ -1,3 +1,10 @@ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,6 +20,8 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json index b812fae235..a87b198782 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package-lock.json @@ -9,10 +9,10 @@ "version": "0.1.0", "license": "MPL-2.0", "dependencies": { - "@reown/walletkit": "^1.1.0", - "@walletconnect/core": "^2.17.0", - "@walletconnect/jsonrpc-utils": "^1.0.8", - "@walletconnect/utils": "^2.17.0" + "@reown/walletkit": "^1.1.1", + "@walletconnect/core": "^2.17.1", + "@walletconnect/utils": "^2.17.1", + "buffer": "^6.0.3" }, "devDependencies": { "webpack": "^5.95.0", @@ -22,23 +22,372 @@ }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" } }, - "node_modules/@ioredis/commands": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", - "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bignumber/node_modules/bn.js": { + "version": "5.2.1", + "license": "MIT" + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT" + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key/node_modules/bn.js": { + "version": "5.2.1", + "license": "MIT" + }, + "node_modules/@ethersproject/signing-key/node_modules/elliptic": { + "version": "6.5.4", + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/@ethersproject/signing-key/node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "license": "MIT" + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -50,43 +399,38 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "version": "1.5.0", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -94,15 +438,12 @@ }, "node_modules/@leichtgewicht/ip-codec": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", - "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@parcel/watcher": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.3.0.tgz", - "integrity": "sha512-pW7QaFiL11O0BphO+bq3MgqeX/INAk9jgBldVDYjlQPO4VddoZnF22TcF9onMhnLVHuNqBJeRf+Fj7eezi/+rQ==", - "hasInstallScript": true, + "version": "2.4.1", + "license": "MIT", "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", @@ -117,46 +458,26 @@ "url": "https://opencollective.com/parcel" }, "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.3.0", - "@parcel/watcher-darwin-arm64": "2.3.0", - "@parcel/watcher-darwin-x64": "2.3.0", - "@parcel/watcher-freebsd-x64": "2.3.0", - "@parcel/watcher-linux-arm-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-musl": "2.3.0", - "@parcel/watcher-linux-x64-glibc": "2.3.0", - "@parcel/watcher-linux-x64-musl": "2.3.0", - "@parcel/watcher-win32-arm64": "2.3.0", - "@parcel/watcher-win32-ia32": "2.3.0", - "@parcel/watcher-win32-x64": "2.3.0" - } - }, - "node_modules/@parcel/watcher-android-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.3.0.tgz", - "integrity": "sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "@parcel/watcher-android-arm64": "2.4.1", + "@parcel/watcher-darwin-arm64": "2.4.1", + "@parcel/watcher-darwin-x64": "2.4.1", + "@parcel/watcher-freebsd-x64": "2.4.1", + "@parcel/watcher-linux-arm-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-musl": "2.4.1", + "@parcel/watcher-linux-x64-glibc": "2.4.1", + "@parcel/watcher-linux-x64-musl": "2.4.1", + "@parcel/watcher-win32-arm64": "2.4.1", + "@parcel/watcher-win32-ia32": "2.4.1", + "@parcel/watcher-win32-x64": "2.4.1" } }, "node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.3.0.tgz", - "integrity": "sha512-mKY+oijI4ahBMc/GygVGvEdOq0L4DxhYgwQqYAz/7yPzuGi79oXrZG52WdpGA1wLBPrYb0T8uBaGFo7I6rvSKw==", + "version": "2.4.1", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -169,146 +490,12 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/@parcel/watcher-darwin-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.3.0.tgz", - "integrity": "sha512-20oBj8LcEOnLE3mgpy6zuOq8AplPu9NcSSSfyVKgfOhNAc4eF4ob3ldj0xWjGGbOF7Dcy1Tvm6ytvgdjlfUeow==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.3.0.tgz", - "integrity": "sha512-7LftKlaHunueAEiojhCn+Ef2CTXWsLgTl4hq0pkhkTBFI3ssj2bJXmH2L67mKpiAD5dz66JYk4zS66qzdnIOgw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.3.0.tgz", - "integrity": "sha512-1apPw5cD2xBv1XIHPUlq0cO6iAaEUQ3BcY0ysSyD9Kuyw4MoWm1DV+W9mneWI+1g6OeP6dhikiFE6BlU+AToTQ==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.3.0.tgz", - "integrity": "sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.3.0.tgz", - "integrity": "sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.3.0.tgz", - "integrity": "sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.3.0.tgz", - "integrity": "sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/@parcel/watcher-wasm": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.3.0.tgz", - "integrity": "sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==", + "version": "2.4.1", "bundleDependencies": [ "napi-wasm" ], + "license": "MIT", "dependencies": { "is-glob": "^4.0.3", "micromatch": "^4.0.5", @@ -327,115 +514,37 @@ "inBundle": true, "license": "MIT" }, - "node_modules/@parcel/watcher-win32-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.3.0.tgz", - "integrity": "sha512-35gXCnaz1AqIXpG42evcoP2+sNL62gZTMZne3IackM+6QlfMcJLy3DrjuL6Iks7Czpd3j4xRBzez3ADCj1l7Aw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-ia32": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.3.0.tgz", - "integrity": "sha512-FJS/IBQHhRpZ6PiCjFt1UAcPr0YmCLHRbTc00IBTrelEjlmmgIVLeOx4MSXzx2HFEy5Jo5YdhGpxCuqCyDJ5ow==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.3.0.tgz", - "integrity": "sha512-dLx+0XRdMnVI62kU3wbXvbIRhLck4aE28bIGKbRGS7BJNt54IIj9+c/Dkqb+7DJEbHUZAX1bwaoM8PqVlHJmCA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/@reown/walletkit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@reown/walletkit/-/walletkit-1.1.0.tgz", - "integrity": "sha512-KAWbA2H0MzsrqU680/tQ3ecm23Ip5scClzzgQD7/u3c+FlSYDlGToz7SqIShpeoDT1ZI+WepoKUdkkA8UXUtJQ==", + "version": "1.1.1", + "license": "Apache-2.0", "dependencies": { - "@walletconnect/core": "2.17.0", + "@walletconnect/core": "2.17.1", "@walletconnect/jsonrpc-provider": "1.0.14", "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/logger": "2.1.2", - "@walletconnect/sign-client": "2.17.0", - "@walletconnect/types": "2.17.0", - "@walletconnect/utils": "2.17.0" - } - }, - "node_modules/@reown/walletkit/node_modules/@walletconnect/sign-client": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.17.0.tgz", - "integrity": "sha512-sErYwvSSHQolNXni47L3Bm10ptJc1s1YoJvJd34s5E9h9+d3rj7PrhbiW9X82deN+Dm5oA8X9tC4xty1yIBrVg==", - "dependencies": { - "@walletconnect/core": "2.17.0", - "@walletconnect/events": "1.0.1", - "@walletconnect/heartbeat": "1.2.2", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/logger": "2.1.2", - "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.17.0", - "@walletconnect/utils": "2.17.0", - "events": "3.3.0" + "@walletconnect/sign-client": "2.17.1", + "@walletconnect/types": "2.17.1", + "@walletconnect/utils": "2.17.1" } }, "node_modules/@stablelib/aead": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/aead/-/aead-1.0.1.tgz", - "integrity": "sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==" + "license": "MIT" }, "node_modules/@stablelib/binary": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "license": "MIT", "dependencies": { "@stablelib/int": "^1.0.1" } }, "node_modules/@stablelib/bytes": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz", - "integrity": "sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==" + "license": "MIT" }, "node_modules/@stablelib/chacha": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -443,8 +552,7 @@ }, "node_modules/@stablelib/chacha20poly1305": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz", - "integrity": "sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==", + "license": "MIT", "dependencies": { "@stablelib/aead": "^1.0.1", "@stablelib/binary": "^1.0.1", @@ -456,13 +564,11 @@ }, "node_modules/@stablelib/constant-time": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz", - "integrity": "sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==" + "license": "MIT" }, "node_modules/@stablelib/ed25519": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@stablelib/ed25519/-/ed25519-1.0.3.tgz", - "integrity": "sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==", + "license": "MIT", "dependencies": { "@stablelib/random": "^1.0.2", "@stablelib/sha512": "^1.0.1", @@ -471,13 +577,11 @@ }, "node_modules/@stablelib/hash": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hash/-/hash-1.0.1.tgz", - "integrity": "sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==" + "license": "MIT" }, "node_modules/@stablelib/hkdf": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hkdf/-/hkdf-1.0.1.tgz", - "integrity": "sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==", + "license": "MIT", "dependencies": { "@stablelib/hash": "^1.0.1", "@stablelib/hmac": "^1.0.1", @@ -486,8 +590,7 @@ }, "node_modules/@stablelib/hmac": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/hmac/-/hmac-1.0.1.tgz", - "integrity": "sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==", + "license": "MIT", "dependencies": { "@stablelib/constant-time": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -496,21 +599,18 @@ }, "node_modules/@stablelib/int": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + "license": "MIT" }, "node_modules/@stablelib/keyagreement": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz", - "integrity": "sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==", + "license": "MIT", "dependencies": { "@stablelib/bytes": "^1.0.1" } }, "node_modules/@stablelib/poly1305": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/poly1305/-/poly1305-1.0.1.tgz", - "integrity": "sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==", + "license": "MIT", "dependencies": { "@stablelib/constant-time": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -518,8 +618,7 @@ }, "node_modules/@stablelib/random": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@stablelib/random/-/random-1.0.2.tgz", - "integrity": "sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/wipe": "^1.0.1" @@ -527,8 +626,7 @@ }, "node_modules/@stablelib/sha256": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha256/-/sha256-1.0.1.tgz", - "integrity": "sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -537,8 +635,7 @@ }, "node_modules/@stablelib/sha512": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/sha512/-/sha512-1.0.1.tgz", - "integrity": "sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==", + "license": "MIT", "dependencies": { "@stablelib/binary": "^1.0.1", "@stablelib/hash": "^1.0.1", @@ -547,13 +644,11 @@ }, "node_modules/@stablelib/wipe": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + "license": "MIT" }, "node_modules/@stablelib/x25519": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@stablelib/x25519/-/x25519-1.0.3.tgz", - "integrity": "sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==", + "license": "MIT", "dependencies": { "@stablelib/keyagreement": "^1.0.1", "@stablelib/random": "^1.0.2", @@ -562,9 +657,8 @@ }, "node_modules/@types/body-parser": { "version": "1.19.5", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", - "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "dev": true, + "license": "MIT", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -572,27 +666,24 @@ }, "node_modules/@types/bonjour": { "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz", - "integrity": "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/connect": { "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", - "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/connect-history-api-fallback": { "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz", - "integrity": "sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==", "dev": true, + "license": "MIT", "dependencies": { "@types/express-serve-static-core": "*", "@types/node": "*" @@ -600,15 +691,13 @@ }, "node_modules/@types/estree": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/express": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", - "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -617,10 +706,20 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.41", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", - "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", + "version": "5.0.0", "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/express/node_modules/@types/express-serve-static-core": { + "version": "4.19.6", + "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -630,72 +729,62 @@ }, "node_modules/@types/http-errors": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/http-proxy": { - "version": "1.17.14", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz", - "integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==", + "version": "1.17.15", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/json-schema": { "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/mime": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "20.10.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", - "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==", + "version": "22.7.5", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/node-forge": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.10.tgz", - "integrity": "sha512-y6PJDYN4xYBxwd22l+OVH35N+1fCYWiuC3aiP2SlXVE6Lo7SS+rSx9r89hLxrP4pn6n1lBGhHJ12pj3F3Mpttw==", + "version": "1.3.11", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/qs": { - "version": "6.9.10", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", - "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==", - "dev": true + "version": "6.9.16", + "dev": true, + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/retry": { "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", - "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/send": { "version": "0.17.4", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", - "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "dev": true, + "license": "MIT", "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -703,46 +792,52 @@ }, "node_modules/@types/serve-index": { "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz", - "integrity": "sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==", "dev": true, + "license": "MIT", "dependencies": { "@types/express": "*" } }, - "node_modules/@types/serve-static": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", - "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "node_modules/@types/serve-index/node_modules/@types/express": { + "version": "5.0.0", "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "dev": true, + "license": "MIT", "dependencies": { "@types/http-errors": "*", - "@types/mime": "*", - "@types/node": "*" + "@types/node": "*", + "@types/send": "*" } }, "node_modules/@types/sockjs": { "version": "0.3.36", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", - "integrity": "sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.12", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@walletconnect/core": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.17.0.tgz", - "integrity": "sha512-On+uSaCfWdsMIQsECwWHZBmUXfrnqmv6B8SXRRuTJgd8tUpEvBkLQH4X7XkSm3zW6ozEkQTCagZ2ox2YPn3kbw==", + "version": "2.17.1", + "license": "Apache-2.0", "dependencies": { "@walletconnect/heartbeat": "1.2.2", "@walletconnect/jsonrpc-provider": "1.0.14", @@ -755,8 +850,9 @@ "@walletconnect/relay-auth": "1.0.4", "@walletconnect/safe-json": "1.0.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.17.0", - "@walletconnect/utils": "2.17.0", + "@walletconnect/types": "2.17.1", + "@walletconnect/utils": "2.17.1", + "@walletconnect/window-getters": "1.0.1", "events": "3.3.0", "lodash.isequal": "4.5.0", "uint8arrays": "3.1.0" @@ -765,26 +861,16 @@ "node": ">=18" } }, - "node_modules/@walletconnect/core/node_modules/uint8arrays": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.0.tgz", - "integrity": "sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==", - "dependencies": { - "multiformats": "^9.4.2" - } - }, "node_modules/@walletconnect/environment": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/environment/-/environment-1.0.1.tgz", - "integrity": "sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==", + "license": "MIT", "dependencies": { "tslib": "1.14.1" } }, "node_modules/@walletconnect/events": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/events/-/events-1.0.1.tgz", - "integrity": "sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==", + "license": "MIT", "dependencies": { "keyvaluestorage-interface": "^1.0.0", "tslib": "1.14.1" @@ -792,8 +878,7 @@ }, "node_modules/@walletconnect/heartbeat": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.2.tgz", - "integrity": "sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==", + "license": "MIT", "dependencies": { "@walletconnect/events": "^1.0.1", "@walletconnect/time": "^1.0.2", @@ -802,8 +887,7 @@ }, "node_modules/@walletconnect/jsonrpc-provider": { "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.14.tgz", - "integrity": "sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==", + "license": "MIT", "dependencies": { "@walletconnect/jsonrpc-utils": "^1.0.8", "@walletconnect/safe-json": "^1.0.2", @@ -812,8 +896,7 @@ }, "node_modules/@walletconnect/jsonrpc-types": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz", - "integrity": "sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==", + "license": "MIT", "dependencies": { "events": "^3.3.0", "keyvaluestorage-interface": "^1.0.0" @@ -821,8 +904,7 @@ }, "node_modules/@walletconnect/jsonrpc-utils": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.8.tgz", - "integrity": "sha512-vdeb03bD8VzJUL6ZtzRYsFMq1eZQcM3EAzT0a3st59dyLfJ0wq+tKMpmGH7HlB7waD858UWgfIcudbPFsbzVdw==", + "license": "MIT", "dependencies": { "@walletconnect/environment": "^1.0.1", "@walletconnect/jsonrpc-types": "^1.0.3", @@ -831,8 +913,7 @@ }, "node_modules/@walletconnect/jsonrpc-ws-connection": { "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.14.tgz", - "integrity": "sha512-Jsl6fC55AYcbkNVkwNM6Jo+ufsuCQRqViOQ8ZBPH9pRREHH9welbBiszuTLqEJiQcO/6XfFDl6bzCJIkrEi8XA==", + "license": "MIT", "dependencies": { "@walletconnect/jsonrpc-utils": "^1.0.6", "@walletconnect/safe-json": "^1.0.2", @@ -840,10 +921,28 @@ "ws": "^7.5.1" } }, + "node_modules/@walletconnect/jsonrpc-ws-connection/node_modules/ws": { + "version": "7.5.10", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/@walletconnect/keyvaluestorage": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", - "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", + "license": "MIT", "dependencies": { "@walletconnect/safe-json": "^1.0.1", "idb-keyval": "^6.2.1", @@ -860,8 +959,7 @@ }, "node_modules/@walletconnect/logger": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@walletconnect/logger/-/logger-2.1.2.tgz", - "integrity": "sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw==", + "license": "MIT", "dependencies": { "@walletconnect/safe-json": "^1.0.2", "pino": "7.11.0" @@ -869,16 +967,14 @@ }, "node_modules/@walletconnect/relay-api": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@walletconnect/relay-api/-/relay-api-1.0.11.tgz", - "integrity": "sha512-tLPErkze/HmC9aCmdZOhtVmYZq1wKfWTJtygQHoWtgg722Jd4homo54Cs4ak2RUFUZIGO2RsOpIcWipaua5D5Q==", + "license": "MIT", "dependencies": { "@walletconnect/jsonrpc-types": "^1.0.2" } }, "node_modules/@walletconnect/relay-auth": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@walletconnect/relay-auth/-/relay-auth-1.0.4.tgz", - "integrity": "sha512-kKJcS6+WxYq5kshpPaxGHdwf5y98ZwbfuS4EE/NkQzqrDFm5Cj+dP8LofzWvjrrLkZq7Afy7WrQMXdLy8Sx7HQ==", + "license": "MIT", "dependencies": { "@stablelib/ed25519": "^1.0.2", "@stablelib/random": "^1.0.1", @@ -888,26 +984,45 @@ "uint8arrays": "^3.0.0" } }, + "node_modules/@walletconnect/relay-auth/node_modules/uint8arrays": { + "version": "3.1.1", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, "node_modules/@walletconnect/safe-json": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@walletconnect/safe-json/-/safe-json-1.0.2.tgz", - "integrity": "sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==", + "license": "MIT", "dependencies": { "tslib": "1.14.1" } }, + "node_modules/@walletconnect/sign-client": { + "version": "2.17.1", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/core": "2.17.1", + "@walletconnect/events": "1.0.1", + "@walletconnect/heartbeat": "1.2.2", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/logger": "2.1.2", + "@walletconnect/time": "1.0.2", + "@walletconnect/types": "2.17.1", + "@walletconnect/utils": "2.17.1", + "events": "3.3.0" + } + }, "node_modules/@walletconnect/time": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@walletconnect/time/-/time-1.0.2.tgz", - "integrity": "sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==", + "license": "MIT", "dependencies": { "tslib": "1.14.1" } }, "node_modules/@walletconnect/types": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.17.0.tgz", - "integrity": "sha512-i1pn9URpvt9bcjRDkabuAmpA9K7mzyKoLJlbsAujRVX7pfaG7wur7u9Jz0bk1HxvuABL5LHNncTnVKSXKQ5jZA==", + "version": "2.17.1", + "license": "Apache-2.0", "dependencies": { "@walletconnect/events": "1.0.1", "@walletconnect/heartbeat": "1.2.2", @@ -918,48 +1033,41 @@ } }, "node_modules/@walletconnect/utils": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.17.0.tgz", - "integrity": "sha512-1aeQvjwsXy4Yh9G6g2eGmXrEl+BzkNjHRdCrGdMYqFTFa8ROEJfTGsSH3pLsNDlOY94CoBUvJvM55q/PMoN/FQ==", + "version": "2.17.1", + "license": "Apache-2.0", "dependencies": { + "@ethersproject/hash": "5.7.0", + "@ethersproject/transactions": "5.7.0", "@stablelib/chacha20poly1305": "1.0.1", "@stablelib/hkdf": "1.0.1", "@stablelib/random": "1.0.2", "@stablelib/sha256": "1.0.1", "@stablelib/x25519": "1.0.3", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/keyvaluestorage": "1.1.1", "@walletconnect/relay-api": "1.0.11", "@walletconnect/relay-auth": "1.0.4", "@walletconnect/safe-json": "1.0.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.17.0", + "@walletconnect/types": "2.17.1", "@walletconnect/window-getters": "1.0.1", "@walletconnect/window-metadata": "1.0.1", "detect-browser": "5.3.0", - "elliptic": "^6.5.7", + "elliptic": "6.5.7", "query-string": "7.1.3", "uint8arrays": "3.1.0" } }, - "node_modules/@walletconnect/utils/node_modules/uint8arrays": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.0.tgz", - "integrity": "sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==", - "dependencies": { - "multiformats": "^9.4.2" - } - }, "node_modules/@walletconnect/window-getters": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", - "integrity": "sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==", + "license": "MIT", "dependencies": { "tslib": "1.14.1" } }, "node_modules/@walletconnect/window-metadata": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz", - "integrity": "sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==", + "license": "MIT", "dependencies": { "@walletconnect/window-getters": "^1.0.1", "tslib": "1.14.1" @@ -967,9 +1075,8 @@ }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", - "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6" @@ -977,27 +1084,23 @@ }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", - "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -1006,15 +1109,13 @@ }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", - "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-buffer": "1.12.1", @@ -1024,33 +1125,29 @@ }, "node_modules/@webassemblyjs/ieee754": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, + "license": "MIT", "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", - "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-buffer": "1.12.1", @@ -1064,9 +1161,8 @@ }, "node_modules/@webassemblyjs/wasm-gen": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", - "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", @@ -1077,9 +1173,8 @@ }, "node_modules/@webassemblyjs/wasm-opt": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", - "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-buffer": "1.12.1", @@ -1089,9 +1184,8 @@ }, "node_modules/@webassemblyjs/wasm-parser": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", - "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", @@ -1103,9 +1197,8 @@ }, "node_modules/@webassemblyjs/wast-printer": { "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", - "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, + "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" @@ -1113,9 +1206,8 @@ }, "node_modules/@webpack-cli/configtest": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", - "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.15.0" }, @@ -1126,9 +1218,8 @@ }, "node_modules/@webpack-cli/info": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", - "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.15.0" }, @@ -1139,9 +1230,8 @@ }, "node_modules/@webpack-cli/serve": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", - "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.15.0" }, @@ -1157,21 +1247,18 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@xtuc/long": { "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/accepts": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -1181,9 +1268,8 @@ } }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.12.1", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -1193,23 +1279,21 @@ }, "node_modules/acorn-import-attributes": { "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^8" } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.17.1", "dev": true, + "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -1218,9 +1302,8 @@ }, "node_modules/ajv-formats": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^8.0.0" }, @@ -1233,53 +1316,31 @@ } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "version": "5.1.0", "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, "peerDependencies": { - "ajv": "^6.9.1" + "ajv": "^8.8.2" } }, "node_modules/ansi-html-community": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", - "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", "dev": true, "engines": [ "node >= 0.8.0" ], + "license": "Apache-2.0", "bin": { "ansi-html": "bin/ansi-html" } }, "node_modules/anymatch": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1288,10 +1349,20 @@ "node": ">= 8" } }, - "node_modules/arch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", - "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "node_modules/array-flatten": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", "funding": [ { "type": "github", @@ -1305,46 +1376,32 @@ "type": "consulting", "url": "https://feross.org/support" } - ] - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "dev": true - }, - "node_modules/atomic-sleep": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", - "engines": { - "node": ">=8.0.0" - } + ], + "license": "MIT" }, "node_modules/batch": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/bn.js": { "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "license": "MIT" }, "node_modules/body-parser": { "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -1364,35 +1421,10 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/bonjour-service": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.2.1.tgz", - "integrity": "sha512-oSzCS2zV14bh2kji6vNe7vrpJYCHGvcZnlffFQ1MEoX/WOeQ/teD8SYWKR942OI3INjq8OMNJlbPK5LLLUxFDw==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "multicast-dns": "^7.2.5" @@ -1400,8 +1432,7 @@ }, "node_modules/braces": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -1411,13 +1442,10 @@ }, "node_modules/brorand": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + "license": "MIT" }, "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "version": "4.24.0", "dev": true, "funding": [ { @@ -1433,11 +1461,12 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001663", + "electron-to-chromium": "^1.5.28", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -1446,17 +1475,37 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "6.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bundle-name": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", - "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", "dev": true, + "license": "MIT", "dependencies": { "run-applescript": "^7.0.0" }, @@ -1468,19 +1517,17 @@ } }, "node_modules/bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "version": "3.1.2", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/call-bind": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -1496,9 +1543,7 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001565", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz", - "integrity": "sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==", + "version": "1.0.30001668", "dev": true, "funding": [ { @@ -1513,12 +1558,12 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chokidar": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -1539,33 +1584,30 @@ } }, "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0" } }, "node_modules/citty": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.5.tgz", - "integrity": "sha512-AS7n5NSc0OQVMV9v6wt3ByujNIrne0/cTjiC2MYqhvao57VNfiuVksTSr2p17nVOhEr2KtqiAkGwHcgMC/qUuQ==", + "version": "0.1.6", + "license": "MIT", "dependencies": { "consola": "^3.2.3" } }, "node_modules/clipboardy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-3.0.0.tgz", - "integrity": "sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==", + "version": "4.0.0", + "license": "MIT", "dependencies": { - "arch": "^2.2.0", - "execa": "^5.1.1", - "is-wsl": "^2.2.0" + "execa": "^8.0.1", + "is-wsl": "^3.1.0", + "is64bit": "^2.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1573,9 +1615,8 @@ }, "node_modules/clone-deep": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "dev": true, + "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4", "kind-of": "^6.0.2", @@ -1585,31 +1626,23 @@ "node": ">=6" } }, - "node_modules/cluster-key-slot": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/colorette": { "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "version": "10.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } }, "node_modules/compressible": { "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": ">= 1.43.0 < 2" }, @@ -1617,11 +1650,18 @@ "node": ">= 0.6" } }, + "node_modules/compressible/node_modules/mime-db": { + "version": "1.53.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/compression": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.5", "bytes": "3.0.0", @@ -1635,49 +1675,42 @@ "node": ">= 0.8.0" } }, - "node_modules/compression/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/compression/node_modules/bytes": { + "version": "3.0.0", "dev": true, - "dependencies": { - "ms": "2.0.0" + "license": "MIT", + "engines": { + "node": ">= 0.8" } }, - "node_modules/compression/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/compression/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/confbox": { + "version": "0.1.8", + "license": "MIT" }, "node_modules/connect-history-api-fallback": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", - "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/consola": { "version": "3.2.3", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", - "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", + "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" } }, "node_modules/content-disposition": { "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" }, @@ -1687,43 +1720,37 @@ }, "node_modules/content-type": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/cookie-es": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", - "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==" + "version": "1.2.2", + "license": "MIT" }, "node_modules/cookie-signature": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/core-util-is": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1733,35 +1760,37 @@ "node": ">= 8" } }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/crossws": { + "version": "0.3.1", + "license": "MIT", "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "uncrypto": "^0.1.3" } }, + "node_modules/debug": { + "version": "2.6.9", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, "node_modules/decode-uri-component": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", "engines": { "node": ">=0.10" } }, "node_modules/default-browser": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", - "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", "dev": true, + "license": "MIT", "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" @@ -1775,9 +1804,8 @@ }, "node_modules/default-browser-id": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", - "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -1787,9 +1815,8 @@ }, "node_modules/define-data-property": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -1804,9 +1831,8 @@ }, "node_modules/define-lazy-prop": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", - "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -1815,37 +1841,25 @@ } }, "node_modules/defu": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.3.tgz", - "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==" - }, - "node_modules/denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "engines": { - "node": ">=0.10" - } + "version": "6.1.4", + "license": "MIT" }, "node_modules/depd": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/destr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.2.tgz", - "integrity": "sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==" + "version": "2.0.3", + "license": "MIT" }, "node_modules/destroy": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -1853,13 +1867,11 @@ }, "node_modules/detect-browser": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.3.0.tgz", - "integrity": "sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==" + "license": "MIT" }, "node_modules/detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "license": "Apache-2.0", "bin": { "detect-libc": "bin/detect-libc.js" }, @@ -1869,15 +1881,13 @@ }, "node_modules/detect-node": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/dns-packet": { "version": "5.6.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", - "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, + "license": "MIT", "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" }, @@ -1886,32 +1896,28 @@ } }, "node_modules/duplexify": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "version": "4.1.3", + "license": "MIT", "dependencies": { "end-of-stream": "^1.4.1", "inherits": "^2.0.3", "readable-stream": "^3.1.1", - "stream-shift": "^1.0.0" + "stream-shift": "^1.0.2" } }, "node_modules/ee-first": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.4.596", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.596.tgz", - "integrity": "sha512-zW3zbZ40Icb2BCWjm47nxwcFGYlIgdXkAx85XDO7cyky9J4QQfq8t0W19/TLZqq3JPQXtlv8BPIGmfa9Jb4scg==", - "dev": true + "version": "1.5.36", + "dev": true, + "license": "ISC" }, "node_modules/elliptic": { "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "license": "MIT", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -1924,26 +1930,23 @@ }, "node_modules/encodeurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/enhanced-resolve": { "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -1953,10 +1956,9 @@ } }, "node_modules/envinfo": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.11.0.tgz", - "integrity": "sha512-G9/6xF1FPbIw0TtalAMaVPpiq2aDEuKLXM314jPVAO9r2fo2a4BLqMNkmRS7O/xPPZ+COAhGIz3ETvHEV3eUcg==", + "version": "7.14.0", "dev": true, + "license": "MIT", "bin": { "envinfo": "dist/cli.js" }, @@ -1966,9 +1968,8 @@ }, "node_modules/es-define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", "dev": true, + "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -1978,39 +1979,34 @@ }, "node_modules/es-errors": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", - "dev": true + "version": "1.5.4", + "dev": true, + "license": "MIT" }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/escape-html": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint-scope": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -2021,9 +2017,8 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -2033,79 +2028,72 @@ }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/etag": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/eventemitter3": { "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "version": "8.0.1", + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=10" + "node": ">=16.17" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -2136,61 +2124,40 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-redact": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz", - "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==", + "version": "3.5.0", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/fast-uri": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.2.tgz", - "integrity": "sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastest-levenshtein": { "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4.9.1" } }, "node_modules/faye-websocket": { "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", "dev": true, + "license": "Apache-2.0", "dependencies": { "websocket-driver": ">=0.5.1" }, @@ -2200,8 +2167,7 @@ }, "node_modules/fill-range": { "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2211,17 +2177,15 @@ }, "node_modules/filter-obj": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/finalhandler": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", @@ -2235,26 +2199,10 @@ "node": ">= 0.8" } }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -2265,17 +2213,14 @@ }, "node_modules/flat": { "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, + "license": "BSD-3-Clause", "bin": { "flat": "cli.js" } }, "node_modules/follow-redirects": { "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -2283,6 +2228,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -2294,27 +2240,23 @@ }, "node_modules/forwarded": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fresh": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fsevents": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -2325,18 +2267,16 @@ }, "node_modules/function-bind": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-intrinsic": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -2352,16 +2292,14 @@ } }, "node_modules/get-port-please": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.1.tgz", - "integrity": "sha512-3UBAyM3u4ZBVYDsxOQfJDxEa6XTbpBDrOjp4mf7ExFRt5BKs/QywQQiJsh2B+hxcZLSapWqCRvElUe8DnKcFHA==" + "version": "3.1.2", + "license": "MIT" }, "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "version": "8.0.1", + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2369,8 +2307,7 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -2380,15 +2317,13 @@ }, "node_modules/glob-to-regexp": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/gopd": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, + "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2398,45 +2333,42 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/h3": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/h3/-/h3-1.9.0.tgz", - "integrity": "sha512-+F3ZqrNV/CFXXfZ2lXBINHi+rM4Xw3CDC5z2CDK3NMPocjonKipGLLDSkrqY9DOrioZNPTIdDMWfQKm//3X2DA==", + "version": "1.13.0", + "license": "MIT", "dependencies": { - "cookie-es": "^1.0.0", - "defu": "^6.1.3", - "destr": "^2.0.2", - "iron-webcrypto": "^1.0.0", - "radix3": "^1.1.0", - "ufo": "^1.3.2", + "cookie-es": "^1.2.2", + "crossws": ">=0.2.0 <0.4.0", + "defu": "^6.1.4", + "destr": "^2.0.3", + "iron-webcrypto": "^1.2.1", + "ohash": "^1.1.4", + "radix3": "^1.1.2", + "ufo": "^1.5.4", "uncrypto": "^0.1.3", - "unenv": "^1.7.4" + "unenv": "^1.10.0" } }, "node_modules/handle-thing": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", - "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -2446,9 +2378,8 @@ }, "node_modules/has-proto": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2458,9 +2389,8 @@ }, "node_modules/has-symbols": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2470,18 +2400,16 @@ }, "node_modules/hash.js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.2", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -2491,8 +2419,7 @@ }, "node_modules/hmac-drbg": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "license": "MIT", "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -2501,9 +2428,8 @@ }, "node_modules/hpack.js": { "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.1", "obuf": "^1.0.0", @@ -2513,9 +2439,8 @@ }, "node_modules/hpack.js/node_modules/readable-stream": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, + "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -2528,23 +2453,19 @@ }, "node_modules/hpack.js/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/hpack.js/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/html-entities": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", - "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==", + "version": "2.5.2", "dev": true, "funding": [ { @@ -2555,19 +2476,18 @@ "type": "patreon", "url": "https://patreon.com/mdevils" } - ] + ], + "license": "MIT" }, "node_modules/http-deceiver": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/http-errors": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, + "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -2581,15 +2501,13 @@ }, "node_modules/http-parser-js": { "version": "0.5.8", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", - "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/http-proxy": { "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, + "license": "MIT", "dependencies": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -2600,10 +2518,9 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", - "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "version": "2.0.7", "dev": true, + "license": "MIT", "dependencies": { "@types/http-proxy": "^1.17.8", "http-proxy": "^1.18.1", @@ -2625,35 +2542,31 @@ }, "node_modules/http-shutdown": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/http-shutdown/-/http-shutdown-1.2.2.tgz", - "integrity": "sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==", + "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" } }, "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "version": "5.0.0", + "license": "Apache-2.0", "engines": { - "node": ">=10.17.0" + "node": ">=16.17.0" } }, "node_modules/hyperdyperid": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", - "integrity": "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.18" } }, "node_modules/iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -2663,14 +2576,30 @@ }, "node_modules/idb-keyval": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz", - "integrity": "sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==" + "license": "Apache-2.0" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" }, "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "version": "3.2.0", "dev": true, + "license": "MIT", "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -2687,62 +2616,34 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "license": "ISC" }, "node_modules/interpret": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.13.0" } }, - "node_modules/ioredis": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", - "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", - "dependencies": { - "@ioredis/commands": "^1.1.1", - "cluster-key-slot": "^1.1.0", - "debug": "^4.3.4", - "denque": "^2.1.0", - "lodash.defaults": "^4.2.0", - "lodash.isarguments": "^3.1.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0", - "standard-as-callback": "^2.1.0" - }, - "engines": { - "node": ">=12.22.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/ioredis" - } - }, "node_modules/ipaddr.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", - "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "version": "2.2.0", "dev": true, + "license": "MIT", "engines": { "node": ">= 10" } }, "node_modules/iron-webcrypto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.0.0.tgz", - "integrity": "sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg==", + "version": "1.2.1", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/brc-dd" } }, "node_modules/is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -2751,26 +2652,27 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.15.1", "dev": true, + "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "version": "3.0.0", + "license": "MIT", "bin": { "is-docker": "cli.js" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2778,16 +2680,14 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-glob": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -2797,9 +2697,7 @@ }, "node_modules/is-inside-container": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", - "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", - "dev": true, + "license": "MIT", "dependencies": { "is-docker": "^3.0.0" }, @@ -2813,26 +2711,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-inside-container/node_modules/is-docker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-network-error": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", - "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, @@ -2842,17 +2724,15 @@ }, "node_modules/is-number": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/is-plain-obj": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -2862,9 +2742,8 @@ }, "node_modules/is-plain-object": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, + "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -2873,52 +2752,62 @@ } }, "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "version": "3.0.0", + "license": "MIT", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "version": "3.1.0", + "license": "MIT", "dependencies": { - "is-docker": "^2.0.0" + "is-inside-container": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is64bit": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "system-architecture": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "license": "ISC" }, "node_modules/isobject": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/jest-worker": { "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -2929,75 +2818,68 @@ } }, "node_modules/jiti": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", - "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "version": "2.3.3", + "license": "MIT", "bin": { - "jiti": "bin/jiti.js" + "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/js-sha3": { + "version": "0.8.0", + "license": "MIT" + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + "version": "1.0.0", + "dev": true, + "license": "MIT" }, "node_modules/keyvaluestorage-interface": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz", - "integrity": "sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==" + "license": "MIT" }, "node_modules/kind-of": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/launch-editor": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.1.tgz", - "integrity": "sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==", + "version": "2.9.1", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^1.0.0", "shell-quote": "^1.8.1" } }, "node_modules/listhen": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.5.5.tgz", - "integrity": "sha512-LXe8Xlyh3gnxdv4tSjTjscD1vpr/2PRpzq8YIaMJgyKzRG8wdISlWVWnGThJfHnlJ6hmLt2wq1yeeix0TEbuoA==", + "version": "1.9.0", + "license": "MIT", "dependencies": { - "@parcel/watcher": "^2.3.0", - "@parcel/watcher-wasm": "2.3.0", - "citty": "^0.1.4", - "clipboardy": "^3.0.0", + "@parcel/watcher": "^2.4.1", + "@parcel/watcher-wasm": "^2.4.1", + "citty": "^0.1.6", + "clipboardy": "^4.0.0", "consola": "^3.2.3", - "defu": "^6.1.2", - "get-port-please": "^3.1.1", - "h3": "^1.8.1", + "crossws": ">=0.2.0 <0.4.0", + "defu": "^6.1.4", + "get-port-please": "^3.1.2", + "h3": "^1.12.0", "http-shutdown": "^1.2.2", - "jiti": "^1.20.0", - "mlly": "^1.4.2", + "jiti": "^2.1.2", + "mlly": "^1.7.1", "node-forge": "^1.3.1", - "pathe": "^1.1.1", - "std-env": "^3.4.3", - "ufo": "^1.3.0", - "untun": "^0.1.2", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "ufo": "^1.5.4", + "untun": "^0.1.3", "uqr": "^0.1.2" }, "bin": { @@ -3007,18 +2889,16 @@ }, "node_modules/loader-runner": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.11.5" } }, "node_modules/locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -3026,40 +2906,26 @@ "node": ">=8" } }, - "node_modules/lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" - }, - "node_modules/lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" - }, "node_modules/lodash.isequal": { "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + "license": "MIT" }, "node_modules/lru-cache": { "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + "license": "ISC" }, "node_modules/media-typer": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/memfs": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.12.0.tgz", - "integrity": "sha512-74wDsex5tQDSClVkeK1vtxqYCAgCoXxx+K4NSHzgU/muYVYByFqa+0RnrPO9NM6naWm1+G9JmZ0p6QHhXmeYfA==", + "version": "4.14.0", "dev": true, + "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/json-pack": "^1.0.3", "@jsonjoy.com/util": "^1.3.0", @@ -3076,9 +2942,8 @@ }, "node_modules/memfs/node_modules/@jsonjoy.com/base64": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=10.0" }, @@ -3092,9 +2957,8 @@ }, "node_modules/memfs/node_modules/@jsonjoy.com/json-pack": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz", - "integrity": "sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/base64": "^1.1.1", "@jsonjoy.com/util": "^1.1.2", @@ -3113,10 +2977,9 @@ } }, "node_modules/memfs/node_modules/@jsonjoy.com/util": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.3.0.tgz", - "integrity": "sha512-Cebt4Vk7k1xHy87kHY7KSPLT77A7Ev7IfOblyLZhtYEhrdQ6fX4EoLq3xOQ3O/DRMEh2ok5nyC180E+ABS8Wmw==", + "version": "1.5.0", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=10.0" }, @@ -3130,9 +2993,8 @@ }, "node_modules/memfs/node_modules/thingies": { "version": "1.21.0", - "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz", - "integrity": "sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==", "dev": true, + "license": "Unlicense", "engines": { "node": ">=10.18" }, @@ -3142,9 +3004,8 @@ }, "node_modules/memfs/node_modules/tree-dump": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz", - "integrity": "sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=10.0" }, @@ -3158,37 +3019,32 @@ }, "node_modules/memfs/node_modules/tslib": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true + "dev": true, + "license": "0BSD" }, "node_modules/merge-descriptors": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/merge-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "license": "MIT" }, "node_modules/methods": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/micromatch": { "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -3198,30 +3054,28 @@ } }, "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "version": "1.6.0", + "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, "engines": { - "node": ">=10.0.0" + "node": ">=4" } }, "node_modules/mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -3230,52 +3084,49 @@ } }, "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "version": "4.0.0", + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/minimalistic-assert": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "license": "ISC" }, "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + "license": "MIT" }, "node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "version": "1.7.2", + "license": "MIT", "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", - "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "acorn": "^8.12.1", + "pathe": "^1.1.2", + "pkg-types": "^1.2.0", + "ufo": "^1.5.4" } }, "node_modules/mri": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "dev": true, + "license": "MIT" }, "node_modules/multicast-dns": { "version": "7.2.5", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", - "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", "dev": true, + "license": "MIT", "dependencies": { "dns-packet": "^5.2.2", "thunky": "^1.0.2" @@ -3286,72 +3137,75 @@ }, "node_modules/multiformats": { "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + "license": "(Apache-2.0 AND MIT)" }, "node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/neo-async": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/node-addon-api": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", - "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==" + "version": "7.1.1", + "license": "MIT" }, "node_modules/node-fetch-native": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.4.1.tgz", - "integrity": "sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==" + "version": "1.6.4", + "license": "MIT" }, "node_modules/node-forge": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.13.0" } }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", - "dev": true + "version": "2.0.18", + "dev": true, + "license": "MIT" }, "node_modules/normalize-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "version": "5.3.0", + "license": "MIT", "dependencies": { - "path-key": "^3.0.0" + "path-key": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/object-inspect": { "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3361,30 +3215,30 @@ }, "node_modules/obuf": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ofetch": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", - "integrity": "sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==", + "version": "1.4.1", + "license": "MIT", "dependencies": { - "destr": "^2.0.1", - "node-fetch-native": "^1.4.0", - "ufo": "^1.3.0" + "destr": "^2.0.3", + "node-fetch-native": "^1.6.4", + "ufo": "^1.5.4" } }, + "node_modules/ohash": { + "version": "1.1.4", + "license": "MIT" + }, "node_modules/on-exit-leak-free": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz", - "integrity": "sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==" + "license": "MIT" }, "node_modules/on-finished": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -3394,30 +3248,27 @@ }, "node_modules/on-headers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "version": "6.0.0", + "license": "MIT", "dependencies": { - "mimic-fn": "^2.1.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3425,9 +3276,8 @@ }, "node_modules/open": { "version": "10.1.0", - "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", - "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", "dev": true, + "license": "MIT", "dependencies": { "default-browser": "^5.2.1", "define-lazy-prop": "^3.0.0", @@ -3441,26 +3291,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/open/node_modules/is-wsl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", - "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", - "dev": true, - "dependencies": { - "is-inside-container": "^1.0.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-limit": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -3473,9 +3307,8 @@ }, "node_modules/p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -3485,9 +3318,8 @@ }, "node_modules/p-retry": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz", - "integrity": "sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA==", "dev": true, + "license": "MIT", "dependencies": { "@types/retry": "0.12.2", "is-network-error": "^1.0.0", @@ -3502,66 +3334,57 @@ }, "node_modules/p-try": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/parseurl": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/path-key": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/path-parse": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-to-regexp": { "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==" + "version": "1.1.2", + "license": "MIT" }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "version": "1.1.0", + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -3571,8 +3394,7 @@ }, "node_modules/pino": { "version": "7.11.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-7.11.0.tgz", - "integrity": "sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.0.0", @@ -3592,8 +3414,7 @@ }, "node_modules/pino-abstract-transport": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz", - "integrity": "sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==", + "license": "MIT", "dependencies": { "duplexify": "^4.1.2", "split2": "^4.0.0" @@ -3601,14 +3422,12 @@ }, "node_modules/pino-std-serializers": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-4.0.0.tgz", - "integrity": "sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==" + "license": "MIT" }, "node_modules/pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^4.0.0" }, @@ -3617,31 +3436,27 @@ } }, "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "version": "1.2.1", + "license": "MIT", "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" + "confbox": "^0.1.8", + "mlly": "^1.7.2", + "pathe": "^1.1.2" } }, "node_modules/process-nextick-args": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/process-warning": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz", - "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==" + "license": "MIT" }, "node_modules/proxy-addr": { "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "dev": true, + "license": "MIT", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -3652,27 +3467,24 @@ }, "node_modules/proxy-addr/node_modules/ipaddr.js": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/punycode": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/qs": { "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" }, @@ -3685,8 +3497,7 @@ }, "node_modules/query-string": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", - "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "license": "MIT", "dependencies": { "decode-uri-component": "^0.2.2", "filter-obj": "^1.1.0", @@ -3702,37 +3513,32 @@ }, "node_modules/quick-format-unescaped": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + "license": "MIT" }, "node_modules/radix3": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.0.tgz", - "integrity": "sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==" + "version": "1.1.2", + "license": "MIT" }, "node_modules/randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/range-parser": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/raw-body": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -3743,19 +3549,9 @@ "node": ">= 0.8" } }, - "node_modules/raw-body/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/readable-stream": { "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -3767,8 +3563,7 @@ }, "node_modules/readdirp": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -3778,17 +3573,15 @@ }, "node_modules/real-require": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.1.0.tgz", - "integrity": "sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==", + "license": "MIT", "engines": { "node": ">= 12.13.0" } }, "node_modules/rechoir": { "version": "0.8.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", "dev": true, + "license": "MIT", "dependencies": { "resolve": "^1.20.0" }, @@ -3796,45 +3589,23 @@ "node": ">= 10.13.0" } }, - "node_modules/redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", - "engines": { - "node": ">=4" - } - }, - "node_modules/redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", - "dependencies": { - "redis-errors": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/require-from-string": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/requires-port": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/resolve": { "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, + "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -3849,9 +3620,8 @@ }, "node_modules/resolve-cwd": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, + "license": "MIT", "dependencies": { "resolve-from": "^5.0.0" }, @@ -3861,27 +3631,24 @@ }, "node_modules/resolve-from": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/retry": { "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/run-applescript": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", - "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3891,8 +3658,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -3906,27 +3671,25 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "version": "2.5.0", + "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/schema-utils": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -3940,17 +3703,43 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "dev": true, + "license": "MIT" + }, "node_modules/select-hose": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/selfsigned": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", - "integrity": "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/node-forge": "^1.3.0", "node-forge": "^1" @@ -3961,9 +3750,8 @@ }, "node_modules/send": { "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -3983,62 +3771,26 @@ "node": ">= 0.8.0" } }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/send/node_modules/encodeurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, - "node_modules/send/node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/serialize-javascript": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/serve-index": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.4", "batch": "0.6.1", @@ -4052,29 +3804,18 @@ "node": ">= 0.8.0" } }, - "node_modules/serve-index/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, "node_modules/serve-index/node_modules/depd": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/serve-index/node_modules/http-errors": { "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -4087,36 +3828,26 @@ }, "node_modules/serve-index/node_modules/inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true - }, - "node_modules/serve-index/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/serve-index/node_modules/setprototypeof": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/serve-index/node_modules/statuses": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/serve-static": { "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, + "license": "MIT", "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", @@ -4129,9 +3860,8 @@ }, "node_modules/set-function-length": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -4146,15 +3876,13 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/shallow-clone": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "dev": true, + "license": "MIT", "dependencies": { "kind-of": "^6.0.2" }, @@ -4164,8 +3892,7 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -4175,26 +3902,23 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/shell-quote": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/side-channel": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -4209,15 +3933,19 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "version": "4.1.0", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/sockjs": { "version": "0.3.24", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", - "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", "dev": true, + "license": "MIT", "dependencies": { "faye-websocket": "^0.11.3", "uuid": "^8.3.2", @@ -4226,26 +3954,23 @@ }, "node_modules/sonic-boom": { "version": "2.8.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-2.8.0.tgz", - "integrity": "sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" } }, "node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -4253,9 +3978,8 @@ }, "node_modules/spdy": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", - "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.0", "handle-thing": "^2.0.0", @@ -4269,9 +3993,8 @@ }, "node_modules/spdy-transport": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.0", "detect-node": "^2.0.4", @@ -4281,75 +4004,96 @@ "wbuf": "^1.7.3" } }, + "node_modules/spdy-transport/node_modules/debug": { + "version": "4.3.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/spdy/node_modules/debug": { + "version": "4.3.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/split-on-first": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/split2": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", "engines": { "node": ">= 10.x" } }, - "node_modules/standard-as-callback": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", - "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" - }, "node_modules/statuses": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/std-env": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.5.0.tgz", - "integrity": "sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA==" + "version": "3.7.0", + "license": "MIT" }, "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + "version": "1.0.3", + "license": "MIT" }, "node_modules/strict-uri-encode": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "version": "3.0.0", + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4362,9 +4106,8 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -4372,20 +4115,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/system-architecture": { + "version": "0.1.0", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tapable": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/terser": { - "version": "5.30.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", - "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", + "version": "5.34.1", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -4401,9 +4152,8 @@ }, "node_modules/terser-webpack-plugin": { "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", @@ -4433,24 +4183,26 @@ } } }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "dev": true, + "license": "MIT" + }, "node_modules/thread-stream": { "version": "0.15.2", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-0.15.2.tgz", - "integrity": "sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==", + "license": "MIT", "dependencies": { "real-require": "^0.1.0" } }, "node_modules/thunky": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", - "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -4460,23 +4212,20 @@ }, "node_modules/toidentifier": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/tslib": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "license": "0BSD" }, "node_modules/type-is": { "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, + "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -4486,80 +4235,83 @@ } }, "node_modules/ufo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", - "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==" + "version": "1.5.4", + "license": "MIT" }, "node_modules/uint8arrays": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", - "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "version": "3.1.0", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } }, "node_modules/uncrypto": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", - "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==" + "license": "MIT" }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "version": "6.19.8", + "dev": true, + "license": "MIT" }, "node_modules/unenv": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.8.0.tgz", - "integrity": "sha512-uIGbdCWZfhRRmyKj1UioCepQ0jpq638j/Cf0xFTn4zD1nGJ2lSdzYHLzfdXN791oo/0juUiSWW1fBklXMTsuqg==", + "version": "1.10.0", + "license": "MIT", "dependencies": { "consola": "^3.2.3", - "defu": "^6.1.3", + "defu": "^6.1.4", "mime": "^3.0.0", - "node-fetch-native": "^1.4.1", - "pathe": "^1.1.1" + "node-fetch-native": "^1.6.4", + "pathe": "^1.1.2" + } + }, + "node_modules/unenv/node_modules/mime": { + "version": "3.0.0", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" } }, "node_modules/unpipe": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/unstorage": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.10.1.tgz", - "integrity": "sha512-rWQvLRfZNBpF+x8D3/gda5nUCQL2PgXy2jNG4U7/Rc9BGEv9+CAJd0YyGCROUBKs9v49Hg8huw3aih5Bf5TAVw==", + "version": "1.12.0", + "license": "MIT", "dependencies": { "anymatch": "^3.1.3", - "chokidar": "^3.5.3", - "destr": "^2.0.2", - "h3": "^1.8.2", - "ioredis": "^5.3.2", - "listhen": "^1.5.5", - "lru-cache": "^10.0.2", + "chokidar": "^3.6.0", + "destr": "^2.0.3", + "h3": "^1.12.0", + "listhen": "^1.7.2", + "lru-cache": "^10.4.3", "mri": "^1.2.0", - "node-fetch-native": "^1.4.1", - "ofetch": "^1.3.3", - "ufo": "^1.3.1" + "node-fetch-native": "^1.6.4", + "ofetch": "^1.3.4", + "ufo": "^1.5.4" }, "peerDependencies": { - "@azure/app-configuration": "^1.4.1", - "@azure/cosmos": "^4.0.0", + "@azure/app-configuration": "^1.7.0", + "@azure/cosmos": "^4.1.1", "@azure/data-tables": "^13.2.2", - "@azure/identity": "^3.3.2", - "@azure/keyvault-secrets": "^4.7.0", - "@azure/storage-blob": "^12.16.0", - "@capacitor/preferences": "^5.0.6", - "@netlify/blobs": "^6.2.0", - "@planetscale/database": "^1.11.0", - "@upstash/redis": "^1.23.4", - "@vercel/kv": "^0.2.3", - "idb-keyval": "^6.2.1" + "@azure/identity": "^4.4.1", + "@azure/keyvault-secrets": "^4.8.0", + "@azure/storage-blob": "^12.24.0", + "@capacitor/preferences": "^6.0.2", + "@netlify/blobs": "^6.5.0 || ^7.0.0", + "@planetscale/database": "^1.19.0", + "@upstash/redis": "^1.34.0", + "@vercel/kv": "^1.0.1", + "idb-keyval": "^6.2.1", + "ioredis": "^5.4.1" }, "peerDependenciesMeta": { "@azure/app-configuration": { @@ -4597,15 +4349,17 @@ }, "idb-keyval": { "optional": true + }, + "ioredis": { + "optional": true } } }, "node_modules/untun": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.2.tgz", - "integrity": "sha512-wLAMWvxfqyTiBODA1lg3IXHQtjggYLeTK7RnSfqtOXixWJ3bAa2kK/HHmOOg19upteqO3muLvN6O/icbyQY33Q==", + "version": "0.1.3", + "license": "MIT", "dependencies": { - "citty": "^0.1.3", + "citty": "^0.1.5", "consola": "^3.2.3", "pathe": "^1.1.1" }, @@ -4614,9 +4368,7 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.1", "dev": true, "funding": [ { @@ -4632,9 +4384,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" }, "bin": { "update-browserslist-db": "cli.js" @@ -4645,55 +4398,48 @@ }, "node_modules/uqr": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/uqr/-/uqr-0.1.2.tgz", - "integrity": "sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==" + "license": "MIT" }, "node_modules/uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "license": "MIT" }, "node_modules/utils-merge": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/uuid": { "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/vary": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/watchpack": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", - "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", + "version": "2.4.2", "dev": true, + "license": "MIT", "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -4704,18 +4450,16 @@ }, "node_modules/wbuf": { "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", "dev": true, + "license": "MIT", "dependencies": { "minimalistic-assert": "^1.0.0" } }, "node_modules/webpack": { "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", @@ -4759,9 +4503,8 @@ }, "node_modules/webpack-cli": { "version": "5.1.4", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", - "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", "dev": true, + "license": "MIT", "dependencies": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^2.1.1", @@ -4802,20 +4545,10 @@ } } }, - "node_modules/webpack-cli/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/webpack-dev-middleware": { "version": "7.4.2", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-7.4.2.tgz", - "integrity": "sha512-xOO8n6eggxnwYpy1NlzUKpvrjfJTvae5/D6WOK0S2LSo7vjmo5gCM1DbLUmFqrMTJP+W/0YZNctm7jasWvLuBA==", "dev": true, + "license": "MIT", "dependencies": { "colorette": "^2.0.10", "memfs": "^4.6.0", @@ -4840,45 +4573,10 @@ } } }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.9", "ajv": "^8.9.0", @@ -4895,9 +4593,8 @@ }, "node_modules/webpack-dev-server": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.1.0.tgz", - "integrity": "sha512-aQpaN81X6tXie1FoOB7xlMfCsN19pSvRAeYUHOdFWOlhpQ/LlbfTqYwwmEDFV0h8GGuqmCmKmT+pxcUV/Nt2gQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/bonjour": "^3.5.13", "@types/connect-history-api-fallback": "^1.5.4", @@ -4950,45 +4647,10 @@ } } }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-server/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/webpack-dev-server/node_modules/schema-utils": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.9", "ajv": "^8.9.0", @@ -5003,11 +4665,74 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "node_modules/webpack-merge": { + "version": "5.10.0", "dev": true, + "license": "MIT", + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.18.0", + "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -5023,97 +4748,6 @@ "optional": true } } - }, - "node_modules/webpack-merge": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", - "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "flat": "^5.0.2", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "dev": true, - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wildcard": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", - "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", - "dev": true - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } } } } diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json index 973ad583da..a313c74f4a 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/package.json @@ -16,9 +16,9 @@ "start": "webpack serve --mode development --open" }, "dependencies": { - "@reown/walletkit": "^1.1.0", - "@walletconnect/utils": "^2.17.0", - "@walletconnect/jsonrpc-utils": "^1.0.8", - "@walletconnect/core": "^2.17.0" + "@reown/walletkit": "^1.1.1", + "@walletconnect/core": "^2.17.1", + "@walletconnect/utils": "^2.17.1", + "buffer": "^6.0.3" } } diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/src/index.js b/ui/app/AppLayouts/Wallet/services/dapps/sdk/src/index.js index 3c03494407..cc19733002 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/src/index.js +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/src/index.js @@ -2,7 +2,7 @@ import { Core } from "@walletconnect/core"; import { WalletKit } from "@reown/walletkit"; // import the builder util -import { buildApprovedNamespaces, getSdkError } from "@walletconnect/utils"; +import { buildApprovedNamespaces, getSdkError, populateAuthPayload, buildAuthObject } from "@walletconnect/utils"; import { formatJsonRpcResult, formatJsonRpcError } from "@walletconnect/jsonrpc-utils"; window.wc = { @@ -102,6 +102,16 @@ window.wc = { window.wc.core.relayer.on("relayer_disconnect", () => { wc.statusObject.echo("debug", `WC unhandled event: "relayer_disconnect" connection to the relay server is lost`); }) + window.wc.walletKit.on("session_authenticate", (payload) => { + // Process the authentication request here. + // Steps include: + // 1. Populate the authentication payload with the supported chains and methods + // 2. Format the authentication message using the payload and the user's account + // 3. Present the authentication message to the user + // 4. Sign the authentication message(s) to create a verifiable authentication object(s) + // 5. Approve the authentication request with the authentication object(s) + wc.statusObject.onSessionAuthenticate(payload) + }) resolve(""); } catch(error) { @@ -187,4 +197,44 @@ window.wc = { } ); }, + + populateAuthPayload: async function (authPayload, chains, methods) { + return populateAuthPayload({ + authPayload, + chains, + methods, + }); + }, + + formatAuthMessage: async function (request, iss) { + return wc.walletKit.formatAuthMessage({ + request, + iss + }); + }, + + buildAuthObject: async function (authPayload, signature, iss) { + return buildAuthObject( + authPayload, + { + t: 'eip191', + s: signature + }, + iss + ) + }, + + acceptSessionAuthenticate: async function(id, auths) { // Approve + return await window.wc.walletKit.approveSessionAuthenticate({ + id, + auths + }) + }, + + rejectSessionAuthenticate: async function(id, error) { // Reject + return await window.wc.walletKit.rejectSessionAuthenticate({ + id: id, + reason: getSdkError('USER_REJECTED') // or choose a different reason if applicable + }) + } }; diff --git a/ui/app/AppLayouts/Wallet/services/dapps/sdk/webpack.config.js b/ui/app/AppLayouts/Wallet/services/dapps/sdk/webpack.config.js index c8939fcf78..3489cb6cff 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/sdk/webpack.config.js +++ b/ui/app/AppLayouts/Wallet/services/dapps/sdk/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const webpack = require('webpack'); module.exports = { entry: './src/index.js', @@ -19,4 +20,17 @@ module.exports = { experiments: { outputModule: true, }, + plugins: [ + // Work around for Buffer is undefined: + // https://github.com/webpack/changelog-v5/issues/10 + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }) + ], + resolve: { + extensions: [ '.ts', '.js' ], + fallback: { + buffer: require.resolve("buffer"), + }, + }, }; \ No newline at end of file