(()=>{vara,se,er={5521:(se,a)=>{"use strict";functionH(l){if(!Number.isSafeInteger(l))thrownewError(`Wrong integer: ${l}`)}functionD(...l){constu=(j,k)=>V=>j(k(V));return{encode:Array.from(l).reverse().reduce((j,k)=>j?u(j,k.encode):k.encode,void0),decode:l.reduce((j,k)=>j?u(j,k.decode):k.decode,void0)}}functiond(l){return{encode:u=>{if(!Array.isArray(u)||u.length&&"number"!=typeofu[0])thrownewError("alphabet.encode input should be an array of numbers");returnu.map(y=>{if(H(y),y<0||y>=l.length)thrownewError(`Digit index outside alphabet: ${y} (alphabet: ${l.length})`);returnl[y]})},decode:u=>{if(!Array.isArray(u)||u.length&&"string"!=typeofu[0])thrownewError("alphabet.decode input should be array of strings");returnu.map(y=>{if("string"!=typeofy)thrownewError(`alphabet.decode: not string element=${y}`);constU=l.indexOf(y);if(-1===U)thrownewError(`Unknown letter: "${y}". Allowed: ${l}`);returnU})}}}functionC(l=""){if("string"!=typeofl)thrownewError("join separator should be string");return{encode:u=>{if(!Array.isArray(u)||u.length&&"string"!=typeofu[0])thrownewError("join.encode input should be array of strings");for(letyofu)if("string"!=typeofy)thrownewError(`join.encode: non-string input=${y}`);returnu.join(l)},decode:u=>{if("string"!=typeofu)thrownewError("join.decode input should be string");returnu.split(l)}}}functionZ(l,u="="){if(H(l),"string"!=typeofu)thrownewError("padding chr should be string");return{encode(y){if(!Array.isArray(y)||y.length&&"string"!=typeofy[0])thrownewError("padding.encode input should be array of strings");for(letUofy)if("string"!=typeofU)thrownewError(`padding.encode: non-string input=${U}`);for(;y.length*l%8;)y.push(u);returny},decode(y){if(!Array.isArray(y)||y.length&&"string"!=typeofy[0])thrownewError("padding.encode input should be array of strings");for(letjofy)if("string"!=typeofj)thrownewError(`padding.decode: non-string input=${j}`);letU=y.length;if(U*l%8)thrownewError("Invalid padding: string should have whole number of bytes");for(;U>0&&y[U-1]===u;U--)if(!((U-1)*l%8))thrownewError("Invalid padding: string has too much padding");returny.slice(0,U)}}}functionQ(l){if("function"!=typeofl)thrownewError("normalize fn should be function");return{encode:u=>u,decode:u=>l(u)}}functionm(l,u,y){if(u<2)thrownewError(`convertRadix: wrong from=${u}, base cannot be less than 2`);if(y<2)thrownewError(`convertRadix: wrong to=${y}, base cannot be less than 2`);if(!Array.isArray(l))thrownewError("convertRadix: data should be array");if(!l.length)return[];letU=0;constj=[],k=Array.from(l);for(k.forEach(V=>{if(H(V),V<0||V>=u)thrownewError(`Wrong integer: ${V}`)});;){letV=0,ce=!0;for(letle=U;le<k.length;le++){constfe=k[le],M=u*V+fe;if(!Number.isSafeInteger(M)||u*V/u!==V||M-fe!=u*V)thrownewError("convertRadix: carry overflow");if(V=M%y,k[le]=Math.floor(M/y),!Number.isSafeInteger(k[le])||k[le]*y+V!==M)thrownewError("convertRadix: carry overflow");ce&&(k[le]?ce=!1:U=le)}if(j.push(V),ce)break}for(letV=0;V<l.length-1&&0===l[V];V++)j.push(0);returnj.reverse()}Object.defineProperty(a,"__esModule",{value:!0}),a.bytes=a.stringToBytes=a.str=a.bytesToString=a.hex=a.utf8=a.bech32m=a.bech32=a.base58check=a.base58xmr=a.base58xrp=a.base58flickr=a.base58=a.base64url=a.base64=a.base32crockford=a.base32hex=a.base32=a.base16=a.utils=a.assertNumber=void0,a.assertNumber=H;constw=(l,u)=>u?w(u,l%u):l,$=(l,u)=>l+(u-w(l,u));functionq(l,u,y,U){if(!Array.isArray(l))thrownewError("convertRadix2: data should be array");if(u<=0||u>32)thrownewError(`convertRadix2: wrong from=${u}`);if(y<=0||y>32)thrownewError(`convertRadix2: wrong to=${y}`);if($(u,y)>32)thrownewError(`convertRadix2: carry overflow from=${u} to=${y} carryBits=${$(u,y)}`);letj=0,k=0;constV=2**y-1,ce=[];for(constleofl){if(H(le),le>=2**u)thrownewError(`convertRadix2: invalid data word=${le} from=${u}`);if(j=j<<u|le,k+u>32)thrownewError(`convertRadix2: carry overflow pos=${k} from=${u}`);for(k+=u;k>=y;k-=y)ce.push((j>>k-y&V)>>>0);j&=2**k-1}if(j=j<<y-k&V,!U&&