UNPKG

@cenoa/waas-js-sdk

Version:

Official Cenoa Wallet as a Service SDK

2 lines 640 kB
/*! For license information please see index.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.exampleTypescriptPackage=t():e.exampleTypescriptPackage=t()}(this,(()=>(()=>{var e={3562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCurve=t.getHash=void 0;const n=r(9615),s=r(9175),i=r(1705);function o(e){return{hash:e,hmac:(t,...r)=>(0,n.hmac)(e,t,(0,s.concatBytes)(...r)),randomBytes:s.randomBytes}}t.getHash=o,t.createCurve=function(e,t){const r=t=>(0,i.weierstrass)({...e,...o(t)});return Object.freeze({...r(t),create:r})}},2422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBasic=t.wNAF=void 0;const n=r(4967),s=r(1484),i=BigInt(0),o=BigInt(1);t.wNAF=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,s=t;for(;r>i;)r&o&&(n=n.add(s)),s=s.double(),r>>=o;return n},precomputeWindow(e,t){const{windows:r,windowSize:s}=n(t),i=[];let o=e,a=o;for(let e=0;e<r;e++){a=o,i.push(a);for(let e=1;e<s;e++)a=a.add(o),i.push(a);o=a.double()}return i},wNAF(t,s,i){const{windows:a,windowSize:c}=n(t);let u=e.ZERO,l=e.BASE;const d=BigInt(2**t-1),f=2**t,h=BigInt(t);for(let e=0;e<a;e++){const t=e*c;let n=Number(i&d);i>>=h,n>c&&(n-=f,i+=o);const a=t,p=t+Math.abs(n)-1,g=e%2!=0,y=n<0;0===n?l=l.add(r(g,s[a])):u=u.add(r(y,s[p]))}return{p:u,f:l}},wNAFCached(e,t,r,n){const s=e._WINDOW_SIZE||1;let i=t.get(e);return i||(i=this.precomputeWindow(e,s),1!==s&&t.set(e,n(i))),this.wNAF(s,i,r)}}},t.validateBasic=function(e){return(0,n.validateField)(e.Fp),(0,s.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},1761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;const n=r(4967),s=r(1484),i=s.bytesToNumberBE;function o(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function a(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function u(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function l(e,t,r,n){c(e),c(t),u(r),t.length>255&&(t=n((0,s.concatBytes)((0,s.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:l}=n,d=Math.ceil(r/i);if(d>255)throw new Error("Invalid xmd length");const f=(0,s.concatBytes)(t,o(t.length,1)),h=o(0,l),p=o(r,2),g=new Array(d),y=n((0,s.concatBytes)(h,e,p,o(0,1),f));g[0]=n((0,s.concatBytes)(y,o(1,1),f));for(let e=1;e<=d;e++){const t=[a(y,g[e-1]),o(e+1,1),f];g[e]=n((0,s.concatBytes)(...t))}return(0,s.concatBytes)(...g).slice(0,r)}function d(e,t,r,n,i){if(c(e),c(t),u(r),t.length>255){const e=Math.ceil(2*n/8);t=i.create({dkLen:e}).update((0,s.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(o(r,2)).update(t).update(o(t.length,1)).digest()}function f(e,t,r){(0,s.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:a,m:f,hash:h,expand:p,DST:g}=r;c(e),u(t);const y=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,s.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(g),m=o.toString(2).length,b=Math.ceil((m+a)/8),w=t*f*b;let v;if("xmd"===p)v=l(e,y,w,h);else if("xof"===p)v=d(e,y,w,a,h);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');v=e}const A=new Array(t);for(let e=0;e<t;e++){const t=new Array(f);for(let r=0;r<f;r++){const s=b*(r+e*f),a=v.subarray(s,s+b);t[r]=(0,n.mod)(i(a),o)}A[e]=t}return A}t.expand_message_xmd=l,t.expand_message_xof=d,t.hash_to_field=f,t.isogenyMap=function(e,t){const r=t.map((e=>Array.from(e).reverse()));return(t,n)=>{const[s,i,o,a]=r.map((r=>r.reduce(((r,n)=>e.add(e.mul(r,t),n)))));return t=e.div(s,i),n=e.mul(n,e.div(o,a)),{x:t,y:n}}},t.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){const i=f(n,2,{...r,DST:r.DST,...s}),o=e.fromAffine(t(i[0])),a=e.fromAffine(t(i[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){const i=f(n,1,{...r,DST:r.encodeDST,...s}),o=e.fromAffine(t(i[0])).clearCofactor();return o.assertValidity(),o}}}},4967:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapHashToField=t.getMinHashLength=t.getFieldBytesLength=t.hashToPrivateScalar=t.FpSqrtEven=t.FpSqrtOdd=t.Field=t.nLength=t.FpIsSquare=t.FpDiv=t.FpInvertBatch=t.FpPow=t.validateField=t.isNegativeLE=t.FpSqrt=t.tonelliShanks=t.invert=t.pow2=t.pow=t.mod=void 0;const n=r(1484),s=BigInt(0),i=BigInt(1),o=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(e,t){const r=e%t;return r>=s?r:t+r}function f(e,t,r){if(r<=s||t<s)throw new Error("Expected power/modulo > 0");if(r===i)return s;let n=i;for(;t>s;)t&i&&(n=n*e%r),e=e*e%r,t>>=i;return n}function h(e,t){if(e===s||t<=s)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=d(e,t),n=t,o=s,a=i,c=i,u=s;for(;r!==s;){const e=n/r,t=n%r,s=o-c*e,i=a-u*e;n=r,r=t,o=c,a=u,c=s,u=i}if(n!==i)throw new Error("invert: does not exist");return d(o,t)}function p(e){const t=(e-i)/o;let r,n,a;for(r=e-i,n=0;r%o===s;r/=o,n++);for(a=o;a<e&&f(a,t,e)!==e-i;a++);if(1===n){const t=(e+i)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(r+i)/o;return function(e,s){if(e.pow(s,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=n,c=e.pow(e.mul(e.ONE,a),r),l=e.pow(s,u),d=e.pow(s,r);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,i<<BigInt(o-t-1));c=e.sqr(r),l=e.mul(l,r),d=e.mul(d,c),o=t}return l}}function g(e){if(e%c===a){const t=(e+i)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%l===u){const t=(e-u)/l;return function(e,r){const n=e.mul(r,o),s=e.pow(n,t),i=e.mul(r,s),a=e.mul(e.mul(i,o),s),c=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),r))throw new Error("Cannot find square root");return c}}return p(e)}BigInt(9),BigInt(16),t.mod=d,t.pow=f,t.pow2=function(e,t,r){let n=e;for(;t-- >s;)n*=n,n%=r;return n},t.invert=h,t.tonelliShanks=p,t.FpSqrt=g,t.isNegativeLE=(e,t)=>(d(e,t)&i)===i;const y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,t,r){if(r<s)throw new Error("Expected power > 0");if(r===s)return e.ONE;if(r===i)return t;let n=e.ONE,o=t;for(;r>s;)r&i&&(n=e.mul(n,o)),o=e.sqr(o),r>>=i;return n}function b(e,t){const r=new Array(t.length),n=t.reduce(((t,n,s)=>e.is0(n)?t:(r[s]=t,e.mul(t,n))),e.ONE),s=e.inv(n);return t.reduceRight(((t,n,s)=>e.is0(n)?t:(r[s]=e.mul(t,r[s]),e.mul(t,n))),s),r}function w(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function v(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 A(e){const t=v(e);return t+Math.ceil(t/2)}t.validateField=function(e){const t=y.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(e,t)},t.FpPow=m,t.FpInvertBatch=b,t.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?h(r,e.ORDER):e.inv(r))},t.FpIsSquare=function(e){const t=(e.ORDER-i)/o;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},t.nLength=w,t.Field=function(e,t,r=!1,o={}){if(e<=s)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:c}=w(e,t);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=g(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:c,MASK:(0,n.bitMask)(a),ZERO:s,ONE:i,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return s<=t&&t<e},is0:e=>e===s,isOdd:e=>(e&i)===i,neg:t=>d(-t,e),eql:(e,t)=>e===t,sqr:t=>d(t*t,e),add:(t,r)=>d(t+r,e),sub:(t,r)=>d(t-r,e),mul:(t,r)=>d(t*r,e),pow:(e,t)=>m(l,e,t),div:(t,r)=>d(t*h(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>h(t,e),sqrt:o.sqrt||(e=>u(l,e)),invertBatch:e=>b(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,c):(0,n.numberToBytesBE)(e,c),fromBytes:e=>{if(e.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)},t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},t.hashToPrivateScalar=function(e,t,r=!1){const s=(e=(0,n.ensureBytes)("privateHash",e)).length,o=w(t).nByteLength+8;if(o<24||s<o||s>1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${s}`);return d(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-i)+i},t.getFieldBytesLength=v,t.getMinHashLength=A,t.mapHashToField=function(e,t,r=!1){const s=e.length,o=v(t),a=A(t);if(s<16||s<a||s>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${s}`);const c=d(r?(0,n.bytesToNumberBE)(e):(0,n.bytesToNumberLE)(e),t-i)+i;return r?(0,n.numberToBytesLE)(c,o):(0,n.numberToBytesBE)(c,o)}},1484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;const r=BigInt(0),n=BigInt(1),s=BigInt(2),i=e=>e instanceof Uint8Array,o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function a(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,s=e.slice(n,n+2),i=Number.parseInt(s,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");r[t]=i}return r}function d(e,t){return l(e.toString(16).padStart(2*t,"0"))}function f(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t}t.bytesToHex=a,t.numberToHexUnpadded=c,t.hexToNumber=u,t.hexToBytes=l,t.bytesToNumberBE=function(e){return u(a(e))},t.bytesToNumberLE=function(e){if(!i(e))throw new Error("Uint8Array expected");return u(a(Uint8Array.from(e).reverse()))},t.numberToBytesBE=d,t.numberToBytesLE=function(e,t){return d(e,t).reverse()},t.numberToVarBytesBE=function(e){return l(c(e))},t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=l(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!i(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const s=n.length;if("number"==typeof r&&s!==r)throw new Error(`${e} expected ${r} bytes, got ${s}`);return n},t.concatBytes=f,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&n},t.bitSet=(e,t,s)=>e|(s?n:r)<<BigInt(t),t.bitMask=e=>(s<<BigInt(e-1))-n;const h=e=>new Uint8Array(e),p=e=>Uint8Array.from(e);t.createHmacDrbg=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");let n=h(e),s=h(e),i=0;const o=()=>{n.fill(1),s.fill(0),i=0},a=(...e)=>r(s,n,...e),c=(e=h())=>{s=a(p([0]),e),n=a(),0!==e.length&&(s=a(p([1]),e),n=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=a();const t=n.slice();r.push(t),e+=n.length}return f(...r)};return(e,t)=>{let r;for(o(),c(e);!(r=t(u()));)c();return o(),r}};const g={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const s=g[r];if("function"!=typeof s)throw new Error(`Invalid validator "${r}", expected function`);const i=e[t];if(!(n&&void 0===i||s(i,e)))throw new Error(`Invalid param ${String(t)}=${i} (${typeof i}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}},1705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToCurveSimpleSWU=t.SWUFpSqrtRatio=t.weierstrass=t.weierstrassPoints=t.DER=void 0;const n=r(4967),s=r(1484),i=r(1484),o=r(2422),{bytesToNumberBE:a,hexToBytes:c}=s;t.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:r}=t.DER;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");const n=e[1],s=e.subarray(2,n+2);if(!n||s.length!==n)throw new r("Invalid signature integer: wrong length");if(128&s[0])throw new r("Invalid signature integer: negative");if(0===s[0]&&!(128&s[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:a(s),l:e.subarray(n+2)}},toSig(e){const{Err:r}=t.DER,n="string"==typeof e?c(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let s=n.length;if(s<2||48!=n[0])throw new r("Invalid signature tag");if(n[1]!==s-2)throw new r("Invalid signature: incorrect length");const{d:i,l:o}=t.DER._parseInt(n.subarray(2)),{d:a,l:u}=t.DER._parseInt(o);if(u.length)throw new r("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),s=t(r(e.r)),i=n.length/2,o=s.length/2,a=r(i),c=r(o);return`30${r(o+i+4)}02${c}${s}02${a}${n}`}};const u=BigInt(0),l=BigInt(1),d=BigInt(2),f=BigInt(3),h=BigInt(4);function p(e){const t=function(e){const t=(0,o.validateBasic)(e);s.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,a=t.toBytes||((e,t,n)=>{const i=t.toAffine();return s.concatBytes(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),c=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function d(e){const{a:n,b:s}=t,i=r.sqr(e),o=r.mul(i,e);return r.add(r.add(o,r.mul(e,n)),s)}if(!r.eql(r.sqr(t.Gy),d(t.Gx)))throw new Error("bad generator point: equation left != right");function h(e){return"bigint"==typeof e&&u<e&&e<t.n}function p(e){if(!h(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function g(e){const{allowedPrivateKeyLengths:r,nByteLength:o,wrapPrivateKey:a,n:c}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=s.bytesToHex(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*o,"0")}let u;try{u="bigint"==typeof e?e:s.bytesToNumberBE((0,i.ensureBytes)("private key",e,o))}catch(t){throw new Error(`private key must be ${o} bytes, hex or bigint, not ${typeof e}`)}return a&&(u=n.mod(u,c)),p(u),u}const y=new Map;function m(e){if(!(e instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}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");const s=e=>r.eql(e,r.ZERO);return s(t)&&s(n)?b.ZERO:new b(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(b.fromAffine)}static fromHex(e){const t=b.fromAffine(c((0,i.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(g(e))}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const s=r.sqr(n),i=d(e);if(!r.eql(s,i))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:t,py:n,pz:s}=this,{px:i,py:o,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(i,s)),u=r.eql(r.mul(n,a),r.mul(o,s));return c&&u}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,s=r.mul(n,f),{px:i,py:o,pz:a}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(i,i),h=r.mul(o,o),p=r.mul(a,a),g=r.mul(i,o);return g=r.add(g,g),l=r.mul(i,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(s,p),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(s,l),p=r.mul(e,p),g=r.sub(d,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,p),d=r.mul(d,g),u=r.add(u,d),p=r.mul(o,a),p=r.add(p,p),d=r.mul(p,g),c=r.sub(c,d),l=r.mul(p,h),l=r.add(l,l),l=r.add(l,l),new b(c,u,l)}add(e){m(e);const{px:n,py:s,pz:i}=this,{px:o,py:a,pz:c}=e;let u=r.ZERO,l=r.ZERO,d=r.ZERO;const h=t.a,p=r.mul(t.b,f);let g=r.mul(n,o),y=r.mul(s,a),w=r.mul(i,c),v=r.add(n,s),A=r.add(o,a);v=r.mul(v,A),A=r.add(g,y),v=r.sub(v,A),A=r.add(n,i);let P=r.add(o,c);return A=r.mul(A,P),P=r.add(g,w),A=r.sub(A,P),P=r.add(s,i),u=r.add(a,c),P=r.mul(P,u),u=r.add(y,w),P=r.sub(P,u),d=r.mul(h,A),u=r.mul(p,w),d=r.add(u,d),u=r.sub(y,d),d=r.add(y,d),l=r.mul(u,d),y=r.add(g,g),y=r.add(y,g),w=r.mul(h,w),A=r.mul(p,A),y=r.add(y,w),w=r.sub(g,w),w=r.mul(h,w),A=r.add(A,w),g=r.mul(y,A),l=r.add(l,g),g=r.mul(P,A),u=r.mul(v,u),u=r.sub(u,g),g=r.mul(v,y),d=r.mul(P,d),d=r.add(d,g),new b(u,l,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return v.wNAFCached(this,y,e,(e=>{const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(b.fromAffine)}))}multiplyUnsafe(e){const n=b.ZERO;if(e===u)return n;if(p(e),e===l)return this;const{endo:s}=t;if(!s)return v.unsafeLadder(this,e);let{k1neg:i,k1:o,k2neg:a,k2:c}=s.splitScalar(e),d=n,f=n,h=this;for(;o>u||c>u;)o&l&&(d=d.add(h)),c&l&&(f=f.add(h)),h=h.double(),o>>=l,c>>=l;return i&&(d=d.negate()),a&&(f=f.negate()),f=new b(r.mul(f.px,s.beta),f.py,f.pz),d.add(f)}multiply(e){p(e);let n,s,i=e;const{endo:o}=t;if(o){const{k1neg:e,k1:t,k2neg:a,k2:c}=o.splitScalar(i);let{p:u,f:l}=this.wNAF(t),{p:d,f}=this.wNAF(c);u=v.constTimeNegate(e,u),d=v.constTimeNegate(a,d),d=new b(r.mul(d.px,o.beta),d.py,d.pz),n=u.add(d),s=l.add(f)}else{const{p:e,f:t}=this.wNAF(i);n=e,s=t}return b.normalizeZ([n,s])[0]}multiplyAndAddUnsafe(e,t,r){const n=b.BASE,s=(e,t)=>t!==u&&t!==l&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),i=s(this,t).add(s(e,r));return i.is0()?void 0:i}toAffine(e){const{px:t,py:n,pz:s}=this,i=this.is0();null==e&&(e=i?r.ONE:r.inv(s));const o=r.mul(t,e),a=r.mul(n,e),c=r.mul(s,e);if(i)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===l)return!0;if(r)return r(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===l?this:r?r(b,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),a(b,this,e)}toHex(e=!0){return s.bytesToHex(this.toRawBytes(e))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const w=t.nBitLength,v=(0,o.wNAF)(b,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:g,weierstrassEquation:d,isWithinCurveOrder:h}}function g(e,t){const r=e.ORDER;let n=u;for(let e=r-l;e%d===u;e/=d)n+=l;const s=n,i=d<<s-l-l,o=i*d,a=(r-l)/o,c=(a-l)/d,p=o-l,g=i,y=e.pow(t,a),m=e.pow(t,(a+l)/d);let b=(t,r)=>{let n=y,i=e.pow(r,p),o=e.sqr(i);o=e.mul(o,r);let a=e.mul(t,o);a=e.pow(a,c),a=e.mul(a,i),i=e.mul(a,r),o=e.mul(a,t);let u=e.mul(o,i);a=e.pow(u,g);let f=e.eql(a,e.ONE);i=e.mul(o,m),a=e.mul(u,n),o=e.cmov(i,o,f),u=e.cmov(a,u,f);for(let t=s;t>l;t--){let r=t-d;r=d<<r-l;let s=e.pow(u,r);const a=e.eql(s,e.ONE);i=e.mul(o,n),n=e.mul(n,n),s=e.mul(u,n),o=e.cmov(i,o,a),u=e.cmov(s,u,a)}return{isValid:f,value:o}};if(e.ORDER%h===f){const r=(e.ORDER-f)/h,n=e.sqrt(e.neg(t));b=(t,s)=>{let i=e.sqr(s);const o=e.mul(t,s);i=e.mul(i,o);let a=e.pow(i,r);a=e.mul(a,o);const c=e.mul(a,n),u=e.mul(e.sqr(a),s),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,a,l)}}}return b}t.weierstrassPoints=p,t.weierstrass=function(e){const r=function(e){const t=(0,o.validateBasic)(e);return s.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:a,n:c}=r,d=a.BYTES+1,f=2*a.BYTES+1;function h(e){return n.mod(e,c)}function g(e){return n.invert(e,c)}const{ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:b,isWithinCurveOrder:w}=p({...r,toBytes(e,t,r){const n=t.toAffine(),i=a.toBytes(n.x),o=s.concatBytes;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),i):o(Uint8Array.from([4]),i,a.toBytes(n.y))},fromBytes(e){const t=e.length,r=e[0],n=e.subarray(1);if(t!==d||2!==r&&3!==r){if(t===f&&4===r)return{x:a.fromBytes(n.subarray(0,a.BYTES)),y:a.fromBytes(n.subarray(a.BYTES,2*a.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${d} compressed bytes or ${f} uncompressed bytes`)}{const e=s.bytesToNumberBE(n);if(!(u<(i=e)&&i<a.ORDER))throw new Error("Point is not on curve");const t=b(e);let o=a.sqrt(t);return!(1&~r)!=((o&l)===l)&&(o=a.neg(o)),{x:e,y:o}}var i}}),v=e=>s.bytesToHex(s.numberToBytesBE(e,r.nByteLength));function A(e){return e>c>>l}const P=(e,t,r)=>s.bytesToNumberBE(e.slice(t,r));class E{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const t=r.nByteLength;return e=(0,i.ensureBytes)("compactSignature",e,2*t),new E(P(e,0,t),P(e,t,2*t))}static fromDER(e){const{r,s:n}=t.DER.toSig((0,i.ensureBytes)("DER",e));return new E(r,n)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new E(this.r,this.s,e)}recoverPublicKey(e){const{r:t,s:n,recovery:s}=this,o=S((0,i.ensureBytes)("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const c=2===s||3===s?t+r.n:t;if(c>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=1&s?"03":"02",l=y.fromHex(u+v(c)),d=g(c),f=h(-o*d),p=h(n*d),m=y.BASE.multiplyAndAddUnsafe(l,f,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return s.hexToBytes(this.toDERHex())}toDERHex(){return t.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return s.hexToBytes(this.toCompactHex())}toCompactHex(){return v(this.r)+v(this.s)}}const T={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=n.getMinHashLength(r.n);return n.mapHashToField(r.randomBytes(e),r.n)},precompute:(e=8,t=y.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function k(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===d||n===f:r?n===2*d||n===2*f:e instanceof y}const O=r.bits2int||function(e){const t=s.bytesToNumberBE(e),n=8*e.length-r.nBitLength;return n>0?t>>BigInt(n):t},S=r.bits2int_modN||function(e){return h(O(e))},B=s.bitMask(r.nBitLength);function I(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(u<=e&&e<B))throw new Error(`bigint expected < 2^${r.nBitLength}`);return s.numberToBytesBE(e,r.nByteLength)}const x={lowS:r.lowS,prehash:!1},R={lowS:r.lowS,prehash:!1};return y.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return y.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(k(e))throw new Error("first arg must be private key");if(!k(t))throw new Error("second arg must be public key");return y.fromHex(t).multiply(m(e)).toRawBytes(r)},sign:function(e,t,n=x){const{seed:o,k2sig:c}=function(e,t,n=x){if(["recovered","canonical"].some((e=>e in n)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:c}=r;let{lowS:d,prehash:f,extraEntropy:p}=n;null==d&&(d=!0),e=(0,i.ensureBytes)("msgHash",e),f&&(e=(0,i.ensureBytes)("prehashed msgHash",o(e)));const b=S(e),v=m(t),P=[I(v),I(b)];if(null!=p){const e=!0===p?c(a.BYTES):p;P.push((0,i.ensureBytes)("extraEntropy",e))}const T=s.concatBytes(...P),k=b;return{seed:T,k2sig:function(e){const t=O(e);if(!w(t))return;const r=g(t),n=y.BASE.multiply(t).toAffine(),s=h(n.x);if(s===u)return;const i=h(r*h(k+s*v));if(i===u)return;let o=(n.x===s?0:2)|Number(n.y&l),a=i;return d&&A(i)&&(a=function(e){return A(e)?h(-e):e}(i),o^=1),new E(s,a,o)}}}(e,t,n),d=r;return s.createHmacDrbg(d.hash.outputLen,d.nByteLength,d.hmac)(o,c)},verify:function(e,n,s,o=R){const a=e;if(n=(0,i.ensureBytes)("msgHash",n),s=(0,i.ensureBytes)("publicKey",s),"strict"in o)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:u}=o;let l,d;try{if("string"==typeof a||a instanceof Uint8Array)try{l=E.fromDER(a)}catch(e){if(!(e instanceof t.DER.Err))throw e;l=E.fromCompact(a)}else{if("object"!=typeof a||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");{const{r:e,s:t}=a;l=new E(e,t)}}d=y.fromHex(s)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&l.hasHighS())return!1;u&&(n=r.hash(n));const{r:f,s:p}=l,m=S(n),b=g(p),w=h(m*b),v=h(f*b),A=y.BASE.multiplyAndAddUnsafe(d,w,v)?.toAffine();return!!A&&h(A.x)===f},ProjectivePoint:y,Signature:E,utils:T}},t.SWUFpSqrtRatio=g,t.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=g(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,o,a,c,u,l,d;s=e.sqr(n),s=e.mul(s,t.Z),i=e.sqr(s),i=e.add(i,s),o=e.add(i,e.ONE),o=e.mul(o,t.B),a=e.cmov(t.Z,e.neg(i),!e.eql(i,e.ZERO)),a=e.mul(a,t.A),i=e.sqr(o),u=e.sqr(a),c=e.mul(u,t.A),i=e.add(i,c),i=e.mul(i,o),u=e.mul(u,a),c=e.mul(u,t.B),i=e.add(i,c),l=e.mul(s,o);const{isValid:f,value:h}=r(i,u);d=e.mul(s,n),d=e.mul(d,h),l=e.cmov(l,o,f),d=e.cmov(d,h,f);const p=e.isOdd(n)===e.isOdd(d);return d=e.cmov(e.neg(d),d,p),l=e.div(l,a),{x:l,y:d}}}},8510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;const n=r(2623),s=r(9175),i=r(4967),o=r(1705),a=r(1484),c=r(1761),u=r(3562),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f=BigInt(1),h=BigInt(2),p=(e,t)=>(e+t/h)/t;function g(e){const t=l,r=BigInt(3),n=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),u=BigInt(88),d=e*e*e%t,f=d*d*e%t,p=(0,i.pow2)(f,r,t)*f%t,g=(0,i.pow2)(p,r,t)*f%t,m=(0,i.pow2)(g,h,t)*d%t,b=(0,i.pow2)(m,s,t)*m%t,w=(0,i.pow2)(b,o,t)*b%t,v=(0,i.pow2)(w,c,t)*w%t,A=(0,i.pow2)(v,u,t)*v%t,P=(0,i.pow2)(A,c,t)*w%t,E=(0,i.pow2)(P,r,t)*f%t,T=(0,i.pow2)(E,a,t)*b%t,k=(0,i.pow2)(T,n,t)*d%t,O=(0,i.pow2)(k,h,t);if(!y.eql(y.sqr(O),e))throw new Error("Cannot find square root");return O}const y=(0,i.Field)(l,void 0,void 0,{sqrt:g});t.secp256k1=(0,u.createCurve)({a:BigInt(0),b:BigInt(7),Fp:y,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=d,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=p(o*e,t),u=p(-n*e,t);let l=(0,i.mod)(e-c*r-u*s,t),h=(0,i.mod)(-c*n-u*o,t);const g=l>a,y=h>a;if(g&&(l=t-l),y&&(h=t-h),l>a||h>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:g,k1:l,k2neg:y,k2:h}}}},n.sha256);const m=BigInt(0),b=e=>"bigint"==typeof e&&m<e&&e<l,w=e=>"bigint"==typeof e&&m<e&&e<d,v={};function A(e,...t){let r=v[e];if(void 0===r){const t=(0,n.sha256)(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=(0,a.concatBytes)(t,t),v[e]=r}return(0,n.sha256)((0,a.concatBytes)(r,...t))}const P=e=>e.toRawBytes(!0).slice(1),E=e=>(0,a.numberToBytesBE)(e,32),T=e=>(0,i.mod)(e,l),k=e=>(0,i.mod)(e,d),O=t.secp256k1.ProjectivePoint,S=(e,t,r)=>O.BASE.multiplyAndAddUnsafe(e,t,r);function B(e){let r=t.secp256k1.utils.normPrivateKeyToScalar(e),n=O.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:k(-r),bytes:P(n)}}function I(e){if(!b(e))throw new Error("bad x: need 0 < x < p");const t=T(e*e);let r=g(T(t*e+BigInt(7)));r%h!==m&&(r=T(-r));const n=new O(e,r,f);return n.assertValidity(),n}function x(...e){return k((0,a.bytesToNumberBE)(A("BIP0340/challenge",...e)))}function R(e,t,r){const n=(0,a.ensureBytes)("signature",e,64),s=(0,a.ensureBytes)("message",t),i=(0,a.ensureBytes)("publicKey",r,32);try{const e=I((0,a.bytesToNumberBE)(i)),t=(0,a.bytesToNumberBE)(n.subarray(0,32));if(!b(t))return!1;const r=(0,a.bytesToNumberBE)(n.subarray(32,64));if(!w(r))return!1;const o=x(E(t),P(e),s),c=S(e,r,k(-o));return!(!c||!c.hasEvenY()||c.toAffine().x!==t)}catch(e){return!1}}t.schnorr={getPublicKey:function(e){return B(e).bytes},sign:function(e,t,r=(0,s.randomBytes)(32)){const n=(0,a.ensureBytes)("message",e),{bytes:i,scalar:o}=B(t),c=(0,a.ensureBytes)("auxRand",r,32),u=E(o^(0,a.bytesToNumberBE)(A("BIP0340/aux",c))),l=A("BIP0340/nonce",u,i,n),d=k((0,a.bytesToNumberBE)(l));if(d===m)throw new Error("sign failed: k is zero");const{bytes:f,scalar:h}=B(d),p=x(f,i,n),g=new Uint8Array(64);if(g.set(f,0),g.set(E(k(h+p*o)),32),!R(g,n,i))throw new Error("sign: Invalid signature produced");return g},verify:R,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:I,pointToBytes:P,numberToBytesBE:a.numberToBytesBE,bytesToNumberBE:a.bytesToNumberBE,taggedHash:A,mod:i.mod}};const N=(()=>(0,c.isogenyMap)(y,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),C=(()=>(0,o.mapToCurveSimpleSWU)(y,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:y.create(BigInt("-11"))}))(),_=(()=>(0,c.createHasher)(t.secp256k1.ProjectivePoint,(e=>{const{x:t,y:r}=C(y.create(e[0]));return N(t,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:y.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256}))();t.hashToCurve=_.hashToCurve,t.encodeToCurve=_.encodeToCurve},7557:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function s(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function o(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 a(e,t){s(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=s,t.hash=i,t.exists=o,t.output=a;const c={number:r,bool:n,bytes:s,hash:i,exists:o,output:a};t.default=c},915:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(7557),s=r(9175);class i extends s.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,s.createView)(this.buffer)}update(e){(0,n.exists)(this);const{view:t,buffer:r,blockLen:i}=this,o=(e=(0,s.toBytes)(e)).length;for(let n=0;n<o;){const a=Math.min(i-this.pos,o-n);if(a!==i)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,s.createView)(e);for(;i<=o-n;n+=i)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(r,0),a=0);for(let e=a;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const s=BigInt(32),i=BigInt(4294967295),o=Number(r>>s&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);const c=(0,s.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],o)}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:s,destroyed:i,pos:o}=this;return e.length=n,e.pos=o,e.finished=s,e.destroyed=i,n%t&&e.buffer.set(r),e}}t.SHA2=i},2318:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function s(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:a}=s(e[i],t);[r[i],n[i]]=[o,a]}return[r,n]}t.fromBig=s,t.split=i;const o=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=o;const a=(e,t,r)=>e>>>r;t.shrSH=a;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;const f=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=f;const h=(e,t)=>t;t.rotr32H=h;const p=(e,t)=>e;t.rotr32L=p;const g=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=g;const y=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=y;const m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;const b=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const s=(t>>>0)+(n>>>0);return{h:e+r+(s/2**32|0)|0,l:0|s}}t.rotlBL=b,t.add=w;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const A=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=A;const P=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=P;const E=(e,t,r,n,s)=>t+r+n+s+(e/2**32|0)|0;t.add4H=E;const T=(e,t,r,n,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(s>>>0);t.add5L=T;const k=(e,t,r,n,s,i)=>t+r+n+s+i+(e/2**32|0)|0;t.add5H=k;const O={fromBig:s,split:i,toBig:o,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:f,rotr32H:h,rotr32L:p,rotlSH:g,rotlSL:y,rotlBH:m,rotlBL:b,add:w,add3L:v,add3H:A,add4L:P,add4H:E,add5H:k,add5L:T};t.default=O},5145:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(7557),s=r(9175);class i extends s.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(e);const r=(0,s.toBytes)(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 i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return(0,n.exists)(this),this.iHash.update(e),this}digestInto(e){(0,n.exists)(this),(0,n.bytes)(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:s,blockLen:i,outputLen:o}=this;return e.finished=n,e.destroyed=s,e.blockLen=i,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=i,t.hmac=(e,t,r)=>new i(e,t).update(r).digest(),t.hmac.create=(e,t)=>new i(e,t)},8941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(7557),s=r(9615),i=r(9175);function o(e,t,r,o){(0,n.hash)(e);const a=(0,i.checkOpts)({dkLen:32,asyncTick:10},o),{c,dkLen:u,asyncTick:l}=a;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const d=(0,i.toBytes)(t),f=(0,i.toBytes)(r),h=new Uint8Array(u),p=s.hmac.create(e,d),g=p._cloneInto().update(f);return{c,dkLen:u,asyncTick:l,DK:h,PRF:p,PRFSalt:g}}function a(e,t,r,n,s){return e.destroy(),t.destroy(),n&&n.destroy(),s.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:s,dkLen:c,DK:u,PRF:l,PRFSalt:d}=o(e,t,r,n);let f;const h=new Uint8Array(4),p=(0,i.createView)(h),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const r=u.subarray(t,t+l.outputLen);p.setInt32(0,e,!1),(f=d._cloneInto(f)).update(h).digestInto(g),r.set(g.subarray(0,r.length));for(let e=1;e<s;e++){l._cloneInto(f).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}}return a(l,d,u,f,g)},t.pbkdf2Async=async function(e,t,r,n){const{c:s,dkLen:c,asyncTick:u,DK:l,PRF:d,PRFSalt:f}=o(e,t,r,n);let h;const p=new Uint8Array(4),g=(0,i.createView)(p),y=new Uint8Array(d.outputLen);for(let e=1,t=0;t<c;e++,t+=d.outputLen){const r=l.subarray(t,t+d.outputLen);g.setInt32(0,e,!1),(h=f._cloneInto(h)).update(p).digestInto(y),r.set(y.subarray(0,r.length)),await(0,i.asyncLoop)(s-1,u,(()=>{d._cloneInto(h).update(y).digestInto(y);for(let e=0;e<r.length;e++)r[e]^=y[e]}))}return a(d,f,l,h,y)}},3238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(915),s=r(9175),i=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),o=Uint8Array.from({length:16},((e,t)=>t));let a=[o],c=[o.map((e=>(9*e+5)%16))];for(let e=0;e<4;e++)for(let t of[a,c])t.push(t[e].map((e=>i[e])));const u=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),l=a.map(((e,t)=>e.map((e=>u[t][e])))),d=c.map(((e,t)=>e.map((e=>u[t][e])))),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),h=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),p=(e,t)=>e<<t|e>>>32-t;function g(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const y=new Uint32Array(16);class m extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:s}=this;return[e,t,r,n,s]}set(e,t,r,n,s){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)y[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,s=0|this.h1,i=s,o=0|this.h2,u=o,m=0|this.h3,b=m,w=0|this.h4,v=w;for(let e=0;e<5;e++){const t=4-e,A=f[e],P=h[e],E=a[e],T=c[e],k=l[e],O=d[e];for(let t=0;t<16;t++){const n=p(r+g(e,s,o,m)+y[E[t]]+A,k[t])+w|0;r=w,w=m,m=0|p(o,10),o=s,s=n}for(let e=0;e<16;e++){const r=p(n+g(t,i,u,b)+y[T[e]]+P,O[e])+v|0;n=v,v=b,b=0|p(u,10),u=i,i=r}}this.set(this.h1+o+b|0,this.h2+m+v|0,this.h3+w+n|0,this.h4+r+i|0,this.h0+s+u|0)}roundClean(){y.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=m,t.ripemd160=(0,s.wrapConstructor)((()=>new m))},5663:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scryptAsync=t.scrypt=void 0;const n=r(7557),s=r(2623),i=r(8941),o=r(9175),a=(e,t)=>e<<t|e>>>32-t;function c(e,t,r,n,s,i){let o=e[t++]^r[n++],c=e[t++]^r[n++],u=e[t++]^r[n++],l=e[t++]^r[n++],d=e[t++]^r[n++],f=e[t++]^r[n++],h=e[t++]^r[n++],p=e[t++]^r[n++],g=e[t++]^r[n++],y=e[t++]^r[n++],m=e[t++]^r[n++],b=e[t++]^r[n++],w=e[t++]^r[n++],v=e[t++]^r[n++],A=e[t++]^r[n++],P=e[t++]^r[n++],E=o,T=c,k=u,O=l,S=d,B=f,I=h,x=p,R=g,N=y,C=m,_=b,U=w,D=v,F=A,M=P;for(let e=0;e<8;e+=2)S^=a(E+U|0,7),R^=a(S+E|0,9),U^=a(R+S|0,13),E^=a(U+R|0,18),N^=a(B+T|0,7),D^=a(N+B|0,9),T^=a(D+N|0,13),B^=a(T+D|0,18),F^=a(C+I|0,7),k^=a(F+C|0,9),I^=a(k+F|0,13),C^=a(I+k|0,18),O^=a(M+_|0,7),x^=a(O+M|0,9),_^=a(x+O|0,13),M^=a(_+x|0,18),T^=a(E+O|0,7),k^=a(T+E|0,9),O^=a(k+T|0,13),E^=a(O+k|0,18),I^=a(B+S|0,7),x^=a(I+B|0,9),S^=a(x+I|0,13),B^=a(S+x|0,18),_^=a(C+N|0,7),R^=a(_+C|0,9),N^=a(R+_|0,13),C^=a(N+R|0,18),U^=a(M+F|0,7),D^=a(U+M|0,9),F^=a(D+U|0,13),M^=a(F+D|0,18);s[i++]=o+E|0,s[i++]=c+T|0,s[i++]=u+k|0,s[i++]=l+O|0,s[i++]=d+S|0,s[i++]=f+B|0,s[i++]=h+I|0,s[i++]=p+x|0,s[i++]=g+R|0,s[i++]=y+N|0,s[i++]=m+C|0,s[i++]=b+_|0,s[i++]=w+U|0,s[i++]=v+D|0,s[i++]=A+F|0,s[i++]=P+M|0}function u(e,t,r,n,s){let i=n+0,o=n+16*s;for(let n=0;n<16;n++)r[o+n]=e[t+16*(2*s-1)+n];for(let n=0;n<s;n++,i+=16,t+=16)c(r,o,e,t,r,i),n>0&&(o+=16),c(r,i,e,t+=16,r,o)}function l(e,t,r){const a=(0,o.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:c,r:u,p:l,dkLen:d,asyncTick:f,maxmem:h,onProgress:p}=a;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),(0,n.number)(d),(0,n.number)(f),(0,n.number)(h),void 0!==p&&"function"!=typeof p)throw new Error("progressCb should be function");const g=128*u,y=g/4;if(c<=1||c&c-1||c>=2**(g/8)||c>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(l<0||l>137438953440/g)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(d<0||d>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const m=g*(c+l);if(m>h)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${h} (maxmem)`);const b=(0,i.pbkdf2)(s.sha256,e,t,{c:1,dkLen:g*l}),w=(0,o.u32)(b),v=(0,o.u32)(new Uint8Array(g*c)),A=(0,o.u32)(new Uint8Array(g));let P=()=>{};if(p){const e=2*c*l,t=Math.max(Math.floor(e/1e4),1);let r=0;P=()=>{r++,!p||r%t&&r!==e||p(r/e)}}return{N:c,r:u,p:l,dkLen:d,blockSize32:y,V:v,B32:w,B:b,tmp:A,blockMixCb:P,asyncTick:f}}function d(e,t,r,n,o){const a=(0,i.pbkdf2)(s.sha256,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),o.fill(0),a}t.scrypt=function(e,t,r){const{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:f,B:h,tmp:p,blockMixCb:g}=l(e,t,r);for(let e=0;e<i;e++){const t=a*e;for(let e=0;e<a;e++)c[e]=f[t+e];for(let e=0,t=0;e<n-1;e++)u(c,t,c,t+=a,s),g();u(c,(n-1)*a,f,t,s),g();for(let e=0;e<n;e++){const e=f[t+a-16]%n;for(let r=0;r<a;r++)p[r]=f[t+r]^c[e*a+r];u(p,0,f,t,s),g()}}return d(e,o,h,c,p)},t.scryptAsync=async function(e,t,r){const{N:n,r:s,p:i,dkLen:a,blockSize32:c,V:f,B32:h,B:p,tmp:g,blockMixCb:y,asyncTick:m}=l(e,t,r);for(let e=0;e<i;e++){const t=c*e;for(let e=0;e<c;e++)f[e]=h[t+e];let r=0;await(0,o.asyncLoop)(n-1,m,(()=>{u(f,r,f,r+=c,s),y()})),u(f,(n-1)*c,h,t,s),y(),await(0,o.asyncLoop)(n,m,(()=>{const e=h[t+c-16]%n;for(let r=0;r<c;r++)g[r]=h[t+r]^f[e*c+r];u(g,0,h,t,s),y()}))}return d(e,a,p,f,g)}},2623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(915),s=r(9175),i=(e,t,r)=>e&t^e&r^t&r,o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:s,F:i,G:o,H:a}=this;return[e,t,r,n,s,i,o,a]}set(e,t,r,n,s,i,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|s,this.F=0|i,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,s.rotr)(t,7)^(0,s.rotr)(t,18)^t>>>3,i=(0,s.rotr)(r,17)^(0,s.rotr)(r,19)^r>>>10;c[e]=i+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:l,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,s.rotr)(l,6)^(0,s.rotr)(l,11)^(0,s.rotr)(l,25))+((p=l)&d^~p&f)+o[e]+c[e]|0,g=((0,s.rotr)(r,2)^(0,s.rotr)(r,13)^(0,s.rotr)(r,22))+i(r,n,a)|0;h=f,f=d,d=l,l=u+t|0,u=a,a=n,n=r,r=t+g|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,n,a,u,l,d,f,h)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,s.wrapConstructor)((()=>new u)),t.sha224=(0,s.wrapConstructor)((()=>new l))},2955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(7557),s=r(2318),i=r(9175),[o,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),d=BigInt(2),f=BigInt(7),h=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],o.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let s=u;for(let e=0;e<7;e++)t=(t<<l^(t>>f)