{"snapId":"npm:@metamask/message-signing-snap","manifest":{"version":"1.1.4","description":"Provides public key and message signing used for signing in with MetaMask","proposedName":"Sign in with MetaMask","repository":{"type":"git","url":"https://github.com/MetaMask/message-signing-snap.git"},"source":{"shasum":"9XT0QAdCcds4xq1qG+zB7DchjMLCv4g7crpYi9G0Tos=","location":{"npm":{"filePath":"dist/bundle.js","iconPath":"images/icon.svg","packageName":"@metamask/message-signing-snap","registry":"https://registry.npmjs.org/"}}},"initialConnections":{"https://portfolio.metamask.io":{},"https://app.metamask.io":{},"https://portfolio-builds.metafi-dev.codefi.network":{},"https://docs.metamask.io":{},"https://developer.metamask.io":{},"npm:@metamask/gator-permissions-snap":{}},"initialPermissions":{"snap_getEntropy":{},"endowment:rpc":{"dapps":true,"snaps":true}},"platformVersion":"8.1.0","manifestVersion":"0.1"},"files":[{"path":"images/icon.svg","value":"<svg width=\"500\" height=\"500\" viewBox=\"0 0 500 500\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect width=\"500\" height=\"500\" fill=\"black\"/>\n<g filter=\"url(#filter0_f_8_91)\">\n<path d=\"M249.444 373.519C249.444 373.519 364.118 343.192 364.118 257.188L378.333 248.251L364.118 239.314L378.333 230.378L364.118 221.441V203.568V185.695V149.948V114.202L301.639 132.596C267.566 142.628 231.323 142.628 197.25 132.596L134.771 114.202V149.948V167.821V185.695V203.568V221.441L120.556 230.378L134.771 239.314L120.556 248.251L134.771 257.188C134.771 343.192 249.444 373.519 249.444 373.519Z\" fill=\"#F1CA77\"/>\n</g>\n<path d=\"M249.445 406.215C249.445 406.215 364.118 348.879 364.118 262.874L378.333 253.937L364.118 245.001L378.333 236.064L364.118 227.127V209.254V191.381V155.634V119.888L249.445 162.179L134.771 119.888V155.634V173.508V191.381V209.254V227.127L120.556 236.064L134.771 245.001L120.556 253.937L134.771 262.874C134.771 348.879 249.445 406.215 249.445 406.215Z\" fill=\"#233447\"/>\n<path d=\"M249.445 399.107C249.445 399.107 364.118 348.879 364.118 262.874L378.333 253.937L364.118 245.001L378.333 236.064L364.118 227.127V209.254V191.381V155.634V119.888L249.445 162.179L134.771 119.888V155.634V173.508V191.381V209.254V227.127L120.556 236.064L134.771 245.001L120.556 253.937L134.771 262.874C134.771 348.879 249.445 399.107 249.445 399.107Z\" fill=\"#123AF0\"/>\n<path d=\"M249.445 392C249.445 392 364.118 348.879 364.118 262.874L378.333 253.937L364.118 245.001L378.333 236.064L364.118 227.127V209.254V191.381V155.634V119.888L249.445 162.179L134.771 119.888V155.634V173.508V191.381V209.254V227.127L120.556 236.064L134.771 245.001L120.556 253.937L134.771 262.874C134.771 348.879 249.445 392 249.445 392Z\" fill=\"#CD6116\"/>\n<path d=\"M249.445 382.049C249.445 382.049 364.118 348.879 364.118 262.874L378.333 253.937L364.118 245.001L378.333 236.064L364.118 227.127V209.254V191.381V155.634V119.888L249.445 162.179L134.771 119.888V155.634V173.508V191.381V209.254V227.127L120.556 236.064L134.771 245.001L120.556 253.937L134.771 262.874C134.771 348.879 249.445 382.049 249.445 382.049Z\" fill=\"#E4751F\"/>\n<path d=\"M249.445 370.676C249.445 370.676 364.118 348.879 364.118 262.874L378.333 253.937L364.118 245.001L378.333 236.064L364.118 227.127V209.254V191.381V155.634V119.888L249.445 162.179L134.771 119.888V155.634V173.508V191.381V209.254V227.127L120.556 236.064L134.771 245.001L120.556 253.937L134.771 262.874C134.771 348.879 249.445 370.676 249.445 370.676Z\" fill=\"#F6851B\"/>\n<path d=\"M249.445 352.196C249.445 352.196 364.118 348.879 364.118 262.874L378.333 253.937L364.118 245.001L378.333 236.064L364.118 227.127V209.254V191.381V155.634V119.888C290.105 147.184 208.784 147.184 134.771 119.888V155.634V173.508V191.381V209.254V227.127L120.556 236.064L134.771 245.001L120.556 253.937L134.771 262.874C134.771 348.879 249.445 352.196 249.445 352.196Z\" fill=\"url(#paint0_linear_8_91)\"/>\n<defs>\n<filter id=\"filter0_f_8_91\" x=\"94.9674\" y=\"88.6133\" width=\"308.954\" height=\"310.494\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\">\n<feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/>\n<feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/>\n<feGaussianBlur stdDeviation=\"12.7941\" result=\"effect1_foregroundBlur_8_91\"/>\n</filter>\n<linearGradient id=\"paint0_linear_8_91\" x1=\"144.012\" y1=\"132.09\" x2=\"425.482\" y2=\"446.967\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#F1CA77\"/>\n<stop offset=\"1\" stop-color=\"#F6851B\"/>\n</linearGradient>\n</defs>\n</svg>\n"},{"path":"dist/bundle.js","value":"(()=>{var e={251:(e,t)=>{t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,d=r?i-1:0,h=r?-1:1,l=e[t+d];for(d+=h,s=l&(1<<-f)-1,l>>=-f,f+=a;f>0;s=256*s+e[t+d],d+=h,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=n;f>0;o=256*o+e[t+d],d+=h,f-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,n),s-=u}return(l?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,c,u=8*s-i-1,f=(1<<u)-1,d=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:s-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=f?(a=0,o=f):o+d>=1?(a=(t*c-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+l]=255&a,l+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[r+l]=255&o,l+=p,o/=256,u-=8);e[r+l-p]|=128*y}},287:(e,t,r)=>{\"use strict\";const n=r(526),i=r(251),s=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.hp=c,t.IS=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if(\"string\"==typeof e)return function(e,t){\"string\"==typeof t&&\"\"!==t||(t=\"utf8\");if(!c.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return l(e,t,r);if(\"undefined\"!=typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return l(e,t,r);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return\"number\"!=typeof e.length||J(e.length)?a(0):h(e);if(\"Buffer\"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive](\"string\"),t,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function f(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function d(e){return f(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('\"length\" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=o)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+o.toString(16)+\" bytes\");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return K(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return H(e).length;default:if(i)return n?-1:K(e).length;t=(\"\"+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return N(this,t,r);case\"utf8\":case\"utf-8\":return O(this,t,r);case\"ascii\":return B(this,t,r);case\"latin1\":case\"binary\":return S(this,t,r);case\"base64\":return k(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function b(e,t,r,n,i){let s,o=1,a=e.length,c=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let n=0;n<c;n++)if(u(e,s+n)!==u(t,n)){r=!1;break}if(r)return s}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(t.substr(2*o,2),16);if(J(n))return o;e[r+o]=n}return o}function _(e,t,r,n){return W(K(t,e.length-r),e,r,n)}function x(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return W(H(t),e,r,n)}function A(e,t,r,n){return W(function(e,t){let r,n,i;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,c;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(s=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r=\"\",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(c.prototype,\"parent\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,\"offset\",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?a(e):void 0!==t?\"string\"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(G(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),G(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(G(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?O(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e=\"\";const r=t.IS;return e=this.toString(\"hex\",0,r).replace(/(.{2})/g,\"$1 \").trim(),this.length>r&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(G(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==f[e]){s=u[e],o=f[e];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n=\"utf8\",r=this.length,t=0;else if(void 0===r&&\"string\"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");let s=!1;for(;;)switch(n){case\"hex\":return v(this,e,t,r);case\"utf8\":case\"utf-8\":return _(this,e,t,r);case\"ascii\":case\"latin1\":case\"binary\":return x(this,e,t,r);case\"base64\":return E(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return A(this,e,t,r);default:if(s)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function B(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function S(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function N(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i=\"\";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i=\"\";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>r)throw new RangeError(\"Trying to access beyond buffer length\")}function T(e,t,r,n,i,s){if(!c.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('\"value\" argument is out of bounds');if(r+n>e.length)throw new RangeError(\"Index out of range\")}function C(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function j(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function L(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function $(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,s){return t=+t,r>>>=0,s||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X(function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||D(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=X(function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||D(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X(function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||D(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=X(function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||D(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X(function(e,t=0){return C(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeBigUInt64BE=X(function(e,t=0){return j(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X(function(e,t=0){return C(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeBigInt64BE=X(function(e,t=0){return j(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))}),c.prototype.writeFloatLE=function(e,t,r){return $(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return $(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if(\"string\"==typeof e){if(\"string\"==typeof t?(n=t,t=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!c.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===n&&t<128||\"latin1\"===n)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError(\"Out of range index\");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const s=c.isBuffer(e)?e:c.from(e,n),o=s.length;if(0===o)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};const Z={};function F(e,t,r){Z[e]=class extends r{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function M(e){let t=\"\",r=e.length;const n=\"-\"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,n,i,s){if(e>r||e<t){const n=\"bigint\"==typeof t?\"n\":\"\";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new Z.ERR_OUT_OF_RANGE(\"value\",i,e)}!function(e,t,r){V(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+r]||D(t,e.length-(r+1))}(n,i,s)}function V(e,t){if(\"number\"!=typeof e)throw new Z.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function D(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new Z.ERR_OUT_OF_RANGE(r||\"offset\",\"an integer\",e);if(t<0)throw new Z.ERR_BUFFER_OUT_OF_BOUNDS;throw new Z.ERR_OUT_OF_RANGE(r||\"offset\",`>= ${r?1:0} and <= ${t}`,e)}F(\"ERR_BUFFER_OUT_OF_BOUNDS\",function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"},RangeError),F(\"ERR_INVALID_ARG_TYPE\",function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`},TypeError),F(\"ERR_OUT_OF_RANGE\",function(e,t,r){let n=`The value of \"${e}\" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=M(String(r)):\"bigint\"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=M(i)),i+=\"n\"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const q=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const s=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function H(e){return n.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(q,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return\"undefined\"==typeof BigInt?Q:e}function Q(){throw new Error(\"BigInt not supported\")}},463:e=>{e.exports=o,o.default=o,o.stable=f,o.stableStringify=f;var t=\"[...]\",r=\"[Circular]\",n=[],i=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,r,o){var a;void 0===o&&(o=s()),c(e,\"\",0,[],void 0,0,o);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,h(t),r)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function a(e,t,r,s){var o=Object.getOwnPropertyDescriptor(s,r);void 0!==o.get?o.configurable?(Object.defineProperty(s,r,{value:e}),n.push([s,r,t,o])):i.push([t,r,e]):(s[r]=e,n.push([s,r,t]))}function c(e,n,i,s,o,u,f){var d;if(u+=1,\"object\"==typeof e&&null!==e){for(d=0;d<s.length;d++)if(s[d]===e)return void a(r,e,n,o);if(void 0!==f.depthLimit&&u>f.depthLimit)return void a(t,e,n,o);if(void 0!==f.edgesLimit&&i+1>f.edgesLimit)return void a(t,e,n,o);if(s.push(e),Array.isArray(e))for(d=0;d<e.length;d++)c(e[d],d,d,s,e,u,f);else{var h=Object.keys(e);for(d=0;d<h.length;d++){var l=h[d];c(e[l],l,d,s,e,u,f)}}s.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function f(e,t,r,o){void 0===o&&(o=s());var a,c=d(e,\"\",0,[],void 0,0,o)||e;try{a=0===i.length?JSON.stringify(c,t,r):JSON.stringify(c,h(t),r)}catch(e){return JSON.stringify(\"[unable to serialize, circular reference is too complex to analyze]\")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function d(e,i,s,o,c,f,h){var l;if(f+=1,\"object\"==typeof e&&null!==e){for(l=0;l<o.length;l++)if(o[l]===e)return void a(r,e,i,c);try{if(\"function\"==typeof e.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&f>h.depthLimit)return void a(t,e,i,c);if(void 0!==h.edgesLimit&&s+1>h.edgesLimit)return void a(t,e,i,c);if(o.push(e),Array.isArray(e))for(l=0;l<e.length;l++)d(e[l],l,l,o,e,f,h);else{var p={},y=Object.keys(e).sort(u);for(l=0;l<y.length;l++){var g=y[l];d(e[g],g,l,o,e,f,h),p[g]=e[g]}if(void 0===c)return p;n.push([c,i,e]),c[i]=p}o.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var s=i[n];if(s[1]===t&&s[0]===r){r=s[2],i.splice(n,1);break}}return e.call(this,t,r)}}},526:(e,t)=>{\"use strict\";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=a(e),o=s[0],c=s[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,c)),f=0,d=c>0?o-4:o;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[f++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=16383,a=0,c=n-i;a<c;a+=o)s.push(u(e,a,a+o>c?c:a+o));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+\"==\")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+\"=\"));return s.join(\"\")};for(var r=[],n=[],i=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,s=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(c(n));return i.join(\"\")}n[\"-\".charCodeAt(0)]=62,n[\"_\".charCodeAt(0)]=63},654:(e,t,r)=>{var n=\"__lodash_hash_undefined__\",i=\"[object Function]\",s=\"[object GeneratorFunction]\",o=/^\\[object .+?Constructor\\]$/,a=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c=\"object\"==typeof self&&self&&self.Object===Object&&self,u=a||c||Function(\"return this\")();var f,d=Array.prototype,h=Function.prototype,l=Object.prototype,p=u[\"__core-js_shared__\"],y=(f=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+f:\"\",g=h.toString,m=l.hasOwnProperty,w=l.toString,b=RegExp(\"^\"+g.call(m).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),v=d.splice,_=S(u,\"Map\"),x=S(Object,\"create\");function E(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function A(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function O(e,t){for(var r=e.length;r--;)if(R(e[r][0],t))return r;return-1}function I(e){if(!U(e)||(t=e,y&&y in t))return!1;var t,r=function(e){var t=U(e)?w.call(e):\"\";return t==i||t==s}(e)||function(e){var t=!1;if(null!=e&&\"function\"!=typeof e.toString)try{t=!!(e+\"\")}catch(e){}return t}(e)?b:o;return r.test(function(e){if(null!=e){try{return g.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}(e))}function B(e,t){var r=e.__data__;return function(e){var t=typeof e;return\"string\"==t||\"number\"==t||\"symbol\"==t||\"boolean\"==t?\"__proto__\"!==e:null===e}(t)?r[\"string\"==typeof t?\"string\":\"hash\"]:r.map}function S(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return I(r)?r:void 0}function N(e,t){if(\"function\"!=typeof e||t&&\"function\"!=typeof t)throw new TypeError(\"Expected a function\");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o),o};return r.cache=new(N.Cache||k),r}function R(e,t){return e===t||e!=e&&t!=t}function U(e){var t=typeof e;return!!e&&(\"object\"==t||\"function\"==t)}E.prototype.clear=function(){this.__data__=x?x(null):{}},E.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},E.prototype.get=function(e){var t=this.__data__;if(x){var r=t[e];return r===n?void 0:r}return m.call(t,e)?t[e]:void 0},E.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:m.call(t,e)},E.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?n:t,this},A.prototype.clear=function(){this.__data__=[]},A.prototype.delete=function(e){var t=this.__data__,r=O(t,e);return!(r<0)&&(r==t.length-1?t.pop():v.call(t,r,1),!0)},A.prototype.get=function(e){var t=this.__data__,r=O(t,e);return r<0?void 0:t[r][1]},A.prototype.has=function(e){return O(this.__data__,e)>-1},A.prototype.set=function(e,t){var r=this.__data__,n=O(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},k.prototype.clear=function(){this.__data__={hash:new E,map:new(_||A),string:new E}},k.prototype.delete=function(e){return B(this,e).delete(e)},k.prototype.get=function(e){return B(this,e).get(e)},k.prototype.has=function(e){return B(this,e).has(e)},k.prototype.set=function(e,t){return B(this,e).set(e,t),this},N.Cache=k,e.exports=N}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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})};var n={};(()=>{\"use strict\";function e(e){return Boolean(e)&&\"object\"==typeof e&&!Array.isArray(e)}r.r(n),r.d(n,{INTERNAL_ORIGINS:()=>Zo,getSaltByOrigin:()=>Fo,onRpcRequest:()=>Mo});const t=(e,t)=>Object.hasOwnProperty.call(e,t);var i;!function(e){e[e.Null=4]=\"Null\",e[e.Comma=1]=\"Comma\",e[e.Wrapper=1]=\"Wrapper\",e[e.True=4]=\"True\",e[e.False=5]=\"False\",e[e.Quote=1]=\"Quote\",e[e.Colon=1]=\"Colon\",e[e.Date=24]=\"Date\"}(i=i||(i={}));var s=r(463);class o extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...s}=e,{path:o}=e,a=0===o.length?n:`At path: ${o.join(\".\")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function a(e){return\"object\"==typeof e&&null!==e}function c(e){return\"symbol\"==typeof e?e.toString():\"string\"==typeof e?JSON.stringify(e):`${e}`}function u(e,t,r,n){if(!0===e)return;!1===e?e={}:\"string\"==typeof e&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:u=`Expected a value of type \\`${o}\\`${a?` with refinement \\`${a}\\``:\"\"}, but received: \\`${c(n)}\\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*f(e,t,r,n){(function(e){return a(e)&&\"function\"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=u(i,t,r,n);e&&(yield e)}}function*d(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),o&&\"type\"!==t.type&&a(t.schema)&&a(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=\"valid\";for(const n of t.validator(e,c))n.explanation=r.message,u=\"not_valid\",yield[n,void 0];for(let[f,h,l]of t.entries(e,c)){const t=d(h,l,{path:void 0===f?n:[...n,f],branch:void 0===f?i:[...i,h],coerce:s,mask:o,message:r.message});for(const r of t)r[0]?(u=null===r[0].refinement||void 0===r[0].refinement?\"not_valid\":\"not_refined\",yield[r[0],void 0]):s&&(h=r[1],void 0===f?e=h:e instanceof Map?e.set(f,h):e instanceof Set?e.add(h):a(e)&&(void 0!==h||f in e)&&(e[f]=h))}if(\"not_valid\"!==u)for(const n of t.refiner(e,c))n.explanation=r.message,u=\"not_refined\",yield[n,void 0];\"valid\"===u&&(yield[void 0,e])}class h{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:s=e=>e,entries:o=function*(){}}=e;this.type=t,this.schema=r,this.entries=o,this.coercer=s,this.validator=n?(e,t)=>f(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>f(i(e,t),t,this,e):()=>[]}assert(e,t){return function(e,t,r){const n=m(e,t,{message:r});if(n[0])throw n[0]}(e,this,t)}create(e,t){return y(e,this,t)}is(e){return g(e,this)}mask(e,t){return function(e,t,r){const n=m(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}(e,this,t)}validate(e,t={}){return m(e,this,t)}}const l=\"EXACT_OPTIONAL\";class p extends h{constructor(e){super({...e,type:`exact optional ${e.type}`}),this.brand=l}static isExactOptional(e){return a(e)&&\"brand\"in e&&e.brand===l}}function y(e,t,r){const n=m(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function g(e,t){return!m(e,t)[0]}function m(e,t,r={}){const n=d(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(i[0]){return[new o(i[0],function*(){for(const e of n)e[0]&&(yield e[0])}),void 0]}return[void 0,i[1]]}function w(e,t){return new h({type:e,schema:null,validator:t})}function b(){return w(\"never\",()=>!1)}function v(e){const t=e?Object.keys(e):[],r=b();return new h({type:\"object\",schema:e??null,*entries(n){if(e&&a(n)){const i=new Set(Object.keys(n));for(const r of t){i.delete(r);const t=e[r];p.isExactOptional(t)&&!Object.prototype.hasOwnProperty.call(n,r)||(yield[r,n[r],e[r]])}for(const e of i)yield[e,n[e],r]}},validator:e=>a(e)||`Expected an object, but received: ${c(e)}`,coercer:e=>a(e)?{...e}:e})}function _(e){return new h({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function x(){return w(\"string\",e=>\"string\"==typeof e||`Expected a string, but received: ${c(e)}`)}function E(e){const t=e.map(e=>e.type).join(\" | \");return new h({type:\"union\",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=d(r,t,n),[s]=e;if(!s?.[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${c(r)}`,...i]}})}function A(e,t,r){return new h({...e,coercer:(n,i)=>g(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function k(e,t){return O(e,\"pattern\",r=>t.test(r)||`Expected a ${e.type} matching \\`/${t.source}/\\` but received \"${r}\"`)}function O(e,t,r){return new h({...e,*refiner(n,i){yield*e.refiner(n,i);const s=f(r(n,i),i,e,n);for(const e of s)yield{...e,refinement:t}}})}const I=e=>v(e);function B({path:e,branch:r}){const n=e[e.length-1];return t(r[r.length-2],n)}function S(e){return new h({...e,type:`optional ${e.type}`,validator:(t,r)=>!B(r)||e.validator(t,r),refiner:(t,r)=>!B(r)||e.refiner(t,r)})}function N(e){if(null===e||\"boolean\"==typeof e||\"string\"==typeof e)return!0;if(\"number\"==typeof e&&Number.isFinite(e))return!0;if(\"object\"==typeof e){let t=!0;if(Array.isArray(e)){for(let r=0;r<e.length;r++)if(!N(e[r])){t=!1;break}return t}const r=Object.entries(e);for(let e=0;e<r.length;e++)if(\"string\"!=typeof r[e][0]||!N(r[e][1])){t=!1;break}return t}return!1}const R=w(\"JSON\",e=>N(e)),U=A(R,O(w(\"any\",()=>!0),\"JSON\",e=>g(e,R)),e=>JSON.parse(JSON.stringify(e,(e,t)=>{if(\"__proto__\"!==e&&\"constructor\"!==e)return t})));function T(e){try{return function(e){y(e,U)}(e),!0}catch{return!1}}const C=function(e){const t=c(e),r=typeof e;return new h({type:\"literal\",schema:\"string\"===r||\"number\"===r||\"boolean\"===r?e:null,validator:r=>r===e||`Expected the literal \\`${t}\\`, but received: ${c(r)}`})}(\"2.0\"),j=(L=E([w(\"number\",e=>\"number\"==typeof e&&!isNaN(e)||`Expected a number, but received: ${c(e)}`),x()]),new h({...L,validator:(e,t)=>null===e||L.validator(e,t),refiner:(e,t)=>null===e||L.refiner(e,t)}));var L;const $=I({code:w(\"integer\",e=>\"number\"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${c(e)}`),message:x(),data:S(U),stack:S(x())}),P=E([(F=x(),M=U,new h({type:\"record\",schema:null,*entries(e){if(a(e))for(const t in e){const r=e[t];yield[t,t,F],yield[t,r,M]}},validator:e=>a(e)||`Expected an object, but received: ${c(e)}`})),(Z=U,new h({type:\"array\",schema:Z,*entries(e){if(Z&&Array.isArray(e))for(const[t,r]of e.entries())yield[t,r,Z]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${c(e)}`}))]);var Z,F,M;I({id:j,jsonrpc:C,method:x(),params:S(P)}),I({jsonrpc:C,method:x(),params:S(P)});v({id:j,jsonrpc:C,result:_(w(\"unknown\",()=>!0)),error:_($)});const z=I({id:j,jsonrpc:C,result:U}),V=I({id:j,jsonrpc:C,error:$});E([z,V]);const D={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},q={\"-32700\":{standard:\"JSON RPC 2.0\",message:\"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.\"},\"-32600\":{standard:\"JSON RPC 2.0\",message:\"The JSON sent is not a valid Request object.\"},\"-32601\":{standard:\"JSON RPC 2.0\",message:\"The method does not exist / is not available.\"},\"-32602\":{standard:\"JSON RPC 2.0\",message:\"Invalid method parameter(s).\"},\"-32603\":{standard:\"JSON RPC 2.0\",message:\"Internal JSON-RPC error.\"},\"-32000\":{standard:\"EIP-1474\",message:\"Invalid input.\"},\"-32001\":{standard:\"EIP-1474\",message:\"Resource not found.\"},\"-32002\":{standard:\"EIP-1474\",message:\"Resource unavailable.\"},\"-32003\":{standard:\"EIP-1474\",message:\"Transaction rejected.\"},\"-32004\":{standard:\"EIP-1474\",message:\"Method not supported.\"},\"-32005\":{standard:\"EIP-1474\",message:\"Request limit exceeded.\"},4001:{standard:\"EIP-1193\",message:\"User rejected the request.\"},4100:{standard:\"EIP-1193\",message:\"The requested account and/or method has not been authorized by the user.\"},4200:{standard:\"EIP-1193\",message:\"The requested method is not supported by this Ethereum provider.\"},4900:{standard:\"EIP-1193\",message:\"The provider is disconnected from all chains.\"},4901:{standard:\"EIP-1193\",message:\"The provider is disconnected from the specified chain.\"}},K=D.internal,H=(W(K),\"Unspecified server error.\");function W(e,r=\"Unspecified error message. This is a bug, please report it.\"){if(function(e){return Number.isInteger(e)}(e)){const r=e.toString();if(t(q,r))return q[r].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return H}return r}function G(t){return Array.isArray(t)?t.map(t=>T(t)?t:e(t)?J(t):null):e(t)?J(t):T(t)?t:null}function J(e){return Object.getOwnPropertyNames(e).reduce((t,r)=>{const n=e[r];return T(n)&&(t[r]=n),t},{})}const Y=function(e){return e?.__esModule?e.default:e}(s);class X extends Error{constructor(r,n,i){if(!Number.isInteger(r))throw new Error('\"code\" must be an integer.');if(!n||\"string\"!=typeof n)throw new Error('\"message\" must be a non-empty string.');!function(r){return e(r)&&t(r,\"cause\")&&e(r.cause)}(i)?super(n):(super(n,{cause:i.cause}),t(this,\"cause\")||Object.assign(this,{cause:i.cause})),void 0!==i&&(this.data=i),this.code=r}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if(\"object\"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=G(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return Y(this.serialize(),Q,2)}}function Q(e,t){if(\"[Circular]\"!==t)return t}const ee=e=>re(D.invalidParams,e),te=e=>re(D.methodNotFound,e);function re(e,t){const[r,n]=ne(t);return new X(e,r??W(e),n)}function ne(e){if(e){if(\"string\"==typeof e)return[e];if(\"object\"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&\"string\"!=typeof t)throw new Error(\"Must specify string message.\");return[t??void 0,r]}}return[]}var ie,se;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>\"number\"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=\"function\"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger=\"function\"==typeof Number.isInteger?e=>Number.isInteger(e):e=>\"number\"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=\" | \"){return e.map(e=>\"string\"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>\"bigint\"==typeof t?t.toString():t}(ie||(ie={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(se||(se={}));const oe=ie.arrayToEnum([\"string\",\"nan\",\"number\",\"integer\",\"float\",\"boolean\",\"date\",\"bigint\",\"symbol\",\"function\",\"undefined\",\"null\",\"array\",\"object\",\"unknown\",\"promise\",\"void\",\"never\",\"map\",\"set\"]),ae=e=>{switch(typeof e){case\"undefined\":return oe.undefined;case\"string\":return oe.string;case\"number\":return Number.isNaN(e)?oe.nan:oe.number;case\"boolean\":return oe.boolean;case\"function\":return oe.function;case\"bigint\":return oe.bigint;case\"symbol\":return oe.symbol;case\"object\":return Array.isArray(e)?oe.array:null===e?oe.null:e.then&&\"function\"==typeof e.then&&e.catch&&\"function\"==typeof e.catch?oe.promise:\"undefined\"!=typeof Map&&e instanceof Map?oe.map:\"undefined\"!=typeof Set&&e instanceof Set?oe.set:\"undefined\"!=typeof Date&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},ce=ie.arrayToEnum([\"invalid_type\",\"invalid_literal\",\"custom\",\"invalid_union\",\"invalid_union_discriminator\",\"invalid_enum_value\",\"unrecognized_keys\",\"invalid_arguments\",\"invalid_return_type\",\"invalid_date\",\"invalid_string\",\"too_small\",\"too_big\",\"invalid_intersection_types\",\"not_multiple_of\",\"not_finite\"]);class ue extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=\"ZodError\",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if(\"invalid_union\"===i.code)i.unionErrors.map(n);else if(\"invalid_return_type\"===i.code)n(i.returnTypeError);else if(\"invalid_arguments\"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){const r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof ue))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ie.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ue.create=e=>new ue(e);const fe=(e,t)=>{let r;switch(e.code){case ce.invalid_type:r=e.received===oe.undefined?\"Required\":`Expected ${e.expected}, received ${e.received}`;break;case ce.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ie.jsonStringifyReplacer)}`;break;case ce.unrecognized_keys:r=`Unrecognized key(s) in object: ${ie.joinValues(e.keys,\", \")}`;break;case ce.invalid_union:r=\"Invalid input\";break;case ce.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ie.joinValues(e.options)}`;break;case ce.invalid_enum_value:r=`Invalid enum value. Expected ${ie.joinValues(e.options)}, received '${e.received}'`;break;case ce.invalid_arguments:r=\"Invalid function arguments\";break;case ce.invalid_return_type:r=\"Invalid function return type\";break;case ce.invalid_date:r=\"Invalid date\";break;case ce.invalid_string:\"object\"==typeof e.validation?\"includes\"in e.validation?(r=`Invalid input: must include \"${e.validation.includes}\"`,\"number\"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):\"startsWith\"in e.validation?r=`Invalid input: must start with \"${e.validation.startsWith}\"`:\"endsWith\"in e.validation?r=`Invalid input: must end with \"${e.validation.endsWith}\"`:ie.assertNever(e.validation):r=\"regex\"!==e.validation?`Invalid ${e.validation}`:\"Invalid\";break;case ce.too_small:r=\"array\"===e.type?`Array must contain ${e.exact?\"exactly\":e.inclusive?\"at least\":\"more than\"} ${e.minimum} element(s)`:\"string\"===e.type?`String must contain ${e.exact?\"exactly\":e.inclusive?\"at least\":\"over\"} ${e.minimum} character(s)`:\"number\"===e.type||\"bigint\"===e.type?`Number must be ${e.exact?\"exactly equal to \":e.inclusive?\"greater than or equal to \":\"greater than \"}${e.minimum}`:\"date\"===e.type?`Date must be ${e.exact?\"exactly equal to \":e.inclusive?\"greater than or equal to \":\"greater than \"}${new Date(Number(e.minimum))}`:\"Invalid input\";break;case ce.too_big:r=\"array\"===e.type?`Array must contain ${e.exact?\"exactly\":e.inclusive?\"at most\":\"less than\"} ${e.maximum} element(s)`:\"string\"===e.type?`String must contain ${e.exact?\"exactly\":e.inclusive?\"at most\":\"under\"} ${e.maximum} character(s)`:\"number\"===e.type?`Number must be ${e.exact?\"exactly\":e.inclusive?\"less than or equal to\":\"less than\"} ${e.maximum}`:\"bigint\"===e.type?`BigInt must be ${e.exact?\"exactly\":e.inclusive?\"less than or equal to\":\"less than\"} ${e.maximum}`:\"date\"===e.type?`Date must be ${e.exact?\"exactly\":e.inclusive?\"smaller than or equal to\":\"smaller than\"} ${new Date(Number(e.maximum))}`:\"Invalid input\";break;case ce.custom:r=\"Invalid input\";break;case ce.invalid_intersection_types:r=\"Intersection results could not be merged\";break;case ce.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ce.not_finite:r=\"Number must be finite\";break;default:r=t.defaultError,ie.assertNever(e)}return{message:r}};let de=fe;function he(){return de}var le;!function(e){e.errToObj=e=>\"string\"==typeof e?{message:e}:e||{},e.toString=e=>\"string\"==typeof e?e:e?.message}(le||(le={}));const pe=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],o={...i,path:s};if(void 0!==i.message)return{...i,path:s,message:i.message};let a=\"\";const c=n.filter(e=>!!e).slice().reverse();for(const e of c)a=e(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}};function ye(e,t){const r=he(),n=pe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===fe?void 0:fe].filter(e=>!!e)});e.common.issues.push(n)}class ge{constructor(){this.value=\"valid\"}dirty(){\"valid\"===this.value&&(this.value=\"dirty\")}abort(){\"aborted\"!==this.value&&(this.value=\"aborted\")}static mergeArray(e,t){const r=[];for(const n of t){if(\"aborted\"===n.status)return me;\"dirty\"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return ge.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:i}=n;if(\"aborted\"===t.status)return me;if(\"aborted\"===i.status)return me;\"dirty\"===t.status&&e.dirty(),\"dirty\"===i.status&&e.dirty(),\"__proto__\"===t.value||void 0===i.value&&!n.alwaysSet||(r[t.value]=i.value)}return{status:e.value,value:r}}}const me=Object.freeze({status:\"aborted\"}),we=e=>({status:\"dirty\",value:e}),be=e=>({status:\"valid\",value:e}),ve=e=>\"aborted\"===e.status,_e=e=>\"dirty\"===e.status,xe=e=>\"valid\"===e.status,Ee=e=>\"undefined\"!=typeof Promise&&e instanceof Promise;class Ae{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ke=(e,t)=>{if(xe(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error(\"Validation failed but no issues detected.\");return{success:!1,get error(){if(this._error)return this._error;const t=new ue(e.common.issues);return this._error=t,this._error}}};function Oe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\\'t use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(t,i)=>{const{message:s}=e;return\"invalid_enum_value\"===t.code?{message:s??i.defaultError}:void 0===i.data?{message:s??n??i.defaultError}:\"invalid_type\"!==t.code?{message:i.defaultError}:{message:s??r??i.defaultError}},description:i}}class Ie{get description(){return this._def.description}_getType(e){return ae(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ge,ctx:{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ee(t))throw new Error(\"Synchronous parse encountered promise.\");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},n=this._parseSync({data:e,path:r.path,parent:r});return ke(r,n)}\"~validate\"(e){const t={common:{issues:[],async:!!this[\"~standard\"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)};if(!this[\"~standard\"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return xe(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(\"encountered\")&&(this[\"~standard\"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>xe(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await(Ee(n)?n:Promise.resolve(n));return ke(r,i)}refine(e,t){const r=e=>\"string\"==typeof t||void 0===t?{message:t}:\"function\"==typeof t?t(e):t;return this._refinement((t,n)=>{const i=e(t),s=()=>n.addIssue({code:ce.custom,...r(t)});return\"undefined\"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(s(),!1)):!!i||(s(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue(\"function\"==typeof t?t(r,n):t),!1))}_refinement(e){return new kt({schema:this,typeName:Ct.ZodEffects,effect:{type:\"refinement\",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[\"~standard\"]={version:1,vendor:\"zod\",validate:e=>this[\"~validate\"](e)}}optional(){return Ot.create(this,this._def)}nullable(){return It.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ft.create(this)}promise(){return At.create(this,this._def)}or(e){return lt.create([this,e],this._def)}and(e){return yt.create(this,e,this._def)}transform(e){return new kt({...Oe(this._def),schema:this,typeName:Ct.ZodEffects,effect:{type:\"transform\",transform:e}})}default(e){const t=\"function\"==typeof e?e:()=>e;return new Bt({...Oe(this._def),innerType:this,defaultValue:t,typeName:Ct.ZodDefault})}brand(){return new Rt({typeName:Ct.ZodBranded,type:this,...Oe(this._def)})}catch(e){const t=\"function\"==typeof e?e:()=>e;return new St({...Oe(this._def),innerType:this,catchValue:t,typeName:Ct.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ut.create(this,e)}readonly(){return Tt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Be=/^c[^\\s-]{8,}$/i,Se=/^[0-9a-z]+$/,Ne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Re=/^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i,Ue=/^[a-z0-9_-]{21}$/i,Te=/^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/,Ce=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,je=/^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;let Le;const $e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/,Ze=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Me=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ze=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ve=\"((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))\",De=new RegExp(`^${Ve}$`);function qe(e){let t=\"[0-5]\\\\d\";e.precision?t=`${t}\\\\.\\\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\\\.\\\\d+)?`);return`([01]\\\\d|2[0-3]):[0-5]\\\\d(:${t})${e.precision?\"+\":\"?\"}`}function Ke(e){return new RegExp(`^${qe(e)}$`)}function He(e){let t=`${Ve}T${qe(e)}`;const r=[];return r.push(e.local?\"Z?\":\"Z\"),e.offset&&r.push(\"([+-]\\\\d{2}:?\\\\d{2})\"),t=`${t}(${r.join(\"|\")})`,new RegExp(`^${t}$`)}function We(e,t){return!(\"v4\"!==t&&t||!$e.test(e))||!(\"v6\"!==t&&t||!Ze.test(e))}function Ge(e,t){if(!Te.test(e))return!1;try{const[r]=e.split(\".\");if(!r)return!1;const n=r.replace(/-/g,\"+\").replace(/_/g,\"/\").padEnd(r.length+(4-r.length%4)%4,\"=\"),i=JSON.parse(atob(n));return\"object\"==typeof i&&null!==i&&((!(\"typ\"in i)||\"JWT\"===i?.typ)&&(!!i.alg&&(!t||i.alg===t)))}catch{return!1}}function Je(e,t){return!(\"v4\"!==t&&t||!Pe.test(e))||!(\"v6\"!==t&&t||!Fe.test(e))}class Ye extends Ie{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==oe.string){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.string,received:t.parsedType}),me}const t=new ge;let r;for(const n of this._def.checks)if(\"min\"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.too_small,minimum:n.value,type:\"string\",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if(\"max\"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.too_big,maximum:n.value,type:\"string\",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if(\"length\"===n.kind){const i=e.data.length>n.value,s=e.data.length<n.value;(i||s)&&(r=this._getOrReturnCtx(e,r),i?ye(r,{code:ce.too_big,maximum:n.value,type:\"string\",inclusive:!0,exact:!0,message:n.message}):s&&ye(r,{code:ce.too_small,minimum:n.value,type:\"string\",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if(\"email\"===n.kind)je.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"email\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"emoji\"===n.kind)Le||(Le=new RegExp(\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\",\"u\")),Le.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"emoji\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"uuid\"===n.kind)Re.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"uuid\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"nanoid\"===n.kind)Ue.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"nanoid\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"cuid\"===n.kind)Be.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"cuid\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"cuid2\"===n.kind)Se.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"cuid2\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"ulid\"===n.kind)Ne.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"ulid\",code:ce.invalid_string,message:n.message}),t.dirty());else if(\"url\"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ye(r,{validation:\"url\",code:ce.invalid_string,message:n.message}),t.dirty()}else if(\"regex\"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"regex\",code:ce.invalid_string,message:n.message}),t.dirty())}else if(\"trim\"===n.kind)e.data=e.data.trim();else if(\"includes\"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if(\"toLowerCase\"===n.kind)e.data=e.data.toLowerCase();else if(\"toUpperCase\"===n.kind)e.data=e.data.toUpperCase();else if(\"startsWith\"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if(\"endsWith\"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if(\"datetime\"===n.kind){He(n).test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.invalid_string,validation:\"datetime\",message:n.message}),t.dirty())}else if(\"date\"===n.kind){De.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.invalid_string,validation:\"date\",message:n.message}),t.dirty())}else if(\"time\"===n.kind){Ke(n).test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.invalid_string,validation:\"time\",message:n.message}),t.dirty())}else\"duration\"===n.kind?Ce.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"duration\",code:ce.invalid_string,message:n.message}),t.dirty()):\"ip\"===n.kind?We(e.data,n.version)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"ip\",code:ce.invalid_string,message:n.message}),t.dirty()):\"jwt\"===n.kind?Ge(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"jwt\",code:ce.invalid_string,message:n.message}),t.dirty()):\"cidr\"===n.kind?Je(e.data,n.version)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"cidr\",code:ce.invalid_string,message:n.message}),t.dirty()):\"base64\"===n.kind?Me.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"base64\",code:ce.invalid_string,message:n.message}),t.dirty()):\"base64url\"===n.kind?ze.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:\"base64url\",code:ce.invalid_string,message:n.message}),t.dirty()):ie.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:ce.invalid_string,...le.errToObj(r)})}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:\"email\",...le.errToObj(e)})}url(e){return this._addCheck({kind:\"url\",...le.errToObj(e)})}emoji(e){return this._addCheck({kind:\"emoji\",...le.errToObj(e)})}uuid(e){return this._addCheck({kind:\"uuid\",...le.errToObj(e)})}nanoid(e){return this._addCheck({kind:\"nanoid\",...le.errToObj(e)})}cuid(e){return this._addCheck({kind:\"cuid\",...le.errToObj(e)})}cuid2(e){return this._addCheck({kind:\"cuid2\",...le.errToObj(e)})}ulid(e){return this._addCheck({kind:\"ulid\",...le.errToObj(e)})}base64(e){return this._addCheck({kind:\"base64\",...le.errToObj(e)})}base64url(e){return this._addCheck({kind:\"base64url\",...le.errToObj(e)})}jwt(e){return this._addCheck({kind:\"jwt\",...le.errToObj(e)})}ip(e){return this._addCheck({kind:\"ip\",...le.errToObj(e)})}cidr(e){return this._addCheck({kind:\"cidr\",...le.errToObj(e)})}datetime(e){return\"string\"==typeof e?this._addCheck({kind:\"datetime\",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:\"datetime\",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...le.errToObj(e?.message)})}date(e){return this._addCheck({kind:\"date\",message:e})}time(e){return\"string\"==typeof e?this._addCheck({kind:\"time\",precision:null,message:e}):this._addCheck({kind:\"time\",precision:void 0===e?.precision?null:e?.precision,...le.errToObj(e?.message)})}duration(e){return this._addCheck({kind:\"duration\",...le.errToObj(e)})}regex(e,t){return this._addCheck({kind:\"regex\",regex:e,...le.errToObj(t)})}includes(e,t){return this._addCheck({kind:\"includes\",value:e,position:t?.position,...le.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:\"startsWith\",value:e,...le.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:\"endsWith\",value:e,...le.errToObj(t)})}min(e,t){return this._addCheck({kind:\"min\",value:e,...le.errToObj(t)})}max(e,t){return this._addCheck({kind:\"max\",value:e,...le.errToObj(t)})}length(e,t){return this._addCheck({kind:\"length\",value:e,...le.errToObj(t)})}nonempty(e){return this.min(1,le.errToObj(e))}trim(){return new Ye({...this._def,checks:[...this._def.checks,{kind:\"trim\"}]})}toLowerCase(){return new Ye({...this._def,checks:[...this._def.checks,{kind:\"toLowerCase\"}]})}toUpperCase(){return new Ye({...this._def,checks:[...this._def.checks,{kind:\"toUpperCase\"}]})}get isDatetime(){return!!this._def.checks.find(e=>\"datetime\"===e.kind)}get isDate(){return!!this._def.checks.find(e=>\"date\"===e.kind)}get isTime(){return!!this._def.checks.find(e=>\"time\"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>\"duration\"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>\"email\"===e.kind)}get isURL(){return!!this._def.checks.find(e=>\"url\"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>\"emoji\"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>\"uuid\"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>\"nanoid\"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>\"cuid\"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>\"cuid2\"===e.kind)}get isULID(){return!!this._def.checks.find(e=>\"ulid\"===e.kind)}get isIP(){return!!this._def.checks.find(e=>\"ip\"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>\"cidr\"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>\"base64\"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>\"base64url\"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)\"min\"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)\"max\"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Xe(e,t){const r=(e.toString().split(\".\")[1]||\"\").length,n=(t.toString().split(\".\")[1]||\"\").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(\".\",\"\"))%Number.parseInt(t.toFixed(i).replace(\".\",\"\"))/10**i}Ye.create=e=>new Ye({checks:[],typeName:Ct.ZodString,coerce:e?.coerce??!1,...Oe(e)});class Qe extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==oe.number){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.number,received:t.parsedType}),me}let t;const r=new ge;for(const n of this._def.checks)if(\"int\"===n.kind)ie.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.invalid_type,expected:\"integer\",received:\"float\",message:n.message}),r.dirty());else if(\"min\"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.too_small,minimum:n.value,type:\"number\",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if(\"max\"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.too_big,maximum:n.value,type:\"number\",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else\"multipleOf\"===n.kind?0!==Xe(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):\"finite\"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.not_finite,message:n.message}),r.dirty()):ie.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit(\"min\",e,!0,le.toString(t))}gt(e,t){return this.setLimit(\"min\",e,!1,le.toString(t))}lte(e,t){return this.setLimit(\"max\",e,!0,le.toString(t))}lt(e,t){return this.setLimit(\"max\",e,!1,le.toString(t))}setLimit(e,t,r,n){return new Qe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:le.toString(n)}]})}_addCheck(e){return new Qe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:\"int\",message:le.toString(e)})}positive(e){return this._addCheck({kind:\"min\",value:0,inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:\"max\",value:0,inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:\"max\",value:0,inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:\"min\",value:0,inclusive:!0,message:le.toString(e)})}multipleOf(e,t){return this._addCheck({kind:\"multipleOf\",value:e,message:le.toString(t)})}finite(e){return this._addCheck({kind:\"finite\",message:le.toString(e)})}safe(e){return this._addCheck({kind:\"min\",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:le.toString(e)})._addCheck({kind:\"max\",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:le.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)\"min\"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)\"max\"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>\"int\"===e.kind||\"multipleOf\"===e.kind&&ie.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(\"finite\"===r.kind||\"int\"===r.kind||\"multipleOf\"===r.kind)return!0;\"min\"===r.kind?(null===t||r.value>t)&&(t=r.value):\"max\"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Qe.create=e=>new Qe({checks:[],typeName:Ct.ZodNumber,coerce:e?.coerce||!1,...Oe(e)});class et extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==oe.bigint)return this._getInvalidInput(e);let t;const r=new ge;for(const n of this._def.checks)if(\"min\"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.too_small,type:\"bigint\",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if(\"max\"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.too_big,type:\"bigint\",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else\"multipleOf\"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),ye(t,{code:ce.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):ie.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.bigint,received:t.parsedType}),me}gte(e,t){return this.setLimit(\"min\",e,!0,le.toString(t))}gt(e,t){return this.setLimit(\"min\",e,!1,le.toString(t))}lte(e,t){return this.setLimit(\"max\",e,!0,le.toString(t))}lt(e,t){return this.setLimit(\"max\",e,!1,le.toString(t))}setLimit(e,t,r,n){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:le.toString(n)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:\"min\",value:BigInt(0),inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:\"max\",value:BigInt(0),inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:\"max\",value:BigInt(0),inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:\"min\",value:BigInt(0),inclusive:!0,message:le.toString(e)})}multipleOf(e,t){return this._addCheck({kind:\"multipleOf\",value:e,message:le.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)\"min\"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)\"max\"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}et.create=e=>new et({checks:[],typeName:Ct.ZodBigInt,coerce:e?.coerce??!1,...Oe(e)});class tt extends Ie{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==oe.boolean){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.boolean,received:t.parsedType}),me}return be(e.data)}}tt.create=e=>new tt({typeName:Ct.ZodBoolean,coerce:e?.coerce||!1,...Oe(e)});class rt extends Ie{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==oe.date){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.date,received:t.parsedType}),me}if(Number.isNaN(e.data.getTime())){return ye(this._getOrReturnCtx(e),{code:ce.invalid_date}),me}const t=new ge;let r;for(const n of this._def.checks)\"min\"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:\"date\"}),t.dirty()):\"max\"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ce.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:\"date\"}),t.dirty()):ie.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:\"min\",value:e.getTime(),message:le.toString(t)})}max(e,t){return this._addCheck({kind:\"max\",value:e.getTime(),message:le.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)\"min\"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)\"max\"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}rt.create=e=>new rt({checks:[],coerce:e?.coerce||!1,typeName:Ct.ZodDate,...Oe(e)});class nt extends Ie{_parse(e){if(this._getType(e)!==oe.symbol){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.symbol,received:t.parsedType}),me}return be(e.data)}}nt.create=e=>new nt({typeName:Ct.ZodSymbol,...Oe(e)});class it extends Ie{_parse(e){if(this._getType(e)!==oe.undefined){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.undefined,received:t.parsedType}),me}return be(e.data)}}it.create=e=>new it({typeName:Ct.ZodUndefined,...Oe(e)});class st extends Ie{_parse(e){if(this._getType(e)!==oe.null){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.null,received:t.parsedType}),me}return be(e.data)}}st.create=e=>new st({typeName:Ct.ZodNull,...Oe(e)});class ot extends Ie{constructor(){super(...arguments),this._any=!0}_parse(e){return be(e.data)}}ot.create=e=>new ot({typeName:Ct.ZodAny,...Oe(e)});class at extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(e){return be(e.data)}}at.create=e=>new at({typeName:Ct.ZodUnknown,...Oe(e)});class ct extends Ie{_parse(e){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.never,received:t.parsedType}),me}}ct.create=e=>new ct({typeName:Ct.ZodNever,...Oe(e)});class ut extends Ie{_parse(e){if(this._getType(e)!==oe.undefined){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.void,received:t.parsedType}),me}return be(e.data)}}ut.create=e=>new ut({typeName:Ct.ZodVoid,...Oe(e)});class ft extends Ie{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==oe.array)return ye(t,{code:ce.invalid_type,expected:oe.array,received:t.parsedType}),me;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(ye(t,{code:e?ce.too_big:ce.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:\"array\",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(ye(t,{code:ce.too_small,minimum:n.minLength.value,type:\"array\",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(ye(t,{code:ce.too_big,maximum:n.maxLength.value,type:\"array\",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new Ae(t,e,t.path,r)))).then(e=>ge.mergeArray(r,e));const i=[...t.data].map((e,r)=>n.type._parseSync(new Ae(t,e,t.path,r)));return ge.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ft({...this._def,minLength:{value:e,message:le.toString(t)}})}max(e,t){return new ft({...this._def,maxLength:{value:e,message:le.toString(t)}})}length(e,t){return new ft({...this._def,exactLength:{value:e,message:le.toString(t)}})}nonempty(e){return this.min(1,e)}}function dt(e){if(e instanceof ht){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Ot.create(dt(n))}return new ht({...e._def,shape:()=>t})}return e instanceof ft?new ft({...e._def,type:dt(e.element)}):e instanceof Ot?Ot.create(dt(e.unwrap())):e instanceof It?It.create(dt(e.unwrap())):e instanceof gt?gt.create(e.items.map(e=>dt(e))):e}ft.create=(e,t)=>new ft({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ct.ZodArray,...Oe(t)});class ht extends Ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=ie.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==oe.object){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.object,received:t.parsedType}),me}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof ct&&\"strip\"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||s.push(e);const o=[];for(const e of i){const t=n[e],i=r.data[e];o.push({key:{status:\"valid\",value:e},value:t._parse(new Ae(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ct){const e=this._def.unknownKeys;if(\"passthrough\"===e)for(const e of s)o.push({key:{status:\"valid\",value:e},value:{status:\"valid\",value:r.data[e]}});else if(\"strict\"===e)s.length>0&&(ye(r,{code:ce.unrecognized_keys,keys:s}),t.dirty());else if(\"strip\"!==e)throw new Error(\"Internal ZodObject error: invalid unknownKeys value.\")}else{const e=this._def.catchall;for(const t of s){const n=r.data[t];o.push({key:{status:\"valid\",value:t},value:e._parse(new Ae(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of o){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>ge.mergeObjectSync(t,e)):ge.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return le.errToObj,new ht({...this._def,unknownKeys:\"strict\",...void 0!==e?{errorMap:(t,r)=>{const n=this._def.errorMap?.(t,r).message??r.defaultError;return\"unrecognized_keys\"===t.code?{message:le.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new ht({...this._def,unknownKeys:\"strip\"})}passthrough(){return new ht({...this._def,unknownKeys:\"passthrough\"})}extend(e){return new ht({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ht({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ct.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ht({...this._def,catchall:e})}pick(e){const t={};for(const r of ie.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new ht({...this._def,shape:()=>t})}omit(e){const t={};for(const r of ie.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new ht({...this._def,shape:()=>t})}deepPartial(){return dt(this)}partial(e){const t={};for(const r of ie.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new ht({...this._def,shape:()=>t})}required(e){const t={};for(const r of ie.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Ot;)e=e._def.innerType;t[r]=e}return new ht({...this._def,shape:()=>t})}keyof(){return _t(ie.objectKeys(this.shape))}}ht.create=(e,t)=>new ht({shape:()=>e,unknownKeys:\"strip\",catchall:ct.create(),typeName:Ct.ZodObject,...Oe(t)}),ht.strictCreate=(e,t)=>new ht({shape:()=>e,unknownKeys:\"strict\",catchall:ct.create(),typeName:Ct.ZodObject,...Oe(t)}),ht.lazycreate=(e,t)=>new ht({shape:e,unknownKeys:\"strip\",catchall:ct.create(),typeName:Ct.ZodObject,...Oe(t)});class lt extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if(\"valid\"===t.result.status)return t.result;for(const r of e)if(\"dirty\"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new ue(e.ctx.common.issues));return ye(t,{code:ce.invalid_union,unionErrors:r}),me});{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},s=i._parseSync({data:t.data,path:t.path,parent:r});if(\"valid\"===s.status)return s;\"dirty\"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map(e=>new ue(e));return ye(t,{code:ce.invalid_union,unionErrors:i}),me}}get options(){return this._def.options}}lt.create=(e,t)=>new lt({options:e,typeName:Ct.ZodUnion,...Oe(t)});function pt(e,t){const r=ae(e),n=ae(t);if(e===t)return{valid:!0,data:e};if(r===oe.object&&n===oe.object){const r=ie.objectKeys(t),n=ie.objectKeys(e).filter(e=>-1!==r.indexOf(e)),i={...e,...t};for(const r of n){const n=pt(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===oe.array&&n===oe.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const i=pt(e[n],t[n]);if(!i.valid)return{valid:!1};r.push(i.data)}return{valid:!0,data:r}}return r===oe.date&&n===oe.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class yt extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(ve(e)||ve(n))return me;const i=pt(e.value,n.value);return i.valid?((_e(e)||_e(n))&&t.dirty(),{status:t.value,value:i.data}):(ye(r,{code:ce.invalid_intersection_types}),me)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}yt.create=(e,t,r)=>new yt({left:e,right:t,typeName:Ct.ZodIntersection,...Oe(r)});class gt extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.array)return ye(r,{code:ce.invalid_type,expected:oe.array,received:r.parsedType}),me;if(r.data.length<this._def.items.length)return ye(r,{code:ce.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:\"array\"}),me;!this._def.rest&&r.data.length>this._def.items.length&&(ye(r,{code:ce.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:\"array\"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new Ae(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>ge.mergeArray(t,e)):ge.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new gt({...this._def,rest:e})}}gt.create=(e,t)=>{if(!Array.isArray(e))throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");return new gt({items:e,typeName:Ct.ZodTuple,rest:null,...Oe(t)})};class mt extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.map)return ye(r,{code:ce.invalid_type,expected:oe.map,received:r.parsedType}),me;const n=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([e,t],s)=>({key:n._parse(new Ae(r,e,r.path,[s,\"key\"])),value:i._parse(new Ae(r,t,r.path,[s,\"value\"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of s){const n=await r.key,i=await r.value;if(\"aborted\"===n.status||\"aborted\"===i.status)return me;\"dirty\"!==n.status&&\"dirty\"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of s){const n=r.key,i=r.value;if(\"aborted\"===n.status||\"aborted\"===i.status)return me;\"dirty\"!==n.status&&\"dirty\"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}mt.create=(e,t,r)=>new mt({valueType:t,keyType:e,typeName:Ct.ZodMap,...Oe(r)});class wt extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.set)return ye(r,{code:ce.invalid_type,expected:oe.set,received:r.parsedType}),me;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(ye(r,{code:ce.too_small,minimum:n.minSize.value,type:\"set\",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(ye(r,{code:ce.too_big,maximum:n.maxSize.value,type:\"set\",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const r=new Set;for(const n of e){if(\"aborted\"===n.status)return me;\"dirty\"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const o=[...r.data.values()].map((e,t)=>i._parse(new Ae(r,e,r.path,t)));return r.common.async?Promise.all(o).then(e=>s(e)):s(o)}min(e,t){return new wt({...this._def,minSize:{value:e,message:le.toString(t)}})}max(e,t){return new wt({...this._def,maxSize:{value:e,message:le.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}wt.create=(e,t)=>new wt({valueType:e,minSize:null,maxSize:null,typeName:Ct.ZodSet,...Oe(t)});class bt extends Ie{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}bt.create=(e,t)=>new bt({getter:e,typeName:Ct.ZodLazy,...Oe(t)});class vt extends Ie{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ye(t,{received:t.data,code:ce.invalid_literal,expected:this._def.value}),me}return{status:\"valid\",value:e.data}}get value(){return this._def.value}}function _t(e,t){return new xt({values:e,typeName:Ct.ZodEnum,...Oe(t)})}vt.create=(e,t)=>new vt({value:e,typeName:Ct.ZodLiteral,...Oe(t)});class xt extends Ie{_parse(e){if(\"string\"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return ye(t,{expected:ie.joinValues(r),received:t.parsedType,code:ce.invalid_type}),me}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return ye(t,{received:t.data,code:ce.invalid_enum_value,options:r}),me}return be(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return xt.create(e,{...this._def,...t})}exclude(e,t=this._def){return xt.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}xt.create=_t;class Et extends Ie{_parse(e){const t=ie.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const e=ie.objectValues(t);return ye(r,{expected:ie.joinValues(e),received:r.parsedType,code:ce.invalid_type}),me}if(this._cache||(this._cache=new Set(ie.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=ie.objectValues(t);return ye(r,{received:r.data,code:ce.invalid_enum_value,options:e}),me}return be(e.data)}get enum(){return this._def.values}}Et.create=(e,t)=>new Et({values:e,typeName:Ct.ZodNativeEnum,...Oe(t)});class At extends Ie{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==oe.promise&&!1===t.common.async)return ye(t,{code:ce.invalid_type,expected:oe.promise,received:t.parsedType}),me;const r=t.parsedType===oe.promise?t.data:Promise.resolve(t.data);return be(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}At.create=(e,t)=>new At({type:e,typeName:Ct.ZodPromise,...Oe(t)});class kt extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ct.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{ye(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),\"preprocess\"===n.type){const e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if(\"aborted\"===t.value)return me;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return\"aborted\"===n.status?me:\"dirty\"===n.status||\"dirty\"===t.value?we(n.value):n});{if(\"aborted\"===t.value)return me;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return\"aborted\"===n.status?me:\"dirty\"===n.status||\"dirty\"===t.value?we(n.value):n}}if(\"refinement\"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return\"aborted\"===n.status?me:(\"dirty\"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>\"aborted\"===r.status?me:(\"dirty\"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if(\"transform\"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xe(e))return me;const s=n.transform(e.value,i);if(s instanceof Promise)throw new Error(\"Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.\");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>xe(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):me)}ie.assertNever(n)}}kt.create=(e,t,r)=>new kt({schema:e,typeName:Ct.ZodEffects,effect:t,...Oe(r)}),kt.createWithPreprocess=(e,t,r)=>new kt({schema:t,effect:{type:\"preprocess\",transform:e},typeName:Ct.ZodEffects,...Oe(r)});class Ot extends Ie{_parse(e){return this._getType(e)===oe.undefined?be(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ot.create=(e,t)=>new Ot({innerType:e,typeName:Ct.ZodOptional,...Oe(t)});class It extends Ie{_parse(e){return this._getType(e)===oe.null?be(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}It.create=(e,t)=>new It({innerType:e,typeName:Ct.ZodNullable,...Oe(t)});class Bt extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Bt.create=(e,t)=>new Bt({innerType:e,typeName:Ct.ZodDefault,defaultValue:\"function\"==typeof t.default?t.default:()=>t.default,...Oe(t)});class St extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ee(n)?n.then(e=>({status:\"valid\",value:\"valid\"===e.status?e.value:this._def.catchValue({get error(){return new ue(r.common.issues)},input:r.data})})):{status:\"valid\",value:\"valid\"===n.status?n.value:this._def.catchValue({get error(){return new ue(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}St.create=(e,t)=>new St({innerType:e,typeName:Ct.ZodCatch,catchValue:\"function\"==typeof t.catch?t.catch:()=>t.catch,...Oe(t)});class Nt extends Ie{_parse(e){if(this._getType(e)!==oe.nan){const t=this._getOrReturnCtx(e);return ye(t,{code:ce.invalid_type,expected:oe.nan,received:t.parsedType}),me}return{status:\"valid\",value:e.data}}}Nt.create=e=>new Nt({typeName:Ct.ZodNaN,...Oe(e)});Symbol(\"zod_brand\");class Rt extends Ie{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ut extends Ie{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return\"aborted\"===e.status?me:\"dirty\"===e.status?(t.dirty(),we(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return\"aborted\"===e.status?me:\"dirty\"===e.status?(t.dirty(),{status:\"dirty\",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Ut({in:e,out:t,typeName:Ct.ZodPipeline})}}class Tt extends Ie{_parse(e){const t=this._def.innerType._parse(e),r=e=>(xe(e)&&(e.value=Object.freeze(e.value)),e);return Ee(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}Tt.create=(e,t)=>new Tt({innerType:e,typeName:Ct.ZodReadonly,...Oe(t)});ht.lazycreate;var Ct;!function(e){e.ZodString=\"ZodString\",e.ZodNumber=\"ZodNumber\",e.ZodNaN=\"ZodNaN\",e.ZodBigInt=\"ZodBigInt\",e.ZodBoolean=\"ZodBoolean\",e.ZodDate=\"ZodDate\",e.ZodSymbol=\"ZodSymbol\",e.ZodUndefined=\"ZodUndefined\",e.ZodNull=\"ZodNull\",e.ZodAny=\"ZodAny\",e.ZodUnknown=\"ZodUnknown\",e.ZodNever=\"ZodNever\",e.ZodVoid=\"ZodVoid\",e.ZodArray=\"ZodArray\",e.ZodObject=\"ZodObject\",e.ZodUnion=\"ZodUnion\",e.ZodDiscriminatedUnion=\"ZodDiscriminatedUnion\",e.ZodIntersection=\"ZodIntersection\",e.ZodTuple=\"ZodTuple\",e.ZodRecord=\"ZodRecord\",e.ZodMap=\"ZodMap\",e.ZodSet=\"ZodSet\",e.ZodFunction=\"ZodFunction\",e.ZodLazy=\"ZodLazy\",e.ZodLiteral=\"ZodLiteral\",e.ZodEnum=\"ZodEnum\",e.ZodEffects=\"ZodEffects\",e.ZodNativeEnum=\"ZodNativeEnum\",e.ZodOptional=\"ZodOptional\",e.ZodNullable=\"ZodNullable\",e.ZodDefault=\"ZodDefault\",e.ZodCatch=\"ZodCatch\",e.ZodPromise=\"ZodPromise\",e.ZodBranded=\"ZodBranded\",e.ZodPipeline=\"ZodPipeline\",e.ZodReadonly=\"ZodReadonly\"}(Ct||(Ct={}));const jt=Ye.create,Lt=(Qe.create,Nt.create,et.create,tt.create,rt.create,nt.create,it.create,st.create,ot.create,at.create,ct.create,ut.create,ft.create,ht.create),$t=(ht.strictCreate,lt.create,yt.create,gt.create,mt.create,wt.create,bt.create,vt.create);xt.create,Et.create,At.create,kt.create,Ot.create,It.create,kt.createWithPreprocess,Ut.create;function Pt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function Zt(e,...t){if(!Pt(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function Ft(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>\"string\"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function Mt(e){if(\"function\"!=typeof e)throw new Error(\"function expected\");return!0}function zt(e,t){if(\"string\"!=typeof t)throw new Error(`${e}: string expected`);return!0}function Vt(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Dt(e){if(!Array.isArray(e))throw new Error(\"array expected\")}function qt(e,t){if(!Ft(!0,t))throw new Error(`${e}: array of strings expected`)}function Kt(e,t){if(!Ft(!1,t))throw new Error(`${e}: array of numbers expected`)}function Ht(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function Wt(e){const t=\"string\"==typeof e?e.split(\"\"):e,r=t.length;qt(\"alphabet\",t);const n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(Dt(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet \"${n}\". Allowed: ${e}`);return t[n]})),decode:t=>(Dt(t),t.map(t=>{zt(\"alphabet.decode\",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: \"${t}\". Allowed: ${e}`);return r}))}}function Gt(e=\"\"){return zt(\"join\",e),{encode:t=>(qt(\"join.decode\",t),t.join(e)),decode:t=>(zt(\"join.decode\",t),t.split(e))}}function Jt(e,t=\"=\"){return Vt(e),zt(\"padding\",t),{encode(r){for(qt(\"padding.encode\",r);r.length*e%8;)r.push(t);return r},decode(r){qt(\"padding.decode\",r);let n=r.length;if(n*e%8)throw new Error(\"padding: invalid, string should have whole number of bytes\");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error(\"padding: invalid, string has too much padding\")}return r.slice(0,n)}}}function Yt(e){return Mt(e),{encode:e=>e,decode:t=>e(t)}}function Xt(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Dt(e),!e.length)return[];let n=0;const i=[],s=Array.from(e,e=>{if(Vt(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),o=s.length;for(;;){let e=0,a=!0;for(let i=n;i<o;i++){const o=s[i],c=t*e,u=c+o;if(!Number.isSafeInteger(u)||c/t!==e||u-o!==c)throw new Error(\"convertRadix: carry overflow\");const f=u/r;e=u%r;const d=Math.floor(f);if(s[i]=d,!Number.isSafeInteger(d)||d*r+e!==u)throw new Error(\"convertRadix: carry overflow\");a&&(d?a=!1:n=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}const Qt=(e,t)=>0===t?e:Qt(t,e%t),er=(e,t)=>e+(t-Qt(e,t)),tr=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function rr(e,t,r,n){if(Dt(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(er(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${er(t,r)}`);let i=0,s=0;const o=tr[t],a=tr[r]-1,c=[];for(const n of e){if(Vt(n),n>=o)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=r;s-=r)c.push((i>>s-r&a)>>>0);const e=tr[s];if(void 0===e)throw new Error(\"invalid carry\");i&=e-1}if(i=i<<r-s&a,!n&&s>=t)throw new Error(\"Excess padding\");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&s>0&&c.push(i>>>0),c}function nr(e){Vt(e);return{encode:t=>{if(!Pt(t))throw new Error(\"radix.encode input should be Uint8Array\");return Xt(Array.from(t),256,e)},decode:t=>(Kt(\"radix.decode\",t),Uint8Array.from(Xt(t,e,256)))}}function ir(e,t=!1){if(Vt(e),e<=0||e>32)throw new Error(\"radix2: bits should be in (0..32]\");if(er(8,e)>32||er(e,8)>32)throw new Error(\"radix2: carry overflow\");return{encode:r=>{if(!Pt(r))throw new Error(\"radix2.encode input should be Uint8Array\");return rr(Array.from(r),8,e,!t)},decode:r=>(Kt(\"radix2.decode\",r),Uint8Array.from(rr(r,e,8,t)))}}function sr(e){return Mt(e),function(...t){try{return e.apply(null,t)}catch(e){}}}const or=Ht(ir(4),Wt(\"0123456789ABCDEF\"),Gt(\"\")),ar=Ht(ir(5),Wt(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),Jt(5),Gt(\"\")),cr=(Ht(ir(5),Wt(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\"),Gt(\"\")),Ht(ir(5),Wt(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),Jt(5),Gt(\"\")),Ht(ir(5),Wt(\"0123456789ABCDEFGHIJKLMNOPQRSTUV\"),Gt(\"\")),Ht(ir(5),Wt(\"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"),Gt(\"\"),Yt(e=>e.toUpperCase().replace(/O/g,\"0\").replace(/[IL]/g,\"1\"))),\"function\"==typeof Uint8Array.from([]).toBase64&&\"function\"==typeof Uint8Array.fromBase64),ur=(e,t)=>{zt(\"base64\",e);const r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?\"base64url\":\"base64\";if(e.length>0&&!r.test(e))throw new Error(\"invalid base64\");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:\"strict\"})},fr=cr?{encode:e=>(Zt(e),e.toBase64()),decode:e=>ur(e,!1)}:Ht(ir(6),Wt(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),Jt(6),Gt(\"\")),dr=(Ht(ir(6),Wt(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"),Gt(\"\")),cr?{encode:e=>(Zt(e),e.toBase64({alphabet:\"base64url\"})),decode:e=>ur(e,!0)}:Ht(ir(6),Wt(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),Jt(6),Gt(\"\"))),hr=(Ht(ir(6),Wt(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\"),Gt(\"\")),e=>Ht(nr(58),Wt(e),Gt(\"\"))),lr=hr(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"),pr=(hr(\"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\"),hr(\"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz\"),[0,2,3,5,6,7,9,10,11]),yr={encode(e){let t=\"\";for(let r=0;r<e.length;r+=8){const n=e.subarray(r,r+8);t+=lr.encode(n).padStart(pr[n.length],\"1\")}return t},decode(e){let t=[];for(let r=0;r<e.length;r+=11){const n=e.slice(r,r+11),i=pr.indexOf(n.length),s=lr.decode(n);for(let e=0;e<s.length-i;e++)if(0!==s[e])throw new Error(\"base58xmr: wrong padding\");t=t.concat(Array.from(s.slice(s.length-i)))}return Uint8Array.from(t)}},gr=Ht(Wt(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"),Gt(\"\")),mr=[996825010,642813549,513874426,1027748829,705979059];function wr(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<mr.length;e++)1==(t>>e&1)&&(r^=mr[e]);return r}function br(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=wr(i)^r>>5}i=wr(i);for(let t=0;t<n;t++)i=wr(i)^31&e.charCodeAt(t);for(let e of t)i=wr(i)^e;for(let e=0;e<6;e++)i=wr(i);return i^=r,gr.encode(rr([i%tr[30]],30,5,!1))}function vr(e){const t=\"bech32\"===e?1:734539939,r=ir(5),n=r.decode,i=r.encode,s=sr(n);function o(e,r,n=90){zt(\"bech32.encode prefix\",e),Pt(r)&&(r=Array.from(r)),Kt(\"bech32.encode\",r);const i=e.length;if(0===i)throw new TypeError(`Invalid prefix length ${i}`);const s=i+7+r.length;if(!1!==n&&s>n)throw new TypeError(`Length ${s} exceeds limit ${n}`);const o=e.toLowerCase(),a=br(o,r,t);return`${o}1${gr.encode(r)}${a}`}function a(e,r=90){zt(\"bech32.decode input\",e);const n=e.length;if(n<8||!1!==r&&n>r)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${r})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error(\"String must be lowercase or uppercase\");const s=i.lastIndexOf(\"1\");if(0===s||-1===s)throw new Error('Letter \"1\" must be present between prefix and data only');const o=i.slice(0,s),a=i.slice(s+1);if(a.length<6)throw new Error(\"Data must be at least 6 characters long\");const c=gr.decode(a).slice(0,-6),u=br(o,c,t);if(!a.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected \"${u}\"`);return{prefix:o,words:c}}return{encode:o,decode:a,encodeFromBytes:function(e,t){return o(e,i(t))},decodeToBytes:function(e){const{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:sr(a),fromWords:n,fromWordsUnsafe:s,toWords:i}}vr(\"bech32\"),vr(\"bech32m\");const _r={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex||Ht(ir(4),Wt(\"0123456789abcdef\"),Gt(\"\"),Yt(e=>{if(\"string\"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));function xr(e,t){return r=e,Boolean(\"string\"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class Er extends Error{constructor(e){super(e.message),this.code=\"ERR_ASSERTION\"}}function Ar(e,t=\"Assertion failed.\",r=Er){if(!e){if(t instanceof Error)throw t;throw xr(r,t)}}const kr=BigInt(2**32-1),Or=BigInt(32);function Ir(e,t=!1){return t?{h:Number(e&kr),l:Number(e>>Or&kr)}:{h:0|Number(e>>Or&kr),l:0|Number(e&kr)}}function Br(e,t=!1){const r=e.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:o}=Ir(e[s],t);[n[s],i[s]]=[r,o]}return[n,i]}const Sr=(e,t,r)=>e<<r|t>>>32-r,Nr=(e,t,r)=>t<<r|e>>>32-r,Rr=(e,t,r)=>t<<r-32|e>>>64-r,Ur=(e,t,r)=>e<<r-32|t>>>64-r;const Tr=\"object\"==typeof globalThis&&\"crypto\"in globalThis?globalThis.crypto:void 0;function Cr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function jr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}function Lr(e,...t){if(!Cr(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function $r(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function Pr(e,t){Lr(e);const r=t.outputLen;if(e.length<r)throw new Error(\"digestInto() expects output buffer of length at least \"+r)}function Zr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Fr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Mr(e,t){return e<<32-t|e>>>t}const zr=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Vr(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Dr=zr?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Vr(e[t]);return e},qr=\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex,Kr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));function Hr(e){if(Lr(e),qr)return e.toHex();let t=\"\";for(let r=0;r<e.length;r++)t+=Kr[e[r]];return t}const Wr=48,Gr=57,Jr=65,Yr=70,Xr=97,Qr=102;function en(e){return e>=Wr&&e<=Gr?e-Wr:e>=Jr&&e<=Yr?e-(Jr-10):e>=Xr&&e<=Qr?e-(Xr-10):void 0}function tn(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);if(qr)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error(\"hex string expected, got unpadded hex of length \"+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=en(e.charCodeAt(i)),s=en(e.charCodeAt(i+1));if(void 0===r||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+i)}n[t]=16*r+s}return n}function rn(e){if(\"string\"!=typeof e)throw new Error(\"string expected\");return new Uint8Array((new TextEncoder).encode(e))}function nn(e){return\"string\"==typeof e&&(e=rn(e)),Lr(e),e}function sn(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];Lr(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}class on{}function an(e){const t=t=>e().update(nn(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function cn(e=32){if(Tr&&\"function\"==typeof Tr.getRandomValues)return Tr.getRandomValues(new Uint8Array(e));if(Tr&&\"function\"==typeof Tr.randomBytes)return Uint8Array.from(Tr.randomBytes(e));throw new Error(\"crypto.getRandomValues must be defined\")}const un=BigInt(0),fn=BigInt(1),dn=BigInt(2),hn=BigInt(7),ln=BigInt(256),pn=BigInt(113),yn=[],gn=[],mn=[];for(let e=0,t=fn,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],yn.push(2*(5*n+r)),gn.push((e+1)*(e+2)/2%64);let i=un;for(let e=0;e<7;e++)t=(t<<fn^(t>>hn)*pn)%ln,t&dn&&(i^=fn<<(fn<<BigInt(e))-fn);mn.push(i)}const wn=Br(mn,!0),bn=wn[0],vn=wn[1],_n=(e,t,r)=>r>32?Rr(e,t,r):Sr(e,t,r),xn=(e,t,r)=>r>32?Ur(e,t,r):Nr(e,t,r);class En extends on{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,jr(r),!(0<e&&e<200))throw new Error(\"only keccak-f1600 function is supported\");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}clone(){return this._cloneInto()}keccak(){Dr(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],a=_n(s,o,1)^r[n],c=xn(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=gn[r],s=_n(t,i,n),o=xn(t,i,n),a=yn[r];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=bn[n],e[1]^=vn[n]}Zr(r)}(this.state32,this.rounds),Dr(this.state32),this.posOut=0,this.pos=0}update(e){$r(this),Lr(e=nn(e));const{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){const s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){$r(this,!1),Lr(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error(\"XOF is not possible for this instance\");return this.writeInto(e)}xof(e){return jr(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Pr(e,this),this.finished)throw new Error(\"digest() was already called\");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Zr(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new En(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const An=(e,t,r)=>an(()=>new En(t,e,r)),kn=An(1,136,32);var On=r(654);const In=/^(?:0x)?[0-9a-f]+$/iu,Bn=/^0x[0-9a-f]+$/iu,Sn=/^0x[0-9a-f]{40}$/u,Nn=/^0x[0-9a-fA-F]{40}$/u,Rn=(k(x(),In),k(x(),Bn),k(x(),Sn),k(x(),Nn),e=>\"string\"==typeof e);function Un(e){return Rn(e)&&Nn.test(e)}function Tn(e){Ar(function(e){return Rn(e)&&In.test(e)}(e),\"Value must be a hexadecimal string.\")}const Cn=On(function(e){Ar(Un(e),\"Invalid hex address.\");const t=Ln(e).toLowerCase(),r=kn(t),{length:n}=t,i=new Array(n);for(let e=0;e<n;e++){const n=1&e,s=r[e>>1],o=0===n?s>>4:15&s;i[e]=o>=8?t[e].toUpperCase():t[e]}return`0x${i.join(\"\")}`});const jn=On(function(e){return!!Un(e)&&Cn(e)===e});On(function(e){return Rn(t=e)&&Sn.test(t)||jn(e);var t});function Ln(e){return e.startsWith(\"0x\")||e.startsWith(\"0X\")?e.substring(2):e}r(287).hp;const $n=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,\"0\"));return e}}();function Pn(e){return e instanceof Uint8Array}function Zn(e){Ar(Pn(e),\"Value must be a Uint8Array.\")}function Fn(e){if(Zn(e),0===e.length)return\"0x\";const t=$n(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return function(e){return e.startsWith(\"0x\")?e:e.startsWith(\"0X\")?`0x${e.substring(2)}`:`0x${e}`}(r.join(\"\"))}function Mn(e){if(\"0x\"===e?.toLowerCase?.())return new Uint8Array;Tn(e);const t=Ln(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),i=r.charCodeAt(2*e+1),s=t-(t<58?48:87),o=i-(i<58?48:87);n[e]=16*s+o}return n}function zn(e){return Ar(\"string\"==typeof e,\"Value must be a string.\"),fr.decode(e)}const Vn=BigInt(0),Dn=BigInt(1);function qn(e,t){if(\"boolean\"!=typeof t)throw new Error(e+\" boolean expected, got \"+t)}function Kn(e){const t=e.toString(16);return 1&t.length?\"0\"+t:t}function Hn(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);return\"\"===e?Vn:BigInt(\"0x\"+e)}function Wn(e){return Hn(Hr(e))}function Gn(e){return Lr(e),Hn(Hr(Uint8Array.from(e).reverse()))}function Jn(e,t){return tn(e.toString(16).padStart(2*t,\"0\"))}function Yn(e,t){return Jn(e,t).reverse()}function Xn(e,t,r){let n;if(\"string\"==typeof t)try{n=tn(t)}catch(t){throw new Error(e+\" must be hex string or Uint8Array, cause: \"+t)}else{if(!Cr(t))throw new Error(e+\" must be hex string or Uint8Array\");n=Uint8Array.from(t)}const i=n.length;if(\"number\"==typeof r&&i!==r)throw new Error(e+\" of length \"+r+\" expected, got \"+i);return n}const Qn=e=>\"bigint\"==typeof e&&Vn<=e;function ei(e,t,r,n){if(!function(e,t,r){return Qn(e)&&Qn(t)&&Qn(r)&&t<=e&&e<r}(t,r,n))throw new Error(\"expected valid \"+e+\": \"+r+\" <= n < \"+n+\", got \"+t)}const ti=e=>(Dn<<BigInt(e))-Dn;function ri(e,t,r={}){if(!e||\"object\"!=typeof e)throw new Error(\"expected valid options object\");function n(t,r,n){const i=e[t];if(n&&void 0===i)return;const s=typeof i;if(s!==r||null===i)throw new Error(`param \"${t}\" is invalid: expected ${r}, got ${s}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function ni(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const s=e(r,...n);return t.set(r,s),s}}const ii=BigInt(0),si=BigInt(1),oi=BigInt(2),ai=BigInt(3),ci=BigInt(4),ui=BigInt(5),fi=BigInt(8);function di(e,t){const r=e%t;return r>=ii?r:t+r}function hi(e,t,r){let n=e;for(;t-- >ii;)n*=n,n%=r;return n}function li(e,t){if(e===ii)throw new Error(\"invert: expected non-zero number\");if(t<=ii)throw new Error(\"invert: expected positive modulus, got \"+t);let r=di(e,t),n=t,i=ii,s=si,o=si,a=ii;for(;r!==ii;){const e=n/r,t=n%r,c=i-o*e,u=s-a*e;n=r,r=t,i=o,s=a,o=c,a=u}if(n!==si)throw new Error(\"invert: does not exist\");return di(i,t)}function pi(e,t){const r=(e.ORDER+si)/ci,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error(\"Cannot find square root\");return n}function yi(e,t){const r=(e.ORDER-ui)/fi,n=e.mul(t,oi),i=e.pow(n,r),s=e.mul(t,i),o=e.mul(e.mul(s,oi),i),a=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error(\"Cannot find square root\");return a}function gi(e){return e%ci===ai?pi:e%fi===ui?yi:function(e){if(e<BigInt(3))throw new Error(\"sqrt is not defined for small field\");let t=e-si,r=0;for(;t%oi===ii;)t/=oi,r++;let n=oi;const i=xi(e);for(;1===vi(i,n);)if(n++>1e3)throw new Error(\"Cannot find square root: probably non-prime P\");if(1===r)return pi;let s=i.pow(n,t);const o=(t+si)/oi;return function(e,n){if(e.is0(n))return n;if(1!==vi(e,n))throw new Error(\"Cannot find square root\");let i=r,a=e.mul(e.ONE,s),c=e.pow(n,t),u=e.pow(n,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw new Error(\"Cannot find square root\");const n=si<<BigInt(i-t-1),s=e.pow(a,n);i=t,a=e.sqr(s),c=e.mul(c,a),u=e.mul(u,s)}return u}}(e)}const mi=[\"create\",\"isValid\",\"is0\",\"neg\",\"inv\",\"sqrt\",\"sqr\",\"eql\",\"add\",\"sub\",\"mul\",\"pow\",\"div\",\"addN\",\"subN\",\"mulN\",\"sqrN\"];function wi(e,t,r){if(r<ii)throw new Error(\"invalid exponent, negatives unsupported\");if(r===ii)return e.ONE;if(r===si)return t;let n=e.ONE,i=t;for(;r>ii;)r&si&&(n=e.mul(n,i)),i=e.sqr(i),r>>=si;return n}function bi(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),s=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),s),n}function vi(e,t){const r=(e.ORDER-si)/oi,n=e.pow(t,r),i=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),o=e.eql(n,e.neg(e.ONE));if(!i&&!s&&!o)throw new Error(\"invalid Legendre symbol result\");return i?1:s?0:-1}function _i(e,t){void 0!==t&&jr(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function xi(e,t,r=!1,n={}){if(e<=ii)throw new Error(\"invalid field: expected ORDER > 0, got \"+e);let i,s;if(\"object\"==typeof t&&null!=t){if(n.sqrt||r)throw new Error(\"cannot specify opts in two arguments\");const e=t;e.BITS&&(i=e.BITS),e.sqrt&&(s=e.sqrt),\"boolean\"==typeof e.isLE&&(r=e.isLE)}else\"number\"==typeof t&&(i=t),n.sqrt&&(s=n.sqrt);const{nBitLength:o,nByteLength:a}=_i(e,i);if(a>2048)throw new Error(\"invalid field: expected ORDER of <= 2048 bytes\");let c;const u=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:a,MASK:ti(o),ZERO:ii,ONE:si,create:t=>di(t,e),isValid:t=>{if(\"bigint\"!=typeof t)throw new Error(\"invalid field element: expected bigint, got \"+typeof t);return ii<=t&&t<e},is0:e=>e===ii,isValidNot0:e=>!u.is0(e)&&u.isValid(e),isOdd:e=>(e&si)===si,neg:t=>di(-t,e),eql:(e,t)=>e===t,sqr:t=>di(t*t,e),add:(t,r)=>di(t+r,e),sub:(t,r)=>di(t-r,e),mul:(t,r)=>di(t*r,e),pow:(e,t)=>wi(u,e,t),div:(t,r)=>di(t*li(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>li(t,e),sqrt:s||(t=>(c||(c=gi(e)),c(u,t))),toBytes:e=>r?Yn(e,a):Jn(e,a),fromBytes:e=>{if(e.length!==a)throw new Error(\"Field.fromBytes: expected \"+a+\" bytes, got \"+e.length);return r?Gn(e):Wn(e)},invertBatch:e=>bi(u,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(u)}function Ei(e){if(\"bigint\"!=typeof e)throw new Error(\"field order must be bigint\");const t=e.toString(2).length;return Math.ceil(t/8)}function Ai(e){const t=Ei(e);return t+Math.ceil(t/2)}const ki=BigInt(0),Oi=BigInt(1),Ii=BigInt(2);function Bi(e){const t=(ri(r=e,{adjustScalarBytes:\"function\",powPminus2:\"function\"}),Object.freeze({...r}));var r;const{P:n,type:i,adjustScalarBytes:s,powPminus2:o,randomBytes:a}=t,c=\"x25519\"===i;if(!c&&\"x448\"!==i)throw new Error(\"invalid type\");const u=a||cn,f=c?255:448,d=c?32:56,h=c?BigInt(9):BigInt(5),l=c?BigInt(121665):BigInt(39081),p=c?Ii**BigInt(254):Ii**BigInt(447),y=c?BigInt(8)*Ii**BigInt(251)-Oi:BigInt(4)*Ii**BigInt(445)-Oi,g=p+y+Oi,m=e=>di(e,n),w=b(h);function b(e){return Yn(m(e),d)}function v(e,t){const r=function(e,t){ei(\"u\",e,ki,n),ei(\"scalar\",t,p,g);const r=t,i=e;let s=Oi,a=ki,c=e,u=Oi,d=ki;for(let e=BigInt(f-1);e>=ki;e--){const t=r>>e&Oi;d^=t,({x_2:s,x_3:c}=x(d,s,c)),({x_2:a,x_3:u}=x(d,a,u)),d=t;const n=s+a,o=m(n*n),f=s-a,h=m(f*f),p=o-h,y=c+u,g=m((c-u)*n),w=m(y*f),b=g+w,v=g-w;c=m(b*b),u=m(i*m(v*v)),s=m(o*h),a=m(p*(o+m(l*p)))}({x_2:s,x_3:c}=x(d,s,c)),({x_2:a,x_3:u}=x(d,a,u));const h=o(a);return m(s*h)}(function(e){const t=Xn(\"u coordinate\",e,d);return c&&(t[31]&=127),m(Gn(t))}(t),function(e){return Gn(s(Xn(\"scalar\",e,d)))}(e));if(r===ki)throw new Error(\"invalid private or public key received\");return b(r)}function _(e){return v(e,w)}function x(e,t,r){const n=m(e*(t-r));return{x_2:t=m(t-n),x_3:r=m(r+n)}}return{scalarMult:v,scalarMultBase:_,getSharedSecret:(e,t)=>v(e,t),getPublicKey:e=>_(e),utils:{randomPrivateKey:()=>u(d)},GuBytes:w.slice()}}BigInt(0);const Si=BigInt(1),Ni=BigInt(2),Ri=BigInt(3),Ui=BigInt(5),Ti=BigInt(8),Ci={p:BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed\"),n:BigInt(\"0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed\"),h:Ti,a:BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec\"),d:BigInt(\"0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3\"),Gx:BigInt(\"0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\"),Gy:BigInt(\"0x6666666666666666666666666666666666666666666666666666666666666658\")};function ji(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=Ci.p,o=e*e%s*e%s,a=hi(o,Ni,s)*o%s,c=hi(a,Si,s)*e%s,u=hi(c,Ui,s)*c%s,f=hi(u,t,s)*u%s,d=hi(f,r,s)*f%s,h=hi(d,n,s)*d%s,l=hi(h,i,s)*h%s,p=hi(l,i,s)*h%s,y=hi(p,t,s)*u%s;return{pow_p_5_8:hi(y,Ni,s)*e%s,b2:o}}function Li(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const $i=(()=>{const e=Ci.p;return Bi({P:e,type:\"x25519\",powPminus2:t=>{const{pow_p_5_8:r,b2:n}=ji(t);return di(hi(r,Ri,e)*n,e)},adjustScalarBytes:Li})})();function Pi(e,t,r){return e&t^~e&r}function Zi(e,t,r){return e&t^e&r^t&r}class Fi extends on{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Fr(this.buffer)}update(e){$r(this),Lr(e=nn(e));const{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);if(o===n){const t=Fr(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$r(this),Pr(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:s}=this;t[s++]=128,Zr(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if(\"function\"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const o=Fr(e),a=this.outputLen;if(a%4)throw new Error(\"_sha2: outputLen should be aligned to 32bit\");const c=a/4,u=this.get();if(c>u.length)throw new Error(\"_sha2: outputLen bigger than state\");for(let e=0;e<c;e++)o.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=n,e.pos=o,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Mi=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zi=(Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Uint32Array.from([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])),Vi=new Uint32Array(64);class Di extends Fi{constructor(e=32){super(64,e,8,!1),this.A=0|Mi[0],this.B=0|Mi[1],this.C=0|Mi[2],this.D=0|Mi[3],this.E=0|Mi[4],this.F=0|Mi[5],this.G=0|Mi[6],this.H=0|Mi[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)Vi[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Vi[e-15],r=Vi[e-2],n=Mr(t,7)^Mr(t,18)^t>>>3,i=Mr(r,17)^Mr(r,19)^r>>>10;Vi[e]=i+Vi[e-7]+n+Vi[e-16]|0}let{A:r,B:n,C:i,D:s,E:o,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Mr(o,6)^Mr(o,11)^Mr(o,25))+Pi(o,a,c)+zi[e]+Vi[e]|0,f=(Mr(r,2)^Mr(r,13)^Mr(r,22))+Zi(r,n,i)|0;u=c,c=a,a=o,o=s+t|0,s=i,i=n,n=r,r=t+f|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,s,o,a,c,u)}roundClean(){Zr(Vi)}destroy(){this.set(0,0,0,0,0,0,0,0),Zr(this.buffer)}}const qi=Br([\"0x428a2f98d728ae22\",\"0x7137449123ef65cd\",\"0xb5c0fbcfec4d3b2f\",\"0xe9b5dba58189dbbc\",\"0x3956c25bf348b538\",\"0x59f111f1b605d019\",\"0x923f82a4af194f9b\",\"0xab1c5ed5da6d8118\",\"0xd807aa98a3030242\",\"0x12835b0145706fbe\",\"0x243185be4ee4b28c\",\"0x550c7dc3d5ffb4e2\",\"0x72be5d74f27b896f\",\"0x80deb1fe3b1696b1\",\"0x9bdc06a725c71235\",\"0xc19bf174cf692694\",\"0xe49b69c19ef14ad2\",\"0xefbe4786384f25e3\",\"0x0fc19dc68b8cd5b5\",\"0x240ca1cc77ac9c65\",\"0x2de92c6f592b0275\",\"0x4a7484aa6ea6e483\",\"0x5cb0a9dcbd41fbd4\",\"0x76f988da831153b5\",\"0x983e5152ee66dfab\",\"0xa831c66d2db43210\",\"0xb00327c898fb213f\",\"0xbf597fc7beef0ee4\",\"0xc6e00bf33da88fc2\",\"0xd5a79147930aa725\",\"0x06ca6351e003826f\",\"0x142929670a0e6e70\",\"0x27b70a8546d22ffc\",\"0x2e1b21385c26c926\",\"0x4d2c6dfc5ac42aed\",\"0x53380d139d95b3df\",\"0x650a73548baf63de\",\"0x766a0abb3c77b2a8\",\"0x81c2c92e47edaee6\",\"0x92722c851482353b\",\"0xa2bfe8a14cf10364\",\"0xa81a664bbc423001\",\"0xc24b8b70d0f89791\",\"0xc76c51a30654be30\",\"0xd192e819d6ef5218\",\"0xd69906245565a910\",\"0xf40e35855771202a\",\"0x106aa07032bbd1b8\",\"0x19a4c116b8d2d0c8\",\"0x1e376c085141ab53\",\"0x2748774cdf8eeb99\",\"0x34b0bcb5e19b48a8\",\"0x391c0cb3c5c95a63\",\"0x4ed8aa4ae3418acb\",\"0x5b9cca4f7763e373\",\"0x682e6ff3d6b2b8a3\",\"0x748f82ee5defb2fc\",\"0x78a5636f43172f60\",\"0x84c87814a1f0ab72\",\"0x8cc702081a6439ec\",\"0x90befffa23631e28\",\"0xa4506cebde82bde9\",\"0xbef9a3f7b2c67915\",\"0xc67178f2e372532b\",\"0xca273eceea26619c\",\"0xd186b8c721c0c207\",\"0xeada7dd6cde0eb1e\",\"0xf57d4f7fee6ed178\",\"0x06f067aa72176fba\",\"0x0a637dc5a2c898a6\",\"0x113f9804bef90dae\",\"0x1b710b35131c471b\",\"0x28db77f523047d84\",\"0x32caab7b40c72493\",\"0x3c9ebe0a15c9bebc\",\"0x431d67c49c100d4c\",\"0x4cc5d4becb3e42b6\",\"0x597f299cfc657e2a\",\"0x5fcb6fab3ad6faec\",\"0x6c44198c4a475817\"].map(e=>BigInt(e)));qi[0],qi[1],new Uint32Array(80),new Uint32Array(80);Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);const Ki=an(()=>new Di);class Hi extends on{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if(\"function\"!=typeof e||\"function\"!=typeof e.create)throw new Error(\"Hash should be wrapped by utils.createHasher\");jr(e.outputLen),jr(e.blockLen)}(e);const r=nn(t);if(this.iHash=e.create(),\"function\"!=typeof this.iHash.update)throw new Error(\"Expected instance of class which extends utils.Hash\");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),Zr(i)}update(e){return $r(this),this.iHash.update(e),this}digestInto(e){$r(this),Lr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Wi=(e,t,r)=>new Hi(e,t).update(r).digest();Wi.create=(e,t)=>new Hi(e,t);const Gi=BigInt(0),Ji=BigInt(1);function Yi(e,t){const r=t.negate();return e?r:t}function Xi(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error(\"invalid window size, expected [1..\"+t+\"], got W=\"+e)}function Qi(e,t){Xi(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:ti(e),maxNumber:r,shiftBy:BigInt(e)}}function es(e,t,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:o}=r;let a=Number(e&i),c=e>>o;a>n&&(a-=s,c+=Ji);const u=t*n;return{nextN:c,offset:u+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:u}}function ts(e,t){if(!Array.isArray(e))throw new Error(\"array expected\");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error(\"invalid point at index \"+r)})}function rs(e,t){if(!Array.isArray(e))throw new Error(\"array of scalars expected\");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error(\"invalid scalar at index \"+r)})}const ns=new WeakMap,is=new WeakMap;function ss(e){return is.get(e)||1}function os(e){if(e!==Gi)throw new Error(\"invalid wNAF\")}function as(e,t,r,n){ts(r,e),rs(n,t);const i=r.length,s=n.length;if(i!==s)throw new Error(\"arrays of points and scalars must have equal length\");const o=e.ZERO,a=function(e){let t;for(t=0;e>Vn;e>>=Dn,t+=1);return t}(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=ti(c),f=new Array(Number(u)+1).fill(o);let d=o;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){f.fill(o);for(let t=0;t<s;t++){const i=n[t],s=Number(i>>BigInt(e)&u);f[s]=f[s].add(r[t])}let t=o;for(let e=f.length-1,r=o;e>0;e--)r=r.add(f[e]),t=t.add(r);if(d=d.add(t),0!==e)for(let e=0;e<c;e++)d=d.double()}return d}function cs(e,t){if(t){if(t.ORDER!==e)throw new Error(\"Field.ORDER must match order: Fp == p, Fn == n\");return function(e){const t=mi.reduce((e,t)=>(e[t]=\"function\",e),{ORDER:\"bigint\",MASK:\"bigint\",BYTES:\"number\",BITS:\"number\"});ri(e,t)}(t),t}return xi(e)}function us(e){void 0!==e.lowS&&qn(\"lowS\",e.lowS),void 0!==e.prehash&&qn(\"prehash\",e.prehash)}class fs extends Error{constructor(e=\"\"){super(e)}}const ds={Err:fs,_tlv:{encode:(e,t)=>{const{Err:r}=ds;if(e<0||e>256)throw new r(\"tlv.encode: wrong tag\");if(1&t.length)throw new r(\"tlv.encode: unpadded data\");const n=t.length/2,i=Kn(n);if(i.length/2&128)throw new r(\"tlv.encode: long form length too big\");const s=n>127?Kn(i.length/2|128):\"\";return Kn(e)+s+i+t},decode(e,t){const{Err:r}=ds;let n=0;if(e<0||e>256)throw new r(\"tlv.encode: wrong tag\");if(t.length<2||t[n++]!==e)throw new r(\"tlv.decode: wrong tlv\");const i=t[n++];let s=0;if(!!(128&i)){const e=127&i;if(!e)throw new r(\"tlv.decode(long): indefinite length not supported\");if(e>4)throw new r(\"tlv.decode(long): byte length is too big\");const o=t.subarray(n,n+e);if(o.length!==e)throw new r(\"tlv.decode: length bytes not complete\");if(0===o[0])throw new r(\"tlv.decode(long): zero leftmost byte\");for(const e of o)s=s<<8|e;if(n+=e,s<128)throw new r(\"tlv.decode(long): not minimal encoding\")}else s=i;const o=t.subarray(n,n+s);if(o.length!==s)throw new r(\"tlv.decode: wrong value length\");return{v:o,l:t.subarray(n+s)}}},_int:{encode(e){const{Err:t}=ds;if(e<hs)throw new t(\"integer: negative integers are not allowed\");let r=Kn(e);if(8&Number.parseInt(r[0],16)&&(r=\"00\"+r),1&r.length)throw new t(\"unexpected DER parsing assertion: unpadded hex\");return r},decode(e){const{Err:t}=ds;if(128&e[0])throw new t(\"invalid signature integer: negative\");if(0===e[0]&&!(128&e[1]))throw new t(\"invalid signature integer: unnecessary leading zero\");return Wn(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=ds,i=Xn(\"signature\",e),{v:s,l:o}=n.decode(48,i);if(o.length)throw new t(\"invalid signature: left bytes after parsing\");const{v:a,l:c}=n.decode(2,s),{v:u,l:f}=n.decode(2,c);if(f.length)throw new t(\"invalid signature: left bytes after parsing\");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){const{_tlv:t,_int:r}=ds,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},hs=BigInt(0),ls=BigInt(1),ps=BigInt(2),ys=BigInt(3),gs=BigInt(4);function ms(e,t,r){return function(n){const i=e.sqr(n),s=e.mul(i,n);return e.add(e.add(s,e.mul(n,t)),r)}}function ws(e,t,r){const{BYTES:n}=e;return function(i){let s;if(\"bigint\"==typeof i)s=i;else{let r=Xn(\"private key\",i);if(t){if(!t.includes(2*r.length))throw new Error(\"invalid private key\");const e=new Uint8Array(n);e.set(r,e.length-r.length),r=e}try{s=e.fromBytes(r)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof i}`)}}if(r&&(s=e.create(s)),!e.isValidNot0(s))throw new Error(\"invalid private key: out of range [1..N-1]\");return s}}function bs(e,t={}){const{Fp:r,Fn:n}=function(e,t,r={}){if(!t||\"object\"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of[\"p\",\"n\",\"h\"]){const r=t[e];if(!(\"bigint\"==typeof r&&r>Gi))throw new Error(`CURVE.${e} must be positive bigint`)}const n=cs(t.p,r.Fp),i=cs(t.n,r.Fn),s=[\"Gx\",\"Gy\",\"a\",\"weierstrass\"===e?\"b\":\"d\"];for(const e of s)if(!n.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{Fp:n,Fn:i}}(\"weierstrass\",e,t),{h:i,n:s}=e;ri(t,{},{allowInfinityPoint:\"boolean\",clearCofactor:\"function\",isTorsionFree:\"function\",fromBytes:\"function\",toBytes:\"function\",endo:\"object\",wrapPrivateKey:\"boolean\"});const{endo:o}=t;if(o&&(!r.is0(e.a)||\"bigint\"!=typeof o.beta||\"function\"!=typeof o.splitScalar))throw new Error('invalid endo: expected \"beta\": bigint and \"splitScalar\": function');function a(){if(!r.isOdd)throw new Error(\"compression is not supported: Field does not have .isOdd()\")}const c=t.toBytes||function(e,t,n){const{x:i,y:s}=t.toAffine(),o=r.toBytes(i);if(qn(\"isCompressed\",n),n){a();return sn(vs(!r.isOdd(s)),o)}return sn(Uint8Array.of(4),o,r.toBytes(s))},u=t.fromBytes||function(e){Lr(e);const t=r.BYTES,n=t+1,i=2*t+1,s=e.length,o=e[0],c=e.subarray(1);if(s!==n||2!==o&&3!==o){if(s===i&&4===o){const e=r.fromBytes(c.subarray(0*t,1*t)),n=r.fromBytes(c.subarray(1*t,2*t));if(!d(e,n))throw new Error(\"bad point: is not on curve\");return{x:e,y:n}}throw new Error(`bad point: got length ${s}, expected compressed=${n} or uncompressed=${i}`)}{const e=r.fromBytes(c);if(!r.isValid(e))throw new Error(\"bad point: is not on curve, wrong x\");const t=f(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?\": \"+e.message:\"\";throw new Error(\"bad point: is not on curve, sqrt error\"+t)}a();return!(1&~o)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}},f=ms(r,e.a,e.b);function d(e,t){const n=r.sqr(t),i=f(e);return r.eql(n,i)}if(!d(e.Gx,e.Gy))throw new Error(\"bad curve params: generator point\");const h=r.mul(r.pow(e.a,ys),gs),l=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(h,l)))throw new Error(\"bad curve params: a or b\");function p(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function y(e){if(!(e instanceof b))throw new Error(\"ProjectivePoint expected\")}const g=ni((e,t)=>{const{px:n,py:i,pz:s}=e;if(r.eql(s,r.ONE))return{x:n,y:i};const o=e.is0();null==t&&(t=o?r.ONE:r.inv(s));const a=r.mul(n,t),c=r.mul(i,t),u=r.mul(s,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error(\"invZ was invalid\");return{x:a,y:c}}),m=ni(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw new Error(\"bad point: ZERO\")}const{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error(\"bad point: x or y not field elements\");if(!d(n,i))throw new Error(\"bad point: equation left != right\");if(!e.isTorsionFree())throw new Error(\"bad point: not in prime-order subgroup\");return!0});function w(e,t,n,i,s){return n=new b(r.mul(n.px,e),n.py,n.pz),t=Yi(i,t),n=Yi(s,n),t.add(n)}class b{constructor(e,t,r){this.px=p(\"x\",e),this.py=p(\"y\",t,!0),this.pz=p(\"z\",r),Object.freeze(this)}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error(\"invalid affine point\");if(e instanceof b)throw new Error(\"projective point not allowed\");return r.is0(t)&&r.is0(n)?b.ZERO:new b(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){return function(e,t,r){const n=\"pz\"===t?e=>e.pz:e=>e.ez,i=bi(e.Fp,r.map(n));return r.map((e,t)=>e.toAffine(i[t])).map(e.fromAffine)}(b,\"pz\",e)}static fromBytes(e){return Lr(e),b.fromHex(e)}static fromHex(e){const t=b.fromAffine(u(Xn(\"pointHex\",e)));return t.assertValidity(),t}static fromPrivateKey(e){const r=ws(n,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return b.BASE.multiply(r(e))}static msm(e,t){return as(b,n,e,t)}precompute(e=8,t=!0){return _.setWindowSize(this,e),t||this.multiply(ys),this}_setWindowSize(e){this.precompute(e)}assertValidity(){m(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error(\"Field doesn't support isOdd\");return!r.isOdd(e)}equals(e){y(e);const{px:t,py:n,pz:i}=this,{px:s,py:o,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(s,i)),u=r.eql(r.mul(n,a),r.mul(o,i));return c&&u}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:t,b:n}=e,i=r.mul(n,ys),{px:s,py:o,pz:a}=this;let c=r.ZERO,u=r.ZERO,f=r.ZERO,d=r.mul(s,s),h=r.mul(o,o),l=r.mul(a,a),p=r.mul(s,o);return p=r.add(p,p),f=r.mul(s,a),f=r.add(f,f),c=r.mul(t,f),u=r.mul(i,l),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(p,c),f=r.mul(i,f),l=r.mul(t,l),p=r.sub(d,l),p=r.mul(t,p),p=r.add(p,f),f=r.add(d,d),d=r.add(f,d),d=r.add(d,l),d=r.mul(d,p),u=r.add(u,d),l=r.mul(o,a),l=r.add(l,l),d=r.mul(l,p),c=r.sub(c,d),f=r.mul(l,h),f=r.add(f,f),f=r.add(f,f),new b(c,u,f)}add(t){y(t);const{px:n,py:i,pz:s}=this,{px:o,py:a,pz:c}=t;let u=r.ZERO,f=r.ZERO,d=r.ZERO;const h=e.a,l=r.mul(e.b,ys);let p=r.mul(n,o),g=r.mul(i,a),m=r.mul(s,c),w=r.add(n,i),v=r.add(o,a);w=r.mul(w,v),v=r.add(p,g),w=r.sub(w,v),v=r.add(n,s);let _=r.add(o,c);return v=r.mul(v,_),_=r.add(p,m),v=r.sub(v,_),_=r.add(i,s),u=r.add(a,c),_=r.mul(_,u),u=r.add(g,m),_=r.sub(_,u),d=r.mul(h,v),u=r.mul(l,m),d=r.add(u,d),u=r.sub(g,d),d=r.add(g,d),f=r.mul(u,d),g=r.add(p,p),g=r.add(g,p),m=r.mul(h,m),v=r.mul(l,v),g=r.add(g,m),m=r.sub(p,m),m=r.mul(h,m),v=r.add(v,m),p=r.mul(g,v),f=r.add(f,p),p=r.mul(_,v),u=r.mul(w,u),u=r.sub(u,p),p=r.mul(w,g),d=r.mul(_,d),d=r.add(d,p),new b(u,f,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}multiply(e){const{endo:r}=t;if(!n.isValidNot0(e))throw new Error(\"invalid scalar: out of range\");let i,s;const o=e=>_.wNAFCached(this,e,b.normalizeZ);if(r){const{k1neg:t,k1:n,k2neg:a,k2:c}=r.splitScalar(e),{p:u,f}=o(n),{p:d,f:h}=o(c);s=f.add(h),i=w(r.beta,u,d,t,a)}else{const{p:t,f:r}=o(e);i=t,s=r}return b.normalizeZ([i,s])[0]}multiplyUnsafe(e){const{endo:r}=t,i=this;if(!n.isValid(e))throw new Error(\"invalid scalar: out of range\");if(e===hs||i.is0())return b.ZERO;if(e===ls)return i;if(_.hasPrecomputes(this))return this.multiply(e);if(r){const{k1neg:t,k1:n,k2neg:s,k2:o}=r.splitScalar(e),{p1:a,p2:c}=function(e,t,r,n){let i=t,s=e.ZERO,o=e.ZERO;for(;r>Gi||n>Gi;)r&Ji&&(s=s.add(i)),n&Ji&&(o=o.add(i)),i=i.double(),r>>=Ji,n>>=Ji;return{p1:s,p2:o}}(b,i,n,o);return w(r.beta,a,c,t,s)}return _.wNAFCachedUnsafe(i,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return g(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return i===ls||(e?e(b,this):_.wNAFCachedUnsafe(this,s).is0())}clearCofactor(){const{clearCofactor:e}=t;return i===ls?this:e?e(b,this):this.multiplyUnsafe(i)}toBytes(e=!0){return qn(\"isCompressed\",e),this.assertValidity(),c(b,this,e)}toRawBytes(e=!0){return this.toBytes(e)}toHex(e=!0){return Hr(this.toBytes(e))}toString(){return`<Point ${this.is0()?\"ZERO\":this.toHex()}>`}}b.BASE=new b(e.Gx,e.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO),b.Fp=r,b.Fn=n;const v=n.BITS,_=function(e,t){return{constTimeNegate:Yi,hasPrecomputes:e=>1!==ss(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>Gi;)r&Ji&&(n=n.add(i)),i=i.double(),r>>=Ji;return n},precomputeWindow(e,r){const{windows:n,windowSize:i}=Qi(r,t),s=[];let o=e,a=o;for(let e=0;e<n;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(r,n,i){let s=e.ZERO,o=e.BASE;const a=Qi(r,t);for(let e=0;e<a.windows;e++){const{nextN:t,offset:r,isZero:c,isNeg:u,isNegF:f,offsetF:d}=es(i,e,a);i=t,c?o=o.add(Yi(f,n[d])):s=s.add(Yi(u,n[r]))}return os(i),{p:s,f:o}},wNAFUnsafe(r,n,i,s=e.ZERO){const o=Qi(r,t);for(let e=0;e<o.windows&&i!==Gi;e++){const{nextN:t,offset:r,isZero:a,isNeg:c}=es(i,e,o);if(i=t,!a){const e=n[r];s=s.add(c?e.negate():e)}}return os(i),s},getPrecomputes(e,t,r){let n=ns.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&(\"function\"==typeof r&&(n=r(n)),ns.set(t,n))),n},wNAFCached(e,t,r){const n=ss(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const i=ss(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){Xi(r,t),is.set(e,r),ns.delete(e)}}}(b,t.endo?Math.ceil(v/2):v);return b}function vs(e){return Uint8Array.of(e?2:3)}function _s(e,t,r={}){ri(t,{hash:\"function\"},{hmac:\"function\",lowS:\"boolean\",randomBytes:\"function\",bits2int:\"function\",bits2int_modN:\"function\"});const n=t.randomBytes||cn,i=t.hmac||((e,...r)=>Wi(t.hash,e,sn(...r))),{Fp:s,Fn:o}=e,{ORDER:a,BITS:c}=o;function u(e){return e>a>>ls}function f(e,t){if(!o.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..CURVE.n`)}class d{constructor(e,t,r){f(\"r\",e),f(\"s\",t),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){const t=o.BYTES,r=Xn(\"compactSignature\",e,2*t);return new d(o.fromBytes(r.subarray(0,t)),o.fromBytes(r.subarray(t,2*t)))}static fromDER(e){const{r:t,s:r}=ds.toSig(Xn(\"DER\",e));return new d(t,r)}assertValidity(){}addRecoveryBit(e){return new d(this.r,this.s,e)}recoverPublicKey(t){const r=s.ORDER,{r:n,s:i,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error(\"recovery id invalid\");if(a*ps<r&&c>1)throw new Error(\"recovery id is ambiguous for h>1 curve\");const u=2===c||3===c?n+a:n;if(!s.isValid(u))throw new Error(\"recovery id 2 or 3 invalid\");const f=s.toBytes(u),d=e.fromHex(sn(vs(!(1&c)),f)),h=o.inv(u),l=g(Xn(\"msgHash\",t)),p=o.create(-l*h),y=o.create(i*h),m=e.BASE.multiplyUnsafe(p).add(d.multiplyUnsafe(y));if(m.is0())throw new Error(\"point at infinify\");return m.assertValidity(),m}hasHighS(){return u(this.s)}normalizeS(){return this.hasHighS()?new d(this.r,o.neg(this.s),this.recovery):this}toBytes(e){if(\"compact\"===e)return sn(o.toBytes(this.r),o.toBytes(this.s));if(\"der\"===e)return tn(ds.hexFromSig(this));throw new Error(\"invalid format\")}toDERRawBytes(){return this.toBytes(\"der\")}toDERHex(){return Hr(this.toBytes(\"der\"))}toCompactRawBytes(){return this.toBytes(\"compact\")}toCompactHex(){return Hr(this.toBytes(\"compact\"))}}const h=ws(o,r.allowedPrivateKeyLengths,r.wrapPrivateKey),l={isValidPrivateKey(e){try{return h(e),!0}catch(e){return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const e=a;return function(e,t,r=!1){const n=e.length,i=Ei(t),s=Ai(t);if(n<16||n<s||n>1024)throw new Error(\"expected \"+s+\"-1024 bytes of input, got \"+n);const o=di(r?Gn(e):Wn(e),t-si)+si;return r?Yn(o,i):Jn(o,i)}(n(Ai(e)),e)},precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};function p(t){if(\"bigint\"==typeof t)return!1;if(t instanceof e)return!0;const n=Xn(\"key\",t).length,i=s.BYTES,a=i+1,c=2*i+1;return r.allowedPrivateKeyLengths||o.BYTES===a?void 0:n===a||n===c}const y=t.bits2int||function(e){if(e.length>8192)throw new Error(\"input is too large\");const t=Wn(e),r=8*e.length-c;return r>0?t>>BigInt(r):t},g=t.bits2int_modN||function(e){return o.create(y(e))},m=ti(c);function w(e){return ei(\"num < 2^\"+c,e,hs,m),o.toBytes(e)}function b(r,i,a=v){if([\"recovered\",\"canonical\"].some(e=>e in a))throw new Error(\"sign() legacy options not supported\");const{hash:c}=t;let{lowS:f,prehash:l,extraEntropy:p}=a;null==f&&(f=!0),r=Xn(\"msgHash\",r),us(a),l&&(r=Xn(\"prehashed msgHash\",c(r)));const m=g(r),b=h(i),_=[w(b),w(m)];if(null!=p&&!1!==p){const e=!0===p?n(s.BYTES):p;_.push(Xn(\"extraEntropy\",e))}const x=sn(..._),E=m;return{seed:x,k2sig:function(t){const r=y(t);if(!o.isValidNot0(r))return;const n=o.inv(r),i=e.BASE.multiply(r).toAffine(),s=o.create(i.x);if(s===hs)return;const a=o.create(n*o.create(E+s*b));if(a===hs)return;let c=(i.x===s?0:2)|Number(i.y&ls),h=a;return f&&u(a)&&(h=function(e){return u(e)?o.neg(e):e}(a),c^=1),new d(s,h,c)}}}const v={lowS:t.lowS,prehash:!1},_={lowS:t.lowS,prehash:!1};return e.BASE.precompute(8),Object.freeze({getPublicKey:function(t,r=!0){return e.fromPrivateKey(t).toBytes(r)},getSharedSecret:function(t,r,n=!0){if(!0===p(t))throw new Error(\"first arg must be private key\");if(!1===p(r))throw new Error(\"second arg must be public key\");return e.fromHex(r).multiply(h(t)).toBytes(n)},sign:function(e,r,n=v){const{seed:s,k2sig:a}=b(e,r,n),c=function(e,t,r){if(\"number\"!=typeof e||e<2)throw new Error(\"hashLen must be a number\");if(\"number\"!=typeof t||t<2)throw new Error(\"qByteLen must be a number\");if(\"function\"!=typeof r)throw new Error(\"hmacFn must be a function\");const n=e=>new Uint8Array(e),i=e=>Uint8Array.of(e);let s=n(e),o=n(e),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},u=(...e)=>r(o,s,...e),f=(e=n(0))=>{o=u(i(0),e),s=u(),0!==e.length&&(o=u(i(1),e),s=u())},d=()=>{if(a++>=1e3)throw new Error(\"drbg: tried 1000 values\");let e=0;const r=[];for(;e<t;){s=u();const t=s.slice();r.push(t),e+=s.length}return sn(...r)};return(e,t)=>{let r;for(c(),f(e);!(r=t(d()));)f();return c(),r}}(t.hash.outputLen,o.BYTES,i);return c(s,a)},verify:function(r,n,i,s=_){const a=r;n=Xn(\"msgHash\",n),i=Xn(\"publicKey\",i),us(s);const{lowS:c,prehash:u,format:f}=s;if(\"strict\"in s)throw new Error(\"options.strict was renamed to lowS\");if(void 0!==f&&![\"compact\",\"der\",\"js\"].includes(f))throw new Error('format must be \"compact\", \"der\" or \"js\"');const h=\"string\"==typeof a||Cr(a),l=!h&&!f&&\"object\"==typeof a&&null!==a&&\"bigint\"==typeof a.r&&\"bigint\"==typeof a.s;if(!h&&!l)throw new Error(\"invalid signature, expected Uint8Array, hex string or Signature instance\");let p,y;try{if(l){if(void 0!==f&&\"js\"!==f)throw new Error(\"invalid format\");p=new d(a.r,a.s)}if(h){try{\"compact\"!==f&&(p=d.fromDER(a))}catch(e){if(!(e instanceof ds.Err))throw e}p||\"der\"===f||(p=d.fromCompact(a))}y=e.fromHex(i)}catch(e){return!1}if(!p)return!1;if(c&&p.hasHighS())return!1;u&&(n=t.hash(n));const{r:m,s:w}=p,b=g(n),v=o.inv(w),x=o.create(b*v),E=o.create(m*v),A=e.BASE.multiplyUnsafe(x).add(y.multiplyUnsafe(E));return!A.is0()&&o.create(A.x)===m},utils:l,Point:e,Signature:d})}function xs(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy};return{CURVE:t,curveOpts:{Fp:e.Fp,Fn:xi(t.n,e.nBitLength),allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function Es(e){const{CURVE:t,curveOpts:r,ecdsaOpts:n}=function(e){const{CURVE:t,curveOpts:r}=xs(e);return{CURVE:t,curveOpts:r,ecdsaOpts:{hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN}}}(e);return function(e,t){return Object.assign({},t,{ProjectivePoint:t.Point,CURVE:e})}(e,_s(bs(t,r),n,r))}const As={p:BigInt(\"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f\"),n:BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt(\"0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\"),Gy:BigInt(\"0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\")},ks=(BigInt(0),BigInt(1)),Os=BigInt(2),Is=(e,t)=>(e+t/Os)/t;function Bs(e){const t=As.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,f=u*u*e%t,d=hi(f,r,t)*f%t,h=hi(d,r,t)*f%t,l=hi(h,Os,t)*u%t,p=hi(l,i,t)*l%t,y=hi(p,s,t)*p%t,g=hi(y,a,t)*y%t,m=hi(g,c,t)*g%t,w=hi(m,a,t)*y%t,b=hi(w,r,t)*f%t,v=hi(b,o,t)*p%t,_=hi(v,n,t)*u%t,x=hi(_,Os,t);if(!Ss.eql(Ss.sqr(x),e))throw new Error(\"Cannot find square root\");return x}const Ss=xi(As.p,void 0,void 0,{sqrt:Bs}),Ns=function(e,t){const r=t=>Es({...e,hash:t});return{...r(t),create:r}}({...As,Fp:Ss,lowS:!0,endo:{beta:BigInt(\"0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\"),splitScalar:e=>{const t=As.n,r=BigInt(\"0x3086d221a7d46bcde86c90e49284eb15\"),n=-ks*BigInt(\"0xe4437ed6010e88286f547fa90abfe4c3\"),i=BigInt(\"0x114ca50f7a8e2f3f657c1108d9d44cfd8\"),s=r,o=BigInt(\"0x100000000000000000000000000000000\"),a=Is(s*e,t),c=Is(-n*e,t);let u=di(e-a*r-c*i,t),f=di(-a*n-c*s,t);const d=u>o,h=f>o;if(d&&(u=t-u),h&&(f=t-f),u>o||f>o)throw new Error(\"splitScalar: Endomorphism failed, k=\"+e);return{k1neg:d,k1:u,k2neg:h,k2:f}}}},Ki);const Rs=Ki;function Us(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&\"Uint8Array\"===e.constructor.name}function Ts(e){if(\"boolean\"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function Cs(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(\"positive integer expected, got \"+e)}function js(e,...t){if(!Us(e))throw new Error(\"Uint8Array expected\");if(t.length>0&&!t.includes(e.length))throw new Error(\"Uint8Array expected of length \"+t+\", got length=\"+e.length)}function Ls(e,t=!0){if(e.destroyed)throw new Error(\"Hash instance has been destroyed\");if(t&&e.finished)throw new Error(\"Hash#digest() has already been called\")}function $s(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ps(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Zs=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],Fs=\"function\"==typeof Uint8Array.from([]).toHex&&\"function\"==typeof Uint8Array.fromHex,Ms=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,\"0\"));function zs(e){if(js(e),Fs)return e.toHex();let t=\"\";for(let r=0;r<e.length;r++)t+=Ms[e[r]];return t}const Vs=48,Ds=57,qs=65,Ks=70,Hs=97,Ws=102;function Gs(e){return e>=Vs&&e<=Ds?e-Vs:e>=qs&&e<=Ks?e-(qs-10):e>=Hs&&e<=Ws?e-(Hs-10):void 0}function Js(e){if(\"string\"!=typeof e)throw new Error(\"hex string expected, got \"+typeof e);if(Fs)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error(\"hex string expected, got unpadded hex of length \"+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=Gs(e.charCodeAt(i)),s=Gs(e.charCodeAt(i+1));if(void 0===r||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character \"'+t+'\" at index '+i)}n[t]=16*r+s}return n}function Ys(e){if(\"string\"!=typeof e)throw new Error(\"string expected\");return new Uint8Array((new TextEncoder).encode(e))}function Xs(e){if(\"string\"==typeof e)e=Ys(e);else{if(!Us(e))throw new Error(\"Uint8Array expected, got \"+typeof e);e=eo(e)}return e}function Qs(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error(\"invalid output length, expected \"+e+\", got: \"+t.length);if(r&&!function(e){return e.byteOffset%4==0}(t))throw new Error(\"invalid output, must be aligned\");return t}function eo(e){return Uint8Array.from(e)}const to=e=>Uint8Array.from(e.split(\"\").map(e=>e.charCodeAt(0))),ro=to(\"expand 16-byte k\"),no=to(\"expand 32-byte k\"),io=$s(ro),so=$s(no);function oo(e,t){return e<<t|e>>>32-t}function ao(e){return e.byteOffset%4==0}const co=2**32-1,uo=new Uint32Array;function fo(e,t){const{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:s,rounds:o}=function(e,t){if(null==t||\"object\"!=typeof t)throw new Error(\"options must be defined\");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(\"function\"!=typeof e)throw new Error(\"core must be a function\");return Cs(i),Cs(o),Ts(s),Ts(r),(t,a,c,u,f=0)=>{js(t),js(a),js(c);const d=c.length;if(void 0===u&&(u=new Uint8Array(d)),js(u),Cs(f),f<0||f>=co)throw new Error(\"arx: counter overflow\");if(u.length<d)throw new Error(`arx: output (${u.length}) is shorter than data (${d})`);const h=[];let l,p,y=t.length;if(32===y)h.push(l=eo(t)),p=so;else{if(16!==y||!r)throw new Error(`arx: invalid 32-byte key, got length=${y}`);l=new Uint8Array(32),l.set(t),l.set(t,16),p=io,h.push(l)}ao(a)||h.push(a=eo(a));const g=$s(l);if(n){if(24!==a.length)throw new Error(\"arx: extended nonce must be 24 bytes\");n(p,g,$s(a.subarray(0,16)),g),a=a.subarray(16)}const m=16-i;if(m!==a.length)throw new Error(`arx: nonce must be ${m} or 16 bytes`);if(12!==m){const e=new Uint8Array(12);e.set(a,s?0:12-a.length),a=e,h.push(a)}const w=$s(a);return function(e,t,r,n,i,s,o,a){const c=i.length,u=new Uint8Array(64),f=$s(u),d=ao(i)&&ao(s),h=d?$s(i):uo,l=d?$s(s):uo;for(let p=0;p<c;o++){if(e(t,r,n,f,o,a),o>=co)throw new Error(\"arx: counter overflow\");const y=Math.min(64,c-p);if(d&&64===y){const e=p/4;if(p%4!=0)throw new Error(\"arx: invalid block position\");for(let t,r=0;r<16;r++)t=e+r,l[t]=h[t]^f[r];p+=64;continue}for(let e,t=0;t<y;t++)e=p+t,s[e]=i[e]^u[t];p+=y}}(e,p,g,w,c,u,f,o),Ps(...h),u}}const ho=(e,t)=>255&e[t++]|(255&e[t++])<<8;class lo{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,js(e=Xs(e),32);const t=ho(e,0),r=ho(e,2),n=ho(e,4),i=ho(e,6),s=ho(e,8),o=ho(e,10),a=ho(e,12),c=ho(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|i<<9),this.r[4]=255&(i>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|o<<2),this.r[7]=8065&(o>>>11|a<<5),this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=ho(e,16+2*t)}process(e,t,r=!1){const n=r?0:2048,{h:i,r:s}=this,o=s[0],a=s[1],c=s[2],u=s[3],f=s[4],d=s[5],h=s[6],l=s[7],p=s[8],y=s[9],g=ho(e,t+0),m=ho(e,t+2),w=ho(e,t+4),b=ho(e,t+6),v=ho(e,t+8),_=ho(e,t+10),x=ho(e,t+12),E=ho(e,t+14);let A=i[0]+(8191&g),k=i[1]+(8191&(g>>>13|m<<3)),O=i[2]+(8191&(m>>>10|w<<6)),I=i[3]+(8191&(w>>>7|b<<9)),B=i[4]+(8191&(b>>>4|v<<12)),S=i[5]+(v>>>1&8191),N=i[6]+(8191&(v>>>14|_<<2)),R=i[7]+(8191&(_>>>11|x<<5)),U=i[8]+(8191&(x>>>8|E<<8)),T=i[9]+(E>>>5|n),C=0,j=C+A*o+k*(5*y)+O*(5*p)+I*(5*l)+B*(5*h);C=j>>>13,j&=8191,j+=S*(5*d)+N*(5*f)+R*(5*u)+U*(5*c)+T*(5*a),C+=j>>>13,j&=8191;let L=C+A*a+k*o+O*(5*y)+I*(5*p)+B*(5*l);C=L>>>13,L&=8191,L+=S*(5*h)+N*(5*d)+R*(5*f)+U*(5*u)+T*(5*c),C+=L>>>13,L&=8191;let $=C+A*c+k*a+O*o+I*(5*y)+B*(5*p);C=$>>>13,$&=8191,$+=S*(5*l)+N*(5*h)+R*(5*d)+U*(5*f)+T*(5*u),C+=$>>>13,$&=8191;let P=C+A*u+k*c+O*a+I*o+B*(5*y);C=P>>>13,P&=8191,P+=S*(5*p)+N*(5*l)+R*(5*h)+U*(5*d)+T*(5*f),C+=P>>>13,P&=8191;let Z=C+A*f+k*u+O*c+I*a+B*o;C=Z>>>13,Z&=8191,Z+=S*(5*y)+N*(5*p)+R*(5*l)+U*(5*h)+T*(5*d),C+=Z>>>13,Z&=8191;let F=C+A*d+k*f+O*u+I*c+B*a;C=F>>>13,F&=8191,F+=S*o+N*(5*y)+R*(5*p)+U*(5*l)+T*(5*h),C+=F>>>13,F&=8191;let M=C+A*h+k*d+O*f+I*u+B*c;C=M>>>13,M&=8191,M+=S*a+N*o+R*(5*y)+U*(5*p)+T*(5*l),C+=M>>>13,M&=8191;let z=C+A*l+k*h+O*d+I*f+B*u;C=z>>>13,z&=8191,z+=S*c+N*a+R*o+U*(5*y)+T*(5*p),C+=z>>>13,z&=8191;let V=C+A*p+k*l+O*h+I*d+B*f;C=V>>>13,V&=8191,V+=S*u+N*c+R*a+U*o+T*(5*y),C+=V>>>13,V&=8191;let D=C+A*y+k*p+O*l+I*h+B*d;C=D>>>13,D&=8191,D+=S*f+N*u+R*c+U*a+T*o,C+=D>>>13,D&=8191,C=(C<<2)+C|0,C=C+j|0,j=8191&C,C>>>=13,L+=C,i[0]=j,i[1]=L,i[2]=$,i[3]=P,i[4]=Z,i[5]=F,i[6]=M,i[7]=z,i[8]=V,i[9]=D}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let i=(1^n)-1;for(let e=0;e<10;e++)r[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|r[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let s=e[0]+t[0];e[0]=65535&s;for(let r=1;r<8;r++)s=(e[r]+t[r]|0)+(s>>>16)|0,e[r]=65535&s;Ps(r)}update(e){Ls(this),js(e=Xs(e));const{buffer:t,blockLen:r}=this,n=e.length;for(let i=0;i<n;){const s=Math.min(r-this.pos,n-i);if(s!==r)t.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=n-i;i+=r)this.process(e,i)}return this}destroy(){Ps(this.h,this.r,this.buffer,this.pad)}digestInto(e){Ls(this),function(e,t){js(e);const r=t.outputLen;if(e.length<r)throw new Error(\"digestInto() expects output buffer of length at least \"+r)}(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=r[t]>>>0,e[i++]=r[t]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}const po=function(e){const t=(t,r)=>e(r).update(Xs(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new lo(e));function yo(e,t,r,n,i,s=20){let o=e[0],a=t[0],c=t[1],u=t[2],f=t[3],d=e[1],h=r[0],l=r[1],p=i,y=e[2],g=t[4],m=t[5],w=t[6],b=t[7],v=e[3],_=o,x=a,E=c,A=u,k=f,O=d,I=h,B=l,S=p,N=0,R=y,U=g,T=m,C=w,j=b,L=v;for(let e=0;e<s;e+=2)k^=oo(_+T|0,7),S^=oo(k+_|0,9),T^=oo(S+k|0,13),_^=oo(T+S|0,18),N^=oo(O+x|0,7),C^=oo(N+O|0,9),x^=oo(C+N|0,13),O^=oo(x+C|0,18),j^=oo(R+I|0,7),E^=oo(j+R|0,9),I^=oo(E+j|0,13),R^=oo(I+E|0,18),A^=oo(L+U|0,7),B^=oo(A+L|0,9),U^=oo(B+A|0,13),L^=oo(U+B|0,18),x^=oo(_+A|0,7),E^=oo(x+_|0,9),A^=oo(E+x|0,13),_^=oo(A+E|0,18),I^=oo(O+k|0,7),B^=oo(I+O|0,9),k^=oo(B+I|0,13),O^=oo(k+B|0,18),U^=oo(R+N|0,7),S^=oo(U+R|0,9),N^=oo(S+U|0,13),R^=oo(N+S|0,18),T^=oo(L+j|0,7),C^=oo(T+L|0,9),j^=oo(C+T|0,13),L^=oo(j+C|0,18);let $=0;n[$++]=o+_|0,n[$++]=a+x|0,n[$++]=c+E|0,n[$++]=u+A|0,n[$++]=f+k|0,n[$++]=d+O|0,n[$++]=h+I|0,n[$++]=l+B|0,n[$++]=p+S|0,n[$++]=0+N|0,n[$++]=y+R|0,n[$++]=g+U|0,n[$++]=m+T|0,n[$++]=w+C|0,n[$++]=b+j|0,n[$++]=v+L|0}function go(e,t,r,n){let i=e[0],s=t[0],o=t[1],a=t[2],c=t[3],u=e[1],f=r[0],d=r[1],h=r[2],l=r[3],p=e[2],y=t[4],g=t[5],m=t[6],w=t[7],b=e[3];for(let e=0;e<20;e+=2)c^=oo(i+g|0,7),h^=oo(c+i|0,9),g^=oo(h+c|0,13),i^=oo(g+h|0,18),l^=oo(u+s|0,7),m^=oo(l+u|0,9),s^=oo(m+l|0,13),u^=oo(s+m|0,18),w^=oo(p+f|0,7),o^=oo(w+p|0,9),f^=oo(o+w|0,13),p^=oo(f+o|0,18),a^=oo(b+y|0,7),d^=oo(a+b|0,9),y^=oo(d+a|0,13),b^=oo(y+d|0,18),s^=oo(i+a|0,7),o^=oo(s+i|0,9),a^=oo(o+s|0,13),i^=oo(a+o|0,18),f^=oo(u+c|0,7),d^=oo(f+u|0,9),c^=oo(d+f|0,13),u^=oo(c+d|0,18),y^=oo(p+l|0,7),h^=oo(y+p|0,9),l^=oo(h+y|0,13),p^=oo(l+h|0,18),g^=oo(b+w|0,7),m^=oo(g+b|0,9),w^=oo(m+g|0,13),b^=oo(w+m|0,18);let v=0;n[v++]=i,n[v++]=u,n[v++]=p,n[v++]=b,n[v++]=f,n[v++]=d,n[v++]=h,n[v++]=l}fo(yo,{allowShortKeys:!0,counterRight:!0});const mo=fo(yo,{counterRight:!0,extendNonceFn:go}),wo=((e,t)=>{function r(r,...n){if(js(r),!Zs)throw new Error(\"Non little-endian hardware is not yet supported\");if(void 0!==e.nonceLength){const t=n[0];if(!t)throw new Error(\"nonce / iv required\");e.varSizeNonce?js(t):js(t,e.nonceLength)}const i=e.tagLength;i&&void 0!==n[1]&&js(n[1]);const s=t(r,...n),o=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error(\"cipher output not supported\");js(t)}};let a=!1;return{encrypt(e,t){if(a)throw new Error(\"cannot encrypt() twice with same key + nonce\");return a=!0,js(e),o(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(js(e),i&&e.length<i)throw new Error(\"invalid ciphertext length: smaller than tagLength=\"+i);return o(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:24,tagLength:16},(e,t)=>({encrypt(r,n){const i=(n=Qs(r.length+32,n,!1)).subarray(0,32),s=n.subarray(32);n.set(r,32),Ps(i),mo(e,t,n,n);const o=po(s,i);return n.set(o,16),Ps(n.subarray(0,16),o),n.subarray(16)},decrypt(r,n){js(r);const i=(n=Qs(r.length+32,n,!1)).subarray(0,32),s=n.subarray(32,48),o=n.subarray(48);n.set(r,32),Ps(i);const a=mo(e,t,i,i),c=po(o,a);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(s,c))throw new Error(\"invalid tag\");return mo(e,t,n.subarray(16),n.subarray(16)),Ps(i,s,c),o}}));function bo(e,t){const r=wo(e,t);return{seal:r.encrypt,open:r.decrypt}}\"object\"==typeof globalThis&&\"crypto\"in globalThis&&globalThis.crypto;const vo=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),_o=new Uint8Array(16),xo=(e,t)=>{const r=$i.getSharedSecret(t,e),n=new Uint32Array(8);return go($s(vo),$s(r),$s(_o),n),i=n,new Uint8Array(i.buffer,i.byteOffset,i.byteLength);var i},Eo=(e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError(\"publicKey must be a Uint8Array\");if(!(t instanceof Uint8Array))throw new TypeError(\"secretKey must be a Uint8Array\")},Ao=(e,t)=>{if(32!==e.length)throw new TypeError(\"publicKey must be 32 bytes long\");if(32!==t.length)throw new TypeError(\"secretKey must be 32 bytes long\")},ko={seal:(e,t,r,n)=>{Eo(r,n),Ao(r,n);return bo(xo(r,n),t).seal(e)},open:(e,t,r,n)=>{Eo(r,n),Ao(r,n);return bo(xo(r,n),t).open(e)},nonceLength:24,keyPair:()=>{const e=$i.utils.randomPrivateKey();return{secretKey:e,publicKey:$i.getPublicKey(e)}}},Oo=(e,t)=>{if(\"x25519-xsalsa20-poly1305\"===e.version){let r;if(t instanceof Uint8Array)r=t;else try{r=Mn(t)}catch(e){throw new Error(\"Bad private key\")}const n=zn(e.nonce),i=zn(e.ciphertext),s=zn(e.ephemPublicKey);return function(e){return(new TextDecoder).decode(e)}(ko.open(i,n,s,r))}throw new Error(`Encryption type/version not supported (${e.version}).`)};async function Io(){return await snap.request({method:\"snap_listEntropySources\"})}async function Bo(e,t){return await snap.request({method:\"snap_getEntropy\",params:{version:1,source:e,...t?{salt:t}:{}}})}async function So(e,t){const r=await Bo(e,t);return Js(Ln(r))}async function No(e,t){const r=await So(e,t);return function(e){return`0x${zs(e)}`}(Ns.getPublicKey(r))}const Ro=\"metamask:snaps:encryption\";async function Uo(e,t){const r=t?`${Ro}${t}`:Ro;return await Bo(e,r)}async function To(e,t){const r=await Uo(e,t);return Fn($i.getPublicKey(r.slice(2)))}const Co=\"invalid tag\";const jo=Lt({entropySourceId:jt().optional()}),Lo=Lt({entropySourceId:jt().optional()}),$o=Lt({message:jt().startsWith(\"metamask:\"),entropySourceId:jt().optional()}),Po=Lt({data:Lt({version:$t(\"x25519-xsalsa20-poly1305\"),nonce:jt().length(32).base64(),ephemPublicKey:jt().length(44).base64(),ciphertext:jt().base64()}),entropySourceId:jt().optional()});const Zo=[\"https://portfolio.metamask.io\",\"https://portfolio-builds.metafi-dev.codefi.network\",\"https://docs.metamask.io\",\"https://developer.metamask.io\",\"metamask\"];function Fo(e){if(e&&!Zo.includes(e))return e}const Mo=async({request:e,origin:t})=>{const r=Fo(t);switch(e.method){case\"getPublicKey\":{const{params:t}=e;if(!t)return No(void 0,r);!function(e){try{jo.parse(e)}catch{throw ee({message:\"`getPublicKey`, must take an optional `entropySourceId` parameter\"})}}(t);const{entropySourceId:n}=t;return No(n,r)}case\"getAllPublicKeys\":return async function(e){const t=await Io(),r=[];return await Promise.all(t.map(async t=>{const n=await No(t.id,e);r.push([t.id,n])})),r}(r);case\"signMessage\":{const{params:t}=e;!function(e){try{$o.parse(e)}catch{throw ee({message:\"`signMessage`, must take a `message` parameter that must begin with `metamask:`\"})}}(t);const{message:n,entropySourceId:i}=t;return await async function(e,t,r){const n=await So(t,r),i=Rs(e);return`0x${Ns.sign(i,n).toCompactHex()}`}(n,i,r)}case\"getEncryptionPublicKey\":{const{params:t}=e;if(!t)return To(void 0,r);!function(e){try{Lo.parse(e)}catch(e){throw ee({message:\"`getEncryptionPublicKey`, expects an optional `entropySourceId` parameter\"})}}(t);const{entropySourceId:n}=t;return To(n,r)}case\"decryptMessage\":{const{params:t}=e;!function(e){try{Po.parse(e)}catch(e){throw ee({message:\"`decryptMessage`, expects a `data` parameter that must match the Eip1024EncryptedData schema, and an optional entropySourceId string parameter\"})}}(t);const{data:n,entropySourceId:i}=t;return await async function(e,t,r){if(t){const n=await Uo(t,r);return Oo(e,n)}const n=await Io();let i=null;for(const t of n){const n=await Uo(t.id,r);try{return Oo(e,n)}catch(e){e.message!==Co&&(i=i??e)}}throw i??new Error(Co)}(n,i,r)}default:throw te({data:{method:e.method}})}}})(),module.exports=n})();"}],"removable":false}