@smartledger/bsv 6.2.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +38 -38
- package/bsv-gdaf.min.js +4 -4
- package/bsv-ltp.min.js +4 -4
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +4 -4
- package/bsv.d.ts +7 -6
- package/bsv.min.js +4 -4
- package/docs/MIGRATION_7.md +123 -0
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/index.mjs +116 -0
- package/lib/crypto/ecdsa.js +15 -14
- package/lib/gdaf/attestation-verifier.js +2 -7
- package/lib/gdaf/did-resolver.js +1 -3
- package/lib/ltp/obligation.js +1 -2
- package/lib/ltp/proof.js +1 -3
- package/lib/ltp/right.js +2 -3
- package/package.json +16 -2
- package/test/build/esm_wrapper.js +66 -0
- package/test/build/exports_resolution.js +58 -0
- package/test/crypto/ecdsa.js +29 -4
- package/test/security/fail_closed_contracts.js +13 -9
- package/version.js +1 -1
package/bsv.bundle.js
CHANGED
|
@@ -14,7 +14,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var mU=nt().Buffer,id=globalThis.c
|
|
|
14
14
|
`)}});var gO=k(pO=>{v();var dO=pO;dO.der=Om();dO.pem=hO()});var Pc=k(vO=>{v();var Rc=vO;Rc.bignum=Nn();Rc.define=HE().define;Rc.base=kc();Rc.constants=ym();Rc.decoders=aO();Rc.encoders=gO()});var _O=k((Y0e,bO)=>{"use strict";v();var Dn=Pc(),mO=Dn.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),$W=Dn.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),Pm=Dn.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),XW=Dn.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Pm),this.key("subjectPublicKey").bitstr())}),JW=Dn.define("RelativeDistinguishedName",function(){this.setof($W)}),QW=Dn.define("RDNSequence",function(){this.seqof(JW)}),yO=Dn.define("Name",function(){this.choice({rdnSequence:this.use(QW)})}),eY=Dn.define("Validity",function(){this.seq().obj(this.key("notBefore").use(mO),this.key("notAfter").use(mO))}),tY=Dn.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),rY=Dn.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Pm),this.key("issuer").use(yO),this.key("validity").use(eY),this.key("subject").use(yO),this.key("subjectPublicKeyInfo").use(XW),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(tY).optional())}),iY=Dn.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(rY),this.key("signatureAlgorithm").use(Pm),this.key("signatureValue").bitstr())});bO.exports=iY});var SO=k(qn=>{"use strict";v();var Ln=Pc();qn.certificate=_O();var nY=Ln.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});qn.RSAPrivateKey=nY;var oY=Ln.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});qn.RSAPublicKey=oY;var wO=Ln.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),aY=Ln.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(wO),this.key("subjectPublicKey").bitstr())});qn.PublicKey=aY;var sY=Ln.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(wO),this.key("subjectPrivateKey").octstr())});qn.PrivateKey=sY;var uY=Ln.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});qn.EncryptedPrivateKey=uY;var fY=Ln.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});qn.DSAPrivateKey=fY;qn.DSAparam=Ln.define("DSAparam",function(){this.int()});var cY=Ln.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),lY=Ln.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(cY),this.key("publicKey").optional().explicit(1).bitstr())});qn.ECPrivateKey=lY;qn.signature=Ln.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})});var xO=k((Q0e,hY)=>{hY.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}});var OO=k((e1e,EO)=>{"use strict";v();var dY=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,pY=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,gY=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,vY=Xh(),mY=D2(),z2=nt().Buffer;EO.exports=function(e,t){var r=e.toString(),i=r.match(dY),n;if(i){var a="aes"+i[1],s=z2.from(i[2],"hex"),u=z2.from(i[3].replace(/[\r\n]/g,""),"base64"),c=vY(t,s.slice(0,8),parseInt(i[1],10)).key,l=[],m=mY.createDecipheriv(a,c,s);l.push(m.update(u)),l.push(m.final()),n=z2.concat(l)}else{var o=r.match(gY);n=z2.from(o[2].replace(/[\r\n]/g,""),"base64")}var w=r.match(pY)[1];return{tag:w,data:n}}});var km=k((r1e,AO)=>{"use strict";v();var Pi=SO(),yY=xO(),bY=OO(),_Y=D2(),wY=Uv().pbkdf2Sync,Tm=nt().Buffer;function SY(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=yY[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=wY(t,r,i,s,"sha1"),c=_Y.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),Tm.concat(l)}function IO(e){var t;typeof e=="object"&&!Tm.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e=="string"&&(e=Tm.from(e));var r=bY(e,t),i=r.tag,n=r.data,o,a;switch(i){case"CERTIFICATE":a=Pi.certificate.decode(n,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(a||(a=Pi.PublicKey.decode(n,"der")),o=a.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Pi.RSAPublicKey.decode(a.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return a.subjectPrivateKey=a.subjectPublicKey,{type:"ec",data:a};case"1.2.840.10040.4.1":return a.algorithm.params.pub_key=Pi.DSAparam.decode(a.subjectPublicKey.data,"der"),{type:"dsa",data:a.algorithm.params};default:throw new Error("unknown key id "+o)}case"ENCRYPTED PRIVATE KEY":n=Pi.EncryptedPrivateKey.decode(n,"der"),n=SY(n,t);case"PRIVATE KEY":switch(a=Pi.PrivateKey.decode(n,"der"),o=a.algorithm.algorithm.join("."),o){case"1.2.840.113549.1.1.1":return Pi.RSAPrivateKey.decode(a.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:a.algorithm.curve,privateKey:Pi.ECPrivateKey.decode(a.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return a.algorithm.params.priv_key=Pi.DSAparam.decode(a.subjectPrivateKey,"der"),{type:"dsa",params:a.algorithm.params};default:throw new Error("unknown key id "+o)}case"RSA PUBLIC KEY":return Pi.RSAPublicKey.decode(n,"der");case"RSA PRIVATE KEY":return Pi.RSAPrivateKey.decode(n,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:Pi.DSAPrivateKey.decode(n,"der")};case"EC PRIVATE KEY":return n=Pi.ECPrivateKey.decode(n,"der"),{curve:n.parameters.value,privateKey:n.privateKey};default:throw new Error("unknown key type "+i)}}IO.signature=Pi.signature;AO.exports=IO});var Bm=k((n1e,PO)=>{v();var xY=zh(),Rm=nt().Buffer;PO.exports=function(e,t){for(var r=Rm.alloc(0),i=0,n;r.length<t;)n=EY(i++),r=Rm.concat([r,xY("sha1").update(e).update(n).digest()]);return r.slice(0,t)};function EY(e){var t=Rm.allocUnsafe(4);return t.writeUInt32BE(e,0),t}});var Mm=k((a1e,TO)=>{v();TO.exports=function(t,r){for(var i=t.length,n=-1;++n<i;)t[n]^=r[n];return t}});var Nm=k((u1e,RO)=>{v();var kO=Nn(),OY=nt().Buffer;function IY(e,t){return OY.from(e.toRed(kO.mont(t.modulus)).redPow(new kO(t.publicExponent)).fromRed().toArray())}RO.exports=IY});var MO=k((BO,Cm)=>{v();(function(e,t){"use strict";function r(y,f){if(!y)throw new Error(f||"Assertion failed")}function i(y,f){y.super_=f;var d=function(){};d.prototype=f.prototype,y.prototype=new d,y.prototype.constructor=y}function n(y,f,d){if(n.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((f==="le"||f==="be")&&(d=f,f=10),this._init(y||0,f||10,d||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=zt().Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,d){return f.cmp(d)>0?f:d},n.min=function(f,d){return f.cmp(d)<0?f:d},n.prototype._init=function(f,d,_){if(typeof f=="number")return this._initNumber(f,d,_);if(typeof f=="object")return this._initArray(f,d,_);d==="hex"&&(d=16),r(d===(d|0)&&d>=2&&d<=36),f=f.toString().replace(/\s+/g,"");var x=0;f[0]==="-"&&(x++,this.negative=1),x<f.length&&(d===16?this._parseHex(f,x,_):(this._parseBase(f,d,x),_==="le"&&this._initArray(this.toArray(),d,_)))},n.prototype._initNumber=function(f,d,_){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),d,_)},n.prototype._initArray=function(f,d,_){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var b,p,I=0;if(_==="be")for(x=f.length-1,b=0;x>=0;x-=3)p=f[x]|f[x-1]<<8|f[x-2]<<16,this.words[b]|=p<<I&67108863,this.words[b+1]=p>>>26-I&67108863,I+=24,I>=26&&(I-=26,b++);else if(_==="le")for(x=0,b=0;x<f.length;x+=3)p=f[x]|f[x+1]<<8|f[x+2]<<16,this.words[b]|=p<<I&67108863,this.words[b+1]=p>>>26-I&67108863,I+=24,I>=26&&(I-=26,b++);return this._strip()};function a(y,f){var d=y.charCodeAt(f);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;r(!1,"Invalid character in "+y)}function s(y,f,d){var _=a(y,d);return d-1>=f&&(_|=a(y,d-1)<<4),_}n.prototype._parseHex=function(f,d,_){this.length=Math.ceil((f.length-d)/6),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var b=0,p=0,I;if(_==="be")for(x=f.length-1;x>=d;x-=2)I=s(f,d,x)<<b,this.words[p]|=I&67108863,b>=18?(b-=18,p+=1,this.words[p]|=I>>>26):b+=8;else{var T=f.length-d;for(x=T%2===0?d+1:d;x<f.length;x+=2)I=s(f,d,x)<<b,this.words[p]|=I&67108863,b>=18?(b-=18,p+=1,this.words[p]|=I>>>26):b+=8}this._strip()};function u(y,f,d,_){for(var x=0,b=0,p=Math.min(y.length,d),I=f;I<p;I++){var T=y.charCodeAt(I)-48;x*=_,T>=49?b=T-49+10:T>=17?b=T-17+10:b=T,r(T>=0&&b<_,"Invalid character"),x+=b}return x}n.prototype._parseBase=function(f,d,_){this.words=[0],this.length=1;for(var x=0,b=1;b<=67108863;b*=d)x++;x--,b=b/d|0;for(var p=f.length-_,I=p%x,T=Math.min(p,p-I)+_,S=0,R=_;R<T;R+=x)S=u(f,R,R+x,d),this.imuln(b),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S);if(I!==0){var Y=1;for(S=u(f,R,f.length,d),R=0;R<I;R++)Y*=d;this.imuln(Y),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S)}this._strip()},n.prototype.copy=function(f){f.words=new Array(this.length);for(var d=0;d<this.length;d++)f.words[d]=this.words[d];f.length=this.length,f.negative=this.negative,f.red=this.red};function c(y,f){y.words=f.words,y.length=f.length,y.negative=f.negative,y.red=f.red}if(n.prototype._move=function(f){c(f,this)},n.prototype.clone=function(){var f=new n(null);return this.copy(f),f},n.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch{n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,d){f=f||10,d=d|0||1;var _;if(f===16||f==="hex"){_="";for(var x=0,b=0,p=0;p<this.length;p++){var I=this.words[p],T=((I<<x|b)&16777215).toString(16);b=I>>>24-x&16777215,x+=2,x>=26&&(x-=26,p--),b!==0||p!==this.length-1?_=m[6-T.length]+T+_:_=T+_}for(b!==0&&(_=b.toString(16)+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(f===(f|0)&&f>=2&&f<=36){var S=w[f],R=E[f];_="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var X=Y.modrn(R).toString(f);Y=Y.idivn(R),Y.isZero()?_=X+_:_=m[S-X.length]+X+_}for(this.isZero()&&(_="0"+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(f,d){return this.toArrayLike(o,f,d)}),n.prototype.toArray=function(f,d){return this.toArrayLike(Array,f,d)};var P=function(f,d){return f.allocUnsafe?f.allocUnsafe(d):new f(d)};n.prototype.toArrayLike=function(f,d,_){this._strip();var x=this.byteLength(),b=_||Math.max(1,x);r(x<=b,"byte array longer than desired length"),r(b>0,"Requested array length <= 0");var p=P(f,b),I=d==="le"?"LE":"BE";return this["_toArrayLike"+I](p,x),p},n.prototype._toArrayLikeLE=function(f,d){for(var _=0,x=0,b=0,p=0;b<this.length;b++){var I=this.words[b]<<p|x;f[_++]=I&255,_<f.length&&(f[_++]=I>>8&255),_<f.length&&(f[_++]=I>>16&255),p===6?(_<f.length&&(f[_++]=I>>24&255),x=0,p=0):(x=I>>>24,p+=2)}if(_<f.length)for(f[_++]=x;_<f.length;)f[_++]=0},n.prototype._toArrayLikeBE=function(f,d){for(var _=f.length-1,x=0,b=0,p=0;b<this.length;b++){var I=this.words[b]<<p|x;f[_--]=I&255,_>=0&&(f[_--]=I>>8&255),_>=0&&(f[_--]=I>>16&255),p===6?(_>=0&&(f[_--]=I>>24&255),x=0,p=0):(x=I>>>24,p+=2)}if(_>=0)for(f[_--]=x;_>=0;)f[_--]=0},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var d=f,_=0;return d>=4096&&(_+=13,d>>>=13),d>=64&&(_+=7,d>>>=7),d>=8&&(_+=4,d>>>=4),d>=2&&(_+=2,d>>>=2),_+d},n.prototype._zeroBits=function(f){if(f===0)return 26;var d=f,_=0;return(d&8191)===0&&(_+=13,d>>>=13),(d&127)===0&&(_+=7,d>>>=7),(d&15)===0&&(_+=4,d>>>=4),(d&3)===0&&(_+=2,d>>>=2),(d&1)===0&&_++,_},n.prototype.bitLength=function(){var f=this.words[this.length-1],d=this._countBits(f);return(this.length-1)*26+d};function M(y){for(var f=new Array(y.bitLength()),d=0;d<f.length;d++){var _=d/26|0,x=d%26;f[d]=y.words[_]>>>x&1}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,d=0;d<this.length;d++){var _=this._zeroBits(this.words[d]);if(f+=_,_!==26)break}return f},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},n.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var d=0;d<f.length;d++)this.words[d]=this.words[d]|f.words[d];return this._strip()},n.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},n.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var d;this.length>f.length?d=f:d=this;for(var _=0;_<d.length;_++)this.words[_]=this.words[_]&f.words[_];return this.length=d.length,this._strip()},n.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},n.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var d,_;this.length>f.length?(d=this,_=f):(d=f,_=this);for(var x=0;x<_.length;x++)this.words[x]=d.words[x]^_.words[x];if(this!==d)for(;x<d.length;x++)this.words[x]=d.words[x];return this.length=d.length,this._strip()},n.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},n.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var d=Math.ceil(f/26)|0,_=f%26;this._expand(d),_>0&&d--;for(var x=0;x<d;x++)this.words[x]=~this.words[x]&67108863;return _>0&&(this.words[x]=~this.words[x]&67108863>>26-_),this._strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,d){r(typeof f=="number"&&f>=0);var _=f/26|0,x=f%26;return this._expand(_+1),d?this.words[_]=this.words[_]|1<<x:this.words[_]=this.words[_]&~(1<<x),this._strip()},n.prototype.iadd=function(f){var d;if(this.negative!==0&&f.negative===0)return this.negative=0,d=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,d=this.isub(f),f.negative=1,d._normSign();var _,x;this.length>f.length?(_=this,x=f):(_=f,x=this);for(var b=0,p=0;p<x.length;p++)d=(_.words[p]|0)+(x.words[p]|0)+b,this.words[p]=d&67108863,b=d>>>26;for(;b!==0&&p<_.length;p++)d=(_.words[p]|0)+b,this.words[p]=d&67108863,b=d>>>26;if(this.length=_.length,b!==0)this.words[this.length]=b,this.length++;else if(_!==this)for(;p<_.length;p++)this.words[p]=_.words[p];return this},n.prototype.add=function(f){var d;return f.negative!==0&&this.negative===0?(f.negative=0,d=this.sub(f),f.negative^=1,d):f.negative===0&&this.negative!==0?(this.negative=0,d=f.sub(this),this.negative=1,d):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var d=this.iadd(f);return f.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var _=this.cmp(f);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,b;_>0?(x=this,b=f):(x=f,b=this);for(var p=0,I=0;I<b.length;I++)d=(x.words[I]|0)-(b.words[I]|0)+p,p=d>>26,this.words[I]=d&67108863;for(;p!==0&&I<x.length;I++)d=(x.words[I]|0)+p,p=d>>26,this.words[I]=d&67108863;if(p===0&&I<x.length&&x!==this)for(;I<x.length;I++)this.words[I]=x.words[I];return this.length=Math.max(this.length,I),x!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(f){return this.clone().isub(f)};function D(y,f,d){d.negative=f.negative^y.negative;var _=y.length+f.length|0;d.length=_,_=_-1|0;var x=y.words[0]|0,b=f.words[0]|0,p=x*b,I=p&67108863,T=p/67108864|0;d.words[0]=I;for(var S=1;S<_;S++){for(var R=T>>>26,Y=T&67108863,X=Math.min(S,f.length-1),ie=Math.max(0,S-y.length+1);ie<=X;ie++){var ce=S-ie|0;x=y.words[ce]|0,b=f.words[ie]|0,p=x*b+Y,R+=p/67108864|0,Y=p&67108863}d.words[S]=Y|0,T=R|0}return T!==0?d.words[S]=T|0:d.length--,d._strip()}var L=function(f,d,_){var x=f.words,b=d.words,p=_.words,I=0,T,S,R,Y=x[0]|0,X=Y&8191,ie=Y>>>13,ce=x[1]|0,pe=ce&8191,q=ce>>>13,W=x[2]|0,$=W&8191,ee=W>>>13,se=x[3]|0,ue=se&8191,le=se>>>13,Pe=x[4]|0,ge=Pe&8191,ve=Pe>>>13,sr=x[5]|0,xe=sr&8191,ye=sr>>>13,Re=x[6]|0,be=Re&8191,_e=Re>>>13,Ji=x[7]|0,Be=Ji&8191,ke=Ji>>>13,Ys=x[8]|0,Ce=Ys&8191,Le=Ys>>>13,$l=x[9]|0,qe=$l&8191,Ue=$l>>>13,Xl=b[0]|0,Fe=Xl&8191,He=Xl>>>13,Jl=b[1]|0,je=Jl&8191,ze=Jl>>>13,Ql=b[2]|0,Ke=Ql&8191,Ve=Ql>>>13,eh=b[3]|0,Ge=eh&8191,Ze=eh>>>13,th=b[4]|0,We=th&8191,Ye=th>>>13,rh=b[5]|0,$e=rh&8191,Xe=rh>>>13,ih=b[6]|0,Je=ih&8191,Qe=ih>>>13,nh=b[7]|0,et=nh&8191,tt=nh>>>13,oh=b[8]|0,rt=oh&8191,it=oh>>>13,Zf=b[9]|0,Jt=Zf&8191,Qt=Zf>>>13;_.negative=f.negative^d.negative,_.length=19,T=Math.imul(X,Fe),S=Math.imul(X,He),S=S+Math.imul(ie,Fe)|0,R=Math.imul(ie,He);var $s=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+($s>>>26)|0,$s&=67108863,T=Math.imul(pe,Fe),S=Math.imul(pe,He),S=S+Math.imul(q,Fe)|0,R=Math.imul(q,He),T=T+Math.imul(X,je)|0,S=S+Math.imul(X,ze)|0,S=S+Math.imul(ie,je)|0,R=R+Math.imul(ie,ze)|0;var Xs=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Xs>>>26)|0,Xs&=67108863,T=Math.imul($,Fe),S=Math.imul($,He),S=S+Math.imul(ee,Fe)|0,R=Math.imul(ee,He),T=T+Math.imul(pe,je)|0,S=S+Math.imul(pe,ze)|0,S=S+Math.imul(q,je)|0,R=R+Math.imul(q,ze)|0,T=T+Math.imul(X,Ke)|0,S=S+Math.imul(X,Ve)|0,S=S+Math.imul(ie,Ke)|0,R=R+Math.imul(ie,Ve)|0;var Js=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Js>>>26)|0,Js&=67108863,T=Math.imul(ue,Fe),S=Math.imul(ue,He),S=S+Math.imul(le,Fe)|0,R=Math.imul(le,He),T=T+Math.imul($,je)|0,S=S+Math.imul($,ze)|0,S=S+Math.imul(ee,je)|0,R=R+Math.imul(ee,ze)|0,T=T+Math.imul(pe,Ke)|0,S=S+Math.imul(pe,Ve)|0,S=S+Math.imul(q,Ke)|0,R=R+Math.imul(q,Ve)|0,T=T+Math.imul(X,Ge)|0,S=S+Math.imul(X,Ze)|0,S=S+Math.imul(ie,Ge)|0,R=R+Math.imul(ie,Ze)|0;var Qs=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,T=Math.imul(ge,Fe),S=Math.imul(ge,He),S=S+Math.imul(ve,Fe)|0,R=Math.imul(ve,He),T=T+Math.imul(ue,je)|0,S=S+Math.imul(ue,ze)|0,S=S+Math.imul(le,je)|0,R=R+Math.imul(le,ze)|0,T=T+Math.imul($,Ke)|0,S=S+Math.imul($,Ve)|0,S=S+Math.imul(ee,Ke)|0,R=R+Math.imul(ee,Ve)|0,T=T+Math.imul(pe,Ge)|0,S=S+Math.imul(pe,Ze)|0,S=S+Math.imul(q,Ge)|0,R=R+Math.imul(q,Ze)|0,T=T+Math.imul(X,We)|0,S=S+Math.imul(X,Ye)|0,S=S+Math.imul(ie,We)|0,R=R+Math.imul(ie,Ye)|0;var eu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(eu>>>26)|0,eu&=67108863,T=Math.imul(xe,Fe),S=Math.imul(xe,He),S=S+Math.imul(ye,Fe)|0,R=Math.imul(ye,He),T=T+Math.imul(ge,je)|0,S=S+Math.imul(ge,ze)|0,S=S+Math.imul(ve,je)|0,R=R+Math.imul(ve,ze)|0,T=T+Math.imul(ue,Ke)|0,S=S+Math.imul(ue,Ve)|0,S=S+Math.imul(le,Ke)|0,R=R+Math.imul(le,Ve)|0,T=T+Math.imul($,Ge)|0,S=S+Math.imul($,Ze)|0,S=S+Math.imul(ee,Ge)|0,R=R+Math.imul(ee,Ze)|0,T=T+Math.imul(pe,We)|0,S=S+Math.imul(pe,Ye)|0,S=S+Math.imul(q,We)|0,R=R+Math.imul(q,Ye)|0,T=T+Math.imul(X,$e)|0,S=S+Math.imul(X,Xe)|0,S=S+Math.imul(ie,$e)|0,R=R+Math.imul(ie,Xe)|0;var tu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(tu>>>26)|0,tu&=67108863,T=Math.imul(be,Fe),S=Math.imul(be,He),S=S+Math.imul(_e,Fe)|0,R=Math.imul(_e,He),T=T+Math.imul(xe,je)|0,S=S+Math.imul(xe,ze)|0,S=S+Math.imul(ye,je)|0,R=R+Math.imul(ye,ze)|0,T=T+Math.imul(ge,Ke)|0,S=S+Math.imul(ge,Ve)|0,S=S+Math.imul(ve,Ke)|0,R=R+Math.imul(ve,Ve)|0,T=T+Math.imul(ue,Ge)|0,S=S+Math.imul(ue,Ze)|0,S=S+Math.imul(le,Ge)|0,R=R+Math.imul(le,Ze)|0,T=T+Math.imul($,We)|0,S=S+Math.imul($,Ye)|0,S=S+Math.imul(ee,We)|0,R=R+Math.imul(ee,Ye)|0,T=T+Math.imul(pe,$e)|0,S=S+Math.imul(pe,Xe)|0,S=S+Math.imul(q,$e)|0,R=R+Math.imul(q,Xe)|0,T=T+Math.imul(X,Je)|0,S=S+Math.imul(X,Qe)|0,S=S+Math.imul(ie,Je)|0,R=R+Math.imul(ie,Qe)|0;var ru=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(ru>>>26)|0,ru&=67108863,T=Math.imul(Be,Fe),S=Math.imul(Be,He),S=S+Math.imul(ke,Fe)|0,R=Math.imul(ke,He),T=T+Math.imul(be,je)|0,S=S+Math.imul(be,ze)|0,S=S+Math.imul(_e,je)|0,R=R+Math.imul(_e,ze)|0,T=T+Math.imul(xe,Ke)|0,S=S+Math.imul(xe,Ve)|0,S=S+Math.imul(ye,Ke)|0,R=R+Math.imul(ye,Ve)|0,T=T+Math.imul(ge,Ge)|0,S=S+Math.imul(ge,Ze)|0,S=S+Math.imul(ve,Ge)|0,R=R+Math.imul(ve,Ze)|0,T=T+Math.imul(ue,We)|0,S=S+Math.imul(ue,Ye)|0,S=S+Math.imul(le,We)|0,R=R+Math.imul(le,Ye)|0,T=T+Math.imul($,$e)|0,S=S+Math.imul($,Xe)|0,S=S+Math.imul(ee,$e)|0,R=R+Math.imul(ee,Xe)|0,T=T+Math.imul(pe,Je)|0,S=S+Math.imul(pe,Qe)|0,S=S+Math.imul(q,Je)|0,R=R+Math.imul(q,Qe)|0,T=T+Math.imul(X,et)|0,S=S+Math.imul(X,tt)|0,S=S+Math.imul(ie,et)|0,R=R+Math.imul(ie,tt)|0;var iu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(iu>>>26)|0,iu&=67108863,T=Math.imul(Ce,Fe),S=Math.imul(Ce,He),S=S+Math.imul(Le,Fe)|0,R=Math.imul(Le,He),T=T+Math.imul(Be,je)|0,S=S+Math.imul(Be,ze)|0,S=S+Math.imul(ke,je)|0,R=R+Math.imul(ke,ze)|0,T=T+Math.imul(be,Ke)|0,S=S+Math.imul(be,Ve)|0,S=S+Math.imul(_e,Ke)|0,R=R+Math.imul(_e,Ve)|0,T=T+Math.imul(xe,Ge)|0,S=S+Math.imul(xe,Ze)|0,S=S+Math.imul(ye,Ge)|0,R=R+Math.imul(ye,Ze)|0,T=T+Math.imul(ge,We)|0,S=S+Math.imul(ge,Ye)|0,S=S+Math.imul(ve,We)|0,R=R+Math.imul(ve,Ye)|0,T=T+Math.imul(ue,$e)|0,S=S+Math.imul(ue,Xe)|0,S=S+Math.imul(le,$e)|0,R=R+Math.imul(le,Xe)|0,T=T+Math.imul($,Je)|0,S=S+Math.imul($,Qe)|0,S=S+Math.imul(ee,Je)|0,R=R+Math.imul(ee,Qe)|0,T=T+Math.imul(pe,et)|0,S=S+Math.imul(pe,tt)|0,S=S+Math.imul(q,et)|0,R=R+Math.imul(q,tt)|0,T=T+Math.imul(X,rt)|0,S=S+Math.imul(X,it)|0,S=S+Math.imul(ie,rt)|0,R=R+Math.imul(ie,it)|0;var nu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(nu>>>26)|0,nu&=67108863,T=Math.imul(qe,Fe),S=Math.imul(qe,He),S=S+Math.imul(Ue,Fe)|0,R=Math.imul(Ue,He),T=T+Math.imul(Ce,je)|0,S=S+Math.imul(Ce,ze)|0,S=S+Math.imul(Le,je)|0,R=R+Math.imul(Le,ze)|0,T=T+Math.imul(Be,Ke)|0,S=S+Math.imul(Be,Ve)|0,S=S+Math.imul(ke,Ke)|0,R=R+Math.imul(ke,Ve)|0,T=T+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ze)|0,S=S+Math.imul(_e,Ge)|0,R=R+Math.imul(_e,Ze)|0,T=T+Math.imul(xe,We)|0,S=S+Math.imul(xe,Ye)|0,S=S+Math.imul(ye,We)|0,R=R+Math.imul(ye,Ye)|0,T=T+Math.imul(ge,$e)|0,S=S+Math.imul(ge,Xe)|0,S=S+Math.imul(ve,$e)|0,R=R+Math.imul(ve,Xe)|0,T=T+Math.imul(ue,Je)|0,S=S+Math.imul(ue,Qe)|0,S=S+Math.imul(le,Je)|0,R=R+Math.imul(le,Qe)|0,T=T+Math.imul($,et)|0,S=S+Math.imul($,tt)|0,S=S+Math.imul(ee,et)|0,R=R+Math.imul(ee,tt)|0,T=T+Math.imul(pe,rt)|0,S=S+Math.imul(pe,it)|0,S=S+Math.imul(q,rt)|0,R=R+Math.imul(q,it)|0,T=T+Math.imul(X,Jt)|0,S=S+Math.imul(X,Qt)|0,S=S+Math.imul(ie,Jt)|0,R=R+Math.imul(ie,Qt)|0;var ou=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(ou>>>26)|0,ou&=67108863,T=Math.imul(qe,je),S=Math.imul(qe,ze),S=S+Math.imul(Ue,je)|0,R=Math.imul(Ue,ze),T=T+Math.imul(Ce,Ke)|0,S=S+Math.imul(Ce,Ve)|0,S=S+Math.imul(Le,Ke)|0,R=R+Math.imul(Le,Ve)|0,T=T+Math.imul(Be,Ge)|0,S=S+Math.imul(Be,Ze)|0,S=S+Math.imul(ke,Ge)|0,R=R+Math.imul(ke,Ze)|0,T=T+Math.imul(be,We)|0,S=S+Math.imul(be,Ye)|0,S=S+Math.imul(_e,We)|0,R=R+Math.imul(_e,Ye)|0,T=T+Math.imul(xe,$e)|0,S=S+Math.imul(xe,Xe)|0,S=S+Math.imul(ye,$e)|0,R=R+Math.imul(ye,Xe)|0,T=T+Math.imul(ge,Je)|0,S=S+Math.imul(ge,Qe)|0,S=S+Math.imul(ve,Je)|0,R=R+Math.imul(ve,Qe)|0,T=T+Math.imul(ue,et)|0,S=S+Math.imul(ue,tt)|0,S=S+Math.imul(le,et)|0,R=R+Math.imul(le,tt)|0,T=T+Math.imul($,rt)|0,S=S+Math.imul($,it)|0,S=S+Math.imul(ee,rt)|0,R=R+Math.imul(ee,it)|0,T=T+Math.imul(pe,Jt)|0,S=S+Math.imul(pe,Qt)|0,S=S+Math.imul(q,Jt)|0,R=R+Math.imul(q,Qt)|0;var au=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(au>>>26)|0,au&=67108863,T=Math.imul(qe,Ke),S=Math.imul(qe,Ve),S=S+Math.imul(Ue,Ke)|0,R=Math.imul(Ue,Ve),T=T+Math.imul(Ce,Ge)|0,S=S+Math.imul(Ce,Ze)|0,S=S+Math.imul(Le,Ge)|0,R=R+Math.imul(Le,Ze)|0,T=T+Math.imul(Be,We)|0,S=S+Math.imul(Be,Ye)|0,S=S+Math.imul(ke,We)|0,R=R+Math.imul(ke,Ye)|0,T=T+Math.imul(be,$e)|0,S=S+Math.imul(be,Xe)|0,S=S+Math.imul(_e,$e)|0,R=R+Math.imul(_e,Xe)|0,T=T+Math.imul(xe,Je)|0,S=S+Math.imul(xe,Qe)|0,S=S+Math.imul(ye,Je)|0,R=R+Math.imul(ye,Qe)|0,T=T+Math.imul(ge,et)|0,S=S+Math.imul(ge,tt)|0,S=S+Math.imul(ve,et)|0,R=R+Math.imul(ve,tt)|0,T=T+Math.imul(ue,rt)|0,S=S+Math.imul(ue,it)|0,S=S+Math.imul(le,rt)|0,R=R+Math.imul(le,it)|0,T=T+Math.imul($,Jt)|0,S=S+Math.imul($,Qt)|0,S=S+Math.imul(ee,Jt)|0,R=R+Math.imul(ee,Qt)|0;var su=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(su>>>26)|0,su&=67108863,T=Math.imul(qe,Ge),S=Math.imul(qe,Ze),S=S+Math.imul(Ue,Ge)|0,R=Math.imul(Ue,Ze),T=T+Math.imul(Ce,We)|0,S=S+Math.imul(Ce,Ye)|0,S=S+Math.imul(Le,We)|0,R=R+Math.imul(Le,Ye)|0,T=T+Math.imul(Be,$e)|0,S=S+Math.imul(Be,Xe)|0,S=S+Math.imul(ke,$e)|0,R=R+Math.imul(ke,Xe)|0,T=T+Math.imul(be,Je)|0,S=S+Math.imul(be,Qe)|0,S=S+Math.imul(_e,Je)|0,R=R+Math.imul(_e,Qe)|0,T=T+Math.imul(xe,et)|0,S=S+Math.imul(xe,tt)|0,S=S+Math.imul(ye,et)|0,R=R+Math.imul(ye,tt)|0,T=T+Math.imul(ge,rt)|0,S=S+Math.imul(ge,it)|0,S=S+Math.imul(ve,rt)|0,R=R+Math.imul(ve,it)|0,T=T+Math.imul(ue,Jt)|0,S=S+Math.imul(ue,Qt)|0,S=S+Math.imul(le,Jt)|0,R=R+Math.imul(le,Qt)|0;var uu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(uu>>>26)|0,uu&=67108863,T=Math.imul(qe,We),S=Math.imul(qe,Ye),S=S+Math.imul(Ue,We)|0,R=Math.imul(Ue,Ye),T=T+Math.imul(Ce,$e)|0,S=S+Math.imul(Ce,Xe)|0,S=S+Math.imul(Le,$e)|0,R=R+Math.imul(Le,Xe)|0,T=T+Math.imul(Be,Je)|0,S=S+Math.imul(Be,Qe)|0,S=S+Math.imul(ke,Je)|0,R=R+Math.imul(ke,Qe)|0,T=T+Math.imul(be,et)|0,S=S+Math.imul(be,tt)|0,S=S+Math.imul(_e,et)|0,R=R+Math.imul(_e,tt)|0,T=T+Math.imul(xe,rt)|0,S=S+Math.imul(xe,it)|0,S=S+Math.imul(ye,rt)|0,R=R+Math.imul(ye,it)|0,T=T+Math.imul(ge,Jt)|0,S=S+Math.imul(ge,Qt)|0,S=S+Math.imul(ve,Jt)|0,R=R+Math.imul(ve,Qt)|0;var fu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(fu>>>26)|0,fu&=67108863,T=Math.imul(qe,$e),S=Math.imul(qe,Xe),S=S+Math.imul(Ue,$e)|0,R=Math.imul(Ue,Xe),T=T+Math.imul(Ce,Je)|0,S=S+Math.imul(Ce,Qe)|0,S=S+Math.imul(Le,Je)|0,R=R+Math.imul(Le,Qe)|0,T=T+Math.imul(Be,et)|0,S=S+Math.imul(Be,tt)|0,S=S+Math.imul(ke,et)|0,R=R+Math.imul(ke,tt)|0,T=T+Math.imul(be,rt)|0,S=S+Math.imul(be,it)|0,S=S+Math.imul(_e,rt)|0,R=R+Math.imul(_e,it)|0,T=T+Math.imul(xe,Jt)|0,S=S+Math.imul(xe,Qt)|0,S=S+Math.imul(ye,Jt)|0,R=R+Math.imul(ye,Qt)|0;var cu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(cu>>>26)|0,cu&=67108863,T=Math.imul(qe,Je),S=Math.imul(qe,Qe),S=S+Math.imul(Ue,Je)|0,R=Math.imul(Ue,Qe),T=T+Math.imul(Ce,et)|0,S=S+Math.imul(Ce,tt)|0,S=S+Math.imul(Le,et)|0,R=R+Math.imul(Le,tt)|0,T=T+Math.imul(Be,rt)|0,S=S+Math.imul(Be,it)|0,S=S+Math.imul(ke,rt)|0,R=R+Math.imul(ke,it)|0,T=T+Math.imul(be,Jt)|0,S=S+Math.imul(be,Qt)|0,S=S+Math.imul(_e,Jt)|0,R=R+Math.imul(_e,Qt)|0;var lu=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(lu>>>26)|0,lu&=67108863,T=Math.imul(qe,et),S=Math.imul(qe,tt),S=S+Math.imul(Ue,et)|0,R=Math.imul(Ue,tt),T=T+Math.imul(Ce,rt)|0,S=S+Math.imul(Ce,it)|0,S=S+Math.imul(Le,rt)|0,R=R+Math.imul(Le,it)|0,T=T+Math.imul(Be,Jt)|0,S=S+Math.imul(Be,Qt)|0,S=S+Math.imul(ke,Jt)|0,R=R+Math.imul(ke,Qt)|0;var k5=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(k5>>>26)|0,k5&=67108863,T=Math.imul(qe,rt),S=Math.imul(qe,it),S=S+Math.imul(Ue,rt)|0,R=Math.imul(Ue,it),T=T+Math.imul(Ce,Jt)|0,S=S+Math.imul(Ce,Qt)|0,S=S+Math.imul(Le,Jt)|0,R=R+Math.imul(Le,Qt)|0;var R5=(I+T|0)+((S&8191)<<13)|0;I=(R+(S>>>13)|0)+(R5>>>26)|0,R5&=67108863,T=Math.imul(qe,Jt),S=Math.imul(qe,Qt),S=S+Math.imul(Ue,Jt)|0,R=Math.imul(Ue,Qt);var B5=(I+T|0)+((S&8191)<<13)|0;return I=(R+(S>>>13)|0)+(B5>>>26)|0,B5&=67108863,p[0]=$s,p[1]=Xs,p[2]=Js,p[3]=Qs,p[4]=eu,p[5]=tu,p[6]=ru,p[7]=iu,p[8]=nu,p[9]=ou,p[10]=au,p[11]=su,p[12]=uu,p[13]=fu,p[14]=cu,p[15]=lu,p[16]=k5,p[17]=R5,p[18]=B5,I!==0&&(p[19]=I,_.length++),_};Math.imul||(L=D);function U(y,f,d){d.negative=f.negative^y.negative,d.length=y.length+f.length;for(var _=0,x=0,b=0;b<d.length-1;b++){var p=x;x=0;for(var I=_&67108863,T=Math.min(b,f.length-1),S=Math.max(0,b-y.length+1);S<=T;S++){var R=b-S,Y=y.words[R]|0,X=f.words[S]|0,ie=Y*X,ce=ie&67108863;p=p+(ie/67108864|0)|0,ce=ce+I|0,I=ce&67108863,p=p+(ce>>>26)|0,x+=p>>>26,p&=67108863}d.words[b]=I,_=p,p=x}return _!==0?d.words[b]=_:d.length--,d._strip()}function K(y,f,d){return U(y,f,d)}n.prototype.mulTo=function(f,d){var _,x=this.length+f.length;return this.length===10&&f.length===10?_=L(this,f,d):x<63?_=D(this,f,d):x<1024?_=U(this,f,d):_=K(this,f,d),_};function N(y,f){this.x=y,this.y=f}N.prototype.makeRBT=function(f){for(var d=new Array(f),_=n.prototype._countBits(f)-1,x=0;x<f;x++)d[x]=this.revBin(x,_,f);return d},N.prototype.revBin=function(f,d,_){if(f===0||f===_-1)return f;for(var x=0,b=0;b<d;b++)x|=(f&1)<<d-b-1,f>>=1;return x},N.prototype.permute=function(f,d,_,x,b,p){for(var I=0;I<p;I++)x[I]=d[f[I]],b[I]=_[f[I]]},N.prototype.transform=function(f,d,_,x,b,p){this.permute(p,f,d,_,x,b);for(var I=1;I<b;I<<=1)for(var T=I<<1,S=Math.cos(2*Math.PI/T),R=Math.sin(2*Math.PI/T),Y=0;Y<b;Y+=T)for(var X=S,ie=R,ce=0;ce<I;ce++){var pe=_[Y+ce],q=x[Y+ce],W=_[Y+ce+I],$=x[Y+ce+I],ee=X*W-ie*$;$=X*$+ie*W,W=ee,_[Y+ce]=pe+W,x[Y+ce]=q+$,_[Y+ce+I]=pe-W,x[Y+ce+I]=q-$,ce!==T&&(ee=S*X-R*ie,ie=S*ie+R*X,X=ee)}},N.prototype.guessLen13b=function(f,d){var _=Math.max(d,f)|1,x=_&1,b=0;for(_=_/2|0;_;_=_>>>1)b++;return 1<<b+1+x},N.prototype.conjugate=function(f,d,_){if(!(_<=1))for(var x=0;x<_/2;x++){var b=f[x];f[x]=f[_-x-1],f[_-x-1]=b,b=d[x],d[x]=-d[_-x-1],d[_-x-1]=-b}},N.prototype.normalize13b=function(f,d){for(var _=0,x=0;x<d/2;x++){var b=Math.round(f[2*x+1]/d)*8192+Math.round(f[2*x]/d)+_;f[x]=b&67108863,b<67108864?_=0:_=b/67108864|0}return f},N.prototype.convert13b=function(f,d,_,x){for(var b=0,p=0;p<d;p++)b=b+(f[p]|0),_[2*p]=b&8191,b=b>>>13,_[2*p+1]=b&8191,b=b>>>13;for(p=2*d;p<x;++p)_[p]=0;r(b===0),r((b&-8192)===0)},N.prototype.stub=function(f){for(var d=new Array(f),_=0;_<f;_++)d[_]=0;return d},N.prototype.mulp=function(f,d,_){var x=2*this.guessLen13b(f.length,d.length),b=this.makeRBT(x),p=this.stub(x),I=new Array(x),T=new Array(x),S=new Array(x),R=new Array(x),Y=new Array(x),X=new Array(x),ie=_.words;ie.length=x,this.convert13b(f.words,f.length,I,x),this.convert13b(d.words,d.length,R,x),this.transform(I,p,T,S,x,b),this.transform(R,p,Y,X,x,b);for(var ce=0;ce<x;ce++){var pe=T[ce]*Y[ce]-S[ce]*X[ce];S[ce]=T[ce]*X[ce]+S[ce]*Y[ce],T[ce]=pe}return this.conjugate(T,S,x),this.transform(T,S,ie,p,x,b),this.conjugate(ie,p,x),this.normalize13b(ie,x),_.negative=f.negative^d.negative,_.length=f.length+d.length,_._strip()},n.prototype.mul=function(f){var d=new n(null);return d.words=new Array(this.length+f.length),this.mulTo(f,d)},n.prototype.mulf=function(f){var d=new n(null);return d.words=new Array(this.length+f.length),K(this,f,d)},n.prototype.imul=function(f){return this.clone().mulTo(f,this)},n.prototype.imuln=function(f){var d=f<0;d&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var _=0,x=0;x<this.length;x++){var b=(this.words[x]|0)*f,p=(b&67108863)+(_&67108863);_>>=26,_+=b/67108864|0,_+=p>>>26,this.words[x]=p&67108863}return _!==0&&(this.words[x]=_,this.length++),this.length=f===0?1:this.length,d?this.ineg():this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var d=M(f);if(d.length===0)return new n(1);for(var _=this,x=0;x<d.length&&d[x]===0;x++,_=_.sqr());if(++x<d.length)for(var b=_.sqr();x<d.length;x++,b=b.sqr())d[x]!==0&&(_=_.mul(b));return _},n.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26,x=67108863>>>26-d<<26-d,b;if(d!==0){var p=0;for(b=0;b<this.length;b++){var I=this.words[b]&x,T=(this.words[b]|0)-I<<d;this.words[b]=T|p,p=I>>>26-d}p&&(this.words[b]=p,this.length++)}if(_!==0){for(b=this.length-1;b>=0;b--)this.words[b+_]=this.words[b];for(b=0;b<_;b++)this.words[b]=0;this.length+=_}return this._strip()},n.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},n.prototype.iushrn=function(f,d,_){r(typeof f=="number"&&f>=0);var x;d?x=(d-d%26)/26:x=0;var b=f%26,p=Math.min((f-b)/26,this.length),I=67108863^67108863>>>b<<b,T=_;if(x-=p,x=Math.max(0,x),T){for(var S=0;S<p;S++)T.words[S]=this.words[S];T.length=p}if(p!==0)if(this.length>p)for(this.length-=p,S=0;S<this.length;S++)this.words[S]=this.words[S+p];else this.words[0]=0,this.length=1;var R=0;for(S=this.length-1;S>=0&&(R!==0||S>=x);S--){var Y=this.words[S]|0;this.words[S]=R<<26-b|Y>>>b,R=Y&I}return T&&R!==0&&(T.words[T.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(f,d,_){return r(this.negative===0),this.iushrn(f,d,_)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26,x=1<<d;if(this.length<=_)return!1;var b=this.words[_];return!!(b&x)},n.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var d=f%26,_=(f-d)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(d!==0&&_++,this.length=Math.min(_,this.length),d!==0){var x=67108863^67108863>>>d<<d;this.words[this.length-1]&=x}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.maskn=function(f){return this.clone().imaskn(f)},n.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},n.prototype._iaddn=function(f){this.words[0]+=f;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},n.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},n.prototype.addn=function(f){return this.clone().iaddn(f)},n.prototype.subn=function(f){return this.clone().isubn(f)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(f,d,_){var x=f.length+_,b;this._expand(x);var p,I=0;for(b=0;b<f.length;b++){p=(this.words[b+_]|0)+I;var T=(f.words[b]|0)*d;p-=T&67108863,I=(p>>26)-(T/67108864|0),this.words[b+_]=p&67108863}for(;b<this.length-_;b++)p=(this.words[b+_]|0)+I,I=p>>26,this.words[b+_]=p&67108863;if(I===0)return this._strip();for(r(I===-1),I=0,b=0;b<this.length;b++)p=-(this.words[b]|0)+I,I=p>>26,this.words[b]=p&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(f,d){var _=this.length-f.length,x=this.clone(),b=f,p=b.words[b.length-1]|0,I=this._countBits(p);_=26-I,_!==0&&(b=b.ushln(_),x.iushln(_),p=b.words[b.length-1]|0);var T=x.length-b.length,S;if(d!=="mod"){S=new n(null),S.length=T+1,S.words=new Array(S.length);for(var R=0;R<S.length;R++)S.words[R]=0}var Y=x.clone()._ishlnsubmul(b,1,T);Y.negative===0&&(x=Y,S&&(S.words[T]=1));for(var X=T-1;X>=0;X--){var ie=(x.words[b.length+X]|0)*67108864+(x.words[b.length+X-1]|0);for(ie=Math.min(ie/p|0,67108863),x._ishlnsubmul(b,ie,X);x.negative!==0;)ie--,x.negative=0,x._ishlnsubmul(b,1,X),x.isZero()||(x.negative^=1);S&&(S.words[X]=ie)}return S&&S._strip(),x._strip(),d!=="div"&&_!==0&&x.iushrn(_),{div:S||null,mod:x}},n.prototype.divmod=function(f,d,_){if(r(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var x,b,p;return this.negative!==0&&f.negative===0?(p=this.neg().divmod(f,d),d!=="mod"&&(x=p.div.neg()),d!=="div"&&(b=p.mod.neg(),_&&b.negative!==0&&b.iadd(f)),{div:x,mod:b}):this.negative===0&&f.negative!==0?(p=this.divmod(f.neg(),d),d!=="mod"&&(x=p.div.neg()),{div:x,mod:p.mod}):(this.negative&f.negative)!==0?(p=this.neg().divmod(f.neg(),d),d!=="div"&&(b=p.mod.neg(),_&&b.negative!==0&&b.isub(f)),{div:p.div,mod:b}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?d==="div"?{div:this.divn(f.words[0]),mod:null}:d==="mod"?{div:null,mod:new n(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modrn(f.words[0]))}:this._wordDiv(f,d)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var d=this.divmod(f);if(d.mod.isZero())return d.div;var _=d.div.negative!==0?d.mod.isub(f):d.mod,x=f.ushrn(1),b=f.andln(1),p=_.cmp(x);return p<0||b===1&&p===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},n.prototype.modrn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var _=(1<<26)%f,x=0,b=this.length-1;b>=0;b--)x=(_*x+(this.words[b]|0))%f;return d?-x:x},n.prototype.modn=function(f){return this.modrn(f)},n.prototype.idivn=function(f){var d=f<0;d&&(f=-f),r(f<=67108863);for(var _=0,x=this.length-1;x>=0;x--){var b=(this.words[x]|0)+_*67108864;this.words[x]=b/f|0,_=b%f}return this._strip(),d?this.ineg():this},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var d=this,_=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var x=new n(1),b=new n(0),p=new n(0),I=new n(1),T=0;d.isEven()&&_.isEven();)d.iushrn(1),_.iushrn(1),++T;for(var S=_.clone(),R=d.clone();!d.isZero();){for(var Y=0,X=1;(d.words[0]&X)===0&&Y<26;++Y,X<<=1);if(Y>0)for(d.iushrn(Y);Y-- >0;)(x.isOdd()||b.isOdd())&&(x.iadd(S),b.isub(R)),x.iushrn(1),b.iushrn(1);for(var ie=0,ce=1;(_.words[0]&ce)===0&&ie<26;++ie,ce<<=1);if(ie>0)for(_.iushrn(ie);ie-- >0;)(p.isOdd()||I.isOdd())&&(p.iadd(S),I.isub(R)),p.iushrn(1),I.iushrn(1);d.cmp(_)>=0?(d.isub(_),x.isub(p),b.isub(I)):(_.isub(d),p.isub(x),I.isub(b))}return{a:p,b:I,gcd:_.iushln(T)}},n.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var d=this,_=f.clone();d.negative!==0?d=d.umod(f):d=d.clone();for(var x=new n(1),b=new n(0),p=_.clone();d.cmpn(1)>0&&_.cmpn(1)>0;){for(var I=0,T=1;(d.words[0]&T)===0&&I<26;++I,T<<=1);if(I>0)for(d.iushrn(I);I-- >0;)x.isOdd()&&x.iadd(p),x.iushrn(1);for(var S=0,R=1;(_.words[0]&R)===0&&S<26;++S,R<<=1);if(S>0)for(_.iushrn(S);S-- >0;)b.isOdd()&&b.iadd(p),b.iushrn(1);d.cmp(_)>=0?(d.isub(_),x.isub(b)):(_.isub(d),b.isub(x))}var Y;return d.cmpn(1)===0?Y=x:Y=b,Y.cmpn(0)<0&&Y.iadd(f),Y},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var d=this.clone(),_=f.clone();d.negative=0,_.negative=0;for(var x=0;d.isEven()&&_.isEven();x++)d.iushrn(1),_.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;_.isEven();)_.iushrn(1);var b=d.cmp(_);if(b<0){var p=d;d=_,_=p}else if(b===0||_.cmpn(1)===0)break;d.isub(_)}while(!0);return _.iushln(x)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){r(typeof f=="number");var d=f%26,_=(f-d)/26,x=1<<d;if(this.length<=_)return this._expand(_+1),this.words[_]|=x,this;for(var b=x,p=_;b!==0&&p<this.length;p++){var I=this.words[p]|0;I+=b,b=I>>>26,I&=67108863,this.words[p]=I}return b!==0&&(this.words[p]=b,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var d=f<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var _;if(this.length>1)_=1;else{d&&(f=-f),r(f<=67108863,"Number is too big");var x=this.words[0]|0;_=x===f?0:x<f?-1:1}return this.negative!==0?-_|0:_},n.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var d=this.ucmp(f);return this.negative!==0?-d|0:d},n.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var d=0,_=this.length-1;_>=0;_--){var x=this.words[_]|0,b=f.words[_]|0;if(x!==b){x<b?d=-1:x>b&&(d=1);break}}return d},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new g(f)},n.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var C={k256:null,p224:null,p192:null,p25519:null};function F(y,f){this.name=y,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},F.prototype.ireduce=function(f){var d=f,_;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),_=d.bitLength();while(_>this.n);var x=_<this.n?-1:d.ucmp(this.p);return x===0?(d.words[0]=0,d.length=1):x>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},F.prototype.split=function(f,d){f.iushrn(this.n,0,d)},F.prototype.imulK=function(f){return f.imul(this.k)};function H(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(H,F),H.prototype.split=function(f,d){for(var _=4194303,x=Math.min(f.length,9),b=0;b<x;b++)d.words[b]=f.words[b];if(d.length=x,f.length<=9){f.words[0]=0,f.length=1;return}var p=f.words[9];for(d.words[d.length++]=p&_,b=10;b<f.length;b++){var I=f.words[b]|0;f.words[b-10]=(I&_)<<4|p>>>22,p=I}p>>>=22,f.words[b-10]=p,p===0&&f.length>10?f.length-=10:f.length-=9},H.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var d=0,_=0;_<f.length;_++){var x=f.words[_]|0;d+=x*977,f.words[_]=d&67108863,d=x*64+(d/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function z(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(z,F);function G(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(G,F);function B(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(B,F),B.prototype.imulK=function(f){for(var d=0,_=0;_<f.length;_++){var x=(f.words[_]|0)*19+d,b=x&67108863;x>>>=26,f.words[_]=b,d=x}return d!==0&&(f.words[f.length++]=d),f},n._prime=function(f){if(C[f])return C[f];var d;if(f==="k256")d=new H;else if(f==="p224")d=new z;else if(f==="p192")d=new G;else if(f==="p25519")d=new B;else throw new Error("Unknown prime "+f);return C[f]=d,d};function g(y){if(typeof y=="string"){var f=n._prime(y);this.m=f.p,this.prime=f}else r(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}g.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},g.prototype._verify2=function(f,d){r((f.negative|d.negative)===0,"red works only with positives"),r(f.red&&f.red===d.red,"red works only with red numbers")},g.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(c(f,f.umod(this.m)._forceRed(this)),f)},g.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},g.prototype.add=function(f,d){this._verify2(f,d);var _=f.add(d);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},g.prototype.iadd=function(f,d){this._verify2(f,d);var _=f.iadd(d);return _.cmp(this.m)>=0&&_.isub(this.m),_},g.prototype.sub=function(f,d){this._verify2(f,d);var _=f.sub(d);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},g.prototype.isub=function(f,d){this._verify2(f,d);var _=f.isub(d);return _.cmpn(0)<0&&_.iadd(this.m),_},g.prototype.shl=function(f,d){return this._verify1(f),this.imod(f.ushln(d))},g.prototype.imul=function(f,d){return this._verify2(f,d),this.imod(f.imul(d))},g.prototype.mul=function(f,d){return this._verify2(f,d),this.imod(f.mul(d))},g.prototype.isqr=function(f){return this.imul(f,f.clone())},g.prototype.sqr=function(f){return this.mul(f,f)},g.prototype.sqrt=function(f){if(f.isZero())return f.clone();var d=this.m.andln(3);if(r(d%2===1),d===3){var _=this.m.add(new n(1)).iushrn(2);return this.pow(f,_)}for(var x=this.m.subn(1),b=0;!x.isZero()&&x.andln(1)===0;)b++,x.iushrn(1);r(!x.isZero());var p=new n(1).toRed(this),I=p.redNeg(),T=this.m.subn(1).iushrn(1),S=this.m.bitLength();for(S=new n(2*S*S).toRed(this);this.pow(S,T).cmp(I)!==0;)S.redIAdd(I);for(var R=this.pow(S,x),Y=this.pow(f,x.addn(1).iushrn(1)),X=this.pow(f,x),ie=b;X.cmp(p)!==0;){for(var ce=X,pe=0;ce.cmp(p)!==0;pe++)ce=ce.redSqr();r(pe<ie);var q=this.pow(R,new n(1).iushln(ie-pe-1));Y=Y.redMul(q),R=q.redSqr(),X=X.redMul(R),ie=pe}return Y},g.prototype.invm=function(f){var d=f._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},g.prototype.pow=function(f,d){if(d.isZero())return new n(1).toRed(this);if(d.cmpn(1)===0)return f.clone();var _=4,x=new Array(1<<_);x[0]=new n(1).toRed(this),x[1]=f;for(var b=2;b<x.length;b++)x[b]=this.mul(x[b-1],f);var p=x[0],I=0,T=0,S=d.bitLength()%26;for(S===0&&(S=26),b=d.length-1;b>=0;b--){for(var R=d.words[b],Y=S-1;Y>=0;Y--){var X=R>>Y&1;if(p!==x[0]&&(p=this.sqr(p)),X===0&&I===0){T=0;continue}I<<=1,I|=X,T++,!(T!==_&&(b!==0||Y!==0))&&(p=this.mul(p,x[I]),T=0,I=0)}S=26}return p},g.prototype.convertTo=function(f){var d=f.umod(this.m);return d===f?d.clone():d},g.prototype.convertFrom=function(f){var d=f.clone();return d.red=null,d},n.mont=function(f){return new O(f)};function O(y){g.call(this,y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(O,g),O.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},O.prototype.convertFrom=function(f){var d=this.imod(f.mul(this.rinv));return d.red=null,d},O.prototype.imul=function(f,d){if(f.isZero()||d.isZero())return f.words[0]=0,f.length=1,f;var _=f.imul(d),x=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=_.isub(x).iushrn(this.shift),p=b;return b.cmp(this.m)>=0?p=b.isub(this.m):b.cmpn(0)<0&&(p=b.iadd(this.m)),p._forceRed(this)},O.prototype.mul=function(f,d){if(f.isZero()||d.isZero())return new n(0)._forceRed(this);var _=f.mul(d),x=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=_.isub(x).iushrn(this.shift),p=b;return b.cmp(this.m)>=0?p=b.isub(this.m):b.cmpn(0)<0&&(p=b.iadd(this.m)),p._forceRed(this)},O.prototype.invm=function(f){var d=this.imod(f._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof Cm>"u"||Cm,BO)});var Dm=k((l1e,DO)=>{"use strict";v();var Bc=MO(),AY=vu(),PY=nt().Buffer;function NO(e){var t=e.modulus.byteLength(),r;do r=new Bc(AY(t));while(r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2));return r}function TY(e){var t=NO(e),r=t.toRed(Bc.mont(e.modulus)).redPow(new Bc(e.publicExponent)).fromRed();return{blinder:r,unblinder:t.invm(e.modulus)}}function CO(e,t){var r=TY(t),i=t.modulus.byteLength(),n=new Bc(e).mul(r.blinder).umod(t.modulus),o=n.toRed(Bc.mont(t.prime1)),a=n.toRed(Bc.mont(t.prime2)),s=t.coefficient,u=t.prime1,c=t.prime2,l=o.redPow(t.exponent1).fromRed(),m=a.redPow(t.exponent2).fromRed(),w=l.isub(m).imul(s).umod(u).imul(c);return m.iadd(w).imul(r.unblinder).umod(t.modulus).toArrayLike(PY,"be",i)}CO.getr=NO;DO.exports=CO});var FO=k((d1e,UO)=>{v();var kY=km(),Lm=vu(),RY=zh(),LO=Bm(),qO=Mm(),qm=Nn(),BY=Nm(),MY=Dm(),Un=nt().Buffer;UO.exports=function(t,r,i){var n;t.padding?n=t.padding:i?n=1:n=4;var o=kY(t),a;if(n===4)a=NY(o,r);else if(n===1)a=CY(o,r,i);else if(n===3){if(a=new qm(r),a.cmp(o.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return i?MY(a,o):BY(a,o)};function NY(e,t){var r=e.modulus.byteLength(),i=t.length,n=RY("sha1").update(Un.alloc(0)).digest(),o=n.length,a=2*o;if(i>r-a-2)throw new Error("message too long");var s=Un.alloc(r-i-a-2),u=r-o-1,c=Lm(o),l=qO(Un.concat([n,s,Un.alloc(1,1),t],u),LO(c,u)),m=qO(c,LO(l,o));return new qm(Un.concat([Un.alloc(1),m,l],r))}function CY(e,t,r){var i=t.length,n=e.modulus.byteLength();if(i>n-11)throw new Error("message too long");var o;return r?o=Un.alloc(n-i-3,255):o=DY(n-i-3),new qm(Un.concat([Un.from([0,r?1:2]),o,Un.alloc(1),t],n))}function DY(e){for(var t=Un.allocUnsafe(e),r=0,i=Lm(e*2),n=0,o;r<e;)n===i.length&&(i=Lm(e*2),n=0),o=i[n++],o&&(t[r++]=o);return t}});var VO=k((g1e,KO)=>{v();var LY=km(),HO=Bm(),jO=Mm(),zO=Nn(),qY=Dm(),UY=zh(),FY=Nm(),t0=nt().Buffer;KO.exports=function(t,r,i){var n;t.padding?n=t.padding:i?n=1:n=4;var o=LY(t),a=o.modulus.byteLength();if(r.length>a||new zO(r).cmp(o.modulus)>=0)throw new Error("decryption error");var s;i?s=FY(new zO(r),o):s=qY(r,o);var u=t0.alloc(a-s.length);if(s=t0.concat([u,s],a),n===4)return HY(o,s);if(n===1)return jY(o,s,i);if(n===3)return s;throw new Error("unknown padding")};function HY(e,t){var r=e.modulus.byteLength(),i=UY("sha1").update(t0.alloc(0)).digest(),n=i.length;if(t[0]!==0)throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=jO(o,HO(a,n)),u=jO(a,HO(s,r-n-1));if(zY(i,u.slice(0,n)))throw new Error("decryption error");for(var c=n;u[c]===0;)c++;if(u[c++]!==1)throw new Error("decryption error");return u.slice(c)}function jY(e,t,r){for(var i=t.slice(0,2),n=2,o=0;t[n++]!==0;)if(n>=t.length){o++;break}var a=t.slice(2,n-1);if((i.toString("hex")!=="0002"&&!r||i.toString("hex")!=="0001"&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(n)}function zY(e,t){e=t0.from(e),t=t0.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));for(var n=-1;++n<i;)r+=e[n]^t[n];return r}});var GO=k(zu=>{v();zu.publicEncrypt=FO();zu.privateDecrypt=VO();zu.privateEncrypt=function(t,r){return zu.publicEncrypt(t,r,!0)};zu.publicDecrypt=function(t,r){return zu.privateDecrypt(t,r,!0)}});var rI=k(r0=>{"use strict";v();function ZO(){throw new Error(`secure random number generation not supported by this browser
|
|
15
15
|
use chrome, FireFox or Internet Explorer 11`)}var YO=nt(),WO=vu(),$O=YO.Buffer,XO=YO.kMaxLength,Um=globalThis.crypto||globalThis.msCrypto,JO=Math.pow(2,32)-1;function QO(e,t){if(typeof e!="number"||e!==e)throw new TypeError("offset must be a number");if(e>JO||e<0)throw new TypeError("offset must be a uint32");if(e>XO||e>t)throw new RangeError("offset out of range")}function eI(e,t,r){if(typeof e!="number"||e!==e)throw new TypeError("size must be a number");if(e>JO||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>XO)throw new RangeError("buffer too small")}Um&&Um.getRandomValues||!A.default.browser?(r0.randomFill=KY,r0.randomFillSync=VY):(r0.randomFill=ZO,r0.randomFillSync=ZO);function KY(e,t,r,i){if(!$O.isBuffer(e)&&!(e instanceof globalThis.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof t=="function")i=t,t=0,r=e.length;else if(typeof r=="function")i=r,r=e.length-t;else if(typeof i!="function")throw new TypeError('"cb" argument must be a function');return QO(t,e.length),eI(r,t,e.length),tI(e,t,r,i)}function tI(e,t,r,i){if(A.default.browser){var n=e.buffer,o=new Uint8Array(n,t,r);if(Um.getRandomValues(o),i){A.default.nextTick(function(){i(null,e)});return}return e}if(i){WO(r,function(s,u){if(s)return i(s);u.copy(e,t),i(null,e)});return}var a=WO(r);return a.copy(e,t),e}function VY(e,t,r){if(typeof t>"u"&&(t=0),!$O.isBuffer(e)&&!(e instanceof globalThis.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return QO(t,e.length),r===void 0&&(r=e.length-t),eI(r,t,e.length),tI(e,t,r)}});var _r=k(ot=>{"use strict";v();ot.randomBytes=ot.rng=ot.pseudoRandomBytes=ot.prng=vu();ot.createHash=ot.Hash=zh();ot.createHmac=ot.Hmac=JS();var GY=fs(),ZY=Object.keys(GY),WY=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(ZY);ot.getHashes=function(){return WY};var iI=Uv();ot.pbkdf2=iI.pbkdf2;ot.pbkdf2Sync=iI.pbkdf2Sync;var xo=xE();ot.Cipher=xo.Cipher;ot.createCipher=xo.createCipher;ot.Cipheriv=xo.Cipheriv;ot.createCipheriv=xo.createCipheriv;ot.Decipher=xo.Decipher;ot.createDecipher=xo.createDecipher;ot.Decipheriv=xo.Decipheriv;ot.createDecipheriv=xo.createDecipheriv;ot.getCiphers=xo.getCiphers;ot.listCiphers=xo.listCiphers;var i0=LE();ot.DiffieHellmanGroup=i0.DiffieHellmanGroup;ot.createDiffieHellmanGroup=i0.createDiffieHellmanGroup;ot.getDiffieHellman=i0.getDiffieHellman;ot.createDiffieHellman=i0.createDiffieHellman;ot.DiffieHellman=i0.DiffieHellman;var K2=fs();ot.createSign=K2.createSign;ot.Sign=K2.Sign;ot.createVerify=K2.createVerify;ot.Verify=K2.Verify;ot.createECDH=fs();var V2=GO();ot.publicEncrypt=V2.publicEncrypt;ot.privateEncrypt=V2.privateEncrypt;ot.publicDecrypt=V2.publicDecrypt;ot.privateDecrypt=V2.privateDecrypt;var nI=rI();ot.randomFill=nI.randomFill;ot.randomFillSync=nI.randomFillSync;ot.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
|
|
16
16
|
we accept pull requests
|
|
17
|
-
https://github.com/browserify/crypto-browserify`)};ot.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}});var Ku=k((x1e,oI)=>{"use strict";v();function Mc(){}Mc.getRandomBuffer=function(e){return A.default.browser?Mc.getRandomBufferBrowser(e):Mc.getRandomBufferNode(e)};Mc.getRandomBufferNode=function(e){var t=_r();return t.randomBytes(e)};Mc.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");var t;if(window.crypto&&window.crypto.getRandomValues)t=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)t=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var r=new Uint8Array(e);t.getRandomValues(r);var i=h.Buffer.from(r);return i};oI.exports=Mc});var xt=k((O1e,aI)=>{"use strict";v();var YY=Ku(),Kt={};Kt.isArray=e=>Array.isArray(e);Kt.isNumber=e=>typeof e=="number";Kt.isObject=e=>e&&typeof e=="object";Kt.isString=e=>typeof e=="string";Kt.isUndefined=e=>typeof e>"u";Kt.isFunction=e=>typeof e=="function";Kt.isNull=e=>e===null;Kt.isDate=e=>e instanceof Date;Kt.extend=(e,t)=>Object.assign(e,t);Kt.noop=()=>{};Kt.every=(e,t)=>e.every(t||(r=>r));Kt.map=(e,t)=>Array.from(e).map(t||(r=>r));Kt.includes=(e,t)=>e.includes(t);Kt.each=(e,t)=>e.forEach(t);Kt.clone=e=>Object.assign({},e);Kt.pick=(e,t)=>{let r={};return t.forEach(i=>{typeof e[i]<"u"&&(r[i]=e[i])}),r};Kt.values=e=>Object.values(e);Kt.filter=(e,t)=>e.filter(t);Kt.reduce=(e,t,r)=>e.reduce(t,r);Kt.without=(e,t)=>e.filter(r=>r!==t);Kt.shuffle=e=>{let t=e.slice(0);for(let r=t.length-1;r>0;r--){let n=YY.getRandomBuffer(4).readUInt32BE(0)/4294967296,o=Math.floor(n*(r+1));[t[r],t[o]]=[t[o],t[r]]}return t};Kt.difference=(e,t)=>e.filter(r=>!t.includes(r));Kt.findIndex=(e,t)=>e.findIndex(t);Kt.some=(e,t)=>e.some(t);Kt.range=e=>[...Array(e).keys()];aI.exports=Kt});var uI=k((A1e,sI)=>{"use strict";v();var G2=nt().Buffer;function $Y(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var n=e.charAt(i),o=n.charCodeAt(0);if(t[o]!==255)throw new TypeError(n+" is ambiguous");t[o]=i}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(E){if((Array.isArray(E)||E instanceof Uint8Array)&&(E=G2.from(E)),!G2.isBuffer(E))throw new TypeError("Expected Buffer");if(E.length===0)return"";for(var P=0,M=0,D=0,L=E.length;D!==L&&E[D]===0;)D++,P++;for(var U=(L-D)*c+1>>>0,K=new Uint8Array(U);D!==L;){for(var N=E[D],C=0,F=U-1;(N!==0||C<M)&&F!==-1;F--,C++)N+=256*K[F]>>>0,K[F]=N%a>>>0,N=N/a>>>0;if(N!==0)throw new Error("Non-zero carry");M=C,D++}for(var H=U-M;H!==U&&K[H]===0;)H++;for(var z=s.repeat(P);H<U;++H)z+=e.charAt(K[H]);return z}function m(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return G2.alloc(0);for(var P=0,M=0,D=0;E[P]===s;)M++,P++;for(var L=(E.length-P)*u+1>>>0,U=new Uint8Array(L);P<E.length;){var K=E.charCodeAt(P);if(K>255)return;var N=t[K];if(N===255)return;for(var C=0,F=L-1;(N!==0||C<D)&&F!==-1;F--,C++)N+=a*U[F]>>>0,U[F]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");D=C,P++}for(var H=L-D;H!==L&&U[H]===0;)H++;var z=G2.allocUnsafe(M+(L-H));z.fill(0,0,M);for(var G=M;H!==L;)z[G++]=U[H++];return z}function w(E){var P=m(E);if(P)return P;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:m,decode:w}}sI.exports=$Y});var Z2=k((T1e,fI)=>{v();var XY=uI(),JY="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";fI.exports=XY(JY)});var Fm=k((R1e,cI)=>{"use strict";v();cI.exports="
|
|
17
|
+
https://github.com/browserify/crypto-browserify`)};ot.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}});var Ku=k((x1e,oI)=>{"use strict";v();function Mc(){}Mc.getRandomBuffer=function(e){return A.default.browser?Mc.getRandomBufferBrowser(e):Mc.getRandomBufferNode(e)};Mc.getRandomBufferNode=function(e){var t=_r();return t.randomBytes(e)};Mc.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");var t;if(window.crypto&&window.crypto.getRandomValues)t=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)t=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var r=new Uint8Array(e);t.getRandomValues(r);var i=h.Buffer.from(r);return i};oI.exports=Mc});var xt=k((O1e,aI)=>{"use strict";v();var YY=Ku(),Kt={};Kt.isArray=e=>Array.isArray(e);Kt.isNumber=e=>typeof e=="number";Kt.isObject=e=>e&&typeof e=="object";Kt.isString=e=>typeof e=="string";Kt.isUndefined=e=>typeof e>"u";Kt.isFunction=e=>typeof e=="function";Kt.isNull=e=>e===null;Kt.isDate=e=>e instanceof Date;Kt.extend=(e,t)=>Object.assign(e,t);Kt.noop=()=>{};Kt.every=(e,t)=>e.every(t||(r=>r));Kt.map=(e,t)=>Array.from(e).map(t||(r=>r));Kt.includes=(e,t)=>e.includes(t);Kt.each=(e,t)=>e.forEach(t);Kt.clone=e=>Object.assign({},e);Kt.pick=(e,t)=>{let r={};return t.forEach(i=>{typeof e[i]<"u"&&(r[i]=e[i])}),r};Kt.values=e=>Object.values(e);Kt.filter=(e,t)=>e.filter(t);Kt.reduce=(e,t,r)=>e.reduce(t,r);Kt.without=(e,t)=>e.filter(r=>r!==t);Kt.shuffle=e=>{let t=e.slice(0);for(let r=t.length-1;r>0;r--){let n=YY.getRandomBuffer(4).readUInt32BE(0)/4294967296,o=Math.floor(n*(r+1));[t[r],t[o]]=[t[o],t[r]]}return t};Kt.difference=(e,t)=>e.filter(r=>!t.includes(r));Kt.findIndex=(e,t)=>e.findIndex(t);Kt.some=(e,t)=>e.some(t);Kt.range=e=>[...Array(e).keys()];aI.exports=Kt});var uI=k((A1e,sI)=>{"use strict";v();var G2=nt().Buffer;function $Y(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var n=e.charAt(i),o=n.charCodeAt(0);if(t[o]!==255)throw new TypeError(n+" is ambiguous");t[o]=i}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(E){if((Array.isArray(E)||E instanceof Uint8Array)&&(E=G2.from(E)),!G2.isBuffer(E))throw new TypeError("Expected Buffer");if(E.length===0)return"";for(var P=0,M=0,D=0,L=E.length;D!==L&&E[D]===0;)D++,P++;for(var U=(L-D)*c+1>>>0,K=new Uint8Array(U);D!==L;){for(var N=E[D],C=0,F=U-1;(N!==0||C<M)&&F!==-1;F--,C++)N+=256*K[F]>>>0,K[F]=N%a>>>0,N=N/a>>>0;if(N!==0)throw new Error("Non-zero carry");M=C,D++}for(var H=U-M;H!==U&&K[H]===0;)H++;for(var z=s.repeat(P);H<U;++H)z+=e.charAt(K[H]);return z}function m(E){if(typeof E!="string")throw new TypeError("Expected String");if(E.length===0)return G2.alloc(0);for(var P=0,M=0,D=0;E[P]===s;)M++,P++;for(var L=(E.length-P)*u+1>>>0,U=new Uint8Array(L);P<E.length;){var K=E.charCodeAt(P);if(K>255)return;var N=t[K];if(N===255)return;for(var C=0,F=L-1;(N!==0||C<D)&&F!==-1;F--,C++)N+=a*U[F]>>>0,U[F]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");D=C,P++}for(var H=L-D;H!==L&&U[H]===0;)H++;var z=G2.allocUnsafe(M+(L-H));z.fill(0,0,M);for(var G=M;H!==L;)z[G++]=U[H++];return z}function w(E){var P=m(E);if(P)return P;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:m,decode:w}}sI.exports=$Y});var Z2=k((T1e,fI)=>{v();var XY=uI(),JY="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";fI.exports=XY(JY)});var Fm=k((R1e,cI)=>{"use strict";v();cI.exports="7.0.0"});var hI=k((M1e,lI)=>{"use strict";v();var QY="https://docs.moneybutton.com/";lI.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+QY+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]});var ln=k((C1e,jm)=>{"use strict";v();var Hm=xt();function e$(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}var dI=function(e,t){var r=function(){if(Hm.isString(t.message))this.message=e$(t.message,arguments);else if(Hm.isFunction(t.message))this.message=t.message.apply(null,arguments);else throw new Error("Invalid error definition for "+t.name);this.stack=this.message+`
|
|
18
18
|
`+new Error().stack};return r.prototype=Object.create(e.prototype),r.prototype.name=e.prototype.name+t.name,e[t.name]=r,t.errors&&pI(r,t.errors),r},pI=function(e,t){Hm.each(t,function(r){dI(e,r)})},t$=function(e,t){return pI(e,t),e},Nc={};Nc.Error=function(){this.message="Internal error",this.stack=this.message+`
|
|
19
19
|
`+new Error().stack};Nc.Error.prototype=Object.create(Error.prototype);Nc.Error.prototype.name="bsv.Error";var r$=hI();t$(Nc.Error,r$);jm.exports=Nc.Error;jm.exports.extend=function(e){return dI(Nc.Error,e)}});var Bt=k((L1e,gI)=>{"use strict";v();var n0=ln(),i$=xt();gI.exports={checkState:function(e,t){if(!e)throw new n0.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new n0.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,r){if(r=r||"(unknown name)",i$.isString(t)){if(t==="Buffer"){var i=zt();if(!i.Buffer.isBuffer(e))throw new n0.InvalidArgumentType(e,t,r)}else if(typeof e!==t)throw new n0.InvalidArgumentType(e,t,r)}else if(!(e instanceof t))throw new n0.InvalidArgumentType(e,t.name,r)}}});var fr=k((U1e,mI)=>{"use strict";v();var It=Nn(),zm=Bt(),vI=xt(),W2=function(e){for(var t=h.Buffer.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};It.Zero=new It(0);It.One=new It(1);It.Minus1=new It(-1);It.fromNumber=function(e){return zm.checkArgument(vI.isNumber(e)),new It(e)};It.fromString=function(e,t){return zm.checkArgument(vI.isString(e)),new It(e,t)};It.fromBuffer=function(e,t){typeof t<"u"&&t.endian==="little"&&(e=W2(e));var r=e.toString("hex"),i=new It(r,16);return i};It.fromSM=function(e,t){var r;if(e.length===0)return It.fromBuffer(h.Buffer.from([0]));var i="big";return t&&(i=t.endian),i==="little"&&(e=W2(e)),e[0]&128?(e[0]=e[0]&127,r=It.fromBuffer(e),r.neg().copy(r)):r=It.fromBuffer(e),r};It.prototype.toNumber=function(){return parseInt(this.toString(10),10)};It.prototype.toBuffer=function(e){var t,r;if(e&&e.size){r=this.toString(16,2);var i=r.length/2;t=h.Buffer.from(r,"hex"),i===e.size||(i>e.size?t=It.trim(t,i):i<e.size&&(t=It.pad(t,i,e.size)))}else r=this.toString(16,2),t=h.Buffer.from(r,"hex");return typeof e<"u"&&e.endian==="little"&&(t=W2(t)),t};It.prototype.toSMBigEndian=function(){var e;return this.cmp(It.Zero)===-1?(e=this.neg().toBuffer(),e[0]&128?e=h.Buffer.concat([h.Buffer.from([128]),e]):e[0]=e[0]|128):(e=this.toBuffer(),e[0]&128&&(e=h.Buffer.concat([h.Buffer.from([0]),e]))),e.length===1&e[0]===0&&(e=h.Buffer.from([])),e};It.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return t==="little"&&(r=W2(r)),r};It.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(zm.checkArgument(e.length<=i,new Error("script number overflow")),t&&e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))throw new Error("non-minimally encoded script number");return It.fromSM(e,{endian:"little"})};It.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})};It.trim=function(e,t){return e.slice(t-e.length,e.length)};It.pad=function(e,t,r){for(var i=h.Buffer.alloc(r),n=0;n<e.length;n++)i[i.length-1-n]=e[e.length-1-n];for(n=0;n<r-t;n++)i[n]=0;return i};It.prototype.toHex=function(...e){return this.toBuffer(...e).toString("hex")};It.fromHex=function(e,...t){return It.fromBuffer(h.Buffer.from(e,"hex"),...t)};mI.exports=It});function Km(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ds(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(`${r}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw new RangeError(`${r}expected integer >= 0, got ${e}`)}}function Eo(e,t,r=""){let i=Km(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function Y2(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ds(e.outputLen),ds(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Cc(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 $2(e,t){Eo(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function Sa(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function X2(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Fn(e,t){return e<<32-t|e>>>t}function J2(e){if(Eo(e),bI)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=n$[e[r]];return t}function yI(e){if(e>=wa._0&&e<=wa._9)return e-wa._0;if(e>=wa.A&&e<=wa.F)return e-(wa.A-10);if(e>=wa.a&&e<=wa.f)return e-(wa.a-10)}function Vm(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(bI)try{return Uint8Array.fromHex(e)}catch(n){throw n instanceof SyntaxError?new RangeError(n.message):n}let t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let n=0,o=0;n<r;n++,o+=2){let a=yI(e.charCodeAt(o)),s=yI(e.charCodeAt(o+1));if(a===void 0||s===void 0){let u=e[o]+e[o+1];throw new RangeError('hex string expected, got non-hex character "'+u+'" at index '+o)}i[n]=a*16+s}return i}function xa(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function _I(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];Eo(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function Vu(e,t={}){let r=(n,o)=>e(o).update(n).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>e(n),Object.assign(r,t),Object.freeze(r)}function o0(e=32){ds(e,"bytesLength");let t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}var bI,n$,wa,Gu,ps=Xr(()=>{v();bI=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",n$=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));wa={_0:48,_9:57,A:65,F:70,a:97,f:102};Gu=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})});function wI(e,t,r){return e&t^~e&r}function SI(e,t,r){return e&t^e&r^t&r}var a0,Ea,Oa,Qr,ei,xI=Xr(()=>{v();ps();a0=class{constructor(t,r,i,n){Z(this,"blockLen");Z(this,"outputLen");Z(this,"canXOF",!1);Z(this,"padOffset");Z(this,"isLE");Z(this,"buffer");Z(this,"view");Z(this,"finished",!1);Z(this,"length",0);Z(this,"pos",0);Z(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=X2(this.buffer)}update(t){Cc(this),Eo(t);let{view:r,buffer:i,blockLen:n}=this,o=t.length;for(let a=0;a<o;){let s=Math.min(n-this.pos,o-a);if(s===n){let u=X2(t);for(;n<=o-a;a+=n)this.process(u,a);continue}i.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Cc(this),$2(t,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:a}=this;r[a++]=128,Sa(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(i,0),a=0);for(let m=a;m<n;m++)r[m]=0;i.setBigUint64(n-8,BigInt(this.length*8),o),this.process(i,0);let s=X2(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<c;m++)s.setUint32(4*m,l[m],o)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=o,t.length=n,t.pos=s,n%r&&t.buffer.set(i),t}clone(){return this._cloneInto()}},Ea=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Oa=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Qr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ei=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});function o$(e,t=!1){return t?{h:Number(e&Q2),l:Number(e>>EI&Q2)}:{h:Number(e>>EI&Q2)|0,l:Number(e&Q2)|0}}function OI(e,t=!1){let r=e.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=o$(e[o],t);[i[o],n[o]]=[a,s]}return[i,n]}function Oo(e,t,r,i){let n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:n|0}}var Q2,EI,Gm,Zm,Zu,Wu,s0,u0,II,AI,PI,TI,kI,RI,BI=Xr(()=>{v();Q2=BigInt(4294967295),EI=BigInt(32);Gm=(e,t,r)=>e>>>r,Zm=(e,t,r)=>e<<32-r|t>>>r,Zu=(e,t,r)=>e>>>r|t<<32-r,Wu=(e,t,r)=>e<<32-r|t>>>r,s0=(e,t,r)=>e<<64-r|t>>>r-32,u0=(e,t,r)=>e>>>r-32|t<<64-r;II=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),AI=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,PI=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),TI=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,kI=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),RI=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0});var Wm={};X1(Wm,{_SHA224:()=>rp,_SHA256:()=>tp,_SHA384:()=>np,_SHA512:()=>ip,_SHA512_224:()=>op,_SHA512_256:()=>ap,sha224:()=>c$,sha256:()=>ys,sha384:()=>h$,sha512:()=>l$,sha512_224:()=>p$,sha512_256:()=>d$});var s$,gs,ep,tp,rp,MI,u$,f$,vs,ms,Dc,ip,np,hi,di,op,ap,ys,c$,l$,h$,d$,p$,sp=Xr(()=>{v();xI();BI();ps();s$=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]),gs=new Uint32Array(64),ep=class extends a0{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:r,C:i,D:n,E:o,F:a,G:s,H:u}=this;return[t,r,i,n,o,a,s,u]}set(t,r,i,n,o,a,s,u){this.A=t|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0}process(t,r){for(let m=0;m<16;m++,r+=4)gs[m]=t.getUint32(r,!1);for(let m=16;m<64;m++){let w=gs[m-15],E=gs[m-2],P=Fn(w,7)^Fn(w,18)^w>>>3,M=Fn(E,17)^Fn(E,19)^E>>>10;gs[m]=M+gs[m-7]+P+gs[m-16]|0}let{A:i,B:n,C:o,D:a,E:s,F:u,G:c,H:l}=this;for(let m=0;m<64;m++){let w=Fn(s,6)^Fn(s,11)^Fn(s,25),E=l+w+wI(s,u,c)+s$[m]+gs[m]|0,M=(Fn(i,2)^Fn(i,13)^Fn(i,22))+SI(i,n,o)|0;l=c,c=u,u=s,s=a+E|0,a=o,o=n,n=i,i=E+M|0}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(i,n,o,a,s,u,c,l)}roundClean(){Sa(gs)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Sa(this.buffer)}},tp=class extends ep{constructor(){super(32);Z(this,"A",Ea[0]|0);Z(this,"B",Ea[1]|0);Z(this,"C",Ea[2]|0);Z(this,"D",Ea[3]|0);Z(this,"E",Ea[4]|0);Z(this,"F",Ea[5]|0);Z(this,"G",Ea[6]|0);Z(this,"H",Ea[7]|0)}},rp=class extends ep{constructor(){super(28);Z(this,"A",Oa[0]|0);Z(this,"B",Oa[1]|0);Z(this,"C",Oa[2]|0);Z(this,"D",Oa[3]|0);Z(this,"E",Oa[4]|0);Z(this,"F",Oa[5]|0);Z(this,"G",Oa[6]|0);Z(this,"H",Oa[7]|0)}},MI=OI(["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))),u$=MI[0],f$=MI[1],vs=new Uint32Array(80),ms=new Uint32Array(80),Dc=class extends a0{constructor(t){super(128,t,16,!1)}get(){let{Ah:t,Al:r,Bh:i,Bl:n,Ch:o,Cl:a,Dh:s,Dl:u,Eh:c,El:l,Fh:m,Fl:w,Gh:E,Gl:P,Hh:M,Hl:D}=this;return[t,r,i,n,o,a,s,u,c,l,m,w,E,P,M,D]}set(t,r,i,n,o,a,s,u,c,l,m,w,E,P,M,D){this.Ah=t|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=m|0,this.Fl=w|0,this.Gh=E|0,this.Gl=P|0,this.Hh=M|0,this.Hl=D|0}process(t,r){for(let K=0;K<16;K++,r+=4)vs[K]=t.getUint32(r),ms[K]=t.getUint32(r+=4);for(let K=16;K<80;K++){let N=vs[K-15]|0,C=ms[K-15]|0,F=Zu(N,C,1)^Zu(N,C,8)^Gm(N,C,7),H=Wu(N,C,1)^Wu(N,C,8)^Zm(N,C,7),z=vs[K-2]|0,G=ms[K-2]|0,B=Zu(z,G,19)^s0(z,G,61)^Gm(z,G,6),g=Wu(z,G,19)^u0(z,G,61)^Zm(z,G,6),O=PI(H,g,ms[K-7],ms[K-16]),y=TI(O,F,B,vs[K-7],vs[K-16]);vs[K]=y|0,ms[K]=O|0}let{Ah:i,Al:n,Bh:o,Bl:a,Ch:s,Cl:u,Dh:c,Dl:l,Eh:m,El:w,Fh:E,Fl:P,Gh:M,Gl:D,Hh:L,Hl:U}=this;for(let K=0;K<80;K++){let N=Zu(m,w,14)^Zu(m,w,18)^s0(m,w,41),C=Wu(m,w,14)^Wu(m,w,18)^u0(m,w,41),F=m&E^~m&M,H=w&P^~w&D,z=kI(U,C,H,f$[K],ms[K]),G=RI(z,L,N,F,u$[K],vs[K]),B=z|0,g=Zu(i,n,28)^s0(i,n,34)^s0(i,n,39),O=Wu(i,n,28)^u0(i,n,34)^u0(i,n,39),y=i&o^i&s^o&s,f=n&a^n&u^a&u;L=M|0,U=D|0,M=E|0,D=P|0,E=m|0,P=w|0,{h:m,l:w}=Oo(c|0,l|0,G|0,B|0),c=s|0,l=u|0,s=o|0,u=a|0,o=i|0,a=n|0;let d=II(B,O,f);i=AI(d,G,g,y),n=d|0}({h:i,l:n}=Oo(this.Ah|0,this.Al|0,i|0,n|0)),{h:o,l:a}=Oo(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Oo(this.Ch|0,this.Cl|0,s|0,u|0),{h:c,l}=Oo(this.Dh|0,this.Dl|0,c|0,l|0),{h:m,l:w}=Oo(this.Eh|0,this.El|0,m|0,w|0),{h:E,l:P}=Oo(this.Fh|0,this.Fl|0,E|0,P|0),{h:M,l:D}=Oo(this.Gh|0,this.Gl|0,M|0,D|0),{h:L,l:U}=Oo(this.Hh|0,this.Hl|0,L|0,U|0),this.set(i,n,o,a,s,u,c,l,m,w,E,P,M,D,L,U)}roundClean(){Sa(vs,ms)}destroy(){this.destroyed=!0,Sa(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ip=class extends Dc{constructor(){super(64);Z(this,"Ah",ei[0]|0);Z(this,"Al",ei[1]|0);Z(this,"Bh",ei[2]|0);Z(this,"Bl",ei[3]|0);Z(this,"Ch",ei[4]|0);Z(this,"Cl",ei[5]|0);Z(this,"Dh",ei[6]|0);Z(this,"Dl",ei[7]|0);Z(this,"Eh",ei[8]|0);Z(this,"El",ei[9]|0);Z(this,"Fh",ei[10]|0);Z(this,"Fl",ei[11]|0);Z(this,"Gh",ei[12]|0);Z(this,"Gl",ei[13]|0);Z(this,"Hh",ei[14]|0);Z(this,"Hl",ei[15]|0)}},np=class extends Dc{constructor(){super(48);Z(this,"Ah",Qr[0]|0);Z(this,"Al",Qr[1]|0);Z(this,"Bh",Qr[2]|0);Z(this,"Bl",Qr[3]|0);Z(this,"Ch",Qr[4]|0);Z(this,"Cl",Qr[5]|0);Z(this,"Dh",Qr[6]|0);Z(this,"Dl",Qr[7]|0);Z(this,"Eh",Qr[8]|0);Z(this,"El",Qr[9]|0);Z(this,"Fh",Qr[10]|0);Z(this,"Fl",Qr[11]|0);Z(this,"Gh",Qr[12]|0);Z(this,"Gl",Qr[13]|0);Z(this,"Hh",Qr[14]|0);Z(this,"Hl",Qr[15]|0)}},hi=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),di=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),op=class extends Dc{constructor(){super(28);Z(this,"Ah",hi[0]|0);Z(this,"Al",hi[1]|0);Z(this,"Bh",hi[2]|0);Z(this,"Bl",hi[3]|0);Z(this,"Ch",hi[4]|0);Z(this,"Cl",hi[5]|0);Z(this,"Dh",hi[6]|0);Z(this,"Dl",hi[7]|0);Z(this,"Eh",hi[8]|0);Z(this,"El",hi[9]|0);Z(this,"Fh",hi[10]|0);Z(this,"Fl",hi[11]|0);Z(this,"Gh",hi[12]|0);Z(this,"Gl",hi[13]|0);Z(this,"Hh",hi[14]|0);Z(this,"Hl",hi[15]|0)}},ap=class extends Dc{constructor(){super(32);Z(this,"Ah",di[0]|0);Z(this,"Al",di[1]|0);Z(this,"Bh",di[2]|0);Z(this,"Bl",di[3]|0);Z(this,"Ch",di[4]|0);Z(this,"Cl",di[5]|0);Z(this,"Dh",di[6]|0);Z(this,"Dl",di[7]|0);Z(this,"Eh",di[8]|0);Z(this,"El",di[9]|0);Z(this,"Fh",di[10]|0);Z(this,"Fl",di[11]|0);Z(this,"Gh",di[12]|0);Z(this,"Gl",di[13]|0);Z(this,"Hh",di[14]|0);Z(this,"Hl",di[15]|0)}},ys=Vu(()=>new tp,Gu(1)),c$=Vu(()=>new rp,Gu(4)),l$=Vu(()=>new ip,Gu(3)),h$=Vu(()=>new np,Gu(2)),d$=Vu(()=>new ap,Gu(6)),p$=Vu(()=>new op,Gu(5))});function $u(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}" `;throw new TypeError(r+"expected boolean, got type="+typeof e)}return e}function cp(e){if(typeof e=="bigint"){if(!up(e))throw new RangeError("positive bigint expected, got "+e)}else $m(e);return e}function hn(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(r+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){let r=t&&`"${t}" `;throw new RangeError(r+"expected safe integer, got "+e)}}function f0(e){let t=cp(e).toString(16);return t.length&1?"0"+t:t}function NI(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?fp:BigInt("0x"+e)}function bi(e){return NI(J2(e))}function qc(e){return NI(J2(hp(Eo(e)).reverse()))}function lp(e,t){if(ds(t),t===0)throw new RangeError("zero length");e=cp(e);let r=e.toString(16);if(r.length>t*2)throw new RangeError("number too large");return Vm(r.padStart(t*2,"0"))}function Xm(e,t){return lp(e,t).reverse()}function hp(e){return Uint8Array.from(qt(e))}function Uc(e){if(typeof e!="string")throw new TypeError("ascii string expected, got "+typeof e);return Uint8Array.from(e,(t,r)=>{let i=t.charCodeAt(0);if(t.length!==1||i>127)throw new RangeError(`string contains non-ASCII character "${e[r]}" with code ${i} at position ${r}`);return i})}function g$(e,t,r){return up(e)&&up(t)&&up(r)&&t<=e&&e<r}function Jm(e,t,r,i){if(!g$(t,r,i))throw new RangeError("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function Xu(e){if(e<fp)throw new Error("expected non-negative bigint, got "+e);let t;for(t=0;e>fp;e>>=Ym,t+=1);return t}function CI(e,t,r){if(ds(e,"hashLen"),ds(t,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let i=D=>new Uint8Array(D),n=Uint8Array.of(),o=Uint8Array.of(0),a=Uint8Array.of(1),s=1e3,u=i(e),c=i(e),l=0,m=()=>{u.fill(1),c.fill(0),l=0},w=(...D)=>r(c,kt(u,...D)),E=(D=n)=>{c=w(o,D),u=w(),D.length!==0&&(c=w(a,D),u=w())},P=()=>{if(l++>=s)throw new Error("drbg: tried max amount of iterations");let D=0,L=[];for(;D<t;){u=w();let U=u.slice();L.push(U),D+=u.length}return kt(...L)};return(D,L)=>{m(),E(D);let U;for(;(U=L(P()))===void 0;)E();return m(),U}}function dn(e,t={},r={}){if(Object.prototype.toString.call(e)!=="[object Object]")throw new TypeError("expected valid options object");function i(o,a,s){if(!s&&a!=="function"&&!Object.hasOwn(e,o))throw new TypeError(`param "${o}" is invalid: expected own property`);let u=e[o];if(s&&u===void 0)return;let c=typeof u;if(c!==a||u===null)throw new TypeError(`param "${o}" is invalid: expected ${a}, got ${c}`)}let n=(o,a)=>Object.entries(o).forEach(([s,u])=>i(s,u,a));n(t,!1),n(r,!0)}var qt,$m,Ia,kt,Lc,Yu,Ti,fp,Ym,up,Fc,Ju=Xr(()=>{v();ps();qt=(e,t,r)=>Eo(e,t,r),$m=ds,Ia=J2,kt=(...e)=>_I(...e),Lc=e=>Vm(e),Yu=Km,Ti=e=>o0(e),fp=BigInt(0),Ym=BigInt(1);up=e=>typeof e=="bigint"&&fp<=e;Fc=e=>(Ym<<BigInt(e))-Ym});function qi(e,t){if(t<=ti)throw new Error("mod: expected positive modulus, got "+t);let r=e%t;return r>=ti?r:t+r}function Ui(e,t,r){if(t<ti)throw new Error("pow2: expected non-negative exponent, got "+t);let i=e;for(;t-- >ti;)i*=i,i%=r;return i}function DI(e,t){if(e===ti)throw new Error("invert: expected non-zero number");if(t<=ti)throw new Error("invert: expected positive modulus, got "+t);let r=qi(e,t),i=t,n=ti,o=wr,a=wr,s=ti;for(;r!==ti;){let c=i/r,l=i-r*c,m=n-a*c,w=o-s*c;i=r,r=l,n=a,o=s,a=m,s=w}if(i!==wr)throw new Error("invert: does not exist");return qi(n,t)}function ey(e,t,r){let i=e;if(!i.eql(i.sqr(t),r))throw new Error("Cannot find square root")}function zI(e,t){let r=e,i=(r.ORDER+wr)/UI,n=r.pow(t,i);return ey(r,n,t),n}function y$(e,t){let r=e,i=(r.ORDER-FI)/HI,n=r.mul(t,Qu),o=r.pow(n,i),a=r.mul(t,o),s=r.mul(r.mul(a,Qu),o),u=r.mul(a,r.sub(s,r.ONE));return ey(r,u,t),u}function b$(e){let t=Hc(e),r=KI(e),i=r(t,t.neg(t.ONE)),n=r(t,i),o=r(t,t.neg(i)),a=(e+v$)/jI;return((s,u)=>{let c=s,l=c.pow(u,a),m=c.mul(l,i),w=c.mul(l,n),E=c.mul(l,o),P=c.eql(c.sqr(m),u),M=c.eql(c.sqr(w),u);l=c.cmov(l,m,P),m=c.cmov(E,w,M);let D=c.eql(c.sqr(m),u),L=c.cmov(l,m,D);return ey(c,L,u),L})}function KI(e){if(e<qI)throw new Error("sqrt is not defined for small field");let t=e-wr,r=0;for(;t%Qu===ti;)t/=Qu,r++;let i=Qu,n=Hc(e);for(;Qm(n,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return zI;let o=n.pow(i,t),a=(t+wr)/Qu;return function(u,c){let l=u;if(l.is0(c))return c;if(Qm(l,c)!==1)throw new Error("Cannot find square root");let m=r,w=l.mul(l.ONE,o),E=l.pow(c,t),P=l.pow(c,a);for(;!l.eql(E,l.ONE);){if(l.is0(E))return l.ZERO;let M=1,D=l.sqr(E);for(;!l.eql(D,l.ONE);)if(M++,D=l.sqr(D),M===m)throw new Error("Cannot find square root");let L=wr<<BigInt(m-M-1),U=l.pow(w,L);m=M,w=l.sqr(U),E=l.mul(E,w),P=l.mul(P,U)}return P}}function _$(e){return e%UI===qI?zI:e%HI===FI?y$:e%jI===m$?b$(e):KI(e)}function ef(e){let t={ORDER:"bigint",BYTES:"number",BITS:"number"},r=w$.reduce((i,n)=>(i[n]="function",i),t);if(dn(e,r),hn(e.BYTES,"BYTES"),hn(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=wr)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function S$(e,t,r){let i=e;if(r<ti)throw new Error("invalid exponent, negatives unsupported");if(r===ti)return i.ONE;if(r===wr)return t;let n=i.ONE,o=t;for(;r>ti;)r&wr&&(n=i.mul(n,o)),o=i.sqr(o),r>>=wr;return n}function tf(e,t,r=!1){let i=e,n=new Array(t.length).fill(r?i.ZERO:void 0),o=t.reduce((s,u,c)=>i.is0(u)?s:(n[c]=s,i.mul(s,u)),i.ONE),a=i.inv(o);return t.reduceRight((s,u,c)=>i.is0(u)?s:(n[c]=i.mul(s,n[c]),i.mul(s,u)),a),n}function Qm(e,t){let r=e,i=(r.ORDER-wr)/Qu,n=r.pow(t,i),o=r.eql(n,r.ONE),a=r.eql(n,r.ZERO),s=r.eql(n,r.neg(r.ONE));if(!o&&!a&&!s)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function ty(e,t){return Qm(e,t)!==-1}function x$(e,t){if(t!==void 0&&$m(t),e<=ti)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);let r=Xu(e);if(t!==void 0&&t<r)throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);let i=t!==void 0?t:r,n=Math.ceil(i/8);return{nBitLength:i,nByteLength:n}}function Hc(e,t={}){return new dp(e,t)}function VI(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=wr)throw new Error("field order must be greater than 1");let t=Xu(e-wr);return Math.ceil(t/8)}function c0(e){let t=VI(e);return t+Math.ceil(t/2)}function jc(e,t,r=!1){qt(e);let i=e.length,n=VI(t),o=Math.max(c0(t),16);if(i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let a=r?qc(e):bi(e),s=qi(a,t-wr)+wr;return r?Xm(s,n):lp(s,n)}var ti,wr,Qu,qI,UI,FI,v$,HI,m$,jI,w$,LI,dp,zc=Xr(()=>{v();Ju();ti=BigInt(0),wr=BigInt(1),Qu=BigInt(2),qI=BigInt(3),UI=BigInt(4),FI=BigInt(5),v$=BigInt(7),HI=BigInt(8),m$=BigInt(9),jI=BigInt(16);w$=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];LI=new WeakMap,dp=class{constructor(t,r={}){Z(this,"ORDER");Z(this,"BITS");Z(this,"BYTES");Z(this,"isLE");Z(this,"ZERO",ti);Z(this,"ONE",wr);Z(this,"_lengths");Z(this,"_mod");if(t<=wr)throw new Error("invalid field: expected ORDER > 1, got "+t);let i;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(i=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:n,nByteLength:o}=x$(t,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=n,this.BYTES=o,Object.freeze(this)}create(t){return qi(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return ti<=t&&t<this.ORDER}is0(t){return t===ti}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&wr)===wr}neg(t){return qi(-t,this.ORDER)}eql(t,r){return t===r}sqr(t){return qi(t*t,this.ORDER)}add(t,r){return qi(t+r,this.ORDER)}sub(t,r){return qi(t-r,this.ORDER)}mul(t,r){return qi(t*r,this.ORDER)}pow(t,r){return S$(this,t,r)}div(t,r){return qi(t*DI(r,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,r){return t+r}subN(t,r){return t-r}mulN(t,r){return t*r}inv(t){return DI(t,this.ORDER)}sqrt(t){let r=LI.get(this);return r||LI.set(this,r=_$(this.ORDER)),r(this,t)}toBytes(t){return this.isLE?Xm(t,this.BYTES):lp(t,this.BYTES)}fromBytes(t,r=!1){qt(t);let{_lengths:i,BYTES:n,isLE:o,ORDER:a,_mod:s}=this;if(i){if(t.length<1||!i.includes(t.length)||t.length>n)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let c=new Uint8Array(n);c.set(t,o?0:c.length-t.length),t=c}if(t.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+t.length);let u=o?qc(t):bi(t);if(s&&(u=qi(u,a)),!r&&!this.isValid(u))throw new Error("invalid field element: outside of range 0..ORDER");return u}invertBatch(t){return tf(this,t)}cmov(t,r,i){return $u(i,"condition"),i?r:t}};Object.freeze(dp.prototype)});function YI(e){let t=e;if(typeof t!="function")throw new TypeError("Point must be a constructor");dn({Fp:t.Fp,Fn:t.Fn,fromAffine:t.fromAffine,fromBytes:t.fromBytes,fromHex:t.fromHex},{Fp:"object",Fn:"object",fromAffine:"function",fromBytes:"function",fromHex:"function"}),ef(t.Fp),ef(t.Fn)}function l0(e,t){let r=t.negate();return e?r:t}function oy(e,t){let r=tf(e.Fp,t.map(i=>i.Z));return t.map((i,n)=>e.fromAffine(i.toAffine(r[n])))}function $I(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ry(e,t){$I(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e,o=Fc(e),a=BigInt(e);return{windows:r,windowSize:i,mask:o,maxNumber:n,shiftBy:a}}function GI(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:a}=r,s=Number(e&n),u=e>>a;s>i&&(s-=o,u+=rf);let c=t*i,l=c+Math.abs(s)-1,m=s===0,w=s<0,E=t%2!==0;return{nextN:u,offset:l,isZero:m,isNeg:w,isNegF:E,offsetF:c}}function E$(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,i)=>{if(!(r instanceof t))throw new Error("invalid point at index "+i)})}function O$(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+i)})}function ny(e){return XI.get(e)||1}function ZI(e){if(e!==Kc)throw new Error("invalid wNAF")}function JI(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>Kc||i>Kc;)r&rf&&(o=o.add(n)),i&rf&&(a=a.add(n)),n=n.double(),r>>=rf,i>>=rf;return{p1:o,p2:a}}function QI(e,t,r){let i=e.Fn;E$(t,e),O$(r,i);let n=t.length,o=r.length;if(n!==o)throw new Error("arrays of points and scalars must have equal length");let a=e.ZERO,s=Xu(BigInt(n)),u=1;s>12?u=s-3:s>4?u=s-2:s>0&&(u=2);let c=Fc(u),l=new Array(Number(c)+1).fill(a),m=Math.floor((i.BITS-1)/u)*u,w=a;for(let E=m;E>=0;E-=u){l.fill(a);for(let M=0;M<o;M++){let D=r[M],L=Number(D>>BigInt(E)&c);l[L]=l[L].add(t[M])}let P=a;for(let M=l.length-1,D=a;M>0;M--)D=D.add(l[M]),P=P.add(D);if(w=w.add(P),E!==0)for(let M=0;M<u;M++)w=w.double()}return w}function WI(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return ef(t),t}else return Hc(e,{isLE:r})}function eA(e,t,r={},i){if(i===void 0&&(i=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let u of["p","n","h"]){let c=t[u];if(!(typeof c=="bigint"&&c>Kc))throw new Error(`CURVE.${u} must be positive bigint`)}let n=WI(t.p,r.Fp,i),o=WI(t.n,r.Fn,i),s=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let u of s)if(!n.isValid(t[u]))throw new Error(`CURVE.${u} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:n,Fn:o}}function gp(e,t){return function(i){let n=e(i);return{secretKey:n,publicKey:t(n)}}}var Kc,rf,iy,XI,pp,vp=Xr(()=>{v();Ju();zc();Kc=BigInt(0),rf=BigInt(1);iy=new WeakMap,XI=new WeakMap;pp=class{constructor(t,r){Z(this,"BASE");Z(this,"ZERO");Z(this,"Fn");Z(this,"bits");this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,i=this.ZERO){let n=t;for(;r>Kc;)r&rf&&(i=i.add(n)),n=n.double(),r>>=rf;return i}precomputeWindow(t,r){let{windows:i,windowSize:n}=ry(r,this.bits),o=[],a=t,s=a;for(let u=0;u<i;u++){s=a,o.push(s);for(let c=1;c<n;c++)s=s.add(a),o.push(s);a=s.double()}return o}wNAF(t,r,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE,a=ry(t,this.bits);for(let s=0;s<a.windows;s++){let{nextN:u,offset:c,isZero:l,isNeg:m,isNegF:w,offsetF:E}=GI(i,s,a);i=u,l?o=o.add(l0(w,r[E])):n=n.add(l0(m,r[c]))}return ZI(i),{p:n,f:o}}wNAFUnsafe(t,r,i,n=this.ZERO){let o=ry(t,this.bits);for(let a=0;a<o.windows&&i!==Kc;a++){let{nextN:s,offset:u,isZero:c,isNeg:l}=GI(i,a,o);if(i=s,!c){let m=r[u];n=n.add(l?m.negate():m)}}return ZI(i),n}getPrecomputes(t,r,i){let n=iy.get(r);return n||(n=this.precomputeWindow(r,t),t!==1&&(typeof i=="function"&&(n=i(n)),iy.set(r,n))),n}cached(t,r,i){let n=ny(t);return this.wNAF(n,this.getPrecomputes(n,t,i),r)}unsafe(t,r,i,n){let o=ny(t);return o===1?this._unsafeLadder(t,r,n):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,n)}createCache(t,r){$I(r,this.bits),XI.set(t,r),iy.delete(t)}hasCache(t){return ny(t)!==1}}});function tA(e){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw new Error("wrong u32 integer:"+e);return e}function I$(e){if(tA(e),e<=1)return 1;if(e>2147483648)throw new Error("nextPowerOfTwo overflow: result does not fit u32");return 1<<ay(e-1)+1>>>0}function ay(e){return tA(e),31-Math.clz32(e)}function rA(e,t,r,i,n){let o=e,a=r||((l,m)=>new Array(l).fill(m??o.ZERO)),s=l=>{if(Array.isArray(l))return!0;if(!ArrayBuffer.isView(l))return!1;let m=l;return typeof m.length=="number"&&typeof m.slice=="function"&&typeof m[Symbol.iterator]=="function"},u=(...l)=>{if(!l.length)return 0;for(let w of l)if(!s(w))throw new Error("poly: not polynomial: "+w);let m=l[0].length;for(let w=1;w<l.length;w++)if(l[w].length!==m)throw new Error(`poly: mismatched lengths ${m} vs ${l[w].length}`);if(n!==void 0&&m!==n)throw new Error(`poly: expected fixed length ${n}, got ${m}`);return m};function c(l,m,w=!1){let E=ay(m),P=w?t.brp(E):t.roots(E);for(let M=0;M<m;M++)if(o.eql(l,P[M]))return M;return-1}return{roots:t,create:a,length:n,extend:(l,m)=>{u(l);let w=a(m,o.ZERO);for(let E=0;E<Math.min(l.length,m);E++)w[E]=l[E];return w},degree:l=>{u(l);for(let m=l.length-1;m>=0;m--)if(!o.is0(l[m]))return m;return-1},add:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.add(l[P],m[P]);return E},sub:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.sub(l[P],m[P]);return E},dot:(l,m)=>{let w=u(l,m),E=a(w);for(let P=0;P<w;P++)E[P]=o.mul(l[P],m[P]);return E},mul:(l,m)=>{if(s(m)){let w=u(l,m);if(i){let E=i.direct(l,!1,!0),P=i.direct(m,!1,!0);for(let M=0;M<E.length;M++)E[M]=o.mul(E[M],P[M]);return i.inverse(E,!0,!1)}else{let E=a(w);for(let P=0;P<w;P++)for(let M=0;M<w;M++){let D=(P+M)%w;E[D]=o.add(E[D],o.mul(l[P],m[M]))}return E}}else{let w=a(u(l));for(let E=0;E<w.length;E++)w[E]=o.mul(l[E],m);return w}},convolve(l,m){let w=I$(l.length+m.length-1);return this.mul(this.extend(l,w),this.extend(m,w))},shift(l,m){let w=a(u(l));w[0]=l[0];for(let E=1,P=o.ONE;E<l.length;E++)P=o.mul(P,m),w[E]=o.mul(l[E],P);return w},clone:l=>{u(l);let m=a(l.length);for(let w=0;w<l.length;w++)m[w]=l[w];return m},eval:(l,m)=>{u(l,m);let w=o.ZERO;for(let E=0;E<l.length;E++)w=o.add(w,o.mul(l[E],m[E]));return w},monomial:{basis:(l,m)=>{let w=a(m),E=o.ONE;for(let P=0;P<m;P++)w[P]=E,E=o.mul(E,l);return w},eval:(l,m)=>{u(l);let w=o.ZERO;for(let E=l.length-1;E>=0;E--)w=o.add(o.mul(w,m),l[E]);return w}},lagrange:{basis:(l,m,w=!1,E)=>{let P=ay(m),M=E||(w?t.brp(P):t.roots(P)),D=a(m),L=c(l,m,w);if(L!==-1)return D[L]=o.ONE,D;let U=o.pow(l,BigInt(m)),K=o.mul(o.sub(U,o.ONE),o.inv(BigInt(m))),N=a(m);for(let F=0;F<m;F++)N[F]=o.sub(l,M[F]);let C=o.invertBatch(N);for(let F=0;F<m;F++)D[F]=o.mul(K,o.mul(M[F],C[F]));return D},eval(l,m,w=!1){u(l);let E=c(m,l.length,w);if(E!==-1)return l[E];let P=this.basis(m,l.length,w),M=o.ZERO;for(let D=0;D<l.length;D++)o.is0(l[D])||(M=o.add(M,o.mul(l[D],P[D])));return M}},vanishing(l){u(l);let m=a(l.length+1,o.ZERO);m[0]=o.ONE;for(let w of l){let E=o.neg(w);for(let P=m.length-1;P>0;P--)m[P]=o.add(o.mul(m[P],E),m[P-1]);m[0]=o.mul(m[0],E)}return m}}}var iA=Xr(()=>{v()});function nf(e,t){if(hn(e),hn(t),t<0||t>4)throw new Error("invalid I2OSP length: "+t);if(e<0||e>2**(8*t)-1)throw new Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let i=t-1;i>=0;i--)r[i]=e&255,e>>>=8;return new Uint8Array(r)}function P$(e,t){let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]^t[i];return r}function nA(e){if(!Yu(e)&&typeof e!="string")throw new Error("DST must be Uint8Array or ascii string");let t=typeof e=="string"?Uc(e):e;if(t.length===0)throw new Error("DST must be non-empty");return t}function T$(e,t,r,i){qt(e),hn(r),t=nA(t),t.length>255&&(t=i(kt(Uc("H2C-OVERSIZE-DST-"),t)));let{outputLen:n,blockLen:o}=i,a=Math.ceil(r/n);if(r>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");let s=kt(t,nf(t.length,1)),u=new Uint8Array(o),c=nf(r,2),l=new Array(a),m=i(kt(u,e,c,nf(0,1),s));l[0]=i(kt(m,nf(1,1),s));for(let E=1;E<a;E++){let P=[P$(m,l[E-1]),nf(E+1,1),s];l[E]=i(kt(...P))}return kt(...l).slice(0,r)}function k$(e,t,r,i,n){if(qt(e),hn(r),t=nA(t),t.length>255){let o=Math.ceil(2*i/8);t=n.create({dkLen:o}).update(Uc("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(e).update(nf(r,2)).update(t).update(nf(t.length,1)).digest()}function sy(e,t,r){dn(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:i,k:n,m:o,hash:a,expand:s,DST:u}=r;if(hn(a.outputLen,"valid hash"),qt(e),hn(t),t<1)throw new Error("hash_to_field: expected count >= 1");if(o<1)throw new Error("hash_to_field: expected m >= 1");let c=i.toString(2).length,l=Math.ceil((c+n)/8),m=t*o*l,w;if(s==="xmd")w=T$(e,u,m,a);else if(s==="xof")w=k$(e,u,m,n,a);else if(s==="_internal_pass")w=e;else throw new Error('expand must be "xmd" or "xof"');let E=new Array(t);for(let P=0;P<t;P++){let M=new Array(o);for(let D=0;D<o;D++){let L=l*(D+P*o),U=w.subarray(L,L+l);M[D]=qi(A$(U),i)}E[P]=M}return E}function oA(e,t){let r=t.map(i=>Array.from(i).reverse());return(i,n)=>{let[o,a,s,u]=r.map(m=>m.reduce((w,E)=>e.add(e.mul(w,i),E))),[c,l]=tf(e,[a,u],!0);return i=e.mul(o,c),n=e.mul(n,e.mul(s,l)),{x:i,y:n}}}function aA(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");let i=s=>Object.freeze({...s,DST:Yu(s.DST)?hp(s.DST):s.DST,...s.encodeDST===void 0?{}:{encodeDST:Yu(s.encodeDST)?hp(s.encodeDST):s.encodeDST}}),n=i(r);function o(s){return e.fromAffine(t(s))}function a(s){let u=s.clearCofactor();return u.equals(e.ZERO)?e.ZERO:(u.assertValidity(),u)}return Object.freeze({get defaults(){return i(n)},Point:e,hashToCurve(s,u){let c=Object.assign({},n,u),l=sy(s,2,c),m=o(l[0]),w=o(l[1]);return a(m.add(w))},encodeToCurve(s,u){let c=n.encodeDST?{DST:n.encodeDST}:{},l=Object.assign({},n,c,u),m=sy(s,1,l),w=o(m[0]);return a(w)},mapToCurve(s){if(n.m===1){if(typeof s!="bigint")throw new Error("expected bigint (m=1)");return a(o([s]))}if(!Array.isArray(s))throw new Error("expected array of bigints");for(let u of s)if(typeof u!="bigint")throw new Error("expected array of bigints");return a(o(s))},hashToScalar(s,u){let c=e.Fn.ORDER,l=Object.assign({},n,{p:c,m:1,DST:R$},u);return sy(s,1,l)[0][0]}})}var A$,R$,sA=Xr(()=>{v();Ju();zc();A$=bi;R$="HashToScalar-"});function uy(e){dn(e,{name:"string",hash:"function"},{hashToScalar:"function",validatePoint:"function",parsePublicKey:"function",adjustScalar:"function",adjustPoint:"function",challenge:"function",adjustNonces:"function",adjustSecret:"function",adjustPublic:"function",adjustGroupCommitmentShare:"function",adjustDKG:"function"}),YI(e.Point);let{Point:t}=e,r=e.Fn===void 0?t.Fn:e.Fn,i=e.hash,n=e.hashToScalar===void 0?(q,W={DST:new Uint8Array})=>{let $=i(kt(W.DST,q));return r.create(r.isLE?qc($):bi($))}:e.hashToScalar,o=xa(e.H1!==void 0?e.H1:e.name+"rho"),a=xa(e.H2!==void 0?e.H2:e.name+"chal"),s=xa(e.H3!==void 0?e.H3:e.name+"nonce"),u=xa(e.H4!==void 0?e.H4:e.name+"msg"),c=xa(e.H5!==void 0?e.H5:e.name+"com"),l=xa(e.HDKG!==void 0?e.HDKG:e.name+"dkg"),m=xa(e.HID!==void 0?e.HID:e.name+"id"),w=q=>n(q,{DST:o}),E=q=>n(q,{DST:a}),P=q=>n(q,{DST:s}),M=q=>i(kt(u,q)),D=q=>i(kt(c,q)),L=q=>n(q,{DST:l}),U=q=>n(q,{DST:m}),K=(q=Ti)=>{let W=jc(q(c0(r.ORDER)),r.ORDER,r.isLE);return r.isLE?qc(W):bi(W)},N=q=>q.toBytes(),C=q=>{let W=t.fromBytes(q);return e.validatePoint&&e.validatePoint(W),W},F=(q,W)=>({identifier:q,hiding:N(t.BASE.multiply(r.fromBytes(W.hiding))),binding:N(t.BASE.multiply(r.fromBytes(W.binding)))}),H=e.adjustPoint===void 0?q=>q:e.adjustPoint,z=q=>{if(!r.isValid(q)||r.is0(q))throw new Error("Invalid identifier "+q);return q},G=q=>Ia(r.toBytes(z(q))),B=q=>{let W=z(r.fromBytes(Lc(q)));if(G(W)!==q)throw new Error("expected canonical identifier hex");return W},g={encode:(q,W)=>{let $=kt(N(q),r.toBytes(W));return e.adjustTx&&($=e.adjustTx.encode($)),$},decode:q=>{e.adjustTx&&(q=e.adjustTx.decode(q));let W=C(q.subarray(0,-r.BYTES)),$=r.fromBytes(q.subarray(-r.BYTES));return{R:W,z:$}}},O=(q=Ti)=>{let W=K(q);e.adjustScalar&&(W=e.adjustScalar(W));let $=t.BASE.multiply(W);return{scalar:W,point:$}},y="roots are unavailable in FROST polynomial mode",f={info:{G:r.ZERO,oddFactor:r.ZERO,powerOfTwo:0},roots(){throw new Error(y)},brp(){throw new Error(y)},inverse(){throw new Error(y)},omega(){throw new Error(y)},clear(){}},d=rA(r,f),_=(q,W)=>QI(t,q,W),x=(q,W)=>{if(!W.length)throw new Error("empty coefficients");return d.monomial.eval(W,q)},b=(q,W)=>{let $="invalid parameters";if(!q.some(le=>r.eql(le,W)))throw new Error($);let ee=new Set(q);if(ee.size!==q.length)throw new Error($);if(!ee.has(W))throw new Error($);let se=r.ONE,ue=r.ONE;for(let le of q)r.eql(le,W)||(se=r.mul(se,le),ue=r.mul(ue,r.sub(le,W)));return r.div(se,ue)},p=(q,W)=>{let $=d.monomial.basis(q,W.length);return _(W,$)},I=(q,W,$,ee=Ti)=>{mp(q);let se=W===void 0?K(ee):r.fromBytes(W);if(!$){$=[];for(let Pe=0;Pe<q.min-1;Pe++)$.push(K(ee))}if($.length!==q.min-1)throw new Error("wrong coefficients length");let ue=[se,...$],le=ue.map(Pe=>t.BASE.multiply(Pe));return{coefficients:ue,commitment:le,secret:se}},T={challenge:(q,W,$)=>L(kt(r.toBytes(q),N(W),N($))),compute(q,W,$,ee=Ti){if(W.length<1)throw new Error("coefficients should have at least one element");let{point:se,scalar:ue}=O(ee),le=$[0],Pe=this.challenge(q,le,se),ge=r.add(ue,r.mul(W[0],Pe));return g.encode(se,ge)},validate(q,W,$){if(W.length<1)throw new Error("commitment should have at least one element");let{R:ee,z:se}=g.decode($),ue=C(W[0]),le=this.challenge(q,ue,ee);if(!ee.equals(t.BASE.multiply(se).subtract(ue.multiply(le))))throw new Error("invalid proof of knowledge")}},S={challenge:(q,W,$)=>e.challenge?e.challenge(q,W,$):E(kt(N(q),N(W),$)),sign(q,W,$=Ti){let{point:ee,scalar:se}=O($),ue=t.BASE.multiply(W),le=this.challenge(ee,ue,q),Pe=r.add(se,r.mul(le,W));return[ee,Pe]},verify(q,W,$,ee){e.adjustPoint&&(ee=e.adjustPoint(ee)),e.adjustPoint&&(W=e.adjustPoint(W));let se=this.challenge(W,ee,q),ue=t.BASE.multiply($),le=ee.multiply(se),Pe=ue.subtract(le).subtract(W);return Pe.clearCofactor&&(Pe=Pe.clearCofactor()),t.ZERO.equals(Pe)}},R=(q,W,$)=>{if(!t.BASE.multiply($).equals(p(q,W)))throw new Error("invalid secret share")},Y={fromNumber(q){if(!Number.isSafeInteger(q))throw new Error("expected safe interger");return G(BigInt(q))},derive(q){if(typeof q!="string")throw new Error("wrong identifier string: "+q);return G(U(xa(q)))}},X=(q,W=Ti)=>P(kt(W(32),r.toBytes(q))),ie=(q,W,$)=>{let ee=W.map(ye=>[ye.identifier,B(ye.identifier),C(ye.hiding),C(ye.binding)]);ee.sort((ye,Re)=>ye[1]<Re[1]?-1:ye[1]>Re[1]?1:0);let se=[];for(let[ye,Re,be,_e]of ee)se.push(r.toBytes(Re),N(be),N(_e));let ue=D(kt(...se)),le=kt(N(q),M($),ue),Pe={};for(let[ye,Re]of ee)Pe[ye]=w(kt(le,r.toBytes(Re)));let ge=[],ve=[];for(let[ye,Re,be,_e]of ee){if(t.ZERO.equals(be)||t.ZERO.equals(_e))throw new Error("infinity commitment");ge.push(be,_e),ve.push(r.ONE,Pe[ye])}let sr=_(ge,ve);return{identifiers:ee.map(ye=>ye[1]),groupCommitment:sr,bindingFactors:Pe}},ce=(q,W,$,ee)=>{let se=H(C(q)),ue=B(ee),{identifiers:le,groupCommitment:Pe,bindingFactors:ge}=ie(se,W,$),ve=ge[ee],sr=b(le,ue),xe=S.challenge(Pe,se,$);return{lambda:sr,challenge:xe,bindingFactor:ve,groupCommitment:Pe}};Object.freeze(Y);let pe={Identifier:Y,DKG:Object.freeze({round1:(q,W,$,ee=Ti)=>{mp(W);let se=B(q),{coefficients:ue,commitment:le}=I(W,$,void 0,ee),Pe=T.compute(se,ue,le,ee),ge=le.map(N),ve={identifier:G(se),commitment:ge,proofOfKnowledge:Pe},sr={identifier:se,coefficients:ue,commitment:le.map(N),signers:{min:W.min,max:W.max},step:1};return{public:ve,secret:sr}},round2:(q,W)=>{if(W.length!==q.signers.max-1)throw new Error("wrong number of round1 packages");if(!q.coefficients||q.step===3)throw new Error("round3 package used in round2");let $={};for(let ee of W){if(ee.commitment.length!==q.signers.min)throw new Error("wrong number of commitments");let se=B(ee.identifier);if(se===q.identifier)throw new Error("duplicate id="+G(se));T.validate(se,ee.commitment,ee.proofOfKnowledge);for(let le of ee.commitment)C(le);if($[ee.identifier])throw new Error("Duplicate id="+se);let ue=r.toBytes(x(se,q.coefficients));$[ee.identifier]={identifier:G(q.identifier),signingShare:ue}}return q.step=2,$},round3:(q,W,$)=>{if(W.length!==q.signers.max-1)throw new Error("wrong length of round1 packages");if(!q.coefficients||q.step!==2)throw new Error("round2 package used in round3");if($.length!==W.length)throw new Error("wrong length of round2 packages");let ee={};for(let Re of W){if(!Re.identifier||!Re.commitment)throw new Error("wrong round1 share");ee[Re.identifier]={...Re}}for(let Re of $){if(!Re.identifier||!Re.signingShare)throw new Error("wrong round2 share");if(!ee[Re.identifier])throw new Error("round1 share for "+Re.identifier+" is missing");ee[Re.identifier].signingShare=Re.signingShare}if(Object.keys(ee).length!==W.length)throw new Error("mismatch identifiers between rounds");let se=r.ZERO;if(q.commitment.length!==q.signers.min)throw new Error("wrong commitments length");let ue=q.commitment.map(C),le=x(q.identifier,q.coefficients);R(q.identifier,ue,le);let Pe=ue.map(N),ge={[G(q.identifier)]:Pe};for(let Re in ee){let be=ee[Re];if(!be.signingShare||!be.commitment)throw new Error("mismatch identifiers");let _e=B(Re),Ji=r.fromBytes(be.signingShare),Be=be.commitment.map(C);R(q.identifier,Be,Ji),se=r.add(se,Ji);let ke=G(_e);if(ge[ke])throw new Error("duplicated id="+ke);ge[ke]=be.commitment}se=r.add(se,le);let ve=new Array(q.signers.min).fill(t.ZERO);for(let Re in ge){let be=ge[Re];if(be.length!==q.signers.min)throw new Error("wrong commitments length");for(let _e=0;_e<be.length;_e++)ve[_e]=ve[_e].add(C(be[_e]))}let sr=ve.map(N),xe={};for(let Re in ge)xe[Re]=N(p(B(Re),ve));let ye={public:{signers:{min:q.signers.min,max:q.signers.max},commitments:sr,verifyingShares:Object.fromEntries(Object.entries(xe).map(([Re,be])=>[Re,be.slice()]))},secret:{identifier:G(q.identifier),signingShare:r.toBytes(se)}};e.adjustDKG&&(ye=e.adjustDKG(ye));for(let Re=0;Re<q.coefficients.length;Re++)q.coefficients[Re]-=q.coefficients[Re];return delete q.coefficients,q.step=3,ye},clean(q){if(q.identifier-=q.identifier,q.coefficients)for(let W=0;W<q.coefficients.length;W++)q.coefficients[W]-=q.coefficients[W];q.step=3}}),trustedDealer(q,W,$,ee=Ti){if(mp(q),W===void 0){W=[];for(let ve=1;ve<=q.max;ve++)W.push(Y.fromNumber(ve))}else if(!Array.isArray(W)||W.length!==q.max)throw new Error("identifiers should be array of "+q.max);let se={};for(let ve of W){let sr=B(ve);if(ve in se)throw new Error("duplicated id="+ve);se[ve]=sr}let ue=I(q,$,void 0,ee),le=ue.commitment.map(N),Pe={},ge={};for(let ve of W){let sr=x(se[ve],ue.coefficients);ge[ve]=N(t.BASE.multiply(sr)),Pe[ve]={identifier:ve,signingShare:r.toBytes(sr)}}return{public:{signers:{min:q.min,max:q.max},commitments:le,verifyingShares:ge},secretShares:Pe}},validateSecret(q,W){let $=B(q.identifier),ee=W.commitments.map(C),se=r.fromBytes(q.signingShare);R($,ee,se)},commit(q,W=Ti){let $=r.fromBytes(q.signingShare),ee=X($,W),se=X($,W),ue={hiding:r.toBytes(ee),binding:r.toBytes(se)};return{nonces:ue,commitments:F(q.identifier,ue)}},signShare(q,W,$,ee,se){uA(W.signers,ee.length);let ue=r.fromBytes($.hiding),le=r.fromBytes($.binding);if(r.is0(ue)||r.is0(le))throw new Error("signing nonces already used");let Pe={identifier:q.identifier,hiding:N(t.BASE.multiply(ue)),binding:N(t.BASE.multiply(le))},ge=ee.find(Ce=>Ce.identifier===q.identifier);if(!ge)throw new Error("missing signer commitment");if(Ia(ge.hiding)!==Ia(Pe.hiding)||Ia(ge.binding)!==Ia(Pe.binding))throw new Error("incorrect signer commitment");e.adjustSecret&&(q=e.adjustSecret(q,W)),e.adjustPublic&&(W=e.adjustPublic(W));let ve=r.fromBytes(q.signingShare),{lambda:sr,challenge:xe,bindingFactor:ye,groupCommitment:Re}=ce(W.commitments[0],ee,se,q.identifier),be=e.adjustNonces?e.adjustNonces(Re,$):$,_e=e.adjustNonces?r.fromBytes(be.hiding):ue,Ji=e.adjustNonces?r.fromBytes(be.binding):le,Be=r.mul(r.mul(sr,ve),xe),ke=r.mul(Ji,ye),Ys=r.toBytes(r.add(r.add(_e,ke),Be));return $.hiding.fill(0),$.binding.fill(0),Ys},verifyShare(q,W,$,ee,se){e.adjustPublic&&(q=e.adjustPublic(q));let ue=W.find(Ji=>Ji.identifier===ee);if(!ue)throw new Error("cannot find identifier commitment");let le=C(q.verifyingShares[ee]),Pe=C(ue.hiding),ge=C(ue.binding),{lambda:ve,challenge:sr,bindingFactor:xe,groupCommitment:ye}=ce(q.commitments[0],W,$,ee),Re=Pe.add(ge.multiply(xe));e.adjustGroupCommitmentShare&&(Re=e.adjustGroupCommitmentShare(ye,Re));let be=t.BASE.multiply(r.fromBytes(se)),_e=Re.add(le.multiply(r.mul(sr,ve)));return be.equals(_e)},aggregate(q,W,$,ee){e.adjustPublic&&(q=e.adjustPublic(q));try{uA(q.signers,W.length)}catch{throw new Vc("aggregation failed",[])}let se=W.map(ge=>ge.identifier);if(se.length!==Object.keys(ee).length)throw new Vc("aggregation failed",[]);for(let ge of se)if(!(ge in ee)||!(ge in q.verifyingShares))throw new Vc("aggregation failed",[]);let ue=C(q.commitments[0]),{groupCommitment:le}=ie(ue,W,$),Pe=r.ZERO;for(let ge of se)Pe=r.add(Pe,r.fromBytes(ee[ge]));if(!S.verify($,le,Pe,ue)){let ge=[];for(let ve of se)this.verifyShare(q,W,$,ve,ee[ve])||ge.push(ve);throw new Vc("aggregation failed",ge)}return g.encode(le,Pe)},sign(q,W){let $=r.fromBytes(W);e.adjustScalar&&($=e.adjustScalar($));let[ee,se]=S.sign(q,$);return g.encode(ee,se)},verify(q,W,$){let ee=e.parsePublicKey?e.parsePublicKey($):C($),{R:se,z:ue}=g.decode(q);return S.verify(W,se,ue,ee)},combineSecret(q,W){if(mp(W),!Array.isArray(q)||q.length<W.min)throw new Error("wrong secret shares array");let $=[],ee={};for(let le of q){let Pe=B(le.identifier),ge=G(Pe);if(ee[ge])throw new Error("duplicated id="+ge);ee[ge]=!0,$.push([Pe,r.fromBytes(le.signingShare)])}let se=$.map(([le])=>le),ue=r.ZERO;for(let[le,Pe]of $)ue=r.add(ue,r.mul(Pe,b(se,le)));return r.toBytes(ue)},utils:Object.freeze({Fn:r,randomScalar:(q=Ti)=>r.toBytes(O(q).scalar),generateSecretPolynomial:(q,W,$,ee)=>{let se=I(q,W,$,ee);return{...se,commitment:se.commitment.map(N)}}})};return Object.freeze(pe)}var mp,uA,Vc,fA=Xr(()=>{v();ps();Ju();vp();iA();zc();mp=e=>{if(!Number.isSafeInteger(e.min)||!Number.isSafeInteger(e.max))throw new Error("Wrong signers info: min="+e.min+" max="+e.max);if(e.min<2||e.max<2||e.min>e.max)throw new Error("Wrong signers info: min="+e.min+" max="+e.max)},uA=(e,t)=>{if(t<e.min||t>e.max)throw new Error("Wrong number of commitments="+t)},Vc=class extends Error{constructor(r,i){super(r);Z(this,"cheaters");this.cheaters=i}}});var cy={};X1(cy,{_HMAC:()=>h0,hmac:()=>fy});var h0,fy,yp=Xr(()=>{v();ps();h0=class{constructor(t,r){Z(this,"oHash");Z(this,"iHash");Z(this,"blockLen");Z(this,"outputLen");Z(this,"canXOF",!1);Z(this,"finished",!1);Z(this,"destroyed",!1);if(Y2(t),Eo(r,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=t.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),Sa(n)}update(t){return Cc(this),this.iHash.update(t),this}digestInto(t){Cc(this),$2(t,this),this.finished=!0;let r=t.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:i,finished:n,destroyed:o,blockLen:a,outputLen:s}=this;return t=t,t.finished=n,t.destroyed=o,t.blockLen=a,t.outputLen=s,t.oHash=r._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},fy=(()=>{let e=((t,r,i)=>new h0(t,r).update(i).digest());return e.create=(t,r)=>new h0(t,r),e})()});function B$(e,t,r){Jm("scalar",e,pn,r);let[[i,n],[o,a]]=t,s=cA(a*e,r),u=cA(-n*e,r),c=e-s*i-u*o,l=-s*n-u*a,m=c<pn,w=l<pn;m&&(c=-c),w&&(l=-l);let E=Fc(Math.ceil(Xu(r)/2))+Kr;if(c<pn||c>=E||l<pn||l>=E)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:m,k1:c,k2neg:w,k2:l}}function hy(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ly(e,t){dn(e);let r={};for(let i of Object.keys(t))r[i]=e[i]===void 0?t[i]:e[i];return $u(r.lowS,"lowS"),$u(r.prehash,"prehash"),r.format!==void 0&&hy(r.format),r}function lA(e,t={}){let r=eA("weierstrass",e,t),i=r.Fp,n=r.Fn,o=r.CURVE,{h:a,n:s}=o;dn(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:u,allowInfinityPoint:c}=t;if(u&&(!i.is0(o.a)||typeof u.beta!="bigint"||!Array.isArray(u.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let l=pA(i,n);function m(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function w(O,y,f){if(c&&y.is0())return Uint8Array.of(0);let{x:d,y:_}=y.toAffine(),x=i.toBytes(d);if($u(f,"isCompressed"),f){m();let b=!i.isOdd(_);return kt(hA(b),x)}else return kt(Uint8Array.of(4),x,i.toBytes(_))}function E(O){qt(O,void 0,"Point");let{publicKey:y,publicKeyUncompressed:f}=l,d=O.length,_=O[0],x=O.subarray(1);if(c&&d===1&&_===0)return{x:i.ZERO,y:i.ZERO};if(d===y&&(_===2||_===3)){let b=i.fromBytes(x);if(!i.isValid(b))throw new Error("bad point: is not on curve, wrong x");let p=D(b),I;try{I=i.sqrt(p)}catch(R){let Y=R instanceof Error?": "+R.message:"";throw new Error("bad point: is not on curve, sqrt error"+Y)}m();let T=i.isOdd(I);return(_&1)===1!==T&&(I=i.neg(I)),{x:b,y:I}}else if(d===f&&_===4){let b=i.BYTES,p=i.fromBytes(x.subarray(0,b)),I=i.fromBytes(x.subarray(b,b*2));if(!L(p,I))throw new Error("bad point: is not on curve");return{x:p,y:I}}else throw new Error(`bad point: got length ${d}, expected compressed=${y} or uncompressed=${f}`)}let P=t.toBytes===void 0?w:t.toBytes,M=t.fromBytes===void 0?E:t.fromBytes;function D(O){let y=i.sqr(O),f=i.mul(y,O);return i.add(i.add(f,i.mul(O,o.a)),o.b)}function L(O,y){let f=i.sqr(y),d=D(O);return i.eql(f,d)}if(!L(o.Gx,o.Gy))throw new Error("bad curve params: generator point");let U=i.mul(i.pow(o.a,Gc),py),K=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(U,K)))throw new Error("bad curve params: a or b");function N(O,y,f=!1){if(!i.isValid(y)||f&&i.is0(y))throw new Error(`bad point coordinate ${O}`);return y}function C(O){if(!(O instanceof z))throw new Error("Weierstrass Point expected")}function F(O){if(!u||!u.basises)throw new Error("no endo");return B$(O,u.basises,n.ORDER)}function H(O,y,f,d,_){return f=new z(i.mul(f.X,O),f.Y,f.Z),y=l0(d,y),f=l0(_,f),y.add(f)}let g=class g{constructor(y,f,d){Z(this,"X");Z(this,"Y");Z(this,"Z");this.X=N("x",y),this.Y=N("y",f,!0),this.Z=N("z",d),Object.freeze(this)}static CURVE(){return o}static fromAffine(y){let{x:f,y:d}=y||{};if(!y||!i.isValid(f)||!i.isValid(d))throw new Error("invalid affine point");if(y instanceof g)throw new Error("projective point not allowed");return i.is0(f)&&i.is0(d)?g.ZERO:new g(f,d,i.ONE)}static fromBytes(y){let f=g.fromAffine(M(qt(y,void 0,"point")));return f.assertValidity(),f}static fromHex(y){return g.fromBytes(Lc(y))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(y=8,f=!0){return B.createCache(this,y),f||this.multiply(Gc),this}assertValidity(){let y=this;if(y.is0()){if(t.allowInfinityPoint&&i.is0(y.X)&&i.eql(y.Y,i.ONE)&&i.is0(y.Z))return;throw new Error("bad point: ZERO")}let{x:f,y:d}=y.toAffine();if(!i.isValid(f)||!i.isValid(d))throw new Error("bad point: x or y not field elements");if(!L(f,d))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(y)}equals(y){C(y);let{X:f,Y:d,Z:_}=this,{X:x,Y:b,Z:p}=y,I=i.eql(i.mul(f,p),i.mul(x,_)),T=i.eql(i.mul(d,p),i.mul(b,_));return I&&T}negate(){return new g(this.X,i.neg(this.Y),this.Z)}double(){let{a:y,b:f}=o,d=i.mul(f,Gc),{X:_,Y:x,Z:b}=this,p=i.ZERO,I=i.ZERO,T=i.ZERO,S=i.mul(_,_),R=i.mul(x,x),Y=i.mul(b,b),X=i.mul(_,x);return X=i.add(X,X),T=i.mul(_,b),T=i.add(T,T),p=i.mul(y,T),I=i.mul(d,Y),I=i.add(p,I),p=i.sub(R,I),I=i.add(R,I),I=i.mul(p,I),p=i.mul(X,p),T=i.mul(d,T),Y=i.mul(y,Y),X=i.sub(S,Y),X=i.mul(y,X),X=i.add(X,T),T=i.add(S,S),S=i.add(T,S),S=i.add(S,Y),S=i.mul(S,X),I=i.add(I,S),Y=i.mul(x,b),Y=i.add(Y,Y),S=i.mul(Y,X),p=i.sub(p,S),T=i.mul(Y,R),T=i.add(T,T),T=i.add(T,T),new g(p,I,T)}add(y){C(y);let{X:f,Y:d,Z:_}=this,{X:x,Y:b,Z:p}=y,I=i.ZERO,T=i.ZERO,S=i.ZERO,R=o.a,Y=i.mul(o.b,Gc),X=i.mul(f,x),ie=i.mul(d,b),ce=i.mul(_,p),pe=i.add(f,d),q=i.add(x,b);pe=i.mul(pe,q),q=i.add(X,ie),pe=i.sub(pe,q),q=i.add(f,_);let W=i.add(x,p);return q=i.mul(q,W),W=i.add(X,ce),q=i.sub(q,W),W=i.add(d,_),I=i.add(b,p),W=i.mul(W,I),I=i.add(ie,ce),W=i.sub(W,I),S=i.mul(R,q),I=i.mul(Y,ce),S=i.add(I,S),I=i.sub(ie,S),S=i.add(ie,S),T=i.mul(I,S),ie=i.add(X,X),ie=i.add(ie,X),ce=i.mul(R,ce),q=i.mul(Y,q),ie=i.add(ie,ce),ce=i.sub(X,ce),ce=i.mul(R,ce),q=i.add(q,ce),X=i.mul(ie,q),T=i.add(T,X),X=i.mul(W,q),I=i.mul(pe,I),I=i.sub(I,X),X=i.mul(pe,ie),S=i.mul(W,S),S=i.add(S,X),new g(I,T,S)}subtract(y){return C(y),this.add(y.negate())}is0(){return this.equals(g.ZERO)}multiply(y){let{endo:f}=t;if(!n.isValidNot0(y))throw new RangeError("invalid scalar: out of range");let d,_,x=b=>B.cached(this,b,p=>oy(g,p));if(f){let{k1neg:b,k1:p,k2neg:I,k2:T}=F(y),{p:S,f:R}=x(p),{p:Y,f:X}=x(T);_=R.add(X),d=H(f.beta,S,Y,b,I)}else{let{p:b,f:p}=x(y);d=b,_=p}return oy(g,[d,_])[0]}multiplyUnsafe(y){let{endo:f}=t,d=this,_=y;if(!n.isValid(_))throw new RangeError("invalid scalar: out of range");if(_===pn||d.is0())return g.ZERO;if(_===Kr)return d;if(B.hasCache(this))return this.multiply(_);if(f){let{k1neg:x,k1:b,k2neg:p,k2:I}=F(_),{p1:T,p2:S}=JI(g,d,b,I);return H(f.beta,T,S,x,p)}else return B.unsafe(d,_)}toAffine(y){let f=this,d=y,{X:_,Y:x,Z:b}=f;if(i.eql(b,i.ONE))return{x:_,y:x};let p=f.is0();d==null&&(d=p?i.ONE:i.inv(b));let I=i.mul(_,d),T=i.mul(x,d),S=i.mul(b,d);if(p)return{x:i.ZERO,y:i.ZERO};if(!i.eql(S,i.ONE))throw new Error("invZ was invalid");return{x:I,y:T}}isTorsionFree(){let{isTorsionFree:y}=t;return a===Kr?!0:y?y(g,this):B.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:y}=t;return a===Kr?this:y?y(g,this):this.multiplyUnsafe(a)}isSmallOrder(){return a===Kr?this.is0():this.clearCofactor().is0()}toBytes(y=!0){return $u(y,"isCompressed"),this.assertValidity(),P(g,this,y)}toHex(y=!0){return Ia(this.toBytes(y))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};Z(g,"BASE",new g(o.Gx,o.Gy,i.ONE)),Z(g,"ZERO",new g(i.ZERO,i.ONE,i.ZERO)),Z(g,"Fp",i),Z(g,"Fn",n);let z=g,G=n.BITS,B=new pp(z,t.endo?Math.ceil(G/2):G);return G>=8&&z.BASE.precompute(8),Object.freeze(z.prototype),Object.freeze(z),z}function hA(e){return Uint8Array.of(e?2:3)}function M$(e,t){let r=ef(e),i=r.ORDER,n=pn;for(let M=i-Kr;M%Io===pn;M/=Io)n+=Kr;let o=n,a=Io<<o-Kr-Kr,s=a*Io,u=(i-Kr)/s,c=(u-Kr)/Io,l=s-Kr,m=a,w=r.pow(t,u),E=r.pow(t,(u+Kr)/Io),P=(M,D)=>{let L=w,U=r.pow(D,l),K=r.sqr(U);K=r.mul(K,D);let N=r.mul(M,K);N=r.pow(N,c),N=r.mul(N,U),U=r.mul(N,D),K=r.mul(N,M);let C=r.mul(K,U);N=r.pow(C,m);let F=r.eql(N,r.ONE);U=r.mul(K,E),N=r.mul(C,L),K=r.cmov(U,K,F),C=r.cmov(N,C,F);for(let H=o;H>Kr;H--){let z=H-Io;z=Io<<z-Kr;let G=r.pow(C,z),B=r.eql(G,r.ONE);U=r.mul(K,L),L=r.mul(L,L),G=r.mul(C,L),K=r.cmov(U,K,B),C=r.cmov(G,C,B)}return{isValid:!r.is0(D)&&(F||r.is0(M)),value:K}};if(r.ORDER%py===Gc){let M=(r.ORDER-Gc)/py,D=r.sqrt(r.neg(t));P=(L,U)=>{let K=r.sqr(U),N=r.mul(L,U);K=r.mul(K,N);let C=r.pow(K,M);C=r.mul(C,N);let F=r.mul(C,D),H=r.mul(r.sqr(C),U),z=r.eql(H,L),G=r.cmov(F,C,z);return{isValid:!r.is0(U)&&z,value:G}}}return P}function dA(e,t){let r=ef(e),{A:i,B:n,Z:o}=t;if(!r.isValidNot0(i)||!r.isValidNot0(n)||!r.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");if(r.eql(o,r.neg(r.ONE))||ty(r,o))throw new Error("mapToCurveSimpleSWU: invalid opts");let a=r.mul(n,r.inv(r.mul(o,i))),s=r.add(r.add(r.mul(r.sqr(a),a),r.mul(i,a)),n);if(!ty(r,s))throw new Error("mapToCurveSimpleSWU: invalid opts");let u=M$(r,o);if(!r.isOdd)throw new Error("Field does not have .isOdd()");return c=>{let l,m,w,E,P,M,D,L;l=r.sqr(c),l=r.mul(l,o),m=r.sqr(l),m=r.add(m,l),w=r.add(m,r.ONE),w=r.mul(w,n),E=r.cmov(o,r.neg(m),!r.eql(m,r.ZERO)),E=r.mul(E,i),m=r.sqr(w),M=r.sqr(E),P=r.mul(M,i),m=r.add(m,P),m=r.mul(m,w),M=r.mul(M,E),P=r.mul(M,n),m=r.add(m,P),D=r.mul(l,w);let{isValid:U,value:K}=u(m,M);L=r.mul(l,c),L=r.mul(L,K),D=r.cmov(D,w,U),L=r.cmov(L,K,U);let N=r.isOdd(c)===r.isOdd(L);L=r.cmov(r.neg(L),L,N);let C=tf(r,[E],!0)[0];return D=r.mul(D,C),{x:D,y:L}}}function pA(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function N$(e,t={}){let{Fn:r}=e,i=t.randomBytes===void 0?Ti:t.randomBytes,n=Object.assign(pA(e.Fp,r),{seed:Math.max(c0(r.ORDER),16)});function o(E){try{let P=r.fromBytes(E);return r.isValidNot0(P)}catch{return!1}}function a(E,P){let{publicKey:M,publicKeyUncompressed:D}=n;try{let L=E.length;return P===!0&&L!==M||P===!1&&L!==D?!1:!!e.fromBytes(E)}catch{return!1}}function s(E){return E=E===void 0?i(n.seed):E,jc(qt(E,n.seed,"seed"),r.ORDER)}function u(E,P=!0){return e.BASE.multiply(r.fromBytes(E)).toBytes(P)}function c(E){let{secretKey:P,publicKey:M,publicKeyUncompressed:D}=n,L=r._lengths;if(!Yu(E))return;let U=qt(E,void 0,"key").length,K=U===M||U===D,N=U===P||!!L?.includes(U);if(!(K&&N))return K}function l(E,P,M=!0){if(c(E)===!0)throw new Error("first arg must be private key");if(c(P)===!1)throw new Error("second arg must be public key");let D=r.fromBytes(E);return e.fromBytes(P).multiply(D).toBytes(M)}let m={isValidSecretKey:o,isValidPublicKey:a,randomSecretKey:s},w=gp(s,u);return Object.freeze(m),Object.freeze(n),Object.freeze({getPublicKey:u,getSharedSecret:l,keygen:w,Point:e,utils:m,lengths:n})}function gA(e,t,r={}){let i=t;Y2(i),dn(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?Ti:r.randomBytes,o=r.hmac===void 0?(d,_)=>fy(i,d,_):r.hmac,{Fp:a,Fn:s}=e,{ORDER:u,BITS:c}=s,{keygen:l,getPublicKey:m,getSharedSecret:w,utils:E,lengths:P}=N$(e,r),M={prehash:!0,lowS:typeof r.lowS=="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},D=u*Io+Kr<a.ORDER;function L(d){let _=u>>Kr;return d>_}function U(d,_){if(!s.isValidNot0(_))throw new Error(`invalid signature ${d}: out of range 1..Point.Fn.ORDER`);return _}function K(){if(D)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function N(d,_){hy(_);let x=P.signature,b=_==="compact"?x:_==="recovered"?x+1:void 0;return qt(d,b)}class C{constructor(_,x,b){Z(this,"r");Z(this,"s");Z(this,"recovery");if(this.r=U("r",_),this.s=U("s",x),b!=null){if(K(),![0,1,2,3].includes(b))throw new Error("invalid recovery id");this.recovery=b}Object.freeze(this)}static fromBytes(_,x=M.format){N(_,x);let b;if(x==="der"){let{r:S,s:R}=Hn.toSig(qt(_));return new C(S,R)}x==="recovered"&&(b=_[0],x="compact",_=_.subarray(1));let p=P.signature/2,I=_.subarray(0,p),T=_.subarray(p,p*2);return new C(s.fromBytes(I),s.fromBytes(T),b)}static fromHex(_,x){return this.fromBytes(Lc(_),x)}assertRecovery(){let{recovery:_}=this;if(_==null)throw new Error("invalid recovery id: must be present");return _}addRecoveryBit(_){return new C(this.r,this.s,_)}recoverPublicKey(_){let{r:x,s:b}=this,p=this.assertRecovery(),I=p===2||p===3?x+u:x;if(!a.isValid(I))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let T=a.toBytes(I),S=e.fromBytes(kt(hA((p&1)===0),T)),R=s.inv(I),Y=H(qt(_,void 0,"msgHash")),X=s.create(-Y*R),ie=s.create(b*R),ce=e.BASE.multiplyUnsafe(X).add(S.multiplyUnsafe(ie));if(ce.is0())throw new Error("invalid recovery: point at infinify");return ce.assertValidity(),ce}hasHighS(){return L(this.s)}toBytes(_=M.format){if(hy(_),_==="der")return Lc(Hn.hexFromSig(this));let{r:x,s:b}=this,p=s.toBytes(x),I=s.toBytes(b);return _==="recovered"?(K(),kt(Uint8Array.of(this.assertRecovery()),p,I)):kt(p,I)}toHex(_){return Ia(this.toBytes(_))}}Object.freeze(C.prototype),Object.freeze(C);let F=r.bits2int===void 0?function(_){if(_.length>8192)throw new Error("input is too large");let x=bi(_),b=_.length*8-c;return b>0?x>>BigInt(b):x}:r.bits2int,H=r.bits2int_modN===void 0?function(_){return s.create(F(_))}:r.bits2int_modN,z=Fc(c);function G(d){return Jm("num < 2^"+c,d,pn,z),s.toBytes(d)}function B(d,_){return qt(d,void 0,"message"),_?qt(i(d),void 0,"prehashed message"):d}function g(d,_,x){let{lowS:b,prehash:p,extraEntropy:I}=ly(x,M);d=B(d,p);let T=H(d),S=s.fromBytes(_);if(!s.isValidNot0(S))throw new Error("invalid private key");let R=[G(S),G(T)];if(I!=null&&I!==!1){let ce=I===!0?n(P.secretKey):I;R.push(qt(ce,void 0,"extraEntropy"))}let Y=kt(...R),X=T;function ie(ce){let pe=F(ce);if(!s.isValidNot0(pe))return;let q=s.inv(pe),W=e.BASE.multiply(pe).toAffine(),$=s.create(W.x);if($===pn)return;let ee=s.create(q*s.create(X+$*S));if(ee===pn)return;let se=(W.x===$?0:2)|Number(W.y&Kr),ue=ee;return b&&L(ee)&&(ue=s.neg(ee),se^=1),new C($,ue,D?void 0:se)}return{seed:Y,k2sig:ie}}function O(d,_,x={}){let{seed:b,k2sig:p}=g(d,_,x);return CI(i.outputLen,s.BYTES,o)(b,p).toBytes(x.format)}function y(d,_,x,b={}){let{lowS:p,prehash:I,format:T}=ly(b,M);if(x=qt(x,void 0,"publicKey"),_=B(_,I),!Yu(d)){let S=d instanceof C?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+S)}N(d,T);try{let S=C.fromBytes(d,T),R=e.fromBytes(x);if(p&&S.hasHighS())return!1;let{r:Y,s:X}=S,ie=H(_),ce=s.inv(X),pe=s.create(ie*ce),q=s.create(Y*ce),W=e.BASE.multiplyUnsafe(pe).add(R.multiplyUnsafe(q));return W.is0()?!1:s.create(W.x)===Y}catch{return!1}}function f(d,_,x={}){let{prehash:b}=ly(x,M);return _=B(_,b),C.fromBytes(d,"recovered").recoverPublicKey(_).toBytes()}return Object.freeze({keygen:l,getPublicKey:m,getSharedSecret:w,utils:E,lengths:P,Point:e,sign:O,verify:y,recoverPublicKey:f,Signature:C,hash:i})}var cA,dy,Hn,pn,Kr,Io,Gc,py,vA=Xr(()=>{v();yp();ps();Ju();vp();zc();cA=(e,t)=>(e+(e>=0?t:-t)/Io)/t;dy=class extends Error{constructor(t=""){super(t)}},Hn={Err:dy,_tlv:{encode:(e,t)=>{let{Err:r}=Hn;if(hn(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if(typeof t!="string")throw new TypeError('"data" expected string, got type='+typeof t);if(t.length&1)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=f0(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?f0(n.length/2|128):"";return f0(e)+o+n+t},decode(e,t){let{Err:r}=Hn;t=qt(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[i++],o=!!(n&128),a=0;if(!o)a=n;else{let u=n&127;if(!u)throw new r("tlv.decode(long): indefinite length not supported");if(u>4)throw new r("tlv.decode(long): byte length is too big");let c=t.subarray(i,i+u);if(c.length!==u)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of c)a=a<<8|l;if(i+=u,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){let{Err:t}=Hn;if(cp(e),e<pn)throw new t("integer: negative integers are not allowed");let r=f0(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Hn;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bi(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=Hn,n=qt(e,void 0,"signature"),{v:o,l:a}=i.decode(48,n);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:s,l:u}=i.decode(2,o),{v:c,l}=i.decode(2,u);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(s),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=Hn,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s)),o=i+n;return t.encode(48,o)}};Object.freeze(Hn._tlv);Object.freeze(Hn._int);Object.freeze(Hn);pn=BigInt(0),Kr=BigInt(1),Io=BigInt(2),Gc=BigInt(3),py=BigInt(4)});var p0={};X1(p0,{__TEST:()=>U$,schnorr:()=>F$,schnorr_FROST:()=>Z$,secp256k1:()=>L$,secp256k1_FROST:()=>z$,secp256k1_hasher:()=>my});function D$(e){let t=bp.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,m=Ui(l,r,t)*l%t,w=Ui(m,r,t)*l%t,E=Ui(w,gy,t)*c%t,P=Ui(E,n,t)*E%t,M=Ui(P,o,t)*P%t,D=Ui(M,s,t)*M%t,L=Ui(D,u,t)*D%t,U=Ui(L,s,t)*M%t,K=Ui(U,r,t)*l%t,N=Ui(K,a,t)*P%t,C=Ui(N,i,t)*c%t,F=Ui(C,gy,t);if(!Aa.eql(Aa.sqr(F),e))throw new Error("Cannot find square root");return F}function d0(e,...t){let r=mA[e];if(r===void 0){let i=ys(Uc(e));r=kt(i,i),mA[e]=r}return ys(kt(r,...t))}function wA(e){let{Fn:t,BASE:r}=Ut,i=t.fromBytes(e),n=r.multiply(i);return{scalar:Ao(n.y)?i:t.neg(i),bytes:of(n)}}function _p(e){let t=Aa;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x \u2265 p");let r=t.create(e*e),i=t.create(r*e+BigInt(7)),n=t.sqrt(i);Ao(n)||(n=t.neg(n));let o=Ut.fromAffine({x:e,y:n});return o.assertValidity(),o}function vy(...e){return Ut.Fn.create(Zc(d0("BIP0340/challenge",...e)))}function yA(e){return wA(e).bytes}function q$(e,t,r=o0(32)){let{Fn:i,BASE:n}=Ut,o=qt(e,void 0,"message"),{bytes:a,scalar:s}=wA(t),u=qt(r,32,"auxRand"),c=i.toBytes(s^Zc(d0("BIP0340/aux",u))),l=d0("BIP0340/nonce",c,a,o),m=i.create(Zc(l));if(m===0n)throw new Error("sign failed: k is zero");let w=n.multiply(m),E=Ao(w.y)?m:i.neg(m),P=of(w),M=vy(P,a,o),D=new Uint8Array(64);if(D.set(P,0),D.set(i.toBytes(i.create(E+M*s)),32),!SA(D,o,a))throw new Error("sign: Invalid signature produced");return D}function SA(e,t,r){let{Fp:i,Fn:n,BASE:o}=Ut,a=qt(e,64,"signature"),s=qt(t,void 0,"message"),u=qt(r,32,"publicKey");try{let c=_p(Zc(u)),l=Zc(a.subarray(0,32));if(!i.isValidNot0(l))return!1;let m=Zc(a.subarray(32,64));if(!n.isValidNot0(m))return!1;let w=vy(n.toBytes(l),of(c),s),E=o.multiplyUnsafe(m).add(c.multiplyUnsafe(n.neg(w))),{x:P,y:M}=E.toAffine();return!(E.is0()||!Ao(M)||P!==l)}catch{return!1}}function xA(e,t){if(t===void 0)return _A;let r=of(e),i=bi(d0("TapTweak",r,t));if(!Ut.Fn.isValid(i))throw new Error("invalid TapTweak hash");return i}function yy(e){let t=Ut.fromBytes(e.commitments[0]);return Ao(t.y)?e:{signers:{min:e.signers.min,max:e.signers.max},commitments:e.commitments.map(r=>Ut.fromBytes(r).negate().toBytes()),verifyingShares:Object.fromEntries(Object.entries(e.verifyingShares).map(([r,i])=>[r,Ut.fromBytes(i).negate().toBytes()]))}}function EA(e,t){let r=Ut.fromBytes(t.commitments[0]);if(Ao(r.y))return e;let i=Ut.Fn;return{...e,signingShare:i.toBytes(i.neg(i.fromBytes(e.signingShare)))}}function K$(e,t){if(Ao(e.y))return t;let r=Ut.Fn;return{binding:r.toBytes(r.neg(r.fromBytes(t.binding))),hiding:r.toBytes(r.neg(r.fromBytes(t.hiding)))}}function V$(e,t,r){let i=Ut.Fn,n=EA(e,t),o=yy(t),a=xA(Ut.fromBytes(o.commitments[0]),r),s=i.toBytes(i.add(i.fromBytes(n.signingShare),a));return{identifier:n.identifier,signingShare:s}}function G$(e,t){let r=yy(e),i=xA(Ut.fromBytes(r.commitments[0]),t),n=Ut.BASE.multiply(i),o=r.commitments.map((s,u)=>(u===0?Ut.fromBytes(s).add(n):Ut.fromBytes(s)).toBytes()),a={};for(let s in r.verifyingShares)a[s]=Ut.fromBytes(r.verifyingShares[s]).add(n).toBytes();return{signers:{min:r.signers.min,max:r.signers.max},commitments:o,verifyingShares:a}}var bp,C$,_A,gy,Aa,Ut,L$,mA,of,Ao,Zc,U$,F$,H$,bA,j$,my,z$,Z$,g0=Xr(()=>{v();sp();ps();vp();fA();sA();zc();vA();Ju();bp={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},C$={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},_A=BigInt(0),gy=BigInt(2);Aa=Hc(bp.p,{sqrt:D$}),Ut=lA(bp,{Fp:Aa,endo:C$}),L$=gA(Ut,ys),mA={};of=e=>e.toBytes(!0).slice(1),Ao=e=>e%gy===_A;Zc=bi;U$=Object.freeze({lift_x:_p}),F$=(()=>{let r=i=>(i=i===void 0?o0(48):i,jc(i,bp.n));return Object.freeze({keygen:gp(r,yA),getPublicKey:yA,sign:q$,verify:SA,Point:Ut,utils:Object.freeze({randomSecretKey:r,taggedHash:d0,lift_x:_p,pointToBytes:of}),lengths:Object.freeze({secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48})})})(),H$=oA(Aa,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),j$=()=>bA||(bA=dA(Aa,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Aa.create(BigInt("-11"))})),my=aA(Ut,e=>{let{x:t,y:r}=j$()(Aa.create(e[0]));return H$(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Aa.ORDER,m:1,k:128,expand:"xmd",hash:ys}),z$=uy({name:"FROST-secp256k1-SHA256-v1",Point:Ut,hashToScalar:my.hashToScalar,hash:ys});Z$=uy({name:"FROST-secp256k1-SHA256-TR-v1",Point:Ut,hashToScalar:my.hashToScalar,hash:ys,parsePublicKey(e){if(e.length===32)return _p(bi(e));if(e.length===33)return Ut.fromBytes(e);throw new Error(`expected x-only or compressed public key, got length=${e.length}`)},adjustScalar(e){let t=Ut.BASE.multiply(e);return Ao(t.y)?e:Ut.Fn.neg(e)},adjustPoint:e=>Ao(e.y)?e:e.negate(),challenge(e,t,r){return vy(of(e),of(t),r)},adjustNonces:K$,adjustGroupCommitmentShare:(e,t)=>Ao(e.y)?t:t.negate(),adjustPublic:yy,adjustSecret:EA,adjustTx:{encode:e=>e.subarray(1),decode:e=>kt(Uint8Array.of(2),e)},adjustDKG:e=>{let t=new Uint8Array(0);return{public:G$(e.public,t),secret:V$(e.secret,e.public,t)}}})});var gn=k((Kde,PA)=>{"use strict";v();var OA=fr(),{secp256k1:W$}=(g0(),lo(p0)),m0=W$.Point,wp=m0.Fn.ORDER;function Y$(e){return BigInt("0x"+(e.toString(16)||"0"))}function by(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new OA(t,16)}function Sp(e){if(e==null)throw new Error("Invalid Point");if(typeof e=="bigint")return e;if(typeof e=="number")return BigInt(e);if(typeof e=="string")return BigInt(e.indexOf("0x")===0?e:"0x"+e);if(typeof e.toString=="function")return Y$(e);throw new Error("Invalid Point")}function v0(e){var t=Object.create(Ft.prototype);return t._p=e,t}function IA(e,t){var r=Sp(t).toString(16).padStart(64,"0");return m0.fromHex((e?"03":"02")+r)}function AA(e,t){var r;try{r=IA((t&1n)===1n,e)}catch{throw new Error("Point does not lie on the curve")}if(r.toAffine().y!==t)throw new Error("Invalid y value for curve.")}function Ft(e,t,r){if(!(this instanceof Ft))return new Ft(e,t,r);var i,n;try{i=Sp(e),n=Sp(t)}catch{throw new Error("Invalid Point")}AA(i,n);try{this._p=m0.fromAffine({x:i,y:n})}catch{throw new Error("Invalid Point")}return this}Ft.fromX=function(t,r){try{var i=v0(IA(t,r))}catch{throw new Error("Invalid X")}return i.validate(),i};Ft.getG=function(){return v0(m0.BASE)};Ft.getN=function(){return by(wp)};Ft.prototype.getX=function(){return by(this._p.toAffine().x)};Ft.prototype.getY=function(){return by(this._p.toAffine().y)};Object.defineProperty(Ft.prototype,"x",{configurable:!0,enumerable:!0,get:function(){return this.getX()}});Object.defineProperty(Ft.prototype,"y",{configurable:!0,enumerable:!0,get:function(){return this.getY()}});Ft.prototype.mul=function(t){var r=(Sp(t)%wp+wp)%wp;return r===0n||this._p.is0()?v0(m0.ZERO):v0(this._p.multiply(r))};Ft.prototype.add=function(t){return v0(this._p.add(t._p))};Ft.prototype.mulAdd=function(t,r,i){return this.mul(t).add(r.mul(i))};Ft.prototype.eq=function(t){return this._p.equals(t._p)};Ft.prototype.isInfinity=function(){return this._p.is0()};Ft.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var t=this._p.toAffine();return AA(t.x,t.y),this};Ft.pointToCompressed=function(t){var r=t.getX().toBuffer({size:32}),i=t.getY().toBuffer({size:32}),n,o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])};Ft.pointFromCompressed=function(e){if(e.length!==33)throw new Error("invalid buffer length");var t=e[0],r;if(t===3)r=!0;else if(t===2)r=!1;else throw new Error("invalid value of compressed prefix");var i=OA.fromBuffer(e.slice(1,33));return Ft.fromX(r,i)};Ft.prototype.toBuffer=function(){return Ft.pointToCompressed(this)};Ft.prototype.toHex=function(){return this.toBuffer().toString("hex")};Ft.fromBuffer=function(e){return Ft.pointFromCompressed(e)};Ft.fromHex=function(e){return Ft.fromBuffer(h.Buffer.from(e,"hex"))};PA.exports=Ft});var pi=k((Gde,RA)=>{"use strict";v();var kA=xt(),$$=Bt(),TA=function(t){return kA.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};RA.exports={isValidJSON:function(t){var r;if(!kA.isString(t))return!1;try{r=JSON.parse(t)}catch{return!1}return typeof r=="object"},isHexa:TA,isHexaString:TA,defineImmutable:function(t,r){return Object.keys(r).forEach(function(i){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,value:r[i]})}),t},isNaturalNumber:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&t>=0},integerAsBuffer:function(t){$$.checkArgumentType(t,"number","integer");let r=h.Buffer.allocUnsafe(4);return r.writeUInt32BE(t,0),r}}});var Vr=k((Wde,BA)=>{"use strict";v();var af=fr(),X$=xt(),vn=Bt(),J$=pi(),mt=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof af)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};mt.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=typeof e.i<"u"?e.i:this.i,this.compressed=typeof e.compressed<"u"?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this};mt.fromCompact=function(e){vn.checkArgument(h.Buffer.isBuffer(e),"Argument is expected to be a Buffer");var t=new mt,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i=i+4);var n=e.slice(1,33),o=e.slice(33,65);return vn.checkArgument(i===0||i===1||i===2||i===3,new Error("i must be 0, 1, 2, or 3")),vn.checkArgument(n.length===32,new Error("r must be 32 bytes")),vn.checkArgument(o.length===32,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=af.fromBuffer(n),t.s=af.fromBuffer(o),t};mt.fromDER=mt.fromBuffer=function(e,t){var r=mt.parseDER(e,t),i=new mt;return i.r=r.r,i.s=r.s,i};mt.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=mt.fromDER(r,!1);return i.nhashtype=t,i};mt.fromString=function(e){var t=h.Buffer.from(e,"hex");return mt.fromDER(t)};mt.parseDER=function(e,t){vn.checkArgument(h.Buffer.isBuffer(e),new Error("DER formatted signature should be a buffer")),X$.isUndefined(t)&&(t=!0);var r=e[0];vn.checkArgument(r===48,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;vn.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i<n?i:n;var o=e[2];vn.checkArgument(o===2,new Error("Integer byte for r should be 0x02"));var a=e[3],s=e.slice(4,4+a),u=af.fromBuffer(s),c=e[4]===0;vn.checkArgument(a===s.length,new Error("Length of r incorrect"));var l=e[4+a+0];vn.checkArgument(l===2,new Error("Integer byte for s should be 0x02"));var m=e[4+a+1],w=e.slice(4+a+2,4+a+2+m),E=af.fromBuffer(w),P=e[4+a+2+2]===0;vn.checkArgument(m===w.length,new Error("Length of s incorrect"));var M=4+a+2+m;vn.checkArgument(i===M-2,new Error("Length of signature incorrect"));var D={header:r,length:i,rheader:o,rlength:a,rneg:c,rbuf:s,r:u,sheader:l,slength:m,sneg:P,sbuf:w,s:E};return D};mt.prototype.toCompact=function(e,t){if(e=typeof e=="number"?e:this.i,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;t===!1&&(r=r-4);var i=h.Buffer.from([r]),n=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return h.Buffer.concat([i,n,o])};mt.prototype.toBuffer=mt.prototype.toDER=function(){var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(e[0]&128),i=!!(t[0]&128),n=r?h.Buffer.concat([h.Buffer.from([0]),e]):e,o=i?h.Buffer.concat([h.Buffer.from([0]),t]):t,a=n.length,s=o.length,u=2+a+2+s,c=2,l=2,m=48,w=h.Buffer.concat([h.Buffer.from([m,u,c,a]),n,h.Buffer.from([l,s]),o]);return w};mt.prototype.toString=function(){var e=this.toDER();return e.toString("hex")};mt.isTxDER=function(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(e[2]!==2||t===0||i[0]&128||t>1&&i[0]===0&&!(i[1]&128))return!1;var n=e.slice(6+t);return!(e[6+t-2]!==2||r===0||n[0]&128||r>1&&n[0]===0&&!(n[1]&128))};mt.prototype.hasLowS=function(){return!(this.s.lt(new af(1))||this.s.gt(new af("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))};mt.prototype.hasDefinedHashtype=function(){if(!J$.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&31;return!(e<mt.SIGHASH_ALL||e>mt.SIGHASH_SINGLE)};mt.prototype.toTxFormat=function(){var e=this.toDER(),t=h.Buffer.alloc(1);return t.writeUInt8(this.nhashtype,0),h.Buffer.concat([e,t])};mt.SIGHASH_ALL=1;mt.SIGHASH_NONE=2;mt.SIGHASH_SINGLE=3;mt.SIGHASH_FORKID=64;mt.SIGHASH_ANYONECANPAY=128;mt.prototype.isCanonical=function(){var e=gn(),t=e.getN().shrn(1);return this.s.lte(t)};mt.prototype.toCanonical=function(){if(this.isCanonical())return new mt({r:this.r,s:this.s,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype});var e=gn(),t=e.getN(),r=t.sub(this.s);return new mt({r:this.r,s:r,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype})};mt.prototype.validate=function(){if(!this.r||!this.s)throw new Error("Signature missing r or s component");if(this.r.isZero())throw new Error("Signature r component is zero");if(this.s.isZero())throw new Error("Signature s component is zero");var e=gn(),t=e.getN();if(this.r.gte(t))throw new Error("Signature r component >= curve order");if(this.s.gte(t))throw new Error("Signature s component >= curve order");if(this.r.isNeg())throw new Error("Signature r component is negative");if(this.s.isNeg())throw new Error("Signature s component is negative");return!0};mt.prototype.isValid=function(){try{return this.validate(),!0}catch{return!1}};mt.prototype.applySecurityPatches=function(){var e=gn(),t=e.getN(),r=t.shrn(1);if(this.r.isZero()||this.s.isZero())throw new Error("Invalid signature: zero r or s");if(this.r.gte(t)||this.s.gte(t))throw new Error("Invalid signature: out of range");return this.s.gt(r)&&(this.s=t.sub(this.s)),this};BA.exports=mt});var jn=k(Ht=>{"use strict";v();var Q$=Rn(),eX=Ot();Ht.inherits=eX;function tX(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function rX(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=o&63|128):tX(e,n)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=o&63|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=o&63|128)}else for(n=0;n<e.length;n++)r[n]=e[n]|0;return r}Ht.toArray=rX;function iX(e){for(var t="",r=0;r<e.length;r++)t+=NA(e[r].toString(16));return t}Ht.toHex=iX;function MA(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Ht.htonl=MA;function nX(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];t==="little"&&(n=MA(n)),r+=CA(n.toString(16))}return r}Ht.toHex32=nX;function NA(e){return e.length===1?"0"+e:e}Ht.zero2=NA;function CA(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}Ht.zero8=CA;function oX(e,t,r,i){var n=r-t;Q$(n%4===0);for(var o=new Array(n/4),a=0,s=t;a<o.length;a++,s+=4){var u;i==="big"?u=e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:u=e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o}Ht.join32=oX;function aX(e,t){for(var r=new Array(e.length*4),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];t==="big"?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=o&255):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=o&255)}return r}Ht.split32=aX;function sX(e,t){return e>>>t|e<<32-t}Ht.rotr32=sX;function uX(e,t){return e<<t|e>>>32-t}Ht.rotl32=uX;function fX(e,t){return e+t>>>0}Ht.sum32=fX;function cX(e,t,r){return e+t+r>>>0}Ht.sum32_3=cX;function lX(e,t,r,i){return e+t+r+i>>>0}Ht.sum32_4=lX;function hX(e,t,r,i,n){return e+t+r+i+n>>>0}Ht.sum32_5=hX;function dX(e,t,r,i){var n=e[t],o=e[t+1],a=i+o>>>0,s=(a<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=a}Ht.sum64=dX;function pX(e,t,r,i){var n=t+i>>>0,o=(n<t?1:0)+e+r;return o>>>0}Ht.sum64_hi=pX;function gX(e,t,r,i){var n=t+i;return n>>>0}Ht.sum64_lo=gX;function vX(e,t,r,i,n,o,a,s){var u=0,c=t;c=c+i>>>0,u+=c<t?1:0,c=c+o>>>0,u+=c<o?1:0,c=c+s>>>0,u+=c<s?1:0;var l=e+r+n+a+u;return l>>>0}Ht.sum64_4_hi=vX;function mX(e,t,r,i,n,o,a,s){var u=t+i+o+s;return u>>>0}Ht.sum64_4_lo=mX;function yX(e,t,r,i,n,o,a,s,u,c){var l=0,m=t;m=m+i>>>0,l+=m<t?1:0,m=m+o>>>0,l+=m<o?1:0,m=m+s>>>0,l+=m<s?1:0,m=m+c>>>0,l+=m<c?1:0;var w=e+r+n+a+u+l;return w>>>0}Ht.sum64_5_hi=yX;function bX(e,t,r,i,n,o,a,s,u,c){var l=t+i+o+s+c;return l>>>0}Ht.sum64_5_lo=bX;function _X(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}Ht.rotr64_hi=_X;function wX(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Ht.rotr64_lo=wX;function SX(e,t,r){return e>>>r}Ht.shr64_hi=SX;function xX(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}Ht.shr64_lo=xX});var Wc=k(LA=>{"use strict";v();var DA=jn(),EX=Rn();function xp(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}LA.BlockHash=xp;xp.prototype.update=function(t,r){if(t=DA.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=DA.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this};xp.prototype.digest=function(t){return this.update(this._pad()),EX(this.pending===null),this._digest(t)};xp.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,i=r-(t+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var o=1;o<i;o++)n[o]=0;if(t<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t>>>24&255,n[o++]=t>>>16&255,n[o++]=t>>>8&255,n[o++]=t&255}else for(n[o++]=t&255,n[o++]=t>>>8&255,n[o++]=t>>>16&255,n[o++]=t>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,a=8;a<this.padLength;a++)n[o++]=0;return n}});var _y=k(Pa=>{"use strict";v();var OX=jn(),Po=OX.rotr32;function IX(e,t,r,i){if(e===0)return qA(t,r,i);if(e===1||e===3)return FA(t,r,i);if(e===2)return UA(t,r,i)}Pa.ft_1=IX;function qA(e,t,r){return e&t^~e&r}Pa.ch32=qA;function UA(e,t,r){return e&t^e&r^t&r}Pa.maj32=UA;function FA(e,t,r){return e^t^r}Pa.p32=FA;function AX(e){return Po(e,2)^Po(e,13)^Po(e,22)}Pa.s0_256=AX;function PX(e){return Po(e,6)^Po(e,11)^Po(e,25)}Pa.s1_256=PX;function TX(e){return Po(e,7)^Po(e,18)^e>>>3}Pa.g0_256=TX;function kX(e){return Po(e,17)^Po(e,19)^e>>>10}Pa.g1_256=kX});var zA=k((r2e,jA)=>{"use strict";v();var Yc=jn(),RX=Wc(),BX=_y(),wy=Yc.rotl32,y0=Yc.sum32,MX=Yc.sum32_5,NX=BX.ft_1,HA=RX.BlockHash,CX=[1518500249,1859775393,2400959708,3395469782];function To(){if(!(this instanceof To))return new To;HA.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Yc.inherits(To,HA);jA.exports=To;To.blockSize=512;To.outSize=160;To.hmacStrength=80;To.padLength=64;To.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=wy(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var o=this.h[0],a=this.h[1],s=this.h[2],u=this.h[3],c=this.h[4];for(n=0;n<i.length;n++){var l=~~(n/20),m=MX(wy(o,5),NX(l,a,s,u),c,i[n],CX[l]);c=u,u=s,s=wy(a,30),a=o,o=m}this.h[0]=y0(this.h[0],o),this.h[1]=y0(this.h[1],a),this.h[2]=y0(this.h[2],s),this.h[3]=y0(this.h[3],u),this.h[4]=y0(this.h[4],c)};To.prototype._digest=function(t){return t==="hex"?Yc.toHex32(this.h,"big"):Yc.split32(this.h,"big")}});var Sy=k((n2e,VA)=>{"use strict";v();var $c=jn(),DX=Wc(),Xc=_y(),LX=Rn(),zn=$c.sum32,qX=$c.sum32_4,UX=$c.sum32_5,FX=Xc.ch32,HX=Xc.maj32,jX=Xc.s0_256,zX=Xc.s1_256,KX=Xc.g0_256,VX=Xc.g1_256,KA=DX.BlockHash,GX=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ko(){if(!(this instanceof ko))return new ko;KA.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=GX,this.W=new Array(64)}$c.inherits(ko,KA);VA.exports=ko;ko.blockSize=512;ko.outSize=256;ko.hmacStrength=192;ko.padLength=64;ko.prototype._update=function(t,r){for(var i=this.W,n=0;n<16;n++)i[n]=t[r+n];for(;n<i.length;n++)i[n]=qX(VX(i[n-2]),i[n-7],KX(i[n-15]),i[n-16]);var o=this.h[0],a=this.h[1],s=this.h[2],u=this.h[3],c=this.h[4],l=this.h[5],m=this.h[6],w=this.h[7];for(LX(this.k.length===i.length),n=0;n<i.length;n++){var E=UX(w,zX(c),FX(c,l,m),this.k[n],i[n]),P=zn(jX(o),HX(o,a,s));w=m,m=l,l=c,c=zn(u,E),u=s,s=a,a=o,o=zn(E,P)}this.h[0]=zn(this.h[0],o),this.h[1]=zn(this.h[1],a),this.h[2]=zn(this.h[2],s),this.h[3]=zn(this.h[3],u),this.h[4]=zn(this.h[4],c),this.h[5]=zn(this.h[5],l),this.h[6]=zn(this.h[6],m),this.h[7]=zn(this.h[7],w)};ko.prototype._digest=function(t){return t==="hex"?$c.toHex32(this.h,"big"):$c.split32(this.h,"big")}});var WA=k((a2e,ZA)=>{"use strict";v();var xy=jn(),GA=Sy();function Ta(){if(!(this instanceof Ta))return new Ta;GA.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}xy.inherits(Ta,GA);ZA.exports=Ta;Ta.blockSize=512;Ta.outSize=224;Ta.hmacStrength=192;Ta.padLength=64;Ta.prototype._digest=function(t){return t==="hex"?xy.toHex32(this.h.slice(0,7),"big"):xy.split32(this.h.slice(0,7),"big")}});var Iy=k((u2e,JA)=>{"use strict";v();var ki=jn(),ZX=Wc(),WX=Rn(),Ro=ki.rotr64_hi,Bo=ki.rotr64_lo,YA=ki.shr64_hi,$A=ki.shr64_lo,bs=ki.sum64,Ey=ki.sum64_hi,Oy=ki.sum64_lo,YX=ki.sum64_4_hi,$X=ki.sum64_4_lo,XX=ki.sum64_5_hi,JX=ki.sum64_5_lo,XA=ZX.BlockHash,QX=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Kn(){if(!(this instanceof Kn))return new Kn;XA.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=QX,this.W=new Array(160)}ki.inherits(Kn,XA);JA.exports=Kn;Kn.blockSize=1024;Kn.outSize=512;Kn.hmacStrength=192;Kn.padLength=128;Kn.prototype._prepareBlock=function(t,r){for(var i=this.W,n=0;n<32;n++)i[n]=t[r+n];for(;n<i.length;n+=2){var o=cJ(i[n-4],i[n-3]),a=lJ(i[n-4],i[n-3]),s=i[n-14],u=i[n-13],c=uJ(i[n-30],i[n-29]),l=fJ(i[n-30],i[n-29]),m=i[n-32],w=i[n-31];i[n]=YX(o,a,s,u,c,l,m,w),i[n+1]=$X(o,a,s,u,c,l,m,w)}};Kn.prototype._update=function(t,r){this._prepareBlock(t,r);var i=this.W,n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],m=this.h[7],w=this.h[8],E=this.h[9],P=this.h[10],M=this.h[11],D=this.h[12],L=this.h[13],U=this.h[14],K=this.h[15];WX(this.k.length===i.length);for(var N=0;N<i.length;N+=2){var C=U,F=K,H=aJ(w,E),z=sJ(w,E),G=eJ(w,E,P,M,D,L),B=tJ(w,E,P,M,D,L),g=this.k[N],O=this.k[N+1],y=i[N],f=i[N+1],d=XX(C,F,H,z,G,B,g,O,y,f),_=JX(C,F,H,z,G,B,g,O,y,f);C=nJ(n,o),F=oJ(n,o),H=rJ(n,o,a,s,u,c),z=iJ(n,o,a,s,u,c);var x=Ey(C,F,H,z),b=Oy(C,F,H,z);U=D,K=L,D=P,L=M,P=w,M=E,w=Ey(l,m,d,_),E=Oy(m,m,d,_),l=u,m=c,u=a,c=s,a=n,s=o,n=Ey(d,_,x,b),o=Oy(d,_,x,b)}bs(this.h,0,n,o),bs(this.h,2,a,s),bs(this.h,4,u,c),bs(this.h,6,l,m),bs(this.h,8,w,E),bs(this.h,10,P,M),bs(this.h,12,D,L),bs(this.h,14,U,K)};Kn.prototype._digest=function(t){return t==="hex"?ki.toHex32(this.h,"big"):ki.split32(this.h,"big")};function eJ(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function tJ(e,t,r,i,n,o){var a=t&i^~t&o;return a<0&&(a+=4294967296),a}function rJ(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function iJ(e,t,r,i,n,o){var a=t&i^t&o^i&o;return a<0&&(a+=4294967296),a}function nJ(e,t){var r=Ro(e,t,28),i=Ro(t,e,2),n=Ro(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function oJ(e,t){var r=Bo(e,t,28),i=Bo(t,e,2),n=Bo(t,e,7),o=r^i^n;return o<0&&(o+=4294967296),o}function aJ(e,t){var r=Ro(e,t,14),i=Ro(e,t,18),n=Ro(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function sJ(e,t){var r=Bo(e,t,14),i=Bo(e,t,18),n=Bo(t,e,9),o=r^i^n;return o<0&&(o+=4294967296),o}function uJ(e,t){var r=Ro(e,t,1),i=Ro(e,t,8),n=YA(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function fJ(e,t){var r=Bo(e,t,1),i=Bo(e,t,8),n=$A(e,t,7),o=r^i^n;return o<0&&(o+=4294967296),o}function cJ(e,t){var r=Ro(e,t,19),i=Ro(t,e,29),n=YA(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}function lJ(e,t){var r=Bo(e,t,19),i=Bo(t,e,29),n=$A(e,t,6),o=r^i^n;return o<0&&(o+=4294967296),o}});var tP=k((c2e,eP)=>{"use strict";v();var Ay=jn(),QA=Iy();function ka(){if(!(this instanceof ka))return new ka;QA.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Ay.inherits(ka,QA);eP.exports=ka;ka.blockSize=1024;ka.outSize=384;ka.hmacStrength=192;ka.padLength=128;ka.prototype._digest=function(t){return t==="hex"?Ay.toHex32(this.h.slice(0,12),"big"):Ay.split32(this.h.slice(0,12),"big")}});var rP=k(Jc=>{"use strict";v();Jc.sha1=zA();Jc.sha224=WA();Jc.sha256=Sy();Jc.sha384=tP();Jc.sha512=Iy()});var uP=k(sP=>{"use strict";v();var sf=jn(),hJ=Wc(),Ep=sf.rotl32,iP=sf.sum32,b0=sf.sum32_3,nP=sf.sum32_4,aP=hJ.BlockHash;function Mo(){if(!(this instanceof Mo))return new Mo;aP.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}sf.inherits(Mo,aP);sP.ripemd160=Mo;Mo.blockSize=512;Mo.outSize=160;Mo.hmacStrength=192;Mo.padLength=64;Mo.prototype._update=function(t,r){for(var i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=i,c=n,l=o,m=a,w=s,E=0;E<80;E++){var P=iP(Ep(nP(i,oP(E,n,o,a),t[gJ[E]+r],dJ(E)),mJ[E]),s);i=s,s=a,a=Ep(o,10),o=n,n=P,P=iP(Ep(nP(u,oP(79-E,c,l,m),t[vJ[E]+r],pJ(E)),yJ[E]),w),u=w,w=m,m=Ep(l,10),l=c,c=P}P=b0(this.h[1],o,m),this.h[1]=b0(this.h[2],a,w),this.h[2]=b0(this.h[3],s,u),this.h[3]=b0(this.h[4],i,c),this.h[4]=b0(this.h[0],n,l),this.h[0]=P};Mo.prototype._digest=function(t){return t==="hex"?sf.toHex32(this.h,"little"):sf.split32(this.h,"little")};function oP(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function dJ(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function pJ(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var gJ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],vJ=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],mJ=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],yJ=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var cP=k((v2e,fP)=>{"use strict";v();var bJ=jn(),_J=Rn();function Qc(e,t,r){if(!(this instanceof Qc))return new Qc(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(bJ.toArray(t,r))}fP.exports=Qc;Qc.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),_J(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};Qc.prototype.update=function(t,r){return this.inner.update(t,r),this};Qc.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var hP=k(lP=>{v();var ri=lP;ri.utils=jn();ri.common=Wc();ri.sha=rP();ri.ripemd=uP();ri.hmac=cP();ri.sha1=ri.sha.sha1;ri.sha256=ri.sha.sha256;ri.sha224=ri.sha.sha224;ri.sha384=ri.sha.sha384;ri.sha512=ri.sha.sha512;ri.ripemd160=ri.ripemd.ripemd160});var pP=k((_2e,dP)=>{"use strict";v();var Op=hP(),Ra=Bt(),Sr=dP.exports;Sr.sha1=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Op.sha1().update(e).digest("hex"),"hex")};Sr.sha1.blocksize=512;Sr.sha256=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Op.sha256().update(e).digest("hex"),"hex")};Sr.sha256.blocksize=512;Sr.sha256sha256=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),Sr.sha256(Sr.sha256(e))};Sr.ripemd160=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Op.ripemd160().update(e).digest("hex"),"hex")};Sr.sha256ripemd160=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),Sr.ripemd160(Sr.sha256(e))};Sr.sha512=function(e){return Ra.checkArgument(h.Buffer.isBuffer(e)),h.Buffer.from(Op.sha512().update(e).digest("hex"),"hex")};Sr.sha512.blocksize=1024;Sr.hmac=function(e,t,r){Ra.checkArgument(h.Buffer.isBuffer(t)),Ra.checkArgument(h.Buffer.isBuffer(r)),Ra.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=h.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=h.Buffer.alloc(i);o.fill(92);var a=h.Buffer.alloc(i);a.fill(54);for(var s=h.Buffer.alloc(i),u=h.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(h.Buffer.concat([s,e(h.Buffer.concat([u,t]))]))};Sr.sha256hmac=function(e,t){return Sr.hmac(Sr.sha256,e,t)};Sr.sha512hmac=function(e,t){return Sr.hmac(Sr.sha512,e,t)}});var vP=k((S2e,gP)=>{"use strict";v();var Ip=_r(),Ba=Bt(),xr=gP.exports;xr.sha1=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Ip.createHash("sha1").update(e).digest()};xr.sha1.blocksize=512;xr.sha256=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Ip.createHash("sha256").update(e).digest()};xr.sha256.blocksize=512;xr.sha256sha256=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),xr.sha256(xr.sha256(e))};xr.ripemd160=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Ip.createHash("ripemd160").update(e).digest()};xr.sha256ripemd160=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),xr.ripemd160(xr.sha256(e))};xr.sha512=function(e){return Ba.checkArgument(h.Buffer.isBuffer(e)),Ip.createHash("sha512").update(e).digest()};xr.sha512.blocksize=1024;xr.hmac=function(e,t,r){Ba.checkArgument(h.Buffer.isBuffer(t)),Ba.checkArgument(h.Buffer.isBuffer(r)),Ba.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r<i){var n=h.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=h.Buffer.alloc(i);o.fill(92);var a=h.Buffer.alloc(i);a.fill(54);for(var s=h.Buffer.alloc(i),u=h.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(h.Buffer.concat([s,e(h.Buffer.concat([u,t]))]))};xr.sha256hmac=function(e,t){return xr.hmac(xr.sha256,e,t)};xr.sha512hmac=function(e,t){return xr.hmac(xr.sha512,e,t)}});var cr=k((E2e,Py)=>{v();A.default.browser?Py.exports=pP():Py.exports=vP()});var ws=k((I2e,bP)=>{"use strict";v();var Ma=xt(),_0=pi(),uf=[],w0={};function mP(){}mP.prototype.toString=function(){return this.name};function S0(e,t){if(~uf.indexOf(e))return e;if(t){Ma.isArray(t)||(t=[t]);for(var r=0;r<uf.length;r++){var i=uf[r],n=Ma.pick(i,t),o=Ma.values(n);if(~o.indexOf(e))return i}return}return w0[e]}function ky(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r)&31);return t}function x0(e){var t=new mP;_0.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey});var r=e.indexBy||Object.keys(e);return e.cashAddrPrefix&&Ma.extend(t,{cashAddrPrefix:e.cashAddrPrefix,cashAddrPrefixArray:ky(e.cashAddrPrefix)}),e.networkMagic&&Ma.extend(t,{networkMagic:_0.integerAsBuffer(e.networkMagic)}),e.port&&Ma.extend(t,{port:e.port}),e.dnsSeeds&&Ma.extend(t,{dnsSeeds:e.dnsSeeds}),uf.push(t),wJ(t,r),t}function wJ(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=e[i];!Ma.isUndefined(n)&&!Ma.isObject(n)&&(w0[n]=e)}}function SJ(e,t){for(var r=0;r<t.length;r++){var i=t[r];w0[i]===e&&delete w0[i]}}function xJ(e){for(var t=0;t<uf.length;t++)uf[t]===e&&uf.splice(t,1);SJ(e,Object.keys(w0))}var Ap={livenet:3823236072,testnet:4108710900,regtest:3669344250,stn:4224632057},yP=["seed.bitcoinsv.org","seed.bitcoinunlimited.info"],_s={PORT:18333,NETWORK_MAGIC:Ap.testnet,DNS_SEEDS:yP,PREFIX:"testnet",CASHADDRPREFIX:"bchtest"},Na={PORT:18444,NETWORK_MAGIC:Ap.regtest,DNS_SEEDS:[],PREFIX:"regtest",CASHADDRPREFIX:"bchreg"},Ca={PORT:9333,NETWORK_MAGIC:Ap.stn,DNS_SEEDS:["stn-seed.bitcoinsv.io"],PREFIX:"stn",CASHADDRPREFIX:"bsvstn"},EJ={name:"livenet",alias:"mainnet",prefix:"bitcoin",cashAddrPrefix:"bitcoincash",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:Ap.livenet,port:8333,dnsSeeds:yP},OJ={name:"testnet",prefix:_s.PREFIX,cashAddrPrefix:_s.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:_s.NETWORK_MAGIC},IJ={name:"regtest",prefix:Na.PREFIX,cashAddrPrefix:Na.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Na.NETWORK_MAGIC,port:Na.PORT,dnsSeeds:[],indexBy:["port","name","cashAddrPrefix","networkMagic"]},AJ={name:"stn",prefix:Ca.PREFIX,cashAddrPrefix:Ca.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Ca.NETWORK_MAGIC,indexBy:["port","name","cashAddrPrefix","networkMagic"]};x0(OJ);x0(AJ);x0(IJ);x0(EJ);var Ty=S0("livenet"),PJ=S0("regtest"),No=S0("testnet"),TJ=S0("stn");Object.defineProperty(No,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.PORT:this.stnEnabled?Ca.PORT:_s.PORT}});Object.defineProperty(No,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?_0.integerAsBuffer(Na.NETWORK_MAGIC):this.stnEnabled?_0.integerAsBuffer(Ca.NETWORK_MAGIC):_0.integerAsBuffer(_s.NETWORK_MAGIC)}});Object.defineProperty(No,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.DNS_SEEDS:this.stnEnabled?Ca.DNS_SEEDS:_s.DNS_SEEDS}});Object.defineProperty(No,"cashAddrPrefix",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Na.CASHADDRPREFIX:this.stnEnabled?Ca.CASHADDRPREFIX:_s.CASHADDRPREFIX}});Object.defineProperty(No,"cashAddrPrefixArray",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?ky(Na.CASHADDRPREFIX):this.stnEnabled?Ca.cashAddrPrefixToArray(Ca.CASHADDRPREFIX):ky(_s.CASHADDRPREFIX)}});function kJ(){No.regtestEnabled=!0}function RJ(){No.regtestEnabled=!1}function BJ(){No.stnEnabled=!0}function MJ(){No.stnEnabled=!1}bP.exports={add:x0,remove:xJ,defaultNetwork:Ty,livenet:Ty,mainnet:Ty,testnet:No,regtest:PJ,stn:TJ,get:S0,enableRegtest:kJ,disableRegtest:RJ,enableStn:BJ,disableStn:MJ}});var E0=k((P2e,SP)=>{"use strict";v();var Ry=xt(),_P=Z2(),wP=zt(),NJ="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),Gr=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};Gr.validCharacters=function(t){return wP.Buffer.isBuffer(t)&&(t=t.toString()),Ry.every(Ry.map(t,function(r){return Ry.includes(NJ,r)}))};Gr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Gr.encode=function(e){if(!wP.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return _P.encode(e)};Gr.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return h.Buffer.from(_P.decode(e))};Gr.prototype.fromBuffer=function(e){return this.buf=e,this};Gr.fromBuffer=function(e){return new Gr().fromBuffer(e)};Gr.fromHex=function(e){return Gr.fromBuffer(h.Buffer.from(e,"hex"))};Gr.prototype.fromString=function(e){var t=Gr.decode(e);return this.buf=t,this};Gr.fromString=function(e){return new Gr().fromString(e)};Gr.prototype.toBuffer=function(){return this.buf};Gr.prototype.toHex=function(){return this.toBuffer().toString("hex")};Gr.prototype.toString=function(){return Gr.encode(this.buf)};SP.exports=Gr});var el=k((k2e,IP)=>{"use strict";v();var xP=xt(),O0=E0(),EP=zt(),OP=cr().sha256sha256,pr=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};pr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};pr.validChecksum=function(t,r){return xP.isString(t)&&(t=EP.Buffer.from(O0.decode(t))),xP.isString(r)&&(r=EP.Buffer.from(O0.decode(r))),r||(r=t.slice(-4),t=t.slice(0,-4)),pr.checksum(t).toString("hex")===r.toString("hex")};pr.decode=function(e){if(typeof e!="string")throw new Error("Input must be a string");var t=h.Buffer.from(O0.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),i=t.slice(-4),n=OP(r),o=n.slice(0,4);if(i.toString("hex")!==o.toString("hex"))throw new Error("Checksum mismatch");return r};pr.checksum=function(e){return OP(e).slice(0,4)};pr.encode=function(e){if(!h.Buffer.isBuffer(e))throw new Error("Input must be a buffer");var t=h.Buffer.alloc(e.length+4),r=pr.checksum(e);return e.copy(t),r.copy(t,e.length),O0.encode(t)};pr.prototype.fromBuffer=function(e){return this.buf=e,this};pr.fromBuffer=function(e){return new pr().fromBuffer(e)};pr.fromHex=function(e){return pr.fromBuffer(h.Buffer.from(e,"hex"))};pr.prototype.fromString=function(e){var t=pr.decode(e);return this.buf=t,this};pr.fromString=function(e){var t=pr.decode(e);return new O0(t)};pr.prototype.toBuffer=function(){return this.buf};pr.prototype.toHex=function(){return this.toBuffer().toString("hex")};pr.prototype.toString=function(){return pr.encode(this.buf)};IP.exports=pr});var Da=k((B2e,PP)=>{"use strict";v();var I0=xt(),AP=Bt(),tl=fr(),gr=function e(t){if(!(this instanceof e))return new e(t);if(!I0.isUndefined(t))if(h.Buffer.isBuffer(t))this.set({buf:t});else if(I0.isString(t)){var r=h.Buffer.from(t,"hex");if(r.length*2!==t.length)throw new TypeError("Invalid hex string");this.set({buf:r})}else if(I0.isObject(t)){var i=t;this.set(i)}else throw new TypeError("Unrecognized argument for BufferReader")};gr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this};gr.prototype.eof=function(){return this.pos>=this.buf.length};gr.prototype.finished=gr.prototype.eof;gr.prototype.read=function(e){AP.checkArgument(!I0.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t};gr.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e};gr.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e};gr.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e};gr.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e};gr.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e};gr.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=tl.fromBuffer(e);return this.pos=this.pos+8,t};gr.prototype.readUInt64LEBN=function(){var e=this.buf.readUInt32LE(this.pos),t=this.buf.readUInt32LE(this.pos+4),r=t*4294967296+e,i;if(r<=9007199254740991)i=new tl(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);i=new tl(n,10,"le")}return this.pos=this.pos+8,i};gr.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN(),r=t.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return e}};gr.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return AP.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t};gr.prototype.readVarintBuf=function(){var e=this.buf.readUInt8(this.pos);switch(e){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}};gr.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new tl(this.readUInt16LE());case 254:return new tl(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new tl(e)}};gr.prototype.reverse=function(){for(var e=h.Buffer.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this};gr.prototype.readReverse=function(e){I0.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,h.Buffer.from(t).reverse()};PP.exports=gr});var Ny=k((N2e,BP)=>{"use strict";v();function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function TP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,DJ(i.key),i)}}function CJ(e,t,r){return t&&TP(e.prototype,t),r&&TP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function DJ(e){var t=LJ(e,"string");return Ss(t)==="symbol"?t:String(t)}function LJ(e,t){if(Ss(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(Ss(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&My(e,t)}function My(e,t){return My=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},My(e,t)}function FJ(e){var t=zJ();return function(){var i=Pp(e),n;if(t){var o=Pp(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return HJ(this,n)}}function HJ(e,t){if(t&&(Ss(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jJ(e)}function jJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Pp(e){return Pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pp(e)}var RP={},rl,By;function A0(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){UJ(s,o);var a=FJ(s);function s(u,c,l){var m;return qJ(this,s),m=a.call(this,i(u,c,l)),m.code=e,m}return CJ(s)})(r);RP[e]=n}function kP(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function KJ(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function VJ(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function GJ(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}A0("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);A0("ERR_INVALID_ARG_TYPE",function(e,t,r){rl===void 0&&(rl=xs()),rl(typeof e=="string","'name' must be a string");var i;typeof t=="string"&&KJ(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(VJ(e," argument"))n="The ".concat(e," ").concat(i," ").concat(kP(t,"type"));else{var o=GJ(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat(kP(t,"type"))}return n+=". Received type ".concat(Ss(r)),n},TypeError);A0("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";By===void 0&&(By=tn());var i=By.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)},TypeError,RangeError);A0("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return r&&r.constructor&&r.constructor.name?i="instance of ".concat(r.constructor.name):i="type ".concat(Ss(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError);A0("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];rl===void 0&&(rl=xs()),rl(t.length>0,"At least one arg needs to be specified");var i="The ",n=t.length;switch(t=t.map(function(o){return'"'.concat(o,'"')}),n){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,n-1).join(", "),i+=", and ".concat(t[n-1]," arguments");break}return"".concat(i," must be specified")},TypeError);BP.exports.codes=RP});var jP=k((D2e,HP)=>{"use strict";v();function MP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function NP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MP(Object(r),!0).forEach(function(i){ZJ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MP(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function ZJ(e,t,r){return t=qP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,qP(i.key),i)}}function YJ(e,t,r){return t&&CP(e.prototype,t),r&&CP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qP(e){var t=$J(e,"string");return Ri(t)==="symbol"?t:String(t)}function $J(e,t){if(Ri(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(Ri(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R0(e,t)}function JJ(e){var t=FP();return function(){var i=B0(e),n;if(t){var o=B0(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return UP(this,n)}}function UP(e,t){if(t&&(Ri(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cy(e)}function Cy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dy(e){var t=typeof Map=="function"?new Map:void 0;return Dy=function(i){if(i===null||!QJ(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(i))return t.get(i);t.set(i,n)}function n(){return Tp(i,arguments,B0(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),R0(n,i)},Dy(e)}function Tp(e,t,r){return FP()?Tp=Reflect.construct.bind():Tp=function(n,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(n,s),c=new u;return a&&R0(c,a.prototype),c},Tp.apply(null,arguments)}function FP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function QJ(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function R0(e,t){return R0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},R0(e,t)}function B0(e){return B0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B0(e)}function Ri(e){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}var eQ=tn(),Ly=eQ.inspect,tQ=Ny(),rQ=tQ.codes.ERR_INVALID_ARG_TYPE;function DP(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function iQ(e,t){if(t=Math.floor(t),e.length==0||t==0)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,r-e.length),e}var Vn="",P0="",T0="",ii="",ff={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},nQ=10;function LP(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(i){r[i]=e[i]}),Object.defineProperty(r,"message",{value:e.message}),r}function k0(e){return Ly(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function oQ(e,t,r){var i="",n="",o=0,a="",s=!1,u=k0(e),c=u.split(`
|
|
20
20
|
`),l=k0(t).split(`
|
|
@@ -72,7 +72,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
72
72
|
`))}throw i}};function vk(e,t,r,i,n){if(!jp(t))throw new il("regexp","RegExp",t);var o=n==="match";if(typeof e!="string"||zp(t,e)!==o){if(r instanceof Error)throw r;var a=!r;r=r||(typeof e!="string"?'The "string" argument must be of type string. Received type '+"".concat(Gn(e)," (").concat(Hp(e),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(Hp(t),`. Input:
|
|
73
73
|
|
|
74
74
|
`).concat(Hp(e),`
|
|
75
|
-
`));var s=new Is({actual:e,expected:t,message:r,operator:n,stackStartFn:i});throw s.generatedMessage=a,s}}Vt.match=function e(t,r,i){vk(t,r,i,e,"match")};Vt.doesNotMatch=function e(t,r,i){vk(t,r,i,e,"doesNotMatch")};function mk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];fk.apply(void 0,[mk,t.length].concat(t))}Vt.strict=mee(mk,Vt,{equal:Vt.strictEqual,deepEqual:Vt.deepStrictEqual,notEqual:Vt.notStrictEqual,notDeepEqual:Vt.notDeepStrictEqual});Vt.strict.strict=Vt.strict});var Wn=k((ype,_k)=>{"use strict";v();var bk=xs(),vr=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};vr.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};vr.prototype.toBuffer=function(){return this.concat()};vr.prototype.concat=function(){return h.Buffer.concat(this.bufs,this.bufLen)};vr.prototype.write=function(e){return bk(h.Buffer.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};vr.prototype.writeReverse=function(e){return bk(h.Buffer.isBuffer(e)),this.bufs.push(h.Buffer.from(e).reverse()),this.bufLen+=e.length,this};vr.prototype.writeUInt8=function(e){var t=h.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};vr.prototype.writeUInt16BE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};vr.prototype.writeUInt16LE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};vr.prototype.writeUInt32BE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};vr.prototype.writeInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};vr.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};vr.prototype.writeVarintNum=function(e){var t=vr.varintBufNum(e);return this.write(t),this};vr.prototype.writeVarintBN=function(e){var t=vr.varintBufBN(e);return this.write(t),this};vr.varintBufNum=function(e){var t;return e<253?(t=h.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=h.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};vr.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)t=h.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new vr;i.writeUInt8(255),i.writeUInt64LEBN(e),t=i.concat()}return t};_k.exports=vr});var Gp=k((_pe,wk)=>{"use strict";v();var nl=xt(),F0=Bt(),bee=pi();function Et(e){if(!(this instanceof Et))return new Et(e);var t;if(nl.isNumber(e))t=e;else if(nl.isString(e))t=Et.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return bee.defineImmutable(this,{num:t}),this}Et.fromBuffer=function(e){return F0.checkArgument(h.Buffer.isBuffer(e)),new Et(+("0x"+e.toString("hex")))};Et.fromNumber=function(e){return F0.checkArgument(nl.isNumber(e)),new Et(e)};Et.fromString=function(e){F0.checkArgument(nl.isString(e));var t=Et.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new Et(t)};Et.prototype.toHex=function(){return this.num.toString(16)};Et.prototype.toBuffer=function(){return h.Buffer.from(this.toHex(),"hex")};Et.prototype.toNumber=function(){return this.num};Et.prototype.toString=function(){var e=Et.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};Et.smallInt=function(e){return F0.checkArgument(nl.isNumber(e),"Invalid Argument: n should be number"),F0.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?Et("OP_0"):new Et(Et.map.OP_1+e-1)};Et.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_NOP4:182,OP_NOP5:183,OP_NOP6:184,OP_NOP7:185,OP_NOP8:186,OP_NOP9:187,OP_NOP10:188,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};Et.reverseMap=[];for(Xy in Et.map)Et.reverseMap[Et.map[Xy]]=Xy;var Xy;nl.extend(Et,Et.map);Et.isSmallIntOp=function(e){return e instanceof Et&&(e=e.toNumber()),e===Et.map.OP_0||e>=Et.map.OP_1&&e<=Et.map.OP_16};Et.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};wk.exports=Et});var e4=k((Spe,Ek)=>{"use strict";v();var Yn=hf(),_ee=Da(),wee=Wn(),Jy=cr(),he=Gp(),lf=$n(),cf=Vr(),Sk=ws(),er=Bt(),yt=xt(),Qy=ln(),xk=zt(),See=pi(),Q=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],h.Buffer.isBuffer(t))return e.fromBuffer(t);if(t instanceof Yn)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(yt.isString(t))return e.fromString(t);yt.isObject(t)&&yt.isArray(t.chunks)&&this.set(t)};Q.prototype.set=function(e){return er.checkArgument(yt.isObject(e)),er.checkArgument(yt.isArray(e.chunks)),this.chunks=e.chunks,this};Q.fromBuffer=function(e){var t=new Q;t.chunks=[];for(var r=new _ee(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<he.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===he.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(a){throw a instanceof RangeError?new Qy.Script.InvalidBuffer(e.toString("hex")):a}return t};Q.prototype.toBuffer=function(){for(var e=new wee,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<he.OP_PUSHDATA1?e.write(r.buf):i===he.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===he.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===he.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};Q.fromASM=function(e){var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(n==="0")a=0,t.chunks.push({opcodenum:a}),i=i+1;else if(n==="-1")a=he.OP_1NEGATE,t.chunks.push({opcodenum:a}),i=i+1;else if(yt.isUndefined(a)){var s=h.Buffer.from(r[i],"hex");if(s.toString("hex")!==r[i])throw new Error("invalid hex string in script");var u=s.length;u>=0&&u<he.OP_PUSHDATA1?a=u:u<Math.pow(2,8)?a=he.OP_PUSHDATA1:u<Math.pow(2,16)?a=he.OP_PUSHDATA2:u<Math.pow(2,32)&&(a=he.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),i=i+1}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.fromHex=function(e){return new Q(xk.Buffer.from(e,"hex"))};Q.fromString=function(e){if(See.isHexa(e)||e.length===0)return new Q(xk.Buffer.from(e,"hex"));var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(yt.isUndefined(a))if(a=parseInt(n),a>0&&a<he.OP_PUSHDATA1)t.chunks.push({buf:h.Buffer.from(r[i+1].slice(2),"hex"),len:a,opcodenum:a}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(a===he.OP_PUSHDATA1||a===he.OP_PUSHDATA2||a===he.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:h.Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:a}),i=i+3}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)!i&&(r===he.OP_PUSHDATA1||r===he.OP_PUSHDATA2||r===he.OP_PUSHDATA4)&&(n=n+" "+he(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof he.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+he(r).toString():n=n+" "+he(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};Q.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};Q.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};Q.prototype.toHex=function(){return this.toBuffer().toString("hex")};Q.prototype.inspect=function(){return"<Script: "+this.toString()+">"};Q.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};Q.prototype.getPublicKey=function(){return er.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};Q.prototype.getPublicKeyHash=function(){return er.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf};Q.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===he.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return lf.isValid(e)}return!1};Q.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};Q.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===he.OP_HASH160&&e[1]===20&&e[e.length-1]===he.OP_EQUAL};Q.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=Q.fromBuffer(t)}catch(n){if(n instanceof Qy.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==Q.types.UNKNOWN};Q.prototype.isMultisigOut=function(){return this.chunks.length>3&&he.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)})&&he.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===he.OP_CHECKMULTISIG};Q.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)&&cf.isTxDER(e.buf)})};Q.prototype.isDataOut=function(){var e=this.chunks.length>=1&&this.chunks[0].opcodenum===he.OP_RETURN;if(!e)return!1;var t=this.chunks.slice(1),r=new Q({chunks:t});return r.isPushOnly()};Q.prototype.isSafeDataOut=function(){if(this.chunks.length<2||this.chunks[0].opcodenum!==he.OP_FALSE)return!1;var e=this.chunks.slice(1),t=new Q({chunks:e});return t.isDataOut()};Q.prototype.getData=function(){if(this.isSafeDataOut()){var e=this.chunks.slice(2),t=e.map(r=>r.buf);return t}if(this.isDataOut()||this.isScriptHashOut())return yt.isUndefined(this.chunks[1])?h.Buffer.alloc(0):h.Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return h.Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};Q.prototype.isPushOnly=function(){return yt.every(this.chunks,function(e){return e.opcodenum<=he.OP_16||e.opcodenum===he.OP_PUSHDATA1||e.opcodenum===he.OP_PUSHDATA2||e.opcodenum===he.OP_PUSHDATA4})};Q.types={};Q.types.UNKNOWN="Unknown";Q.types.PUBKEY_OUT="Pay to public key";Q.types.PUBKEY_IN="Spend from public key";Q.types.PUBKEYHASH_OUT="Pay to public key hash";Q.types.PUBKEYHASH_IN="Spend from public key hash";Q.types.SCRIPTHASH_OUT="Pay to script hash";Q.types.SCRIPTHASH_IN="Spend from script hash";Q.types.MULTISIG_OUT="Pay to multisig";Q.types.MULTISIG_IN="Spend from multisig";Q.types.DATA_OUT="Data push";Q.types.SAFE_DATA_OUT="Safe data push";Q.OP_RETURN_STANDARD_SIZE=220;Q.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==Q.types.UNKNOWN?e:this.classifyInput()};Q.outputIdentifiers={};Q.outputIdentifiers.PUBKEY_OUT=Q.prototype.isPublicKeyOut;Q.outputIdentifiers.PUBKEYHASH_OUT=Q.prototype.isPublicKeyHashOut;Q.outputIdentifiers.MULTISIG_OUT=Q.prototype.isMultisigOut;Q.outputIdentifiers.SCRIPTHASH_OUT=Q.prototype.isScriptHashOut;Q.outputIdentifiers.DATA_OUT=Q.prototype.isDataOut;Q.outputIdentifiers.SAFE_DATA_OUT=Q.prototype.isSafeDataOut;Q.prototype.classifyOutput=function(){for(var e in Q.outputIdentifiers)if(Q.outputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.inputIdentifiers={};Q.inputIdentifiers.PUBKEY_IN=Q.prototype.isPublicKeyIn;Q.inputIdentifiers.PUBKEYHASH_IN=Q.prototype.isPublicKeyHashIn;Q.inputIdentifiers.MULTISIG_IN=Q.prototype.isMultisigIn;Q.inputIdentifiers.SCRIPTHASH_IN=Q.prototype.isScriptHashIn;Q.prototype.classifyInput=function(){for(var e in Q.inputIdentifiers)if(Q.inputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.prototype.isStandard=function(){return this.classify()!==Q.types.UNKNOWN};Q.prototype.prepend=function(e){return this._addByType(e,!0),this};Q.prototype.equals=function(e){if(er.checkState(e instanceof Q,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(h.Buffer.isBuffer(this.chunks[t].buf)&&!h.Buffer.isBuffer(e.chunks[t].buf)||h.Buffer.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};Q.prototype.add=function(e){return this._addByType(e,!1),this};Q.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof he)this._addOpcode(e,t);else if(h.Buffer.isBuffer(e))this._addBuffer(e,t);else if(e instanceof Q)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};Q.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};Q.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof he?r=e.toNumber():r=he(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};Q.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<he.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=he.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=he.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=he.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};Q.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==he.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};Q.buildMultisigOut=function(e,t,r){er.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new Q;i.add(he.smallInt(t)),e=yt.map(e,lf);var n=e;r.noSorting||(n=e.map(s=>s.toString("hex")).sort().map(s=>new lf(s)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(he.smallInt(e.length)),i.add(he.OP_CHECKMULTISIG),i};Q.buildMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n};Q.buildP2SHMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n.add((i.cachedMultisig||Q.buildMultisigOut(e,t,i)).toBuffer()),n};Q.buildPublicKeyHashOut=function(e){er.checkArgument(!yt.isUndefined(e)),er.checkArgument(e instanceof lf||e instanceof Yn||yt.isString(e)),e instanceof lf?e=e.toAddress():yt.isString(e)&&(e=new Yn(e));var t=new Q;return t.add(he.OP_DUP).add(he.OP_HASH160).add(e.hashBuffer).add(he.OP_EQUALVERIFY).add(he.OP_CHECKSIG),t._network=e.network,t};Q.buildPublicKeyOut=function(e){er.checkArgument(e instanceof lf);var t=new Q;return t.add(e.toBuffer()).add(he.OP_CHECKSIG),t};Q.buildDataOut=function(e,t){er.checkArgument(yt.isUndefined(e)||yt.isString(e)||yt.isArray(e)||h.Buffer.isBuffer(e));var r=e;yt.isArray(r)||(r=[e]);var i=new Q;i.add(he.OP_RETURN);for(let n of r)er.checkArgument(yt.isUndefined(n)||yt.isString(n)||h.Buffer.isBuffer(n)),yt.isString(n)&&(n=h.Buffer.from(n,t)),yt.isUndefined(n)||i.add(n);return i};Q.buildSafeDataOut=function(e,t){var r=Q.buildDataOut(e,t),i=new Q;return i.add(he.OP_FALSE),i.add(r),i};Q.buildScriptHashOut=function(e){er.checkArgument(e instanceof Q||e instanceof Yn&&e.isPayToScriptHash());var t=new Q;return t.add(he.OP_HASH160).add(e instanceof Yn?e.hashBuffer:Jy.sha256ripemd160(e.toBuffer())).add(he.OP_EQUAL),t._network=e._network||e.network,t};Q.buildPublicKeyIn=function(e,t){er.checkArgument(e instanceof cf||h.Buffer.isBuffer(e)),er.checkArgument(yt.isUndefined(t)||yt.isNumber(t)),e instanceof cf&&(e=e.toBuffer());var r=new Q;return r.add(h.Buffer.concat([e,h.Buffer.from([(t||cf.SIGHASH_ALL)&255])])),r};Q.buildPublicKeyHashIn=function(e,t,r){er.checkArgument(t instanceof cf||h.Buffer.isBuffer(t)),er.checkArgument(yt.isUndefined(r)||yt.isNumber(r)),t instanceof cf&&(t=t.toBuffer());var i=new Q().add(h.Buffer.concat([t,h.Buffer.from([(r||cf.SIGHASH_ALL)&255])])).add(new lf(e).toBuffer());return i};Q.empty=function(){return new Q};Q.prototype.toScriptHashOut=function(){return Q.buildScriptHashOut(this)};Q.fromAddress=function(e){if(e=Yn(e),e.isPayToScriptHash())return Q.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return Q.buildPublicKeyHashOut(e);throw new Qy.Script.UnrecognizedAddress(e)};Q.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};Q.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToPublicKeyHash;else return!1;return e};Q.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=Jy.sha256ripemd160(this.chunks[1].buf),e.type=Yn.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=Jy.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Yn.PayToScriptHash;else return!1;return e};Q.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=Sk.get(e)||this._network||Sk.defaultNetwork,new Yn(t)):!1};Q.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=Q({chunks:[this.chunks[i]]}),o=n.toBuffer(),a=o.toString("hex");r===a&&this.chunks.splice(i,1)}return this};Q.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===he.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===he.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===he.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===he.OP_PUSHDATA1:r.length<=65535?i===he.OP_PUSHDATA2:!0:!0};Q.prototype._decodeOP_N=function(e){if(e===he.OP_0)return 0;if(e>=he.OP_1&&e<=he.OP_16)return e-(he.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))};Q.prototype.getSignatureOperationsCount=function(e){e=yt.isUndefined(e)?!0:e;var t=this,r=0,i=he.OP_INVALIDOPCODE;return yt.each(t.chunks,function(o){var a=o.opcodenum;a===he.OP_CHECKSIG||a===he.OP_CHECKSIGVERIFY?r++:(a===he.OP_CHECKMULTISIG||a===he.OP_CHECKMULTISIGVERIFY)&&(e&&i>=he.OP_1&&i<=he.OP_16?r+=t._decodeOP_N(i):r+=20),i=a}),r};Ek.exports=Q});var t4=k((Epe,Ik)=>{v();var xee=Object.prototype.toString;Ik.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return Pee(t)?"generatorfunction":"function";if(Eee(t))return"array";if(Ree(t))return"buffer";if(kee(t))return"arguments";if(Iee(t))return"date";if(Oee(t))return"error";if(Aee(t))return"regexp";switch(Ok(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(Tee(t))return"generator";switch(r=xee.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Ok(e){return typeof e.constructor=="function"?e.constructor.name:null}function Eee(e){return Array.isArray?Array.isArray(e):e instanceof Array}function Oee(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Iee(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Aee(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function Pee(e,t){return Ok(e)==="GeneratorFunction"}function Tee(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function kee(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function Ree(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var Tk=k((Ipe,Pk)=>{"use strict";v();var Ak=Symbol.prototype.valueOf,Bee=t4();function Mee(e,t){switch(Bee(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return Lee(e);case"symbol":return qee(e);case"arraybuffer":return Cee(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return Dee(e);case"regexp":return Nee(e);case"error":return Object.create(e);default:return e}}function Nee(e){let t=e.flags!==void 0?e.flags:/\w+$/.exec(e)||void 0,r=new e.constructor(e.source,t);return r.lastIndex=e.lastIndex,r}function Cee(e){let t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function Dee(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}function Lee(e){let t=e.length,r=h.Buffer.allocUnsafe?h.Buffer.allocUnsafe(t):h.Buffer.from(t);return e.copy(r),r}function qee(e){return Ak?Object(Ak.call(e)):{}}Pk.exports=Mee});var Rk=k((Ppe,kk)=>{"use strict";v();kk.exports=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}});var Nk=k((kpe,Mk)=>{"use strict";v();var Uee=Rk();function Bk(e){return Uee(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}Mk.exports=function(t){var r,i;return!(Bk(t)===!1||(r=t.constructor,typeof r!="function")||(i=r.prototype,Bk(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var Dk=k((Bpe,Ck)=>{"use strict";v();var Fee=Tk(),Hee=t4(),jee=Nk();function r4(e,t){switch(Hee(e)){case"object":return zee(e,t);case"array":return Kee(e,t);default:return Fee(e)}}function zee(e,t){if(typeof t=="function")return t(e);if(t||jee(e)){let r=new e.constructor;for(let i in e)r[i]=r4(e[i],t);return r}return e}function Kee(e,t){let r=new e.constructor(e.length);for(let i=0;i<e.length;i++)r[i]=r4(e[i],t);return r}Ck.exports=r4});var ol=k((Npe,Uk)=>{"use strict";v();var Lk=Wn(),qk=Da(),Vee=fr(),Xn=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof Vee){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};Xn.prototype.set=function(e){return this.buf=e.buf||this.buf,this};Xn.prototype.fromString=function(e){return this.set({buf:h.Buffer.from(e,"hex")}),this};Xn.prototype.toString=function(){return this.buf.toString("hex")};Xn.prototype.fromBuffer=function(e){return this.buf=e,this};Xn.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};Xn.prototype.fromBN=function(e){return this.buf=Lk().writeVarintBN(e).concat(),this};Xn.prototype.fromNumber=function(e){return this.buf=Lk().writeVarintNum(e).concat(),this};Xn.prototype.toBuffer=function(){return this.buf};Xn.prototype.toBN=function(){return qk(this.buf).readVarintBN()};Xn.prototype.toNumber=function(){return qk(this.buf).readVarintNum()};Uk.exports=Xn});var La=k((Dpe,Hk)=>{"use strict";v();var Zp=xt(),i4=fr(),Fk=zt(),Wp=pi(),Gee=Wn(),Zee=ol(),n4=bn(),o4=Bt(),Wee=ln(),Yee=9007199254740991;function Zr(e){if(!(this instanceof Zr))return new Zr(e);if(Zp.isObject(e))if(this.satoshis=e.satoshis,h.Buffer.isBuffer(e.script))this._scriptBuffer=e.script;else{var t;Zp.isString(e.script)&&Wp.isHexa(e.script)?t=Fk.Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(Zr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(Zr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof i4?(this._satoshisBN=e,this._satoshis=e.toNumber()):Zp.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=i4.fromNumber(this._satoshis)):(o4.checkArgument(Wp.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=i4.fromNumber(e),this._satoshis=e),o4.checkState(Wp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.invalidSatoshis=function(){return this._satoshis>Yee?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};Object.defineProperty(Zr.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),o4.checkState(Wp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.toObject=Zr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};Zr.fromObject=function(e){return new Zr(e)};Zr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=n4.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof Wee.Script.InvalidBuffer)this._script=null;else throw t}};Zr.prototype.setScript=function(e){if(e instanceof n4)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(Zp.isString(e))this._script=n4.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(h.Buffer.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};Zr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};Zr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=Fk.Buffer.from([]),new Zr(t)};Zr.prototype.toBufferWriter=function(e){e||(e=new Gee),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};Zr.prototype.getSize=function(){var e=this.script.toBuffer().length,t=Zee(e).toBuffer().length;return 8+t+e};Hk.exports=Zr});var al=k((qpe,Vk)=>{"use strict";v();var As=xt(),$ee=Bt(),H0=ln(),Xee=Wn(),a4=zt(),zk=pi(),Yp=bn(),Jee=qa(),jk=La(),$p=4294967295,Qee=$p-2,Kk=$p,ete=$p-1;function jt(e){if(!(this instanceof jt))return new jt(e);if(e)return this._fromObject(e)}jt.MAXINT=$p;jt.DEFAULT_SEQNUMBER=Kk;jt.DEFAULT_LOCKTIME_SEQNUMBER=ete;jt.DEFAULT_RBF_SEQNUMBER=Qee;jt.BASE_SIZE=40;Object.defineProperty(jt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new Yp(this._scriptBuffer),this._script._isInput=!0),this._script)}});jt.fromObject=function(e){$ee.checkArgument(As.isObject(e));var t=new jt;return t._fromObject(e)};jt.prototype._fromObject=function(e){var t;if(As.isString(e.prevTxId)&&zk.isHexa(e.prevTxId)?t=a4.Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.output=e.output?e.output instanceof jk?e.output:new jk(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=As.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=As.isUndefined(e.sequenceNumber)?As.isUndefined(e.seqnum)?Kk:e.seqnum:e.sequenceNumber,As.isUndefined(e.script)&&As.isUndefined(e.scriptBuffer))throw new H0.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};jt.prototype.toObject=jt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};jt.fromBufferReader=function(e){var t=new jt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};jt.prototype.toBufferWriter=function(e){e||(e=new Xee),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};jt.prototype.setScript=function(e){if(this._script=null,e instanceof Yp)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(e===null)this._script=Yp.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(zk.isHexa(e))this._scriptBuffer=a4.Buffer.from(e,"hex");else if(As.isString(e))this._script=new Yp(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(h.Buffer.isBuffer(e))this._scriptBuffer=a4.Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};jt.prototype.getSignatures=function(){throw new H0.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};jt.prototype.isFullySigned=function(){throw new H0.AbstractMethodInvoked("Input#isFullySigned")};jt.prototype.isFinal=function(){return this.sequenceNumber===jt.MAXINT};jt.prototype.addSignature=function(){throw new H0.AbstractMethodInvoked("Input#addSignature")};jt.prototype.clearSignatures=function(){throw new H0.AbstractMethodInvoked("Input#clearSignatures")};jt.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,Jee.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};jt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};jt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};Vk.exports=jt});var ul=k((Fpe,Wk)=>{"use strict";v();var sl=xt(),_n=Bt(),tte=Ot(),Gk=pi(),Zk=$n(),rte=ln(),j0=Vr();function Jn(e){if(!(this instanceof Jn))return new Jn(e);if(e instanceof Jn)return e;if(sl.isObject(e))return this._fromObject(e);throw new rte.InvalidArgument("TransactionSignatures must be instantiated from an object")}tte(Jn,j0);Jn.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new Zk(e.publicKey),this.prevTxId=h.Buffer.isBuffer(e.prevTxId)?e.prevTxId:h.Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof j0?e.signature:h.Buffer.isBuffer(e.signature)?j0.fromBuffer(e.signature):j0.fromString(e.signature),this.sigtype=e.sigtype,this};Jn.prototype._checkObjectArgs=function(e){_n.checkArgument(Zk(e.publicKey),"publicKey"),_n.checkArgument(!sl.isUndefined(e.inputIndex),"inputIndex"),_n.checkArgument(!sl.isUndefined(e.outputIndex),"outputIndex"),_n.checkState(sl.isNumber(e.inputIndex),"inputIndex must be a number"),_n.checkState(sl.isNumber(e.outputIndex),"outputIndex must be a number"),_n.checkArgument(e.signature,"signature"),_n.checkArgument(e.prevTxId,"prevTxId"),_n.checkState(e.signature instanceof j0||h.Buffer.isBuffer(e.signature)||Gk.isHexa(e.signature),"signature must be a buffer or hexa value"),_n.checkState(h.Buffer.isBuffer(e.prevTxId)||Gk.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),_n.checkArgument(e.sigtype,"sigtype"),_n.checkState(sl.isNumber(e.sigtype),"sigtype must be a number")};Jn.prototype.toObject=Jn.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};Jn.fromObject=function(e){return _n.checkArgument(e),new Jn(e)};Wk.exports=Jn});var Qk=k((jpe,Jk)=>{"use strict";v();var ite=Ot(),$k=Bt(),s4=al(),nte=La(),ote=qa(),Xk=bn(),Yk=Vr(),ate=ul();function Ua(){s4.apply(this,arguments)}ite(Ua,s4);Ua.prototype.getSignatures=function(e,t,r,i){$k.checkState(this.output instanceof nte),i=i||Yk.SIGHASH_ALL|Yk.SIGHASH_FORKID;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new ate({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:ote.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Ua.prototype.addSignature=function(e,t){return $k.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(Xk.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};Ua.prototype.clearSignatures=function(){return this.setScript(Xk.empty()),this};Ua.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};Ua.SCRIPT_MAX_SIZE=74;Ua.prototype._estimateSize=function(){return s4.BASE_SIZE+Ua.SCRIPT_MAX_SIZE};Jk.exports=Ua});var nR=k((Kpe,iR)=>{"use strict";v();var ste=Ot(),tR=Bt(),ute=cr(),u4=al(),fte=La(),cte=qa(),rR=bn(),eR=Vr(),lte=ul();function Fa(){u4.apply(this,arguments)}ste(Fa,u4);Fa.prototype.getSignatures=function(e,t,r,i,n){tR.checkState(this.output instanceof fte),n=n||ute.sha256ripemd160(t.publicKey.toBuffer()),i=i||eR.SIGHASH_ALL|eR.SIGHASH_FORKID;var o=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return o&&n.equals(o)?[new lte({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:cte.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Fa.prototype.addSignature=function(e,t){return tR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(rR.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};Fa.prototype.clearSignatures=function(){return this.setScript(rR.empty()),this};Fa.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()};Fa.SCRIPT_MAX_SIZE=108;Fa.prototype._estimateSize=function(){return u4.BASE_SIZE+Fa.SCRIPT_MAX_SIZE};iR.exports=Fa});var sR=k((Gpe,aR)=>{"use strict";v();var Qn=xt(),hte=Ot(),Jp=al(),dte=La(),z0=Bt(),oR=bn(),Xp=Vr(),f4=qa(),c4=ul(),pte=$n(),gte=ol();function Br(e,t,r,i){Jp.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new pte(o)),z0.checkState(oR.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},Qn.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}hte(Br,Jp);Br.prototype.toObject=function(){var e=Jp.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=Qn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Br.prototype._deserializeSignatures=function(e){return Qn.map(e,function(t){if(t)return new c4(t)})};Br.prototype._serializeSignatures=function(){return Qn.map(this.signatures,function(e){if(e)return e.toObject()})};Br.prototype.getSignatures=function(e,t,r,i){z0.checkState(this.output instanceof dte),i=i||Xp.SIGHASH_ALL|Xp.SIGHASH_FORKID;var n=this,o=[];return Qn.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new c4({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:f4.sign(e,t,i,r,n.output.script,n.output.satoshisBN),sigtype:i}))}),o};Br.prototype.addSignature=function(e,t){return z0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),z0.checkArgument(!Qn.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),z0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Br.prototype._updateScript=function(){return this.setScript(oR.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Br.prototype._createSignatures=function(){return Qn.map(Qn.filter(this.signatures,function(e){return!Qn.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Br.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Br.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Br.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Br.prototype.countSignatures=function(){return Qn.reduce(this.signatures,function(e,t){return e+!!t},0)};Br.prototype.publicKeysWithoutSignature=function(){var e=this;return Qn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Br.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,f4.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};Br.normalizeSignatures=function(e,t,r,i,n){return n.map(function(o){var a=null;return i=i.filter(function(s){if(a)return!0;var u=new c4({signature:Xp.fromTxFormat(s),publicKey:o,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:Xp.SIGHASH_ALL});u.signature.nhashtype=u.sigtype;var c=f4.verify(e,u.signature,u.publicKey,u.inputIndex,t.output.script);return c?(a=u,!1):!0}),a||null})};Br.SIGNATURE_SIZE=73;Br.prototype._estimateSize=function(){var e=1+this.threshold*Br.SIGNATURE_SIZE;return Jp.BASE_SIZE+gte(e).toBuffer().length+e};aR.exports=Br});var hR=k((Wpe,lR)=>{"use strict";v();var eo=xt(),vte=Ot(),Qp=al(),mte=La(),K0=Bt(),l4=bn(),uR=Vr(),fR=qa(),cR=ul(),yte=$n(),bte=ol();function Er(e,t,r,i){Qp.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new yte(o)),this.redeemScript=l4.buildMultisigOut(this.publicKeys,r),K0.checkState(l4.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},eo.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}vte(Er,Qp);Er.prototype.toObject=function(){var e=Qp.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=eo.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Er.prototype._deserializeSignatures=function(e){return eo.map(e,function(t){if(t)return new cR(t)})};Er.prototype._serializeSignatures=function(){return eo.map(this.signatures,function(e){if(e)return e.toObject()})};Er.prototype.getSignatures=function(e,t,r,i){K0.checkState(this.output instanceof mte),i=i||uR.SIGHASH_ALL|uR.SIGHASH_FORKID;var n=this,o=[];return eo.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new cR({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:fR.sign(e,t,i,r,n.redeemScript,n.output.satoshisBN),sigtype:i}))}),o};Er.prototype.addSignature=function(e,t){return K0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),K0.checkArgument(!eo.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),K0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Er.prototype._updateScript=function(){return this.setScript(l4.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this};Er.prototype._createSignatures=function(){return eo.map(eo.filter(this.signatures,function(e){return!eo.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Er.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Er.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Er.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Er.prototype.countSignatures=function(){return eo.reduce(this.signatures,function(e,t){return e+!!t},0)};Er.prototype.publicKeysWithoutSignature=function(){var e=this;return eo.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Er.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,fR.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)};Er.SIGNATURE_SIZE=73;Er.PUBKEY_SIZE=34;Er.prototype._estimateSize=function(){var e=this.publicKeys.length*Er.PUBKEY_SIZE,t=this.threshold*Er.SIGNATURE_SIZE,r=3+e,i=r<=75?1:r<=255?2:3,n=t+1+i+r;return Qp.BASE_SIZE+bte(n).toBuffer().length+n};lR.exports=Er});var e6=k(($pe,fl)=>{v();fl.exports=al();fl.exports.PublicKey=Qk();fl.exports.PublicKeyHash=nR();fl.exports.MultiSig=sR();fl.exports.MultiSigScriptHash=hR()});var qa=k((Jpe,mR)=>{"use strict";v();var _te=zt(),Fi=Vr(),h4=bn(),wte=La(),Ste=Da(),V0=Wn(),dR=fr(),t6=cr(),pR=i6(),d4=Bt(),p4=r6(),Ps=xt(),gR=h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),xte="ffffffffffffffff",Ete=p4.SCRIPT_ENABLE_SIGHASH_FORKID,Ote=function(e,t,r,i,n){var o=e.inputs[r];d4.checkArgument(n instanceof dR,"For ForkId=0 signatures, satoshis or complete input must be provided");function a(M){var D=new V0;Ps.each(M.inputs,function(K){D.writeReverse(K.prevTxId),D.writeUInt32LE(K.outputIndex)});var L=D.toBuffer(),U=t6.sha256sha256(L);return U}function s(M){var D=new V0;Ps.each(M.inputs,function(K){D.writeUInt32LE(K.sequenceNumber)});var L=D.toBuffer(),U=t6.sha256sha256(L);return U}function u(M,D){var L=new V0;Ps.isUndefined(D)?Ps.each(M.outputs,function(N){N.toBufferWriter(L)}):M.outputs[D].toBufferWriter(L);var U=L.toBuffer(),K=t6.sha256sha256(U);return K}var c=h.Buffer.alloc(32),l=h.Buffer.alloc(32),m=h.Buffer.alloc(32);t&Fi.SIGHASH_ANYONECANPAY||(c=a(e)),!(t&Fi.SIGHASH_ANYONECANPAY)&&(t&31)!==Fi.SIGHASH_SINGLE&&(t&31)!==Fi.SIGHASH_NONE&&(l=s(e)),(t&31)!==Fi.SIGHASH_SINGLE&&(t&31)!==Fi.SIGHASH_NONE?m=u(e):(t&31)===Fi.SIGHASH_SINGLE&&r<e.outputs.length&&(m=u(e,r));var w=new V0;w.writeInt32LE(e.version),w.write(c),w.write(l),w.writeReverse(o.prevTxId),w.writeUInt32LE(o.outputIndex),w.writeVarintNum(i.toBuffer().length),w.write(i.toBuffer()),w.writeUInt64LEBN(n);var E=o.sequenceNumber;w.writeUInt32LE(E),w.write(m),w.writeUInt32LE(e.nLockTime),w.writeUInt32LE(t>>>0);var P=w.toBuffer();return P},vR=function(t,r,i,n,o,a){var s=v4(),u=e6();Ps.isUndefined(a)&&(a=Ete);var c=s.shallowCopy(t);if(n=new h4(n),a&p4.SCRIPT_ENABLE_REPLAY_PROTECTION){var l=r>>8,m=16711680|l^57005;r=m<<8|r&255}if(r&Fi.SIGHASH_FORKID&&a&p4.SCRIPT_ENABLE_SIGHASH_FORKID)return Ote(c,r,i,n,o);n.removeCodeseparators();var w;for(w=0;w<c.inputs.length;w++)c.inputs[w]=new u(c.inputs[w]).setScript(h4.empty());if(c.inputs[i]=new u(c.inputs[i]).setScript(n),(r&31)===Fi.SIGHASH_NONE||(r&31)===Fi.SIGHASH_SINGLE)for(w=0;w<c.inputs.length;w++)w!==i&&(c.inputs[w].sequenceNumber=0);if((r&31)===Fi.SIGHASH_NONE)c.outputs=[];else if((r&31)===Fi.SIGHASH_SINGLE){if(i>=c.outputs.length)return gR;for(c.outputs.length=i+1,w=0;w<i;w++)c.outputs[w]=new wte({satoshis:dR.fromBuffer(_te.Buffer.from(xte,"hex")),script:h4.empty()})}r&Fi.SIGHASH_ANYONECANPAY&&(c.inputs=[c.inputs[i]]);var E=new V0().write(c.toBuffer()).writeInt32LE(r).toBuffer();return E},g4=function(t,r,i,n,o,a){var s=vR(t,r,i,n,o,a);if(s.compare(gR)===0)return s;var u=t6.sha256sha256(s);return u=new Ste(u).readReverse(),u};function Ite(e,t,r,i,n,o,a){var s=g4(e,r,i,n,o,a),u=pR.sign(s,t,"little").set({nhashtype:r});return u}function Ate(e,t,r,i,n,o,a){d4.checkArgument(!Ps.isUndefined(e)),d4.checkArgument(!Ps.isUndefined(t)&&!Ps.isUndefined(t.nhashtype));var s=g4(e,t.nhashtype,i,n,o,a);return pR.verify(s,t,r,"little")}mR.exports={sighashPreimage:vR,sighash:g4,sign:Ite,verify:Ate}});var m4=k((e6e,bR)=>{"use strict";v();var Ha=xt(),n6=Bt(),yR=pi(),Pte=bn(),Tte=hf();function ja(e){if(!(this instanceof ja))return new ja(e);n6.checkArgument(Ha.isObject(e),"Must provide an object from where to extract data");var t=e.address?new Tte(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!yR.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=Ha.isUndefined(e.vout)?e.outputIndex:e.vout;if(!Ha.isNumber(i))throw new Error("Invalid outputIndex, received "+i);n6.checkArgument(!Ha.isUndefined(e.scriptPubKey)||!Ha.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new Pte(e.scriptPubKey||e.script);n6.checkArgument(!Ha.isUndefined(e.amount)||!Ha.isUndefined(e.satoshis),"Must provide an amount for the output");var o=Ha.isUndefined(e.amount)?e.satoshis:Math.round(e.amount*1e8);n6.checkArgument(Ha.isNumber(o),"Amount must be a number"),yR.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}ja.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};ja.prototype.toString=function(){return this.txId+":"+this.outputIndex};ja.fromObject=function(e){return new ja(e)};ja.prototype.toObject=ja.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}};bR.exports=ja});var v4=k((r6e,AR)=>{"use strict";v();var Ee=xt(),Wr=Bt(),kte=zt(),Nr=ln(),wR=pi(),SR=Da(),Rte=Wn(),_R=ol(),xR=cr(),a6=Vr(),ER=qa(),Bte=hf(),OR=m4(),Mr=e6(),Mte=Mr.PublicKeyHash,Nte=Mr.PublicKey,Cte=Mr.MultiSigScriptHash,Dte=Mr.MultiSig,to=La(),Co=bn(),Lte=G0(),o6=fr(),qte=r6(),Ute=qte.SCRIPT_ENABLE_SIGHASH_FORKID;function fe(e){if(!(this instanceof fe))return new fe(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof fe)return fe.shallowCopy(e);if(wR.isHexa(e))this.fromString(e);else if(h.Buffer.isBuffer(e))this.fromBuffer(e);else if(Ee.isObject(e))this.fromObject(e);else throw new Nr.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var Fte=1,Hte=0,jte=1e6;fe.DUST_AMOUNT=546;fe.FEE_SECURITY_MARGIN=150;fe.MAX_MONEY=21e6*1e8;fe.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;fe.NLOCKTIME_MAX_VALUE=4294967295;fe.FEE_PER_KB=500;fe.CHANGE_OUTPUT_MAX_SIZE=62;fe.shallowCopy=function(e){var t=new fe(e.toBuffer());return t};var IR={configurable:!1,enumerable:!0,get:function(){return this._hash=new SR(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(fe.prototype,"hash",IR);Object.defineProperty(fe.prototype,"id",IR);var y4={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(fe.prototype,"inputAmount",y4);y4.get=function(){return this._getOutputAmount()};Object.defineProperty(fe.prototype,"outputAmount",y4);fe.prototype._getHash=function(){return xR.sha256sha256(this.toBuffer())};fe.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};fe.prototype.uncheckedSerialize=fe.prototype.toString=function(){return this.toBuffer().toString("hex")};fe.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()};fe.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};fe.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Nr.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Nr.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};fe.prototype._hasFeeError=function(e,t){if(!Ee.isUndefined(this._fee)&&this._fee!==t)return new Nr.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(fe.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Nr.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Nr.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}};fe.prototype._missingChange=function(){return!this._changeScript};fe.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<fe.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new Nr.Transaction.DustOutputs}};fe.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Nr.Transaction.MissingSignatures};fe.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};fe.prototype.toBuffer=function(){var e=new Rte;return this.toBufferWriter(e).toBuffer()};fe.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),Ee.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),Ee.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e};fe.prototype.fromBuffer=function(e){var t=new SR(e);return this.fromBufferReader(t)};fe.prototype.fromBufferReader=function(e){Wr.checkArgument(!e.finished(),"No transaction data received");var t,r,i;for(this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=Mr.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(to.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this};fe.prototype.toObject=fe.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),Ee.isUndefined(this._changeIndex)||(i.changeIndex=this._changeIndex),Ee.isUndefined(this._fee)||(i.fee=this._fee),i};fe.prototype.fromObject=function(t){Wr.checkArgument(Ee.isObject(t)||t instanceof fe);var r=this,i;return t instanceof fe?i=i.toObject():i=t,Ee.each(i.inputs,function(n){if(!n.output||!n.output.script){r.uncheckedAddInput(new Mr(n));return}var o=new Co(n.output.script),a;if(o.isPublicKeyHashOut())a=new Mr.PublicKeyHash(n);else if(o.isScriptHashOut()&&n.publicKeys&&n.threshold)a=new Mr.MultiSigScriptHash(n,n.publicKeys,n.threshold,n.signatures);else if(o.isPublicKeyOut())a=new Mr.PublicKey(n);else throw new Nr.Transaction.Input.UnsupportedScript(n.output.script);r.addInput(a)}),Ee.each(i.outputs,function(n){r.addOutput(new to(n))}),i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new Co(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};fe.prototype._checkConsistency=function(e){Ee.isUndefined(this._changeIndex)||(Wr.checkState(this._changeScript,"Change script is expected."),Wr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),Wr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&Wr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};fe.prototype.lockUntilDate=function(e){if(Wr.checkArgument(e),Ee.isNumber(e)&&e<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.LockTimeTooEarly;Ee.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.lockUntilBlockHeight=function(e){if(Wr.checkArgument(Ee.isNumber(e)),e>=fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.BlockHeightTooHigh;if(e<0)throw new Nr.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};fe.prototype.fromString=function(e){this.fromBuffer(kte.Buffer.from(e,"hex"))};fe.prototype._newTransaction=function(){this.version=Fte,this.nLockTime=Hte};fe.prototype.from=function(e,t,r){if(Ee.isArray(e)){var i=this;return Ee.each(e,function(o){i.from(o,t,r)}),this}var n=Ee.some(this.inputs,function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex});return n?this:(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e),this)};fe.prototype._fromNonP2SH=function(e){var t;e=new OR(e),e.script.isPublicKeyHashOutPrefix()?t=Mte:e.script.isPublicKeyOut()?t=Nte:t=Mr,this.addInput(new t({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()}))};fe.prototype._fromMultisigUtxo=function(e,t,r){Wr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");var i;if(e=new OR(e),e.script.isMultisigOut())i=Dte;else if(e.script.isScriptHashOut())i=Cte;else throw new Nr.Transaction.Input.UnsupportedScript(e.script.toString());this.addInput(new i({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()},t,r))};fe.prototype.addInput=function(e,t,r){if(Wr.checkArgumentType(e,Mr,"input"),!e.output&&(Ee.isUndefined(t)||Ee.isUndefined(r)))throw new Nr.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&!Ee.isUndefined(r)&&(t=t instanceof Co?t:new Co(t),Wr.checkArgumentType(r,"number","satoshis"),e.output=new to({script:t,satoshis:r})),this.uncheckedAddInput(e)};fe.prototype.uncheckedAddInput=function(e){return Wr.checkArgumentType(e,Mr,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};fe.prototype.hasAllUtxoInfo=function(){return Ee.every(this.inputs.map(function(e){return!!e.output}))};fe.prototype.fee=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};fe.prototype.feePerKb=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};fe.prototype.change=function(e){return Wr.checkArgument(e,"address is required"),this._changeScript=Co.fromAddress(e),this._updateChangeOutput(),this};fe.prototype.getChangeOutput=function(){return Ee.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]};fe.prototype.to=function(e,t){if(Ee.isArray(e)){var r=this;return Ee.each(e,function(i){r.to(i.address,i.satoshis)}),this}return Wr.checkArgument(wR.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new to({script:Co(new Bte(e)),satoshis:t})),this};fe.prototype.addData=function(e){return this.addOutput(new to({script:Co.buildDataOut(e),satoshis:0})),this};fe.prototype.addSafeData=function(e){return this.addOutput(new to({script:Co.buildSafeDataOut(e),satoshis:0})),this};fe.prototype.addOutput=function(e){return Wr.checkArgumentType(e,to,"output"),this._addOutput(e),this._updateChangeOutput(),this};fe.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};fe.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};fe.prototype._getOutputAmount=function(){if(Ee.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,Ee.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount};fe.prototype._getInputAmount=function(){if(Ee.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,Ee.each(this.inputs,function(t){if(Ee.isUndefined(t.output))throw new Nr.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount};fe.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),Ee.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue(),t=this.getFee(),r=e-t;this._removeOutput(this._changeIndex),this._changeIndex=void 0,r>=fe.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:r})))}};fe.prototype.getFee=function(){return this.isCoinbase()?0:Ee.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee};fe.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||fe.FEE_PER_KB))};fe.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};fe.prototype._clearSignatures=function(){Ee.each(this.inputs,function(e){e.clearSignatures!==Mr.prototype.clearSignatures&&e.clearSignatures()})};fe.prototype._estimateSize=function(){var e=8;return e+=_R(this.inputs.length).toBuffer().length,e+=_R(this.outputs.length).toBuffer().length,Ee.each(this.inputs,function(t){e+=t._estimateSize()}),Ee.each(this.outputs,function(t){e+=t.getSize()}),e};fe.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=Ee.without(this.outputs,t),this._outputAmount=void 0};fe.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};fe.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.prevTxId.compare(i.prevTxId)||r.outputIndex-i.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.satoshis-i.satoshis||r.script.toBuffer().compare(i.script.toBuffer())}),t}),this};fe.prototype.shuffleOutputs=function(){return this.sortOutputs(Ee.shuffle)};fe.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};fe.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};fe.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||Ee.difference(this.outputs,e).length!==0;if(t)throw new Nr.Transaction.InvalidSorting;if(!Ee.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};fe.prototype.removeInput=function(e,t){var r;if(!t&&Ee.isNumber(e)?r=e:r=Ee.findIndex(this.inputs,function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Nr.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=Ee.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};fe.prototype.sign=function(e,t){Wr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return Ee.isArray(e)?(Ee.each(e,function(i){r.sign(i,t)}),this):(Ee.each(this.getSignatures(e,t),function(i){r.applySignature(i)}),this)};fe.prototype.getSignatures=function(e,t){e=new Lte(e),t=t||a6.SIGHASH_ALL|a6.SIGHASH_FORKID;var r=this,i=[],n=xR.sha256ripemd160(e.publicKey.toBuffer());return Ee.each(this.inputs,function(a,s){Ee.each(a.getSignatures(r,e,s,t,n),function(u){i.push(u)})}),i};fe.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this};fe.prototype.isFullySigned=function(){return Ee.each(this.inputs,function(e){if(e.isFullySigned===Mr.prototype.isFullySigned)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),Ee.every(Ee.map(this.inputs,function(e){return e.isFullySigned()}))};fe.prototype.isValidSignature=function(e){var t=this;if(this.inputs[e.inputIndex].isValidSignature===Mr.prototype.isValidSignature)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(t,e)};fe.prototype.verifySignature=function(e,t,r,i,n,o){return ER.verify(this,e,t,r,i,n,o)};fe.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new o6(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new o6(fe.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new o6(fe.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>jte)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(!Ee.isUndefined(i[o]))return"transaction input "+t+" duplicate input";i[o]=!0}var a=this.isCoinbase();if(a){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};fe.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};fe.prototype.sighash=function(e,t,r,i,n){t=t||a6.SIGHASH_ALL|a6.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new o6(o.output.satoshis)),n=n||Ute,ER.sighash(this,t,e,r,i,n)};AR.exports=fe});var Ts=k((n6e,df)=>{v();df.exports=v4();df.exports.Input=e6();df.exports.Output=La();df.exports.UnspentOutput=m4();df.exports.Signature=ul();df.exports.Sighash=qa()});var r6=k((a6e,TR)=>{"use strict";v();var s6=xt(),W0=e4(),V=Gp(),Te=fr(),Z0=cr(),pf=Vr(),b4=$n(),PR=Dk(),oe=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};oe.prototype.verify=function(e,t,r,i,n,o){var a=Ts();if(s6.isUndefined(r)&&(r=new a),s6.isUndefined(i)&&(i=0),s6.isUndefined(n)&&(n=0),n&oe.SCRIPT_ENABLE_SIGHASH_FORKID&&(n|=oe.SCRIPT_VERIFY_STRICTENC,!o))throw new Error("internal error - need satoshisBN to verify FORKID transactions");this.set({script:e,tx:r,nin:i,flags:n,satoshisBN:o});var s;if((n&oe.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;n&oe.SCRIPT_VERIFY_P2SH&&(s=this.stack.slice());var u=this.stack;if(this.initialize(),this.set({script:t,stack:u,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var c=this.stack[this.stack.length-1];if(!oe.castToBool(c))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(n&oe.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(s.length===0)throw new Error("internal error - stack copy empty");var l=s[s.length-1],m=W0.fromBuffer(l);if(s.pop(),this.initialize(),this.set({script:m,stack:s,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(s.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!oe.castToBool(s[s.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if((n&oe.SCRIPT_VERIFY_CLEANSTACK)!==0){if((n&oe.SCRIPT_VERIFY_P2SH)===0)throw new Error("internal error - CLEANSTACK without P2SH");if(s.length!==1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0};TR.exports=oe;oe.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0};oe.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin<"u"?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc<"u"?e.pc:this.pc,this.pbegincodehash=typeof e.pbegincodehash<"u"?e.pbegincodehash:this.pbegincodehash,this.nOpCount=typeof e.nOpCount<"u"?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags<"u"?e.flags:this.flags};oe.true=h.Buffer.from([1]);oe.false=h.Buffer.from([]);oe.MAX_SCRIPT_ELEMENT_SIZE=520;oe.MAXIMUM_ELEMENT_SIZE=4;oe.MAX_OPS_PER_SCRIPT=201;oe.LOCKTIME_THRESHOLD=5e8;oe.LOCKTIME_THRESHOLD_BN=new Te(oe.LOCKTIME_THRESHOLD);oe.useGenesisLimits=function(e){return e=e||2147483647,oe.MAX_SCRIPT_ELEMENT_SIZE=e,oe.MAXIMUM_ELEMENT_SIZE=e,oe.MAX_OPS_PER_SCRIPT=e,oe};oe.SCRIPT_VERIFY_NONE=0;oe.SCRIPT_VERIFY_P2SH=1;oe.SCRIPT_VERIFY_STRICTENC=2;oe.SCRIPT_VERIFY_DERSIG=4;oe.SCRIPT_VERIFY_LOW_S=8;oe.SCRIPT_VERIFY_NULLDUMMY=16;oe.SCRIPT_VERIFY_SIGPUSHONLY=32;oe.SCRIPT_VERIFY_MINIMALDATA=64;oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;oe.SCRIPT_VERIFY_CLEANSTACK=256;oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;oe.SCRIPT_VERIFY_MINIMALIF=8192;oe.SCRIPT_VERIFY_NULLFAIL=16384;oe.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768;oe.SCRIPT_ENABLE_SIGHASH_FORKID=65536;oe.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;oe.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18;oe.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19;oe.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;oe.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;oe.SEQUENCE_LOCKTIME_MASK=65535;oe.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};oe.prototype.checkSignatureEncoding=function(e){var t;if(e.length===0)return!0;if((this.flags&(oe.SCRIPT_VERIFY_DERSIG|oe.SCRIPT_VERIFY_LOW_S|oe.SCRIPT_VERIFY_STRICTENC))!==0&&!pf.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if((this.flags&oe.SCRIPT_VERIFY_LOW_S)!==0){if(t=pf.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if((this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0){if(t=pf.fromTxFormat(e),!t.hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&pf.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&pf.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0};oe.prototype.checkPubkeyEncoding=function(e){return(this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0&&!b4.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):!0};oe._isMinimallyEncoded=function(e,t){return t=t||oe.MAXIMUM_ELEMENT_SIZE,!(e.length>t||e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))};oe._minimallyEncode=function(e){if(e.length===0)return e;var t=e[e.length-1];if(t&127)return e;if(e.length===1)return h.Buffer.from("");if(e[e.length-2]&128)return e;for(var r=e.length-1;r>0;r--)if(e[r-1]!==0)return e[r-1]&128?e[r++]=t:e[r-1]|=t,e.slice(0,r);return h.Buffer.from("")};oe.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:V.fromNumber(this.script.chunks[this.pc].opcodenum)};var e=this.step();if(!e)return!1;this._callbackStep(t)}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};oe.prototype._callbackStep=function(e){if(typeof this.stepListener=="function")try{this.stepListener(e,PR(this.stack,!0),PR(this.altstack,!0))}catch(t){console.log(`Error in Step callback:${t}`)}};oe.prototype.checkLockTime=function(e){return!(!(this.tx.nLockTime<oe.LOCKTIME_THRESHOLD&&e.lt(oe.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=oe.LOCKTIME_THRESHOLD&&e.gte(oe.LOCKTIME_THRESHOLD_BN))||e.gt(new Te(this.tx.nLockTime))||this.tx.inputs[this.nin].isFinal())};oe.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||t&oe.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=oe.SEQUENCE_LOCKTIME_TYPE_FLAG|oe.SEQUENCE_LOCKTIME_MASK,i=new Te(t&r),n=e.and(r),o=new Te(oe.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o))||n.gt(i))};function zte(e,t){let r=e;for(;r.length<t;)r=h.Buffer.concat([h.Buffer.from([0]),r]);return r}oe.prototype.step=function(){var e=this;function t(se){return e.stack[e.stack.length+se]}function r(se){switch(se){case V.OP_2MUL:case V.OP_2DIV:return!0;case V.OP_INVERT:case V.OP_MUL:case V.OP_LSHIFT:case V.OP_RSHIFT:if((e.flags&oe.SCRIPT_ENABLE_MAGNETIC_OPCODES)===0)return!0;break;case V.OP_DIV:case V.OP_MOD:case V.OP_SPLIT:case V.OP_CAT:case V.OP_AND:case V.OP_OR:case V.OP_XOR:case V.OP_BIN2NUM:case V.OP_NUM2BIN:return!1;default:break}return!1}var i=(this.flags&oe.SCRIPT_VERIFY_MINIMALDATA)!==0,n=this.vfExec.indexOf(!1)===-1,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F=this.script.chunks[this.pc];this.pc++;var H=F.opcodenum;if(s6.isUndefined(H))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(F.buf&&F.buf.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(H>V.OP_16&&++this.nOpCount>oe.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(r(H))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(n&&H>=0&&H<=V.OP_PUSHDATA4){if(i&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!F.buf)this.stack.push(oe.false);else{if(F.len!==F.buf.length)throw new Error(`Length of push value not equal to length of data (${F.len},${F.buf.length})`);this.stack.push(F.buf)}}else if(n||V.OP_IF<=H&&H<=V.OP_ENDIF)switch(H){case V.OP_1NEGATE:case V.OP_1:case V.OP_2:case V.OP_3:case V.OP_4:case V.OP_5:case V.OP_6:case V.OP_7:case V.OP_8:case V.OP_9:case V.OP_10:case V.OP_11:case V.OP_12:case V.OP_13:case V.OP_14:case V.OP_15:case V.OP_16:c=H-(V.OP_1-1),o=new Te(c).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_NOP:break;case V.OP_NOP2:case V.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=Te.fromScriptNumBuffer(this.stack[this.stack.length-1],i,5);if(z.lt(new Te(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(z))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP3:case V.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var G=Te.fromScriptNumBuffer(t(-1),i,5);if(G.lt(new Te(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((G&oe.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(G))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP1:case V.OP_NOP4:case V.OP_NOP5:case V.OP_NOP6:case V.OP_NOP7:case V.OP_NOP8:case V.OP_NOP9:case V.OP_NOP10:if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case V.OP_IF:case V.OP_NOTIF:if(N=!1,n){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(o=t(-1),this.flags&oe.SCRIPT_VERIFY_MINIMALIF){if(o.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(o.length===1&&o[0]!==1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}N=oe.castToBool(o),H===V.OP_NOTIF&&(N=!N),this.stack.pop()}this.vfExec.push(N);break;case V.OP_ELSE:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case V.OP_ENDIF:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case V.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),N=oe.castToBool(o),N)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1;break;case V.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case V.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case V.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case V.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case V.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3),s=t(-2);var B=t(-1);this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s)),this.stack.push(h.Buffer.from(B));break;case V.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-4),s=t(-3),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-6,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-4,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1),N=oe.castToBool(o),N&&this.stack.push(h.Buffer.from(o));break;case V.OP_DEPTH:o=new Te(this.stack.length).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case V.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-1)));break;case V.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case V.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-2)));break;case V.OP_PICK:case V.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),w=Te.fromScriptNumBuffer(o,i),c=w.toNumber(),this.stack.pop(),c<0||c>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-c-1),H===V.OP_ROLL&&this.stack.splice(this.stack.length-c-1,1),this.stack.push(h.Buffer.from(o));break;case V.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-3),m=t(-2);var g=t(-1);this.stack[this.stack.length-3]=m,this.stack[this.stack.length-2]=g,this.stack[this.stack.length-1]=l;break;case V.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-2),m=t(-1),this.stack[this.stack.length-2]=m,this.stack[this.stack.length-1]=l;break;case V.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,h.Buffer.from(t(-1)));break;case V.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new Te(t(-1).length),this.stack.push(w.toScriptNumBuffer());break;case V.OP_AND:case V.OP_OR:case V.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length!==s.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(H){case V.OP_AND:for(let se=0;se<a.length;se++)a[se]&=s[se];break;case V.OP_OR:for(let se=0;se<a.length;se++)a[se]|=s[se];break;case V.OP_XOR:for(let se=0;se<a.length;se++)a[se]^=s[se];break;default:break}this.stack.pop();break;case V.OP_INVERT:this.stack.length<1&&(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION"),o=t(-1);for(let se=0;se<o.length;se++)o[se]=~o[se];break;case V.OP_LSHIFT:case V.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),a.length===0)this.stack.pop();else{if(E=new Te(a),P=Te.fromScriptNumBuffer(t(-1),i),c=P.toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop();let se;H===V.OP_LSHIFT&&(se=E.ushln(c)),H===V.OP_RSHIFT&&(se=E.ushrn(c));let ue=zte(h.Buffer.from(se.toArray().slice(a.length*-1)),a.length);this.stack.push(ue)}break;case V.OP_EQUAL:case V.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1);var O=a.toString("hex")===s.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?oe.true:oe.false),H===V.OP_EQUALVERIFY)if(O)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;break;case V.OP_1ADD:case V.OP_1SUB:case V.OP_NEGATE:case V.OP_ABS:case V.OP_NOT:case V.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(o=t(-1),w=Te.fromScriptNumBuffer(o,i),H){case V.OP_1ADD:w=w.add(Te.One);break;case V.OP_1SUB:w=w.sub(Te.One);break;case V.OP_NEGATE:w=w.neg();break;case V.OP_ABS:w.cmp(Te.Zero)<0&&(w=w.neg());break;case V.OP_NOT:w=new Te((w.cmp(Te.Zero)===0)+0);break;case V.OP_0NOTEQUAL:w=new Te((w.cmp(Te.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(w.toScriptNumBuffer());break;case V.OP_ADD:case V.OP_SUB:case V.OP_MUL:case V.OP_MOD:case V.OP_DIV:case V.OP_BOOLAND:case V.OP_BOOLOR:case V.OP_NUMEQUAL:case V.OP_NUMEQUALVERIFY:case V.OP_NUMNOTEQUAL:case V.OP_LESSTHAN:case V.OP_GREATERTHAN:case V.OP_LESSTHANOREQUAL:case V.OP_GREATERTHANOREQUAL:case V.OP_MIN:case V.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(E=Te.fromScriptNumBuffer(t(-2),i,oe.MAXIMUM_ELEMENT_SIZE),P=Te.fromScriptNumBuffer(t(-1),i,oe.MAXIMUM_ELEMENT_SIZE),w=new Te(0),H){case V.OP_ADD:w=E.add(P);break;case V.OP_SUB:w=E.sub(P);break;case V.OP_MUL:w=E.mul(P);break;case V.OP_DIV:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.div(P);break;case V.OP_MOD:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.mod(P);break;case V.OP_BOOLAND:w=new Te((E.cmp(Te.Zero)!==0&&P.cmp(Te.Zero)!==0)+0);break;case V.OP_BOOLOR:w=new Te((E.cmp(Te.Zero)!==0||P.cmp(Te.Zero)!==0)+0);break;case V.OP_NUMEQUAL:w=new Te((E.cmp(P)===0)+0);break;case V.OP_NUMEQUALVERIFY:w=new Te((E.cmp(P)===0)+0);break;case V.OP_NUMNOTEQUAL:w=new Te((E.cmp(P)!==0)+0);break;case V.OP_LESSTHAN:w=new Te((E.cmp(P)<0)+0);break;case V.OP_GREATERTHAN:w=new Te((E.cmp(P)>0)+0);break;case V.OP_LESSTHANOREQUAL:w=new Te((E.cmp(P)<=0)+0);break;case V.OP_GREATERTHANOREQUAL:w=new Te((E.cmp(P)>=0)+0);break;case V.OP_MIN:w=E.cmp(P)<0?E:P;break;case V.OP_MAX:w=E.cmp(P)>0?E:P;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),H===V.OP_NUMEQUALVERIFY)if(oe.castToBool(t(-1)))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;break;case V.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;E=Te.fromScriptNumBuffer(t(-3),i,oe.MAXIMUM_ELEMENT_SIZE),P=Te.fromScriptNumBuffer(t(-2),i,oe.MAXIMUM_ELEMENT_SIZE);var y=Te.fromScriptNumBuffer(t(-1),i,oe.MAXIMUM_ELEMENT_SIZE);N=P.cmp(E)<=0&&E.cmp(y)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(N?oe.true:oe.false);break;case V.OP_RIPEMD160:case V.OP_SHA1:case V.OP_SHA256:case V.OP_HASH160:case V.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1);var f;H===V.OP_RIPEMD160?f=Z0.ripemd160(o):H===V.OP_SHA1?f=Z0.sha1(o):H===V.OP_SHA256?f=Z0.sha256(o):H===V.OP_HASH160?f=Z0.sha256ripemd160(o):H===V.OP_HASH256&&(f=Z0.sha256sha256(o)),this.stack.pop(),this.stack.push(f);break;case V.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case V.OP_CHECKSIG:case V.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(M=t(-2),D=t(-1),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;L=new W0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var d=new W0().add(M);L.findAndDelete(d);try{U=pf.fromTxFormat(M),K=b4.fromBuffer(D,!1),C=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{C=!1}if(!C&&this.flags&oe.SCRIPT_VERIFY_NULLFAIL&&M.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(C?oe.true:oe.false),H===V.OP_CHECKSIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;break;case V.OP_CHECKMULTISIG:case V.OP_CHECKMULTISIGVERIFY:var _=1;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var x=Te.fromScriptNumBuffer(t(-_),i).toNumber();if(x<0||x>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=x,this.nOpCount>oe.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var b=++_;_+=x;var p=x+2;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var I=Te.fromScriptNumBuffer(t(-_),i).toNumber();if(I<0||I>x)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var T=++_;if(_+=I,this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;L=new W0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var S=0;S<I;S++)M=t(-T-S),L.findAndDelete(new W0().add(M));for(C=!0;C&&I>0;){if(M=t(-T),D=t(-b),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;var R;try{U=pf.fromTxFormat(M),K=b4.fromBuffer(D,!1),R=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{R=!1}R&&(T++,I--),b++,x--,I>x&&(C=!1)}for(;_-- >1;){if(!C&&this.flags&oe.SCRIPT_VERIFY_NULLFAIL&&!p&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;p>0&&p--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&oe.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(C?oe.true:oe.false),H===V.OP_CHECKMULTISIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;break;case V.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length+s.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=h.Buffer.concat([a,s]),this.stack.pop();break;case V.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2);var Y=Te.fromScriptNumBuffer(t(-1),i).toNumber();if(Y<0||Y>a.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var X=h.Buffer.from(a);this.stack[this.stack.length-2]=X.slice(0,Y),this.stack[this.stack.length-1]=X.slice(Y);break;case V.OP_LEFT:case V.OP_RIGHT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),c=Te.fromScriptNumBuffer(t(-1),i).toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;c>a.length&&(c=a.length),this.stack.pop(),H===V.OP_LEFT?this.stack[this.stack.length-1]=h.Buffer.from(a).slice(0,c):this.stack[this.stack.length-1]=h.Buffer.from(a).slice(a.length-c);break;case V.OP_SUBSTR:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3);var ie=Te.fromScriptNumBuffer(t(-1),i).toNumber(),ce=Te.fromScriptNumBuffer(t(-2),i).toNumber();if(ce<0||ie<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;ce>a.length&&(ce=a.length),ce+ie>a.length&&(ie=a.length-ce),this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=h.Buffer.from(a).slice(ce,ce+ie);break;case V.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var pe=Te.fromScriptNumBuffer(t(-1),i).toNumber();if(pe>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var q=t(-1);if(q=oe._minimallyEncode(q),q.length>pe)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(q.length===pe){this.stack[this.stack.length-1]=q;break}var W=0;q.length>0&&(W=q[q.length-1]&128,q[q.length-1]&=127);var $=h.Buffer.alloc(pe);q.copy($,0);for(var ee=q.length-1;ee++<pe-2;)$[ee]=0;$[ee]=W,this.stack[this.stack.length-1]=$;break;case V.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-1),s=oe._minimallyEncode(a),this.stack[this.stack.length-1]=s,!oe._isMinimallyEncoded(s))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}});var bn=k((u6e,_4)=>{v();_4.exports=e4();_4.exports.Interpreter=r6()});var hf=k((c6e,MR)=>{"use strict";v();var w4=xt(),za=Bt(),Kte=ln(),kR=el(),wn=ws(),RR=cr(),BR=pi(),S4=$n();function me(e,t,r){if(!(this instanceof me))return new me(e,t,r);if(w4.isArray(e)&&w4.isNumber(t))return me.createMultisig(e,t,r);if(e instanceof me)return e;if(za.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!wn.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==me.PayToPublicKeyHash&&r!==me.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||wn.get(t)||wn.defaultNetwork,i.type=i.type||r||me.PayToPublicKeyHash,BR.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}me.prototype._classifyArguments=function(e,t,r){if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===20)return me._transformHash(e);if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===21)return me._transformBuffer(e,t,r);if(e instanceof S4)return me._transformPublicKey(e);if(e instanceof Y0)return me._transformScript(e,t);if(typeof e=="string")return me._transformString(e,t,r);if(w4.isObject(e))return me._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};me.PayToPublicKeyHash="pubkeyhash";me.PayToScriptHash="scripthash";me._transformHash=function(e){var t={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t};me._transformObject=function(e){return za.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),za.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?h.Buffer.from(e.hash,"hex"):e.hashBuffer,network:wn.get(e.network)||wn.defaultNetwork,type:e.type}};me._classifyFromVersion=function(e){var t={},r=wn.get(e[0],"pubkeyhash"),i=wn.get(e[0],"scripthash");return r?(t.network=r,t.type=me.PayToPublicKeyHash):i&&(t.network=i,t.type=me.PayToScriptHash),t};me._transformBuffer=function(e,t,r){var i={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==21)throw new TypeError("Address buffers must be exactly 21 bytes.");var n=wn.get(t),o=me._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=o.network,i.type=o.type,i};me._transformPublicKey=function(e){var t={};if(!(e instanceof S4))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=RR.sha256ripemd160(e.toBuffer()),t.type=me.PayToPublicKeyHash,t};me._transformScript=function(e,t){za.checkArgument(e instanceof Y0,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new Kte.Script.CantDeriveAddress(e);return r};me.createMultisig=function(e,t,r){return r=r||e[0].network||wn.defaultNetwork,me.payingTo(Y0.buildMultisigOut(e,t),r)};me._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=wn.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=kR.decode(e);return me._transformBuffer(n,t,r)};me.fromPublicKey=function(e,t){var r=me._transformPublicKey(e);return t=t||wn.defaultNetwork,new me(r.hashBuffer,t,r.type)};me.fromPrivateKey=function(e,t){let r=S4.fromPrivateKey(e);return t=t||e.network||wn.defaultNetwork,me.fromPublicKey(r,t)};me.fromPublicKeyHash=function(e,t){var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToPublicKeyHash)};me.fromScriptHash=function(e,t){za.checkArgument(e,"hash parameter is required");var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToScriptHash)};me.payingTo=function(e,t){return za.checkArgument(e,"script is required"),za.checkArgument(e instanceof Y0,"script must be instance of Script"),me.fromScriptHash(RR.sha256ripemd160(e.toBuffer()),t)};me.fromScript=function(e,t){za.checkArgument(e instanceof Y0,"script must be a Script instance");var r=me._transformScript(e,t);return new me(r.hashBuffer,t,r.type)};me.fromBuffer=function(e,t,r){var i=me._transformBuffer(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromHex=function(e,t,r){return me.fromBuffer(h.Buffer.from(e,"hex"),t,r)};me.fromString=function(e,t,r){var i=me._transformString(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromObject=function(t){za.checkState(BR.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=h.Buffer.from(t.hash,"hex");return new me(r,t.network,t.type)};me.getValidationError=function(e,t,r){var i;try{new me(e,t,r)}catch(n){i=n}return i};me.isValid=function(e,t,r){return!me.getValidationError(e,t,r)};me.prototype.isPayToPublicKeyHash=function(){return this.type===me.PayToPublicKeyHash};me.prototype.isPayToScriptHash=function(){return this.type===me.PayToScriptHash};me.prototype.toBuffer=function(){var e=h.Buffer.from([this.network[this.type]]),t=h.Buffer.concat([e,this.hashBuffer]);return t};me.prototype.toHex=function(){return this.toBuffer().toString("hex")};me.prototype.toObject=me.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};me.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};me.prototype.toString=function(){return kR.encode(this.toBuffer())};MR.exports=me;var Y0=bn()});var G0=k((h6e,qR)=>{"use strict";v();var u6=xt(),Vte=hf(),NR=el(),gf=fr(),CR=pi(),Ka=ws(),DR=gn(),Gte=$n(),Zte=Ku(),LR=Bt();function Me(e,t){if(!(this instanceof Me))return new Me(e,t);if(e instanceof Me)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new gf(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(DR.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return CR.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}Me.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?Ka.get(t):Ka.defaultNetwork};if(u6.isUndefined(e)||u6.isNull(e))r.bn=Me._getRandomBN();else if(e instanceof gf)r.bn=e;else if(e instanceof h.Buffer||e instanceof Uint8Array)r=Me._transformBuffer(e,t);else if(e.bn&&e.network)r=Me._transformObject(e);else if(!t&&Ka.get(e))r.bn=Me._getRandomBN(),r.network=Ka.get(e);else if(typeof e=="string")CR.isHexa(e)?r.bn=new gf(h.Buffer.from(e,"hex")):r=Me._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};Me._getRandomBN=function(){var e,t;do{var r=Zte.getRandomBuffer(32);t=gf.fromBuffer(r),e=t.lt(DR.getN())}while(!e);return t};Me._transformBuffer=function(e,t){var r={};if(e.length===32)return Me._transformBNBuffer(e,t);if(r.network=Ka.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==Ka.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=gf.fromBuffer(e.slice(1,33)),r};Me._transformBNBuffer=function(e,t){var r={};return r.network=Ka.get(t)||Ka.defaultNetwork,r.bn=gf.fromBuffer(e),r.compressed=!1,r};Me._transformWIF=function(e,t){return Me._transformBuffer(NR.decode(e),t)};Me.fromBuffer=function(e,t){return new Me(e,t)};Me.fromHex=function(e,t){return Me.fromBuffer(h.Buffer.from(e,"hex"),t)};Me._transformObject=function(e){var t=new gf(e.bn,"hex"),r=Ka.get(e.network);return{bn:t,network:r,compressed:e.compressed}};Me.fromString=Me.fromWIF=function(e){return LR.checkArgument(u6.isString(e),"First argument is expected to be a string."),new Me(e)};Me.fromObject=Me.fromJSON=function(e){return LR.checkArgument(u6.isObject(e),"First argument is expected to be an object."),new Me(e)};Me.fromRandom=function(e){var t=Me._getRandomBN();return new Me(t,e)};Me.getValidationError=function(e,t){var r;try{new Me(e,t)}catch(i){r=i}return r};Me.isValid=function(e,t){return e?!Me.getValidationError(e,t):!1};Me.prototype.toString=function(){return this.toWIF()};Me.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),h.Buffer.from([1])]):r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),NR.encode(r)};Me.prototype.toBigNumber=function(){return this.bn};Me.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};Me.prototype.toHex=function(){return this.toBuffer().toString("hex")};Me.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=Gte.fromPrivateKey(this)),this._pubkey};Me.prototype.toAddress=function(e){var t=this.toPublicKey();return Vte.fromPublicKey(t,e||this.network)};Me.prototype.toObject=Me.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};Me.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"};qR.exports=Me});var $n=k((p6e,FR)=>{"use strict";v();var cl=fr(),ll=gn(),Wte=cr(),Yte=pi(),UR=ws(),x4=xt(),vf=Bt();function Se(e,t){if(!(this instanceof Se))return new Se(e,t);if(vf.checkArgument(e,"First argument is required, please include public key data."),e instanceof Se)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),Yte.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||UR.defaultNetwork}),this}Se.prototype._classifyArgs=function(e,t){var r={compressed:x4.isUndefined(t.compressed)||t.compressed};if(e instanceof ll)r.point=e;else if(e.x&&e.y)r=Se._transformObject(e);else if(typeof e=="string")r=Se._transformDER(h.Buffer.from(e,"hex"));else if(Se._isBuffer(e))r=Se._transformDER(e);else if(Se._isPrivateKey(e))r=Se._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=x4.isUndefined(t.network)?void 0:UR.get(t.network)),r};Se._isPrivateKey=function(e){var t=G0();return e instanceof t};Se._isBuffer=function(e){return e instanceof h.Buffer||e instanceof Uint8Array};Se._transformPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=ll.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};Se._transformDER=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r={};t=x4.isUndefined(t)?!0:t;var i,n,o,a;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),a=e.slice(33,65),o.length!==32||a.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new cl(o),n=new cl(a),r.point=new ll(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new cl(o),r=Se._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new cl(o),r=Se._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};Se._transformX=function(e,t){vf.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=ll.fromX(e,t),r};Se._transformObject=function(e){var t=new cl(e.x,"hex"),r=new cl(e.y,"hex"),i=new ll(t,r);return new Se(i,{compressed:e.compressed})};Se.fromPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t=Se._transformPrivateKey(e);return new Se(t.point,{compressed:t.compressed,network:t.network})};Se.fromDER=Se.fromBuffer=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r=Se._transformDER(e,t);return new Se(r.point,{compressed:r.compressed})};Se.fromPoint=function(e,t){return vf.checkArgument(e instanceof ll,"First argument must be an instance of Point."),new Se(e,{compressed:t})};Se.fromHex=Se.fromString=function(e,t){var r=h.Buffer.from(e,t||"hex"),i=Se._transformDER(r);return new Se(i.point,{compressed:i.compressed})};Se.fromX=function(e,t){var r=Se._transformX(e,t);return new Se(r.point,{compressed:r.compressed})};Se.getValidationError=function(e){var t;try{new Se(e)}catch(r){t=r}return t};Se.isValid=function(e){return!Se.getValidationError(e)};Se.prototype.toObject=Se.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};Se.prototype.toBuffer=Se.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])}else return n=h.Buffer.from([4]),h.Buffer.concat([n,r,i])};Se.prototype._getID=function(){return Wte.sha256ripemd160(this.toBuffer())};Se.prototype.toAddress=function(e){var t=hf();return t.fromPublicKey(this,e||this.network)};Se.prototype.toString=Se.prototype.toHex=function(){return this.toDER().toString("hex")};Se.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"};FR.exports=Se});var i6=k((v6e,HR)=>{"use strict";v();var Hi=fr(),Do=gn(),$te=Vr(),Xte=$n(),Jte=Ku(),ks=cr(),Qte=xt(),E4=Bt(),Gt=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};Gt.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(h.Buffer.isBuffer(e.sig)){var t=Vr();this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return this.k=e.k||this.k,this.verified=e.verified||this.verified,this};Gt.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()};Gt.prototype.calci=function(){for(var e=0;e<4;e++){this.sig.i=e;var t;try{t=this.toPublicKey()}catch(r){console.error(r);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")};Gt.fromString=function(e){var t=JSON.parse(e);return new Gt(t)};Gt.prototype.randomK=function(){var e=Do.getN(),t;do t=Hi.fromBuffer(Jte.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(Hi.Zero)));return this.k=t,this};Gt.prototype.deterministicK=function(e){Qte.isUndefined(e)&&(e=0);var t=h.Buffer.alloc(32);t.fill(1);var r=h.Buffer.alloc(32);r.fill(0);var i=this.privkey.bn.toBuffer({size:32}),n=this.endian==="little"?h.Buffer.from(this.hashbuf).reverse():this.hashbuf;r=ks.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0]),i,n]),r),t=ks.sha256hmac(t,r),r=ks.sha256hmac(h.Buffer.concat([t,h.Buffer.from([1]),i,n]),r),t=ks.sha256hmac(t,r),t=ks.sha256hmac(t,r);for(var o=Hi.fromBuffer(t),a=Do.getN(),s=0;s<e||!(o.lt(a)&&o.gt(Hi.Zero));s++)r=ks.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0])]),r),t=ks.sha256hmac(t,r),t=ks.sha256hmac(t,r),o=Hi.fromBuffer(t);return this.k=o,this};Gt.prototype.toPublicKey=function(){var e=this.sig.i;E4.checkArgument(e===0||e===1||e===2||e===3,new Error("i must be equal to 0, 1, 2, or 3"));var t=Hi.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,n=e&1,o=e>>1,a=Do.getN(),s=Do.getG(),u=o?r.add(a):r,c=Do.fromX(n,u),l=c.mul(a);if(!l.isInfinity())throw new Error("nR is not a valid curve point");var m=t.neg().umod(a),w=r.invm(a),E=c.mul(i).add(s.mul(m)).mul(w),P=Xte.fromPoint(E,this.sig.compressed);return P};Gt.prototype.sigError=function(){if(!h.Buffer.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=Do.getN();try{if(e.lte(Hi.Zero)||t.lte(Hi.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var i=Hi.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),n=t.invm(r),o=n.mul(i).umod(r),a=n.mul(e).umod(r),s=Do.getG().mulAdd(o,this.pubkey.point,a);return s.isInfinity()?"p is infinity":s.getX().umod(r).cmp(e)!==0?"Invalid signature":!1}catch(u){return"Signature security validation failed: "+u.message}};Gt.toLowS=function(e){return e.gt(Hi.fromBuffer(h.Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=Do.getN().sub(e)),e};Gt.prototype._findSignature=function(e,t){var r=Do.getN(),i=Do.getG(),n=0,o,a,s,u;do(!this.k||n>0)&&this.deterministicK(n),n++,o=this.k,a=i.mul(o),s=a.x.umod(r),u=o.invm(r).mul(t.add(e.mul(s))).umod(r);while(s.cmp(Hi.Zero)<=0||u.cmp(Hi.Zero)<=0);return u=Gt.toLowS(u),{s:u,r:s}};Gt.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;E4.checkState(e&&t&&r,new Error("invalid parameters")),E4.checkState(h.Buffer.isBuffer(e)&&e.length===32,new Error("hashbuf must be a 32 byte buffer"));var i=Hi.fromBuffer(e,this.endian?{endian:this.endian}:void 0),n=this._findSignature(r,i);return n.compressed=this.pubkey.compressed,this.sig=new $te(n),this};Gt.prototype.signRandomK=function(){return this.randomK(),this.sign()};Gt.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)};Gt.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this};Gt.prototype.verifyBool=function(){return this.verify().verified===!0};Gt.sign=function(e,t,r){return Gt().set({hashbuf:e,endian:r,privkey:t}).sign().sig};Gt.signWithCalcI=function(e,t,r){return Gt().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig};Gt.signRandomK=function(e,t,r){return Gt().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig};Gt.verify=function(e,t,r,i){return Gt().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify().verified};HR.exports=Gt});var zR=k((O4,jR)=>{v();(function(e,t){"use strict";typeof define=="function"&&define.amd?define([],function(){return e.secrets=t()}):typeof O4=="object"?jR.exports=t(_r()):e.secrets=t(e.crypto)})(O4,function(e){"use strict";var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!!(r&&r.rng&&typeof r.rng=="function")}function u(N,C){var F;if(C===0||C===1)return N;if(C&&C>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return C=C||r.bits,N&&(F=N.length%C),F?(i+N).slice(-(C-F+N.length)):N}function c(N){var C="",F,H;for(H=N.length-1;H>=0;H--){if(F=parseInt(N[H],16),isNaN(F))throw new Error("Invalid hex character.");C=u(F.toString(2),4)+C}return C}function l(N){var C="",F,H;for(N=u(N,4),H=N.length;H>=4;H-=4){if(F=parseInt(N.slice(H-4,H),2),isNaN(F))throw new Error("Invalid binary character.");C=F.toString(16)+C}return C}function m(){return!!(e&&typeof e=="object"&&(typeof e.getRandomValues=="function"||typeof e.getRandomValues=="object")&&(typeof Uint32Array=="function"||typeof Uint32Array=="object"))}function w(){return typeof e=="object"&&typeof e.randomBytes=="function"}function E(N){function C(G,B,g,O){var y=0,f,d="",_;for(B&&(f=B.length-1);y<f||d.length<G;)_=Math.abs(parseInt(B[y],g)),d=d+u(_.toString(2),O),y++;return d=d.substr(-G),(d.match(/0/g)||[]).length===d.length?null:d}function F(G){var B,g,O,y,f=null;for(O=16,y=4,g=Math.ceil(G/8);f===null;)B=e.randomBytes(g),f=C(G,B.toString("hex"),O,y);return f}function H(G){var B,g,O,y=null;for(g=10,O=32,B=Math.ceil(G/32);y===null;)y=C(G,e.getRandomValues(new Uint32Array(B)),g,O);return y}function z(G){var B,g,O,y,f,d=null;y=10,f=32,g=Math.ceil(G/32),O=123456789,B=new Uint32Array(g);for(var _=0;_<B.length;_++)B[_]=O;for(;d===null;)d=C(G,B,y,f);return d}if(N&&N==="testRandom")return r.typeCSPRNG=N,z;if(N&&N==="nodeCryptoRandomBytes")return r.typeCSPRNG=N,F;if(N&&N==="browserCryptoGetRandomValues")return r.typeCSPRNG=N,H;if(w())return r.typeCSPRNG="nodeCryptoRandomBytes",F;if(m())return r.typeCSPRNG="browserCryptoGetRandomValues",H}function P(N,C){var F=[],H;for(C&&(N=u(N,C)),H=N.length;H>r.bits;H-=r.bits)F.push(parseInt(N.slice(H-r.bits,H),2));return F.push(parseInt(N.slice(0,H),2)),F}function M(N,C){var F=r.logs[N],H=0,z;for(z=C.length-1;z>=0;z--)H!==0?H=r.exps[(F+r.logs[H])%r.maxShares]^C[z]:H=C[z];return H}function D(N,C,F){var H=0,z,G,B,g;for(B=0,z=C.length;B<z;B++)if(F[B]){for(G=r.logs[F[B]],g=0;g<z;g++)if(B!==g){if(N===C[g]){G=-1;break}G=(G+r.logs[N^C[g]]-r.logs[C[B]^C[g]]+r.maxShares)%r.maxShares}H=G===-1?H:H^r.exps[G]}return H}function L(N,C,F){var H=[],z=[N],G,B;for(G=1;G<F;G++)z[G]=parseInt(r.rng(r.bits),2);for(G=1,B=C+1;G<B;G++)H[G-1]={x:G,y:M(G,z)};return H}function U(N,C,F){var H,z,G,B,g;if(C=parseInt(C,r.radix),N=parseInt(N,10)||r.bits,H=N.toString(36).toUpperCase(),G=Math.pow(2,N)-1,B=G.toString(r.radix).length,z=u(C.toString(r.radix),B),typeof C!="number"||C%1!==0||C<1||C>G)throw new Error("Share id must be an integer between 1 and "+G+", inclusive.");return g=H+z+F,g}var K={init:function(N,C){var F=[],H=[],z=1,G,B;if(a(),N&&(typeof N!="number"||N%1!==0||N<t.minBits||N>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(C&&o.indexOf(C)===-1)throw new Error("Invalid RNG type argument : '"+C+"'");for(r.radix=t.radix,r.bits=N||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,G=t.primitivePolynomials[r.bits],B=0;B<r.size;B++)H[B]=z,F[z]=B,z=z<<1,z>=r.size&&(z=z^G,z=z&r.maxShares);if(r.logs=F,r.exps=H,C&&this.setRNG(C),s()||this.setRNG(),!s()||!r.bits||!r.size||!r.maxShares||!r.logs||!r.exps||r.logs.length!==r.size||r.exps.length!==r.size)throw new Error("Initialization failed.")},combine:function(N,C){var F,H,z,G,B="",g,O,y,f=[],d=[];for(C=C||0,F=0,z=N.length;F<z;F++){if(O=this.extractShareComponents(N[F]),g===void 0)g=O.bits;else if(O.bits!==g)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==g&&this.init(g),f.indexOf(O.id)===-1)for(f.push(O.id),y=P(c(O.data)),H=0,G=y.length;H<G;H++)d[H]=d[H]||[],d[H][f.length-1]=y[H]}for(F=0,z=d.length;F<z;F++)B=u(D(C,f,d[F]).toString(2))+B;return l(C>=1?B:B.slice(B.indexOf("1")+1))},getConfig:function(){var N={};return N.radix=r.radix,N.bits=r.bits,N.maxShares=r.maxShares,N.hasCSPRNG=s(),N.typeCSPRNG=r.typeCSPRNG,N},extractShareComponents:function(N){var C,F,H,z,G={},B,g;if(C=parseInt(N.substr(0,1),36),C&&(typeof C!="number"||C%1!==0||C<t.minBits||C>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(z=Math.pow(2,C)-1,H=(Math.pow(2,C)-1).toString(r.radix).length,B="^([a-kA-K3-9]{1})([a-fA-F0-9]{"+H+"})([a-fA-F0-9]+)$",g=new RegExp(B).exec(N),g&&(F=parseInt(g[2],r.radix)),typeof F!="number"||F%1!==0||F<1||F>z)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(g&&g[3])return G.bits=C,G.id=F,G.data=g[3],G;throw new Error("The share data provided is invalid : "+N)},setRNG:function(N){var C="Random number generator is invalid ",F=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(N&&typeof N=="string"&&o.indexOf(N)===-1)throw new Error("Invalid RNG type argument : '"+N+"'");if(N||(N=E()),N&&typeof N=="string"&&(N=E(N)),n){if(N&&typeof N!="function")throw new Error(C+"(Not a function)."+F);if(N&&typeof N(r.bits)!="string")throw new Error(C+"(Output is not a string)."+F);if(N&&!parseInt(N(r.bits),2))throw new Error(C+"(Binary string output not parseable to an Integer)."+F);if(N&&N(r.bits).length>r.bits)throw new Error(C+"(Output length is greater than config.bits)."+F);if(N&&N(r.bits).length<r.bits)throw new Error(C+"(Output length is less than config.bits)."+F)}return r.rng=N,!0},str2hex:function(N,C){var F,H,z="",G,B,g,O;if(typeof N!="string")throw new Error("Input must be a character string.");if(C||(C=t.bytesPerChar),typeof C!="number"||C<1||C>t.maxBytesPerChar||C%1!==0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,H=Math.pow(16,F)-1,g=0,O=N.length;g<O;g++){if(B=N[g].charCodeAt(),isNaN(B))throw new Error("Invalid character: "+N[g]);if(B>H)throw G=Math.ceil(Math.log(B+1)/Math.log(256)),new Error("Invalid character code ("+B+"). Maximum allowable is 256^bytes-1 ("+H+"). To convert this character, use at least "+G+" bytes.");z=u(B.toString(16),F)+z}return z},hex2str:function(N,C){var F,H="",z,G;if(typeof N!="string")throw new Error("Input must be a hexadecimal string.");if(C=C||t.bytesPerChar,typeof C!="number"||C%1!==0||C<1||C>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,N=u(N,F),z=0,G=N.length;z<G;z+=F)H=String.fromCharCode(parseInt(N.slice(z,z+F),16))+H;return H},random:function(N){if(typeof N!="number"||N%1!==0||N<2||N>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return l(r.rng(N))},share:function(N,C,F,H){var z,G,B=new Array(C),g=new Array(C),O,y,f;if(H=H||128,typeof N!="string")throw new Error("Secret must be a string.");if(typeof C!="number"||C%1!==0||C<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(C>r.maxShares)throw z=Math.ceil(Math.log(C+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+C+" shares, use at least "+z+" bits.");if(typeof F!="number"||F%1!==0||F<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(F>r.maxShares)throw z=Math.ceil(Math.log(F+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+F+", use at least "+z+" bits.");if(F>C)throw new Error("Threshold number of shares was "+F+" but must be less than or equal to the "+C+" shares specified as the total to generate.");if(typeof H!="number"||H%1!==0||H<0||H>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(N="1"+c(N),N=P(N,H),O=0,f=N.length;O<f;O++)for(G=L(N[O],C,F),y=0;y<C;y++)B[y]=B[y]||G[y].x.toString(r.radix),g[y]=u(G[y].y.toString(2))+(g[y]||"");for(O=0;O<C;O++)B[O]=U(r.bits,B[O],l(g[O]));return B},newShare:function(N,C){var F,H;if(N&&typeof N=="string"&&(N=parseInt(N,r.radix)),H=N.toString(r.radix),N&&H&&C&&C[0])return F=this.extractShareComponents(C[0]),U(F.bits,H,this.combine(C,N));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:l,_hasCryptoGetRandomValues:m,_hasCryptoRandomBytes:w,_getRNG:E,_isSetRNG:s,_splitNumStringToIntArray:P,_horner:M,_lagrange:D,_getShares:L,_constructPublicShareString:U};return K.init(),K})});var A4=k((b6e,ZR)=>{"use strict";v();var gi=fr(),KR=Ku(),VR=cr(),f6=null;function I4(){if(f6)return f6;var e=zR();return e.setRNG(function(t){for(var r=64,i=0;i<r;i++){for(var n=KR.getRandomBuffer(Math.ceil(t/8)),o="",a=0;a<n.length;a++)o+=("00000000"+n[a].toString(2)).slice(-8);if(o=o.slice(0,t),/1/.test(o))return o}throw new Error("shamir: CSPRNG returned all-zero draws "+r+" times in a row \u2014 refusing to hang on a degenerate/stubbed random source")}),f6=e,f6}var c6="ff",GR=2;function Or(e){return this instanceof Or?(this.options=e||{},this):new Or(e)}Or.split=function(e,t,r,i){if(i=i||{},e==null)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var n=h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8"),o=c6+n.toString("hex"),a=I4().share(o,r,t),s=KR.getRandomBuffer(8).toString("hex"),u=i.checksum===!0,c=u?VR.sha256(n).slice(0,4).toString("hex"):null,l=[],m=0;m<a.length;m++)l.push({v:GR,id:m+1,threshold:t,shares:r,length:n.length,splitId:s,share:a[m],checksum:c});return l};Or.combine=function(e){if(!e||e.length===0)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&e[0].share===void 0)return Or._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var i=[],n=0;n<e.length;n++){var o=e[n];if(!o||typeof o.share!="string")throw new Error("Invalid share at index "+n);if(r!==void 0&&o.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(o.threshold!==t)throw new Error("Shares have inconsistent threshold");i.push(o.share)}var a=I4().combine(i);if(a.slice(0,c6.length)!==c6)throw new Error("Reconstruction failed: invalid or insufficient shares");var s=h.Buffer.from(a.slice(c6.length),"hex"),u=e[0].checksum;if(u){var c=VR.sha256(s).slice(0,4).toString("hex");if(c!==u)throw new Error("Integrity check failed: shares are inconsistent or tampered")}return s};Or.verifyShare=function(e){try{return!e||typeof e!="object"?!1:Array.isArray(e.bytes)&&e.share===void 0?Or._verifyLegacyShare(e):e.v!==GR||typeof e.share!="string"||!/^[0-9a-fA-F]+$/.test(e.share)||typeof e.threshold!="number"||typeof e.shares!="number"||e.threshold<2||e.shares<e.threshold||e.shares>255||e.id<1||e.id>e.shares||e.checksum!==null&&e.checksum!==void 0&&!/^[0-9a-fA-F]{8}$/.test(e.checksum)?!1:(I4().extractShareComponents(e.share),!0)}catch{return!1}};Or.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=3,r=5,i=Or.split(e,t,r),n=Or.combine(i.slice(0,t));return{secret:e,threshold:t,totalShares:r,shares:i,reconstructed:n.toString("utf8"),valid:n.toString("utf8")===e}};var Rs=new gi(2147483647);Or._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,i=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=0;n<e.length;n++){if(e[n].threshold!==t||e[n].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[n].length!==i)throw new Error("Shares have different secret lengths")}for(var o=[],a=0;a<i;a++){for(var s=[],u=0;u<Math.min(e.length,t);u++)s.push(e[u].bytes[a]);o.push(Or._combineByteLegacy(s))}return h.Buffer.from(o)};Or._combineByteLegacy=function(e){for(var t=new gi(0),r=0;r<e.length;r++){for(var i=new gi(e[r].x),n=new gi(e[r].y,16),o=new gi(1),a=new gi(1),s=0;s<e.length;s++)if(r!==s){var u=new gi(e[s].x),c=new gi(0).sub(u);c.lt(new gi(0))&&(c=c.add(Rs)),o=o.mul(c).mod(Rs);var l=i.sub(u);l.lt(new gi(0))&&(l=l.add(Rs)),a=a.mul(l).mod(Rs)}var m=Or._modInverseLegacy(a,Rs),w=o.mul(m).mod(Rs);t=t.add(n.mul(w)).mod(Rs)}return t.mod(Rs).mod(new gi(256)).toNumber()};Or._modInverseLegacy=function(e,t){e.lt(new gi(0))&&(e=e.mod(t).add(t));var r=Or._extendedGCDLegacy(e,t);if(!r.gcd.eq(new gi(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)};Or._extendedGCDLegacy=function(e,t){if(e.eq(new gi(0)))return{gcd:t,x:new gi(0),y:new gi(1)};var r=Or._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}};Or._verifyLegacyShare=function(e){if(!e.id||!e.threshold||!e.shares||!e.bytes||typeof e.length!="number"||e.threshold<2||e.shares<e.threshold||!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y||r.x<1||r.x>e.shares||!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0};ZR.exports=Or});var h6=k((w6e,WR)=>{"use strict";v();var Lo=fr(),ere=gn(),tre=i6(),hl=ere.getN(),l6=hl.shrn(1);function rre(e,t,r){if(!h.Buffer.isBuffer(e)||e.length!==32)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let i=t;if(h.Buffer.isBuffer(t))try{i=Vr().fromDER(t)}catch{return!1}if(!i||!i.r||!i.s)return!1;let n=Lo.isBN(i.r)?i.r:new Lo(i.r),o=Lo.isBN(i.s)?i.s:new Lo(i.s);if(n.isZero()||o.isZero()||n.gte(hl)||o.gte(hl))return!1;let a=o;o.gt(l6)&&(a=hl.sub(o));let s=Vr(),u=new s({r:n,s:a});return tre.verify(e,u,r)}function ire(e){if(!e)return!1;let t=e;if(h.Buffer.isBuffer(e))try{t=Vr().fromDER(e)}catch{return!1}return!t||!t.s?!1:(Lo.isBN(t.s)?t.s:new Lo(t.s)).lte(l6)}function nre(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");let t=Lo.isBN(e.r)?e.r:new Lo(e.r),r=Lo.isBN(e.s)?e.s:new Lo(e.s),i=r;return r.gt(l6)&&(i=hl.sub(r)),{r:t,s:i}}WR.exports={smartVerify:rre,isCanonical:ire,canonicalize:nre,constants:{n:hl,nh:l6}}});var d6=k((x6e,XR)=>{"use strict";v();var ore=fr(),{secp256k1:dl}=(g0(),lo(p0)),YR=dl.Point,are=YR.Fn.ORDER;function P4(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new ore(t,16)}function T4(e){return h.Buffer.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(h.Buffer.from(e,"hex"))}function k4(e){this._p=e}k4.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var $R={curve:{n:P4(are)},keyFromPrivate:function(e,t){var r;h.Buffer.isBuffer(e)?r=e:e instanceof Uint8Array?r=h.Buffer.from(e):r=h.Buffer.from(e,t||"hex");var i=Uint8Array.from(r);return{_priv:i,getPublic:function(){return new k4(YR.fromBytes(dl.getPublicKey(i,!0)))}}},sign:function(e,t){var r=dl.sign(T4(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),i=r[0],n=P4(BigInt("0x"+h.Buffer.from(r.subarray(1,33)).toString("hex"))),o=P4(BigInt("0x"+h.Buffer.from(r.subarray(33,65)).toString("hex")));return{r:n,s:o,recoveryParam:i}},verify:function(e,t,r){try{if(!t||typeof t!="object")return!1;var i=t.r,n=t.s;if(!i||!n||typeof i.cmp!="function"||typeof n.cmp!="function"||i.isZero()||n.isZero())return!1;var o=$R.curve.n;if(i.cmp(o)>=0||n.cmp(o)>=0)return!1;var a=h.Buffer.concat([i.toBuffer({size:32}),n.toBuffer({size:32})]),s=r._priv?dl.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return dl.verify(Uint8Array.from(a),T4(e),Uint8Array.from(s),{lowS:!1,prehash:!1})}catch{return!1}},recoverPubKey:function(e,t,r){var i=h.Buffer.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]),n=dl.Signature.fromBytes(Uint8Array.from(i),"compact").addRecoveryBit(r);return new k4(n.recoverPublicKey(T4(e)))}};XR.exports=$R});var X0=k((O6e,eB)=>{"use strict";v();var p6=xt(),$0=fr(),g6=Da(),sre=Wn(),ure=cr(),JR=Bt(),fre=486604799,gt=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&JR.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};gt._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=gt._fromBufferReader(g6(t));else if(p6.isObject(t))r=gt._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};gt._fromObject=function(t){JR.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;p6.isString(t.prevHash)&&(r=h.Buffer.from(t.prevHash,"hex").reverse()),p6.isString(t.merkleRoot)&&(i=h.Buffer.from(t.merkleRoot,"hex").reverse());var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};gt.fromObject=function(t){var r=gt._fromObject(t);return new gt(r)};gt.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=g6(t);r.pos=gt.Constants.START_OF_HEADER;var i=gt._fromBufferReader(r);return new gt(i)};gt.fromBuffer=function(t){var r=gt._fromBufferReader(g6(t));return new gt(r)};gt.fromString=function(t){var r=h.Buffer.from(t,"hex");return gt.fromBuffer(r)};gt._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};gt.fromBufferReader=function(t){var r=gt._fromBufferReader(t);return new gt(r)};gt.prototype.toObject=gt.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:h.Buffer.from(this.prevHash).reverse().toString("hex"),merkleRoot:h.Buffer.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};gt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};gt.prototype.toString=function(){return this.toBuffer().toString("hex")};gt.prototype.toBufferWriter=function(t){return t||(t=new sre),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};gt.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new $0(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new $0(2));return r};gt.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(fre).mul(new $0(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};gt.prototype._getHash=function(){var t=this.toBuffer();return ure.sha256sha256(t)};var QR={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=g6(this._getHash()).readReverse().toString("hex")),this._id},set:p6.noop};Object.defineProperty(gt.prototype,"id",QR);Object.defineProperty(gt.prototype,"hash",QR);gt.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+gt.Constants.MAX_TIME_OFFSET)};gt.prototype.validProofOfWork=function(){var t=new $0(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};gt.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};gt.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new $0("10000000000000000000000000000000000000000000000000000000000000000","hex")};eB.exports=gt});var aB=k((A6e,oB)=>{"use strict";v();var B4=xt(),rB=X0(),tB=fr(),M4=Da(),cre=Wn(),lre=cr(),R4=Ts(),iB=Bt();function at(e){return this instanceof at?(B4.extend(this,at._from(e)),this):new at(e)}at.MAX_BLOCK_SIZE=128e6;at._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=at._fromBufferReader(M4(t));else if(B4.isObject(t))r=at._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};at._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof R4?r.push(n):r.push(R4().fromObject(n))});var i={header:rB.fromObject(t.header),transactions:r};return i};at.fromObject=function(t){var r=at._fromObject(t);return new at(r)};at._fromBufferReader=function(t){var r={};iB.checkState(!t.finished(),"No block data received"),r.header=rB.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(R4().fromBufferReader(t));return r};at.fromBufferReader=function(t){iB.checkArgument(t,"br is required");var r=at._fromBufferReader(t);return new at(r)};at.fromBuffer=function(t){return at.fromBufferReader(new M4(t))};at.fromString=function(t){var r=h.Buffer.from(t,"hex");return at.fromBuffer(r)};at.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=M4(t);r.pos=at.Values.START_OF_BLOCK;var i=at._fromBufferReader(r);return new at(i)};at.prototype.toObject=at.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};at.prototype.toBuffer=function(){return this.toBufferWriter().concat()};at.prototype.toString=function(){return this.toBuffer().toString("hex")};at.prototype.toBufferWriter=function(t){t||(t=new cre),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};at.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[at.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};at.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),a=h.Buffer.concat([t[r+n],t[r+o]]);t.push(lre.sha256sha256(a))}r+=i}return t};at.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};at.prototype.validMerkleRoot=function(){var t=new tB(this.header.merkleRoot.toString("hex"),"hex"),r=new tB(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};at.prototype._getHash=function(){return this.header._getHash()};var nB={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:B4.noop};Object.defineProperty(at.prototype,"id",nB);Object.defineProperty(at.prototype,"hash",nB);at.prototype.inspect=function(){return"<Block "+this.id+">"};at.Values={START_OF_BLOCK:8,NULL_HASH:h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};oB.exports=at});var D4=k((T6e,fB)=>{"use strict";v();var mf=xt(),C4=X0(),uB=Da(),hre=Wn(),dre=cr(),sB=Ts(),N4=ln(),yf=Bt();function nr(e){if(!(this instanceof nr))return new nr(e);var t={};if(h.Buffer.isBuffer(e))t=nr._fromBufferReader(uB(e));else if(mf.isObject(e)){var r;e.header instanceof C4?r=e.header:r=C4.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return mf.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}nr.fromBuffer=function(t){return nr.fromBufferReader(uB(t))};nr.fromBufferReader=function(t){return new nr(nr._fromBufferReader(t))};nr.prototype.toBuffer=function(){return this.toBufferWriter().concat()};nr.prototype.toBufferWriter=function(t){t||(t=new hre),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(h.Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};nr.prototype.toObject=nr.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};nr.prototype.validMerkleTree=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:i.equals(this.header.merkleRoot)};nr.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")};nr.prototype.filteredTxsHash=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new N4.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new N4.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new N4.MerkleBlock.InvalidMerkleTree;return i};nr.prototype._traverseMerkleTree=function(t,r,i,n){if(i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0,n=n||!1,i.flagBitsUsed>this.flags.length*8)return null;var o=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!o){if(i.hashesUsed>=this.hashes.length)return null;var a=this.hashes[i.hashesUsed++];return t===0&&o&&i.txs.push(a),h.Buffer.from(a,"hex")}else{var s=this._traverseMerkleTree(t-1,r*2,i),u=s;return r*2+1<this._calcTreeWidth(t-1)&&(u=this._traverseMerkleTree(t-1,r*2+1,i)),n?i.txs:dre.sha256sha256(h.Buffer.concat([s,u]))}};nr.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};nr.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};nr.prototype.hasTransaction=function(t){yf.checkArgument(!mf.isUndefined(t),"tx cannot be undefined"),yf.checkArgument(t instanceof sB||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof sB&&(r=h.Buffer.from(t.id,"hex").reverse().toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};nr._fromBufferReader=function(t){yf.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=C4.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};nr.fromObject=function(t){return new nr(t)};fB.exports=nr});var cB=k((R6e,v6)=>{v();v6.exports=aB();v6.exports.BlockHeader=X0();v6.exports.MerkleBlock=D4()});var yB=k((M6e,mB)=>{"use strict";v();var pB=Ae(),lB=pB.crypto.Hash,hB=/^[0-9a-fA-F]{64}$/;function gB(e){return h.Buffer.from(e).reverse()}function dB(e){return gB(h.Buffer.from(e,"hex"))}function vB(e){return gB(e).toString("hex")}function L4(e,t,r){if(!hB.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var i=dB(e),n=t,o=0;o<r.length;o++){var a=r[o],s;if(a==="*"||a===""||a==null)s=i;else{if(!hB.test(String(a)))throw new Error("proof node "+o+' must be 32-byte hex or "*"');s=dB(a)}i=n&1?lB.sha256sha256(h.Buffer.concat([s,i])):lB.sha256sha256(h.Buffer.concat([i,s])),n=Math.floor(n/2)}return vB(i)}function pre(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");var t=L4(e.txid,e.index,e.nodes);return t.toLowerCase()===String(e.merkleRoot).toLowerCase()}function gre(e){var t=e.header;if((h.Buffer.isBuffer(t)||typeof t=="string")&&(t=pB.BlockHeader.fromBuffer(h.Buffer.isBuffer(t)?t:h.Buffer.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=vB(t.merkleRoot),i=L4(e.txid,e.index,e.nodes),n=i.toLowerCase()===r.toLowerCase(),o=e.requirePow!==!1,a=t.validProofOfWork();return{valid:n&&(!o||a),rootMatches:n,powValid:a,merkleRoot:i,blockHash:t.id}}mB.exports={merkleRootFromBranch:L4,verifyMerkleProof:pre,verifyTxInclusion:gre}});var wB=k((C6e,_B)=>{"use strict";v();var bB=Ae();function vre(e){return h.Buffer.from(e).reverse()}function mre(e){if(e&&typeof e.validProofOfWork=="function")return e;if(h.Buffer.isBuffer(e))return bB.BlockHeader.fromBuffer(e);if(typeof e=="string")return bB.BlockHeader.fromBuffer(h.Buffer.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}function yre(e,t){if(t=t||{},!Array.isArray(e)||e.length===0)throw new Error("headers must be a non-empty array");for(var r=e.map(mre),i=t.requirePow!==!1,n=0,o=0;o<r.length;o++){if(i&&!r[o].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+o,count:r.length};if(n+=r[o].getDifficulty(),o>0){var a=vre(r[o].prevHash).toString("hex").toLowerCase()===r[o-1].id.toLowerCase();if(!a)return{valid:!1,reason:"broken link at index "+o,count:r.length}}}var s=r[0].id,u=r[r.length-1].id;if(t.trustedHash){var c=String(t.trustedHash).toLowerCase();if(c!==u.toLowerCase()&&c!==s.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:s,tipHash:u}}return{valid:!0,count:r.length,anchorHash:s,tipHash:u,work:n}}_B.exports={verifyHeaderChain:yre}});var xB=k((L6e,SB)=>{"use strict";v();var q4=yB(),bre=wB();SB.exports={merkleRootFromBranch:q4.merkleRootFromBranch,verifyMerkleProof:q4.verifyMerkleProof,verifyTxInclusion:q4.verifyTxInclusion,verifyHeaderChain:bre.verifyHeaderChain}});var F4=k((U6e,TB)=>{"use strict";v();var Ir=xt(),EB=Bt(),OB=fr(),_re=E0(),m6=el(),IB=cr(),y6=H4(),bf=ws(),U4=gn(),AB=$n(),PB=ln(),J0=PB,ro=PB.HDPublicKey,b6=xs(),Bs=pi();function ne(e){if(e instanceof ne)return e;if(!(this instanceof ne))return new ne(e);if(e)if(Ir.isString(e)||h.Buffer.isBuffer(e)){var t=ne.getSerializedError(e);if(t){if(h.Buffer.isBuffer(e)&&!ne.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof ro.ArgumentIsPrivateExtended)return new y6(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(Ir.isObject(e))return e instanceof y6?this._buildFromPrivate(e):this._buildFromObject(e);throw new ro.UnrecognizedArgument(e)}else throw new ro.MustSupplyArgument}ne.fromHDPrivateKey=function(e){return new ne(e)};ne.isValidPath=function(e){if(Ir.isString(e)){var t=y6._getDerivationIndexes(e);return t!==null&&Ir.every(t,ne.isValidPath)}return Ir.isNumber(e)?e>=0&&e<ne.Hardened:!1};ne.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};ne.prototype.deriveChild=function(e,t){if(Ir.isNumber(e))return this._deriveWithNumber(e,t);if(Ir.isString(e))return this._deriveFromString(e);throw new ro.InvalidDerivationArgument(e)};ne.prototype._deriveWithNumber=function(e,t){if(e>=ne.Hardened||t)throw new ro.InvalidIndexCantDeriveHardened;if(e<0)throw new ro.InvalidPath(e);var r=Bs.integerAsBuffer(e),i=h.Buffer.concat([this.publicKey.toBuffer(),r]),n=IB.sha512hmac(i,this._buffers.chainCode),o=OB.fromBuffer(n.slice(0,32),{size:32}),a=n.slice(32,64),s;try{s=AB.fromPoint(U4.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var u=new ne({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:a,publicKey:s});return u};ne.prototype._deriveFromString=function(e){if(Ir.includes(e,"'"))throw new ro.InvalidIndexCantDeriveHardened;if(!ne.isValidPath(e))throw new ro.InvalidPath(e);var t=y6._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};ne.isValidSerialized=function(e,t){return Ir.isNull(ne.getSerializedError(e,t))};ne.getSerializedError=function(e,t){if(!(Ir.isString(e)||h.Buffer.isBuffer(e)))return new ro.UnrecognizedArgument("expected buffer or string");if(!_re.validCharacters(e))return new J0.InvalidB58Char("(unknown)",e);try{e=m6.decode(e)}catch{return new J0.InvalidB58Checksum(e)}if(e.length!==ne.DataSize)return new ro.InvalidLength(e);if(!Ir.isUndefined(t)){var r=ne._validateNetwork(e,t);if(r)return r}var i=e.readUInt32BE(0);return i===bf.livenet.xprivkey||i===bf.testnet.xprivkey?new ro.ArgumentIsPrivateExtended:null};ne._validateNetwork=function(e,t){var r=bf.get(t);if(!r)return new J0.InvalidNetworkArgument(t);var i=e.slice(ne.VersionStart,ne.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new J0.InvalidNetwork(i):null};ne.prototype._buildFromPrivate=function(e){var t=Ir.clone(e._buffers),r=U4.getG().mul(OB.fromBuffer(t.privateKey));return t.publicKey=U4.pointToCompressed(r),t.version=Bs.integerAsBuffer(bf.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};ne.prototype._buildFromObject=function(e){var t={version:e.network?Bs.integerAsBuffer(bf.get(e.network).xpubkey):e.version,depth:Ir.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:Ir.isNumber(e.parentFingerPrint)?Bs.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Ir.isNumber(e.childIndex)?Bs.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Ir.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:Ir.isString(e.publicKey)?h.Buffer.from(e.publicKey,"hex"):h.Buffer.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:Ir.isNumber(e.checksum)?Bs.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};ne.prototype._buildFromSerialized=function(e){var t=m6.decode(e),r={version:t.slice(ne.VersionStart,ne.VersionEnd),depth:t.slice(ne.DepthStart,ne.DepthEnd),parentFingerPrint:t.slice(ne.ParentFingerPrintStart,ne.ParentFingerPrintEnd),childIndex:t.slice(ne.ChildIndexStart,ne.ChildIndexEnd),chainCode:t.slice(ne.ChainCodeStart,ne.ChainCodeEnd),publicKey:t.slice(ne.PublicKeyStart,ne.PublicKeyEnd),checksum:t.slice(ne.ChecksumStart,ne.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};ne.prototype._buildFromBuffers=function(e){ne._validateBufferArguments(e),Bs.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=h.Buffer.concat(t),i=m6.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new J0.InvalidB58Checksum(r,i);var n=bf.get(e.version.readUInt32BE(0)),o;o=m6.encode(h.Buffer.concat(t)),e.xpubkey=h.Buffer.from(o);var a=new AB(e.publicKey,{network:n}),s=ne.ParentFingerPrintSize,u=IB.sha256ripemd160(a.toBuffer()).slice(0,s);return Bs.defineImmutable(this,{xpubkey:o,network:n,depth:e.depth[0],publicKey:a,fingerPrint:u}),this};ne._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];b6(h.Buffer.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),b6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",ne.VersionSize),t("depth",ne.DepthSize),t("parentFingerPrint",ne.ParentFingerPrintSize),t("childIndex",ne.ChildIndexSize),t("chainCode",ne.ChainCodeSize),t("publicKey",ne.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",ne.CheckSumSize)};ne.fromString=function(e){return EB.checkArgument(Ir.isString(e),"No valid string was provided"),new ne(e)};ne.fromObject=function(e){return EB.checkArgument(Ir.isObject(e),"No valid argument was provided"),new ne(e)};ne.prototype.toString=function(){return this.xpubkey};ne.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};ne.prototype.toObject=ne.prototype.toJSON=function(){return{network:bf.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}};ne.fromBuffer=function(e){return new ne(e)};ne.fromHex=function(e){return ne.fromBuffer(h.Buffer.from(e,"hex"))};ne.prototype.toBuffer=function(){return h.Buffer.from(this._buffers.xpubkey)};ne.prototype.toHex=function(){return this.toBuffer().toString("hex")};ne.Hardened=2147483648;ne.RootElementAlias=["m","M"];ne.VersionSize=4;ne.DepthSize=1;ne.ParentFingerPrintSize=4;ne.ChildIndexSize=4;ne.ChainCodeSize=32;ne.PublicKeySize=33;ne.CheckSumSize=4;ne.DataSize=78;ne.SerializedByteSize=82;ne.VersionStart=0;ne.VersionEnd=ne.VersionStart+ne.VersionSize;ne.DepthStart=ne.VersionEnd;ne.DepthEnd=ne.DepthStart+ne.DepthSize;ne.ParentFingerPrintStart=ne.DepthEnd;ne.ParentFingerPrintEnd=ne.ParentFingerPrintStart+ne.ParentFingerPrintSize;ne.ChildIndexStart=ne.ParentFingerPrintEnd;ne.ChildIndexEnd=ne.ChildIndexStart+ne.ChildIndexSize;ne.ChainCodeStart=ne.ChildIndexEnd;ne.ChainCodeEnd=ne.ChainCodeStart+ne.ChainCodeSize;ne.PublicKeyStart=ne.ChainCodeEnd;ne.PublicKeyEnd=ne.PublicKeyStart+ne.PublicKeySize;ne.ChecksumStart=ne.PublicKeyEnd;ne.ChecksumEnd=ne.ChecksumStart+ne.CheckSumSize;b6(ne.PublicKeyEnd===ne.DataSize);b6(ne.ChecksumEnd===ne.SerializedByteSize);TB.exports=ne});var H4=k((H6e,NB)=>{"use strict";v();var _6=xs(),e1=zt(),mr=xt(),RB=Bt(),BB=fr(),wre=E0(),Q0=el(),j4=cr(),_f=ws(),Sre=gn(),MB=G0(),xre=Ku(),pl=ln(),Uo=pl.HDPrivateKey,qo=pi(),Ere=128,kB=1/8,Ore=512;function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(!e)return this._generateRandomly();if(_f.get(e))return this._generateRandomly(e);if(mr.isString(e)||h.Buffer.isBuffer(e))if(J.isValidSerialized(e))this._buildFromSerialized(e);else if(qo.isValidJSON(e))this._buildFromJSON(e);else if(h.Buffer.isBuffer(e)&&J.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw J.getSerializedError(e);else if(mr.isObject(e))this._buildFromObject(e);else throw new Uo.UnrecognizedArgument(e)}J.fromRandom=function(){return new J};J.isValidPath=function(e,t){if(mr.isString(e)){var r=J._getDerivationIndexes(e);return r!==null&&mr.every(r,J.isValidPath)}return mr.isNumber(e)?(e<J.Hardened&&t===!0&&(e+=J.Hardened),e>=0&&e<J.MaxIndex):!1};J._getDerivationIndexes=function(e){var t=e.split("/");if(mr.includes(J.RootElementAlias,e))return[];if(!mr.includes(J.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=J.Hardened),o});return mr.some(r,isNaN)?null:r};J.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};J.prototype.deriveChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t);if(mr.isString(e))return this._deriveFromString(e);throw new Uo.InvalidDerivationArgument(e)};J.prototype.deriveNonCompliantChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t,!0);if(mr.isString(e))return this._deriveFromString(e,!0);throw new Uo.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t,r){if(!J.isValidPath(e,t))throw new Uo.InvalidPath(e);t=e>=J.Hardened?!0:t,e<J.Hardened&&t===!0&&(e+=J.Hardened);var i=qo.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=h.Buffer.concat([e1.Buffer.from([0]),o,i])}else if(t){var a=this.privateKey.bn.toBuffer({size:32});_6(a.length===32,"length of private key buffer is expected to be 32 bytes"),n=h.Buffer.concat([e1.Buffer.from([0]),a,i])}else n=h.Buffer.concat([this.publicKey.toBuffer(),i]);var s=j4.sha512hmac(n,this._buffers.chainCode),u=BB.fromBuffer(s.slice(0,32),{size:32}),c=s.slice(32,64),l=u.add(this.privateKey.toBigNumber()).umod(Sre.getN()).toBuffer({size:32});if(!MB.isValid(l))return this._deriveWithNumber(e+1,null,r);var m=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:c,privateKey:l});return m};J.prototype._deriveFromString=function(e,t){if(!J.isValidPath(e))throw new Uo.InvalidPath(e);var r=J._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};J.isValidSerialized=function(e,t){return!J.getSerializedError(e,t)};J.getSerializedError=function(e,t){if(!(mr.isString(e)||h.Buffer.isBuffer(e)))return new Uo.UnrecognizedArgument("Expected string or buffer");if(!wre.validCharacters(e))return new pl.InvalidB58Char("(unknown)",e);try{e=Q0.decode(e)}catch{return new pl.InvalidB58Checksum(e)}if(e.length!==J.DataLength)return new Uo.InvalidLength(e);if(!mr.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}return null};J._validateNetwork=function(e,t){var r=_f.get(t);if(!r)return new pl.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new pl.InvalidNetwork(i):null};J.fromString=function(e){return RB.checkArgument(mr.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return RB.checkArgument(mr.isObject(e),"No valid argument was provided"),new J(e)};J.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};J.prototype._buildFromObject=function(e){var t={version:e.network?qo.integerAsBuffer(_f.get(e.network).xprivkey):e.version,depth:mr.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:mr.isNumber(e.parentFingerPrint)?qo.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:mr.isNumber(e.childIndex)?qo.integerAsBuffer(e.childIndex):e.childIndex,chainCode:mr.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:mr.isString(e.privateKey)&&qo.isHexa(e.privateKey)?h.Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:qo.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=Q0.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),privateKey:t.slice(J.PrivateKeyStart,J.PrivateKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};J.prototype._generateRandomly=function(e){return J.fromSeed(xre.getRandomBuffer(64),e)};J.fromSeed=function(e,t){if(qo.isHexaString(e)&&(e=h.Buffer.from(e,"hex")),!h.Buffer.isBuffer(e))throw new Uo.InvalidEntropyArgument(e);if(e.length<Ere*kB)throw new Uo.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>Ore*kB)throw new Uo.InvalidEntropyArgument.TooMuchEntropy(e);var r=j4.sha512hmac(e,e1.Buffer.from("Bitcoin seed"));return new J({network:_f.get(t)||_f.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};J.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=F4();this._hdPublicKey=new e(this)}};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),qo.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,h.Buffer.alloc(1),e.privateKey],r=e1.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=Q0.checksum(r);else if(e.checksum.toString()!==Q0.checksum(r).toString())throw new pl.InvalidB58Checksum(r);var i=_f.get(e.version.readUInt32BE(0)),n;n=Q0.encode(e1.Buffer.concat(t)),e.xprivkey=h.Buffer.from(n);var o=new MB(BB.fromBuffer(e.privateKey),i),a=o.toPublicKey(),s=J.ParentFingerPrintSize,u=j4.sha256ripemd160(a.toBuffer()).slice(0,s);return qo.defineImmutable(this,{xprivkey:n,network:i,depth:e.depth[0],privateKey:o,publicKey:a,fingerPrint:u}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];_6(h.Buffer.isBuffer(n),r+" argument is not a buffer"),_6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("privateKey",J.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.prototype.toString=function(){return this.xprivkey};J.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:_f.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}};J.fromBuffer=function(e){return new J(e.toString())};J.fromHex=function(e){return J.fromBuffer(h.Buffer.from(e,"hex"))};J.prototype.toBuffer=function(){return h.Buffer.from(this.toString())};J.prototype.toHex=function(){return this.toBuffer().toString("hex")};J.DefaultDepth=0;J.DefaultFingerprint=0;J.DefaultChildIndex=0;J.Hardened=2147483648;J.MaxIndex=2*J.Hardened;J.RootElementAlias=["m","M","m'","M'"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PrivateKeySize=32;J.CheckSumSize=4;J.DataLength=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PrivateKeyStart=J.ChainCodeEnd+1;J.PrivateKeyEnd=J.PrivateKeyStart+J.PrivateKeySize;J.ChecksumStart=J.PrivateKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;_6(J.ChecksumEnd===J.SerializedByteSize);NB.exports=J});var UB=k((z6e,qB)=>{"use strict";v();var Fo=Ae(),w6=Fo.deps._,Ire=Fo.PrivateKey,Are=Fo.PublicKey,CB=Fo.Address,DB=Fo.encoding.BufferWriter,z4=Fo.crypto.ECDSA,LB=Fo.crypto.Signature,Pre=Fo.crypto.Hash.sha256sha256,Tre=Fo.util.js,gl=Fo.util.preconditions,or=function e(t){return this instanceof e?(gl.checkArgument(w6.isString(t)||h.Buffer.isBuffer(t),"First argument should be a string or Buffer"),w6.isString(t)&&(this.messageBuffer=h.Buffer.from(t)),h.Buffer.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};or.sign=function(e,t){return new or(e).sign(t)};or.verify=function(e,t,r){return new or(e).verify(t,r)};or.MAGIC_BYTES=h.Buffer.from(`Bitcoin Signed Message:
|
|
75
|
+
`));var s=new Is({actual:e,expected:t,message:r,operator:n,stackStartFn:i});throw s.generatedMessage=a,s}}Vt.match=function e(t,r,i){vk(t,r,i,e,"match")};Vt.doesNotMatch=function e(t,r,i){vk(t,r,i,e,"doesNotMatch")};function mk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];fk.apply(void 0,[mk,t.length].concat(t))}Vt.strict=mee(mk,Vt,{equal:Vt.strictEqual,deepEqual:Vt.deepStrictEqual,notEqual:Vt.notStrictEqual,notDeepEqual:Vt.notDeepStrictEqual});Vt.strict.strict=Vt.strict});var Wn=k((ype,_k)=>{"use strict";v();var bk=xs(),vr=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};vr.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};vr.prototype.toBuffer=function(){return this.concat()};vr.prototype.concat=function(){return h.Buffer.concat(this.bufs,this.bufLen)};vr.prototype.write=function(e){return bk(h.Buffer.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};vr.prototype.writeReverse=function(e){return bk(h.Buffer.isBuffer(e)),this.bufs.push(h.Buffer.from(e).reverse()),this.bufLen+=e.length,this};vr.prototype.writeUInt8=function(e){var t=h.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};vr.prototype.writeUInt16BE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};vr.prototype.writeUInt16LE=function(e){var t=h.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};vr.prototype.writeUInt32BE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};vr.prototype.writeInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt32LE=function(e){var t=h.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};vr.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};vr.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};vr.prototype.writeVarintNum=function(e){var t=vr.varintBufNum(e);return this.write(t),this};vr.prototype.writeVarintBN=function(e){var t=vr.varintBufBN(e);return this.write(t),this};vr.varintBufNum=function(e){var t;return e<253?(t=h.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=h.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};vr.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)t=h.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=h.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=h.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new vr;i.writeUInt8(255),i.writeUInt64LEBN(e),t=i.concat()}return t};_k.exports=vr});var Gp=k((_pe,wk)=>{"use strict";v();var nl=xt(),F0=Bt(),bee=pi();function Et(e){if(!(this instanceof Et))return new Et(e);var t;if(nl.isNumber(e))t=e;else if(nl.isString(e))t=Et.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return bee.defineImmutable(this,{num:t}),this}Et.fromBuffer=function(e){return F0.checkArgument(h.Buffer.isBuffer(e)),new Et(+("0x"+e.toString("hex")))};Et.fromNumber=function(e){return F0.checkArgument(nl.isNumber(e)),new Et(e)};Et.fromString=function(e){F0.checkArgument(nl.isString(e));var t=Et.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new Et(t)};Et.prototype.toHex=function(){return this.num.toString(16)};Et.prototype.toBuffer=function(){return h.Buffer.from(this.toHex(),"hex")};Et.prototype.toNumber=function(){return this.num};Et.prototype.toString=function(){var e=Et.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};Et.smallInt=function(e){return F0.checkArgument(nl.isNumber(e),"Invalid Argument: n should be number"),F0.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?Et("OP_0"):new Et(Et.map.OP_1+e-1)};Et.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_NOP4:182,OP_NOP5:183,OP_NOP6:184,OP_NOP7:185,OP_NOP8:186,OP_NOP9:187,OP_NOP10:188,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};Et.reverseMap=[];for(Xy in Et.map)Et.reverseMap[Et.map[Xy]]=Xy;var Xy;nl.extend(Et,Et.map);Et.isSmallIntOp=function(e){return e instanceof Et&&(e=e.toNumber()),e===Et.map.OP_0||e>=Et.map.OP_1&&e<=Et.map.OP_16};Et.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};wk.exports=Et});var e4=k((Spe,Ek)=>{"use strict";v();var Yn=hf(),_ee=Da(),wee=Wn(),Jy=cr(),he=Gp(),lf=$n(),cf=Vr(),Sk=ws(),er=Bt(),yt=xt(),Qy=ln(),xk=zt(),See=pi(),Q=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],h.Buffer.isBuffer(t))return e.fromBuffer(t);if(t instanceof Yn)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(yt.isString(t))return e.fromString(t);yt.isObject(t)&&yt.isArray(t.chunks)&&this.set(t)};Q.prototype.set=function(e){return er.checkArgument(yt.isObject(e)),er.checkArgument(yt.isArray(e.chunks)),this.chunks=e.chunks,this};Q.fromBuffer=function(e){var t=new Q;t.chunks=[];for(var r=new _ee(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<he.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===he.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===he.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(a){throw a instanceof RangeError?new Qy.Script.InvalidBuffer(e.toString("hex")):a}return t};Q.prototype.toBuffer=function(){for(var e=new wee,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<he.OP_PUSHDATA1?e.write(r.buf):i===he.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===he.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===he.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};Q.fromASM=function(e){var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(n==="0")a=0,t.chunks.push({opcodenum:a}),i=i+1;else if(n==="-1")a=he.OP_1NEGATE,t.chunks.push({opcodenum:a}),i=i+1;else if(yt.isUndefined(a)){var s=h.Buffer.from(r[i],"hex");if(s.toString("hex")!==r[i])throw new Error("invalid hex string in script");var u=s.length;u>=0&&u<he.OP_PUSHDATA1?a=u:u<Math.pow(2,8)?a=he.OP_PUSHDATA1:u<Math.pow(2,16)?a=he.OP_PUSHDATA2:u<Math.pow(2,32)&&(a=he.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),i=i+1}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.fromHex=function(e){return new Q(xk.Buffer.from(e,"hex"))};Q.fromString=function(e){if(See.isHexa(e)||e.length===0)return new Q(xk.Buffer.from(e,"hex"));var t=new Q;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=he(n),a=o.toNumber();if(yt.isUndefined(a))if(a=parseInt(n),a>0&&a<he.OP_PUSHDATA1)t.chunks.push({buf:h.Buffer.from(r[i+1].slice(2),"hex"),len:a,opcodenum:a}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(a===he.OP_PUSHDATA1||a===he.OP_PUSHDATA2||a===he.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:h.Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:a}),i=i+3}else t.chunks.push({opcodenum:a}),i=i+1}return t};Q.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)!i&&(r===he.OP_PUSHDATA1||r===he.OP_PUSHDATA2||r===he.OP_PUSHDATA4)&&(n=n+" "+he(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof he.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+he(r).toString():n=n+" "+he(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};Q.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};Q.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};Q.prototype.toHex=function(){return this.toBuffer().toString("hex")};Q.prototype.inspect=function(){return"<Script: "+this.toString()+">"};Q.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===he.OP_DUP&&this.chunks[1].opcodenum===he.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===he.OP_EQUALVERIFY&&this.chunks[4].opcodenum===he.OP_CHECKSIG)};Q.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};Q.prototype.getPublicKey=function(){return er.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};Q.prototype.getPublicKeyHash=function(){return er.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf};Q.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===he.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return lf.isValid(e)}return!1};Q.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};Q.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===he.OP_HASH160&&e[1]===20&&e[e.length-1]===he.OP_EQUAL};Q.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=Q.fromBuffer(t)}catch(n){if(n instanceof Qy.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==Q.types.UNKNOWN};Q.prototype.isMultisigOut=function(){return this.chunks.length>3&&he.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)})&&he.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===he.OP_CHECKMULTISIG};Q.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&h.Buffer.isBuffer(e.buf)&&cf.isTxDER(e.buf)})};Q.prototype.isDataOut=function(){var e=this.chunks.length>=1&&this.chunks[0].opcodenum===he.OP_RETURN;if(!e)return!1;var t=this.chunks.slice(1),r=new Q({chunks:t});return r.isPushOnly()};Q.prototype.isSafeDataOut=function(){if(this.chunks.length<2||this.chunks[0].opcodenum!==he.OP_FALSE)return!1;var e=this.chunks.slice(1),t=new Q({chunks:e});return t.isDataOut()};Q.prototype.getData=function(){if(this.isSafeDataOut()){var e=this.chunks.slice(2),t=e.map(r=>r.buf);return t}if(this.isDataOut()||this.isScriptHashOut())return yt.isUndefined(this.chunks[1])?h.Buffer.alloc(0):h.Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return h.Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};Q.prototype.isPushOnly=function(){return yt.every(this.chunks,function(e){return e.opcodenum<=he.OP_16||e.opcodenum===he.OP_PUSHDATA1||e.opcodenum===he.OP_PUSHDATA2||e.opcodenum===he.OP_PUSHDATA4})};Q.types={};Q.types.UNKNOWN="Unknown";Q.types.PUBKEY_OUT="Pay to public key";Q.types.PUBKEY_IN="Spend from public key";Q.types.PUBKEYHASH_OUT="Pay to public key hash";Q.types.PUBKEYHASH_IN="Spend from public key hash";Q.types.SCRIPTHASH_OUT="Pay to script hash";Q.types.SCRIPTHASH_IN="Spend from script hash";Q.types.MULTISIG_OUT="Pay to multisig";Q.types.MULTISIG_IN="Spend from multisig";Q.types.DATA_OUT="Data push";Q.types.SAFE_DATA_OUT="Safe data push";Q.OP_RETURN_STANDARD_SIZE=220;Q.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==Q.types.UNKNOWN?e:this.classifyInput()};Q.outputIdentifiers={};Q.outputIdentifiers.PUBKEY_OUT=Q.prototype.isPublicKeyOut;Q.outputIdentifiers.PUBKEYHASH_OUT=Q.prototype.isPublicKeyHashOut;Q.outputIdentifiers.MULTISIG_OUT=Q.prototype.isMultisigOut;Q.outputIdentifiers.SCRIPTHASH_OUT=Q.prototype.isScriptHashOut;Q.outputIdentifiers.DATA_OUT=Q.prototype.isDataOut;Q.outputIdentifiers.SAFE_DATA_OUT=Q.prototype.isSafeDataOut;Q.prototype.classifyOutput=function(){for(var e in Q.outputIdentifiers)if(Q.outputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.inputIdentifiers={};Q.inputIdentifiers.PUBKEY_IN=Q.prototype.isPublicKeyIn;Q.inputIdentifiers.PUBKEYHASH_IN=Q.prototype.isPublicKeyHashIn;Q.inputIdentifiers.MULTISIG_IN=Q.prototype.isMultisigIn;Q.inputIdentifiers.SCRIPTHASH_IN=Q.prototype.isScriptHashIn;Q.prototype.classifyInput=function(){for(var e in Q.inputIdentifiers)if(Q.inputIdentifiers[e].bind(this)())return Q.types[e];return Q.types.UNKNOWN};Q.prototype.isStandard=function(){return this.classify()!==Q.types.UNKNOWN};Q.prototype.prepend=function(e){return this._addByType(e,!0),this};Q.prototype.equals=function(e){if(er.checkState(e instanceof Q,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(h.Buffer.isBuffer(this.chunks[t].buf)&&!h.Buffer.isBuffer(e.chunks[t].buf)||h.Buffer.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};Q.prototype.add=function(e){return this._addByType(e,!1),this};Q.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof he)this._addOpcode(e,t);else if(h.Buffer.isBuffer(e))this._addBuffer(e,t);else if(e instanceof Q)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};Q.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};Q.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof he?r=e.toNumber():r=he(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};Q.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<he.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=he.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=he.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=he.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};Q.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==he.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};Q.buildMultisigOut=function(e,t,r){er.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new Q;i.add(he.smallInt(t)),e=yt.map(e,lf);var n=e;r.noSorting||(n=e.map(s=>s.toString("hex")).sort().map(s=>new lf(s)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(he.smallInt(e.length)),i.add(he.OP_CHECKMULTISIG),i};Q.buildMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n};Q.buildP2SHMultisigIn=function(e,t,r,i){er.checkArgument(yt.isArray(e)),er.checkArgument(yt.isNumber(t)),er.checkArgument(yt.isArray(r)),i=i||{};var n=new Q;return n.add(he.OP_0),yt.each(r,function(o){er.checkArgument(h.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n.add((i.cachedMultisig||Q.buildMultisigOut(e,t,i)).toBuffer()),n};Q.buildPublicKeyHashOut=function(e){er.checkArgument(!yt.isUndefined(e)),er.checkArgument(e instanceof lf||e instanceof Yn||yt.isString(e)),e instanceof lf?e=e.toAddress():yt.isString(e)&&(e=new Yn(e));var t=new Q;return t.add(he.OP_DUP).add(he.OP_HASH160).add(e.hashBuffer).add(he.OP_EQUALVERIFY).add(he.OP_CHECKSIG),t._network=e.network,t};Q.buildPublicKeyOut=function(e){er.checkArgument(e instanceof lf);var t=new Q;return t.add(e.toBuffer()).add(he.OP_CHECKSIG),t};Q.buildDataOut=function(e,t){er.checkArgument(yt.isUndefined(e)||yt.isString(e)||yt.isArray(e)||h.Buffer.isBuffer(e));var r=e;yt.isArray(r)||(r=[e]);var i=new Q;i.add(he.OP_RETURN);for(let n of r)er.checkArgument(yt.isUndefined(n)||yt.isString(n)||h.Buffer.isBuffer(n)),yt.isString(n)&&(n=h.Buffer.from(n,t)),yt.isUndefined(n)||i.add(n);return i};Q.buildSafeDataOut=function(e,t){var r=Q.buildDataOut(e,t),i=new Q;return i.add(he.OP_FALSE),i.add(r),i};Q.buildScriptHashOut=function(e){er.checkArgument(e instanceof Q||e instanceof Yn&&e.isPayToScriptHash());var t=new Q;return t.add(he.OP_HASH160).add(e instanceof Yn?e.hashBuffer:Jy.sha256ripemd160(e.toBuffer())).add(he.OP_EQUAL),t._network=e._network||e.network,t};Q.buildPublicKeyIn=function(e,t){er.checkArgument(e instanceof cf||h.Buffer.isBuffer(e)),er.checkArgument(yt.isUndefined(t)||yt.isNumber(t)),e instanceof cf&&(e=e.toBuffer());var r=new Q;return r.add(h.Buffer.concat([e,h.Buffer.from([(t||cf.SIGHASH_ALL)&255])])),r};Q.buildPublicKeyHashIn=function(e,t,r){er.checkArgument(t instanceof cf||h.Buffer.isBuffer(t)),er.checkArgument(yt.isUndefined(r)||yt.isNumber(r)),t instanceof cf&&(t=t.toBuffer());var i=new Q().add(h.Buffer.concat([t,h.Buffer.from([(r||cf.SIGHASH_ALL)&255])])).add(new lf(e).toBuffer());return i};Q.empty=function(){return new Q};Q.prototype.toScriptHashOut=function(){return Q.buildScriptHashOut(this)};Q.fromAddress=function(e){if(e=Yn(e),e.isPayToScriptHash())return Q.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return Q.buildPublicKeyHashOut(e);throw new Qy.Script.UnrecognizedAddress(e)};Q.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};Q.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Yn.PayToPublicKeyHash;else return!1;return e};Q.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=Jy.sha256ripemd160(this.chunks[1].buf),e.type=Yn.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=Jy.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Yn.PayToScriptHash;else return!1;return e};Q.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=Sk.get(e)||this._network||Sk.defaultNetwork,new Yn(t)):!1};Q.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=Q({chunks:[this.chunks[i]]}),o=n.toBuffer(),a=o.toString("hex");r===a&&this.chunks.splice(i,1)}return this};Q.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===he.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===he.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===he.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===he.OP_PUSHDATA1:r.length<=65535?i===he.OP_PUSHDATA2:!0:!0};Q.prototype._decodeOP_N=function(e){if(e===he.OP_0)return 0;if(e>=he.OP_1&&e<=he.OP_16)return e-(he.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))};Q.prototype.getSignatureOperationsCount=function(e){e=yt.isUndefined(e)?!0:e;var t=this,r=0,i=he.OP_INVALIDOPCODE;return yt.each(t.chunks,function(o){var a=o.opcodenum;a===he.OP_CHECKSIG||a===he.OP_CHECKSIGVERIFY?r++:(a===he.OP_CHECKMULTISIG||a===he.OP_CHECKMULTISIGVERIFY)&&(e&&i>=he.OP_1&&i<=he.OP_16?r+=t._decodeOP_N(i):r+=20),i=a}),r};Ek.exports=Q});var t4=k((Epe,Ik)=>{v();var xee=Object.prototype.toString;Ik.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return Pee(t)?"generatorfunction":"function";if(Eee(t))return"array";if(Ree(t))return"buffer";if(kee(t))return"arguments";if(Iee(t))return"date";if(Oee(t))return"error";if(Aee(t))return"regexp";switch(Ok(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(Tee(t))return"generator";switch(r=xee.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Ok(e){return typeof e.constructor=="function"?e.constructor.name:null}function Eee(e){return Array.isArray?Array.isArray(e):e instanceof Array}function Oee(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Iee(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Aee(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function Pee(e,t){return Ok(e)==="GeneratorFunction"}function Tee(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function kee(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function Ree(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var Tk=k((Ipe,Pk)=>{"use strict";v();var Ak=Symbol.prototype.valueOf,Bee=t4();function Mee(e,t){switch(Bee(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return Lee(e);case"symbol":return qee(e);case"arraybuffer":return Cee(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return Dee(e);case"regexp":return Nee(e);case"error":return Object.create(e);default:return e}}function Nee(e){let t=e.flags!==void 0?e.flags:/\w+$/.exec(e)||void 0,r=new e.constructor(e.source,t);return r.lastIndex=e.lastIndex,r}function Cee(e){let t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function Dee(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}function Lee(e){let t=e.length,r=h.Buffer.allocUnsafe?h.Buffer.allocUnsafe(t):h.Buffer.from(t);return e.copy(r),r}function qee(e){return Ak?Object(Ak.call(e)):{}}Pk.exports=Mee});var Rk=k((Ppe,kk)=>{"use strict";v();kk.exports=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}});var Nk=k((kpe,Mk)=>{"use strict";v();var Uee=Rk();function Bk(e){return Uee(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}Mk.exports=function(t){var r,i;return!(Bk(t)===!1||(r=t.constructor,typeof r!="function")||(i=r.prototype,Bk(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var Dk=k((Bpe,Ck)=>{"use strict";v();var Fee=Tk(),Hee=t4(),jee=Nk();function r4(e,t){switch(Hee(e)){case"object":return zee(e,t);case"array":return Kee(e,t);default:return Fee(e)}}function zee(e,t){if(typeof t=="function")return t(e);if(t||jee(e)){let r=new e.constructor;for(let i in e)r[i]=r4(e[i],t);return r}return e}function Kee(e,t){let r=new e.constructor(e.length);for(let i=0;i<e.length;i++)r[i]=r4(e[i],t);return r}Ck.exports=r4});var ol=k((Npe,Uk)=>{"use strict";v();var Lk=Wn(),qk=Da(),Vee=fr(),Xn=function e(t){if(!(this instanceof e))return new e(t);if(h.Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof Vee){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};Xn.prototype.set=function(e){return this.buf=e.buf||this.buf,this};Xn.prototype.fromString=function(e){return this.set({buf:h.Buffer.from(e,"hex")}),this};Xn.prototype.toString=function(){return this.buf.toString("hex")};Xn.prototype.fromBuffer=function(e){return this.buf=e,this};Xn.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};Xn.prototype.fromBN=function(e){return this.buf=Lk().writeVarintBN(e).concat(),this};Xn.prototype.fromNumber=function(e){return this.buf=Lk().writeVarintNum(e).concat(),this};Xn.prototype.toBuffer=function(){return this.buf};Xn.prototype.toBN=function(){return qk(this.buf).readVarintBN()};Xn.prototype.toNumber=function(){return qk(this.buf).readVarintNum()};Uk.exports=Xn});var La=k((Dpe,Hk)=>{"use strict";v();var Zp=xt(),i4=fr(),Fk=zt(),Wp=pi(),Gee=Wn(),Zee=ol(),n4=bn(),o4=Bt(),Wee=ln(),Yee=9007199254740991;function Zr(e){if(!(this instanceof Zr))return new Zr(e);if(Zp.isObject(e))if(this.satoshis=e.satoshis,h.Buffer.isBuffer(e.script))this._scriptBuffer=e.script;else{var t;Zp.isString(e.script)&&Wp.isHexa(e.script)?t=Fk.Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(Zr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(Zr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof i4?(this._satoshisBN=e,this._satoshis=e.toNumber()):Zp.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=i4.fromNumber(this._satoshis)):(o4.checkArgument(Wp.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=i4.fromNumber(e),this._satoshis=e),o4.checkState(Wp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.invalidSatoshis=function(){return this._satoshis>Yee?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};Object.defineProperty(Zr.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),o4.checkState(Wp.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});Zr.prototype.toObject=Zr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};Zr.fromObject=function(e){return new Zr(e)};Zr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=n4.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof Wee.Script.InvalidBuffer)this._script=null;else throw t}};Zr.prototype.setScript=function(e){if(e instanceof n4)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(Zp.isString(e))this._script=n4.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(h.Buffer.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};Zr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};Zr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=Fk.Buffer.from([]),new Zr(t)};Zr.prototype.toBufferWriter=function(e){e||(e=new Gee),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};Zr.prototype.getSize=function(){var e=this.script.toBuffer().length,t=Zee(e).toBuffer().length;return 8+t+e};Hk.exports=Zr});var al=k((qpe,Vk)=>{"use strict";v();var As=xt(),$ee=Bt(),H0=ln(),Xee=Wn(),a4=zt(),zk=pi(),Yp=bn(),Jee=qa(),jk=La(),$p=4294967295,Qee=$p-2,Kk=$p,ete=$p-1;function jt(e){if(!(this instanceof jt))return new jt(e);if(e)return this._fromObject(e)}jt.MAXINT=$p;jt.DEFAULT_SEQNUMBER=Kk;jt.DEFAULT_LOCKTIME_SEQNUMBER=ete;jt.DEFAULT_RBF_SEQNUMBER=Qee;jt.BASE_SIZE=40;Object.defineProperty(jt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new Yp(this._scriptBuffer),this._script._isInput=!0),this._script)}});jt.fromObject=function(e){$ee.checkArgument(As.isObject(e));var t=new jt;return t._fromObject(e)};jt.prototype._fromObject=function(e){var t;if(As.isString(e.prevTxId)&&zk.isHexa(e.prevTxId)?t=a4.Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.output=e.output?e.output instanceof jk?e.output:new jk(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=As.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=As.isUndefined(e.sequenceNumber)?As.isUndefined(e.seqnum)?Kk:e.seqnum:e.sequenceNumber,As.isUndefined(e.script)&&As.isUndefined(e.scriptBuffer))throw new H0.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};jt.prototype.toObject=jt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};jt.fromBufferReader=function(e){var t=new jt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};jt.prototype.toBufferWriter=function(e){e||(e=new Xee),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};jt.prototype.setScript=function(e){if(this._script=null,e instanceof Yp)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(e===null)this._script=Yp.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(zk.isHexa(e))this._scriptBuffer=a4.Buffer.from(e,"hex");else if(As.isString(e))this._script=new Yp(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(h.Buffer.isBuffer(e))this._scriptBuffer=a4.Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};jt.prototype.getSignatures=function(){throw new H0.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};jt.prototype.isFullySigned=function(){throw new H0.AbstractMethodInvoked("Input#isFullySigned")};jt.prototype.isFinal=function(){return this.sequenceNumber===jt.MAXINT};jt.prototype.addSignature=function(){throw new H0.AbstractMethodInvoked("Input#addSignature")};jt.prototype.clearSignatures=function(){throw new H0.AbstractMethodInvoked("Input#clearSignatures")};jt.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,Jee.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};jt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};jt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};Vk.exports=jt});var ul=k((Fpe,Wk)=>{"use strict";v();var sl=xt(),_n=Bt(),tte=Ot(),Gk=pi(),Zk=$n(),rte=ln(),j0=Vr();function Jn(e){if(!(this instanceof Jn))return new Jn(e);if(e instanceof Jn)return e;if(sl.isObject(e))return this._fromObject(e);throw new rte.InvalidArgument("TransactionSignatures must be instantiated from an object")}tte(Jn,j0);Jn.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new Zk(e.publicKey),this.prevTxId=h.Buffer.isBuffer(e.prevTxId)?e.prevTxId:h.Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof j0?e.signature:h.Buffer.isBuffer(e.signature)?j0.fromBuffer(e.signature):j0.fromString(e.signature),this.sigtype=e.sigtype,this};Jn.prototype._checkObjectArgs=function(e){_n.checkArgument(Zk(e.publicKey),"publicKey"),_n.checkArgument(!sl.isUndefined(e.inputIndex),"inputIndex"),_n.checkArgument(!sl.isUndefined(e.outputIndex),"outputIndex"),_n.checkState(sl.isNumber(e.inputIndex),"inputIndex must be a number"),_n.checkState(sl.isNumber(e.outputIndex),"outputIndex must be a number"),_n.checkArgument(e.signature,"signature"),_n.checkArgument(e.prevTxId,"prevTxId"),_n.checkState(e.signature instanceof j0||h.Buffer.isBuffer(e.signature)||Gk.isHexa(e.signature),"signature must be a buffer or hexa value"),_n.checkState(h.Buffer.isBuffer(e.prevTxId)||Gk.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),_n.checkArgument(e.sigtype,"sigtype"),_n.checkState(sl.isNumber(e.sigtype),"sigtype must be a number")};Jn.prototype.toObject=Jn.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};Jn.fromObject=function(e){return _n.checkArgument(e),new Jn(e)};Wk.exports=Jn});var Qk=k((jpe,Jk)=>{"use strict";v();var ite=Ot(),$k=Bt(),s4=al(),nte=La(),ote=qa(),Xk=bn(),Yk=Vr(),ate=ul();function Ua(){s4.apply(this,arguments)}ite(Ua,s4);Ua.prototype.getSignatures=function(e,t,r,i){$k.checkState(this.output instanceof nte),i=i||Yk.SIGHASH_ALL|Yk.SIGHASH_FORKID;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new ate({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:ote.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Ua.prototype.addSignature=function(e,t){return $k.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(Xk.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};Ua.prototype.clearSignatures=function(){return this.setScript(Xk.empty()),this};Ua.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};Ua.SCRIPT_MAX_SIZE=74;Ua.prototype._estimateSize=function(){return s4.BASE_SIZE+Ua.SCRIPT_MAX_SIZE};Jk.exports=Ua});var nR=k((Kpe,iR)=>{"use strict";v();var ste=Ot(),tR=Bt(),ute=cr(),u4=al(),fte=La(),cte=qa(),rR=bn(),eR=Vr(),lte=ul();function Fa(){u4.apply(this,arguments)}ste(Fa,u4);Fa.prototype.getSignatures=function(e,t,r,i,n){tR.checkState(this.output instanceof fte),n=n||ute.sha256ripemd160(t.publicKey.toBuffer()),i=i||eR.SIGHASH_ALL|eR.SIGHASH_FORKID;var o=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return o&&n.equals(o)?[new lte({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:cte.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Fa.prototype.addSignature=function(e,t){return tR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(rR.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};Fa.prototype.clearSignatures=function(){return this.setScript(rR.empty()),this};Fa.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()};Fa.SCRIPT_MAX_SIZE=108;Fa.prototype._estimateSize=function(){return u4.BASE_SIZE+Fa.SCRIPT_MAX_SIZE};iR.exports=Fa});var sR=k((Gpe,aR)=>{"use strict";v();var Qn=xt(),hte=Ot(),Jp=al(),dte=La(),z0=Bt(),oR=bn(),Xp=Vr(),f4=qa(),c4=ul(),pte=$n(),gte=ol();function Br(e,t,r,i){Jp.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new pte(o)),z0.checkState(oR.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},Qn.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}hte(Br,Jp);Br.prototype.toObject=function(){var e=Jp.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=Qn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Br.prototype._deserializeSignatures=function(e){return Qn.map(e,function(t){if(t)return new c4(t)})};Br.prototype._serializeSignatures=function(){return Qn.map(this.signatures,function(e){if(e)return e.toObject()})};Br.prototype.getSignatures=function(e,t,r,i){z0.checkState(this.output instanceof dte),i=i||Xp.SIGHASH_ALL|Xp.SIGHASH_FORKID;var n=this,o=[];return Qn.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new c4({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:f4.sign(e,t,i,r,n.output.script,n.output.satoshisBN),sigtype:i}))}),o};Br.prototype.addSignature=function(e,t){return z0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),z0.checkArgument(!Qn.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),z0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Br.prototype._updateScript=function(){return this.setScript(oR.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Br.prototype._createSignatures=function(){return Qn.map(Qn.filter(this.signatures,function(e){return!Qn.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Br.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Br.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Br.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Br.prototype.countSignatures=function(){return Qn.reduce(this.signatures,function(e,t){return e+!!t},0)};Br.prototype.publicKeysWithoutSignature=function(){var e=this;return Qn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Br.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,f4.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};Br.normalizeSignatures=function(e,t,r,i,n){return n.map(function(o){var a=null;return i=i.filter(function(s){if(a)return!0;var u=new c4({signature:Xp.fromTxFormat(s),publicKey:o,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:Xp.SIGHASH_ALL});u.signature.nhashtype=u.sigtype;var c=f4.verify(e,u.signature,u.publicKey,u.inputIndex,t.output.script);return c?(a=u,!1):!0}),a||null})};Br.SIGNATURE_SIZE=73;Br.prototype._estimateSize=function(){var e=1+this.threshold*Br.SIGNATURE_SIZE;return Jp.BASE_SIZE+gte(e).toBuffer().length+e};aR.exports=Br});var hR=k((Wpe,lR)=>{"use strict";v();var eo=xt(),vte=Ot(),Qp=al(),mte=La(),K0=Bt(),l4=bn(),uR=Vr(),fR=qa(),cR=ul(),yte=$n(),bte=ol();function Er(e,t,r,i){Qp.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new yte(o)),this.redeemScript=l4.buildMultisigOut(this.publicKeys,r),K0.checkState(l4.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},eo.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}vte(Er,Qp);Er.prototype.toObject=function(){var e=Qp.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=eo.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Er.prototype._deserializeSignatures=function(e){return eo.map(e,function(t){if(t)return new cR(t)})};Er.prototype._serializeSignatures=function(){return eo.map(this.signatures,function(e){if(e)return e.toObject()})};Er.prototype.getSignatures=function(e,t,r,i){K0.checkState(this.output instanceof mte),i=i||uR.SIGHASH_ALL|uR.SIGHASH_FORKID;var n=this,o=[];return eo.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new cR({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:fR.sign(e,t,i,r,n.redeemScript,n.output.satoshisBN),sigtype:i}))}),o};Er.prototype.addSignature=function(e,t){return K0.checkState(!this.isFullySigned(),"All needed signatures have already been added"),K0.checkArgument(!eo.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),K0.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Er.prototype._updateScript=function(){return this.setScript(l4.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this};Er.prototype._createSignatures=function(){return eo.map(eo.filter(this.signatures,function(e){return!eo.isUndefined(e)}),function(e){return h.Buffer.concat([e.signature.toDER(),h.Buffer.from([e.sigtype&255])])})};Er.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Er.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Er.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Er.prototype.countSignatures=function(){return eo.reduce(this.signatures,function(e,t){return e+!!t},0)};Er.prototype.publicKeysWithoutSignature=function(){var e=this;return eo.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Er.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,fR.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)};Er.SIGNATURE_SIZE=73;Er.PUBKEY_SIZE=34;Er.prototype._estimateSize=function(){var e=this.publicKeys.length*Er.PUBKEY_SIZE,t=this.threshold*Er.SIGNATURE_SIZE,r=3+e,i=r<=75?1:r<=255?2:3,n=t+1+i+r;return Qp.BASE_SIZE+bte(n).toBuffer().length+n};lR.exports=Er});var e6=k(($pe,fl)=>{v();fl.exports=al();fl.exports.PublicKey=Qk();fl.exports.PublicKeyHash=nR();fl.exports.MultiSig=sR();fl.exports.MultiSigScriptHash=hR()});var qa=k((Jpe,mR)=>{"use strict";v();var _te=zt(),Fi=Vr(),h4=bn(),wte=La(),Ste=Da(),V0=Wn(),dR=fr(),t6=cr(),pR=i6(),d4=Bt(),p4=r6(),Ps=xt(),gR=h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),xte="ffffffffffffffff",Ete=p4.SCRIPT_ENABLE_SIGHASH_FORKID,Ote=function(e,t,r,i,n){var o=e.inputs[r];d4.checkArgument(n instanceof dR,"For ForkId=0 signatures, satoshis or complete input must be provided");function a(M){var D=new V0;Ps.each(M.inputs,function(K){D.writeReverse(K.prevTxId),D.writeUInt32LE(K.outputIndex)});var L=D.toBuffer(),U=t6.sha256sha256(L);return U}function s(M){var D=new V0;Ps.each(M.inputs,function(K){D.writeUInt32LE(K.sequenceNumber)});var L=D.toBuffer(),U=t6.sha256sha256(L);return U}function u(M,D){var L=new V0;Ps.isUndefined(D)?Ps.each(M.outputs,function(N){N.toBufferWriter(L)}):M.outputs[D].toBufferWriter(L);var U=L.toBuffer(),K=t6.sha256sha256(U);return K}var c=h.Buffer.alloc(32),l=h.Buffer.alloc(32),m=h.Buffer.alloc(32);t&Fi.SIGHASH_ANYONECANPAY||(c=a(e)),!(t&Fi.SIGHASH_ANYONECANPAY)&&(t&31)!==Fi.SIGHASH_SINGLE&&(t&31)!==Fi.SIGHASH_NONE&&(l=s(e)),(t&31)!==Fi.SIGHASH_SINGLE&&(t&31)!==Fi.SIGHASH_NONE?m=u(e):(t&31)===Fi.SIGHASH_SINGLE&&r<e.outputs.length&&(m=u(e,r));var w=new V0;w.writeInt32LE(e.version),w.write(c),w.write(l),w.writeReverse(o.prevTxId),w.writeUInt32LE(o.outputIndex),w.writeVarintNum(i.toBuffer().length),w.write(i.toBuffer()),w.writeUInt64LEBN(n);var E=o.sequenceNumber;w.writeUInt32LE(E),w.write(m),w.writeUInt32LE(e.nLockTime),w.writeUInt32LE(t>>>0);var P=w.toBuffer();return P},vR=function(t,r,i,n,o,a){var s=v4(),u=e6();Ps.isUndefined(a)&&(a=Ete);var c=s.shallowCopy(t);if(n=new h4(n),a&p4.SCRIPT_ENABLE_REPLAY_PROTECTION){var l=r>>8,m=16711680|l^57005;r=m<<8|r&255}if(r&Fi.SIGHASH_FORKID&&a&p4.SCRIPT_ENABLE_SIGHASH_FORKID)return Ote(c,r,i,n,o);n.removeCodeseparators();var w;for(w=0;w<c.inputs.length;w++)c.inputs[w]=new u(c.inputs[w]).setScript(h4.empty());if(c.inputs[i]=new u(c.inputs[i]).setScript(n),(r&31)===Fi.SIGHASH_NONE||(r&31)===Fi.SIGHASH_SINGLE)for(w=0;w<c.inputs.length;w++)w!==i&&(c.inputs[w].sequenceNumber=0);if((r&31)===Fi.SIGHASH_NONE)c.outputs=[];else if((r&31)===Fi.SIGHASH_SINGLE){if(i>=c.outputs.length)return gR;for(c.outputs.length=i+1,w=0;w<i;w++)c.outputs[w]=new wte({satoshis:dR.fromBuffer(_te.Buffer.from(xte,"hex")),script:h4.empty()})}r&Fi.SIGHASH_ANYONECANPAY&&(c.inputs=[c.inputs[i]]);var E=new V0().write(c.toBuffer()).writeInt32LE(r).toBuffer();return E},g4=function(t,r,i,n,o,a){var s=vR(t,r,i,n,o,a);if(s.compare(gR)===0)return s;var u=t6.sha256sha256(s);return u=new Ste(u).readReverse(),u};function Ite(e,t,r,i,n,o,a){var s=g4(e,r,i,n,o,a),u=pR.sign(s,t,"little").set({nhashtype:r});return u}function Ate(e,t,r,i,n,o,a){d4.checkArgument(!Ps.isUndefined(e)),d4.checkArgument(!Ps.isUndefined(t)&&!Ps.isUndefined(t.nhashtype));var s=g4(e,t.nhashtype,i,n,o,a);return pR.verify(s,t,r,"little")}mR.exports={sighashPreimage:vR,sighash:g4,sign:Ite,verify:Ate}});var m4=k((e6e,bR)=>{"use strict";v();var Ha=xt(),n6=Bt(),yR=pi(),Pte=bn(),Tte=hf();function ja(e){if(!(this instanceof ja))return new ja(e);n6.checkArgument(Ha.isObject(e),"Must provide an object from where to extract data");var t=e.address?new Tte(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!yR.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=Ha.isUndefined(e.vout)?e.outputIndex:e.vout;if(!Ha.isNumber(i))throw new Error("Invalid outputIndex, received "+i);n6.checkArgument(!Ha.isUndefined(e.scriptPubKey)||!Ha.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new Pte(e.scriptPubKey||e.script);n6.checkArgument(!Ha.isUndefined(e.amount)||!Ha.isUndefined(e.satoshis),"Must provide an amount for the output");var o=Ha.isUndefined(e.amount)?e.satoshis:Math.round(e.amount*1e8);n6.checkArgument(Ha.isNumber(o),"Amount must be a number"),yR.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}ja.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};ja.prototype.toString=function(){return this.txId+":"+this.outputIndex};ja.fromObject=function(e){return new ja(e)};ja.prototype.toObject=ja.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}};bR.exports=ja});var v4=k((r6e,AR)=>{"use strict";v();var Ee=xt(),Wr=Bt(),kte=zt(),Nr=ln(),wR=pi(),SR=Da(),Rte=Wn(),_R=ol(),xR=cr(),a6=Vr(),ER=qa(),Bte=hf(),OR=m4(),Mr=e6(),Mte=Mr.PublicKeyHash,Nte=Mr.PublicKey,Cte=Mr.MultiSigScriptHash,Dte=Mr.MultiSig,to=La(),Co=bn(),Lte=G0(),o6=fr(),qte=r6(),Ute=qte.SCRIPT_ENABLE_SIGHASH_FORKID;function fe(e){if(!(this instanceof fe))return new fe(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof fe)return fe.shallowCopy(e);if(wR.isHexa(e))this.fromString(e);else if(h.Buffer.isBuffer(e))this.fromBuffer(e);else if(Ee.isObject(e))this.fromObject(e);else throw new Nr.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var Fte=1,Hte=0,jte=1e6;fe.DUST_AMOUNT=546;fe.FEE_SECURITY_MARGIN=150;fe.MAX_MONEY=21e6*1e8;fe.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;fe.NLOCKTIME_MAX_VALUE=4294967295;fe.FEE_PER_KB=500;fe.CHANGE_OUTPUT_MAX_SIZE=62;fe.shallowCopy=function(e){var t=new fe(e.toBuffer());return t};var IR={configurable:!1,enumerable:!0,get:function(){return this._hash=new SR(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(fe.prototype,"hash",IR);Object.defineProperty(fe.prototype,"id",IR);var y4={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(fe.prototype,"inputAmount",y4);y4.get=function(){return this._getOutputAmount()};Object.defineProperty(fe.prototype,"outputAmount",y4);fe.prototype._getHash=function(){return xR.sha256sha256(this.toBuffer())};fe.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};fe.prototype.uncheckedSerialize=fe.prototype.toString=function(){return this.toBuffer().toString("hex")};fe.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()};fe.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};fe.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Nr.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Nr.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};fe.prototype._hasFeeError=function(e,t){if(!Ee.isUndefined(this._fee)&&this._fee!==t)return new Nr.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(fe.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Nr.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Nr.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}};fe.prototype._missingChange=function(){return!this._changeScript};fe.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<fe.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new Nr.Transaction.DustOutputs}};fe.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Nr.Transaction.MissingSignatures};fe.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};fe.prototype.toBuffer=function(){var e=new Rte;return this.toBufferWriter(e).toBuffer()};fe.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),Ee.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),Ee.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e};fe.prototype.fromBuffer=function(e){var t=new SR(e);return this.fromBufferReader(t)};fe.prototype.fromBufferReader=function(e){Wr.checkArgument(!e.finished(),"No transaction data received");var t,r,i;for(this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=Mr.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(to.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this};fe.prototype.toObject=fe.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),Ee.isUndefined(this._changeIndex)||(i.changeIndex=this._changeIndex),Ee.isUndefined(this._fee)||(i.fee=this._fee),i};fe.prototype.fromObject=function(t){Wr.checkArgument(Ee.isObject(t)||t instanceof fe);var r=this,i;return t instanceof fe?i=i.toObject():i=t,Ee.each(i.inputs,function(n){if(!n.output||!n.output.script){r.uncheckedAddInput(new Mr(n));return}var o=new Co(n.output.script),a;if(o.isPublicKeyHashOut())a=new Mr.PublicKeyHash(n);else if(o.isScriptHashOut()&&n.publicKeys&&n.threshold)a=new Mr.MultiSigScriptHash(n,n.publicKeys,n.threshold,n.signatures);else if(o.isPublicKeyOut())a=new Mr.PublicKey(n);else throw new Nr.Transaction.Input.UnsupportedScript(n.output.script);r.addInput(a)}),Ee.each(i.outputs,function(n){r.addOutput(new to(n))}),i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new Co(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};fe.prototype._checkConsistency=function(e){Ee.isUndefined(this._changeIndex)||(Wr.checkState(this._changeScript,"Change script is expected."),Wr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),Wr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&Wr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};fe.prototype.lockUntilDate=function(e){if(Wr.checkArgument(e),Ee.isNumber(e)&&e<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.LockTimeTooEarly;Ee.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.lockUntilBlockHeight=function(e){if(Wr.checkArgument(Ee.isNumber(e)),e>=fe.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Nr.Transaction.BlockHeightTooHigh;if(e<0)throw new Nr.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Mr.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Mr.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};fe.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<fe.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};fe.prototype.fromString=function(e){this.fromBuffer(kte.Buffer.from(e,"hex"))};fe.prototype._newTransaction=function(){this.version=Fte,this.nLockTime=Hte};fe.prototype.from=function(e,t,r){if(Ee.isArray(e)){var i=this;return Ee.each(e,function(o){i.from(o,t,r)}),this}var n=Ee.some(this.inputs,function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex});return n?this:(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e),this)};fe.prototype._fromNonP2SH=function(e){var t;e=new OR(e),e.script.isPublicKeyHashOutPrefix()?t=Mte:e.script.isPublicKeyOut()?t=Nte:t=Mr,this.addInput(new t({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()}))};fe.prototype._fromMultisigUtxo=function(e,t,r){Wr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");var i;if(e=new OR(e),e.script.isMultisigOut())i=Dte;else if(e.script.isScriptHashOut())i=Cte;else throw new Nr.Transaction.Input.UnsupportedScript(e.script.toString());this.addInput(new i({output:new to({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Co.empty()},t,r))};fe.prototype.addInput=function(e,t,r){if(Wr.checkArgumentType(e,Mr,"input"),!e.output&&(Ee.isUndefined(t)||Ee.isUndefined(r)))throw new Nr.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&!Ee.isUndefined(r)&&(t=t instanceof Co?t:new Co(t),Wr.checkArgumentType(r,"number","satoshis"),e.output=new to({script:t,satoshis:r})),this.uncheckedAddInput(e)};fe.prototype.uncheckedAddInput=function(e){return Wr.checkArgumentType(e,Mr,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};fe.prototype.hasAllUtxoInfo=function(){return Ee.every(this.inputs.map(function(e){return!!e.output}))};fe.prototype.fee=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};fe.prototype.feePerKb=function(e){return Wr.checkArgument(Ee.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};fe.prototype.change=function(e){return Wr.checkArgument(e,"address is required"),this._changeScript=Co.fromAddress(e),this._updateChangeOutput(),this};fe.prototype.getChangeOutput=function(){return Ee.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]};fe.prototype.to=function(e,t){if(Ee.isArray(e)){var r=this;return Ee.each(e,function(i){r.to(i.address,i.satoshis)}),this}return Wr.checkArgument(wR.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new to({script:Co(new Bte(e)),satoshis:t})),this};fe.prototype.addData=function(e){return this.addOutput(new to({script:Co.buildDataOut(e),satoshis:0})),this};fe.prototype.addSafeData=function(e){return this.addOutput(new to({script:Co.buildSafeDataOut(e),satoshis:0})),this};fe.prototype.addOutput=function(e){return Wr.checkArgumentType(e,to,"output"),this._addOutput(e),this._updateChangeOutput(),this};fe.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};fe.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};fe.prototype._getOutputAmount=function(){if(Ee.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,Ee.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount};fe.prototype._getInputAmount=function(){if(Ee.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,Ee.each(this.inputs,function(t){if(Ee.isUndefined(t.output))throw new Nr.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount};fe.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),Ee.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue(),t=this.getFee(),r=e-t;this._removeOutput(this._changeIndex),this._changeIndex=void 0,r>=fe.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new to({script:this._changeScript,satoshis:r})))}};fe.prototype.getFee=function(){return this.isCoinbase()?0:Ee.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee};fe.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||fe.FEE_PER_KB))};fe.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};fe.prototype._clearSignatures=function(){Ee.each(this.inputs,function(e){e.clearSignatures!==Mr.prototype.clearSignatures&&e.clearSignatures()})};fe.prototype._estimateSize=function(){var e=8;return e+=_R(this.inputs.length).toBuffer().length,e+=_R(this.outputs.length).toBuffer().length,Ee.each(this.inputs,function(t){e+=t._estimateSize()}),Ee.each(this.outputs,function(t){e+=t.getSize()}),e};fe.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=Ee.without(this.outputs,t),this._outputAmount=void 0};fe.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};fe.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.prevTxId.compare(i.prevTxId)||r.outputIndex-i.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.satoshis-i.satoshis||r.script.toBuffer().compare(i.script.toBuffer())}),t}),this};fe.prototype.shuffleOutputs=function(){return this.sortOutputs(Ee.shuffle)};fe.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};fe.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};fe.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||Ee.difference(this.outputs,e).length!==0;if(t)throw new Nr.Transaction.InvalidSorting;if(!Ee.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};fe.prototype.removeInput=function(e,t){var r;if(!t&&Ee.isNumber(e)?r=e:r=Ee.findIndex(this.inputs,function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Nr.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=Ee.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};fe.prototype.sign=function(e,t){Wr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return Ee.isArray(e)?(Ee.each(e,function(i){r.sign(i,t)}),this):(Ee.each(this.getSignatures(e,t),function(i){r.applySignature(i)}),this)};fe.prototype.getSignatures=function(e,t){e=new Lte(e),t=t||a6.SIGHASH_ALL|a6.SIGHASH_FORKID;var r=this,i=[],n=xR.sha256ripemd160(e.publicKey.toBuffer());return Ee.each(this.inputs,function(a,s){Ee.each(a.getSignatures(r,e,s,t,n),function(u){i.push(u)})}),i};fe.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this};fe.prototype.isFullySigned=function(){return Ee.each(this.inputs,function(e){if(e.isFullySigned===Mr.prototype.isFullySigned)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),Ee.every(Ee.map(this.inputs,function(e){return e.isFullySigned()}))};fe.prototype.isValidSignature=function(e){var t=this;if(this.inputs[e.inputIndex].isValidSignature===Mr.prototype.isValidSignature)throw new Nr.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(t,e)};fe.prototype.verifySignature=function(e,t,r,i,n,o){return ER.verify(this,e,t,r,i,n,o)};fe.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new o6(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new o6(fe.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new o6(fe.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>jte)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(!Ee.isUndefined(i[o]))return"transaction input "+t+" duplicate input";i[o]=!0}var a=this.isCoinbase();if(a){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};fe.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};fe.prototype.sighash=function(e,t,r,i,n){t=t||a6.SIGHASH_ALL|a6.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new o6(o.output.satoshis)),n=n||Ute,ER.sighash(this,t,e,r,i,n)};AR.exports=fe});var Ts=k((n6e,df)=>{v();df.exports=v4();df.exports.Input=e6();df.exports.Output=La();df.exports.UnspentOutput=m4();df.exports.Signature=ul();df.exports.Sighash=qa()});var r6=k((a6e,TR)=>{"use strict";v();var s6=xt(),W0=e4(),V=Gp(),Te=fr(),Z0=cr(),pf=Vr(),b4=$n(),PR=Dk(),oe=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};oe.prototype.verify=function(e,t,r,i,n,o){var a=Ts();if(s6.isUndefined(r)&&(r=new a),s6.isUndefined(i)&&(i=0),s6.isUndefined(n)&&(n=0),n&oe.SCRIPT_ENABLE_SIGHASH_FORKID&&(n|=oe.SCRIPT_VERIFY_STRICTENC,!o))throw new Error("internal error - need satoshisBN to verify FORKID transactions");this.set({script:e,tx:r,nin:i,flags:n,satoshisBN:o});var s;if((n&oe.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;n&oe.SCRIPT_VERIFY_P2SH&&(s=this.stack.slice());var u=this.stack;if(this.initialize(),this.set({script:t,stack:u,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var c=this.stack[this.stack.length-1];if(!oe.castToBool(c))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(n&oe.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(s.length===0)throw new Error("internal error - stack copy empty");var l=s[s.length-1],m=W0.fromBuffer(l);if(s.pop(),this.initialize(),this.set({script:m,stack:s,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(s.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!oe.castToBool(s[s.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if((n&oe.SCRIPT_VERIFY_CLEANSTACK)!==0){if((n&oe.SCRIPT_VERIFY_P2SH)===0)throw new Error("internal error - CLEANSTACK without P2SH");if(s.length!==1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0};TR.exports=oe;oe.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0};oe.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin<"u"?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc<"u"?e.pc:this.pc,this.pbegincodehash=typeof e.pbegincodehash<"u"?e.pbegincodehash:this.pbegincodehash,this.nOpCount=typeof e.nOpCount<"u"?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags<"u"?e.flags:this.flags};oe.true=h.Buffer.from([1]);oe.false=h.Buffer.from([]);oe.MAX_SCRIPT_ELEMENT_SIZE=520;oe.MAXIMUM_ELEMENT_SIZE=4;oe.MAX_OPS_PER_SCRIPT=201;oe.LOCKTIME_THRESHOLD=5e8;oe.LOCKTIME_THRESHOLD_BN=new Te(oe.LOCKTIME_THRESHOLD);oe.useGenesisLimits=function(e){return e=e||2147483647,oe.MAX_SCRIPT_ELEMENT_SIZE=e,oe.MAXIMUM_ELEMENT_SIZE=e,oe.MAX_OPS_PER_SCRIPT=e,oe};oe.SCRIPT_VERIFY_NONE=0;oe.SCRIPT_VERIFY_P2SH=1;oe.SCRIPT_VERIFY_STRICTENC=2;oe.SCRIPT_VERIFY_DERSIG=4;oe.SCRIPT_VERIFY_LOW_S=8;oe.SCRIPT_VERIFY_NULLDUMMY=16;oe.SCRIPT_VERIFY_SIGPUSHONLY=32;oe.SCRIPT_VERIFY_MINIMALDATA=64;oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;oe.SCRIPT_VERIFY_CLEANSTACK=256;oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;oe.SCRIPT_VERIFY_MINIMALIF=8192;oe.SCRIPT_VERIFY_NULLFAIL=16384;oe.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768;oe.SCRIPT_ENABLE_SIGHASH_FORKID=65536;oe.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;oe.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18;oe.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19;oe.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;oe.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;oe.SEQUENCE_LOCKTIME_MASK=65535;oe.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};oe.prototype.checkSignatureEncoding=function(e){var t;if(e.length===0)return!0;if((this.flags&(oe.SCRIPT_VERIFY_DERSIG|oe.SCRIPT_VERIFY_LOW_S|oe.SCRIPT_VERIFY_STRICTENC))!==0&&!pf.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if((this.flags&oe.SCRIPT_VERIFY_LOW_S)!==0){if(t=pf.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if((this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0){if(t=pf.fromTxFormat(e),!t.hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&pf.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&pf.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0};oe.prototype.checkPubkeyEncoding=function(e){return(this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0&&!b4.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):!0};oe._isMinimallyEncoded=function(e,t){return t=t||oe.MAXIMUM_ELEMENT_SIZE,!(e.length>t||e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))};oe._minimallyEncode=function(e){if(e.length===0)return e;var t=e[e.length-1];if(t&127)return e;if(e.length===1)return h.Buffer.from("");if(e[e.length-2]&128)return e;for(var r=e.length-1;r>0;r--)if(e[r-1]!==0)return e[r-1]&128?e[r++]=t:e[r-1]|=t,e.slice(0,r);return h.Buffer.from("")};oe.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:V.fromNumber(this.script.chunks[this.pc].opcodenum)};var e=this.step();if(!e)return!1;this._callbackStep(t)}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};oe.prototype._callbackStep=function(e){if(typeof this.stepListener=="function")try{this.stepListener(e,PR(this.stack,!0),PR(this.altstack,!0))}catch(t){console.log(`Error in Step callback:${t}`)}};oe.prototype.checkLockTime=function(e){return!(!(this.tx.nLockTime<oe.LOCKTIME_THRESHOLD&&e.lt(oe.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=oe.LOCKTIME_THRESHOLD&&e.gte(oe.LOCKTIME_THRESHOLD_BN))||e.gt(new Te(this.tx.nLockTime))||this.tx.inputs[this.nin].isFinal())};oe.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||t&oe.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=oe.SEQUENCE_LOCKTIME_TYPE_FLAG|oe.SEQUENCE_LOCKTIME_MASK,i=new Te(t&r),n=e.and(r),o=new Te(oe.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o))||n.gt(i))};function zte(e,t){let r=e;for(;r.length<t;)r=h.Buffer.concat([h.Buffer.from([0]),r]);return r}oe.prototype.step=function(){var e=this;function t(se){return e.stack[e.stack.length+se]}function r(se){switch(se){case V.OP_2MUL:case V.OP_2DIV:return!0;case V.OP_INVERT:case V.OP_MUL:case V.OP_LSHIFT:case V.OP_RSHIFT:if((e.flags&oe.SCRIPT_ENABLE_MAGNETIC_OPCODES)===0)return!0;break;case V.OP_DIV:case V.OP_MOD:case V.OP_SPLIT:case V.OP_CAT:case V.OP_AND:case V.OP_OR:case V.OP_XOR:case V.OP_BIN2NUM:case V.OP_NUM2BIN:return!1;default:break}return!1}var i=(this.flags&oe.SCRIPT_VERIFY_MINIMALDATA)!==0,n=this.vfExec.indexOf(!1)===-1,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F=this.script.chunks[this.pc];this.pc++;var H=F.opcodenum;if(s6.isUndefined(H))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(F.buf&&F.buf.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(H>V.OP_16&&++this.nOpCount>oe.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(r(H))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(n&&H>=0&&H<=V.OP_PUSHDATA4){if(i&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!F.buf)this.stack.push(oe.false);else{if(F.len!==F.buf.length)throw new Error(`Length of push value not equal to length of data (${F.len},${F.buf.length})`);this.stack.push(F.buf)}}else if(n||V.OP_IF<=H&&H<=V.OP_ENDIF)switch(H){case V.OP_1NEGATE:case V.OP_1:case V.OP_2:case V.OP_3:case V.OP_4:case V.OP_5:case V.OP_6:case V.OP_7:case V.OP_8:case V.OP_9:case V.OP_10:case V.OP_11:case V.OP_12:case V.OP_13:case V.OP_14:case V.OP_15:case V.OP_16:c=H-(V.OP_1-1),o=new Te(c).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_NOP:break;case V.OP_NOP2:case V.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=Te.fromScriptNumBuffer(this.stack[this.stack.length-1],i,5);if(z.lt(new Te(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(z))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP3:case V.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var G=Te.fromScriptNumBuffer(t(-1),i,5);if(G.lt(new Te(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((G&oe.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(G))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case V.OP_NOP1:case V.OP_NOP4:case V.OP_NOP5:case V.OP_NOP6:case V.OP_NOP7:case V.OP_NOP8:case V.OP_NOP9:case V.OP_NOP10:if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case V.OP_IF:case V.OP_NOTIF:if(N=!1,n){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(o=t(-1),this.flags&oe.SCRIPT_VERIFY_MINIMALIF){if(o.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(o.length===1&&o[0]!==1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}N=oe.castToBool(o),H===V.OP_NOTIF&&(N=!N),this.stack.pop()}this.vfExec.push(N);break;case V.OP_ELSE:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case V.OP_ENDIF:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case V.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),N=oe.castToBool(o),N)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1;break;case V.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case V.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case V.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case V.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case V.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3),s=t(-2);var B=t(-1);this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s)),this.stack.push(h.Buffer.from(B));break;case V.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-4),s=t(-3),this.stack.push(h.Buffer.from(a)),this.stack.push(h.Buffer.from(s));break;case V.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-6,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;u=this.stack.splice(this.stack.length-4,2),this.stack.push(u[0]),this.stack.push(u[1]);break;case V.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1),N=oe.castToBool(o),N&&this.stack.push(h.Buffer.from(o));break;case V.OP_DEPTH:o=new Te(this.stack.length).toScriptNumBuffer(),this.stack.push(o);break;case V.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case V.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-1)));break;case V.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case V.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(h.Buffer.from(t(-2)));break;case V.OP_PICK:case V.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),w=Te.fromScriptNumBuffer(o,i),c=w.toNumber(),this.stack.pop(),c<0||c>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-c-1),H===V.OP_ROLL&&this.stack.splice(this.stack.length-c-1,1),this.stack.push(h.Buffer.from(o));break;case V.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-3),m=t(-2);var g=t(-1);this.stack[this.stack.length-3]=m,this.stack[this.stack.length-2]=g,this.stack[this.stack.length-1]=l;break;case V.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;l=t(-2),m=t(-1),this.stack[this.stack.length-2]=m,this.stack[this.stack.length-1]=l;break;case V.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,h.Buffer.from(t(-1)));break;case V.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new Te(t(-1).length),this.stack.push(w.toScriptNumBuffer());break;case V.OP_AND:case V.OP_OR:case V.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length!==s.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(H){case V.OP_AND:for(let se=0;se<a.length;se++)a[se]&=s[se];break;case V.OP_OR:for(let se=0;se<a.length;se++)a[se]|=s[se];break;case V.OP_XOR:for(let se=0;se<a.length;se++)a[se]^=s[se];break;default:break}this.stack.pop();break;case V.OP_INVERT:this.stack.length<1&&(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION"),o=t(-1);for(let se=0;se<o.length;se++)o[se]=~o[se];break;case V.OP_LSHIFT:case V.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),a.length===0)this.stack.pop();else{if(E=new Te(a),P=Te.fromScriptNumBuffer(t(-1),i),c=P.toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop();let se;H===V.OP_LSHIFT&&(se=E.ushln(c)),H===V.OP_RSHIFT&&(se=E.ushrn(c));let ue=zte(h.Buffer.from(se.toArray().slice(a.length*-1)),a.length);this.stack.push(ue)}break;case V.OP_EQUAL:case V.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2),s=t(-1);var O=a.toString("hex")===s.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?oe.true:oe.false),H===V.OP_EQUALVERIFY)if(O)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;break;case V.OP_1ADD:case V.OP_1SUB:case V.OP_NEGATE:case V.OP_ABS:case V.OP_NOT:case V.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(o=t(-1),w=Te.fromScriptNumBuffer(o,i),H){case V.OP_1ADD:w=w.add(Te.One);break;case V.OP_1SUB:w=w.sub(Te.One);break;case V.OP_NEGATE:w=w.neg();break;case V.OP_ABS:w.cmp(Te.Zero)<0&&(w=w.neg());break;case V.OP_NOT:w=new Te((w.cmp(Te.Zero)===0)+0);break;case V.OP_0NOTEQUAL:w=new Te((w.cmp(Te.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(w.toScriptNumBuffer());break;case V.OP_ADD:case V.OP_SUB:case V.OP_MUL:case V.OP_MOD:case V.OP_DIV:case V.OP_BOOLAND:case V.OP_BOOLOR:case V.OP_NUMEQUAL:case V.OP_NUMEQUALVERIFY:case V.OP_NUMNOTEQUAL:case V.OP_LESSTHAN:case V.OP_GREATERTHAN:case V.OP_LESSTHANOREQUAL:case V.OP_GREATERTHANOREQUAL:case V.OP_MIN:case V.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(E=Te.fromScriptNumBuffer(t(-2),i,oe.MAXIMUM_ELEMENT_SIZE),P=Te.fromScriptNumBuffer(t(-1),i,oe.MAXIMUM_ELEMENT_SIZE),w=new Te(0),H){case V.OP_ADD:w=E.add(P);break;case V.OP_SUB:w=E.sub(P);break;case V.OP_MUL:w=E.mul(P);break;case V.OP_DIV:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.div(P);break;case V.OP_MOD:if(P===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;w=E.mod(P);break;case V.OP_BOOLAND:w=new Te((E.cmp(Te.Zero)!==0&&P.cmp(Te.Zero)!==0)+0);break;case V.OP_BOOLOR:w=new Te((E.cmp(Te.Zero)!==0||P.cmp(Te.Zero)!==0)+0);break;case V.OP_NUMEQUAL:w=new Te((E.cmp(P)===0)+0);break;case V.OP_NUMEQUALVERIFY:w=new Te((E.cmp(P)===0)+0);break;case V.OP_NUMNOTEQUAL:w=new Te((E.cmp(P)!==0)+0);break;case V.OP_LESSTHAN:w=new Te((E.cmp(P)<0)+0);break;case V.OP_GREATERTHAN:w=new Te((E.cmp(P)>0)+0);break;case V.OP_LESSTHANOREQUAL:w=new Te((E.cmp(P)<=0)+0);break;case V.OP_GREATERTHANOREQUAL:w=new Te((E.cmp(P)>=0)+0);break;case V.OP_MIN:w=E.cmp(P)<0?E:P;break;case V.OP_MAX:w=E.cmp(P)>0?E:P;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),H===V.OP_NUMEQUALVERIFY)if(oe.castToBool(t(-1)))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;break;case V.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;E=Te.fromScriptNumBuffer(t(-3),i,oe.MAXIMUM_ELEMENT_SIZE),P=Te.fromScriptNumBuffer(t(-2),i,oe.MAXIMUM_ELEMENT_SIZE);var y=Te.fromScriptNumBuffer(t(-1),i,oe.MAXIMUM_ELEMENT_SIZE);N=P.cmp(E)<=0&&E.cmp(y)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(N?oe.true:oe.false);break;case V.OP_RIPEMD160:case V.OP_SHA1:case V.OP_SHA256:case V.OP_HASH160:case V.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-1);var f;H===V.OP_RIPEMD160?f=Z0.ripemd160(o):H===V.OP_SHA1?f=Z0.sha1(o):H===V.OP_SHA256?f=Z0.sha256(o):H===V.OP_HASH160?f=Z0.sha256ripemd160(o):H===V.OP_HASH256&&(f=Z0.sha256sha256(o)),this.stack.pop(),this.stack.push(f);break;case V.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case V.OP_CHECKSIG:case V.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(M=t(-2),D=t(-1),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;L=new W0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var d=new W0().add(M);L.findAndDelete(d);try{U=pf.fromTxFormat(M),K=b4.fromBuffer(D,!1),C=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{C=!1}if(!C&&this.flags&oe.SCRIPT_VERIFY_NULLFAIL&&M.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(C?oe.true:oe.false),H===V.OP_CHECKSIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;break;case V.OP_CHECKMULTISIG:case V.OP_CHECKMULTISIGVERIFY:var _=1;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var x=Te.fromScriptNumBuffer(t(-_),i).toNumber();if(x<0||x>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=x,this.nOpCount>oe.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var b=++_;_+=x;var p=x+2;if(this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var I=Te.fromScriptNumBuffer(t(-_),i).toNumber();if(I<0||I>x)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var T=++_;if(_+=I,this.stack.length<_)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;L=new W0().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var S=0;S<I;S++)M=t(-T-S),L.findAndDelete(new W0().add(M));for(C=!0;C&&I>0;){if(M=t(-T),D=t(-b),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(D))return!1;var R;try{U=pf.fromTxFormat(M),K=b4.fromBuffer(D,!1),R=this.tx.verifySignature(U,K,this.nin,L,this.satoshisBN,this.flags)}catch{R=!1}R&&(T++,I--),b++,x--,I>x&&(C=!1)}for(;_-- >1;){if(!C&&this.flags&oe.SCRIPT_VERIFY_NULLFAIL&&!p&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;p>0&&p--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&oe.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(C?oe.true:oe.false),H===V.OP_CHECKMULTISIGVERIFY)if(C)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;break;case V.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),s=t(-1),a.length+s.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=h.Buffer.concat([a,s]),this.stack.pop();break;case V.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-2);var Y=Te.fromScriptNumBuffer(t(-1),i).toNumber();if(Y<0||Y>a.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var X=h.Buffer.from(a);this.stack[this.stack.length-2]=X.slice(0,Y),this.stack[this.stack.length-1]=X.slice(Y);break;case V.OP_LEFT:case V.OP_RIGHT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-2),c=Te.fromScriptNumBuffer(t(-1),i).toNumber(),c<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;c>a.length&&(c=a.length),this.stack.pop(),H===V.OP_LEFT?this.stack[this.stack.length-1]=h.Buffer.from(a).slice(0,c):this.stack[this.stack.length-1]=h.Buffer.from(a).slice(a.length-c);break;case V.OP_SUBSTR:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;a=t(-3);var ie=Te.fromScriptNumBuffer(t(-1),i).toNumber(),ce=Te.fromScriptNumBuffer(t(-2),i).toNumber();if(ce<0||ie<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;ce>a.length&&(ce=a.length),ce+ie>a.length&&(ie=a.length-ce),this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=h.Buffer.from(a).slice(ce,ce+ie);break;case V.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var pe=Te.fromScriptNumBuffer(t(-1),i).toNumber();if(pe>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var q=t(-1);if(q=oe._minimallyEncode(q),q.length>pe)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(q.length===pe){this.stack[this.stack.length-1]=q;break}var W=0;q.length>0&&(W=q[q.length-1]&128,q[q.length-1]&=127);var $=h.Buffer.alloc(pe);q.copy($,0);for(var ee=q.length-1;ee++<pe-2;)$[ee]=0;$[ee]=W,this.stack[this.stack.length-1]=$;break;case V.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(a=t(-1),s=oe._minimallyEncode(a),this.stack[this.stack.length-1]=s,!oe._isMinimallyEncoded(s))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}});var bn=k((u6e,_4)=>{v();_4.exports=e4();_4.exports.Interpreter=r6()});var hf=k((c6e,MR)=>{"use strict";v();var w4=xt(),za=Bt(),Kte=ln(),kR=el(),wn=ws(),RR=cr(),BR=pi(),S4=$n();function me(e,t,r){if(!(this instanceof me))return new me(e,t,r);if(w4.isArray(e)&&w4.isNumber(t))return me.createMultisig(e,t,r);if(e instanceof me)return e;if(za.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!wn.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==me.PayToPublicKeyHash&&r!==me.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||wn.get(t)||wn.defaultNetwork,i.type=i.type||r||me.PayToPublicKeyHash,BR.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}me.prototype._classifyArguments=function(e,t,r){if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===20)return me._transformHash(e);if((e instanceof h.Buffer||e instanceof Uint8Array)&&e.length===21)return me._transformBuffer(e,t,r);if(e instanceof S4)return me._transformPublicKey(e);if(e instanceof Y0)return me._transformScript(e,t);if(typeof e=="string")return me._transformString(e,t,r);if(w4.isObject(e))return me._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};me.PayToPublicKeyHash="pubkeyhash";me.PayToScriptHash="scripthash";me._transformHash=function(e){var t={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t};me._transformObject=function(e){return za.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),za.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?h.Buffer.from(e.hash,"hex"):e.hashBuffer,network:wn.get(e.network)||wn.defaultNetwork,type:e.type}};me._classifyFromVersion=function(e){var t={},r=wn.get(e[0],"pubkeyhash"),i=wn.get(e[0],"scripthash");return r?(t.network=r,t.type=me.PayToPublicKeyHash):i&&(t.network=i,t.type=me.PayToScriptHash),t};me._transformBuffer=function(e,t,r){var i={};if(!(e instanceof h.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==21)throw new TypeError("Address buffers must be exactly 21 bytes.");var n=wn.get(t),o=me._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=o.network,i.type=o.type,i};me._transformPublicKey=function(e){var t={};if(!(e instanceof S4))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=RR.sha256ripemd160(e.toBuffer()),t.type=me.PayToPublicKeyHash,t};me._transformScript=function(e,t){za.checkArgument(e instanceof Y0,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new Kte.Script.CantDeriveAddress(e);return r};me.createMultisig=function(e,t,r){return r=r||e[0].network||wn.defaultNetwork,me.payingTo(Y0.buildMultisigOut(e,t),r)};me._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=wn.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=kR.decode(e);return me._transformBuffer(n,t,r)};me.fromPublicKey=function(e,t){var r=me._transformPublicKey(e);return t=t||wn.defaultNetwork,new me(r.hashBuffer,t,r.type)};me.fromPrivateKey=function(e,t){let r=S4.fromPrivateKey(e);return t=t||e.network||wn.defaultNetwork,me.fromPublicKey(r,t)};me.fromPublicKeyHash=function(e,t){var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToPublicKeyHash)};me.fromScriptHash=function(e,t){za.checkArgument(e,"hash parameter is required");var r=me._transformHash(e);return new me(r.hashBuffer,t,me.PayToScriptHash)};me.payingTo=function(e,t){return za.checkArgument(e,"script is required"),za.checkArgument(e instanceof Y0,"script must be instance of Script"),me.fromScriptHash(RR.sha256ripemd160(e.toBuffer()),t)};me.fromScript=function(e,t){za.checkArgument(e instanceof Y0,"script must be a Script instance");var r=me._transformScript(e,t);return new me(r.hashBuffer,t,r.type)};me.fromBuffer=function(e,t,r){var i=me._transformBuffer(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromHex=function(e,t,r){return me.fromBuffer(h.Buffer.from(e,"hex"),t,r)};me.fromString=function(e,t,r){var i=me._transformString(e,t,r);return new me(i.hashBuffer,i.network,i.type)};me.fromObject=function(t){za.checkState(BR.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=h.Buffer.from(t.hash,"hex");return new me(r,t.network,t.type)};me.getValidationError=function(e,t,r){var i;try{new me(e,t,r)}catch(n){i=n}return i};me.isValid=function(e,t,r){return!me.getValidationError(e,t,r)};me.prototype.isPayToPublicKeyHash=function(){return this.type===me.PayToPublicKeyHash};me.prototype.isPayToScriptHash=function(){return this.type===me.PayToScriptHash};me.prototype.toBuffer=function(){var e=h.Buffer.from([this.network[this.type]]),t=h.Buffer.concat([e,this.hashBuffer]);return t};me.prototype.toHex=function(){return this.toBuffer().toString("hex")};me.prototype.toObject=me.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};me.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};me.prototype.toString=function(){return kR.encode(this.toBuffer())};MR.exports=me;var Y0=bn()});var G0=k((h6e,qR)=>{"use strict";v();var u6=xt(),Vte=hf(),NR=el(),gf=fr(),CR=pi(),Ka=ws(),DR=gn(),Gte=$n(),Zte=Ku(),LR=Bt();function Me(e,t){if(!(this instanceof Me))return new Me(e,t);if(e instanceof Me)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new gf(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(DR.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return CR.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}Me.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?Ka.get(t):Ka.defaultNetwork};if(u6.isUndefined(e)||u6.isNull(e))r.bn=Me._getRandomBN();else if(e instanceof gf)r.bn=e;else if(e instanceof h.Buffer||e instanceof Uint8Array)r=Me._transformBuffer(e,t);else if(e.bn&&e.network)r=Me._transformObject(e);else if(!t&&Ka.get(e))r.bn=Me._getRandomBN(),r.network=Ka.get(e);else if(typeof e=="string")CR.isHexa(e)?r.bn=new gf(h.Buffer.from(e,"hex")):r=Me._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};Me._getRandomBN=function(){var e,t;do{var r=Zte.getRandomBuffer(32);t=gf.fromBuffer(r),e=t.lt(DR.getN())}while(!e);return t};Me._transformBuffer=function(e,t){var r={};if(e.length===32)return Me._transformBNBuffer(e,t);if(r.network=Ka.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==Ka.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=gf.fromBuffer(e.slice(1,33)),r};Me._transformBNBuffer=function(e,t){var r={};return r.network=Ka.get(t)||Ka.defaultNetwork,r.bn=gf.fromBuffer(e),r.compressed=!1,r};Me._transformWIF=function(e,t){return Me._transformBuffer(NR.decode(e),t)};Me.fromBuffer=function(e,t){return new Me(e,t)};Me.fromHex=function(e,t){return Me.fromBuffer(h.Buffer.from(e,"hex"),t)};Me._transformObject=function(e){var t=new gf(e.bn,"hex"),r=Ka.get(e.network);return{bn:t,network:r,compressed:e.compressed}};Me.fromString=Me.fromWIF=function(e){return LR.checkArgument(u6.isString(e),"First argument is expected to be a string."),new Me(e)};Me.fromObject=Me.fromJSON=function(e){return LR.checkArgument(u6.isObject(e),"First argument is expected to be an object."),new Me(e)};Me.fromRandom=function(e){var t=Me._getRandomBN();return new Me(t,e)};Me.getValidationError=function(e,t){var r;try{new Me(e,t)}catch(i){r=i}return r};Me.isValid=function(e,t){return e?!Me.getValidationError(e,t):!1};Me.prototype.toString=function(){return this.toWIF()};Me.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),h.Buffer.from([1])]):r=h.Buffer.concat([h.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),NR.encode(r)};Me.prototype.toBigNumber=function(){return this.bn};Me.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};Me.prototype.toHex=function(){return this.toBuffer().toString("hex")};Me.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=Gte.fromPrivateKey(this)),this._pubkey};Me.prototype.toAddress=function(e){var t=this.toPublicKey();return Vte.fromPublicKey(t,e||this.network)};Me.prototype.toObject=Me.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};Me.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"};qR.exports=Me});var $n=k((p6e,FR)=>{"use strict";v();var cl=fr(),ll=gn(),Wte=cr(),Yte=pi(),UR=ws(),x4=xt(),vf=Bt();function Se(e,t){if(!(this instanceof Se))return new Se(e,t);if(vf.checkArgument(e,"First argument is required, please include public key data."),e instanceof Se)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),Yte.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||UR.defaultNetwork}),this}Se.prototype._classifyArgs=function(e,t){var r={compressed:x4.isUndefined(t.compressed)||t.compressed};if(e instanceof ll)r.point=e;else if(e.x&&e.y)r=Se._transformObject(e);else if(typeof e=="string")r=Se._transformDER(h.Buffer.from(e,"hex"));else if(Se._isBuffer(e))r=Se._transformDER(e);else if(Se._isPrivateKey(e))r=Se._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=x4.isUndefined(t.network)?void 0:UR.get(t.network)),r};Se._isPrivateKey=function(e){var t=G0();return e instanceof t};Se._isBuffer=function(e){return e instanceof h.Buffer||e instanceof Uint8Array};Se._transformPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=ll.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};Se._transformDER=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r={};t=x4.isUndefined(t)?!0:t;var i,n,o,a;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),a=e.slice(33,65),o.length!==32||a.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new cl(o),n=new cl(a),r.point=new ll(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new cl(o),r=Se._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new cl(o),r=Se._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};Se._transformX=function(e,t){vf.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=ll.fromX(e,t),r};Se._transformObject=function(e){var t=new cl(e.x,"hex"),r=new cl(e.y,"hex"),i=new ll(t,r);return new Se(i,{compressed:e.compressed})};Se.fromPrivateKey=function(e){vf.checkArgument(Se._isPrivateKey(e),"Must be an instance of PrivateKey");var t=Se._transformPrivateKey(e);return new Se(t.point,{compressed:t.compressed,network:t.network})};Se.fromDER=Se.fromBuffer=function(e,t){vf.checkArgument(Se._isBuffer(e),"Must be a buffer of DER encoded public key");var r=Se._transformDER(e,t);return new Se(r.point,{compressed:r.compressed})};Se.fromPoint=function(e,t){return vf.checkArgument(e instanceof ll,"First argument must be an instance of Point."),new Se(e,{compressed:t})};Se.fromHex=Se.fromString=function(e,t){var r=h.Buffer.from(e,t||"hex"),i=Se._transformDER(r);return new Se(i.point,{compressed:i.compressed})};Se.fromX=function(e,t){var r=Se._transformX(e,t);return new Se(r.point,{compressed:r.compressed})};Se.getValidationError=function(e){var t;try{new Se(e)}catch(r){t=r}return t};Se.isValid=function(e){return!Se.getValidationError(e)};Se.prototype.toObject=Se.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};Se.prototype.toBuffer=Se.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=h.Buffer.from([3]):n=h.Buffer.from([2]),h.Buffer.concat([n,r])}else return n=h.Buffer.from([4]),h.Buffer.concat([n,r,i])};Se.prototype._getID=function(){return Wte.sha256ripemd160(this.toBuffer())};Se.prototype.toAddress=function(e){var t=hf();return t.fromPublicKey(this,e||this.network)};Se.prototype.toString=Se.prototype.toHex=function(){return this.toDER().toString("hex")};Se.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"};FR.exports=Se});var i6=k((v6e,HR)=>{"use strict";v();var Hi=fr(),Do=gn(),$te=Vr(),Xte=$n(),Jte=Ku(),ks=cr(),Qte=xt(),E4=Bt(),Gt=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};Gt.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(h.Buffer.isBuffer(e.sig)){var t=Vr();this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return this.k=e.k||this.k,this.verified=e.verified||this.verified,this};Gt.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()};Gt.prototype.calci=function(){for(var e=0;e<4;e++){this.sig.i=e;var t;try{t=this.toPublicKey()}catch(r){console.error(r);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")};Gt.fromString=function(e){var t=JSON.parse(e);return new Gt(t)};Gt.prototype.randomK=function(){var e=Do.getN(),t;do t=Hi.fromBuffer(Jte.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(Hi.Zero)));return this.k=t,this};Gt.prototype.deterministicK=function(e){Qte.isUndefined(e)&&(e=0);var t=h.Buffer.alloc(32);t.fill(1);var r=h.Buffer.alloc(32);r.fill(0);var i=this.privkey.bn.toBuffer({size:32}),n=this.endian==="little"?h.Buffer.from(this.hashbuf).reverse():this.hashbuf;r=ks.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0]),i,n]),r),t=ks.sha256hmac(t,r),r=ks.sha256hmac(h.Buffer.concat([t,h.Buffer.from([1]),i,n]),r),t=ks.sha256hmac(t,r),t=ks.sha256hmac(t,r);for(var o=Hi.fromBuffer(t),a=Do.getN(),s=0;s<e||!(o.lt(a)&&o.gt(Hi.Zero));s++)r=ks.sha256hmac(h.Buffer.concat([t,h.Buffer.from([0])]),r),t=ks.sha256hmac(t,r),t=ks.sha256hmac(t,r),o=Hi.fromBuffer(t);return this.k=o,this};Gt.prototype.toPublicKey=function(){var e=this.sig.i;E4.checkArgument(e===0||e===1||e===2||e===3,new Error("i must be equal to 0, 1, 2, or 3"));var t=Hi.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,n=e&1,o=e>>1,a=Do.getN(),s=Do.getG(),u=o?r.add(a):r,c=Do.fromX(n,u),l=c.mul(a);if(!l.isInfinity())throw new Error("nR is not a valid curve point");var m=t.neg().umod(a),w=r.invm(a),E=c.mul(i).add(s.mul(m)).mul(w),P=Xte.fromPoint(E,this.sig.compressed);return P};Gt.prototype.sigError=function(){if(!h.Buffer.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=Do.getN();try{if(e.lte(Hi.Zero)||t.lte(Hi.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var i=Hi.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),n=t.invm(r),o=n.mul(i).umod(r),a=n.mul(e).umod(r),s=Do.getG().mulAdd(o,this.pubkey.point,a);return s.isInfinity()?"p is infinity":s.getX().umod(r).cmp(e)!==0?"Invalid signature":!1}catch(u){return"Signature security validation failed: "+u.message}};Gt.toLowS=function(e){return e.gt(Hi.fromBuffer(h.Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=Do.getN().sub(e)),e};Gt.prototype._findSignature=function(e,t){var r=Do.getN(),i=Do.getG(),n=0,o,a,s,u;do(!this.k||n>0)&&this.deterministicK(n),n++,o=this.k,a=i.mul(o),s=a.x.umod(r),u=o.invm(r).mul(t.add(e.mul(s))).umod(r);while(s.cmp(Hi.Zero)<=0||u.cmp(Hi.Zero)<=0);return u=Gt.toLowS(u),{s:u,r:s}};Gt.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;E4.checkState(e&&t&&r,new Error("invalid parameters")),E4.checkState(h.Buffer.isBuffer(e)&&e.length===32,new Error("hashbuf must be a 32 byte buffer"));var i=Hi.fromBuffer(e,this.endian?{endian:this.endian}:void 0),n=this._findSignature(r,i);return n.compressed=this.pubkey.compressed,this.sig=new $te(n),this};Gt.prototype.signRandomK=function(){return this.randomK(),this.sign()};Gt.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)};Gt.prototype.verify=function(){return this.verified=!this.sigError(),this.verified};Gt.prototype.verifyBool=function(){return this.verify()===!0};Gt.sign=function(e,t,r){return Gt().set({hashbuf:e,endian:r,privkey:t}).sign().sig};Gt.signWithCalcI=function(e,t,r){return Gt().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig};Gt.signRandomK=function(e,t,r){return Gt().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig};Gt.verify=function(e,t,r,i){return Gt().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify()};HR.exports=Gt});var zR=k((O4,jR)=>{v();(function(e,t){"use strict";typeof define=="function"&&define.amd?define([],function(){return e.secrets=t()}):typeof O4=="object"?jR.exports=t(_r()):e.secrets=t(e.crypto)})(O4,function(e){"use strict";var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!!(r&&r.rng&&typeof r.rng=="function")}function u(N,C){var F;if(C===0||C===1)return N;if(C&&C>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return C=C||r.bits,N&&(F=N.length%C),F?(i+N).slice(-(C-F+N.length)):N}function c(N){var C="",F,H;for(H=N.length-1;H>=0;H--){if(F=parseInt(N[H],16),isNaN(F))throw new Error("Invalid hex character.");C=u(F.toString(2),4)+C}return C}function l(N){var C="",F,H;for(N=u(N,4),H=N.length;H>=4;H-=4){if(F=parseInt(N.slice(H-4,H),2),isNaN(F))throw new Error("Invalid binary character.");C=F.toString(16)+C}return C}function m(){return!!(e&&typeof e=="object"&&(typeof e.getRandomValues=="function"||typeof e.getRandomValues=="object")&&(typeof Uint32Array=="function"||typeof Uint32Array=="object"))}function w(){return typeof e=="object"&&typeof e.randomBytes=="function"}function E(N){function C(G,B,g,O){var y=0,f,d="",_;for(B&&(f=B.length-1);y<f||d.length<G;)_=Math.abs(parseInt(B[y],g)),d=d+u(_.toString(2),O),y++;return d=d.substr(-G),(d.match(/0/g)||[]).length===d.length?null:d}function F(G){var B,g,O,y,f=null;for(O=16,y=4,g=Math.ceil(G/8);f===null;)B=e.randomBytes(g),f=C(G,B.toString("hex"),O,y);return f}function H(G){var B,g,O,y=null;for(g=10,O=32,B=Math.ceil(G/32);y===null;)y=C(G,e.getRandomValues(new Uint32Array(B)),g,O);return y}function z(G){var B,g,O,y,f,d=null;y=10,f=32,g=Math.ceil(G/32),O=123456789,B=new Uint32Array(g);for(var _=0;_<B.length;_++)B[_]=O;for(;d===null;)d=C(G,B,y,f);return d}if(N&&N==="testRandom")return r.typeCSPRNG=N,z;if(N&&N==="nodeCryptoRandomBytes")return r.typeCSPRNG=N,F;if(N&&N==="browserCryptoGetRandomValues")return r.typeCSPRNG=N,H;if(w())return r.typeCSPRNG="nodeCryptoRandomBytes",F;if(m())return r.typeCSPRNG="browserCryptoGetRandomValues",H}function P(N,C){var F=[],H;for(C&&(N=u(N,C)),H=N.length;H>r.bits;H-=r.bits)F.push(parseInt(N.slice(H-r.bits,H),2));return F.push(parseInt(N.slice(0,H),2)),F}function M(N,C){var F=r.logs[N],H=0,z;for(z=C.length-1;z>=0;z--)H!==0?H=r.exps[(F+r.logs[H])%r.maxShares]^C[z]:H=C[z];return H}function D(N,C,F){var H=0,z,G,B,g;for(B=0,z=C.length;B<z;B++)if(F[B]){for(G=r.logs[F[B]],g=0;g<z;g++)if(B!==g){if(N===C[g]){G=-1;break}G=(G+r.logs[N^C[g]]-r.logs[C[B]^C[g]]+r.maxShares)%r.maxShares}H=G===-1?H:H^r.exps[G]}return H}function L(N,C,F){var H=[],z=[N],G,B;for(G=1;G<F;G++)z[G]=parseInt(r.rng(r.bits),2);for(G=1,B=C+1;G<B;G++)H[G-1]={x:G,y:M(G,z)};return H}function U(N,C,F){var H,z,G,B,g;if(C=parseInt(C,r.radix),N=parseInt(N,10)||r.bits,H=N.toString(36).toUpperCase(),G=Math.pow(2,N)-1,B=G.toString(r.radix).length,z=u(C.toString(r.radix),B),typeof C!="number"||C%1!==0||C<1||C>G)throw new Error("Share id must be an integer between 1 and "+G+", inclusive.");return g=H+z+F,g}var K={init:function(N,C){var F=[],H=[],z=1,G,B;if(a(),N&&(typeof N!="number"||N%1!==0||N<t.minBits||N>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(C&&o.indexOf(C)===-1)throw new Error("Invalid RNG type argument : '"+C+"'");for(r.radix=t.radix,r.bits=N||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,G=t.primitivePolynomials[r.bits],B=0;B<r.size;B++)H[B]=z,F[z]=B,z=z<<1,z>=r.size&&(z=z^G,z=z&r.maxShares);if(r.logs=F,r.exps=H,C&&this.setRNG(C),s()||this.setRNG(),!s()||!r.bits||!r.size||!r.maxShares||!r.logs||!r.exps||r.logs.length!==r.size||r.exps.length!==r.size)throw new Error("Initialization failed.")},combine:function(N,C){var F,H,z,G,B="",g,O,y,f=[],d=[];for(C=C||0,F=0,z=N.length;F<z;F++){if(O=this.extractShareComponents(N[F]),g===void 0)g=O.bits;else if(O.bits!==g)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==g&&this.init(g),f.indexOf(O.id)===-1)for(f.push(O.id),y=P(c(O.data)),H=0,G=y.length;H<G;H++)d[H]=d[H]||[],d[H][f.length-1]=y[H]}for(F=0,z=d.length;F<z;F++)B=u(D(C,f,d[F]).toString(2))+B;return l(C>=1?B:B.slice(B.indexOf("1")+1))},getConfig:function(){var N={};return N.radix=r.radix,N.bits=r.bits,N.maxShares=r.maxShares,N.hasCSPRNG=s(),N.typeCSPRNG=r.typeCSPRNG,N},extractShareComponents:function(N){var C,F,H,z,G={},B,g;if(C=parseInt(N.substr(0,1),36),C&&(typeof C!="number"||C%1!==0||C<t.minBits||C>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(z=Math.pow(2,C)-1,H=(Math.pow(2,C)-1).toString(r.radix).length,B="^([a-kA-K3-9]{1})([a-fA-F0-9]{"+H+"})([a-fA-F0-9]+)$",g=new RegExp(B).exec(N),g&&(F=parseInt(g[2],r.radix)),typeof F!="number"||F%1!==0||F<1||F>z)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(g&&g[3])return G.bits=C,G.id=F,G.data=g[3],G;throw new Error("The share data provided is invalid : "+N)},setRNG:function(N){var C="Random number generator is invalid ",F=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(N&&typeof N=="string"&&o.indexOf(N)===-1)throw new Error("Invalid RNG type argument : '"+N+"'");if(N||(N=E()),N&&typeof N=="string"&&(N=E(N)),n){if(N&&typeof N!="function")throw new Error(C+"(Not a function)."+F);if(N&&typeof N(r.bits)!="string")throw new Error(C+"(Output is not a string)."+F);if(N&&!parseInt(N(r.bits),2))throw new Error(C+"(Binary string output not parseable to an Integer)."+F);if(N&&N(r.bits).length>r.bits)throw new Error(C+"(Output length is greater than config.bits)."+F);if(N&&N(r.bits).length<r.bits)throw new Error(C+"(Output length is less than config.bits)."+F)}return r.rng=N,!0},str2hex:function(N,C){var F,H,z="",G,B,g,O;if(typeof N!="string")throw new Error("Input must be a character string.");if(C||(C=t.bytesPerChar),typeof C!="number"||C<1||C>t.maxBytesPerChar||C%1!==0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,H=Math.pow(16,F)-1,g=0,O=N.length;g<O;g++){if(B=N[g].charCodeAt(),isNaN(B))throw new Error("Invalid character: "+N[g]);if(B>H)throw G=Math.ceil(Math.log(B+1)/Math.log(256)),new Error("Invalid character code ("+B+"). Maximum allowable is 256^bytes-1 ("+H+"). To convert this character, use at least "+G+" bytes.");z=u(B.toString(16),F)+z}return z},hex2str:function(N,C){var F,H="",z,G;if(typeof N!="string")throw new Error("Input must be a hexadecimal string.");if(C=C||t.bytesPerChar,typeof C!="number"||C%1!==0||C<1||C>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(F=2*C,N=u(N,F),z=0,G=N.length;z<G;z+=F)H=String.fromCharCode(parseInt(N.slice(z,z+F),16))+H;return H},random:function(N){if(typeof N!="number"||N%1!==0||N<2||N>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return l(r.rng(N))},share:function(N,C,F,H){var z,G,B=new Array(C),g=new Array(C),O,y,f;if(H=H||128,typeof N!="string")throw new Error("Secret must be a string.");if(typeof C!="number"||C%1!==0||C<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(C>r.maxShares)throw z=Math.ceil(Math.log(C+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+C+" shares, use at least "+z+" bits.");if(typeof F!="number"||F%1!==0||F<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(F>r.maxShares)throw z=Math.ceil(Math.log(F+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+F+", use at least "+z+" bits.");if(F>C)throw new Error("Threshold number of shares was "+F+" but must be less than or equal to the "+C+" shares specified as the total to generate.");if(typeof H!="number"||H%1!==0||H<0||H>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(N="1"+c(N),N=P(N,H),O=0,f=N.length;O<f;O++)for(G=L(N[O],C,F),y=0;y<C;y++)B[y]=B[y]||G[y].x.toString(r.radix),g[y]=u(G[y].y.toString(2))+(g[y]||"");for(O=0;O<C;O++)B[O]=U(r.bits,B[O],l(g[O]));return B},newShare:function(N,C){var F,H;if(N&&typeof N=="string"&&(N=parseInt(N,r.radix)),H=N.toString(r.radix),N&&H&&C&&C[0])return F=this.extractShareComponents(C[0]),U(F.bits,H,this.combine(C,N));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:l,_hasCryptoGetRandomValues:m,_hasCryptoRandomBytes:w,_getRNG:E,_isSetRNG:s,_splitNumStringToIntArray:P,_horner:M,_lagrange:D,_getShares:L,_constructPublicShareString:U};return K.init(),K})});var A4=k((b6e,ZR)=>{"use strict";v();var gi=fr(),KR=Ku(),VR=cr(),f6=null;function I4(){if(f6)return f6;var e=zR();return e.setRNG(function(t){for(var r=64,i=0;i<r;i++){for(var n=KR.getRandomBuffer(Math.ceil(t/8)),o="",a=0;a<n.length;a++)o+=("00000000"+n[a].toString(2)).slice(-8);if(o=o.slice(0,t),/1/.test(o))return o}throw new Error("shamir: CSPRNG returned all-zero draws "+r+" times in a row \u2014 refusing to hang on a degenerate/stubbed random source")}),f6=e,f6}var c6="ff",GR=2;function Or(e){return this instanceof Or?(this.options=e||{},this):new Or(e)}Or.split=function(e,t,r,i){if(i=i||{},e==null)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var n=h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8"),o=c6+n.toString("hex"),a=I4().share(o,r,t),s=KR.getRandomBuffer(8).toString("hex"),u=i.checksum===!0,c=u?VR.sha256(n).slice(0,4).toString("hex"):null,l=[],m=0;m<a.length;m++)l.push({v:GR,id:m+1,threshold:t,shares:r,length:n.length,splitId:s,share:a[m],checksum:c});return l};Or.combine=function(e){if(!e||e.length===0)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&e[0].share===void 0)return Or._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var i=[],n=0;n<e.length;n++){var o=e[n];if(!o||typeof o.share!="string")throw new Error("Invalid share at index "+n);if(r!==void 0&&o.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(o.threshold!==t)throw new Error("Shares have inconsistent threshold");i.push(o.share)}var a=I4().combine(i);if(a.slice(0,c6.length)!==c6)throw new Error("Reconstruction failed: invalid or insufficient shares");var s=h.Buffer.from(a.slice(c6.length),"hex"),u=e[0].checksum;if(u){var c=VR.sha256(s).slice(0,4).toString("hex");if(c!==u)throw new Error("Integrity check failed: shares are inconsistent or tampered")}return s};Or.verifyShare=function(e){try{return!e||typeof e!="object"?!1:Array.isArray(e.bytes)&&e.share===void 0?Or._verifyLegacyShare(e):e.v!==GR||typeof e.share!="string"||!/^[0-9a-fA-F]+$/.test(e.share)||typeof e.threshold!="number"||typeof e.shares!="number"||e.threshold<2||e.shares<e.threshold||e.shares>255||e.id<1||e.id>e.shares||e.checksum!==null&&e.checksum!==void 0&&!/^[0-9a-fA-F]{8}$/.test(e.checksum)?!1:(I4().extractShareComponents(e.share),!0)}catch{return!1}};Or.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=3,r=5,i=Or.split(e,t,r),n=Or.combine(i.slice(0,t));return{secret:e,threshold:t,totalShares:r,shares:i,reconstructed:n.toString("utf8"),valid:n.toString("utf8")===e}};var Rs=new gi(2147483647);Or._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,i=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=0;n<e.length;n++){if(e[n].threshold!==t||e[n].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[n].length!==i)throw new Error("Shares have different secret lengths")}for(var o=[],a=0;a<i;a++){for(var s=[],u=0;u<Math.min(e.length,t);u++)s.push(e[u].bytes[a]);o.push(Or._combineByteLegacy(s))}return h.Buffer.from(o)};Or._combineByteLegacy=function(e){for(var t=new gi(0),r=0;r<e.length;r++){for(var i=new gi(e[r].x),n=new gi(e[r].y,16),o=new gi(1),a=new gi(1),s=0;s<e.length;s++)if(r!==s){var u=new gi(e[s].x),c=new gi(0).sub(u);c.lt(new gi(0))&&(c=c.add(Rs)),o=o.mul(c).mod(Rs);var l=i.sub(u);l.lt(new gi(0))&&(l=l.add(Rs)),a=a.mul(l).mod(Rs)}var m=Or._modInverseLegacy(a,Rs),w=o.mul(m).mod(Rs);t=t.add(n.mul(w)).mod(Rs)}return t.mod(Rs).mod(new gi(256)).toNumber()};Or._modInverseLegacy=function(e,t){e.lt(new gi(0))&&(e=e.mod(t).add(t));var r=Or._extendedGCDLegacy(e,t);if(!r.gcd.eq(new gi(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)};Or._extendedGCDLegacy=function(e,t){if(e.eq(new gi(0)))return{gcd:t,x:new gi(0),y:new gi(1)};var r=Or._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}};Or._verifyLegacyShare=function(e){if(!e.id||!e.threshold||!e.shares||!e.bytes||typeof e.length!="number"||e.threshold<2||e.shares<e.threshold||!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y||r.x<1||r.x>e.shares||!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0};ZR.exports=Or});var h6=k((w6e,WR)=>{"use strict";v();var Lo=fr(),ere=gn(),tre=i6(),hl=ere.getN(),l6=hl.shrn(1);function rre(e,t,r){if(!h.Buffer.isBuffer(e)||e.length!==32)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let i=t;if(h.Buffer.isBuffer(t))try{i=Vr().fromDER(t)}catch{return!1}if(!i||!i.r||!i.s)return!1;let n=Lo.isBN(i.r)?i.r:new Lo(i.r),o=Lo.isBN(i.s)?i.s:new Lo(i.s);if(n.isZero()||o.isZero()||n.gte(hl)||o.gte(hl))return!1;let a=o;o.gt(l6)&&(a=hl.sub(o));let s=Vr(),u=new s({r:n,s:a});return tre.verify(e,u,r)}function ire(e){if(!e)return!1;let t=e;if(h.Buffer.isBuffer(e))try{t=Vr().fromDER(e)}catch{return!1}return!t||!t.s?!1:(Lo.isBN(t.s)?t.s:new Lo(t.s)).lte(l6)}function nre(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");let t=Lo.isBN(e.r)?e.r:new Lo(e.r),r=Lo.isBN(e.s)?e.s:new Lo(e.s),i=r;return r.gt(l6)&&(i=hl.sub(r)),{r:t,s:i}}WR.exports={smartVerify:rre,isCanonical:ire,canonicalize:nre,constants:{n:hl,nh:l6}}});var d6=k((x6e,XR)=>{"use strict";v();var ore=fr(),{secp256k1:dl}=(g0(),lo(p0)),YR=dl.Point,are=YR.Fn.ORDER;function P4(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new ore(t,16)}function T4(e){return h.Buffer.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(h.Buffer.from(e,"hex"))}function k4(e){this._p=e}k4.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var $R={curve:{n:P4(are)},keyFromPrivate:function(e,t){var r;h.Buffer.isBuffer(e)?r=e:e instanceof Uint8Array?r=h.Buffer.from(e):r=h.Buffer.from(e,t||"hex");var i=Uint8Array.from(r);return{_priv:i,getPublic:function(){return new k4(YR.fromBytes(dl.getPublicKey(i,!0)))}}},sign:function(e,t){var r=dl.sign(T4(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),i=r[0],n=P4(BigInt("0x"+h.Buffer.from(r.subarray(1,33)).toString("hex"))),o=P4(BigInt("0x"+h.Buffer.from(r.subarray(33,65)).toString("hex")));return{r:n,s:o,recoveryParam:i}},verify:function(e,t,r){try{if(!t||typeof t!="object")return!1;var i=t.r,n=t.s;if(!i||!n||typeof i.cmp!="function"||typeof n.cmp!="function"||i.isZero()||n.isZero())return!1;var o=$R.curve.n;if(i.cmp(o)>=0||n.cmp(o)>=0)return!1;var a=h.Buffer.concat([i.toBuffer({size:32}),n.toBuffer({size:32})]),s=r._priv?dl.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return dl.verify(Uint8Array.from(a),T4(e),Uint8Array.from(s),{lowS:!1,prehash:!1})}catch{return!1}},recoverPubKey:function(e,t,r){var i=h.Buffer.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]),n=dl.Signature.fromBytes(Uint8Array.from(i),"compact").addRecoveryBit(r);return new k4(n.recoverPublicKey(T4(e)))}};XR.exports=$R});var X0=k((O6e,eB)=>{"use strict";v();var p6=xt(),$0=fr(),g6=Da(),sre=Wn(),ure=cr(),JR=Bt(),fre=486604799,gt=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&JR.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};gt._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=gt._fromBufferReader(g6(t));else if(p6.isObject(t))r=gt._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};gt._fromObject=function(t){JR.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;p6.isString(t.prevHash)&&(r=h.Buffer.from(t.prevHash,"hex").reverse()),p6.isString(t.merkleRoot)&&(i=h.Buffer.from(t.merkleRoot,"hex").reverse());var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};gt.fromObject=function(t){var r=gt._fromObject(t);return new gt(r)};gt.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=g6(t);r.pos=gt.Constants.START_OF_HEADER;var i=gt._fromBufferReader(r);return new gt(i)};gt.fromBuffer=function(t){var r=gt._fromBufferReader(g6(t));return new gt(r)};gt.fromString=function(t){var r=h.Buffer.from(t,"hex");return gt.fromBuffer(r)};gt._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};gt.fromBufferReader=function(t){var r=gt._fromBufferReader(t);return new gt(r)};gt.prototype.toObject=gt.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:h.Buffer.from(this.prevHash).reverse().toString("hex"),merkleRoot:h.Buffer.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};gt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};gt.prototype.toString=function(){return this.toBuffer().toString("hex")};gt.prototype.toBufferWriter=function(t){return t||(t=new sre),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};gt.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new $0(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new $0(2));return r};gt.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(fre).mul(new $0(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};gt.prototype._getHash=function(){var t=this.toBuffer();return ure.sha256sha256(t)};var QR={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=g6(this._getHash()).readReverse().toString("hex")),this._id},set:p6.noop};Object.defineProperty(gt.prototype,"id",QR);Object.defineProperty(gt.prototype,"hash",QR);gt.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+gt.Constants.MAX_TIME_OFFSET)};gt.prototype.validProofOfWork=function(){var t=new $0(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};gt.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};gt.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new $0("10000000000000000000000000000000000000000000000000000000000000000","hex")};eB.exports=gt});var aB=k((A6e,oB)=>{"use strict";v();var B4=xt(),rB=X0(),tB=fr(),M4=Da(),cre=Wn(),lre=cr(),R4=Ts(),iB=Bt();function at(e){return this instanceof at?(B4.extend(this,at._from(e)),this):new at(e)}at.MAX_BLOCK_SIZE=128e6;at._from=function(t){var r={};if(h.Buffer.isBuffer(t))r=at._fromBufferReader(M4(t));else if(B4.isObject(t))r=at._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};at._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof R4?r.push(n):r.push(R4().fromObject(n))});var i={header:rB.fromObject(t.header),transactions:r};return i};at.fromObject=function(t){var r=at._fromObject(t);return new at(r)};at._fromBufferReader=function(t){var r={};iB.checkState(!t.finished(),"No block data received"),r.header=rB.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(R4().fromBufferReader(t));return r};at.fromBufferReader=function(t){iB.checkArgument(t,"br is required");var r=at._fromBufferReader(t);return new at(r)};at.fromBuffer=function(t){return at.fromBufferReader(new M4(t))};at.fromString=function(t){var r=h.Buffer.from(t,"hex");return at.fromBuffer(r)};at.fromRawBlock=function(t){h.Buffer.isBuffer(t)||(t=h.Buffer.from(t,"binary"));var r=M4(t);r.pos=at.Values.START_OF_BLOCK;var i=at._fromBufferReader(r);return new at(i)};at.prototype.toObject=at.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};at.prototype.toBuffer=function(){return this.toBufferWriter().concat()};at.prototype.toString=function(){return this.toBuffer().toString("hex")};at.prototype.toBufferWriter=function(t){t||(t=new cre),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};at.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[at.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};at.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),a=h.Buffer.concat([t[r+n],t[r+o]]);t.push(lre.sha256sha256(a))}r+=i}return t};at.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};at.prototype.validMerkleRoot=function(){var t=new tB(this.header.merkleRoot.toString("hex"),"hex"),r=new tB(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};at.prototype._getHash=function(){return this.header._getHash()};var nB={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:B4.noop};Object.defineProperty(at.prototype,"id",nB);Object.defineProperty(at.prototype,"hash",nB);at.prototype.inspect=function(){return"<Block "+this.id+">"};at.Values={START_OF_BLOCK:8,NULL_HASH:h.Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};oB.exports=at});var D4=k((T6e,fB)=>{"use strict";v();var mf=xt(),C4=X0(),uB=Da(),hre=Wn(),dre=cr(),sB=Ts(),N4=ln(),yf=Bt();function nr(e){if(!(this instanceof nr))return new nr(e);var t={};if(h.Buffer.isBuffer(e))t=nr._fromBufferReader(uB(e));else if(mf.isObject(e)){var r;e.header instanceof C4?r=e.header:r=C4.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return mf.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}nr.fromBuffer=function(t){return nr.fromBufferReader(uB(t))};nr.fromBufferReader=function(t){return new nr(nr._fromBufferReader(t))};nr.prototype.toBuffer=function(){return this.toBufferWriter().concat()};nr.prototype.toBufferWriter=function(t){t||(t=new hre),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(h.Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};nr.prototype.toObject=nr.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};nr.prototype.validMerkleTree=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:i.equals(this.header.merkleRoot)};nr.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")};nr.prototype.filteredTxsHash=function(){if(yf.checkState(mf.isArray(this.flags),"MerkleBlock flags is not an array"),yf.checkState(mf.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new N4.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new N4.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new N4.MerkleBlock.InvalidMerkleTree;return i};nr.prototype._traverseMerkleTree=function(t,r,i,n){if(i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0,n=n||!1,i.flagBitsUsed>this.flags.length*8)return null;var o=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!o){if(i.hashesUsed>=this.hashes.length)return null;var a=this.hashes[i.hashesUsed++];return t===0&&o&&i.txs.push(a),h.Buffer.from(a,"hex")}else{var s=this._traverseMerkleTree(t-1,r*2,i),u=s;return r*2+1<this._calcTreeWidth(t-1)&&(u=this._traverseMerkleTree(t-1,r*2+1,i)),n?i.txs:dre.sha256sha256(h.Buffer.concat([s,u]))}};nr.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};nr.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};nr.prototype.hasTransaction=function(t){yf.checkArgument(!mf.isUndefined(t),"tx cannot be undefined"),yf.checkArgument(t instanceof sB||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof sB&&(r=h.Buffer.from(t.id,"hex").reverse().toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};nr._fromBufferReader=function(t){yf.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=C4.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};nr.fromObject=function(t){return new nr(t)};fB.exports=nr});var cB=k((R6e,v6)=>{v();v6.exports=aB();v6.exports.BlockHeader=X0();v6.exports.MerkleBlock=D4()});var yB=k((M6e,mB)=>{"use strict";v();var pB=Ae(),lB=pB.crypto.Hash,hB=/^[0-9a-fA-F]{64}$/;function gB(e){return h.Buffer.from(e).reverse()}function dB(e){return gB(h.Buffer.from(e,"hex"))}function vB(e){return gB(e).toString("hex")}function L4(e,t,r){if(!hB.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var i=dB(e),n=t,o=0;o<r.length;o++){var a=r[o],s;if(a==="*"||a===""||a==null)s=i;else{if(!hB.test(String(a)))throw new Error("proof node "+o+' must be 32-byte hex or "*"');s=dB(a)}i=n&1?lB.sha256sha256(h.Buffer.concat([s,i])):lB.sha256sha256(h.Buffer.concat([i,s])),n=Math.floor(n/2)}return vB(i)}function pre(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");var t=L4(e.txid,e.index,e.nodes);return t.toLowerCase()===String(e.merkleRoot).toLowerCase()}function gre(e){var t=e.header;if((h.Buffer.isBuffer(t)||typeof t=="string")&&(t=pB.BlockHeader.fromBuffer(h.Buffer.isBuffer(t)?t:h.Buffer.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=vB(t.merkleRoot),i=L4(e.txid,e.index,e.nodes),n=i.toLowerCase()===r.toLowerCase(),o=e.requirePow!==!1,a=t.validProofOfWork();return{valid:n&&(!o||a),rootMatches:n,powValid:a,merkleRoot:i,blockHash:t.id}}mB.exports={merkleRootFromBranch:L4,verifyMerkleProof:pre,verifyTxInclusion:gre}});var wB=k((C6e,_B)=>{"use strict";v();var bB=Ae();function vre(e){return h.Buffer.from(e).reverse()}function mre(e){if(e&&typeof e.validProofOfWork=="function")return e;if(h.Buffer.isBuffer(e))return bB.BlockHeader.fromBuffer(e);if(typeof e=="string")return bB.BlockHeader.fromBuffer(h.Buffer.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}function yre(e,t){if(t=t||{},!Array.isArray(e)||e.length===0)throw new Error("headers must be a non-empty array");for(var r=e.map(mre),i=t.requirePow!==!1,n=0,o=0;o<r.length;o++){if(i&&!r[o].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+o,count:r.length};if(n+=r[o].getDifficulty(),o>0){var a=vre(r[o].prevHash).toString("hex").toLowerCase()===r[o-1].id.toLowerCase();if(!a)return{valid:!1,reason:"broken link at index "+o,count:r.length}}}var s=r[0].id,u=r[r.length-1].id;if(t.trustedHash){var c=String(t.trustedHash).toLowerCase();if(c!==u.toLowerCase()&&c!==s.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:s,tipHash:u}}return{valid:!0,count:r.length,anchorHash:s,tipHash:u,work:n}}_B.exports={verifyHeaderChain:yre}});var xB=k((L6e,SB)=>{"use strict";v();var q4=yB(),bre=wB();SB.exports={merkleRootFromBranch:q4.merkleRootFromBranch,verifyMerkleProof:q4.verifyMerkleProof,verifyTxInclusion:q4.verifyTxInclusion,verifyHeaderChain:bre.verifyHeaderChain}});var F4=k((U6e,TB)=>{"use strict";v();var Ir=xt(),EB=Bt(),OB=fr(),_re=E0(),m6=el(),IB=cr(),y6=H4(),bf=ws(),U4=gn(),AB=$n(),PB=ln(),J0=PB,ro=PB.HDPublicKey,b6=xs(),Bs=pi();function ne(e){if(e instanceof ne)return e;if(!(this instanceof ne))return new ne(e);if(e)if(Ir.isString(e)||h.Buffer.isBuffer(e)){var t=ne.getSerializedError(e);if(t){if(h.Buffer.isBuffer(e)&&!ne.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof ro.ArgumentIsPrivateExtended)return new y6(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(Ir.isObject(e))return e instanceof y6?this._buildFromPrivate(e):this._buildFromObject(e);throw new ro.UnrecognizedArgument(e)}else throw new ro.MustSupplyArgument}ne.fromHDPrivateKey=function(e){return new ne(e)};ne.isValidPath=function(e){if(Ir.isString(e)){var t=y6._getDerivationIndexes(e);return t!==null&&Ir.every(t,ne.isValidPath)}return Ir.isNumber(e)?e>=0&&e<ne.Hardened:!1};ne.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};ne.prototype.deriveChild=function(e,t){if(Ir.isNumber(e))return this._deriveWithNumber(e,t);if(Ir.isString(e))return this._deriveFromString(e);throw new ro.InvalidDerivationArgument(e)};ne.prototype._deriveWithNumber=function(e,t){if(e>=ne.Hardened||t)throw new ro.InvalidIndexCantDeriveHardened;if(e<0)throw new ro.InvalidPath(e);var r=Bs.integerAsBuffer(e),i=h.Buffer.concat([this.publicKey.toBuffer(),r]),n=IB.sha512hmac(i,this._buffers.chainCode),o=OB.fromBuffer(n.slice(0,32),{size:32}),a=n.slice(32,64),s;try{s=AB.fromPoint(U4.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var u=new ne({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:a,publicKey:s});return u};ne.prototype._deriveFromString=function(e){if(Ir.includes(e,"'"))throw new ro.InvalidIndexCantDeriveHardened;if(!ne.isValidPath(e))throw new ro.InvalidPath(e);var t=y6._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};ne.isValidSerialized=function(e,t){return Ir.isNull(ne.getSerializedError(e,t))};ne.getSerializedError=function(e,t){if(!(Ir.isString(e)||h.Buffer.isBuffer(e)))return new ro.UnrecognizedArgument("expected buffer or string");if(!_re.validCharacters(e))return new J0.InvalidB58Char("(unknown)",e);try{e=m6.decode(e)}catch{return new J0.InvalidB58Checksum(e)}if(e.length!==ne.DataSize)return new ro.InvalidLength(e);if(!Ir.isUndefined(t)){var r=ne._validateNetwork(e,t);if(r)return r}var i=e.readUInt32BE(0);return i===bf.livenet.xprivkey||i===bf.testnet.xprivkey?new ro.ArgumentIsPrivateExtended:null};ne._validateNetwork=function(e,t){var r=bf.get(t);if(!r)return new J0.InvalidNetworkArgument(t);var i=e.slice(ne.VersionStart,ne.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new J0.InvalidNetwork(i):null};ne.prototype._buildFromPrivate=function(e){var t=Ir.clone(e._buffers),r=U4.getG().mul(OB.fromBuffer(t.privateKey));return t.publicKey=U4.pointToCompressed(r),t.version=Bs.integerAsBuffer(bf.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};ne.prototype._buildFromObject=function(e){var t={version:e.network?Bs.integerAsBuffer(bf.get(e.network).xpubkey):e.version,depth:Ir.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:Ir.isNumber(e.parentFingerPrint)?Bs.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Ir.isNumber(e.childIndex)?Bs.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Ir.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:Ir.isString(e.publicKey)?h.Buffer.from(e.publicKey,"hex"):h.Buffer.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:Ir.isNumber(e.checksum)?Bs.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};ne.prototype._buildFromSerialized=function(e){var t=m6.decode(e),r={version:t.slice(ne.VersionStart,ne.VersionEnd),depth:t.slice(ne.DepthStart,ne.DepthEnd),parentFingerPrint:t.slice(ne.ParentFingerPrintStart,ne.ParentFingerPrintEnd),childIndex:t.slice(ne.ChildIndexStart,ne.ChildIndexEnd),chainCode:t.slice(ne.ChainCodeStart,ne.ChainCodeEnd),publicKey:t.slice(ne.PublicKeyStart,ne.PublicKeyEnd),checksum:t.slice(ne.ChecksumStart,ne.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};ne.prototype._buildFromBuffers=function(e){ne._validateBufferArguments(e),Bs.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=h.Buffer.concat(t),i=m6.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new J0.InvalidB58Checksum(r,i);var n=bf.get(e.version.readUInt32BE(0)),o;o=m6.encode(h.Buffer.concat(t)),e.xpubkey=h.Buffer.from(o);var a=new AB(e.publicKey,{network:n}),s=ne.ParentFingerPrintSize,u=IB.sha256ripemd160(a.toBuffer()).slice(0,s);return Bs.defineImmutable(this,{xpubkey:o,network:n,depth:e.depth[0],publicKey:a,fingerPrint:u}),this};ne._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];b6(h.Buffer.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),b6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",ne.VersionSize),t("depth",ne.DepthSize),t("parentFingerPrint",ne.ParentFingerPrintSize),t("childIndex",ne.ChildIndexSize),t("chainCode",ne.ChainCodeSize),t("publicKey",ne.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",ne.CheckSumSize)};ne.fromString=function(e){return EB.checkArgument(Ir.isString(e),"No valid string was provided"),new ne(e)};ne.fromObject=function(e){return EB.checkArgument(Ir.isObject(e),"No valid argument was provided"),new ne(e)};ne.prototype.toString=function(){return this.xpubkey};ne.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};ne.prototype.toObject=ne.prototype.toJSON=function(){return{network:bf.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}};ne.fromBuffer=function(e){return new ne(e)};ne.fromHex=function(e){return ne.fromBuffer(h.Buffer.from(e,"hex"))};ne.prototype.toBuffer=function(){return h.Buffer.from(this._buffers.xpubkey)};ne.prototype.toHex=function(){return this.toBuffer().toString("hex")};ne.Hardened=2147483648;ne.RootElementAlias=["m","M"];ne.VersionSize=4;ne.DepthSize=1;ne.ParentFingerPrintSize=4;ne.ChildIndexSize=4;ne.ChainCodeSize=32;ne.PublicKeySize=33;ne.CheckSumSize=4;ne.DataSize=78;ne.SerializedByteSize=82;ne.VersionStart=0;ne.VersionEnd=ne.VersionStart+ne.VersionSize;ne.DepthStart=ne.VersionEnd;ne.DepthEnd=ne.DepthStart+ne.DepthSize;ne.ParentFingerPrintStart=ne.DepthEnd;ne.ParentFingerPrintEnd=ne.ParentFingerPrintStart+ne.ParentFingerPrintSize;ne.ChildIndexStart=ne.ParentFingerPrintEnd;ne.ChildIndexEnd=ne.ChildIndexStart+ne.ChildIndexSize;ne.ChainCodeStart=ne.ChildIndexEnd;ne.ChainCodeEnd=ne.ChainCodeStart+ne.ChainCodeSize;ne.PublicKeyStart=ne.ChainCodeEnd;ne.PublicKeyEnd=ne.PublicKeyStart+ne.PublicKeySize;ne.ChecksumStart=ne.PublicKeyEnd;ne.ChecksumEnd=ne.ChecksumStart+ne.CheckSumSize;b6(ne.PublicKeyEnd===ne.DataSize);b6(ne.ChecksumEnd===ne.SerializedByteSize);TB.exports=ne});var H4=k((H6e,NB)=>{"use strict";v();var _6=xs(),e1=zt(),mr=xt(),RB=Bt(),BB=fr(),wre=E0(),Q0=el(),j4=cr(),_f=ws(),Sre=gn(),MB=G0(),xre=Ku(),pl=ln(),Uo=pl.HDPrivateKey,qo=pi(),Ere=128,kB=1/8,Ore=512;function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(!e)return this._generateRandomly();if(_f.get(e))return this._generateRandomly(e);if(mr.isString(e)||h.Buffer.isBuffer(e))if(J.isValidSerialized(e))this._buildFromSerialized(e);else if(qo.isValidJSON(e))this._buildFromJSON(e);else if(h.Buffer.isBuffer(e)&&J.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw J.getSerializedError(e);else if(mr.isObject(e))this._buildFromObject(e);else throw new Uo.UnrecognizedArgument(e)}J.fromRandom=function(){return new J};J.isValidPath=function(e,t){if(mr.isString(e)){var r=J._getDerivationIndexes(e);return r!==null&&mr.every(r,J.isValidPath)}return mr.isNumber(e)?(e<J.Hardened&&t===!0&&(e+=J.Hardened),e>=0&&e<J.MaxIndex):!1};J._getDerivationIndexes=function(e){var t=e.split("/");if(mr.includes(J.RootElementAlias,e))return[];if(!mr.includes(J.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=J.Hardened),o});return mr.some(r,isNaN)?null:r};J.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};J.prototype.deriveChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t);if(mr.isString(e))return this._deriveFromString(e);throw new Uo.InvalidDerivationArgument(e)};J.prototype.deriveNonCompliantChild=function(e,t){if(mr.isNumber(e))return this._deriveWithNumber(e,t,!0);if(mr.isString(e))return this._deriveFromString(e,!0);throw new Uo.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t,r){if(!J.isValidPath(e,t))throw new Uo.InvalidPath(e);t=e>=J.Hardened?!0:t,e<J.Hardened&&t===!0&&(e+=J.Hardened);var i=qo.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=h.Buffer.concat([e1.Buffer.from([0]),o,i])}else if(t){var a=this.privateKey.bn.toBuffer({size:32});_6(a.length===32,"length of private key buffer is expected to be 32 bytes"),n=h.Buffer.concat([e1.Buffer.from([0]),a,i])}else n=h.Buffer.concat([this.publicKey.toBuffer(),i]);var s=j4.sha512hmac(n,this._buffers.chainCode),u=BB.fromBuffer(s.slice(0,32),{size:32}),c=s.slice(32,64),l=u.add(this.privateKey.toBigNumber()).umod(Sre.getN()).toBuffer({size:32});if(!MB.isValid(l))return this._deriveWithNumber(e+1,null,r);var m=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:c,privateKey:l});return m};J.prototype._deriveFromString=function(e,t){if(!J.isValidPath(e))throw new Uo.InvalidPath(e);var r=J._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};J.isValidSerialized=function(e,t){return!J.getSerializedError(e,t)};J.getSerializedError=function(e,t){if(!(mr.isString(e)||h.Buffer.isBuffer(e)))return new Uo.UnrecognizedArgument("Expected string or buffer");if(!wre.validCharacters(e))return new pl.InvalidB58Char("(unknown)",e);try{e=Q0.decode(e)}catch{return new pl.InvalidB58Checksum(e)}if(e.length!==J.DataLength)return new Uo.InvalidLength(e);if(!mr.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}return null};J._validateNetwork=function(e,t){var r=_f.get(t);if(!r)return new pl.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new pl.InvalidNetwork(i):null};J.fromString=function(e){return RB.checkArgument(mr.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return RB.checkArgument(mr.isObject(e),"No valid argument was provided"),new J(e)};J.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};J.prototype._buildFromObject=function(e){var t={version:e.network?qo.integerAsBuffer(_f.get(e.network).xprivkey):e.version,depth:mr.isNumber(e.depth)?h.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:mr.isNumber(e.parentFingerPrint)?qo.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:mr.isNumber(e.childIndex)?qo.integerAsBuffer(e.childIndex):e.childIndex,chainCode:mr.isString(e.chainCode)?h.Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:mr.isString(e.privateKey)&&qo.isHexa(e.privateKey)?h.Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:qo.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=Q0.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),privateKey:t.slice(J.PrivateKeyStart,J.PrivateKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};J.prototype._generateRandomly=function(e){return J.fromSeed(xre.getRandomBuffer(64),e)};J.fromSeed=function(e,t){if(qo.isHexaString(e)&&(e=h.Buffer.from(e,"hex")),!h.Buffer.isBuffer(e))throw new Uo.InvalidEntropyArgument(e);if(e.length<Ere*kB)throw new Uo.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>Ore*kB)throw new Uo.InvalidEntropyArgument.TooMuchEntropy(e);var r=j4.sha512hmac(e,e1.Buffer.from("Bitcoin seed"));return new J({network:_f.get(t)||_f.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};J.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=F4();this._hdPublicKey=new e(this)}};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),qo.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,h.Buffer.alloc(1),e.privateKey],r=e1.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=Q0.checksum(r);else if(e.checksum.toString()!==Q0.checksum(r).toString())throw new pl.InvalidB58Checksum(r);var i=_f.get(e.version.readUInt32BE(0)),n;n=Q0.encode(e1.Buffer.concat(t)),e.xprivkey=h.Buffer.from(n);var o=new MB(BB.fromBuffer(e.privateKey),i),a=o.toPublicKey(),s=J.ParentFingerPrintSize,u=j4.sha256ripemd160(a.toBuffer()).slice(0,s);return qo.defineImmutable(this,{xprivkey:n,network:i,depth:e.depth[0],privateKey:o,publicKey:a,fingerPrint:u}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];_6(h.Buffer.isBuffer(n),r+" argument is not a buffer"),_6(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("privateKey",J.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.prototype.toString=function(){return this.xprivkey};J.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:_f.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}};J.fromBuffer=function(e){return new J(e.toString())};J.fromHex=function(e){return J.fromBuffer(h.Buffer.from(e,"hex"))};J.prototype.toBuffer=function(){return h.Buffer.from(this.toString())};J.prototype.toHex=function(){return this.toBuffer().toString("hex")};J.DefaultDepth=0;J.DefaultFingerprint=0;J.DefaultChildIndex=0;J.Hardened=2147483648;J.MaxIndex=2*J.Hardened;J.RootElementAlias=["m","M","m'","M'"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PrivateKeySize=32;J.CheckSumSize=4;J.DataLength=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PrivateKeyStart=J.ChainCodeEnd+1;J.PrivateKeyEnd=J.PrivateKeyStart+J.PrivateKeySize;J.ChecksumStart=J.PrivateKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;_6(J.ChecksumEnd===J.SerializedByteSize);NB.exports=J});var UB=k((z6e,qB)=>{"use strict";v();var Fo=Ae(),w6=Fo.deps._,Ire=Fo.PrivateKey,Are=Fo.PublicKey,CB=Fo.Address,DB=Fo.encoding.BufferWriter,z4=Fo.crypto.ECDSA,LB=Fo.crypto.Signature,Pre=Fo.crypto.Hash.sha256sha256,Tre=Fo.util.js,gl=Fo.util.preconditions,or=function e(t){return this instanceof e?(gl.checkArgument(w6.isString(t)||h.Buffer.isBuffer(t),"First argument should be a string or Buffer"),w6.isString(t)&&(this.messageBuffer=h.Buffer.from(t)),h.Buffer.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};or.sign=function(e,t){return new or(e).sign(t)};or.verify=function(e,t,r){return new or(e).verify(t,r)};or.MAGIC_BYTES=h.Buffer.from(`Bitcoin Signed Message:
|
|
76
76
|
`);or.prototype.magicHash=function(){var t=DB.varintBufNum(or.MAGIC_BYTES.length),r=DB.varintBufNum(this.messageBuffer.length),i=h.Buffer.concat([t,or.MAGIC_BYTES,r,this.messageBuffer]),n=Pre(i);return n};or.prototype._sign=function(t){gl.checkArgument(t instanceof Ire,"First argument should be an instance of PrivateKey");var r=this.magicHash();return z4.signWithCalcI(r,t)};or.prototype.sign=function(t){var r=this._sign(t);return r.toCompact().toString("base64")};or.prototype._verify=function(t,r){gl.checkArgument(t instanceof Are,"First argument should be an instance of PublicKey"),gl.checkArgument(r instanceof LB,"Second argument should be an instance of Signature");var i=this.magicHash(),n=z4.verify(i,r,t);return n||(this.error="The signature was invalid"),n};or.prototype.verify=function(t,r){gl.checkArgument(t),gl.checkArgument(r&&w6.isString(r)),w6.isString(t)&&(t=CB.fromString(t));var i=LB.fromCompact(h.Buffer.from(r,"base64")),n=new z4;n.hashbuf=this.magicHash(),n.sig=i;var o=n.toPublicKey(),a=CB.fromPublicKey(o,t.network);return t.toString()!==a.toString()?(this.error="The signature did not match the message digest",!1):this._verify(o,i)};or.fromString=function(e){return new or(e)};or.fromJSON=function(t){return Tre.isValidJSON(t)&&(t=JSON.parse(t)),or.fromObject(t)};or.prototype.toObject=function(){return{messageHex:this.messageBuffer.toString("hex")}};or.fromObject=function(e){let t=h.Buffer.from(e.messageHex,"hex");return new or(t)};or.prototype.toJSON=function(){return JSON.stringify(this.toObject())};or.prototype.toString=function(){return this.messageBuffer.toString()};or.prototype.inspect=function(){return"<Message: "+this.toString()+">"};qB.exports=or});var jB=k((V6e,HB)=>{v();var FB=Ae();FB.Message=UB();HB.exports=FB.Message});var KB=k((zB,K4)=>{v();(function(e){"use strict";for(var t=[null,0,{}],r=10,i=44032,n=4352,o=4449,a=4519,s=19,u=21,c=28,l=u*c,m=s*l,w=function(x,b){this.codepoint=x,this.feature=b},E={},P=[],M=0;M<=255;++M)P[M]=0;function D(x,b,p){var I=E[b];return I||(I=x(b,p),I.feature&&++P[b>>8&255]>r&&(E[b]=I)),I}function L(x,b,p){var I=b&65280,T=w.udata[I]||{},S=T[b];return S?new w(b,S):new w(b,t)}function U(x,b,p){return p?x(b,p):new w(b,null)}function K(x,b,p){var I;if(b<n||n+s<=b&&b<i||i+m<b)return x(b,p);if(n<=b&&b<n+s){var T={},S=(b-n)*u;for(I=0;I<u;++I)T[o+I]=i+c*(I+S);return new w(b,[,,T])}var R=b-i,Y=R%c,X=[];if(Y!==0)X[0]=[i+R-Y,a+Y];else for(X[0]=[n+Math.floor(R/l),o+Math.floor(R%l/c)],X[2]={},I=1;I<c;++I)X[2][a+I]=b+I;return new w(b,X)}function N(x,b,p){return b<60||13311<b&&b<42607?new w(b,t):x(b,p)}var C=[N,D,U,K,L];w.fromCharCode=C.reduceRight(function(x,b){return function(p,I){return b(x,p,I)}},null),w.isHighSurrogate=function(x){return x>=55296&&x<=56319},w.isLowSurrogate=function(x){return x>=56320&&x<=57343},w.prototype.prepFeature=function(){this.feature||(this.feature=w.fromCharCode(this.codepoint,!0).feature)},w.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var x=this.codepoint-65536;return String.fromCharCode(Math.floor(x/1024)+55296,x%1024+56320)},w.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},w.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&this.feature[1]&256},w.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&this.feature[1]&512},w.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?this.feature[1]&255:0},w.prototype.getComposite=function(x){if(this.prepFeature(),!this.feature[2])return null;var b=this.feature[2][x.codepoint];return b?w.fromCharCode(b):null};var F=function(x){this.str=x,this.cursor=0};F.prototype.next=function(){if(this.str&&this.cursor<this.str.length){var x=this.str.charCodeAt(this.cursor++),b;return w.isHighSurrogate(x)&&this.cursor<this.str.length&&w.isLowSurrogate(b=this.str.charCodeAt(this.cursor))&&(x=(x-55296)*1024+(b-56320)+65536,++this.cursor),w.fromCharCode(x)}else return this.str=null,null};var H=function(x,b){this.it=x,this.canonical=b,this.resBuf=[]};H.prototype.next=function(){function x(p,I){var T=I.getDecomp();if(T&&!(p&&I.isCompatibility())){for(var S=[],R=0;R<T.length;++R){var Y=x(p,w.fromCharCode(T[R]));S=S.concat(Y)}return S}else return[I]}if(this.resBuf.length===0){var b=this.it.next();if(!b)return null;this.resBuf=x(this.canonical,b)}return this.resBuf.shift()};var z=function(x){this.it=x,this.resBuf=[]};z.prototype.next=function(){var x;if(this.resBuf.length===0)do{var b=this.it.next();if(!b)break;x=b.getCanonicalClass();var p=this.resBuf.length;if(x!==0)for(;p>0;--p){var I=this.resBuf[p-1],T=I.getCanonicalClass();if(T<=x)break}this.resBuf.splice(p,0,b)}while(x!==0);return this.resBuf.shift()};var G=function(x){this.it=x,this.procBuf=[],this.resBuf=[],this.lastClass=null};G.prototype.next=function(){for(;this.resBuf.length===0;){var x=this.it.next();if(!x){this.resBuf=this.procBuf,this.procBuf=[];break}if(this.procBuf.length===0)this.lastClass=x.getCanonicalClass(),this.procBuf.push(x);else{var b=this.procBuf[0],p=b.getComposite(x),I=x.getCanonicalClass();p&&(this.lastClass<I||this.lastClass===0)?this.procBuf[0]=p:(I===0&&(this.resBuf=this.procBuf,this.procBuf=[]),this.lastClass=I,this.procBuf.push(x))}}return this.resBuf.shift()};var B=function(x,b){switch(x){case"NFD":return new z(new H(new F(b),!0));case"NFKD":return new z(new H(new F(b),!1));case"NFC":return new G(new z(new H(new F(b),!0)));case"NFKC":return new G(new z(new H(new F(b),!1)))}throw x+" is invalid"},g=function(x,b){for(var p=B(x,b),I="",T;T=p.next();)I+=T.toString();return I};function O(x){return g("NFD",x)}function y(x){return g("NFKD",x)}function f(x){return g("NFC",x)}function d(x){return g("NFKC",x)}w.udata={0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]},256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]},512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256],66272:[,220]},768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8e3,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256],66422:[,230],66423:[,230],66424:[,230],66425:[,230],66426:[,230]},1024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]},1280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]},1536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]},1792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]},2048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230],2303:[,230]},2304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]},2560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9],68325:[,230],68326:[,220]},2816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]},3072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]},3328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]},3584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]},3840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]},4096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69759:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]},4352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70003:[,7],70080:[,9]},4608:{70197:[,9],70198:[,7],70377:[,7],70378:[,9]},4864:{4957:[,230],4958:[,230],4959:[,230],70460:[,7],70471:[,,{70462:70475,70487:70476}],70475:[[70471,70462]],70476:[[70471,70487]],70477:[,9],70502:[,230],70503:[,230],70504:[,230],70505:[,230],70506:[,230],70507:[,230],70508:[,230],70512:[,230],70513:[,230],70514:[,230],70515:[,230],70516:[,230]},5120:{70841:[,,{70832:70844,70842:70843,70845:70846}],70843:[[70841,70842]],70844:[[70841,70832]],70846:[[70841,70845]],70850:[,9],70851:[,7]},5376:{71096:[,,{71087:71098}],71097:[,,{71087:71099}],71098:[[71096,71087]],71099:[[71097,71087]],71103:[,9],71104:[,7]},5632:{71231:[,9],71350:[,9],71351:[,7]},5888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]},6144:{6313:[,228]},6400:{6457:[,222],6458:[,230],6459:[,220]},6656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220],6832:[,230],6833:[,230],6834:[,230],6835:[,230],6836:[,230],6837:[,220],6838:[,220],6839:[,220],6840:[,220],6841:[,220],6842:[,220],6843:[,230],6844:[,230],6845:[,220]},6912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]},7168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230],7416:[,230],7417:[,230]},7424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7655:[,230],7656:[,230],7657:[,230],7658:[,230],7659:[,230],7660:[,230],7661:[,230],7662:[,230],7663:[,230],7664:[,230],7665:[,230],7666:[,230],7667:[,230],7668:[,230],7669:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]},7680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]},7936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8e3:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8e3,768]],8003:[[8001,768]],8004:[[8e3,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]},8192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]},8448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]},8704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]},8960:{9001:[[12296]],9002:[[12297]]},9216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]},10752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]},11264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]},11520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]},11776:{11935:[[27597],256],12019:[[40863],256]},12032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[3e4],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]},12288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]},12544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]},12800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13e3:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]},13056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]},27136:{92912:[,1],92913:[,1],92914:[,1],92915:[,1],92916:[,1]},27392:{92976:[,230],92977:[,230],92978:[,230],92979:[,230],92980:[,230],92981:[,230],92982:[,230]},42496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42652:[[1098],256],42653:[[1100],256],42655:[,230],42736:[,230],42737:[,230]},42752:{42864:[[42863],256],43e3:[[294],256],43001:[[339],256]},43008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]},43264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]},43520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]},43776:{43868:[[42791],256],43869:[[43831],256],43870:[[619],256],43871:[[43858],256],44013:[,9]},48128:{113822:[,1]},53504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]},53760:{119362:[,230],119363:[,230],119364:[,230]},54272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],12e4:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]},54528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]},54784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]},55040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]},59392:{125136:[,220],125137:[,220],125138:[,220],125139:[,220],125140:[,220],125141:[,220],125142:[,220]},60928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]},61696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]},61952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]},63488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23e3]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]},63744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149e3]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32e3]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195e3:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]},64e3:{64e3:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[4e4]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]},64256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]},64512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]},64768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]},65024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65063:[,220],65064:[,220],65065:[,220],65066:[,220],65067:[,220],65068:[,220],65069:[,220],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]},65280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]}};var _={nfc:f,nfd:O,nfkc:d,nfkd:y};typeof K4=="object"?K4.exports=_:typeof define=="function"&&define.amd?define("unorm",function(){return _}):e.unorm=_,_.shimApplied=!1,String.prototype.normalize||(String.prototype.normalize=function(x){var b=""+this;if(x=x===void 0?"NFC":x,x==="NFC")return _.nfc(b);if(x==="NFD")return _.nfd(b);if(x==="NFKC")return _.nfkc(b);if(x==="NFKD")return _.nfkd(b);throw new RangeError("Invalid normalization form: "+x)},_.shimApplied=!0)})(zB)});var ZB=k((W6e,GB)=>{"use strict";v();var VB=cr();function kre(e,t,r,i){var n=64;if(i>(Math.pow(2,32)-1)*n)throw Error("Requested key length too long");if(typeof e!="string"&&!h.Buffer.isBuffer(e))throw new TypeError("key must a string or Buffer");if(typeof t!="string"&&!h.Buffer.isBuffer(t))throw new TypeError("salt must a string or Buffer");typeof e=="string"&&(e=h.Buffer.from(e)),typeof t=="string"&&(t=h.Buffer.from(t));var o=h.Buffer.alloc(i),a=h.Buffer.alloc(n),s=h.Buffer.alloc(n),u=h.Buffer.alloc(t.length+4),c=Math.ceil(i/n),l=i-(c-1)*n;t.copy(u,0,0,t.length);for(var m=1;m<=c;m++){u[t.length+0]=m>>24&255,u[t.length+1]=m>>16&255,u[t.length+2]=m>>8&255,u[t.length+3]=m>>0&255,a=VB.sha512hmac(u,e),a.copy(s,0,0,n);for(var w=1;w<r;w++){a=VB.sha512hmac(a,e);for(var E=0;E<n;E++)s[E]^=a[E]}var P=(m-1)*n,M=m===c?l:n;s.copy(o,P,0,M)}return o}GB.exports=kre});var $B=k(($6e,YB)=>{"use strict";v();var WB=_r();function Rre(e,t,r,i){var n=64;if(i>(Math.pow(2,32)-1)*n)throw Error("Requested key length too long");if(typeof e!="string"&&!h.Buffer.isBuffer(e))throw new TypeError("key must a string or Buffer");if(typeof t!="string"&&!h.Buffer.isBuffer(t))throw new TypeError("salt must a string or Buffer");typeof e=="string"&&(e=h.Buffer.from(e)),typeof t=="string"&&(t=h.Buffer.from(t));var o=h.Buffer.alloc(i),a=h.Buffer.alloc(n),s=h.Buffer.alloc(n),u=h.Buffer.alloc(t.length+4),c=Math.ceil(i/n),l=i-(c-1)*n;t.copy(u,0,0,t.length);for(var m=1;m<=c;m++){u[t.length+0]=m>>24&255,u[t.length+1]=m>>16&255,u[t.length+2]=m>>8&255,u[t.length+3]=m>>0&255,a=WB.createHmac("sha512",e).update(u).digest(),a.copy(s,0,0,n);for(var w=1;w<r;w++){a=WB.createHmac("sha512",e).update(a).digest();for(var E=0;E<n;E++)s[E]^=a[E]}var P=(m-1)*n,M=m===c?l:n;s.copy(o,P,0,M)}return o}YB.exports=Rre});var XB=k((J6e,V4)=>{v();A.default.browser?V4.exports=ZB():V4.exports=$B()});var QB=k((e5e,JB)=>{"use strict";v();var Bre={name:"Mnemonic",message:"Internal Error on bsv-mnemonic module {0}",errors:[{name:"InvalidEntropy",message:"Entropy length must be an even multiple of 11 bits: {0}"},{name:"UnknownWordlist",message:"Could not detect the used word list: {0}"},{name:"InvalidMnemonic",message:"Mnemonic string is invalid: {0}"}]};JB.exports=Ae().errors.extend(Bre)});var tM=k((r5e,eM)=>{"use strict";v();var Mre=["\u7684","\u4E00","\u662F","\u5728","\u4E0D","\u4E86","\u6709","\u548C","\u4EBA","\u8FD9","\u4E2D","\u5927","\u4E3A","\u4E0A","\u4E2A","\u56FD","\u6211","\u4EE5","\u8981","\u4ED6","\u65F6","\u6765","\u7528","\u4EEC","\u751F","\u5230","\u4F5C","\u5730","\u4E8E","\u51FA","\u5C31","\u5206","\u5BF9","\u6210","\u4F1A","\u53EF","\u4E3B","\u53D1","\u5E74","\u52A8","\u540C","\u5DE5","\u4E5F","\u80FD","\u4E0B","\u8FC7","\u5B50","\u8BF4","\u4EA7","\u79CD","\u9762","\u800C","\u65B9","\u540E","\u591A","\u5B9A","\u884C","\u5B66","\u6CD5","\u6240","\u6C11","\u5F97","\u7ECF","\u5341","\u4E09","\u4E4B","\u8FDB","\u7740","\u7B49","\u90E8","\u5EA6","\u5BB6","\u7535","\u529B","\u91CC","\u5982","\u6C34","\u5316","\u9AD8","\u81EA","\u4E8C","\u7406","\u8D77","\u5C0F","\u7269","\u73B0","\u5B9E","\u52A0","\u91CF","\u90FD","\u4E24","\u4F53","\u5236","\u673A","\u5F53","\u4F7F","\u70B9","\u4ECE","\u4E1A","\u672C","\u53BB","\u628A","\u6027","\u597D","\u5E94","\u5F00","\u5B83","\u5408","\u8FD8","\u56E0","\u7531","\u5176","\u4E9B","\u7136","\u524D","\u5916","\u5929","\u653F","\u56DB","\u65E5","\u90A3","\u793E","\u4E49","\u4E8B","\u5E73","\u5F62","\u76F8","\u5168","\u8868","\u95F4","\u6837","\u4E0E","\u5173","\u5404","\u91CD","\u65B0","\u7EBF","\u5185","\u6570","\u6B63","\u5FC3","\u53CD","\u4F60","\u660E","\u770B","\u539F","\u53C8","\u4E48","\u5229","\u6BD4","\u6216","\u4F46","\u8D28","\u6C14","\u7B2C","\u5411","\u9053","\u547D","\u6B64","\u53D8","\u6761","\u53EA","\u6CA1","\u7ED3","\u89E3","\u95EE","\u610F","\u5EFA","\u6708","\u516C","\u65E0","\u7CFB","\u519B","\u5F88","\u60C5","\u8005","\u6700","\u7ACB","\u4EE3","\u60F3","\u5DF2","\u901A","\u5E76","\u63D0","\u76F4","\u9898","\u515A","\u7A0B","\u5C55","\u4E94","\u679C","\u6599","\u8C61","\u5458","\u9769","\u4F4D","\u5165","\u5E38","\u6587","\u603B","\u6B21","\u54C1","\u5F0F","\u6D3B","\u8BBE","\u53CA","\u7BA1","\u7279","\u4EF6","\u957F","\u6C42","\u8001","\u5934","\u57FA","\u8D44","\u8FB9","\u6D41","\u8DEF","\u7EA7","\u5C11","\u56FE","\u5C71","\u7EDF","\u63A5","\u77E5","\u8F83","\u5C06","\u7EC4","\u89C1","\u8BA1","\u522B","\u5979","\u624B","\u89D2","\u671F","\u6839","\u8BBA","\u8FD0","\u519C","\u6307","\u51E0","\u4E5D","\u533A","\u5F3A","\u653E","\u51B3","\u897F","\u88AB","\u5E72","\u505A","\u5FC5","\u6218","\u5148","\u56DE","\u5219","\u4EFB","\u53D6","\u636E","\u5904","\u961F","\u5357","\u7ED9","\u8272","\u5149","\u95E8","\u5373","\u4FDD","\u6CBB","\u5317","\u9020","\u767E","\u89C4","\u70ED","\u9886","\u4E03","\u6D77","\u53E3","\u4E1C","\u5BFC","\u5668","\u538B","\u5FD7","\u4E16","\u91D1","\u589E","\u4E89","\u6D4E","\u9636","\u6CB9","\u601D","\u672F","\u6781","\u4EA4","\u53D7","\u8054","\u4EC0","\u8BA4","\u516D","\u5171","\u6743","\u6536","\u8BC1","\u6539","\u6E05","\u7F8E","\u518D","\u91C7","\u8F6C","\u66F4","\u5355","\u98CE","\u5207","\u6253","\u767D","\u6559","\u901F","\u82B1","\u5E26","\u5B89","\u573A","\u8EAB","\u8F66","\u4F8B","\u771F","\u52A1","\u5177","\u4E07","\u6BCF","\u76EE","\u81F3","\u8FBE","\u8D70","\u79EF","\u793A","\u8BAE","\u58F0","\u62A5","\u6597","\u5B8C","\u7C7B","\u516B","\u79BB","\u534E","\u540D","\u786E","\u624D","\u79D1","\u5F20","\u4FE1","\u9A6C","\u8282","\u8BDD","\u7C73","\u6574","\u7A7A","\u5143","\u51B5","\u4ECA","\u96C6","\u6E29","\u4F20","\u571F","\u8BB8","\u6B65","\u7FA4","\u5E7F","\u77F3","\u8BB0","\u9700","\u6BB5","\u7814","\u754C","\u62C9","\u6797","\u5F8B","\u53EB","\u4E14","\u7A76","\u89C2","\u8D8A","\u7EC7","\u88C5","\u5F71","\u7B97","\u4F4E","\u6301","\u97F3","\u4F17","\u4E66","\u5E03","\u590D","\u5BB9","\u513F","\u987B","\u9645","\u5546","\u975E","\u9A8C","\u8FDE","\u65AD","\u6DF1","\u96BE","\u8FD1","\u77FF","\u5343","\u5468","\u59D4","\u7D20","\u6280","\u5907","\u534A","\u529E","\u9752","\u7701","\u5217","\u4E60","\u54CD","\u7EA6","\u652F","\u822C","\u53F2","\u611F","\u52B3","\u4FBF","\u56E2","\u5F80","\u9178","\u5386","\u5E02","\u514B","\u4F55","\u9664","\u6D88","\u6784","\u5E9C","\u79F0","\u592A","\u51C6","\u7CBE","\u503C","\u53F7","\u7387","\u65CF","\u7EF4","\u5212","\u9009","\u6807","\u5199","\u5B58","\u5019","\u6BDB","\u4EB2","\u5FEB","\u6548","\u65AF","\u9662","\u67E5","\u6C5F","\u578B","\u773C","\u738B","\u6309","\u683C","\u517B","\u6613","\u7F6E","\u6D3E","\u5C42","\u7247","\u59CB","\u5374","\u4E13","\u72B6","\u80B2","\u5382","\u4EAC","\u8BC6","\u9002","\u5C5E","\u5706","\u5305","\u706B","\u4F4F","\u8C03","\u6EE1","\u53BF","\u5C40","\u7167","\u53C2","\u7EA2","\u7EC6","\u5F15","\u542C","\u8BE5","\u94C1","\u4EF7","\u4E25","\u9996","\u5E95","\u6DB2","\u5B98","\u5FB7","\u968F","\u75C5","\u82CF","\u5931","\u5C14","\u6B7B","\u8BB2","\u914D","\u5973","\u9EC4","\u63A8","\u663E","\u8C08","\u7F6A","\u795E","\u827A","\u5462","\u5E2D","\u542B","\u4F01","\u671B","\u5BC6","\u6279","\u8425","\u9879","\u9632","\u4E3E","\u7403","\u82F1","\u6C27","\u52BF","\u544A","\u674E","\u53F0","\u843D","\u6728","\u5E2E","\u8F6E","\u7834","\u4E9A","\u5E08","\u56F4","\u6CE8","\u8FDC","\u5B57","\u6750","\u6392","\u4F9B","\u6CB3","\u6001","\u5C01","\u53E6","\u65BD","\u51CF","\u6811","\u6EB6","\u600E","\u6B62","\u6848","\u8A00","\u58EB","\u5747","\u6B66","\u56FA","\u53F6","\u9C7C","\u6CE2","\u89C6","\u4EC5","\u8D39","\u7D27","\u7231","\u5DE6","\u7AE0","\u65E9","\u671D","\u5BB3","\u7EED","\u8F7B","\u670D","\u8BD5","\u98DF","\u5145","\u5175","\u6E90","\u5224","\u62A4","\u53F8","\u8DB3","\u67D0","\u7EC3","\u5DEE","\u81F4","\u677F","\u7530","\u964D","\u9ED1","\u72AF","\u8D1F","\u51FB","\u8303","\u7EE7","\u5174","\u4F3C","\u4F59","\u575A","\u66F2","\u8F93","\u4FEE","\u6545","\u57CE","\u592B","\u591F","\u9001","\u7B14","\u8239","\u5360","\u53F3","\u8D22","\u5403","\u5BCC","\u6625","\u804C","\u89C9","\u6C49","\u753B","\u529F","\u5DF4","\u8DDF","\u867D","\u6742","\u98DE","\u68C0","\u5438","\u52A9","\u5347","\u9633","\u4E92","\u521D","\u521B","\u6297","\u8003","\u6295","\u574F","\u7B56","\u53E4","\u5F84","\u6362","\u672A","\u8DD1","\u7559","\u94A2","\u66FE","\u7AEF","\u8D23","\u7AD9","\u7B80","\u8FF0","\u94B1","\u526F","\u5C3D","\u5E1D","\u5C04","\u8349","\u51B2","\u627F","\u72EC","\u4EE4","\u9650","\u963F","\u5BA3","\u73AF","\u53CC","\u8BF7","\u8D85","\u5FAE","\u8BA9","\u63A7","\u5DDE","\u826F","\u8F74","\u627E","\u5426","\u7EAA","\u76CA","\u4F9D","\u4F18","\u9876","\u7840","\u8F7D","\u5012","\u623F","\u7A81","\u5750","\u7C89","\u654C","\u7565","\u5BA2","\u8881","\u51B7","\u80DC","\u7EDD","\u6790","\u5757","\u5242","\u6D4B","\u4E1D","\u534F","\u8BC9","\u5FF5","\u9648","\u4ECD","\u7F57","\u76D0","\u53CB","\u6D0B","\u9519","\u82E6","\u591C","\u5211","\u79FB","\u9891","\u9010","\u9760","\u6DF7","\u6BCD","\u77ED","\u76AE","\u7EC8","\u805A","\u6C7D","\u6751","\u4E91","\u54EA","\u65E2","\u8DDD","\u536B","\u505C","\u70C8","\u592E","\u5BDF","\u70E7","\u8FC5","\u5883","\u82E5","\u5370","\u6D32","\u523B","\u62EC","\u6FC0","\u5B54","\u641E","\u751A","\u5BA4","\u5F85","\u6838","\u6821","\u6563","\u4FB5","\u5427","\u7532","\u6E38","\u4E45","\u83DC","\u5473","\u65E7","\u6A21","\u6E56","\u8D27","\u635F","\u9884","\u963B","\u6BEB","\u666E","\u7A33","\u4E59","\u5988","\u690D","\u606F","\u6269","\u94F6","\u8BED","\u6325","\u9152","\u5B88","\u62FF","\u5E8F","\u7EB8","\u533B","\u7F3A","\u96E8","\u5417","\u9488","\u5218","\u554A","\u6025","\u5531","\u8BEF","\u8BAD","\u613F","\u5BA1","\u9644","\u83B7","\u8336","\u9C9C","\u7CAE","\u65A4","\u5B69","\u8131","\u786B","\u80A5","\u5584","\u9F99","\u6F14","\u7236","\u6E10","\u8840","\u6B22","\u68B0","\u638C","\u6B4C","\u6C99","\u521A","\u653B","\u8C13","\u76FE","\u8BA8","\u665A","\u7C92","\u4E71","\u71C3","\u77DB","\u4E4E","\u6740","\u836F","\u5B81","\u9C81","\u8D35","\u949F","\u7164","\u8BFB","\u73ED","\u4F2F","\u9999","\u4ECB","\u8FEB","\u53E5","\u4E30","\u57F9","\u63E1","\u5170","\u62C5","\u5F26","\u86CB","\u6C89","\u5047","\u7A7F","\u6267","\u7B54","\u4E50","\u8C01","\u987A","\u70DF","\u7F29","\u5F81","\u8138","\u559C","\u677E","\u811A","\u56F0","\u5F02","\u514D","\u80CC","\u661F","\u798F","\u4E70","\u67D3","\u4E95","\u6982","\u6162","\u6015","\u78C1","\u500D","\u7956","\u7687","\u4FC3","\u9759","\u8865","\u8BC4","\u7FFB","\u8089","\u8DF5","\u5C3C","\u8863","\u5BBD","\u626C","\u68C9","\u5E0C","\u4F24","\u64CD","\u5782","\u79CB","\u5B9C","\u6C22","\u5957","\u7763","\u632F","\u67B6","\u4EAE","\u672B","\u5BAA","\u5E86","\u7F16","\u725B","\u89E6","\u6620","\u96F7","\u9500","\u8BD7","\u5EA7","\u5C45","\u6293","\u88C2","\u80DE","\u547C","\u5A18","\u666F","\u5A01","\u7EFF","\u6676","\u539A","\u76DF","\u8861","\u9E21","\u5B59","\u5EF6","\u5371","\u80F6","\u5C4B","\u4E61","\u4E34","\u9646","\u987E","\u6389","\u5440","\u706F","\u5C81","\u63AA","\u675F","\u8010","\u5267","\u7389","\u8D75","\u8DF3","\u54E5","\u5B63","\u8BFE","\u51EF","\u80E1","\u989D","\u6B3E","\u7ECD","\u5377","\u9F50","\u4F1F","\u84B8","\u6B96","\u6C38","\u5B97","\u82D7","\u5DDD","\u7089","\u5CA9","\u5F31","\u96F6","\u6768","\u594F","\u6CBF","\u9732","\u6746","\u63A2","\u6ED1","\u9547","\u996D","\u6D53","\u822A","\u6000","\u8D76","\u5E93","\u593A","\u4F0A","\u7075","\u7A0E","\u9014","\u706D","\u8D5B","\u5F52","\u53EC","\u9F13","\u64AD","\u76D8","\u88C1","\u9669","\u5EB7","\u552F","\u5F55","\u83CC","\u7EAF","\u501F","\u7CD6","\u76D6","\u6A2A","\u7B26","\u79C1","\u52AA","\u5802","\u57DF","\u67AA","\u6DA6","\u5E45","\u54C8","\u7ADF","\u719F","\u866B","\u6CFD","\u8111","\u58E4","\u78B3","\u6B27","\u904D","\u4FA7","\u5BE8","\u6562","\u5F7B","\u8651","\u659C","\u8584","\u5EAD","\u7EB3","\u5F39","\u9972","\u4F38","\u6298","\u9EA6","\u6E7F","\u6697","\u8377","\u74E6","\u585E","\u5E8A","\u7B51","\u6076","\u6237","\u8BBF","\u5854","\u5947","\u900F","\u6881","\u5200","\u65CB","\u8FF9","\u5361","\u6C2F","\u9047","\u4EFD","\u6BD2","\u6CE5","\u9000","\u6D17","\u6446","\u7070","\u5F69","\u5356","\u8017","\u590F","\u62E9","\u5FD9","\u94DC","\u732E","\u786C","\u4E88","\u7E41","\u5708","\u96EA","\u51FD","\u4EA6","\u62BD","\u7BC7","\u9635","\u9634","\u4E01","\u5C3A","\u8FFD","\u5806","\u96C4","\u8FCE","\u6CDB","\u7238","\u697C","\u907F","\u8C0B","\u5428","\u91CE","\u732A","\u65D7","\u7D2F","\u504F","\u5178","\u9986","\u7D22","\u79E6","\u8102","\u6F6E","\u7237","\u8C46","\u5FFD","\u6258","\u60CA","\u5851","\u9057","\u6108","\u6731","\u66FF","\u7EA4","\u7C97","\u503E","\u5C1A","\u75DB","\u695A","\u8C22","\u594B","\u8D2D","\u78E8","\u541B","\u6C60","\u65C1","\u788E","\u9AA8","\u76D1","\u6355","\u5F1F","\u66B4","\u5272","\u8D2F","\u6B8A","\u91CA","\u8BCD","\u4EA1","\u58C1","\u987F","\u5B9D","\u5348","\u5C18","\u95FB","\u63ED","\u70AE","\u6B8B","\u51AC","\u6865","\u5987","\u8B66","\u7EFC","\u62DB","\u5434","\u4ED8","\u6D6E","\u906D","\u5F90","\u60A8","\u6447","\u8C37","\u8D5E","\u7BB1","\u9694","\u8BA2","\u7537","\u5439","\u56ED","\u7EB7","\u5510","\u8D25","\u5B8B","\u73BB","\u5DE8","\u8015","\u5766","\u8363","\u95ED","\u6E7E","\u952E","\u51E1","\u9A7B","\u9505","\u6551","\u6069","\u5265","\u51DD","\u78B1","\u9F7F","\u622A","\u70BC","\u9EBB","\u7EBA","\u7981","\u5E9F","\u76DB","\u7248","\u7F13","\u51C0","\u775B","\u660C","\u5A5A","\u6D89","\u7B52","\u5634","\u63D2","\u5CB8","\u6717","\u5E84","\u8857","\u85CF","\u59D1","\u8D38","\u8150","\u5974","\u5566","\u60EF","\u4E58","\u4F19","\u6062","\u5300","\u7EB1","\u624E","\u8FA9","\u8033","\u5F6A","\u81E3","\u4EBF","\u7483","\u62B5","\u8109","\u79C0","\u8428","\u4FC4","\u7F51","\u821E","\u5E97","\u55B7","\u7EB5","\u5BF8","\u6C57","\u6302","\u6D2A","\u8D3A","\u95EA","\u67EC","\u7206","\u70EF","\u6D25","\u7A3B","\u5899","\u8F6F","\u52C7","\u50CF","\u6EDA","\u5398","\u8499","\u82B3","\u80AF","\u5761","\u67F1","\u8361","\u817F","\u4EEA","\u65C5","\u5C3E","\u8F67","\u51B0","\u8D21","\u767B","\u9ECE","\u524A","\u94BB","\u52D2","\u9003","\u969C","\u6C28","\u90ED","\u5CF0","\u5E01","\u6E2F","\u4F0F","\u8F68","\u4EA9","\u6BD5","\u64E6","\u83AB","\u523A","\u6D6A","\u79D8","\u63F4","\u682A","\u5065","\u552E","\u80A1","\u5C9B","\u7518","\u6CE1","\u7761","\u7AE5","\u94F8","\u6C64","\u9600","\u4F11","\u6C47","\u820D","\u7267","\u7ED5","\u70B8","\u54F2","\u78F7","\u7EE9","\u670B","\u6DE1","\u5C16","\u542F","\u9677","\u67F4","\u5448","\u5F92","\u989C","\u6CEA","\u7A0D","\u5FD8","\u6CF5","\u84DD","\u62D6","\u6D1E","\u6388","\u955C","\u8F9B","\u58EE","\u950B","\u8D2B","\u865A","\u5F2F","\u6469","\u6CF0","\u5E7C","\u5EF7","\u5C0A","\u7A97","\u7EB2","\u5F04","\u96B6","\u7591","\u6C0F","\u5BAB","\u59D0","\u9707","\u745E","\u602A","\u5C24","\u7434","\u5FAA","\u63CF","\u819C","\u8FDD","\u5939","\u8170","\u7F18","\u73E0","\u7A77","\u68EE","\u679D","\u7AF9","\u6C9F","\u50AC","\u7EF3","\u5FC6","\u90A6","\u5269","\u5E78","\u6D46","\u680F","\u62E5","\u7259","\u8D2E","\u793C","\u6EE4","\u94A0","\u7EB9","\u7F62","\u62CD","\u54B1","\u558A","\u8896","\u57C3","\u52E4","\u7F5A","\u7126","\u6F5C","\u4F0D","\u58A8","\u6B32","\u7F1D","\u59D3","\u520A","\u9971","\u4EFF","\u5956","\u94DD","\u9B3C","\u4E3D","\u8DE8","\u9ED8","\u6316","\u94FE","\u626B","\u559D","\u888B","\u70AD","\u6C61","\u5E55","\u8BF8","\u5F27","\u52B1","\u6885","\u5976","\u6D01","\u707E","\u821F","\u9274","\u82EF","\u8BBC","\u62B1","\u6BC1","\u61C2","\u5BD2","\u667A","\u57D4","\u5BC4","\u5C4A","\u8DC3","\u6E21","\u6311","\u4E39","\u8270","\u8D1D","\u78B0","\u62D4","\u7239","\u6234","\u7801","\u68A6","\u82BD","\u7194","\u8D64","\u6E14","\u54ED","\u656C","\u9897","\u5954","\u94C5","\u4EF2","\u864E","\u7A00","\u59B9","\u4E4F","\u73CD","\u7533","\u684C","\u9075","\u5141","\u9686","\u87BA","\u4ED3","\u9B4F","\u9510","\u6653","\u6C2E","\u517C","\u9690","\u788D","\u8D6B","\u62E8","\u5FE0","\u8083","\u7F38","\u7275","\u62A2","\u535A","\u5DE7","\u58F3","\u5144","\u675C","\u8BAF","\u8BDA","\u78A7","\u7965","\u67EF","\u9875","\u5DE1","\u77E9","\u60B2","\u704C","\u9F84","\u4F26","\u7968","\u5BFB","\u6842","\u94FA","\u5723","\u6050","\u6070","\u90D1","\u8DA3","\u62AC","\u8352","\u817E","\u8D34","\u67D4","\u6EF4","\u731B","\u9614","\u8F86","\u59BB","\u586B","\u64A4","\u50A8","\u7B7E","\u95F9","\u6270","\u7D2B","\u7802","\u9012","\u620F","\u540A","\u9676","\u4F10","\u5582","\u7597","\u74F6","\u5A46","\u629A","\u81C2","\u6478","\u5FCD","\u867E","\u8721","\u90BB","\u80F8","\u5DE9","\u6324","\u5076","\u5F03","\u69FD","\u52B2","\u4E73","\u9093","\u5409","\u4EC1","\u70C2","\u7816","\u79DF","\u4E4C","\u8230","\u4F34","\u74DC","\u6D45","\u4E19","\u6682","\u71E5","\u6A61","\u67F3","\u8FF7","\u6696","\u724C","\u79E7","\u80C6","\u8BE6","\u7C27","\u8E0F","\u74F7","\u8C31","\u5446","\u5BBE","\u7CCA","\u6D1B","\u8F89","\u6124","\u7ADE","\u9699","\u6012","\u7C98","\u4E43","\u7EEA","\u80A9","\u7C4D","\u654F","\u6D82","\u7199","\u7686","\u4FA6","\u60AC","\u6398","\u4EAB","\u7EA0","\u9192","\u72C2","\u9501","\u6DC0","\u6068","\u7272","\u9738","\u722C","\u8D4F","\u9006","\u73A9","\u9675","\u795D","\u79D2","\u6D59","\u8C8C","\u5F79","\u5F7C","\u6089","\u9E2D","\u8D8B","\u51E4","\u6668","\u755C","\u8F88","\u79E9","\u5375","\u7F72","\u68AF","\u708E","\u6EE9","\u68CB","\u9A71","\u7B5B","\u5CE1","\u5192","\u5565","\u5BFF","\u8BD1","\u6D78","\u6CC9","\u5E3D","\u8FDF","\u7845","\u7586","\u8D37","\u6F0F","\u7A3F","\u51A0","\u5AE9","\u80C1","\u82AF","\u7262","\u53DB","\u8680","\u5965","\u9E23","\u5CAD","\u7F8A","\u51ED","\u4E32","\u5858","\u7ED8","\u9175","\u878D","\u76C6","\u9521","\u5E99","\u7B79","\u51BB","\u8F85","\u6444","\u88AD","\u7B4B","\u62D2","\u50DA","\u65F1","\u94BE","\u9E1F","\u6F06","\u6C88","\u7709","\u758F","\u6DFB","\u68D2","\u7A57","\u785D","\u97E9","\u903C","\u626D","\u4FA8","\u51C9","\u633A","\u7897","\u683D","\u7092","\u676F","\u60A3","\u998F","\u529D","\u8C6A","\u8FBD","\u52C3","\u9E3F","\u65E6","\u540F","\u62DC","\u72D7","\u57CB","\u8F8A","\u63A9","\u996E","\u642C","\u9A82","\u8F9E","\u52FE","\u6263","\u4F30","\u848B","\u7ED2","\u96FE","\u4E08","\u6735","\u59C6","\u62DF","\u5B87","\u8F91","\u9655","\u96D5","\u507F","\u84C4","\u5D07","\u526A","\u5021","\u5385","\u54AC","\u9A76","\u85AF","\u5237","\u65A5","\u756A","\u8D4B","\u5949","\u4F5B","\u6D47","\u6F2B","\u66FC","\u6247","\u9499","\u6843","\u6276","\u4ED4","\u8FD4","\u4FD7","\u4E8F","\u8154","\u978B","\u68F1","\u8986","\u6846","\u6084","\u53D4","\u649E","\u9A97","\u52D8","\u65FA","\u6CB8","\u5B64","\u5410","\u5B5F","\u6E20","\u5C48","\u75BE","\u5999","\u60DC","\u4EF0","\u72E0","\u80C0","\u8C10","\u629B","\u9709","\u6851","\u5C97","\u561B","\u8870","\u76D7","\u6E17","\u810F","\u8D56","\u6D8C","\u751C","\u66F9","\u9605","\u808C","\u54E9","\u5389","\u70C3","\u7EAC","\u6BC5","\u6628","\u4F2A","\u75C7","\u716E","\u53F9","\u9489","\u642D","\u830E","\u7B3C","\u9177","\u5077","\u5F13","\u9525","\u6052","\u6770","\u5751","\u9F3B","\u7FFC","\u7EB6","\u53D9","\u72F1","\u902E","\u7F50","\u7EDC","\u68DA","\u6291","\u81A8","\u852C","\u5BFA","\u9AA4","\u7A46","\u51B6","\u67AF","\u518C","\u5C38","\u51F8","\u7EC5","\u576F","\u727A","\u7130","\u8F70","\u6B23","\u664B","\u7626","\u5FA1","\u952D","\u9526","\u4E27","\u65EC","\u953B","\u5784","\u641C","\u6251","\u9080","\u4EAD","\u916F","\u8FC8","\u8212","\u8106","\u9176","\u95F2","\u5FE7","\u915A","\u987D","\u7FBD","\u6DA8","\u5378","\u4ED7","\u966A","\u8F9F","\u60E9","\u676D","\u59DA","\u809A","\u6349","\u98D8","\u6F02","\u6606","\u6B3A","\u543E","\u90CE","\u70F7","\u6C41","\u5475","\u9970","\u8427","\u96C5","\u90AE","\u8FC1","\u71D5","\u6492","\u59FB","\u8D74","\u5BB4","\u70E6","\u503A","\u5E10","\u6591","\u94C3","\u65E8","\u9187","\u8463","\u997C","\u96CF","\u59FF","\u62CC","\u5085","\u8179","\u59A5","\u63C9","\u8D24","\u62C6","\u6B6A","\u8461","\u80FA","\u4E22","\u6D69","\u5FBD","\u6602","\u57AB","\u6321","\u89C8","\u8D2A","\u6170","\u7F34","\u6C6A","\u614C","\u51AF","\u8BFA","\u59DC","\u8C0A","\u51F6","\u52A3","\u8BEC","\u8000","\u660F","\u8EBA","\u76C8","\u9A91","\u4E54","\u6EAA","\u4E1B","\u5362","\u62B9","\u95F7","\u54A8","\u522E","\u9A7E","\u7F06","\u609F","\u6458","\u94D2","\u63B7","\u9887","\u5E7B","\u67C4","\u60E0","\u60E8","\u4F73","\u4EC7","\u814A","\u7A9D","\u6DA4","\u5251","\u77A7","\u5821","\u6CFC","\u8471","\u7F69","\u970D","\u635E","\u80CE","\u82CD","\u6EE8","\u4FE9","\u6345","\u6E58","\u780D","\u971E","\u90B5","\u8404","\u75AF","\u6DEE","\u9042","\u718A","\u7CAA","\u70D8","\u5BBF","\u6863","\u6208","\u9A73","\u5AC2","\u88D5","\u5F99","\u7BAD","\u6350","\u80A0","\u6491","\u6652","\u8FA8","\u6BBF","\u83B2","\u644A","\u6405","\u9171","\u5C4F","\u75AB","\u54C0","\u8521","\u5835","\u6CAB","\u76B1","\u7545","\u53E0","\u9601","\u83B1","\u6572","\u8F96","\u94A9","\u75D5","\u575D","\u5DF7","\u997F","\u7978","\u4E18","\u7384","\u6E9C","\u66F0","\u903B","\u5F6D","\u5C1D","\u537F","\u59A8","\u8247","\u541E","\u97E6","\u6028","\u77EE","\u6B47"];eM.exports=Mre});var iM=k((n5e,rM)=>{"use strict";v();var Nre=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];rM.exports=Nre});var oM=k((a5e,nM)=>{"use string";v();var Cre=["abaisser","abandon","abdiquer","abeille","abolir","aborder","aboutir","aboyer","abrasif","abreuver","abriter","abroger","abrupt","absence","absolu","absurde","abusif","abyssal","acade\u0301mie","acajou","acarien","accabler","accepter","acclamer","accolade","accroche","accuser","acerbe","achat","acheter","aciduler","acier","acompte","acque\u0301rir","acronyme","acteur","actif","actuel","adepte","ade\u0301quat","adhe\u0301sif","adjectif","adjuger","admettre","admirer","adopter","adorer","adoucir","adresse","adroit","adulte","adverbe","ae\u0301rer","ae\u0301ronef","affaire","affecter","affiche","affreux","affubler","agacer","agencer","agile","agiter","agrafer","agre\u0301able","agrume","aider","aiguille","ailier","aimable","aisance","ajouter","ajuster","alarmer","alchimie","alerte","alge\u0300bre","algue","alie\u0301ner","aliment","alle\u0301ger","alliage","allouer","allumer","alourdir","alpaga","altesse","alve\u0301ole","amateur","ambigu","ambre","ame\u0301nager","amertume","amidon","amiral","amorcer","amour","amovible","amphibie","ampleur","amusant","analyse","anaphore","anarchie","anatomie","ancien","ane\u0301antir","angle","angoisse","anguleux","animal","annexer","annonce","annuel","anodin","anomalie","anonyme","anormal","antenne","antidote","anxieux","apaiser","ape\u0301ritif","aplanir","apologie","appareil","appeler","apporter","appuyer","aquarium","aqueduc","arbitre","arbuste","ardeur","ardoise","argent","arlequin","armature","armement","armoire","armure","arpenter","arracher","arriver","arroser","arsenic","arte\u0301riel","article","aspect","asphalte","aspirer","assaut","asservir","assiette","associer","assurer","asticot","astre","astuce","atelier","atome","atrium","atroce","attaque","attentif","attirer","attraper","aubaine","auberge","audace","audible","augurer","aurore","automne","autruche","avaler","avancer","avarice","avenir","averse","aveugle","aviateur","avide","avion","aviser","avoine","avouer","avril","axial","axiome","badge","bafouer","bagage","baguette","baignade","balancer","balcon","baleine","balisage","bambin","bancaire","bandage","banlieue","bannie\u0300re","banquier","barbier","baril","baron","barque","barrage","bassin","bastion","bataille","bateau","batterie","baudrier","bavarder","belette","be\u0301lier","belote","be\u0301ne\u0301fice","berceau","berger","berline","bermuda","besace","besogne","be\u0301tail","beurre","biberon","bicycle","bidule","bijou","bilan","bilingue","billard","binaire","biologie","biopsie","biotype","biscuit","bison","bistouri","bitume","bizarre","blafard","blague","blanchir","blessant","blinder","blond","bloquer","blouson","bobard","bobine","boire","boiser","bolide","bonbon","bondir","bonheur","bonifier","bonus","bordure","borne","botte","boucle","boueux","bougie","boulon","bouquin","bourse","boussole","boutique","boxeur","branche","brasier","brave","brebis","bre\u0300che","breuvage","bricoler","brigade","brillant","brioche","brique","brochure","broder","bronzer","brousse","broyeur","brume","brusque","brutal","bruyant","buffle","buisson","bulletin","bureau","burin","bustier","butiner","butoir","buvable","buvette","cabanon","cabine","cachette","cadeau","cadre","cafe\u0301ine","caillou","caisson","calculer","calepin","calibre","calmer","calomnie","calvaire","camarade","came\u0301ra","camion","campagne","canal","caneton","canon","cantine","canular","capable","caporal","caprice","capsule","capter","capuche","carabine","carbone","caresser","caribou","carnage","carotte","carreau","carton","cascade","casier","casque","cassure","causer","caution","cavalier","caverne","caviar","ce\u0301dille","ceinture","ce\u0301leste","cellule","cendrier","censurer","central","cercle","ce\u0301re\u0301bral","cerise","cerner","cerveau","cesser","chagrin","chaise","chaleur","chambre","chance","chapitre","charbon","chasseur","chaton","chausson","chavirer","chemise","chenille","che\u0301quier","chercher","cheval","chien","chiffre","chignon","chime\u0300re","chiot","chlorure","chocolat","choisir","chose","chouette","chrome","chute","cigare","cigogne","cimenter","cine\u0301ma","cintrer","circuler","cirer","cirque","citerne","citoyen","citron","civil","clairon","clameur","claquer","classe","clavier","client","cligner","climat","clivage","cloche","clonage","cloporte","cobalt","cobra","cocasse","cocotier","coder","codifier","coffre","cogner","cohe\u0301sion","coiffer","coincer","cole\u0300re","colibri","colline","colmater","colonel","combat","come\u0301die","commande","compact","concert","conduire","confier","congeler","connoter","consonne","contact","convexe","copain","copie","corail","corbeau","cordage","corniche","corpus","correct","corte\u0300ge","cosmique","costume","coton","coude","coupure","courage","couteau","couvrir","coyote","crabe","crainte","cravate","crayon","cre\u0301ature","cre\u0301diter","cre\u0301meux","creuser","crevette","cribler","crier","cristal","crite\u0300re","croire","croquer","crotale","crucial","cruel","crypter","cubique","cueillir","cuille\u0300re","cuisine","cuivre","culminer","cultiver","cumuler","cupide","curatif","curseur","cyanure","cycle","cylindre","cynique","daigner","damier","danger","danseur","dauphin","de\u0301battre","de\u0301biter","de\u0301border","de\u0301brider","de\u0301butant","de\u0301caler","de\u0301cembre","de\u0301chirer","de\u0301cider","de\u0301clarer","de\u0301corer","de\u0301crire","de\u0301cupler","de\u0301dale","de\u0301ductif","de\u0301esse","de\u0301fensif","de\u0301filer","de\u0301frayer","de\u0301gager","de\u0301givrer","de\u0301glutir","de\u0301grafer","de\u0301jeuner","de\u0301lice","de\u0301loger","demander","demeurer","de\u0301molir","de\u0301nicher","de\u0301nouer","dentelle","de\u0301nuder","de\u0301part","de\u0301penser","de\u0301phaser","de\u0301placer","de\u0301poser","de\u0301ranger","de\u0301rober","de\u0301sastre","descente","de\u0301sert","de\u0301signer","de\u0301sobe\u0301ir","dessiner","destrier","de\u0301tacher","de\u0301tester","de\u0301tourer","de\u0301tresse","devancer","devenir","deviner","devoir","diable","dialogue","diamant","dicter","diffe\u0301rer","dige\u0301rer","digital","digne","diluer","dimanche","diminuer","dioxyde","directif","diriger","discuter","disposer","dissiper","distance","divertir","diviser","docile","docteur","dogme","doigt","domaine","domicile","dompter","donateur","donjon","donner","dopamine","dortoir","dorure","dosage","doseur","dossier","dotation","douanier","double","douceur","douter","doyen","dragon","draper","dresser","dribbler","droiture","duperie","duplexe","durable","durcir","dynastie","e\u0301blouir","e\u0301carter","e\u0301charpe","e\u0301chelle","e\u0301clairer","e\u0301clipse","e\u0301clore","e\u0301cluse","e\u0301cole","e\u0301conomie","e\u0301corce","e\u0301couter","e\u0301craser","e\u0301cre\u0301mer","e\u0301crivain","e\u0301crou","e\u0301cume","e\u0301cureuil","e\u0301difier","e\u0301duquer","effacer","effectif","effigie","effort","effrayer","effusion","e\u0301galiser","e\u0301garer","e\u0301jecter","e\u0301laborer","e\u0301largir","e\u0301lectron","e\u0301le\u0301gant","e\u0301le\u0301phant","e\u0301le\u0300ve","e\u0301ligible","e\u0301litisme","e\u0301loge","e\u0301lucider","e\u0301luder","emballer","embellir","embryon","e\u0301meraude","e\u0301mission","emmener","e\u0301motion","e\u0301mouvoir","empereur","employer","emporter","emprise","e\u0301mulsion","encadrer","enche\u0300re","enclave","encoche","endiguer","endosser","endroit","enduire","e\u0301nergie","enfance","enfermer","enfouir","engager","engin","englober","e\u0301nigme","enjamber","enjeu","enlever","ennemi","ennuyeux","enrichir","enrobage","enseigne","entasser","entendre","entier","entourer","entraver","e\u0301nume\u0301rer","envahir","enviable","envoyer","enzyme","e\u0301olien","e\u0301paissir","e\u0301pargne","e\u0301patant","e\u0301paule","e\u0301picerie","e\u0301pide\u0301mie","e\u0301pier","e\u0301pilogue","e\u0301pine","e\u0301pisode","e\u0301pitaphe","e\u0301poque","e\u0301preuve","e\u0301prouver","e\u0301puisant","e\u0301querre","e\u0301quipe","e\u0301riger","e\u0301rosion","erreur","e\u0301ruption","escalier","espadon","espe\u0300ce","espie\u0300gle","espoir","esprit","esquiver","essayer","essence","essieu","essorer","estime","estomac","estrade","e\u0301tage\u0300re","e\u0301taler","e\u0301tanche","e\u0301tatique","e\u0301teindre","e\u0301tendoir","e\u0301ternel","e\u0301thanol","e\u0301thique","ethnie","e\u0301tirer","e\u0301toffer","e\u0301toile","e\u0301tonnant","e\u0301tourdir","e\u0301trange","e\u0301troit","e\u0301tude","euphorie","e\u0301valuer","e\u0301vasion","e\u0301ventail","e\u0301vidence","e\u0301viter","e\u0301volutif","e\u0301voquer","exact","exage\u0301rer","exaucer","exceller","excitant","exclusif","excuse","exe\u0301cuter","exemple","exercer","exhaler","exhorter","exigence","exiler","exister","exotique","expe\u0301dier","explorer","exposer","exprimer","exquis","extensif","extraire","exulter","fable","fabuleux","facette","facile","facture","faiblir","falaise","fameux","famille","farceur","farfelu","farine","farouche","fasciner","fatal","fatigue","faucon","fautif","faveur","favori","fe\u0301brile","fe\u0301conder","fe\u0301de\u0301rer","fe\u0301lin","femme","fe\u0301mur","fendoir","fe\u0301odal","fermer","fe\u0301roce","ferveur","festival","feuille","feutre","fe\u0301vrier","fiasco","ficeler","fictif","fide\u0300le","figure","filature","filetage","filie\u0300re","filleul","filmer","filou","filtrer","financer","finir","fiole","firme","fissure","fixer","flairer","flamme","flasque","flatteur","fle\u0301au","fle\u0300che","fleur","flexion","flocon","flore","fluctuer","fluide","fluvial","folie","fonderie","fongible","fontaine","forcer","forgeron","formuler","fortune","fossile","foudre","fouge\u0300re","fouiller","foulure","fourmi","fragile","fraise","franchir","frapper","frayeur","fre\u0301gate","freiner","frelon","fre\u0301mir","fre\u0301ne\u0301sie","fre\u0300re","friable","friction","frisson","frivole","froid","fromage","frontal","frotter","fruit","fugitif","fuite","fureur","furieux","furtif","fusion","futur","gagner","galaxie","galerie","gambader","garantir","gardien","garnir","garrigue","gazelle","gazon","ge\u0301ant","ge\u0301latine","ge\u0301lule","gendarme","ge\u0301ne\u0301ral","ge\u0301nie","genou","gentil","ge\u0301ologie","ge\u0301ome\u0300tre","ge\u0301ranium","germe","gestuel","geyser","gibier","gicler","girafe","givre","glace","glaive","glisser","globe","gloire","glorieux","golfeur","gomme","gonfler","gorge","gorille","goudron","gouffre","goulot","goupille","gourmand","goutte","graduel","graffiti","graine","grand","grappin","gratuit","gravir","grenat","griffure","griller","grimper","grogner","gronder","grotte","groupe","gruger","grutier","gruye\u0300re","gue\u0301pard","guerrier","guide","guimauve","guitare","gustatif","gymnaste","gyrostat","habitude","hachoir","halte","hameau","hangar","hanneton","haricot","harmonie","harpon","hasard","he\u0301lium","he\u0301matome","herbe","he\u0301risson","hermine","he\u0301ron","he\u0301siter","heureux","hiberner","hibou","hilarant","histoire","hiver","homard","hommage","homoge\u0300ne","honneur","honorer","honteux","horde","horizon","horloge","hormone","horrible","houleux","housse","hublot","huileux","humain","humble","humide","humour","hurler","hydromel","hygie\u0300ne","hymne","hypnose","idylle","ignorer","iguane","illicite","illusion","image","imbiber","imiter","immense","immobile","immuable","impact","impe\u0301rial","implorer","imposer","imprimer","imputer","incarner","incendie","incident","incliner","incolore","indexer","indice","inductif","ine\u0301dit","ineptie","inexact","infini","infliger","informer","infusion","inge\u0301rer","inhaler","inhiber","injecter","injure","innocent","inoculer","inonder","inscrire","insecte","insigne","insolite","inspirer","instinct","insulter","intact","intense","intime","intrigue","intuitif","inutile","invasion","inventer","inviter","invoquer","ironique","irradier","irre\u0301el","irriter","isoler","ivoire","ivresse","jaguar","jaillir","jambe","janvier","jardin","jauger","jaune","javelot","jetable","jeton","jeudi","jeunesse","joindre","joncher","jongler","joueur","jouissif","journal","jovial","joyau","joyeux","jubiler","jugement","junior","jupon","juriste","justice","juteux","juve\u0301nile","kayak","kimono","kiosque","label","labial","labourer","lace\u0301rer","lactose","lagune","laine","laisser","laitier","lambeau","lamelle","lampe","lanceur","langage","lanterne","lapin","largeur","larme","laurier","lavabo","lavoir","lecture","le\u0301gal","le\u0301ger","le\u0301gume","lessive","lettre","levier","lexique","le\u0301zard","liasse","libe\u0301rer","libre","licence","licorne","lie\u0300ge","lie\u0300vre","ligature","ligoter","ligue","limer","limite","limonade","limpide","line\u0301aire","lingot","lionceau","liquide","lisie\u0300re","lister","lithium","litige","littoral","livreur","logique","lointain","loisir","lombric","loterie","louer","lourd","loutre","louve","loyal","lubie","lucide","lucratif","lueur","lugubre","luisant","lumie\u0300re","lunaire","lundi","luron","lutter","luxueux","machine","magasin","magenta","magique","maigre","maillon","maintien","mairie","maison","majorer","malaxer","male\u0301fice","malheur","malice","mallette","mammouth","mandater","maniable","manquant","manteau","manuel","marathon","marbre","marchand","mardi","maritime","marqueur","marron","marteler","mascotte","massif","mate\u0301riel","matie\u0300re","matraque","maudire","maussade","mauve","maximal","me\u0301chant","me\u0301connu","me\u0301daille","me\u0301decin","me\u0301diter","me\u0301duse","meilleur","me\u0301lange","me\u0301lodie","membre","me\u0301moire","menacer","mener","menhir","mensonge","mentor","mercredi","me\u0301rite","merle","messager","mesure","me\u0301tal","me\u0301te\u0301ore","me\u0301thode","me\u0301tier","meuble","miauler","microbe","miette","mignon","migrer","milieu","million","mimique","mince","mine\u0301ral","minimal","minorer","minute","miracle","miroiter","missile","mixte","mobile","moderne","moelleux","mondial","moniteur","monnaie","monotone","monstre","montagne","monument","moqueur","morceau","morsure","mortier","moteur","motif","mouche","moufle","moulin","mousson","mouton","mouvant","multiple","munition","muraille","mure\u0300ne","murmure","muscle","muse\u0301um","musicien","mutation","muter","mutuel","myriade","myrtille","myste\u0300re","mythique","nageur","nappe","narquois","narrer","natation","nation","nature","naufrage","nautique","navire","ne\u0301buleux","nectar","ne\u0301faste","ne\u0301gation","ne\u0301gliger","ne\u0301gocier","neige","nerveux","nettoyer","neurone","neutron","neveu","niche","nickel","nitrate","niveau","noble","nocif","nocturne","noirceur","noisette","nomade","nombreux","nommer","normatif","notable","notifier","notoire","nourrir","nouveau","novateur","novembre","novice","nuage","nuancer","nuire","nuisible","nume\u0301ro","nuptial","nuque","nutritif","obe\u0301ir","objectif","obliger","obscur","observer","obstacle","obtenir","obturer","occasion","occuper","oce\u0301an","octobre","octroyer","octupler","oculaire","odeur","odorant","offenser","officier","offrir","ogive","oiseau","oisillon","olfactif","olivier","ombrage","omettre","onctueux","onduler","one\u0301reux","onirique","opale","opaque","ope\u0301rer","opinion","opportun","opprimer","opter","optique","orageux","orange","orbite","ordonner","oreille","organe","orgueil","orifice","ornement","orque","ortie","osciller","osmose","ossature","otarie","ouragan","ourson","outil","outrager","ouvrage","ovation","oxyde","oxyge\u0300ne","ozone","paisible","palace","palmare\u0300s","palourde","palper","panache","panda","pangolin","paniquer","panneau","panorama","pantalon","papaye","papier","papoter","papyrus","paradoxe","parcelle","paresse","parfumer","parler","parole","parrain","parsemer","partager","parure","parvenir","passion","paste\u0300que","paternel","patience","patron","pavillon","pavoiser","payer","paysage","peigne","peintre","pelage","pe\u0301lican","pelle","pelouse","peluche","pendule","pe\u0301ne\u0301trer","pe\u0301nible","pensif","pe\u0301nurie","pe\u0301pite","pe\u0301plum","perdrix","perforer","pe\u0301riode","permuter","perplexe","persil","perte","peser","pe\u0301tale","petit","pe\u0301trir","peuple","pharaon","phobie","phoque","photon","phrase","physique","piano","pictural","pie\u0300ce","pierre","pieuvre","pilote","pinceau","pipette","piquer","pirogue","piscine","piston","pivoter","pixel","pizza","placard","plafond","plaisir","planer","plaque","plastron","plateau","pleurer","plexus","pliage","plomb","plonger","pluie","plumage","pochette","poe\u0301sie","poe\u0300te","pointe","poirier","poisson","poivre","polaire","policier","pollen","polygone","pommade","pompier","ponctuel","ponde\u0301rer","poney","portique","position","posse\u0301der","posture","potager","poteau","potion","pouce","poulain","poumon","pourpre","poussin","pouvoir","prairie","pratique","pre\u0301cieux","pre\u0301dire","pre\u0301fixe","pre\u0301lude","pre\u0301nom","pre\u0301sence","pre\u0301texte","pre\u0301voir","primitif","prince","prison","priver","proble\u0300me","proce\u0301der","prodige","profond","progre\u0300s","proie","projeter","prologue","promener","propre","prospe\u0300re","prote\u0301ger","prouesse","proverbe","prudence","pruneau","psychose","public","puceron","puiser","pulpe","pulsar","punaise","punitif","pupitre","purifier","puzzle","pyramide","quasar","querelle","question","quie\u0301tude","quitter","quotient","racine","raconter","radieux","ragondin","raideur","raisin","ralentir","rallonge","ramasser","rapide","rasage","ratisser","ravager","ravin","rayonner","re\u0301actif","re\u0301agir","re\u0301aliser","re\u0301animer","recevoir","re\u0301citer","re\u0301clamer","re\u0301colter","recruter","reculer","recycler","re\u0301diger","redouter","refaire","re\u0301flexe","re\u0301former","refrain","refuge","re\u0301galien","re\u0301gion","re\u0301glage","re\u0301gulier","re\u0301ite\u0301rer","rejeter","rejouer","relatif","relever","relief","remarque","reme\u0300de","remise","remonter","remplir","remuer","renard","renfort","renifler","renoncer","rentrer","renvoi","replier","reporter","reprise","reptile","requin","re\u0301serve","re\u0301sineux","re\u0301soudre","respect","rester","re\u0301sultat","re\u0301tablir","retenir","re\u0301ticule","retomber","retracer","re\u0301union","re\u0301ussir","revanche","revivre","re\u0301volte","re\u0301vulsif","richesse","rideau","rieur","rigide","rigoler","rincer","riposter","risible","risque","rituel","rival","rivie\u0300re","rocheux","romance","rompre","ronce","rondin","roseau","rosier","rotatif","rotor","rotule","rouge","rouille","rouleau","routine","royaume","ruban","rubis","ruche","ruelle","rugueux","ruiner","ruisseau","ruser","rustique","rythme","sabler","saboter","sabre","sacoche","safari","sagesse","saisir","salade","salive","salon","saluer","samedi","sanction","sanglier","sarcasme","sardine","saturer","saugrenu","saumon","sauter","sauvage","savant","savonner","scalpel","scandale","sce\u0301le\u0301rat","sce\u0301nario","sceptre","sche\u0301ma","science","scinder","score","scrutin","sculpter","se\u0301ance","se\u0301cable","se\u0301cher","secouer","se\u0301cre\u0301ter","se\u0301datif","se\u0301duire","seigneur","se\u0301jour","se\u0301lectif","semaine","sembler","semence","se\u0301minal","se\u0301nateur","sensible","sentence","se\u0301parer","se\u0301quence","serein","sergent","se\u0301rieux","serrure","se\u0301rum","service","se\u0301same","se\u0301vir","sevrage","sextuple","side\u0301ral","sie\u0300cle","sie\u0301ger","siffler","sigle","signal","silence","silicium","simple","since\u0300re","sinistre","siphon","sirop","sismique","situer","skier","social","socle","sodium","soigneux","soldat","soleil","solitude","soluble","sombre","sommeil","somnoler","sonde","songeur","sonnette","sonore","sorcier","sortir","sosie","sottise","soucieux","soudure","souffle","soulever","soupape","source","soutirer","souvenir","spacieux","spatial","spe\u0301cial","sphe\u0300re","spiral","stable","station","sternum","stimulus","stipuler","strict","studieux","stupeur","styliste","sublime","substrat","subtil","subvenir","succe\u0300s","sucre","suffixe","sugge\u0301rer","suiveur","sulfate","superbe","supplier","surface","suricate","surmener","surprise","sursaut","survie","suspect","syllabe","symbole","syme\u0301trie","synapse","syntaxe","syste\u0300me","tabac","tablier","tactile","tailler","talent","talisman","talonner","tambour","tamiser","tangible","tapis","taquiner","tarder","tarif","tartine","tasse","tatami","tatouage","taupe","taureau","taxer","te\u0301moin","temporel","tenaille","tendre","teneur","tenir","tension","terminer","terne","terrible","te\u0301tine","texte","the\u0300me","the\u0301orie","the\u0301rapie","thorax","tibia","tie\u0300de","timide","tirelire","tiroir","tissu","titane","titre","tituber","toboggan","tole\u0301rant","tomate","tonique","tonneau","toponyme","torche","tordre","tornade","torpille","torrent","torse","tortue","totem","toucher","tournage","tousser","toxine","traction","trafic","tragique","trahir","train","trancher","travail","tre\u0300fle","tremper","tre\u0301sor","treuil","triage","tribunal","tricoter","trilogie","triomphe","tripler","triturer","trivial","trombone","tronc","tropical","troupeau","tuile","tulipe","tumulte","tunnel","turbine","tuteur","tutoyer","tuyau","tympan","typhon","typique","tyran","ubuesque","ultime","ultrason","unanime","unifier","union","unique","unitaire","univers","uranium","urbain","urticant","usage","usine","usuel","usure","utile","utopie","vacarme","vaccin","vagabond","vague","vaillant","vaincre","vaisseau","valable","valise","vallon","valve","vampire","vanille","vapeur","varier","vaseux","vassal","vaste","vecteur","vedette","ve\u0301ge\u0301tal","ve\u0301hicule","veinard","ve\u0301loce","vendredi","ve\u0301ne\u0301rer","venger","venimeux","ventouse","verdure","ve\u0301rin","vernir","verrou","verser","vertu","veston","ve\u0301te\u0301ran","ve\u0301tuste","vexant","vexer","viaduc","viande","victoire","vidange","vide\u0301o","vignette","vigueur","vilain","village","vinaigre","violon","vipe\u0300re","virement","virtuose","virus","visage","viseur","vision","visqueux","visuel","vital","vitesse","viticole","vitrine","vivace","vivipare","vocation","voguer","voile","voisin","voiture","volaille","volcan","voltiger","volume","vorace","vortex","voter","vouloir","voyage","voyelle","wagon","xe\u0301non","yacht","ze\u0300bre","ze\u0301nith","zeste","zoologie"];nM.exports=Cre});var sM=k((u5e,aM)=>{"use strict";v();var Dre=["abaco","abbaglio","abbinato","abete","abisso","abolire","abrasivo","abrogato","accadere","accenno","accusato","acetone","achille","acido","acqua","acre","acrilico","acrobata","acuto","adagio","addebito","addome","adeguato","aderire","adipe","adottare","adulare","affabile","affetto","affisso","affranto","aforisma","afoso","africano","agave","agente","agevole","aggancio","agire","agitare","agonismo","agricolo","agrumeto","aguzzo","alabarda","alato","albatro","alberato","albo","albume","alce","alcolico","alettone","alfa","algebra","aliante","alibi","alimento","allagato","allegro","allievo","allodola","allusivo","almeno","alogeno","alpaca","alpestre","altalena","alterno","alticcio","altrove","alunno","alveolo","alzare","amalgama","amanita","amarena","ambito","ambrato","ameba","america","ametista","amico","ammasso","ammenda","ammirare","ammonito","amore","ampio","ampliare","amuleto","anacardo","anagrafe","analista","anarchia","anatra","anca","ancella","ancora","andare","andrea","anello","angelo","angolare","angusto","anima","annegare","annidato","anno","annuncio","anonimo","anticipo","anzi","apatico","apertura","apode","apparire","appetito","appoggio","approdo","appunto","aprile","arabica","arachide","aragosta","araldica","arancio","aratura","arazzo","arbitro","archivio","ardito","arenile","argento","argine","arguto","aria","armonia","arnese","arredato","arringa","arrosto","arsenico","arso","artefice","arzillo","asciutto","ascolto","asepsi","asettico","asfalto","asino","asola","aspirato","aspro","assaggio","asse","assoluto","assurdo","asta","astenuto","astice","astratto","atavico","ateismo","atomico","atono","attesa","attivare","attorno","attrito","attuale","ausilio","austria","autista","autonomo","autunno","avanzato","avere","avvenire","avviso","avvolgere","azione","azoto","azzimo","azzurro","babele","baccano","bacino","baco","badessa","badilata","bagnato","baita","balcone","baldo","balena","ballata","balzano","bambino","bandire","baraonda","barbaro","barca","baritono","barlume","barocco","basilico","basso","batosta","battuto","baule","bava","bavosa","becco","beffa","belgio","belva","benda","benevole","benigno","benzina","bere","berlina","beta","bibita","bici","bidone","bifido","biga","bilancia","bimbo","binocolo","biologo","bipede","bipolare","birbante","birra","biscotto","bisesto","bisnonno","bisonte","bisturi","bizzarro","blando","blatta","bollito","bonifico","bordo","bosco","botanico","bottino","bozzolo","braccio","bradipo","brama","branca","bravura","bretella","brevetto","brezza","briglia","brillante","brindare","broccolo","brodo","bronzina","brullo","bruno","bubbone","buca","budino","buffone","buio","bulbo","buono","burlone","burrasca","bussola","busta","cadetto","caduco","calamaro","calcolo","calesse","calibro","calmo","caloria","cambusa","camerata","camicia","cammino","camola","campale","canapa","candela","cane","canino","canotto","cantina","capace","capello","capitolo","capogiro","cappero","capra","capsula","carapace","carcassa","cardo","carisma","carovana","carretto","cartolina","casaccio","cascata","caserma","caso","cassone","castello","casuale","catasta","catena","catrame","cauto","cavillo","cedibile","cedrata","cefalo","celebre","cellulare","cena","cenone","centesimo","ceramica","cercare","certo","cerume","cervello","cesoia","cespo","ceto","chela","chiaro","chicca","chiedere","chimera","china","chirurgo","chitarra","ciao","ciclismo","cifrare","cigno","cilindro","ciottolo","circa","cirrosi","citrico","cittadino","ciuffo","civetta","civile","classico","clinica","cloro","cocco","codardo","codice","coerente","cognome","collare","colmato","colore","colposo","coltivato","colza","coma","cometa","commando","comodo","computer","comune","conciso","condurre","conferma","congelare","coniuge","connesso","conoscere","consumo","continuo","convegno","coperto","copione","coppia","copricapo","corazza","cordata","coricato","cornice","corolla","corpo","corredo","corsia","cortese","cosmico","costante","cottura","covato","cratere","cravatta","creato","credere","cremoso","crescita","creta","criceto","crinale","crisi","critico","croce","cronaca","crostata","cruciale","crusca","cucire","cuculo","cugino","cullato","cupola","curatore","cursore","curvo","cuscino","custode","dado","daino","dalmata","damerino","daniela","dannoso","danzare","datato","davanti","davvero","debutto","decennio","deciso","declino","decollo","decreto","dedicato","definito","deforme","degno","delegare","delfino","delirio","delta","demenza","denotato","dentro","deposito","derapata","derivare","deroga","descritto","deserto","desiderio","desumere","detersivo","devoto","diametro","dicembre","diedro","difeso","diffuso","digerire","digitale","diluvio","dinamico","dinnanzi","dipinto","diploma","dipolo","diradare","dire","dirotto","dirupo","disagio","discreto","disfare","disgelo","disposto","distanza","disumano","dito","divano","divelto","dividere","divorato","doblone","docente","doganale","dogma","dolce","domato","domenica","dominare","dondolo","dono","dormire","dote","dottore","dovuto","dozzina","drago","druido","dubbio","dubitare","ducale","duna","duomo","duplice","duraturo","ebano","eccesso","ecco","eclissi","economia","edera","edicola","edile","editoria","educare","egemonia","egli","egoismo","egregio","elaborato","elargire","elegante","elencato","eletto","elevare","elfico","elica","elmo","elsa","eluso","emanato","emblema","emesso","emiro","emotivo","emozione","empirico","emulo","endemico","enduro","energia","enfasi","enoteca","entrare","enzima","epatite","epilogo","episodio","epocale","eppure","equatore","erario","erba","erboso","erede","eremita","erigere","ermetico","eroe","erosivo","errante","esagono","esame","esanime","esaudire","esca","esempio","esercito","esibito","esigente","esistere","esito","esofago","esortato","esoso","espanso","espresso","essenza","esso","esteso","estimare","estonia","estroso","esultare","etilico","etnico","etrusco","etto","euclideo","europa","evaso","evidenza","evitato","evoluto","evviva","fabbrica","faccenda","fachiro","falco","famiglia","fanale","fanfara","fango","fantasma","fare","farfalla","farinoso","farmaco","fascia","fastoso","fasullo","faticare","fato","favoloso","febbre","fecola","fede","fegato","felpa","feltro","femmina","fendere","fenomeno","fermento","ferro","fertile","fessura","festivo","fetta","feudo","fiaba","fiducia","fifa","figurato","filo","finanza","finestra","finire","fiore","fiscale","fisico","fiume","flacone","flamenco","flebo","flemma","florido","fluente","fluoro","fobico","focaccia","focoso","foderato","foglio","folata","folclore","folgore","fondente","fonetico","fonia","fontana","forbito","forchetta","foresta","formica","fornaio","foro","fortezza","forzare","fosfato","fosso","fracasso","frana","frassino","fratello","freccetta","frenata","fresco","frigo","frollino","fronde","frugale","frutta","fucilata","fucsia","fuggente","fulmine","fulvo","fumante","fumetto","fumoso","fune","funzione","fuoco","furbo","furgone","furore","fuso","futile","gabbiano","gaffe","galateo","gallina","galoppo","gambero","gamma","garanzia","garbo","garofano","garzone","gasdotto","gasolio","gastrico","gatto","gaudio","gazebo","gazzella","geco","gelatina","gelso","gemello","gemmato","gene","genitore","gennaio","genotipo","gergo","ghepardo","ghiaccio","ghisa","giallo","gilda","ginepro","giocare","gioiello","giorno","giove","girato","girone","gittata","giudizio","giurato","giusto","globulo","glutine","gnomo","gobba","golf","gomito","gommone","gonfio","gonna","governo","gracile","grado","grafico","grammo","grande","grattare","gravoso","grazia","greca","gregge","grifone","grigio","grinza","grotta","gruppo","guadagno","guaio","guanto","guardare","gufo","guidare","ibernato","icona","identico","idillio","idolo","idra","idrico","idrogeno","igiene","ignaro","ignorato","ilare","illeso","illogico","illudere","imballo","imbevuto","imbocco","imbuto","immane","immerso","immolato","impacco","impeto","impiego","importo","impronta","inalare","inarcare","inattivo","incanto","incendio","inchino","incisivo","incluso","incontro","incrocio","incubo","indagine","india","indole","inedito","infatti","infilare","inflitto","ingaggio","ingegno","inglese","ingordo","ingrosso","innesco","inodore","inoltrare","inondato","insano","insetto","insieme","insonnia","insulina","intasato","intero","intonaco","intuito","inumidire","invalido","invece","invito","iperbole","ipnotico","ipotesi","ippica","iride","irlanda","ironico","irrigato","irrorare","isolato","isotopo","isterico","istituto","istrice","italia","iterare","labbro","labirinto","lacca","lacerato","lacrima","lacuna","laddove","lago","lampo","lancetta","lanterna","lardoso","larga","laringe","lastra","latenza","latino","lattuga","lavagna","lavoro","legale","leggero","lembo","lentezza","lenza","leone","lepre","lesivo","lessato","lesto","letterale","leva","levigato","libero","lido","lievito","lilla","limatura","limitare","limpido","lineare","lingua","liquido","lira","lirica","lisca","lite","litigio","livrea","locanda","lode","logica","lombare","londra","longevo","loquace","lorenzo","loto","lotteria","luce","lucidato","lumaca","luminoso","lungo","lupo","luppolo","lusinga","lusso","lutto","macabro","macchina","macero","macinato","madama","magico","maglia","magnete","magro","maiolica","malafede","malgrado","malinteso","malsano","malto","malumore","mana","mancia","mandorla","mangiare","manifesto","mannaro","manovra","mansarda","mantide","manubrio","mappa","maratona","marcire","maretta","marmo","marsupio","maschera","massaia","mastino","materasso","matricola","mattone","maturo","mazurca","meandro","meccanico","mecenate","medesimo","meditare","mega","melassa","melis","melodia","meninge","meno","mensola","mercurio","merenda","merlo","meschino","mese","messere","mestolo","metallo","metodo","mettere","miagolare","mica","micelio","michele","microbo","midollo","miele","migliore","milano","milite","mimosa","minerale","mini","minore","mirino","mirtillo","miscela","missiva","misto","misurare","mitezza","mitigare","mitra","mittente","mnemonico","modello","modifica","modulo","mogano","mogio","mole","molosso","monastero","monco","mondina","monetario","monile","monotono","monsone","montato","monviso","mora","mordere","morsicato","mostro","motivato","motosega","motto","movenza","movimento","mozzo","mucca","mucosa","muffa","mughetto","mugnaio","mulatto","mulinello","multiplo","mummia","munto","muovere","murale","musa","muscolo","musica","mutevole","muto","nababbo","nafta","nanometro","narciso","narice","narrato","nascere","nastrare","naturale","nautica","naviglio","nebulosa","necrosi","negativo","negozio","nemmeno","neofita","neretto","nervo","nessuno","nettuno","neutrale","neve","nevrotico","nicchia","ninfa","nitido","nobile","nocivo","nodo","nome","nomina","nordico","normale","norvegese","nostrano","notare","notizia","notturno","novella","nucleo","nulla","numero","nuovo","nutrire","nuvola","nuziale","oasi","obbedire","obbligo","obelisco","oblio","obolo","obsoleto","occasione","occhio","occidente","occorrere","occultare","ocra","oculato","odierno","odorare","offerta","offrire","offuscato","oggetto","oggi","ognuno","olandese","olfatto","oliato","oliva","ologramma","oltre","omaggio","ombelico","ombra","omega","omissione","ondoso","onere","onice","onnivoro","onorevole","onta","operato","opinione","opposto","oracolo","orafo","ordine","orecchino","orefice","orfano","organico","origine","orizzonte","orma","ormeggio","ornativo","orologio","orrendo","orribile","ortensia","ortica","orzata","orzo","osare","oscurare","osmosi","ospedale","ospite","ossa","ossidare","ostacolo","oste","otite","otre","ottagono","ottimo","ottobre","ovale","ovest","ovino","oviparo","ovocito","ovunque","ovviare","ozio","pacchetto","pace","pacifico","padella","padrone","paese","paga","pagina","palazzina","palesare","pallido","palo","palude","pandoro","pannello","paolo","paonazzo","paprica","parabola","parcella","parere","pargolo","pari","parlato","parola","partire","parvenza","parziale","passivo","pasticca","patacca","patologia","pattume","pavone","peccato","pedalare","pedonale","peggio","peloso","penare","pendice","penisola","pennuto","penombra","pensare","pentola","pepe","pepita","perbene","percorso","perdonato","perforare","pergamena","periodo","permesso","perno","perplesso","persuaso","pertugio","pervaso","pesatore","pesista","peso","pestifero","petalo","pettine","petulante","pezzo","piacere","pianta","piattino","piccino","picozza","piega","pietra","piffero","pigiama","pigolio","pigro","pila","pilifero","pillola","pilota","pimpante","pineta","pinna","pinolo","pioggia","piombo","piramide","piretico","pirite","pirolisi","pitone","pizzico","placebo","planare","plasma","platano","plenario","pochezza","poderoso","podismo","poesia","poggiare","polenta","poligono","pollice","polmonite","polpetta","polso","poltrona","polvere","pomice","pomodoro","ponte","popoloso","porfido","poroso","porpora","porre","portata","posa","positivo","possesso","postulato","potassio","potere","pranzo","prassi","pratica","precluso","predica","prefisso","pregiato","prelievo","premere","prenotare","preparato","presenza","pretesto","prevalso","prima","principe","privato","problema","procura","produrre","profumo","progetto","prolunga","promessa","pronome","proposta","proroga","proteso","prova","prudente","prugna","prurito","psiche","pubblico","pudica","pugilato","pugno","pulce","pulito","pulsante","puntare","pupazzo","pupilla","puro","quadro","qualcosa","quasi","querela","quota","raccolto","raddoppio","radicale","radunato","raffica","ragazzo","ragione","ragno","ramarro","ramingo","ramo","randagio","rantolare","rapato","rapina","rappreso","rasatura","raschiato","rasente","rassegna","rastrello","rata","ravveduto","reale","recepire","recinto","recluta","recondito","recupero","reddito","redimere","regalato","registro","regola","regresso","relazione","remare","remoto","renna","replica","reprimere","reputare","resa","residente","responso","restauro","rete","retina","retorica","rettifica","revocato","riassunto","ribadire","ribelle","ribrezzo","ricarica","ricco","ricevere","riciclato","ricordo","ricreduto","ridicolo","ridurre","rifasare","riflesso","riforma","rifugio","rigare","rigettato","righello","rilassato","rilevato","rimanere","rimbalzo","rimedio","rimorchio","rinascita","rincaro","rinforzo","rinnovo","rinomato","rinsavito","rintocco","rinuncia","rinvenire","riparato","ripetuto","ripieno","riportare","ripresa","ripulire","risata","rischio","riserva","risibile","riso","rispetto","ristoro","risultato","risvolto","ritardo","ritegno","ritmico","ritrovo","riunione","riva","riverso","rivincita","rivolto","rizoma","roba","robotico","robusto","roccia","roco","rodaggio","rodere","roditore","rogito","rollio","romantico","rompere","ronzio","rosolare","rospo","rotante","rotondo","rotula","rovescio","rubizzo","rubrica","ruga","rullino","rumine","rumoroso","ruolo","rupe","russare","rustico","sabato","sabbiare","sabotato","sagoma","salasso","saldatura","salgemma","salivare","salmone","salone","saltare","saluto","salvo","sapere","sapido","saporito","saraceno","sarcasmo","sarto","sassoso","satellite","satira","satollo","saturno","savana","savio","saziato","sbadiglio","sbalzo","sbancato","sbarra","sbattere","sbavare","sbendare","sbirciare","sbloccato","sbocciato","sbrinare","sbruffone","sbuffare","scabroso","scadenza","scala","scambiare","scandalo","scapola","scarso","scatenare","scavato","scelto","scenico","scettro","scheda","schiena","sciarpa","scienza","scindere","scippo","sciroppo","scivolo","sclerare","scodella","scolpito","scomparto","sconforto","scoprire","scorta","scossone","scozzese","scriba","scrollare","scrutinio","scuderia","scultore","scuola","scuro","scusare","sdebitare","sdoganare","seccatura","secondo","sedano","seggiola","segnalato","segregato","seguito","selciato","selettivo","sella","selvaggio","semaforo","sembrare","seme","seminato","sempre","senso","sentire","sepolto","sequenza","serata","serbato","sereno","serio","serpente","serraglio","servire","sestina","setola","settimana","sfacelo","sfaldare","sfamato","sfarzoso","sfaticato","sfera","sfida","sfilato","sfinge","sfocato","sfoderare","sfogo","sfoltire","sforzato","sfratto","sfruttato","sfuggito","sfumare","sfuso","sgabello","sgarbato","sgonfiare","sgorbio","sgrassato","sguardo","sibilo","siccome","sierra","sigla","signore","silenzio","sillaba","simbolo","simpatico","simulato","sinfonia","singolo","sinistro","sino","sintesi","sinusoide","sipario","sisma","sistole","situato","slitta","slogatura","sloveno","smarrito","smemorato","smentito","smeraldo","smilzo","smontare","smottato","smussato","snellire","snervato","snodo","sobbalzo","sobrio","soccorso","sociale","sodale","soffitto","sogno","soldato","solenne","solido","sollazzo","solo","solubile","solvente","somatico","somma","sonda","sonetto","sonnifero","sopire","soppeso","sopra","sorgere","sorpasso","sorriso","sorso","sorteggio","sorvolato","sospiro","sosta","sottile","spada","spalla","spargere","spatola","spavento","spazzola","specie","spedire","spegnere","spelatura","speranza","spessore","spettrale","spezzato","spia","spigoloso","spillato","spinoso","spirale","splendido","sportivo","sposo","spranga","sprecare","spronato","spruzzo","spuntino","squillo","sradicare","srotolato","stabile","stacco","staffa","stagnare","stampato","stantio","starnuto","stasera","statuto","stelo","steppa","sterzo","stiletto","stima","stirpe","stivale","stizzoso","stonato","storico","strappo","stregato","stridulo","strozzare","strutto","stuccare","stufo","stupendo","subentro","succoso","sudore","suggerito","sugo","sultano","suonare","superbo","supporto","surgelato","surrogato","sussurro","sutura","svagare","svedese","sveglio","svelare","svenuto","svezia","sviluppo","svista","svizzera","svolta","svuotare","tabacco","tabulato","tacciare","taciturno","tale","talismano","tampone","tannino","tara","tardivo","targato","tariffa","tarpare","tartaruga","tasto","tattico","taverna","tavolata","tazza","teca","tecnico","telefono","temerario","tempo","temuto","tendone","tenero","tensione","tentacolo","teorema","terme","terrazzo","terzetto","tesi","tesserato","testato","tetro","tettoia","tifare","tigella","timbro","tinto","tipico","tipografo","tiraggio","tiro","titanio","titolo","titubante","tizio","tizzone","toccare","tollerare","tolto","tombola","tomo","tonfo","tonsilla","topazio","topologia","toppa","torba","tornare","torrone","tortora","toscano","tossire","tostatura","totano","trabocco","trachea","trafila","tragedia","tralcio","tramonto","transito","trapano","trarre","trasloco","trattato","trave","treccia","tremolio","trespolo","tributo","tricheco","trifoglio","trillo","trincea","trio","tristezza","triturato","trivella","tromba","trono","troppo","trottola","trovare","truccato","tubatura","tuffato","tulipano","tumulto","tunisia","turbare","turchino","tuta","tutela","ubicato","uccello","uccisore","udire","uditivo","uffa","ufficio","uguale","ulisse","ultimato","umano","umile","umorismo","uncinetto","ungere","ungherese","unicorno","unificato","unisono","unitario","unte","uovo","upupa","uragano","urgenza","urlo","usanza","usato","uscito","usignolo","usuraio","utensile","utilizzo","utopia","vacante","vaccinato","vagabondo","vagliato","valanga","valgo","valico","valletta","valoroso","valutare","valvola","vampata","vangare","vanitoso","vano","vantaggio","vanvera","vapore","varano","varcato","variante","vasca","vedetta","vedova","veduto","vegetale","veicolo","velcro","velina","velluto","veloce","venato","vendemmia","vento","verace","verbale","vergogna","verifica","vero","verruca","verticale","vescica","vessillo","vestale","veterano","vetrina","vetusto","viandante","vibrante","vicenda","vichingo","vicinanza","vidimare","vigilia","vigneto","vigore","vile","villano","vimini","vincitore","viola","vipera","virgola","virologo","virulento","viscoso","visione","vispo","vissuto","visura","vita","vitello","vittima","vivanda","vivido","viziare","voce","voga","volatile","volere","volpe","voragine","vulcano","zampogna","zanna","zappato","zattera","zavorra","zefiro","zelante","zelo","zenzero","zerbino","zibetto","zinco","zircone","zitto","zolla","zotico","zucchero","zufolo","zulu","zuppa"];aM.exports=Dre});var fM=k((c5e,uM)=>{"use strict";v();var Lre=["\u3042\u3044\u3053\u304F\u3057\u3093","\u3042\u3044\u3055\u3064","\u3042\u3044\u305F\u3099","\u3042\u304A\u305D\u3099\u3089","\u3042\u304B\u3061\u3083\u3093","\u3042\u304D\u308B","\u3042\u3051\u304B\u3099\u305F","\u3042\u3051\u308B","\u3042\u3053\u304B\u3099\u308C\u308B","\u3042\u3055\u3044","\u3042\u3055\u3072","\u3042\u3057\u3042\u3068","\u3042\u3057\u3099\u308F\u3046","\u3042\u3059\u3099\u304B\u308B","\u3042\u3059\u3099\u304D","\u3042\u305D\u3075\u3099","\u3042\u305F\u3048\u308B","\u3042\u305F\u305F\u3081\u308B","\u3042\u305F\u308A\u307E\u3048","\u3042\u305F\u308B","\u3042\u3064\u3044","\u3042\u3064\u304B\u3046","\u3042\u3063\u3057\u3085\u304F","\u3042\u3064\u307E\u308A","\u3042\u3064\u3081\u308B","\u3042\u3066\u306A","\u3042\u3066\u306F\u307E\u308B","\u3042\u3072\u308B","\u3042\u3075\u3099\u3089","\u3042\u3075\u3099\u308B","\u3042\u3075\u308C\u308B","\u3042\u307E\u3044","\u3042\u307E\u3068\u3099","\u3042\u307E\u3084\u304B\u3059","\u3042\u307E\u308A","\u3042\u307F\u3082\u306E","\u3042\u3081\u308A\u304B","\u3042\u3084\u307E\u308B","\u3042\u3086\u3080","\u3042\u3089\u3044\u304F\u3099\u307E","\u3042\u3089\u3057","\u3042\u3089\u3059\u3057\u3099","\u3042\u3089\u305F\u3081\u308B","\u3042\u3089\u3086\u308B","\u3042\u3089\u308F\u3059","\u3042\u308A\u304B\u3099\u3068\u3046","\u3042\u308F\u305B\u308B","\u3042\u308F\u3066\u308B","\u3042\u3093\u3044","\u3042\u3093\u304B\u3099\u3044","\u3042\u3093\u3053","\u3042\u3093\u305B\u3099\u3093","\u3042\u3093\u3066\u3044","\u3042\u3093\u306A\u3044","\u3042\u3093\u307E\u308A","\u3044\u3044\u305F\u3099\u3059","\u3044\u304A\u3093","\u3044\u304B\u3099\u3044","\u3044\u304B\u3099\u304F","\u3044\u304D\u304A\u3044","\u3044\u304D\u306A\u308A","\u3044\u304D\u3082\u306E","\u3044\u304D\u308B","\u3044\u304F\u3057\u3099","\u3044\u304F\u3075\u3099\u3093","\u3044\u3051\u306F\u3099\u306A","\u3044\u3051\u3093","\u3044\u3053\u3046","\u3044\u3053\u304F","\u3044\u3053\u3064","\u3044\u3055\u307E\u3057\u3044","\u3044\u3055\u3093","\u3044\u3057\u304D","\u3044\u3057\u3099\u3085\u3046","\u3044\u3057\u3099\u3087\u3046","\u3044\u3057\u3099\u308F\u308B","\u3044\u3059\u3099\u307F","\u3044\u3059\u3099\u308C","\u3044\u305B\u3044","\u3044\u305B\u3048\u3072\u3099","\u3044\u305B\u304B\u3044","\u3044\u305B\u304D","\u3044\u305B\u3099\u3093","\u3044\u305D\u3046\u308D\u3046","\u3044\u305D\u304B\u3099\u3057\u3044","\u3044\u305F\u3099\u3044","\u3044\u305F\u3099\u304F","\u3044\u305F\u3059\u3099\u3089","\u3044\u305F\u307F","\u3044\u305F\u308A\u3042","\u3044\u3061\u304A\u3046","\u3044\u3061\u3057\u3099","\u3044\u3061\u3068\u3099","\u3044\u3061\u306F\u3099","\u3044\u3061\u3075\u3099","\u3044\u3061\u308A\u3085\u3046","\u3044\u3064\u304B","\u3044\u3063\u3057\u3085\u3093","\u3044\u3063\u305B\u3044","\u3044\u3063\u305D\u3046","\u3044\u3063\u305F\u3093","\u3044\u3063\u3061","\u3044\u3063\u3066\u3044","\u3044\u3063\u307B\u309A\u3046","\u3044\u3066\u3055\u3099","\u3044\u3066\u3093","\u3044\u3068\u3099\u3046","\u3044\u3068\u3053","\u3044\u306A\u3044","\u3044\u306A\u304B","\u3044\u306D\u3080\u308A","\u3044\u306E\u3061","\u3044\u306E\u308B","\u3044\u306F\u3064","\u3044\u306F\u3099\u308B","\u3044\u306F\u3093","\u3044\u3072\u3099\u304D","\u3044\u3072\u3093","\u3044\u3075\u304F","\u3044\u3078\u3093","\u3044\u307B\u3046","\u3044\u307F\u3093","\u3044\u3082\u3046\u3068","\u3044\u3082\u305F\u308C","\u3044\u3082\u308A","\u3044\u3084\u304B\u3099\u308B","\u3044\u3084\u3059","\u3044\u3088\u304B\u3093","\u3044\u3088\u304F","\u3044\u3089\u3044","\u3044\u3089\u3059\u3068","\u3044\u308A\u304F\u3099\u3061","\u3044\u308A\u3087\u3046","\u3044\u308C\u3044","\u3044\u308C\u3082\u306E","\u3044\u308C\u308B","\u3044\u308D\u3048\u3093\u3072\u309A\u3064","\u3044\u308F\u3044","\u3044\u308F\u3046","\u3044\u308F\u304B\u3093","\u3044\u308F\u306F\u3099","\u3044\u308F\u3086\u308B","\u3044\u3093\u3051\u3099\u3093\u307E\u3081","\u3044\u3093\u3055\u3064","\u3044\u3093\u3057\u3087\u3046","\u3044\u3093\u3088\u3046","\u3046\u3048\u304D","\u3046\u3048\u308B","\u3046\u304A\u3055\u3099","\u3046\u304B\u3099\u3044","\u3046\u304B\u3075\u3099","\u3046\u304B\u3078\u3099\u308B","\u3046\u304D\u308F","\u3046\u304F\u3089\u3044\u306A","\u3046\u304F\u308C\u308C","\u3046\u3051\u305F\u307E\u308F\u308B","\u3046\u3051\u3064\u3051","\u3046\u3051\u3068\u308B","\u3046\u3051\u3082\u3064","\u3046\u3051\u308B","\u3046\u3053\u3099\u304B\u3059","\u3046\u3053\u3099\u304F","\u3046\u3053\u3093","\u3046\u3055\u304D\u3099","\u3046\u3057\u306A\u3046","\u3046\u3057\u308D\u304B\u3099\u307F","\u3046\u3059\u3044","\u3046\u3059\u304D\u3099","\u3046\u3059\u304F\u3099\u3089\u3044","\u3046\u3059\u3081\u308B","\u3046\u305B\u3064","\u3046\u3061\u3042\u308F\u305B","\u3046\u3061\u304B\u3099\u308F","\u3046\u3061\u304D","\u3046\u3061\u3085\u3046","\u3046\u3063\u304B\u308A","\u3046\u3064\u304F\u3057\u3044","\u3046\u3063\u305F\u3048\u308B","\u3046\u3064\u308B","\u3046\u3068\u3099\u3093","\u3046\u306A\u304D\u3099","\u3046\u306A\u3057\u3099","\u3046\u306A\u3059\u3099\u304F","\u3046\u306A\u308B","\u3046\u306D\u308B","\u3046\u306E\u3046","\u3046\u3075\u3099\u3051\u3099","\u3046\u3075\u3099\u3053\u3099\u3048","\u3046\u307E\u308C\u308B","\u3046\u3081\u308B","\u3046\u3082\u3046","\u3046\u3084\u307E\u3046","\u3046\u3088\u304F","\u3046\u3089\u304B\u3099\u3048\u3059","\u3046\u3089\u304F\u3099\u3061","\u3046\u3089\u306A\u3044","\u3046\u308A\u3042\u3051\u3099","\u3046\u308A\u304D\u308C","\u3046\u308B\u3055\u3044","\u3046\u308C\u3057\u3044","\u3046\u308C\u3086\u304D","\u3046\u308C\u308B","\u3046\u308D\u3053","\u3046\u308F\u304D","\u3046\u308F\u3055","\u3046\u3093\u3053\u3046","\u3046\u3093\u3061\u3093","\u3046\u3093\u3066\u3093","\u3046\u3093\u3068\u3099\u3046","\u3048\u3044\u3048\u3093","\u3048\u3044\u304B\u3099","\u3048\u3044\u304D\u3087\u3046","\u3048\u3044\u3053\u3099","\u3048\u3044\u305B\u3044","\u3048\u3044\u3075\u3099\u3093","\u3048\u3044\u3088\u3046","\u3048\u3044\u308F","\u3048\u304A\u308A","\u3048\u304B\u3099\u304A","\u3048\u304B\u3099\u304F","\u3048\u304D\u305F\u3044","\u3048\u304F\u305B\u308B","\u3048\u3057\u3083\u304F","\u3048\u3059\u3066","\u3048\u3064\u3089\u3093","\u3048\u306E\u304F\u3099","\u3048\u307B\u3046\u307E\u304D","\u3048\u307B\u3093","\u3048\u307E\u304D","\u3048\u3082\u3057\u3099","\u3048\u3082\u306E","\u3048\u3089\u3044","\u3048\u3089\u3075\u3099","\u3048\u308A\u3042","\u3048\u3093\u3048\u3093","\u3048\u3093\u304B\u3044","\u3048\u3093\u304D\u3099","\u3048\u3093\u3051\u3099\u304D","\u3048\u3093\u3057\u3085\u3046","\u3048\u3093\u305B\u3099\u3064","\u3048\u3093\u305D\u304F","\u3048\u3093\u3061\u3087\u3046","\u3048\u3093\u3068\u3064","\u304A\u3044\u304B\u3051\u308B","\u304A\u3044\u3053\u3059","\u304A\u3044\u3057\u3044","\u304A\u3044\u3064\u304F","\u304A\u3046\u3048\u3093","\u304A\u3046\u3055\u307E","\u304A\u3046\u3057\u3099","\u304A\u3046\u305B\u3064","\u304A\u3046\u305F\u3044","\u304A\u3046\u3075\u304F","\u304A\u3046\u3078\u3099\u3044","\u304A\u3046\u3088\u3046","\u304A\u3048\u308B","\u304A\u304A\u3044","\u304A\u304A\u3046","\u304A\u304A\u3068\u3099\u304A\u308A","\u304A\u304A\u3084","\u304A\u304A\u3088\u305D","\u304A\u304B\u3048\u308A","\u304A\u304B\u3059\u3099","\u304A\u304B\u3099\u3080","\u304A\u304B\u308F\u308A","\u304A\u304D\u3099\u306A\u3046","\u304A\u304D\u308B","\u304A\u304F\u3055\u307E","\u304A\u304F\u3057\u3099\u3087\u3046","\u304A\u304F\u308A\u304B\u3099\u306A","\u304A\u304F\u308B","\u304A\u304F\u308C\u308B","\u304A\u3053\u3059","\u304A\u3053\u306A\u3046","\u304A\u3053\u308B","\u304A\u3055\u3048\u308B","\u304A\u3055\u306A\u3044","\u304A\u3055\u3081\u308B","\u304A\u3057\u3044\u308C","\u304A\u3057\u3048\u308B","\u304A\u3057\u3099\u304D\u3099","\u304A\u3057\u3099\u3055\u3093","\u304A\u3057\u3083\u308C","\u304A\u305D\u3089\u304F","\u304A\u305D\u308F\u308B","\u304A\u305F\u304B\u3099\u3044","\u304A\u305F\u304F","\u304A\u305F\u3099\u3084\u304B","\u304A\u3061\u3064\u304F","\u304A\u3063\u3068","\u304A\u3064\u308A","\u304A\u3066\u3099\u304B\u3051","\u304A\u3068\u3057\u3082\u306E","\u304A\u3068\u306A\u3057\u3044","\u304A\u3068\u3099\u308A","\u304A\u3068\u3099\u308D\u304B\u3059","\u304A\u306F\u3099\u3055\u3093","\u304A\u307E\u3044\u308A","\u304A\u3081\u3066\u3099\u3068\u3046","\u304A\u3082\u3044\u3066\u3099","\u304A\u3082\u3046","\u304A\u3082\u305F\u3044","\u304A\u3082\u3061\u3083","\u304A\u3084\u3064","\u304A\u3084\u3086\u3072\u3099","\u304A\u3088\u307B\u3099\u3059","\u304A\u3089\u3093\u305F\u3099","\u304A\u308D\u3059","\u304A\u3093\u304B\u3099\u304F","\u304A\u3093\u3051\u3044","\u304A\u3093\u3057\u3083","\u304A\u3093\u305B\u3093","\u304A\u3093\u305F\u3099\u3093","\u304A\u3093\u3061\u3085\u3046","\u304A\u3093\u3068\u3099\u3051\u3044","\u304B\u3042\u3064","\u304B\u3044\u304B\u3099","\u304B\u3099\u3044\u304D","\u304B\u3099\u3044\u3051\u3093","\u304B\u3099\u3044\u3053\u3046","\u304B\u3044\u3055\u3064","\u304B\u3044\u3057\u3083","\u304B\u3044\u3059\u3044\u3088\u304F","\u304B\u3044\u305B\u3099\u3093","\u304B\u3044\u305D\u3099\u3046\u3068\u3099","\u304B\u3044\u3064\u3046","\u304B\u3044\u3066\u3093","\u304B\u3044\u3068\u3046","\u304B\u3044\u3075\u304F","\u304B\u3099\u3044\u3078\u304D","\u304B\u3044\u307B\u3046","\u304B\u3044\u3088\u3046","\u304B\u3099\u3044\u3089\u3044","\u304B\u3044\u308F","\u304B\u3048\u308B","\u304B\u304A\u308A","\u304B\u304B\u3048\u308B","\u304B\u304B\u3099\u304F","\u304B\u304B\u3099\u3057","\u304B\u304B\u3099\u307F","\u304B\u304F\u3053\u3099","\u304B\u304F\u3068\u304F","\u304B\u3055\u3099\u308B","\u304B\u3099\u305D\u3099\u3046","\u304B\u305F\u3044","\u304B\u305F\u3061","\u304B\u3099\u3061\u3087\u3046","\u304B\u3099\u3063\u304D\u3085\u3046","\u304B\u3099\u3063\u3053\u3046","\u304B\u3099\u3063\u3055\u3093","\u304B\u3099\u3063\u3057\u3087\u3046","\u304B\u306A\u3055\u3099\u308F\u3057","\u304B\u306E\u3046","\u304B\u3099\u306F\u304F","\u304B\u3075\u3099\u304B","\u304B\u307B\u3046","\u304B\u307B\u3053\u3099","\u304B\u307E\u3046","\u304B\u307E\u307B\u3099\u3053","\u304B\u3081\u308C\u304A\u3093","\u304B\u3086\u3044","\u304B\u3088\u3046\u3072\u3099","\u304B\u3089\u3044","\u304B\u308B\u3044","\u304B\u308D\u3046","\u304B\u308F\u304F","\u304B\u308F\u3089","\u304B\u3099\u3093\u304B","\u304B\u3093\u3051\u3044","\u304B\u3093\u3053\u3046","\u304B\u3093\u3057\u3083","\u304B\u3093\u305D\u3046","\u304B\u3093\u305F\u3093","\u304B\u3093\u3061","\u304B\u3099\u3093\u306F\u3099\u308B","\u304D\u3042\u3044","\u304D\u3042\u3064","\u304D\u3044\u308D","\u304D\u3099\u3044\u3093","\u304D\u3046\u3044","\u304D\u3046\u3093","\u304D\u3048\u308B","\u304D\u304A\u3046","\u304D\u304A\u304F","\u304D\u304A\u3061","\u304D\u304A\u3093","\u304D\u304B\u3044","\u304D\u304B\u304F","\u304D\u304B\u3093\u3057\u3083","\u304D\u304D\u3066","\u304D\u304F\u306F\u3099\u308A","\u304D\u304F\u3089\u3051\u3099","\u304D\u3051\u3093\u305B\u3044","\u304D\u3053\u3046","\u304D\u3053\u3048\u308B","\u304D\u3053\u304F","\u304D\u3055\u3044","\u304D\u3055\u304F","\u304D\u3055\u307E","\u304D\u3055\u3089\u304D\u3099","\u304D\u3099\u3057\u3099\u304B\u304B\u3099\u304F","\u304D\u3099\u3057\u304D","\u304D\u3099\u3057\u3099\u305F\u3044\u3051\u3093","\u304D\u3099\u3057\u3099\u306B\u3063\u3066\u3044","\u304D\u3099\u3057\u3099\u3085\u3064\u3057\u3083","\u304D\u3059\u3046","\u304D\u305B\u3044","\u304D\u305B\u304D","\u304D\u305B\u3064","\u304D\u305D\u3046","\u304D\u305D\u3099\u304F","\u304D\u305D\u3099\u3093","\u304D\u305F\u3048\u308B","\u304D\u3061\u3087\u3046","\u304D\u3064\u3048\u3093","\u304D\u3099\u3063\u3061\u308A","\u304D\u3064\u3064\u304D","\u304D\u3064\u306D","\u304D\u3066\u3044","\u304D\u3068\u3099\u3046","\u304D\u3068\u3099\u304F","\u304D\u306A\u3044","\u304D\u306A\u304B\u3099","\u304D\u306A\u3053","\u304D\u306C\u3053\u3099\u3057","\u304D\u306D\u3093","\u304D\u306E\u3046","\u304D\u306E\u3057\u305F","\u304D\u306F\u304F","\u304D\u3072\u3099\u3057\u3044","\u304D\u3072\u3093","\u304D\u3075\u304F","\u304D\u3075\u3099\u3093","\u304D\u307B\u3099\u3046","\u304D\u307B\u3093","\u304D\u307E\u308B","\u304D\u307F\u3064","\u304D\u3080\u3059\u3099\u304B\u3057\u3044","\u304D\u3081\u308B","\u304D\u3082\u305F\u3099\u3081\u3057","\u304D\u3082\u3061","\u304D\u3082\u306E","\u304D\u3083\u304F","\u304D\u3084\u304F","\u304D\u3099\u3085\u3046\u306B\u304F","\u304D\u3088\u3046","\u304D\u3087\u3046\u308A\u3085\u3046","\u304D\u3089\u3044","\u304D\u3089\u304F","\u304D\u308A\u3093","\u304D\u308C\u3044","\u304D\u308C\u3064","\u304D\u308D\u304F","\u304D\u3099\u308D\u3093","\u304D\u308F\u3081\u308B","\u304D\u3099\u3093\u3044\u308D","\u304D\u3093\u304B\u304F\u3057\u3099","\u304D\u3093\u3057\u3099\u3087","\u304D\u3093\u3088\u3046\u3072\u3099","\u304F\u3099\u3042\u3044","\u304F\u3044\u3059\u3099","\u304F\u3046\u304B\u3093","\u304F\u3046\u304D","\u304F\u3046\u304F\u3099\u3093","\u304F\u3046\u3053\u3046","\u304F\u3099\u3046\u305B\u3044","\u304F\u3046\u305D\u3046","\u304F\u3099\u3046\u305F\u3089","\u304F\u3046\u3075\u304F","\u304F\u3046\u307B\u3099","\u304F\u304B\u3093","\u304F\u304D\u3087\u3046","\u304F\u3051\u3099\u3093","\u304F\u3099\u3053\u3046","\u304F\u3055\u3044","\u304F\u3055\u304D","\u304F\u3055\u306F\u3099\u306A","\u304F\u3055\u308B","\u304F\u3057\u3083\u307F","\u304F\u3057\u3087\u3046","\u304F\u3059\u306E\u304D","\u304F\u3059\u308A\u3086\u3072\u3099","\u304F\u305B\u3051\u3099","\u304F\u305B\u3093","\u304F\u3099\u305F\u3044\u3066\u304D","\u304F\u305F\u3099\u3055\u308B","\u304F\u305F\u3072\u3099\u308C\u308B","\u304F\u3061\u3053\u307F","\u304F\u3061\u3055\u304D","\u304F\u3064\u3057\u305F","\u304F\u3099\u3063\u3059\u308A","\u304F\u3064\u308D\u304F\u3099","\u304F\u3068\u3046\u3066\u3093","\u304F\u3068\u3099\u304F","\u304F\u306A\u3093","\u304F\u306D\u304F\u306D","\u304F\u306E\u3046","\u304F\u3075\u3046","\u304F\u307F\u3042\u308F\u305B","\u304F\u307F\u305F\u3066\u308B","\u304F\u3081\u308B","\u304F\u3084\u304F\u3057\u3087","\u304F\u3089\u3059","\u304F\u3089\u3078\u3099\u308B","\u304F\u308B\u307E","\u304F\u308C\u308B","\u304F\u308D\u3046","\u304F\u308F\u3057\u3044","\u304F\u3099\u3093\u304B\u3093","\u304F\u3099\u3093\u3057\u3087\u304F","\u304F\u3099\u3093\u305F\u3044","\u304F\u3099\u3093\u3066","\u3051\u3042\u306A","\u3051\u3044\u304B\u304F","\u3051\u3044\u3051\u3093","\u3051\u3044\u3053","\u3051\u3044\u3055\u3064","\u3051\u3099\u3044\u3057\u3099\u3085\u3064","\u3051\u3044\u305F\u3044","\u3051\u3099\u3044\u306E\u3046\u3057\u3099\u3093","\u3051\u3044\u308C\u304D","\u3051\u3044\u308D","\u3051\u304A\u3068\u3059","\u3051\u304A\u308A\u3082\u306E","\u3051\u3099\u304D\u304B","\u3051\u3099\u304D\u3051\u3099\u3093","\u3051\u3099\u304D\u305F\u3099\u3093","\u3051\u3099\u304D\u3061\u3093","\u3051\u3099\u304D\u3068\u3064","\u3051\u3099\u304D\u306F","\u3051\u3099\u304D\u3084\u304F","\u3051\u3099\u3053\u3046","\u3051\u3099\u3053\u304F\u3057\u3099\u3087\u3046","\u3051\u3099\u3055\u3099\u3044","\u3051\u3055\u304D","\u3051\u3099\u3055\u3099\u3093","\u3051\u3057\u304D","\u3051\u3057\u3053\u3099\u3080","\u3051\u3057\u3087\u3046","\u3051\u3099\u3059\u3068","\u3051\u305F\u306F\u3099","\u3051\u3061\u3083\u3063\u3075\u309A","\u3051\u3061\u3089\u3059","\u3051\u3064\u3042\u3064","\u3051\u3064\u3044","\u3051\u3064\u3048\u304D","\u3051\u3063\u3053\u3093","\u3051\u3064\u3057\u3099\u3087","\u3051\u3063\u305B\u304D","\u3051\u3063\u3066\u3044","\u3051\u3064\u307E\u3064","\u3051\u3099\u3064\u3088\u3046\u3072\u3099","\u3051\u3099\u3064\u308C\u3044","\u3051\u3064\u308D\u3093","\u3051\u3099\u3068\u3099\u304F","\u3051\u3068\u306F\u3099\u3059","\u3051\u3068\u308B","\u3051\u306A\u3051\u3099","\u3051\u306A\u3059","\u3051\u306A\u307F","\u3051\u306C\u304D","\u3051\u3099\u306D\u3064","\u3051\u306D\u3093","\u3051\u306F\u3044","\u3051\u3099\u3072\u3093","\u3051\u3075\u3099\u304B\u3044","\u3051\u3099\u307B\u3099\u304F","\u3051\u307E\u308A","\u3051\u307F\u304B\u308B","\u3051\u3080\u3057","\u3051\u3080\u308A","\u3051\u3082\u306E","\u3051\u3089\u3044","\u3051\u308D\u3051\u308D","\u3051\u308F\u3057\u3044","\u3051\u3093\u3044","\u3051\u3093\u3048\u3064","\u3051\u3093\u304A","\u3051\u3093\u304B","\u3051\u3099\u3093\u304D","\u3051\u3093\u3051\u3099\u3093","\u3051\u3093\u3053\u3046","\u3051\u3093\u3055\u304F","\u3051\u3093\u3057\u3085\u3046","\u3051\u3093\u3059\u3046","\u3051\u3099\u3093\u305D\u3046","\u3051\u3093\u3061\u304F","\u3051\u3093\u3066\u3044","\u3051\u3093\u3068\u3046","\u3051\u3093\u306A\u3044","\u3051\u3093\u306B\u3093","\u3051\u3099\u3093\u3075\u3099\u3064","\u3051\u3093\u307E","\u3051\u3093\u307F\u3093","\u3051\u3093\u3081\u3044","\u3051\u3093\u3089\u3093","\u3051\u3093\u308A","\u3053\u3042\u304F\u307E","\u3053\u3044\u306C","\u3053\u3044\u3072\u3099\u3068","\u3053\u3099\u3046\u3044","\u3053\u3046\u3048\u3093","\u3053\u3046\u304A\u3093","\u3053\u3046\u304B\u3093","\u3053\u3099\u3046\u304D\u3085\u3046","\u3053\u3099\u3046\u3051\u3044","\u3053\u3046\u3053\u3046","\u3053\u3046\u3055\u3044","\u3053\u3046\u3057\u3099","\u3053\u3046\u3059\u3044","\u3053\u3099\u3046\u305B\u3044","\u3053\u3046\u305D\u304F","\u3053\u3046\u305F\u3044","\u3053\u3046\u3061\u3083","\u3053\u3046\u3064\u3046","\u3053\u3046\u3066\u3044","\u3053\u3046\u3068\u3099\u3046","\u3053\u3046\u306A\u3044","\u3053\u3046\u306F\u3044","\u3053\u3099\u3046\u307B\u3046","\u3053\u3099\u3046\u307E\u3093","\u3053\u3046\u3082\u304F","\u3053\u3046\u308A\u3064","\u3053\u3048\u308B","\u3053\u304A\u308A","\u3053\u3099\u304B\u3044","\u3053\u3099\u304B\u3099\u3064","\u3053\u3099\u304B\u3093","\u3053\u304F\u3053\u3099","\u3053\u304F\u3055\u3044","\u3053\u304F\u3068\u3046","\u3053\u304F\u306A\u3044","\u3053\u304F\u306F\u304F","\u3053\u304F\u3099\u307E","\u3053\u3051\u3044","\u3053\u3051\u308B","\u3053\u3053\u306E\u304B","\u3053\u3053\u308D","\u3053\u3055\u3081","\u3053\u3057\u3064","\u3053\u3059\u3046","\u3053\u305B\u3044","\u3053\u305B\u304D","\u3053\u305B\u3099\u3093","\u3053\u305D\u305F\u3099\u3066","\u3053\u305F\u3044","\u3053\u305F\u3048\u308B","\u3053\u305F\u3064","\u3053\u3061\u3087\u3046","\u3053\u3063\u304B","\u3053\u3064\u3053\u3064","\u3053\u3064\u306F\u3099\u3093","\u3053\u3064\u3075\u3099","\u3053\u3066\u3044","\u3053\u3066\u3093","\u3053\u3068\u304B\u3099\u3089","\u3053\u3068\u3057","\u3053\u3068\u306F\u3099","\u3053\u3068\u308A","\u3053\u306A\u3053\u3099\u306A","\u3053\u306D\u3053\u306D","\u3053\u306E\u307E\u307E","\u3053\u306E\u307F","\u3053\u306E\u3088","\u3053\u3099\u306F\u3093","\u3053\u3072\u3064\u3057\u3099","\u3053\u3075\u3046","\u3053\u3075\u3093","\u3053\u307B\u3099\u308C\u308B","\u3053\u3099\u307E\u3042\u3075\u3099\u3089","\u3053\u307E\u304B\u3044","\u3053\u3099\u307E\u3059\u308A","\u3053\u307E\u3064\u306A","\u3053\u307E\u308B","\u3053\u3080\u304D\u3099\u3053","\u3053\u3082\u3057\u3099","\u3053\u3082\u3061","\u3053\u3082\u306E","\u3053\u3082\u3093","\u3053\u3084\u304F","\u3053\u3084\u307E","\u3053\u3086\u3046","\u3053\u3086\u3072\u3099","\u3053\u3088\u3044","\u3053\u3088\u3046","\u3053\u308A\u308B","\u3053\u308C\u304F\u3057\u3087\u3093","\u3053\u308D\u3063\u3051","\u3053\u308F\u3082\u3066","\u3053\u308F\u308C\u308B","\u3053\u3093\u3044\u3093","\u3053\u3093\u304B\u3044","\u3053\u3093\u304D","\u3053\u3093\u3057\u3085\u3046","\u3053\u3093\u3059\u3044","\u3053\u3093\u305F\u3099\u3066","\u3053\u3093\u3068\u3093","\u3053\u3093\u306A\u3093","\u3053\u3093\u3072\u3099\u306B","\u3053\u3093\u307B\u309A\u3093","\u3053\u3093\u307E\u3051","\u3053\u3093\u3084","\u3053\u3093\u308C\u3044","\u3053\u3093\u308F\u304F","\u3055\u3099\u3044\u3048\u304D","\u3055\u3044\u304B\u3044","\u3055\u3044\u304D\u3093","\u3055\u3099\u3044\u3051\u3099\u3093","\u3055\u3099\u3044\u3053","\u3055\u3044\u3057\u3087","\u3055\u3044\u305B\u3044","\u3055\u3099\u3044\u305F\u304F","\u3055\u3099\u3044\u3061\u3085\u3046","\u3055\u3044\u3066\u304D","\u3055\u3099\u3044\u308A\u3087\u3046","\u3055\u3046\u306A","\u3055\u304B\u3044\u3057","\u3055\u304B\u3099\u3059","\u3055\u304B\u306A","\u3055\u304B\u307F\u3061","\u3055\u304B\u3099\u308B","\u3055\u304D\u3099\u3087\u3046","\u3055\u304F\u3057","\u3055\u304F\u3072\u3093","\u3055\u304F\u3089","\u3055\u3053\u304F","\u3055\u3053\u3064","\u3055\u3059\u3099\u304B\u308B","\u3055\u3099\u305B\u304D","\u3055\u305F\u3093","\u3055\u3064\u3048\u3044","\u3055\u3099\u3064\u304A\u3093","\u3055\u3099\u3063\u304B","\u3055\u3099\u3064\u304B\u3099\u304F","\u3055\u3063\u304D\u3087\u304F","\u3055\u3099\u3063\u3057","\u3055\u3064\u3057\u3099\u3093","\u3055\u3099\u3063\u305D\u3046","\u3055\u3064\u305F\u306F\u3099","\u3055\u3064\u307E\u3044\u3082","\u3055\u3066\u3044","\u3055\u3068\u3044\u3082","\u3055\u3068\u3046","\u3055\u3068\u304A\u3084","\u3055\u3068\u3057","\u3055\u3068\u308B","\u3055\u306E\u3046","\u3055\u306F\u3099\u304F","\u3055\u3072\u3099\u3057\u3044","\u3055\u3078\u3099\u3064","\u3055\u307B\u3046","\u3055\u307B\u3068\u3099","\u3055\u307E\u3059","\u3055\u307F\u3057\u3044","\u3055\u307F\u305F\u3099\u308C","\u3055\u3080\u3051","\u3055\u3081\u308B","\u3055\u3084\u3048\u3093\u3068\u3099\u3046","\u3055\u3086\u3046","\u3055\u3088\u3046","\u3055\u3088\u304F","\u3055\u3089\u305F\u3099","\u3055\u3099\u308B\u305D\u306F\u3099","\u3055\u308F\u3084\u304B","\u3055\u308F\u308B","\u3055\u3093\u3044\u3093","\u3055\u3093\u304B","\u3055\u3093\u304D\u3083\u304F","\u3055\u3093\u3053\u3046","\u3055\u3093\u3055\u3044","\u3055\u3099\u3093\u3057\u3087","\u3055\u3093\u3059\u3046","\u3055\u3093\u305B\u3044","\u3055\u3093\u305D","\u3055\u3093\u3061","\u3055\u3093\u307E","\u3055\u3093\u307F","\u3055\u3093\u3089\u3093","\u3057\u3042\u3044","\u3057\u3042\u3051\u3099","\u3057\u3042\u3055\u3063\u3066","\u3057\u3042\u308F\u305B","\u3057\u3044\u304F","\u3057\u3044\u3093","\u3057\u3046\u3061","\u3057\u3048\u3044","\u3057\u304A\u3051","\u3057\u304B\u3044","\u3057\u304B\u304F","\u3057\u3099\u304B\u3093","\u3057\u3053\u3099\u3068","\u3057\u3059\u3046","\u3057\u3099\u305F\u3099\u3044","\u3057\u305F\u3046\u3051","\u3057\u305F\u304D\u3099","\u3057\u305F\u3066","\u3057\u305F\u307F","\u3057\u3061\u3087\u3046","\u3057\u3061\u308A\u3093","\u3057\u3063\u304B\u308A","\u3057\u3064\u3057\u3099","\u3057\u3064\u3082\u3093","\u3057\u3066\u3044","\u3057\u3066\u304D","\u3057\u3066\u3064","\u3057\u3099\u3066\u3093","\u3057\u3099\u3068\u3099\u3046","\u3057\u306A\u304D\u3099\u308C","\u3057\u306A\u3082\u306E","\u3057\u306A\u3093","\u3057\u306D\u307E","\u3057\u306D\u3093","\u3057\u306E\u304F\u3099","\u3057\u306E\u3075\u3099","\u3057\u306F\u3044","\u3057\u306F\u3099\u304B\u308A","\u3057\u306F\u3064","\u3057\u306F\u3089\u3044","\u3057\u306F\u3093","\u3057\u3072\u3087\u3046","\u3057\u3075\u304F","\u3057\u3099\u3075\u3099\u3093","\u3057\u3078\u3044","\u3057\u307B\u3046","\u3057\u307B\u3093","\u3057\u307E\u3046","\u3057\u307E\u308B","\u3057\u307F\u3093","\u3057\u3080\u3051\u308B","\u3057\u3099\u3080\u3057\u3087","\u3057\u3081\u3044","\u3057\u3081\u308B","\u3057\u3082\u3093","\u3057\u3083\u3044\u3093","\u3057\u3083\u3046\u3093","\u3057\u3083\u304A\u3093","\u3057\u3099\u3083\u304B\u3099\u3044\u3082","\u3057\u3084\u304F\u3057\u3087","\u3057\u3083\u304F\u307B\u3046","\u3057\u3083\u3051\u3093","\u3057\u3083\u3053","\u3057\u3083\u3055\u3099\u3044","\u3057\u3083\u3057\u3093","\u3057\u3083\u305B\u3093","\u3057\u3083\u305D\u3046","\u3057\u3083\u305F\u3044","\u3057\u3083\u3061\u3087\u3046","\u3057\u3083\u3063\u304D\u3093","\u3057\u3099\u3083\u307E","\u3057\u3083\u308A\u3093","\u3057\u3083\u308C\u3044","\u3057\u3099\u3086\u3046","\u3057\u3099\u3085\u3046\u3057\u3087","\u3057\u3085\u304F\u306F\u304F","\u3057\u3099\u3085\u3057\u3093","\u3057\u3085\u3063\u305B\u304D","\u3057\u3085\u307F","\u3057\u3085\u3089\u306F\u3099","\u3057\u3099\u3085\u3093\u306F\u3099\u3093","\u3057\u3087\u3046\u304B\u3044","\u3057\u3087\u304F\u305F\u304F","\u3057\u3087\u3063\u3051\u3093","\u3057\u3087\u3068\u3099\u3046","\u3057\u3087\u3082\u3064","\u3057\u3089\u305B\u308B","\u3057\u3089\u3078\u3099\u308B","\u3057\u3093\u304B","\u3057\u3093\u3053\u3046","\u3057\u3099\u3093\u3057\u3099\u3083","\u3057\u3093\u305B\u3044\u3057\u3099","\u3057\u3093\u3061\u304F","\u3057\u3093\u308A\u3093","\u3059\u3042\u3051\u3099","\u3059\u3042\u3057","\u3059\u3042\u306A","\u3059\u3099\u3042\u3093","\u3059\u3044\u3048\u3044","\u3059\u3044\u304B","\u3059\u3044\u3068\u3046","\u3059\u3099\u3044\u3075\u3099\u3093","\u3059\u3044\u3088\u3046\u3072\u3099","\u3059\u3046\u304B\u3099\u304F","\u3059\u3046\u3057\u3099\u3064","\u3059\u3046\u305B\u3093","\u3059\u304A\u3068\u3099\u308A","\u3059\u304D\u307E","\u3059\u304F\u3046","\u3059\u304F\u306A\u3044","\u3059\u3051\u308B","\u3059\u3053\u3099\u3044","\u3059\u3053\u3057","\u3059\u3099\u3055\u3093","\u3059\u3059\u3099\u3057\u3044","\u3059\u3059\u3080","\u3059\u3059\u3081\u308B","\u3059\u3063\u304B\u308A","\u3059\u3099\u3063\u3057\u308A","\u3059\u3099\u3063\u3068","\u3059\u3066\u304D","\u3059\u3066\u308B","\u3059\u306D\u308B","\u3059\u306E\u3053","\u3059\u306F\u305F\u3099","\u3059\u306F\u3099\u3089\u3057\u3044","\u3059\u3099\u3072\u3087\u3046","\u3059\u3099\u3075\u3099\u306C\u308C","\u3059\u3075\u3099\u308A","\u3059\u3075\u308C","\u3059\u3078\u3099\u3066","\u3059\u3078\u3099\u308B","\u3059\u3099\u307B\u3046","\u3059\u307B\u3099\u3093","\u3059\u307E\u3044","\u3059\u3081\u3057","\u3059\u3082\u3046","\u3059\u3084\u304D","\u3059\u3089\u3059\u3089","\u3059\u308B\u3081","\u3059\u308C\u3061\u304B\u3099\u3046","\u3059\u308D\u3063\u3068","\u3059\u308F\u308B","\u3059\u3093\u305B\u3099\u3093","\u3059\u3093\u307B\u309A\u3046","\u305B\u3042\u3075\u3099\u3089","\u305B\u3044\u304B\u3064","\u305B\u3044\u3051\u3099\u3093","\u305B\u3044\u3057\u3099","\u305B\u3044\u3088\u3046","\u305B\u304A\u3046","\u305B\u304B\u3044\u304B\u3093","\u305B\u304D\u306B\u3093","\u305B\u304D\u3080","\u305B\u304D\u3086","\u305B\u304D\u3089\u3093\u3046\u3093","\u305B\u3051\u3093","\u305B\u3053\u3046","\u305B\u3059\u3057\u3099","\u305B\u305F\u3044","\u305B\u305F\u3051","\u305B\u3063\u304B\u304F","\u305B\u3063\u304D\u3083\u304F","\u305B\u3099\u3063\u304F","\u305B\u3063\u3051\u3093","\u305B\u3063\u3053\u3064","\u305B\u3063\u3055\u305F\u304F\u307E","\u305B\u3064\u305D\u3099\u304F","\u305B\u3064\u305F\u3099\u3093","\u305B\u3064\u3066\u3099\u3093","\u305B\u3063\u306F\u309A\u3093","\u305B\u3064\u3072\u3099","\u305B\u3064\u3075\u3099\u3093","\u305B\u3064\u3081\u3044","\u305B\u3064\u308A\u3064","\u305B\u306A\u304B","\u305B\u306E\u3072\u3099","\u305B\u306F\u306F\u3099","\u305B\u3072\u3099\u308D","\u305B\u307B\u3099\u306D","\u305B\u307E\u3044","\u305B\u307E\u308B","\u305B\u3081\u308B","\u305B\u3082\u305F\u308C","\u305B\u308A\u3075","\u305B\u3099\u3093\u3042\u304F","\u305B\u3093\u3044","\u305B\u3093\u3048\u3044","\u305B\u3093\u304B","\u305B\u3093\u304D\u3087","\u305B\u3093\u304F","\u305B\u3093\u3051\u3099\u3093","\u305B\u3099\u3093\u3053\u3099","\u305B\u3093\u3055\u3044","\u305B\u3093\u3057\u3085","\u305B\u3093\u3059\u3044","\u305B\u3093\u305B\u3044","\u305B\u3093\u305D\u3099","\u305B\u3093\u305F\u304F","\u305B\u3093\u3061\u3087\u3046","\u305B\u3093\u3066\u3044","\u305B\u3093\u3068\u3046","\u305B\u3093\u306C\u304D","\u305B\u3093\u306D\u3093","\u305B\u3093\u306F\u309A\u3044","\u305B\u3099\u3093\u3075\u3099","\u305B\u3099\u3093\u307B\u309A\u3046","\u305B\u3093\u3080","\u305B\u3093\u3081\u3093\u3057\u3099\u3087","\u305B\u3093\u3082\u3093","\u305B\u3093\u3084\u304F","\u305B\u3093\u3086\u3046","\u305B\u3093\u3088\u3046","\u305B\u3099\u3093\u3089","\u305B\u3099\u3093\u308A\u3083\u304F","\u305B\u3093\u308C\u3044","\u305B\u3093\u308D","\u305D\u3042\u304F","\u305D\u3044\u3068\u3051\u3099\u308B","\u305D\u3044\u306D","\u305D\u3046\u304B\u3099\u3093\u304D\u3087\u3046","\u305D\u3046\u304D","\u305D\u3046\u3053\u3099","\u305D\u3046\u3057\u3093","\u305D\u3046\u305F\u3099\u3093","\u305D\u3046\u306A\u3093","\u305D\u3046\u3072\u3099","\u305D\u3046\u3081\u3093","\u305D\u3046\u308A","\u305D\u3048\u3082\u306E","\u305D\u3048\u3093","\u305D\u304B\u3099\u3044","\u305D\u3051\u3099\u304D","\u305D\u3053\u3046","\u305D\u3053\u305D\u3053","\u305D\u3055\u3099\u3044","\u305D\u3057\u306A","\u305D\u305B\u3044","\u305D\u305B\u3093","\u305D\u305D\u304F\u3099","\u305D\u305F\u3099\u3066\u308B","\u305D\u3064\u3046","\u305D\u3064\u3048\u3093","\u305D\u3063\u304B\u3093","\u305D\u3064\u304D\u3099\u3087\u3046","\u305D\u3063\u3051\u3064","\u305D\u3063\u3053\u3046","\u305D\u3063\u305B\u3093","\u305D\u3063\u3068","\u305D\u3068\u304B\u3099\u308F","\u305D\u3068\u3064\u3099\u3089","\u305D\u306A\u3048\u308B","\u305D\u306A\u305F","\u305D\u3075\u307B\u3099","\u305D\u307B\u3099\u304F","\u305D\u307B\u3099\u308D","\u305D\u307E\u3064","\u305D\u307E\u308B","\u305D\u3080\u304F","\u305D\u3080\u308A\u3048","\u305D\u3081\u308B","\u305D\u3082\u305D\u3082","\u305D\u3088\u304B\u305B\u3099","\u305D\u3089\u307E\u3081","\u305D\u308D\u3046","\u305D\u3093\u304B\u3044","\u305D\u3093\u3051\u3044","\u305D\u3093\u3055\u3099\u3044","\u305D\u3093\u3057\u3064","\u305D\u3093\u305D\u3099\u304F","\u305D\u3093\u3061\u3087\u3046","\u305D\u3099\u3093\u3072\u3099","\u305D\u3099\u3093\u3075\u3099\u3093","\u305D\u3093\u307F\u3093","\u305F\u3042\u3044","\u305F\u3044\u3044\u3093","\u305F\u3044\u3046\u3093","\u305F\u3044\u3048\u304D","\u305F\u3044\u304A\u3046","\u305F\u3099\u3044\u304B\u3099\u304F","\u305F\u3044\u304D","\u305F\u3044\u304F\u3099\u3046","\u305F\u3044\u3051\u3093","\u305F\u3044\u3053","\u305F\u3044\u3055\u3099\u3044","\u305F\u3099\u3044\u3057\u3099\u3087\u3046\u3075\u3099","\u305F\u3099\u3044\u3059\u304D","\u305F\u3044\u305B\u3064","\u305F\u3044\u305D\u3046","\u305F\u3099\u3044\u305F\u3044","\u305F\u3044\u3061\u3087\u3046","\u305F\u3044\u3066\u3044","\u305F\u3099\u3044\u3068\u3099\u3053\u308D","\u305F\u3044\u306A\u3044","\u305F\u3044\u306D\u3064","\u305F\u3044\u306E\u3046","\u305F\u3044\u306F\u3093","\u305F\u3099\u3044\u3072\u3087\u3046","\u305F\u3044\u3075\u3046","\u305F\u3044\u3078\u3093","\u305F\u3044\u307B","\u305F\u3044\u307E\u3064\u306F\u3099\u306A","\u305F\u3044\u307F\u3093\u304F\u3099","\u305F\u3044\u3080","\u305F\u3044\u3081\u3093","\u305F\u3044\u3084\u304D","\u305F\u3044\u3088\u3046","\u305F\u3044\u3089","\u305F\u3044\u308A\u3087\u304F","\u305F\u3044\u308B","\u305F\u3044\u308F\u3093","\u305F\u3046\u3048","\u305F\u3048\u308B","\u305F\u304A\u3059","\u305F\u304A\u308B","\u305F\u304A\u308C\u308B","\u305F\u304B\u3044","\u305F\u304B\u306D","\u305F\u304D\u3072\u3099","\u305F\u304F\u3055\u3093","\u305F\u3053\u304F","\u305F\u3053\u3084\u304D","\u305F\u3055\u3044","\u305F\u3057\u3055\u3099\u3093","\u305F\u3099\u3057\u3099\u3083\u308C","\u305F\u3059\u3051\u308B","\u305F\u3059\u3099\u3055\u308F\u308B","\u305F\u305D\u304B\u3099\u308C","\u305F\u305F\u304B\u3046","\u305F\u305F\u304F","\u305F\u305F\u3099\u3057\u3044","\u305F\u305F\u307F","\u305F\u3061\u306F\u3099\u306A","\u305F\u3099\u3063\u304B\u3044","\u305F\u3099\u3063\u304D\u3083\u304F","\u305F\u3099\u3063\u3053","\u305F\u3099\u3063\u3057\u3085\u3064","\u305F\u3099\u3063\u305F\u3044","\u305F\u3066\u308B","\u305F\u3068\u3048\u308B","\u305F\u306A\u306F\u3099\u305F","\u305F\u306B\u3093","\u305F\u306C\u304D","\u305F\u306E\u3057\u307F","\u305F\u306F\u3064","\u305F\u3075\u3099\u3093","\u305F\u3078\u3099\u308B","\u305F\u307B\u3099\u3046","\u305F\u307E\u3053\u3099","\u305F\u307E\u308B","\u305F\u3099\u3080\u308B","\u305F\u3081\u3044\u304D","\u305F\u3081\u3059","\u305F\u3081\u308B","\u305F\u3082\u3064","\u305F\u3084\u3059\u3044","\u305F\u3088\u308B","\u305F\u3089\u3059","\u305F\u308A\u304D\u307B\u3093\u304B\u3099\u3093","\u305F\u308A\u3087\u3046","\u305F\u308A\u308B","\u305F\u308B\u3068","\u305F\u308C\u308B","\u305F\u308C\u3093\u3068","\u305F\u308D\u3063\u3068","\u305F\u308F\u3080\u308C\u308B","\u305F\u3099\u3093\u3042\u3064","\u305F\u3093\u3044","\u305F\u3093\u304A\u3093","\u305F\u3093\u304B","\u305F\u3093\u304D","\u305F\u3093\u3051\u3093","\u305F\u3093\u3053\u3099","\u305F\u3093\u3055\u3093","\u305F\u3093\u3057\u3099\u3087\u3046\u3072\u3099","\u305F\u3099\u3093\u305B\u3044","\u305F\u3093\u305D\u304F","\u305F\u3093\u305F\u3044","\u305F\u3099\u3093\u3061","\u305F\u3093\u3066\u3044","\u305F\u3093\u3068\u3046","\u305F\u3099\u3093\u306A","\u305F\u3093\u306B\u3093","\u305F\u3099\u3093\u306D\u3064","\u305F\u3093\u306E\u3046","\u305F\u3093\u3072\u309A\u3093","\u305F\u3099\u3093\u307B\u3099\u3046","\u305F\u3093\u307E\u3064","\u305F\u3093\u3081\u3044","\u305F\u3099\u3093\u308C\u3064","\u305F\u3099\u3093\u308D","\u305F\u3099\u3093\u308F","\u3061\u3042\u3044","\u3061\u3042\u3093","\u3061\u3044\u304D","\u3061\u3044\u3055\u3044","\u3061\u3048\u3093","\u3061\u304B\u3044","\u3061\u304B\u3089","\u3061\u304D\u3085\u3046","\u3061\u304D\u3093","\u3061\u3051\u3044\u3059\u3099","\u3061\u3051\u3093","\u3061\u3053\u304F","\u3061\u3055\u3044","\u3061\u3057\u304D","\u3061\u3057\u308A\u3087\u3046","\u3061\u305B\u3044","\u3061\u305D\u3046","\u3061\u305F\u3044","\u3061\u305F\u3093","\u3061\u3061\u304A\u3084","\u3061\u3064\u3057\u3099\u3087","\u3061\u3066\u304D","\u3061\u3066\u3093","\u3061\u306C\u304D","\u3061\u306C\u308A","\u3061\u306E\u3046","\u3061\u3072\u3087\u3046","\u3061\u3078\u3044\u305B\u3093","\u3061\u307B\u3046","\u3061\u307E\u305F","\u3061\u307F\u3064","\u3061\u307F\u3068\u3099\u308D","\u3061\u3081\u3044\u3068\u3099","\u3061\u3083\u3093\u3053\u306A\u3078\u3099","\u3061\u3085\u3046\u3044","\u3061\u3086\u308A\u3087\u304F","\u3061\u3087\u3046\u3057","\u3061\u3087\u3055\u304F\u3051\u3093","\u3061\u3089\u3057","\u3061\u3089\u307F","\u3061\u308A\u304B\u3099\u307F","\u3061\u308A\u3087\u3046","\u3061\u308B\u3068\u3099","\u3061\u308F\u308F","\u3061\u3093\u305F\u3044","\u3061\u3093\u3082\u304F","\u3064\u3044\u304B","\u3064\u3044\u305F\u3061","\u3064\u3046\u304B","\u3064\u3046\u3057\u3099\u3087\u3046","\u3064\u3046\u306F\u3093","\u3064\u3046\u308F","\u3064\u304B\u3046","\u3064\u304B\u308C\u308B","\u3064\u304F\u306D","\u3064\u304F\u308B","\u3064\u3051\u306D","\u3064\u3051\u308B","\u3064\u3053\u3099\u3046","\u3064\u305F\u3048\u308B","\u3064\u3064\u3099\u304F","\u3064\u3064\u3057\u3099","\u3064\u3064\u3080","\u3064\u3068\u3081\u308B","\u3064\u306A\u304B\u3099\u308B","\u3064\u306A\u307F","\u3064\u306D\u3064\u3099\u306D","\u3064\u306E\u308B","\u3064\u3075\u3099\u3059","\u3064\u307E\u3089\u306A\u3044","\u3064\u307E\u308B","\u3064\u307F\u304D","\u3064\u3081\u305F\u3044","\u3064\u3082\u308A","\u3064\u3082\u308B","\u3064\u3088\u3044","\u3064\u308B\u307B\u3099","\u3064\u308B\u307F\u304F","\u3064\u308F\u3082\u306E","\u3064\u308F\u308A","\u3066\u3042\u3057","\u3066\u3042\u3066","\u3066\u3042\u307F","\u3066\u3044\u304A\u3093","\u3066\u3044\u304B","\u3066\u3044\u304D","\u3066\u3044\u3051\u3044","\u3066\u3044\u3053\u304F","\u3066\u3044\u3055\u3064","\u3066\u3044\u3057","\u3066\u3044\u305B\u3044","\u3066\u3044\u305F\u3044","\u3066\u3044\u3068\u3099","\u3066\u3044\u306D\u3044","\u3066\u3044\u3072\u3087\u3046","\u3066\u3044\u3078\u3093","\u3066\u3044\u307B\u3099\u3046","\u3066\u3046\u3061","\u3066\u304A\u304F\u308C","\u3066\u304D\u3068\u3046","\u3066\u304F\u3072\u3099","\u3066\u3099\u3053\u307B\u3099\u3053","\u3066\u3055\u304D\u3099\u3087\u3046","\u3066\u3055\u3051\u3099","\u3066\u3059\u308A","\u3066\u305D\u3046","\u3066\u3061\u304B\u3099\u3044","\u3066\u3061\u3087\u3046","\u3066\u3064\u304B\u3099\u304F","\u3066\u3064\u3064\u3099\u304D","\u3066\u3099\u3063\u306F\u309A","\u3066\u3064\u307B\u3099\u3046","\u3066\u3064\u3084","\u3066\u3099\u306C\u304B\u3048","\u3066\u306C\u304D","\u3066\u306C\u304F\u3099\u3044","\u3066\u306E\u3072\u3089","\u3066\u306F\u3044","\u3066\u3075\u3099\u304F\u308D","\u3066\u3075\u305F\u3099","\u3066\u307B\u3068\u3099\u304D","\u3066\u307B\u3093","\u3066\u307E\u3048","\u3066\u307E\u304D\u3059\u3099\u3057","\u3066\u307F\u3057\u3099\u304B","\u3066\u307F\u3084\u3051\u3099","\u3066\u3089\u3059","\u3066\u308C\u3072\u3099","\u3066\u308F\u3051","\u3066\u308F\u305F\u3057","\u3066\u3099\u3093\u3042\u3064","\u3066\u3093\u3044\u3093","\u3066\u3093\u304B\u3044","\u3066\u3093\u304D","\u3066\u3093\u304F\u3099","\u3066\u3093\u3051\u3093","\u3066\u3093\u3053\u3099\u304F","\u3066\u3093\u3055\u3044","\u3066\u3093\u3057","\u3066\u3093\u3059\u3046","\u3066\u3099\u3093\u3061","\u3066\u3093\u3066\u304D","\u3066\u3093\u3068\u3046","\u3066\u3093\u306A\u3044","\u3066\u3093\u3075\u309A\u3089","\u3066\u3093\u307B\u3099\u3046\u305F\u3099\u3044","\u3066\u3093\u3081\u3064","\u3066\u3093\u3089\u3093\u304B\u3044","\u3066\u3099\u3093\u308A\u3087\u304F","\u3066\u3099\u3093\u308F","\u3068\u3099\u3042\u3044","\u3068\u3044\u308C","\u3068\u3099\u3046\u304B\u3093","\u3068\u3046\u304D\u3085\u3046","\u3068\u3099\u3046\u304F\u3099","\u3068\u3046\u3057","\u3068\u3046\u3080\u304D\u3099","\u3068\u304A\u3044","\u3068\u304A\u304B","\u3068\u304A\u304F","\u3068\u304A\u3059","\u3068\u304A\u308B","\u3068\u304B\u3044","\u3068\u304B\u3059","\u3068\u304D\u304A\u308A","\u3068\u304D\u3068\u3099\u304D","\u3068\u304F\u3044","\u3068\u304F\u3057\u3085\u3046","\u3068\u304F\u3066\u3093","\u3068\u304F\u306B","\u3068\u304F\u3078\u3099\u3064","\u3068\u3051\u3044","\u3068\u3051\u308B","\u3068\u3053\u3084","\u3068\u3055\u304B","\u3068\u3057\u3087\u304B\u3093","\u3068\u305D\u3046","\u3068\u305F\u3093","\u3068\u3061\u3085\u3046","\u3068\u3063\u304D\u3085\u3046","\u3068\u3063\u304F\u3093","\u3068\u3064\u305B\u3099\u3093","\u3068\u3064\u306B\u3085\u3046","\u3068\u3068\u3099\u3051\u308B","\u3068\u3068\u306E\u3048\u308B","\u3068\u306A\u3044","\u3068\u306A\u3048\u308B","\u3068\u306A\u308A","\u3068\u306E\u3055\u307E","\u3068\u306F\u3099\u3059","\u3068\u3099\u3075\u3099\u304B\u3099\u308F","\u3068\u307B\u3046","\u3068\u307E\u308B","\u3068\u3081\u308B","\u3068\u3082\u305F\u3099\u3061","\u3068\u3082\u308B","\u3068\u3099\u3088\u3046\u3072\u3099","\u3068\u3089\u3048\u308B","\u3068\u3093\u304B\u3064","\u3068\u3099\u3093\u3075\u3099\u308A","\u306A\u3044\u304B\u304F","\u306A\u3044\u3053\u3046","\u306A\u3044\u3057\u3087","\u306A\u3044\u3059","\u306A\u3044\u305B\u3093","\u306A\u3044\u305D\u3046","\u306A\u304A\u3059","\u306A\u304B\u3099\u3044","\u306A\u304F\u3059","\u306A\u3051\u3099\u308B","\u306A\u3053\u3046\u3068\u3099","\u306A\u3055\u3051","\u306A\u305F\u3066\u3099\u3053\u3053","\u306A\u3063\u3068\u3046","\u306A\u3064\u3084\u3059\u307F","\u306A\u306A\u304A\u3057","\u306A\u306B\u3053\u3099\u3068","\u306A\u306B\u3082\u306E","\u306A\u306B\u308F","\u306A\u306E\u304B","\u306A\u3075\u305F\u3099","\u306A\u307E\u3044\u304D","\u306A\u307E\u3048","\u306A\u307E\u307F","\u306A\u307F\u305F\u3099","\u306A\u3081\u3089\u304B","\u306A\u3081\u308B","\u306A\u3084\u3080","\u306A\u3089\u3046","\u306A\u3089\u3072\u3099","\u306A\u3089\u3075\u3099","\u306A\u308C\u308B","\u306A\u308F\u3068\u3072\u3099","\u306A\u308F\u306F\u3099\u308A","\u306B\u3042\u3046","\u306B\u3044\u304B\u3099\u305F","\u306B\u3046\u3051","\u306B\u304A\u3044","\u306B\u304B\u3044","\u306B\u304B\u3099\u3066","\u306B\u304D\u3072\u3099","\u306B\u304F\u3057\u307F","\u306B\u304F\u307E\u3093","\u306B\u3051\u3099\u308B","\u306B\u3055\u3093\u304B\u305F\u3093\u305D","\u306B\u3057\u304D","\u306B\u305B\u3082\u306E","\u306B\u3061\u3057\u3099\u3087\u3046","\u306B\u3061\u3088\u3046\u3072\u3099","\u306B\u3063\u304B","\u306B\u3063\u304D","\u306B\u3063\u3051\u3044","\u306B\u3063\u3053\u3046","\u306B\u3063\u3055\u3093","\u306B\u3063\u3057\u3087\u304F","\u306B\u3063\u3059\u3046","\u306B\u3063\u305B\u304D","\u306B\u3063\u3066\u3044","\u306B\u306A\u3046","\u306B\u307B\u3093","\u306B\u307E\u3081","\u306B\u3082\u3064","\u306B\u3084\u308A","\u306B\u3085\u3046\u3044\u3093","\u306B\u308A\u3093\u3057\u3083","\u306B\u308F\u3068\u308A","\u306B\u3093\u3044","\u306B\u3093\u304B","\u306B\u3093\u304D","\u306B\u3093\u3051\u3099\u3093","\u306B\u3093\u3057\u304D","\u306B\u3093\u3059\u3099\u3046","\u306B\u3093\u305D\u3046","\u306B\u3093\u305F\u3044","\u306B\u3093\u3061","\u306B\u3093\u3066\u3044","\u306B\u3093\u306B\u304F","\u306B\u3093\u3075\u309A","\u306B\u3093\u307E\u308A","\u306B\u3093\u3080","\u306B\u3093\u3081\u3044","\u306B\u3093\u3088\u3046","\u306C\u3044\u304F\u304D\u3099","\u306C\u304B\u3059","\u306C\u304F\u3099\u3044\u3068\u308B","\u306C\u304F\u3099\u3046","\u306C\u304F\u3082\u308A","\u306C\u3059\u3080","\u306C\u307E\u3048\u3072\u3099","\u306C\u3081\u308A","\u306C\u3089\u3059","\u306C\u3093\u3061\u3083\u304F","\u306D\u3042\u3051\u3099","\u306D\u3044\u304D","\u306D\u3044\u308B","\u306D\u3044\u308D","\u306D\u304F\u3099\u305B","\u306D\u304F\u305F\u3044","\u306D\u304F\u3089","\u306D\u3053\u305B\u3099","\u306D\u3053\u3080","\u306D\u3055\u3051\u3099","\u306D\u3059\u3053\u3099\u3059","\u306D\u305D\u3078\u3099\u308B","\u306D\u305F\u3099\u3093","\u306D\u3064\u3044","\u306D\u3063\u3057\u3093","\u306D\u3064\u305D\u3099\u3046","\u306D\u3063\u305F\u3044\u304D\u3099\u3087","\u306D\u3075\u3099\u305D\u304F","\u306D\u3075\u305F\u3099","\u306D\u307B\u3099\u3046","\u306D\u307B\u308A\u306F\u307B\u308A","\u306D\u307E\u304D","\u306D\u307E\u308F\u3057","\u306D\u307F\u307F","\u306D\u3080\u3044","\u306D\u3080\u305F\u3044","\u306D\u3082\u3068","\u306D\u3089\u3046","\u306D\u308F\u3055\u3099","\u306D\u3093\u3044\u308A","\u306D\u3093\u304A\u3057","\u306D\u3093\u304B\u3093","\u306D\u3093\u304D\u3093","\u306D\u3093\u304F\u3099","\u306D\u3093\u3055\u3099","\u306D\u3093\u3057","\u306D\u3093\u3061\u3083\u304F","\u306D\u3093\u3068\u3099","\u306D\u3093\u3072\u309A","\u306D\u3093\u3075\u3099\u3064","\u306D\u3093\u307E\u3064","\u306D\u3093\u308A\u3087\u3046","\u306D\u3093\u308C\u3044","\u306E\u3044\u3059\u3099","\u306E\u304A\u3064\u3099\u307E","\u306E\u304B\u3099\u3059","\u306E\u304D\u306A\u307F","\u306E\u3053\u304D\u3099\u308A","\u306E\u3053\u3059","\u306E\u3053\u308B","\u306E\u305B\u308B","\u306E\u305D\u3099\u304F","\u306E\u305D\u3099\u3080","\u306E\u305F\u307E\u3046","\u306E\u3061\u307B\u3068\u3099","\u306E\u3063\u304F","\u306E\u306F\u3099\u3059","\u306E\u306F\u3089","\u306E\u3078\u3099\u308B","\u306E\u307B\u3099\u308B","\u306E\u307F\u3082\u306E","\u306E\u3084\u307E","\u306E\u3089\u3044\u306C","\u306E\u3089\u306D\u3053","\u306E\u308A\u3082\u306E","\u306E\u308A\u3086\u304D","\u306E\u308C\u3093","\u306E\u3093\u304D","\u306F\u3099\u3042\u3044","\u306F\u3042\u304F","\u306F\u3099\u3042\u3055\u3093","\u306F\u3099\u3044\u304B","\u306F\u3099\u3044\u304F","\u306F\u3044\u3051\u3093","\u306F\u3044\u3053\u3099","\u306F\u3044\u3057\u3093","\u306F\u3044\u3059\u3044","\u306F\u3044\u305B\u3093","\u306F\u3044\u305D\u3046","\u306F\u3044\u3061","\u306F\u3099\u3044\u306F\u3099\u3044","\u306F\u3044\u308C\u3064","\u306F\u3048\u308B","\u306F\u304A\u308B","\u306F\u304B\u3044","\u306F\u3099\u304B\u308A","\u306F\u304B\u308B","\u306F\u304F\u3057\u3085","\u306F\u3051\u3093","\u306F\u3053\u3075\u3099","\u306F\u3055\u307F","\u306F\u3055\u3093","\u306F\u3057\u3053\u3099","\u306F\u3099\u3057\u3087","\u306F\u3057\u308B","\u306F\u305B\u308B","\u306F\u309A\u305D\u3053\u3093","\u306F\u305D\u3093","\u306F\u305F\u3093","\u306F\u3061\u307F\u3064","\u306F\u3064\u304A\u3093","\u306F\u3063\u304B\u304F","\u306F\u3064\u3099\u304D","\u306F\u3063\u304D\u308A","\u306F\u3063\u304F\u3064","\u306F\u3063\u3051\u3093","\u306F\u3063\u3053\u3046","\u306F\u3063\u3055\u3093","\u306F\u3063\u3057\u3093","\u306F\u3063\u305F\u3064","\u306F\u3063\u3061\u3085\u3046","\u306F\u3063\u3066\u3093","\u306F\u3063\u3072\u309A\u3087\u3046","\u306F\u3063\u307B\u309A\u3046","\u306F\u306A\u3059","\u306F\u306A\u3072\u3099","\u306F\u306B\u304B\u3080","\u306F\u3075\u3099\u3089\u3057","\u306F\u307F\u304B\u3099\u304D","\u306F\u3080\u304B\u3046","\u306F\u3081\u3064","\u306F\u3084\u3044","\u306F\u3084\u3057","\u306F\u3089\u3046","\u306F\u308D\u3046\u3043\u3093","\u306F\u308F\u3044","\u306F\u3093\u3044","\u306F\u3093\u3048\u3044","\u306F\u3093\u304A\u3093","\u306F\u3093\u304B\u304F","\u306F\u3093\u304D\u3087\u3046","\u306F\u3099\u3093\u304F\u3099\u307F","\u306F\u3093\u3053","\u306F\u3093\u3057\u3083","\u306F\u3093\u3059\u3046","\u306F\u3093\u305F\u3099\u3093","\u306F\u309A\u3093\u3061","\u306F\u309A\u3093\u3064","\u306F\u3093\u3066\u3044","\u306F\u3093\u3068\u3057","\u306F\u3093\u306E\u3046","\u306F\u3093\u306F\u309A","\u306F\u3093\u3075\u3099\u3093","\u306F\u3093\u3078\u309A\u3093","\u306F\u3093\u307B\u3099\u3046\u304D","\u306F\u3093\u3081\u3044","\u306F\u3093\u3089\u3093","\u306F\u3093\u308D\u3093","\u3072\u3044\u304D","\u3072\u3046\u3093","\u3072\u3048\u308B","\u3072\u304B\u304F","\u3072\u304B\u308A","\u3072\u304B\u308B","\u3072\u304B\u3093","\u3072\u304F\u3044","\u3072\u3051\u3064","\u3072\u3053\u3046\u304D","\u3072\u3053\u304F","\u3072\u3055\u3044","\u3072\u3055\u3057\u3075\u3099\u308A","\u3072\u3055\u3093","\u3072\u3099\u3057\u3099\u3085\u3064\u304B\u3093","\u3072\u3057\u3087","\u3072\u305D\u304B","\u3072\u305D\u3080","\u3072\u305F\u3080\u304D","\u3072\u305F\u3099\u308A","\u3072\u305F\u308B","\u3072\u3064\u304D\u3099","\u3072\u3063\u3053\u3057","\u3072\u3063\u3057","\u3072\u3064\u3057\u3099\u3085\u3072\u3093","\u3072\u3063\u3059","\u3072\u3064\u305B\u3099\u3093","\u3072\u309A\u3063\u305F\u308A","\u3072\u309A\u3063\u3061\u308A","\u3072\u3064\u3088\u3046","\u3072\u3066\u3044","\u3072\u3068\u3053\u3099\u307F","\u3072\u306A\u307E\u3064\u308A","\u3072\u306A\u3093","\u3072\u306D\u308B","\u3072\u306F\u3093","\u3072\u3072\u3099\u304F","\u3072\u3072\u3087\u3046","\u3072\u307B\u3046","\u3072\u307E\u308F\u308A","\u3072\u307E\u3093","\u3072\u307F\u3064","\u3072\u3081\u3044","\u3072\u3081\u3057\u3099\u3057","\u3072\u3084\u3051","\u3072\u3084\u3059","\u3072\u3088\u3046","\u3072\u3099\u3087\u3046\u304D","\u3072\u3089\u304B\u3099\u306A","\u3072\u3089\u304F","\u3072\u308A\u3064","\u3072\u308A\u3087\u3046","\u3072\u308B\u307E","\u3072\u308B\u3084\u3059\u307F","\u3072\u308C\u3044","\u3072\u308D\u3044","\u3072\u308D\u3046","\u3072\u308D\u304D","\u3072\u308D\u3086\u304D","\u3072\u3093\u304B\u304F","\u3072\u3093\u3051\u3064","\u3072\u3093\u3053\u3093","\u3072\u3093\u3057\u3085","\u3072\u3093\u305D\u3046","\u3072\u309A\u3093\u3061","\u3072\u3093\u306F\u309A\u3093","\u3072\u3099\u3093\u307B\u3099\u3046","\u3075\u3042\u3093","\u3075\u3044\u3046\u3061","\u3075\u3046\u3051\u3044","\u3075\u3046\u305B\u3093","\u3075\u309A\u3046\u305F\u308D\u3046","\u3075\u3046\u3068\u3046","\u3075\u3046\u3075","\u3075\u3048\u308B","\u3075\u304A\u3093","\u3075\u304B\u3044","\u3075\u304D\u3093","\u3075\u304F\u3055\u3099\u3064","\u3075\u304F\u3075\u3099\u304F\u308D","\u3075\u3053\u3046","\u3075\u3055\u3044","\u3075\u3057\u304D\u3099","\u3075\u3057\u3099\u307F","\u3075\u3059\u307E","\u3075\u305B\u3044","\u3075\u305B\u304F\u3099","\u3075\u305D\u304F","\u3075\u3099\u305F\u306B\u304F","\u3075\u305F\u3093","\u3075\u3061\u3087\u3046","\u3075\u3064\u3046","\u3075\u3064\u304B","\u3075\u3063\u304B\u3064","\u3075\u3063\u304D","\u3075\u3063\u3053\u304F","\u3075\u3099\u3068\u3099\u3046","\u3075\u3068\u308B","\u3075\u3068\u3093","\u3075\u306E\u3046","\u3075\u306F\u3044","\u3075\u3072\u3087\u3046","\u3075\u3078\u3093","\u3075\u307E\u3093","\u3075\u307F\u3093","\u3075\u3081\u3064","\u3075\u3081\u3093","\u3075\u3088\u3046","\u3075\u308A\u3053","\u3075\u308A\u308B","\u3075\u308B\u3044","\u3075\u3093\u3044\u304D","\u3075\u3099\u3093\u304B\u3099\u304F","\u3075\u3099\u3093\u304F\u3099","\u3075\u3093\u3057\u3064","\u3075\u3099\u3093\u305B\u304D","\u3075\u3093\u305D\u3046","\u3075\u3099\u3093\u307B\u309A\u3046","\u3078\u3044\u3042\u3093","\u3078\u3044\u304A\u3093","\u3078\u3044\u304B\u3099\u3044","\u3078\u3044\u304D","\u3078\u3044\u3051\u3099\u3093","\u3078\u3044\u3053\u3046","\u3078\u3044\u3055","\u3078\u3044\u3057\u3083","\u3078\u3044\u305B\u3064","\u3078\u3044\u305D","\u3078\u3044\u305F\u304F","\u3078\u3044\u3066\u3093","\u3078\u3044\u306D\u3064","\u3078\u3044\u308F","\u3078\u304D\u304B\u3099","\u3078\u3053\u3080","\u3078\u3099\u306B\u3044\u308D","\u3078\u3099\u306B\u3057\u3087\u3046\u304B\u3099","\u3078\u3089\u3059","\u3078\u3093\u304B\u3093","\u3078\u3099\u3093\u304D\u3087\u3046","\u3078\u3099\u3093\u3053\u3099\u3057","\u3078\u3093\u3055\u3044","\u3078\u3093\u305F\u3044","\u3078\u3099\u3093\u308A","\u307B\u3042\u3093","\u307B\u3044\u304F","\u307B\u3099\u3046\u304D\u3099\u3087","\u307B\u3046\u3053\u304F","\u307B\u3046\u305D\u3046","\u307B\u3046\u307B\u3046","\u307B\u3046\u3082\u3093","\u307B\u3046\u308A\u3064","\u307B\u3048\u308B","\u307B\u304A\u3093","\u307B\u304B\u3093","\u307B\u304D\u3087\u3046","\u307B\u3099\u304D\u3093","\u307B\u304F\u308D","\u307B\u3051\u3064","\u307B\u3051\u3093","\u307B\u3053\u3046","\u307B\u3053\u308B","\u307B\u3057\u3044","\u307B\u3057\u3064","\u307B\u3057\u3085","\u307B\u3057\u3087\u3046","\u307B\u305B\u3044","\u307B\u305D\u3044","\u307B\u305D\u304F","\u307B\u305F\u3066","\u307B\u305F\u308B","\u307B\u309A\u3061\u3075\u3099\u304F\u308D","\u307B\u3063\u304D\u3087\u304F","\u307B\u3063\u3055","\u307B\u3063\u305F\u3093","\u307B\u3068\u3093\u3068\u3099","\u307B\u3081\u308B","\u307B\u3093\u3044","\u307B\u3093\u304D","\u307B\u3093\u3051","\u307B\u3093\u3057\u3064","\u307B\u3093\u3084\u304F","\u307E\u3044\u306B\u3061","\u307E\u304B\u3044","\u307E\u304B\u305B\u308B","\u307E\u304B\u3099\u308B","\u307E\u3051\u308B","\u307E\u3053\u3068","\u307E\u3055\u3064","\u307E\u3057\u3099\u3081","\u307E\u3059\u304F","\u307E\u305B\u3099\u308B","\u307E\u3064\u308A","\u307E\u3068\u3081","\u307E\u306A\u3075\u3099","\u307E\u306C\u3051","\u307E\u306D\u304F","\u307E\u307B\u3046","\u307E\u3082\u308B","\u307E\u3086\u3051\u3099","\u307E\u3088\u3046","\u307E\u308D\u3084\u304B","\u307E\u308F\u3059","\u307E\u308F\u308A","\u307E\u308F\u308B","\u307E\u3093\u304B\u3099","\u307E\u3093\u304D\u3064","\u307E\u3093\u305D\u3099\u304F","\u307E\u3093\u306A\u304B","\u307F\u3044\u3089","\u307F\u3046\u3061","\u307F\u3048\u308B","\u307F\u304B\u3099\u304F","\u307F\u304B\u305F","\u307F\u304B\u3093","\u307F\u3051\u3093","\u307F\u3053\u3093","\u307F\u3057\u3099\u304B\u3044","\u307F\u3059\u3044","\u307F\u3059\u3048\u308B","\u307F\u305B\u308B","\u307F\u3063\u304B","\u307F\u3064\u304B\u308B","\u307F\u3064\u3051\u308B","\u307F\u3066\u3044","\u307F\u3068\u3081\u308B","\u307F\u306A\u3068","\u307F\u306A\u307F\u304B\u3055\u3044","\u307F\u306D\u3089\u308B","\u307F\u306E\u3046","\u307F\u306E\u304B\u3099\u3059","\u307F\u307B\u3093","\u307F\u3082\u3068","\u307F\u3084\u3051\u3099","\u307F\u3089\u3044","\u307F\u308A\u3087\u304F","\u307F\u308F\u304F","\u307F\u3093\u304B","\u307F\u3093\u305D\u3099\u304F","\u3080\u3044\u304B","\u3080\u3048\u304D","\u3080\u3048\u3093","\u3080\u304B\u3044","\u3080\u304B\u3046","\u3080\u304B\u3048","\u3080\u304B\u3057","\u3080\u304D\u3099\u3061\u3083","\u3080\u3051\u308B","\u3080\u3051\u3099\u3093","\u3080\u3055\u307B\u3099\u308B","\u3080\u3057\u3042\u3064\u3044","\u3080\u3057\u306F\u3099","\u3080\u3057\u3099\u3085\u3093","\u3080\u3057\u308D","\u3080\u3059\u3046","\u3080\u3059\u3053","\u3080\u3059\u3075\u3099","\u3080\u3059\u3081","\u3080\u305B\u308B","\u3080\u305B\u3093","\u3080\u3061\u3085\u3046","\u3080\u306A\u3057\u3044","\u3080\u306E\u3046","\u3080\u3084\u307F","\u3080\u3088\u3046","\u3080\u3089\u3055\u304D","\u3080\u308A\u3087\u3046","\u3080\u308D\u3093","\u3081\u3044\u3042\u3093","\u3081\u3044\u3046\u3093","\u3081\u3044\u3048\u3093","\u3081\u3044\u304B\u304F","\u3081\u3044\u304D\u3087\u304F","\u3081\u3044\u3055\u3044","\u3081\u3044\u3057","\u3081\u3044\u305D\u3046","\u3081\u3044\u3075\u3099\u3064","\u3081\u3044\u308C\u3044","\u3081\u3044\u308F\u304F","\u3081\u304F\u3099\u307E\u308C\u308B","\u3081\u3055\u3099\u3059","\u3081\u3057\u305F","\u3081\u3059\u3099\u3089\u3057\u3044","\u3081\u305F\u3099\u3064","\u3081\u307E\u3044","\u3081\u3084\u3059","\u3081\u3093\u304D\u3087","\u3081\u3093\u305B\u304D","\u3081\u3093\u3068\u3099\u3046","\u3082\u3046\u3057\u3042\u3051\u3099\u308B","\u3082\u3046\u3068\u3099\u3046\u3051\u3093","\u3082\u3048\u308B","\u3082\u304F\u3057","\u3082\u304F\u3066\u304D","\u3082\u304F\u3088\u3046\u3072\u3099","\u3082\u3061\u308D\u3093","\u3082\u3068\u3099\u308B","\u3082\u3089\u3046","\u3082\u3093\u304F","\u3082\u3093\u305F\u3099\u3044","\u3084\u304A\u3084","\u3084\u3051\u308B","\u3084\u3055\u3044","\u3084\u3055\u3057\u3044","\u3084\u3059\u3044","\u3084\u3059\u305F\u308D\u3046","\u3084\u3059\u307F","\u3084\u305B\u308B","\u3084\u305D\u3046","\u3084\u305F\u3044","\u3084\u3061\u3093","\u3084\u3063\u3068","\u3084\u3063\u306F\u309A\u308A","\u3084\u3075\u3099\u308B","\u3084\u3081\u308B","\u3084\u3084\u3053\u3057\u3044","\u3084\u3088\u3044","\u3084\u308F\u3089\u304B\u3044","\u3086\u3046\u304D","\u3086\u3046\u3072\u3099\u3093\u304D\u3087\u304F","\u3086\u3046\u3078\u3099","\u3086\u3046\u3081\u3044","\u3086\u3051\u3064","\u3086\u3057\u3085\u3064","\u3086\u305B\u3093","\u3086\u305D\u3046","\u3086\u305F\u304B","\u3086\u3061\u3083\u304F","\u3086\u3066\u3099\u308B","\u3086\u306B\u3085\u3046","\u3086\u3072\u3099\u308F","\u3086\u3089\u3044","\u3086\u308C\u308B","\u3088\u3046\u3044","\u3088\u3046\u304B","\u3088\u3046\u304D\u3085\u3046","\u3088\u3046\u3057\u3099","\u3088\u3046\u3059","\u3088\u3046\u3061\u3048\u3093","\u3088\u304B\u305B\u3099","\u3088\u304B\u3093","\u3088\u304D\u3093","\u3088\u304F\u305B\u3044","\u3088\u304F\u307B\u3099\u3046","\u3088\u3051\u3044","\u3088\u3053\u3099\u308C\u308B","\u3088\u3055\u3093","\u3088\u3057\u3085\u3046","\u3088\u305D\u3046","\u3088\u305D\u304F","\u3088\u3063\u304B","\u3088\u3066\u3044","\u3088\u3068\u3099\u304B\u3099\u308F\u304F","\u3088\u306D\u3064","\u3088\u3084\u304F","\u3088\u3086\u3046","\u3088\u308D\u3053\u3075\u3099","\u3088\u308D\u3057\u3044","\u3089\u3044\u3046","\u3089\u304F\u304B\u3099\u304D","\u3089\u304F\u3053\u3099","\u3089\u304F\u3055\u3064","\u3089\u304F\u305F\u3099","\u3089\u3057\u3093\u306F\u3099\u3093","\u3089\u305B\u3093","\u3089\u305D\u3099\u304F","\u3089\u305F\u3044","\u3089\u3063\u304B","\u3089\u308C\u3064","\u308A\u3048\u304D","\u308A\u304B\u3044","\u308A\u304D\u3055\u304F","\u308A\u304D\u305B\u3064","\u308A\u304F\u304F\u3099\u3093","\u308A\u304F\u3064","\u308A\u3051\u3093","\u308A\u3053\u3046","\u308A\u305B\u3044","\u308A\u305D\u3046","\u308A\u305D\u304F","\u308A\u3066\u3093","\u308A\u306D\u3093","\u308A\u3086\u3046","\u308A\u3085\u3046\u304B\u3099\u304F","\u308A\u3088\u3046","\u308A\u3087\u3046\u308A","\u308A\u3087\u304B\u3093","\u308A\u3087\u304F\u3061\u3083","\u308A\u3087\u3053\u3046","\u308A\u308A\u304F","\u308A\u308C\u304D","\u308A\u308D\u3093","\u308A\u3093\u3053\u3099","\u308B\u3044\u3051\u3044","\u308B\u3044\u3055\u3044","\u308B\u3044\u3057\u3099","\u308B\u3044\u305B\u304D","\u308B\u3059\u306F\u3099\u3093","\u308B\u308A\u304B\u3099\u308F\u3089","\u308C\u3044\u304B\u3093","\u308C\u3044\u304D\u3099","\u308C\u3044\u305B\u3044","\u308C\u3044\u305D\u3099\u3046\u3053","\u308C\u3044\u3068\u3046","\u308C\u3044\u307B\u3099\u3046","\u308C\u304D\u3057","\u308C\u304D\u305F\u3099\u3044","\u308C\u3093\u3042\u3044","\u308C\u3093\u3051\u3044","\u308C\u3093\u3053\u3093","\u308C\u3093\u3055\u3044","\u308C\u3093\u3057\u3085\u3046","\u308C\u3093\u305D\u3099\u304F","\u308C\u3093\u3089\u304F","\u308D\u3046\u304B","\u308D\u3046\u3053\u3099","\u308D\u3046\u3057\u3099\u3093","\u308D\u3046\u305D\u304F","\u308D\u304F\u304B\u3099","\u308D\u3053\u3064","\u308D\u3057\u3099\u3046\u3089","\u308D\u3057\u3085\u3064","\u308D\u305B\u3093","\u308D\u3066\u3093","\u308D\u3081\u3093","\u308D\u308C\u3064","\u308D\u3093\u304D\u3099","\u308D\u3093\u306F\u309A","\u308D\u3093\u3075\u3099\u3093","\u308D\u3093\u308A","\u308F\u304B\u3059","\u308F\u304B\u3081","\u308F\u304B\u3084\u307E","\u308F\u304B\u308C\u308B","\u308F\u3057\u3064","\u308F\u3057\u3099\u307E\u3057","\u308F\u3059\u308C\u3082\u306E","\u308F\u3089\u3046","\u308F\u308C\u308B"];uM.exports=Lre});var lM=k((h5e,cM)=>{"use strict";v();var qre=["a\u0301baco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","accio\u0301n","aceite","acelga","acento","aceptar","a\u0301cido","aclarar","acne\u0301","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","ae\u0301reo","afectar","aficio\u0301n","afinar","afirmar","a\u0301gil","agitar","agoni\u0301a","agosto","agotar","agregar","agrio","agua","agudo","a\u0301guila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacra\u0301n","alambre","alarma","alba","a\u0301lbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodo\u0301n","aliado","aliento","alivio","alma","almeja","almi\u0301bar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","a\u0301mbar","a\u0301mbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","ande\u0301n","anemia","a\u0301ngulo","anillo","a\u0301nimo","ani\u0301s","anotar","antena","antiguo","antojo","anual","anular","anuncio","an\u0303adir","an\u0303ejo","an\u0303o","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","aran\u0303a","arar","a\u0301rbitro","a\u0301rbol","arbusto","archivo","arco","arder","ardilla","arduo","a\u0301rea","a\u0301rido","aries","armoni\u0301a","arne\u0301s","aroma","arpa","arpo\u0301n","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","a\u0301spero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","a\u0301tico","atleta","a\u0301tomo","atraer","atroz","atu\u0301n","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avio\u0301n","aviso","ayer","ayuda","ayuno","azafra\u0301n","azar","azote","azu\u0301car","azufre","azul","baba","babor","bache","bahi\u0301a","baile","bajar","balanza","balco\u0301n","balde","bambu\u0301","banco","banda","ban\u0303o","barba","barco","barniz","barro","ba\u0301scula","basto\u0301n","basura","batalla","bateri\u0301a","batir","batuta","bau\u0301l","bazar","bebe\u0301","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsa\u0301i","borde","borrar","bosque","bote","boti\u0301n","bo\u0301veda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufo\u0301n","bu\u0301ho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzo\u0301n","caballo","cabeza","cabina","cabra","cacao","cada\u0301ver","cadena","caer","cafe\u0301","cai\u0301da","caima\u0301n","caja","cajo\u0301n","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","ca\u0301ncer","candil","canela","canguro","canica","canto","can\u0303a","can\u0303o\u0301n","caoba","caos","capaz","capita\u0301n","capote","captar","capucha","cara","carbo\u0301n","ca\u0301rcel","careta","carga","carin\u0303o","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","ce\u0301lebre","celoso","ce\u0301lula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","ce\u0301sped","cetro","chacal","chaleco","champu\u0301","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclo\u0301n","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","cipre\u0301s","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","cli\u0301nica","cobre","coccio\u0301n","cochino","cocina","coco","co\u0301digo","codo","cofre","coger","cohete","coji\u0301n","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","co\u0301modo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazo\u0301n","corbata","corcho","cordo\u0301n","corona","correr","coser","cosmos","costa","cra\u0301neo","cra\u0301ter","crear","crecer","crei\u0301do","crema","cri\u0301a","crimen","cripta","crisis","cromo","cro\u0301nica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupo\u0301n","cu\u0301pula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","da\u0301til","deber","de\u0301bil","de\u0301cada","decir","dedo","defensa","definir","dejar","delfi\u0301n","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvi\u0301o","detalle","detener","deuda","di\u0301a","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difi\u0301cil","digno","dilema","diluir","dinero","directo","dirigir","disco","disen\u0303o","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","drago\u0301n","droga","ducha","duda","duelo","duen\u0303o","dulce","du\u0301o","duque","durar","dureza","duro","e\u0301bano","ebrio","echar","eco","ecuador","edad","edicio\u0301n","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","e\u0301lite","elixir","elogio","eludir","embudo","emitir","emocio\u0301n","empate","empen\u0303o","empleo","empresa","enano","encargo","enchufe","enci\u0301a","enemigo","enero","enfado","enfermo","engan\u0303o","enigma","enlace","enorme","enredo","ensayo","ensen\u0303ar","entero","entrar","envase","envi\u0301o","e\u0301poca","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espi\u0301a","esposa","espuma","esqui\u0301","estar","este","estilo","estufa","etapa","eterno","e\u0301tica","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","e\u0301xito","experto","explicar","exponer","extremo","fa\u0301brica","fa\u0301bula","fachada","fa\u0301cil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","farao\u0301n","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fe\u0301rtil","fervor","festi\u0301n","fiable","fianza","fiar","fibra","ficcio\u0301n","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flu\u0301or","fobia","foca","fogata","fogo\u0301n","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","fra\u0301gil","franja","frase","fraude","frei\u0301r","freno","fresa","fri\u0301o","frito","fruta","fuego","fuente","fuerza","fuga","fumar","funcio\u0301n","funda","furgo\u0301n","furia","fusil","fu\u0301tbol","futuro","gacela","gafas","gaita","gajo","gala","galeri\u0301a","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavila\u0301n","gemelo","gemir","gen","ge\u0301nero","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gra\u0301fico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","gru\u0301a","grueso","grumo","grupo","guante","guapo","guardia","guerra","gui\u0301a","guin\u0303o","guion","guiso","guitarra","gusano","gustar","haber","ha\u0301bil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazan\u0303a","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","he\u0301roe","hervir","hielo","hierro","hi\u0301gado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","hu\u0301medo","humilde","humo","hundir","huraca\u0301n","hurto","icono","ideal","idioma","i\u0301dolo","iglesia","iglu\u0301","igual","ilegal","ilusio\u0301n","imagen","ima\u0301n","imitar","impar","imperio","imponer","impulso","incapaz","i\u0301ndice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","intere\u0301s","i\u0301ntimo","intuir","inu\u0301til","invierno","ira","iris","ironi\u0301a","isla","islote","jabali\u0301","jabo\u0301n","jamo\u0301n","jarabe","jardi\u0301n","jarra","jaula","jazmi\u0301n","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","ju\u0301piter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladro\u0301n","lagarto","la\u0301grima","laguna","laico","lamer","la\u0301mina","la\u0301mpara","lana","lancha","langosta","lanza","la\u0301piz","largo","larva","la\u0301stima","lata","la\u0301tex","latir","laurel","lavar","lazo","leal","leccio\u0301n","leche","lector","leer","legio\u0301n","legumbre","lejano","lengua","lento","len\u0303a","leo\u0301n","leopardo","lesio\u0301n","letal","letra","leve","leyenda","libertad","libro","licor","li\u0301der","lidiar","lienzo","liga","ligero","lima","li\u0301mite","limo\u0301n","limpio","lince","lindo","li\u0301nea","lingote","lino","linterna","li\u0301quido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","locio\u0301n","loco","locura","lo\u0301gica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","mai\u0301z","maldad","maleta","malla","malo","mama\u0301","mambo","mamut","manco","mando","manejar","manga","maniqui\u0301","manjar","mano","manso","manta","man\u0303ana","mapa","ma\u0301quina","mar","marco","marea","marfil","margen","marido","ma\u0301rmol","marro\u0301n","martes","marzo","masa","ma\u0301scara","masivo","matar","materia","matiz","matriz","ma\u0301ximo","mayor","mazorca","mecha","medalla","medio","me\u0301dula","mejilla","mejor","melena","melo\u0301n","memoria","menor","mensaje","mente","menu\u0301","mercado","merengue","me\u0301rito","mes","meso\u0301n","meta","meter","me\u0301todo","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millo\u0301n","mimo","mina","minero","mi\u0301nimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","mocio\u0301n","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","mon\u0303o","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","mo\u0301vil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","mun\u0303eca","mural","muro","mu\u0301sculo","museo","musgo","mu\u0301sica","muslo","na\u0301car","nacio\u0301n","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","na\u0301usea","naval","nave","navidad","necio","ne\u0301ctar","negar","negocio","negro","neo\u0301n","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","nin\u0303ez","nin\u0303o","ni\u0301tido","nivel","nobleza","noche","no\u0301mina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","nu\u0301cleo","nudillo","nudo","nuera","nueve","nuez","nulo","nu\u0301mero","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","oce\u0301ano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oi\u0301do","oi\u0301r","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opcio\u0301n","o\u0301pera","opinar","oponer","optar","o\u0301ptica","opuesto","oracio\u0301n","orador","oral","o\u0301rbita","orca","orden","oreja","o\u0301rgano","orgi\u0301a","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadi\u0301a","oscuro","osezno","oso","ostra","oton\u0303o","otro","oveja","o\u0301vulo","o\u0301xido","oxi\u0301geno","oyente","ozono","pacto","padre","paella","pa\u0301gina","pago","pai\u0301s","pa\u0301jaro","palabra","palco","paleta","pa\u0301lido","palma","paloma","palpar","pan","panal","pa\u0301nico","pantera","pan\u0303uelo","papa\u0301","papel","papilla","paquete","parar","parcela","pared","parir","paro","pa\u0301rpado","parque","pa\u0301rrafo","parte","pasar","paseo","pasio\u0301n","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peato\u0301n","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldan\u0303o","pelea","peligro","pellejo","pelo","peluca","pena","pensar","pen\u0303o\u0301n","peo\u0301n","peor","pepino","pequen\u0303o","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pe\u0301simo","pestan\u0303a","pe\u0301talo","petro\u0301leo","pez","pezun\u0303a","picar","picho\u0301n","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","pin\u0303a","piojo","pipa","pirata","pisar","piscina","piso","pista","pito\u0301n","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesi\u0301a","poeta","polen","polici\u0301a","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porcio\u0301n","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","pri\u0301ncipe","prisio\u0301n","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","pro\u0301ximo","prueba","pu\u0301blico","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmo\u0301n","pulpo","pulso","puma","punto","pun\u0303al","pun\u0303o","pupa","pupila","pure\u0301","quedar","queja","quemar","querer","queso","quieto","qui\u0301mica","quince","quitar","ra\u0301bano","rabia","rabo","racio\u0301n","radical","rai\u0301z","rama","rampa","rancho","rango","rapaz","ra\u0301pido","rapto","rasgo","raspa","rato","rayo","raza","razo\u0301n","reaccio\u0301n","realidad","reban\u0303o","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refra\u0301n","refugio","regalo","regir","regla","regreso","rehe\u0301n","reino","rei\u0301r","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","reve\u0301s","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","ri\u0301gido","rigor","rinco\u0301n","rin\u0303o\u0301n","ri\u0301o","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubi\u0301","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sa\u0301bado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmo\u0301n","salo\u0301n","salsa","salto","salud","salvar","samba","sancio\u0301n","sandi\u0301a","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sarte\u0301n","sastre","sata\u0301n","sauna","saxofo\u0301n","seccio\u0301n","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","sen\u0303al","sen\u0303or","separar","sepia","sequi\u0301a","ser","serie","sermo\u0301n","servir","sesenta","sesio\u0301n","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","si\u0301laba","silbar","silencio","silla","si\u0301mbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","so\u0301lido","soltar","solucio\u0301n","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","soste\u0301n","so\u0301tano","suave","subir","suceso","sudor","suegra","suelo","suen\u0303o","suerte","sufrir","sujeto","sulta\u0301n","sumar","superar","suplir","suponer","supremo","sur","surco","suren\u0303o","surgir","susto","sutil","tabaco","tabique","tabla","tabu\u0301","taco","tacto","tajo","talar","talco","talento","talla","talo\u0301n","taman\u0303o","tambor","tango","tanque","tapa","tapete","tapia","tapo\u0301n","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazo\u0301n","teatro","techo","tecla","te\u0301cnica","tejado","tejer","tejido","tela","tele\u0301fono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teori\u0301a","terapia","terco","te\u0301rmino","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburo\u0301n","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","ti\u0301mido","timo","tinta","ti\u0301o","ti\u0301pico","tipo","tira","tiro\u0301n","tita\u0301n","ti\u0301tere","ti\u0301tulo","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","to\u0301rax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","to\u0301xico","trabajo","tractor","traer","tra\u0301fico","trago","traje","tramo","trance","trato","trauma","trazar","tre\u0301bol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tuberi\u0301a","tubo","tuerto","tumba","tumor","tu\u0301nel","tu\u0301nica","turbina","turismo","turno","tutor","ubicar","u\u0301lcera","umbral","unidad","unir","universo","uno","untar","un\u0303a","urbano","urbe","urgente","urna","usar","usuario","u\u0301til","utopi\u0301a","uva","vaca","vaci\u0301o","vacuna","vagar","vago","vaina","vajilla","vale","va\u0301lido","valle","valor","va\u0301lvula","vampiro","vara","variar","varo\u0301n","vaso","vecino","vector","vehi\u0301culo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vi\u0301a","viaje","vibrar","vicio","vi\u0301ctima","vida","vi\u0301deo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","vin\u0303edo","violi\u0301n","viral","virgo","virtud","visor","vi\u0301spera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volca\u0301n","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"];cM.exports=qre});var dM=k((p5e,hM)=>{v();hM.exports={CHINESE:tM(),ENGLISH:iM(),FRENCH:oM(),ITALIAN:sM(),JAPANESE:fM(),SPANISH:lM()}});var vM=k((v5e,gM)=>{"use strict";v();var Va=Ae(),Ure=Va.crypto.BN,r1=KB(),t1=Va.deps._,Fre=XB(),G4=QB(),Hre=Va.crypto.Hash,jre=Va.crypto.Random,pM=Va.util.preconditions,dt=function(e,t){if(!(this instanceof dt))return new dt(e,t);t1.isArray(e)&&(t=e,e=null);var r,i,n;if(h.Buffer.isBuffer(e))n=e;else if(t1.isString(e))i=r1.nfkd(e);else if(t1.isNumber(e))r=e;else if(e)throw new Va.errors.InvalidArgument("data","Must be a Buffer, a string or an integer");if(r=r||128,t=t||dt._getDictionary(i),i&&!t)throw new G4.UnknownWordlist(i);if(t=t||dt.Words.ENGLISH,n&&(i=dt._entropy2mnemonic(n,t)),i&&!dt.isValid(i,t))throw new G4.InvalidMnemonic(i);if(r%32!==0||r<128)throw new Va.errors.InvalidArgument("ENT","Values must be ENT > 128 and ENT % 32 == 0");i=i||dt._mnemonic(r,t),Object.defineProperty(this,"wordlist",{configurable:!1,value:t}),Object.defineProperty(this,"phrase",{configurable:!1,value:i})};dt.fromRandom=function(e=dt.Words.ENGLISH){return new dt(e)};dt.fromString=function(e,t=dt.Words.ENGLISH){return new dt(e,t)};dt.Words=dM();dt.isValid=function(e,t){if(e=r1.nfkd(e),t=t||dt._getDictionary(e),!t)return!1;for(var r=e.split(" "),i="",n=0;n<r.length;n++){var o=t.indexOf(r[n]);if(o<0)return!1;i=i+("00000000000"+o.toString(2)).slice(-11)}var a=i.length/33,s=i.slice(-a),u=i.slice(0,i.length-a),c=h.Buffer.alloc(u.length/8);for(n=0;n<u.length/8;n++)c.writeUInt8(parseInt(i.slice(n*8,(n+1)*8),2),n);var l=dt._entropyChecksum(c);return l===s};dt._belongsToWordlist=function(e,t){for(var r=r1.nfkd(e).split(" "),i=0;i<r.length;i++){var n=t.indexOf(r[i]);if(n<0)return!1}return!0};dt._getDictionary=function(e){if(!e)return null;for(var t=Object.keys(dt.Words),r=0;r<t.length;r++){var i=t[r];if(dt._belongsToWordlist(e,dt.Words[i]))return dt.Words[i]}return null};dt.prototype.toSeed=function(e){return e=e||"",Fre(r1.nfkd(this.phrase),r1.nfkd("mnemonic"+e),2048,64)};dt.fromSeed=function(e,t){return pM.checkArgument(h.Buffer.isBuffer(e),"seed must be a Buffer."),pM.checkArgument(t1.isArray(t)||t1.isString(t),"wordlist must be a string or an array."),new dt(e,t)};dt.prototype.toHDPrivateKey=function(e,t){var r=this.toSeed(e);return Va.HDPrivateKey.fromSeed(r,t)};dt.prototype.toString=function(){return this.phrase};dt.prototype.inspect=function(){return"<Mnemonic: "+this.toString()+" >"};dt._mnemonic=function(e,t){var r=jre.getRandomBuffer(e/8);return dt._entropy2mnemonic(r,t)};dt._entropy2mnemonic=function(e,t){for(var r="",i=0;i<e.length;i++)r=r+("00000000"+e[i].toString(2)).slice(-8);if(r=r+dt._entropyChecksum(e),r.length%11!==0)throw new G4.InvalidEntropy(r);var n=[];for(i=0;i<r.length/11;i++){var o=parseInt(r.slice(i*11,(i+1)*11),2);n.push(t[o])}var a;return t===dt.Words.JAPANESE?a=n.join("\u3000"):a=n.join(" "),a};dt._entropyChecksum=function(e){for(var t=Hre.sha256(e),r=e.length*8,i=r/32,n=new Ure(t.toString("hex"),16).toString(2);n.length%256!==0;)n="0"+n;var o=n.slice(0,i);return o};dt.bsv=Va;gM.exports=dt});var bM=k((y5e,yM)=>{v();var mM=Ae();mM.Mnemonic=vM();yM.exports=mM.Mnemonic});function zre(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Kre(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function S6(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function st(e,t,r=""){let i=zre(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function i1(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 n1(e,t,r=!1){st(e,void 0,"output");let i=t.outputLen;if(e.length<i)throw new RangeError("digestInto() expects output buffer of length at least "+i);if(r&&!Yr(e))throw new Error("invalid output, must be aligned")}function x6(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function vt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Rt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function vl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Z4(e,t){return!e.byteLength||!t.byteLength?!1:e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength}function o1(e,t){if(Z4(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function W4(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];st(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function a1(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return r===0}function s1(e,t,r){let i=t,n=r||(()=>[]),o=(s,u)=>i(u,...n(s)).update(s).digest(),a=i(new Uint8Array(e),...n(new Uint8Array(0)));return o.outputLen=a.outputLen,o.blockLen=a.blockLen,o.create=(s,...u)=>i(s,...u),o}function Sf(e,t,r=!0){if(t===void 0)return new Uint8Array(e);if(st(t,void 0,"output"),t.length!==e)throw new Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&!Yr(t))throw new Error("invalid output, must be aligned");return t}function _M(e,t,r){S6(e),S6(t),Kre(r);let i=new Uint8Array(16),n=vl(i);return n.setBigUint64(0,BigInt(t),r),n.setBigUint64(8,BigInt(e),r),i}function Yr(e){return e.byteOffset%4===0}function tr(e){return Uint8Array.from(st(e))}var Sn,wf,ut,Vre,_t,Ho,Y4=Xr(()=>{v();Sn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,wf=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,ut=Sn?e=>e:e=>wf(e)>>>0,Vre=e=>{for(let t=0;t<e.length;t++)e[t]=wf(e[t]);return e},_t=Sn?e=>e:Vre;Ho=(e,t)=>{function r(i,...n){if(st(i,void 0,"key"),e.nonceLength!==void 0){let l=n[0];st(l,e.varSizeNonce?void 0:e.nonceLength,"nonce")}let o=e.tagLength;o&&n[1]!==void 0&&st(n[1],void 0,"AAD");let a=t(i,...n),s=(l,m)=>{if(m!==void 0){if(l!==2)throw new Error("cipher output not supported");st(m,void 0,"output")}},u=!1;return{encrypt(l,m){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,st(l),s(a.encrypt.length,m),a.encrypt(l,m)},decrypt(l,m){if(st(l),o&&l.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return s(a.decrypt.length,m),a.decrypt(l,m)}}}return Object.assign(r,e),r}});function Wre(e){e.reverse();let t=e[15]&1,r=0;for(let i=0;i<e.length;i++){let n=e[i];e[i]=n>>>1|r,r=(n&1)<<7}return e[0]^=-t&225,e}var Ga,X4,jo,Gre,Zre,u1,Ms,Yre,E6,$4,J4,wM,SM=Xr(()=>{v();Y4();Ga=16,X4=new Uint8Array(16),jo=vt(X4),Gre=225,Zre=(e,t,r,i)=>{let n=i&1;return{s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^Gre<<24&-(n&1)}},u1=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255|0,Ms=e=>ut(u1(e));Yre=e=>e>64*1024?8:e>1024?4:2,E6=class{constructor(t,r){Z(this,"blockLen",Ga);Z(this,"outputLen",Ga);Z(this,"s0",0);Z(this,"s1",0);Z(this,"s2",0);Z(this,"s3",0);Z(this,"finished",!1);Z(this,"destroyed",!1);Z(this,"t");Z(this,"W");Z(this,"windowSize");st(t,16,"key"),t=tr(t);let i=vl(t),n=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),s=i.getUint32(12,!1),u=[];for(let P=0;P<128;P++)u.push({s0:u1(n),s1:u1(o),s2:u1(a),s3:u1(s)}),{s0:n,s1:o,s2:a,s3:s}=Zre(n,o,a,s);let c=Yre(r||1024);if(![1,2,4,8].includes(c))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=c;let m=128/c,w=this.windowSize=2**c,E=[];for(let P=0;P<m;P++)for(let M=0;M<w;M++){let D=0,L=0,U=0,K=0;for(let N=0;N<c;N++){if(!(M>>>c-N-1&1))continue;let{s0:F,s1:H,s2:z,s3:G}=u[c*P+N];D^=F,L^=H,U^=z,K^=G}E.push({s0:D,s1:L,s2:U,s3:K})}this.t=E}_updateBlock(t,r,i,n){t^=this.s0,r^=this.s1,i^=this.s2,n^=this.s3;let{W:o,t:a,windowSize:s}=this,u=0,c=0,l=0,m=0,w=(1<<o)-1,E=0;for(let P of[t,r,i,n])for(let M=0;M<4;M++){let D=P>>>8*M&255;for(let L=8/o-1;L>=0;L--){let U=D>>>o*L&w,{s0:K,s1:N,s2:C,s3:F}=a[E*s+U];u^=K,c^=N,l^=C,m^=F,E+=1}}this.s0=u,this.s1=c,this.s2=l,this.s3=m}update(t){i1(this),st(t),t=tr(t);let r=vt(t),i=Math.floor(t.length/Ga),n=t.length%Ga;for(let o=0;o<i;o++)this._updateBlock(ut(r[o*4+0]),ut(r[o*4+1]),ut(r[o*4+2]),ut(r[o*4+3]));return n&&(X4.set(t.subarray(i*Ga)),this._updateBlock(ut(jo[0]),ut(jo[1]),ut(jo[2]),ut(jo[3])),Rt(jo)),this}destroy(){this.destroyed=!0;let{t}=this;for(let r of t)r.s0=0,r.s1=0,r.s2=0,r.s3=0}digestInto(t){i1(this),n1(t,this,!0),this.finished=!0;let{s0:r,s1:i,s2:n,s3:o}=this,a=vt(t);a[0]=r,a[1]=i,a[2]=n,a[3]=o,_t(a)}digest(){let t=new Uint8Array(Ga);return this.digestInto(t),this.destroy(),t}},$4=class extends E6{constructor(t,r){st(t);let i=Wre(tr(t));super(i,r),Rt(i)}update(t){i1(this),st(t),t=tr(t);let r=vt(t),i=t.length%Ga,n=Math.floor(t.length/Ga);for(let o=0;o<n;o++)this._updateBlock(Ms(r[o*4+3]),Ms(r[o*4+2]),Ms(r[o*4+1]),Ms(r[o*4+0]));return i&&(X4.set(t.subarray(n*Ga)),this._updateBlock(Ms(jo[3]),Ms(jo[2]),Ms(jo[1]),Ms(jo[0])),Rt(jo)),this}digestInto(t){i1(this),n1(t,this,!0),this.finished=!0;let r=t.subarray(0,this.outputLen),{s0:i,s1:n,s2:o,s3:a}=this,s=vt(r);s[0]=i,s[1]=n,s[2]=o,s[3]=a,_t(s),r.reverse()}},J4=s1(16,(e,t)=>new E6(e,t),e=>[e.length]),wM=s1(16,(e,t)=>new $4(e,t),e=>[e.length])});var s8={};X1(s8,{__TESTS:()=>die,aeskw:()=>aie,aeskwp:()=>sie,aessiv:()=>lie,cbc:()=>rie,cfb:()=>iie,cmac:()=>c1,ctr:()=>_l,ecb:()=>tie,gcm:()=>nie,gcmsiv:()=>oie,rngAesCtrDrbg128:()=>uie,rngAesCtrDrbg256:()=>fie,siv:()=>cie,unsafe:()=>hie});function I6(e){if(![16,24,32].includes(e.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+e.length)}function o8(e){return e<<1^Xre&-(e>>7)}function ml(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(t&1),e=o8(e);return r}function OM(e,t){if(e.length!==256)throw new Error("Wrong sbox length");let r=new Uint32Array(256).map((c,l)=>t(e[l])),i=r.map(Q4),n=i.map(Q4),o=n.map(Q4),a=new Uint32Array(256*256),s=new Uint32Array(256*256),u=new Uint16Array(256*256);for(let c=0;c<256;c++)for(let l=0;l<256;l++){let m=c*256+l;a[m]=r[c]^i[l],s[m]=n[c]^o[l],u[m]=e[c]<<8|e[l]}return{sbox:e,sbox2:u,T0:r,T1:i,T2:n,T3:o,T01:a,T23:s}}function io(e){st(e);let t=e.length;I6(e);let{sbox2:r}=a8,i=[];(!Sn||!Yr(e))&&i.push(e=tr(e));let n=_t(vt(e)),o=n.length,a=u=>zo(r,u,u,u,u),s=new Uint32Array(t+28);s.set(n);for(let u=o;u<s.length;u++){let c=s[u-1];u%o===0?c=a(Qre(c))^eie[u/o-1]:o>6&&u%o===4&&(c=a(c)),s[u]=s[u-o]^c}return Rt(...i),s}function A6(e){let t=io(e),r=t.slice(),i=t.length,{sbox2:n}=a8,{T0:o,T1:a,T2:s,T3:u}=IM;for(let c=0;c<i;c+=4)for(let l=0;l<4;l++)r[c+l]=t[i-c-4+l];Rt(t);for(let c=4;c<i-4;c++){let l=r[c],m=zo(n,l,l,l,l);r[c]=o[m&255]^a[m>>>8&255]^s[m>>>16&255]^u[m>>>24]}return r}function Ns(e,t,r,i,n,o){return e[r<<8&65280|i>>>8&255]^t[n>>>8&65280|o>>>24&255]}function zo(e,t,r,i,n){return e[t&255|r&65280]|e[i>>>16&255|n>>>16&65280]<<16}function wi(e,t,r,i,n){let{sbox2:o,T01:a,T23:s}=a8,u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];let c=e.length/4-2;for(let P=0;P<c;P++){let M=e[u++]^Ns(a,s,t,r,i,n),D=e[u++]^Ns(a,s,r,i,n,t),L=e[u++]^Ns(a,s,i,n,t,r),U=e[u++]^Ns(a,s,n,t,r,i);t=M,r=D,i=L,n=U}let l=e[u++]^zo(o,t,r,i,n),m=e[u++]^zo(o,r,i,n,t),w=e[u++]^zo(o,i,n,t,r),E=e[u++]^zo(o,n,t,r,i);return{s0:l,s1:m,s2:w,s3:E}}function p1(e,t,r,i,n){let{sbox2:o,T01:a,T23:s}=IM,u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];let c=e.length/4-2;for(let P=0;P<c;P++){let M=e[u++]^Ns(a,s,t,n,i,r),D=e[u++]^Ns(a,s,r,t,n,i),L=e[u++]^Ns(a,s,i,r,t,n),U=e[u++]^Ns(a,s,n,i,r,t);t=M,r=D,i=L,n=U}let l=e[u++]^zo(o,t,n,i,r),m=e[u++]^zo(o,r,t,n,i),w=e[u++]^zo(o,i,r,t,n),E=e[u++]^zo(o,n,i,r,t);return{s0:l,s1:m,s2:w,s3:E}}function AM(e,t,r,i){st(t,At,"nonce"),st(r);let n=r.length;i=Sf(n,i),o1(r,i);let o=t,a=vt(o),s=vt(r),u=vt(i),{s0:c,s1:l,s2:m,s3:w}=wi(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));for(let P=0;P+4<=s.length;P+=4)u[P+0]=s[P+0]^ut(c),u[P+1]=s[P+1]^ut(l),u[P+2]=s[P+2]^ut(m),u[P+3]=s[P+3]^ut(w),l1(o,!1,1),{s0:c,s1:l,s2:m,s3:w}=wi(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));let E=At*Math.floor(s.length/n8);if(E<n){let P=new Uint32Array([c,l,m,w]);_t(P);let M=x6(P);for(let D=E,L=0;D<n;D++,L++)i[D]=r[D]^M[L];Rt(P)}return i}function yl(e,t,r,i,n){st(r,At,"nonce"),st(i),n=Sf(i.length,n);let o=r,a=vt(o),s=vl(o),u=vt(i),c=vt(n),l=t?0:12,m=i.length,w=s.getUint32(l,t),{s0:E,s1:P,s2:M,s3:D}=wi(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));for(let U=0;U+4<=u.length;U+=4)c[U+0]=u[U+0]^ut(E),c[U+1]=u[U+1]^ut(P),c[U+2]=u[U+2]^ut(M),c[U+3]=u[U+3]^ut(D),w=w+1>>>0,s.setUint32(l,w,t),{s0:E,s1:P,s2:M,s3:D}=wi(e,ut(a[0]),ut(a[1]),ut(a[2]),ut(a[3]));let L=At*Math.floor(u.length/n8);if(L<m){let U=new Uint32Array([E,P,M,D]);_t(U);let K=x6(U);for(let N=L,C=0;N<m;N++,C++)n[N]=i[N]^K[C];Rt(U)}return n}function PM(e){if(st(e),e.length%At!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+At)}function TM(e,t,r){st(e);let i=e.length,n=i%At;if(!t&&n!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");if(t){let s=At-n;s||(s=At),i=i+s}r=Sf(i,r),o1(e,r),(!Sn||!Yr(e))&&(e=tr(e));let o=vt(e);_t(o);let a=vt(r);return{b:o,o:a,out:r}}function kM(e,t){if(!t)return e;let r=e.length;if(r===0)throw new Error("aes/pkcs7: empty ciphertext not allowed");let i=e[r-1],n=1;n&=i-1>>>31^1,n&=16-i>>>31^1;for(let o=0;o<16;o++){let a=o-i>>>31,s=(e[r-1-o]^i)===0?1:0;n&=s|a^1}if(!n)throw new Error("aes/pkcs7: wrong padding");return e.subarray(0,r-i)}function RM(e){let t=new Uint8Array(16),r=vt(t);t.set(e);let i=At-e.length;for(let n=At-i;n<At;n++)t[n]=i;return r}function BM(e,t,r,i,n){let o=n?n.length:0,a=e.create(r,i.length+o);n&&a.update(n);let s=_M(8*i.length,8*o,t);a.update(i),a.update(s);let u=a.digest();return Rt(s),u}function MM(e){return e instanceof Uint32Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint32Array"}function h1(e,t){if(st(t,16,"block"),!MM(e))throw new Error("_encryptBlock accepts result of expandKeyLE");let r=vt(t);_t(r);let{s0:i,s1:n,s2:o,s3:a}=wi(e,r[0],r[1],r[2],r[3]);return r[0]=i,r[1]=n,r[2]=o,r[3]=a,_t(r),t}function NM(e,t){if(st(t,16,"block"),!MM(e))throw new Error("_decryptBlock accepts result of expandKeyLE");let r=vt(t);_t(r);let{s0:i,s1:n,s2:o,s3:a}=p1(e,r[0],r[1],r[2],r[3]);return r[0]=i,r[1]=n,r[2]=o,r[3]=a,_t(r),t}function d1(e){let t=0;for(let r=At-1;r>=0;r--){let i=(e[r]&128)>>>7;e[r]=e[r]<<1|t,t=i}return t&&(e[At-1]^=135),e}function xf(e,t){if(e.length!==t.length)throw new Error("xorBlock: blocks must have same length");for(let r=0;r<e.length;r++)e[r]=e[r]^t[r];return e}function DM(e,t){if(t.length>e.length)throw new Error("xorend: len(B) must be less than or equal to len(A)");let r=e.length-t.length;for(let i=0;i<t.length;i++)e[r+i]=e[r+i]^t[i];return e}function i8(e,t){I6(e);let r=t.length;if(r>127)throw new Error("s2v: number of input strings must be less than or equal to 127");if(r===0)return c1($re,e);let i=c1(f1,e);for(let s=0;s<r-1;s++){d1(i);let u=c1(t[s],e);xf(i,u),Rt(u)}let n=t[r-1];st(n);let o;if(n.byteLength>=At)o=DM(Uint8Array.from(n),i);else{let s=new Uint8Array(At);s.set(n),s[n.length]=128,o=xf(d1(i),s),Rt(s)}let a=c1(o,e);return Rt(i,o),a}var At,n8,f1,$re,Xre,l1,e8,Jre,Qre,Q4,a8,IM,eie,_l,tie,rie,iie,nie,bl,oie,O6,xM,aie,EM,sie,t8,CM,uie,fie,r8,c1,cie,lie,hie,die,u8=Xr(()=>{v();SM();Y4();At=16,n8=4,f1=new Uint8Array(At),$re=Uint8Array.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]),Xre=283;l1=(e,t,r=1)=>{if(!Number.isSafeInteger(r)||r>4294967040)throw new Error("incBytes: wrong carry "+r);st(e);for(let i=0;i<e.length;i++){let n=t?i:e.length-1-i;r=r+(e[n]&255)|0,e[n]=r&255,r>>>=8}},e8=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=o8(i))e[r]=i;let t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=(i^i>>4^i>>5^i>>6^i>>7^99)&255}return Rt(e),t})(),Jre=e8.map((e,t)=>e8.indexOf(t)),Qre=e=>e<<24|e>>>8,Q4=e=>e<<8|e>>>24;a8=OM(e8,e=>ml(e,3)<<24|e<<16|e<<8|ml(e,2)),IM=OM(Jre,e=>ml(e,11)<<24|ml(e,13)<<16|ml(e,9)<<8|ml(e,14)),eie=(()=>{let e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=o8(r))e[t]=r;return e})();_l=Ho({blockSize:16,nonceLength:16},function(t,r){function i(n,o){if(st(n),o!==void 0&&(st(o),!Yr(o)))throw new Error("unaligned destination");let a=io(t),s=tr(r),u=[a,s];Yr(n)||u.push(n=tr(n));let c=AM(a,s,n,o);return Rt(...u),c}return{encrypt:(n,o)=>i(n,o),decrypt:(n,o)=>i(n,o)}});tie=Ho({blockSize:16},function(t,r={}){let i=!r.disablePadding;return{encrypt(n,o){let{b:a,o:s,out:u}=TM(n,i,o),c=io(t),l=0;for(;l+4<=a.length;){let{s0:m,s1:w,s2:E,s3:P}=wi(c,a[l+0],a[l+1],a[l+2],a[l+3]);s[l++]=m,s[l++]=w,s[l++]=E,s[l++]=P}if(i){let m=RM(n.subarray(l*4));_t(m);let{s0:w,s1:E,s2:P,s3:M}=wi(c,m[0],m[1],m[2],m[3]);s[l++]=w,s[l++]=E,s[l++]=P,s[l++]=M}return _t(s),Rt(c),u},decrypt(n,o){PM(n);let a=A6(t);o=Sf(n.length,o);let s=[a];o1(n,o),(!Sn||!Yr(n))&&s.push(n=tr(n));let u=vt(n),c=vt(o);_t(u);for(let l=0;l+4<=u.length;){let{s0:m,s1:w,s2:E,s3:P}=p1(a,u[l+0],u[l+1],u[l+2],u[l+3]);c[l++]=m,c[l++]=w,c[l++]=E,c[l++]=P}return _t(c),Rt(...s),kM(o,i)}}}),rie=Ho({blockSize:16,nonceLength:16},function(t,r,i={}){let n=!i.disablePadding;return{encrypt(o,a){let s=io(t),{b:u,o:c,out:l}=TM(o,n,a),m=r,w=[s];(!Sn||!Yr(m))&&w.push(m=tr(m));let E=vt(m);_t(E);let P=E[0],M=E[1],D=E[2],L=E[3],U=0;for(;U+4<=u.length;)P^=u[U+0],M^=u[U+1],D^=u[U+2],L^=u[U+3],{s0:P,s1:M,s2:D,s3:L}=wi(s,P,M,D,L),c[U++]=P,c[U++]=M,c[U++]=D,c[U++]=L;if(n){let K=RM(o.subarray(U*4));_t(K),P^=K[0],M^=K[1],D^=K[2],L^=K[3],{s0:P,s1:M,s2:D,s3:L}=wi(s,P,M,D,L),c[U++]=P,c[U++]=M,c[U++]=D,c[U++]=L}return _t(c),Rt(...w),l},decrypt(o,a){PM(o);let s=A6(t),u=r,c=[s];(!Sn||!Yr(u))&&c.push(u=tr(u));let l=vt(u);_t(l),a=Sf(o.length,a),o1(o,a),(!Sn||!Yr(o))&&c.push(o=tr(o));let m=vt(o),w=vt(a);_t(m);let E=l[0],P=l[1],M=l[2],D=l[3];for(let L=0;L+4<=m.length;){let U=E,K=P,N=M,C=D;E=m[L+0],P=m[L+1],M=m[L+2],D=m[L+3];let{s0:F,s1:H,s2:z,s3:G}=p1(s,E,P,M,D);w[L++]=F^U,w[L++]=H^K,w[L++]=z^N,w[L++]=G^C}return _t(w),Rt(...c),kM(a,n)}}}),iie=Ho({blockSize:16,nonceLength:16},function(t,r){function i(n,o,a){st(n);let s=n.length;if(a=Sf(s,a),Z4(n,a))throw new Error("overlapping src and dst not supported.");let u=io(t),c=r,l=[u];(!Sn||!Yr(c))&&l.push(c=tr(c)),(!Sn||!Yr(n))&&l.push(n=tr(n));let m=vt(n),w=vt(a),E=o?w:m,P=vt(c);_t(m),_t(P);let M=P[0],D=P[1],L=P[2],U=P[3];for(let N=0;N+4<=m.length;){let{s0:C,s1:F,s2:H,s3:z}=wi(u,M,D,L,U);w[N+0]=m[N+0]^C,w[N+1]=m[N+1]^F,w[N+2]=m[N+2]^H,w[N+3]=m[N+3]^z,M=E[N++],D=E[N++],L=E[N++],U=E[N++]}let K=At*Math.floor(m.length/n8);if(K<s){({s0:M,s1:D,s2:L,s3:U}=wi(u,M,D,L,U));let N=new Uint32Array([M,D,L,U]);_t(N);let C=x6(N);for(let F=K,H=0;F<s;F++,H++)a[F]=n[F]^C[H];Rt(C)}return _t(w),Rt(...l),a}return{encrypt:(n,o)=>i(n,!0,o),decrypt:(n,o)=>i(n,!1,o)}});nie=Ho({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,r,i){if(r.length<8)throw new Error("aes/gcm: invalid nonce length");let n=16;function o(s,u,c){let l=BM(J4,!1,s,c,i);for(let m=0;m<u.length;m++)l[m]^=u[m];return l}function a(){let s=io(t),u=f1.slice(),c=f1.slice();if(yl(s,!1,c,c,u),r.length===12)c.set(r);else{let m=f1.slice();vl(m).setBigUint64(8,BigInt(r.length*8),!1);let E=J4.create(u).update(r).update(m);E.digestInto(c),E.destroy()}let l=yl(s,!1,c,f1);return{xk:s,authKey:u,counter:c,tagMask:l}}return{encrypt(s){let{xk:u,authKey:c,counter:l,tagMask:m}=a(),w=new Uint8Array(s.length+n),E=[u,c,l,m];Yr(s)||E.push(s=tr(s)),yl(u,!1,l,s,w.subarray(0,s.length));let P=o(c,m,w.subarray(0,w.length-n));return E.push(P),w.set(P,s.length),Rt(...E),w},decrypt(s){let{xk:u,authKey:c,counter:l,tagMask:m}=a(),w=[u,c,m,l];Yr(s)||w.push(s=tr(s));let E=s.subarray(0,-n),P=s.subarray(-n),M=o(c,m,E);if(w.push(M),!a1(M,P))throw Rt(...w),new Error("aes/gcm: invalid ghash tag");let D=yl(u,!1,l,E);return Rt(...w),D}}}),bl=(e,t,r)=>i=>{if(!Number.isSafeInteger(i)||t>i||i>r){let n="["+t+".."+r+"]";throw new Error(""+e+": expected value in range "+n+", got "+i)}},oie=Ho({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,r,i){let o=bl("AAD",0,68719476736),a=bl("plaintext",0,2**36),s=bl("nonce",12,12),u=bl("ciphertext",16,2**36+16);st(t),I6(t),s(r.length),i!==void 0&&o(i.length);function c(){let w=io(t),E=new Uint8Array(t.length),P=new Uint8Array(16),M=[w,E],D=r;(!Sn||!Yr(D))&&M.push(D=tr(D));let L=vt(D);_t(L);let U=0,K=L[0],N=L[1],C=L[2],F=0;for(let z of[P,E].map(vt)){let G=vt(z);for(let B=0;B<G.length;B+=2){let{s0:g,s1:O}=wi(w,U,K,N,C);G[B+0]=g,G[B+1]=O,U=++F}_t(G)}let H={authKey:P,encKey:io(E)};return Rt(...M),H}function l(w,E,P){let M=BM(wM,!0,E,P,i);for(let C=0;C<12;C++)M[C]^=r[C];M[15]&=127;let D=vt(M);_t(D);let L=D[0],U=D[1],K=D[2],N=D[3];return{s0:L,s1:U,s2:K,s3:N}=wi(w,L,U,K,N),D[0]=L,D[1]=U,D[2]=K,D[3]=N,_t(D),M}function m(w,E,P){let M=tr(E);M[15]|=128;let D=yl(w,!0,M,P);return Rt(M),D}return{encrypt(w){a(w.length);let{encKey:E,authKey:P}=c(),M=l(E,P,w),D=[E,P,M];Yr(w)||D.push(w=tr(w));let L=new Uint8Array(w.length+16);return L.set(M,w.length),L.set(m(E,M,w)),Rt(...D),L},decrypt(w){u(w.length);let E=w.subarray(-16),{encKey:P,authKey:M}=c(),D=[P,M];Yr(w)||D.push(w=tr(w));let L=m(P,E,w.subarray(0,-16)),U=l(P,M,L);if(D.push(U),!a1(E,U))throw Rt(...D),new Error("invalid polyval tag");return Rt(...D),L}}});O6={encrypt(e,t){if(t.length>=2**32)throw new Error("plaintext should be less than 4gb");let r=io(e);if(t.length===16)h1(r,t);else{let i=vt(t);_t(i);let n=i[0],o=i[1];for(let a=0,s=1;a<6;a++)for(let u=2;u<i.length;u+=2,s++){let{s0:c,s1:l,s2:m,s3:w}=wi(r,n,o,i[u],i[u+1]);n=c,o=l^wf(s),i[u]=m,i[u+1]=w}i[0]=n,i[1]=o,_t(i)}r.fill(0)},decrypt(e,t){if(t.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");let r=A6(e),i=t.length/8-1;if(i===1)NM(r,t);else{let n=vt(t);_t(n);let o=n[0],a=n[1];for(let s=0,u=i*6;s<6;s++)for(let c=i*2;c>=1;c-=2,u--){a^=wf(u);let{s0:l,s1:m,s2:w,s3:E}=p1(r,o,a,n[c],n[c+1]);o=l,a=m,n[c]=w,n[c+1]=E}n[0]=o,n[1]=a,_t(n)}r.fill(0)}},xM=new Uint8Array(8).fill(166),aie=Ho({blockSize:8},e=>({encrypt(t){if(!t.length||t.length%8!==0)throw new Error("invalid plaintext length");if(t.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");let r=W4(xM,t);return O6.encrypt(e,r),r},decrypt(t){if(t.length%8!==0||t.length<24)throw new Error("invalid ciphertext length");let r=tr(t);if(O6.decrypt(e,r),!a1(r.subarray(0,8),xM))throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8)}})),EM=2790873510,sie=Ho({blockSize:8},e=>({encrypt(t){if(!t.length)throw new Error("invalid plaintext length");let r=Math.ceil(t.length/8)*8,i=new Uint8Array(8+r);i.set(t,8);let n=vt(i);return n[0]=ut(EM),n[1]=ut(wf(t.length)),O6.encrypt(e,i),i},decrypt(t){if(t.length<16)throw new Error("invalid ciphertext length");let r=tr(t),i=vt(r);O6.decrypt(e,r);let n=wf(ut(i[1]))>>>0,o=Math.ceil(n/8)*8;if(ut(i[0])!==EM||r.length-8!==o)throw new Error("integrity check failed");for(let a=n;a<o;a++)if(r[8+a]!==0)throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8,8+n)}})),t8=class{constructor(t,r,i){Z(this,"blockLen");Z(this,"key");Z(this,"nonce");Z(this,"state");Z(this,"reseedCnt");this.blockLen=_l.blockSize;let n=t/8,o=16;this.state=new Uint8Array(n+o),this.key=this.state.subarray(0,n),this.nonce=this.state.subarray(n,n+o),this.reseedCnt=1,l1(this.nonce,!1,1),this.addEntropy(r,i)}update(t){if(_l(this.key,this.nonce).encrypt(new Uint8Array(this.state.length),this.state),t){st(t);for(let r=0;r<t.length;r++)this.state[r]^=t[r]}l1(this.nonce,!1,1)}addEntropy(t,r){st(t,this.state.length,"seed");let i=t.slice();if(r){if(st(r),r.length>i.length)throw new Error("info length is too big");for(let n=0;n<r.length;n++)i[n]^=r[n]}this.update(i),i.fill(0),this.reseedCnt=1}randomBytes(t,r){if(S6(t),t>2**16)throw new Error("requested output is too big");if(this.reseedCnt>2**48)throw new Error("entropy exhausted");if(r){if(st(r),r.length>this.state.length)throw new Error("info length is too big");this.update(r)}let i=new Uint8Array(t);return _l(this.key,this.nonce).encrypt(i,i),l1(this.nonce,!1,Math.ceil(t/this.blockLen)),this.update(r),this.reseedCnt++,i}clean(){this.state.fill(0),this.reseedCnt=0}},CM=e=>(t,r=void 0)=>new t8(e,t,r),uie=CM(128),fie=CM(256);r8=class{constructor(t){Z(this,"blockLen",At);Z(this,"outputLen",At);Z(this,"buffer");Z(this,"pos");Z(this,"finished");Z(this,"destroyed");Z(this,"k1");Z(this,"k2");Z(this,"x");Z(this,"xk");st(t),I6(t),this.xk=io(t),this.buffer=new Uint8Array(At),this.pos=0,this.finished=!1,this.destroyed=!1,this.x=new Uint8Array(At);let r=new Uint8Array(At);h1(this.xk,r),this.k1=d1(r),this.k2=d1(new Uint8Array(this.k1))}process(t){xf(this.x,t),h1(this.xk,this.x)}update(t){if(this.destroyed)throw new Error("Hash instance has been destroyed");if(this.finished)throw new Error("Hash#digest() has already been called");st(t);let r=0;if(this.pos){let i=Math.min(At-this.pos,t.length);this.buffer.set(t.subarray(0,i),this.pos),this.pos+=i,r=i,this.pos===At&&r<t.length&&(this.process(this.buffer),this.pos=0)}for(;r+At<t.length;)this.process(t.subarray(r,r+At)),r+=At;return r<t.length&&(this.buffer.set(t.subarray(r),0),this.pos=t.length-r),this}digestInto(t){if(this.destroyed)throw new Error("Hash instance has been destroyed");if(this.finished)throw new Error("Hash#digest() has already been called");n1(t,this,!0),this.finished=!0;let r=t.subarray(0,this.outputLen),i=new Uint8Array(At);this.pos===At?(i.set(this.buffer),xf(i,this.k1)):(i.set(this.buffer.subarray(0,this.pos)),i[this.pos]=128,xf(i,this.k2)),r.set(this.x),xf(r,i),h1(this.xk,r),Rt(i)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}destroy(){let{buffer:t,destroyed:r,x:i,xk:n,k1:o,k2:a}=this;r||(this.destroyed=!0,Rt(t,i,n,o,a))}},c1=s1(16,e=>new r8(e));cie=()=>{throw new Error('"siv" from v1 is now "gcmsiv"')},lie=Ho({blockSize:16,tagLength:16},function(t,...r){let i=bl("plaintext",0,5444517870735016e24),n=bl("ciphertext",16,2**132+16);if(r.length>126)throw new Error('"AAD" number of elements must be less than or equal to 126');if(r.forEach(s=>st(s)),st(t),![32,48,64].includes(t.length))throw new Error('"aes key" expected Uint8Array of length 32/48/64, got length='+t.length);let o=t.subarray(0,t.length/2),a=t.subarray(t.length/2);return{encrypt(s){i(s.length);let u=i8(o,[...r,s]),c=Uint8Array.from(u);c[8]&=127,c[12]&=127;let l=_l(a,c).encrypt(s);return W4(u,l)},decrypt(s){n(s.length);let u=s.subarray(0,At),c=s.subarray(At),l=Uint8Array.from(u);l[8]&=127,l[12]&=127;let m=_l(a,l).decrypt(c),w=i8(o,[...r,m]);if(a1(w,u))return m;throw new Error("invalid siv tag")}}}),hie=Object.freeze({expandKeyLE:io,expandKeyDecLE:A6,encrypt:wi,decrypt:p1,encryptBlock:h1,decryptBlock:NM,ctrCounter:AM,ctr32:yl,dbl:d1,xorBlock:xf,xorend:DM,s2v:i8}),die=Object.freeze({incBytes:l1})});var FM=k((k5e,UM)=>{"use strict";v();var{secp256k1:LM}=(g0(),lo(p0)),{sha512:pie,sha256:gie}=(sp(),lo(Wm)),{hmac:vie}=(yp(),lo(cy)),{cbc:qM}=(u8(),lo(s8)),c8=Ae(),mie=c8.PublicKey,Cs=c8.util.preconditions,yie=c8.crypto.Random;function g1(e){return h.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function f8(e,t){return g1(vie(gie,e,t))}function bie(e,t){if(e.length!==t.length)return!1;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return r===0}var P6=function(){};P6.encrypt=function(e,t,r){Cs.checkArgument(e),Cs.checkArgument(t),Cs.checkArgument(r),r=r||yie.getRandomBuffer(128/8);var i=qM(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e));return h.Buffer.concat([h.Buffer.from(r),g1(i)])};P6.decrypt=function(e,t){Cs.checkArgument(e),Cs.checkArgument(t);var r=e.slice(0,128/8),i=e.slice(128/8),n=qM(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(i));return g1(n)};var wl=function e(t){if(!(this instanceof e))return new e;this.opts=t||{}};wl.prototype.privateKey=function(e){return Cs.checkArgument(e,"no private key provided"),this._privateKey=e||null,this};wl.prototype.publicKey=function(e){return Cs.checkArgument(e,"no public key provided"),this._publicKey=e||null,this};var T6=function(e,t){var r="_"+e;Object.defineProperty(wl.prototype,e,{configurable:!1,enumerable:!0,get:function(){var i=this[r];return i||(i=this[r]=t.apply(this)),i}})};T6("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return g1(LM.getPublicKey(Uint8Array.from(e),!0))});T6("kEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=LM.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0),i=r.slice(1);return g1(pie(i))});T6("kE",function(){return this.kEkM.slice(0,32)});T6("kM",function(){return this.kEkM.slice(32,64)});wl.prototype.encrypt=function(e,t){h.Buffer.isBuffer(e)||(e=h.Buffer.from(e)),t===void 0&&(t=f8(this._privateKey.toBuffer(),e).slice(0,16));var r=P6.encrypt(e,this.kE,t),i=f8(this.kM,r);return this.opts.shortTag&&(i=i.slice(0,4)),this.opts.noKey?h.Buffer.concat([r,i]):h.Buffer.concat([this.Rbuf,r,i])};wl.prototype.decrypt=function(e){Cs.checkArgument(e);var t=0,r=this.opts.shortTag?4:32;if(!this.opts.noKey){var i;switch(e[0]){case 4:i=e.slice(0,65);break;case 3:case 2:i=e.slice(0,33);break;default:throw new Error("Invalid type: "+e[0])}this._publicKey=mie.fromDER(i),t+=i.length}var n=e.slice(t,e.length-r),o=e.slice(e.length-r,e.length),a=f8(this.kM,n);if(this.opts.shortTag&&(a=a.slice(0,4)),!bie(o,a))throw new Error("Invalid checksum");return P6.decrypt(n,this.kE)};UM.exports=wl});var jM=k((B5e,HM)=>{"use strict";v();var _ie={name:"ECIES",message:"Internal Error on bsv-ecies Module {0}",errors:[{name:"DecryptionError",message:"Invalid Message: {0}"},{name:"UnsupportAlgorithm",message:"Unsupport Algorithm: {0}"}]};HM.exports=Ae().errors.extend(_ie)});var WM=k((N5e,ZM)=>{"use strict";v();var R6=Ae(),l8=R6.PublicKey,zM=R6.PrivateKey,ji=R6.util.preconditions,wie=FM(),k6=jM(),{secp256k1:KM}=(g0(),lo(p0)),{sha512:Sie,sha256:xie}=(sp(),lo(Wm)),{hmac:Eie}=(yp(),lo(cy)),{cbc:VM}=(u8(),lo(s8));function v1(e){return h.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function GM(e,t){return v1(Eie(xie,t,e))}var B6=function(){};B6.encrypt=function(e,t,r){return ji.checkArgument(e),ji.checkArgument(t),ji.checkArgument(r),ji.checkArgument(t.length===16,"keybuf length must be 16"),ji.checkArgument(r.length===16,"ivbuf length must be 16"),v1(VM(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e)))};B6.decrypt=function(e,t,r){return ji.checkArgument(e),ji.checkArgument(t),ji.checkArgument(r),ji.checkArgument(t.length===16,"keybuf length must be 16"),ji.checkArgument(r.length===16,"ivbuf length must be 16"),v1(VM(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(e)))};var Ef=function e(t,r="BIE1"){if(r!=="BIE1")throw new k6.UnsupportAlgorithm(r);if(!(this instanceof e))return new e(t,r);this._privateKey=new R6.PrivateKey,this.opts=t||{},this.opts.ephemeralKey=!0};Ef.prototype.privateKey=function(e){return ji.checkArgument(zM.isValid(e),"no private key provided"),this._privateKey=zM(e.toHex())||null,this.opts.ephemeralKey=!1,this};Ef.prototype.publicKey=function(e){return ji.checkArgument(l8.isValid(e),"no public key provided"),this._publicKey=l8(e.toString())||null,this._publicKey!=null&&(this.opts.fixedPublicKey=!0),this};var m1=function(e,t){var r="_"+e;Object.defineProperty(Ef.prototype,e,{configurable:!1,enumerable:!0,get:function(){var i=this[r];return i=this[r]=t.apply(this),i}})};m1("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return v1(KM.getPublicKey(Uint8Array.from(e),!0))});m1("ivkEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=KM.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0);return v1(Sie(r))});m1("iv",function(){return this.ivkEkM.slice(0,16)});m1("kE",function(){return this.ivkEkM.slice(16,32)});m1("kM",function(){return this.ivkEkM.slice(32,64)});Ef.prototype.encrypt=function(e){h.Buffer.isBuffer(e)||(e=h.Buffer.from(e));var t=B6.encrypt(e,this.kE,this.iv),r,i=h.Buffer.from("BIE1");this.opts.noKey&&!this.opts.ephemeralKey?r=h.Buffer.concat([i,t]):r=h.Buffer.concat([i,this.Rbuf,t]);var n=GM(r,this.kM);return this.opts.shortTag&&(n=n.slice(0,4)),h.Buffer.concat([r,n])};Ef.prototype.decrypt=function(e){ji.checkArgument(h.Buffer.isBuffer(e),"ciphetext must be a buffer");var t=this.opts.shortTag?4:32,r=4,i=e.slice(0,4);if(!i.equals(h.Buffer.from("BIE1")))throw new k6.DecryptionError("Invalid Magic");if(!this.opts.noKey){var n=e.slice(4,37);this.opts.fixedPublicKey?console.log('Notice: Overriding PublicKey in message. Consider use "noKey" option if you are not sending message to electrum and do not want to use ephemeral key'):this._publicKey=l8.fromDER(n),r=37}var o=e.slice(r,e.length-t),a=e.slice(e.length-t,e.length),s=GM(e.slice(0,e.length-t),this.kM);if(this.opts.shortTag&&(s=s.slice(0,4)),a.length!==s.length)throw new k6.DecryptionError("Invalid checksum");for(var u=0,c=0;c<s.length;c++)u|=a[c]^s[c];if(u!==0)throw new k6.DecryptionError("Invalid checksum");return B6.decrypt(o,this.kE,this.iv)};Ef.bitcoreECIES=wie;ZM.exports=Ef});var $M=k((D5e,YM)=>{v();YM.exports=WM()});var M6=k((q5e,JM)=>{"use strict";v();function Ko(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function XM(e,t){for(var r="",i=0,n=-1,o=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(n===s-1||o===1))if(n!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf("/")),n=s,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=s,o=0;continue}}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(n+1,s):r=e.slice(n+1,s),i=s-n-1;n=s,o=0}else a===46&&o!==-1?++o:o=-1}return r}function Oie(e,t){var r=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+i:r+e+i:i}var Sl={resolve:function(){for(var t="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=A.default.cwd()),o=i),Ko(o),o.length!==0&&(t=o+"/"+t,r=o.charCodeAt(0)===47)}return t=XM(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(Ko(t),t.length===0)return".";var r=t.charCodeAt(0)===47,i=t.charCodeAt(t.length-1)===47;return t=XM(t,!r),t.length===0&&!r&&(t="."),t.length>0&&i&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return Ko(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];Ko(i),i.length>0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":Sl.normalize(t)},relative:function(t,r){if(Ko(t),Ko(r),t===r||(t=Sl.resolve(t),r=Sl.resolve(r),t===r))return"";for(var i=1;i<t.length&&t.charCodeAt(i)===47;++i);for(var n=t.length,o=n-i,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var s=r.length,u=s-a,c=o<u?o:u,l=-1,m=0;m<=c;++m){if(m===c){if(u>c){if(r.charCodeAt(a+m)===47)return r.slice(a+m+1);if(m===0)return r.slice(a+m)}else o>c&&(t.charCodeAt(i+m)===47?l=m:m===0&&(l=0));break}var w=t.charCodeAt(i+m),E=r.charCodeAt(a+m);if(w!==E)break;w===47&&(l=m)}var P="";for(m=i+l+1;m<=n;++m)(m===n||t.charCodeAt(m)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+r.slice(a+l):(a+=l,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(Ko(t),t.length===0)return".";for(var r=t.charCodeAt(0),i=r===47,n=-1,o=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!o){n=a;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":t.slice(0,n)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ko(t);var i=0,n=-1,o=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,u=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!o){i=a+1;break}}else u===-1&&(o=!1,u=a+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(n=a):(s=-1,n=u))}return i===n?n=u:n===-1&&(n=t.length),t.slice(i,n)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!o){i=a+1;break}}else n===-1&&(o=!1,n=a+1);return n===-1?"":t.slice(i,n)}},extname:function(t){Ko(t);for(var r=-1,i=0,n=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(u===47){if(!o){i=s+1;break}continue}n===-1&&(o=!1,n=s+1),u===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||n===-1||a===0||a===1&&r===n-1&&r===i+1?"":t.slice(r,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Oie("/",t)},parse:function(t){Ko(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var i=t.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var a=-1,s=0,u=-1,c=!0,l=t.length-1,m=0;l>=o;--l){if(i=t.charCodeAt(l),i===47){if(!c){s=l+1;break}continue}u===-1&&(c=!1,u=l+1),i===46?a===-1?a=l:m!==1&&(m=1):a!==-1&&(m=-1)}return a===-1||u===-1||m===0||m===1&&a===u-1&&a===s+1?u!==-1&&(s===0&&n?r.base=r.name=t.slice(1,u):r.base=r.name=t.slice(s,u)):(s===0&&n?(r.name=t.slice(1,a),r.base=t.slice(1,u)):(r.name=t.slice(s,a),r.base=t.slice(s,u)),r.ext=t.slice(a,u)),s>0?r.dir=t.slice(0,s-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Sl.posix=Sl;JM.exports=Sl});var tN=k((F5e,eN)=>{"use strict";v();var Yt=Ae(),QM=M6(),Za;try{Za=fs()}catch{Za=null}var Iie=function(){var e=typeof A.default<"u"&&A.default.env&&A.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)};function Bi(e,t){if(!(this instanceof Bi))return new Bi(e,t);this.privateKey=e,this.publicKey=e.publicKey,this.address=e.toAddress(),t=t||{},this.storageDir=t.storageDir||(typeof A.default<"u"?QM.join(A.default.cwd(),".bsv-covenants"):".bsv-covenants"),this.covenantUtxoPath=QM.join(this.storageDir,"covenant_utxos.json"),this.sighashType=Yt.crypto.Signature.SIGHASH_ALL|Yt.crypto.Signature.SIGHASH_FORKID,this.allowNonEnforcing=t.allowNonEnforcing===!0,Za&&this._ensureStorageDir()}Bi.prototype.createFromP2PKH=function(e){if(!this.allowNonEnforcing)throw new Error("SmartContract.Covenant builds a NON-ENFORCING script that reduces to plain P2PK \u2014 it does not constrain the spend. Use SmartContract.PushTx.valueCovenant (output binding) or SmartContract.Token / perpetualCovenant (stateful covenants) for real covenants. To use this demo anyway, construct with { allowNonEnforcing: true }.");e.script||(e.script=Bi.reconstructP2pkhScript(this.address));var t=new Yt.Transaction().from({txId:e.txid,outputIndex:e.vout,script:e.script,satoshis:e.satoshis}).to(this.address,e.satoshis-1e3),r=Yt.Script.fromHex(e.script),i=Yt.Transaction.sighash.sighashPreimage(t,this.sighashType,0,r,new Yt.crypto.BN(e.satoshis)),n=Yt.crypto.Hash.sha256sha256(i),o=new Yt.Script().add("OP_DUP").add("OP_HASH256").add(n).add("OP_EQUALVERIFY").add("OP_DROP").add(this.publicKey.toBuffer()).add("OP_CHECKSIG");t.outputs[0].setScript(o),t.sign(this.privateKey);var a={txid:t.id,vout:0,satoshis:e.satoshis-1e3,script:o.toHex(),scriptPubKey:o.toHex(),preimageHash:n.toString("hex"),originalPreimage:i.toString("hex"),status:"local",createdAt:new Date().toISOString(),type:"preimage_covenant"};return{transaction:t,covenantUtxo:a}};Bi.prototype.createSpendingTx=function(e,t,r){var i=t||this.address,n=r||e.satoshis-500,o=new Yt.Transaction;o.addInput(new Yt.Transaction.Input({prevTxId:e.txid,outputIndex:e.vout,script:Yt.Script.empty()}),Yt.Script.fromHex(e.script),e.satoshis),o.to(i,n);var a=Yt.Script.fromHex(e.script),s=Yt.Transaction.sighash.sign(o,this.privateKey,this.sighashType,0,a,new Yt.crypto.BN(e.satoshis)),u=h.Buffer.concat([s.toDER(),h.Buffer.from([this.sighashType])]),c=h.Buffer.from(e.originalPreimage,"hex"),l=new Yt.Script().add(u).add(c);return o.inputs[0].setScript(l),o};Bi.prototype.validate=function(e,t){var r=new Yt.Script.Interpreter,i=Yt.Script.Interpreter.SCRIPT_VERIFY_P2SH|Yt.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|Yt.Script.Interpreter.SCRIPT_VERIFY_DERSIG|Yt.Script.Interpreter.SCRIPT_VERIFY_LOW_S|Yt.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n=e.inputs[0].script,o=Yt.Script.fromHex(t.script),a=r.verify(n,o,e,0,i,new Yt.crypto.BN(t.satoshis));return{valid:a,error:a?null:r.errstr}};Bi.prototype.save=function(e){if(!Za)return Iie("File system operations not available in browser environment"),e;var t=this.list();return t.push(e),Za.writeFileSync(this.covenantUtxoPath,JSON.stringify(t,null,2)),e};Bi.prototype.load=function(e){var t=this.list();if(e){var r=t.find(function(i){return i.txid===e});if(!r)throw new Error("Covenant UTXO with TXID "+e+" not found");return r}else{var r=t.find(function(n){return n.type==="preimage_covenant"});if(!r)throw new Error("No preimage covenant UTXO found");return r}};Bi.prototype.list=function(){return Za.existsSync(this.covenantUtxoPath)?JSON.parse(Za.readFileSync(this.covenantUtxoPath,"utf8")):[]};Bi.prototype.getPortfolio=function(){var e=this.list(),t={total:e.length,totalValue:e.reduce(function(r,i){return r+i.satoshis},0),byStatus:{},recent:e.slice(-5)};return e.forEach(function(r){var i=r.status||"local";t.byStatus[i]||(t.byStatus[i]={count:0,value:0}),t.byStatus[i].count++,t.byStatus[i].value+=r.satoshis}),t};Bi.prototype.completeFlow=function(e,t){var r=this.createFromP2PKH(e),i=this.save(r.covenantUtxo);t&&t(r.transaction,"creation");var n=this.createSpendingTx(i),o=this.validate(n,i);return t&&o.valid&&t(n,"spending"),{creationTx:r.transaction,spendingTx:n,covenantUtxo:i,validation:o,success:o.valid}};Bi.prototype._ensureStorageDir=function(){Za.existsSync(this.storageDir)||Za.mkdirSync(this.storageDir,{recursive:!0})};Bi.reconstructP2pkhScript=function(e){return Yt.Script.buildPublicKeyHashOut(e).toHex()};eN.exports=Bi});var Vo=k((z5e,rN)=>{"use strict";v();var xl=Ae(),j5e=_r();function Oe(e,t){if(!(this instanceof Oe))return new Oe(e,t);this.preimage=h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"hex"),this.options=t||{},this.strategy=this.options.strategy||"DYNAMIC",this.fields=null,this.sighashInfo=null,this.options.deferExtraction||this._extractFields()}Oe.LEFT_FIXED_LENGTH=104;Oe.RIGHT_FIXED_LENGTH=52;Oe.MIN_PREIMAGE_LENGTH=Oe.LEFT_FIXED_LENGTH+1+Oe.RIGHT_FIXED_LENGTH;Oe.prototype.extract=function(e){return this.strategy=e||this.strategy,this._extractFields(),this.fields};Oe.prototype.getSighashInfo=function(){return this.fields||this._extractFields(),this.sighashInfo};Oe.prototype.getField=function(e){return this.fields||this._extractFields(),this.fields[e]};Oe.prototype.extractField=function(e,t){t=t||{},this.fields||this._extractFields();var r=this._parsePreimageStructure(),i=this._generateBidirectionalASM(e,r,t.includeComments),n=this._extractSpecificField(e,r),o=this._interpretField(e,n,r);return{field:e,value:n?n.toString("hex"):null,buffer:n,asm:i,interpretation:o,strategy:this._getExtractionStrategy(e),structure:r._structure}};Oe.prototype.generateASM=function(e,t){var r=this._parsePreimageStructure();return this._generateBidirectionalASM(e,r,t)};Oe.prototype.extractFields=function(e){var t={};return e.forEach(function(r){t[r]=this.extractField(r)}.bind(this)),t};Oe.prototype.validate=function(){var e=[],t=[];if(this.preimage.length<Oe.MIN_PREIMAGE_LENGTH)return e.push("Preimage too short: "+this.preimage.length+" bytes (BIP-143 preimage requires at least "+Oe.MIN_PREIMAGE_LENGTH+")"),{valid:!1,errors:e,warnings:t,sighashInfo:this.sighashInfo};this.fields||this._extractFields();var r=["version","hashPrevouts","hashSequence","outpoint","scriptCode","amount","sequence","hashOutputs","locktime","sighash"];return r.forEach(function(i){this.fields[i]||e.push("Missing required field: "+i)}.bind(this)),this.sighashInfo.hasZeroHashes&&t.push("Zero hashes detected - check SIGHASH flags: "+this.sighashInfo.zeroFields.join(", ")),{valid:e.length===0,errors:e,warnings:t,sighashInfo:this.sighashInfo}};Oe.prototype.toObject=function(){return this.fields||this._extractFields(),{preimage:this.preimage.toString("hex"),length:this.preimage.length,strategy:this.strategy,fields:{version:this.fields.version?this.fields.version.toString("hex"):null,hashPrevouts:this.fields.hashPrevouts?this.fields.hashPrevouts.toString("hex"):null,hashSequence:this.fields.hashSequence?this.fields.hashSequence.toString("hex"):null,outpoint:this.fields.outpoint?this.fields.outpoint.toString("hex"):null,scriptCode:this.fields.scriptCode?this.fields.scriptCode.toString("hex"):null,scriptCodeLength:this.fields.scriptCodeLength,amount:this.fields.amount?this.fields.amount.toString("hex"):null,sequence:this.fields.sequence?this.fields.sequence.toString("hex"):null,hashOutputs:this.fields.hashOutputs?this.fields.hashOutputs.toString("hex"):null,locktime:this.fields.locktime?this.fields.locktime.toString("hex"):null,sighash:this.fields.sighash?this.fields.sighash.toString("hex"):null},sighashInfo:this.sighashInfo,validation:this.validate()}};Oe.prototype._extractFields=function(){if(this.fields={},this.sighashInfo={flag:null,hasZeroHashes:!1,zeroFields:[],warnings:[]},this.preimage.length<Oe.MIN_PREIMAGE_LENGTH)throw new Error("Preimage too short: "+this.preimage.length+" bytes (BIP-143 preimage requires at least "+Oe.MIN_PREIMAGE_LENGTH+")");try{this.strategy==="LEFT"||this.strategy==="DYNAMIC"?this._extractFromLeft():this.strategy==="RIGHT"&&this._extractFromRight(),this._analyzeSighash()}catch(e){if(this.strategy==="DYNAMIC")try{this.strategy="RIGHT",this._extractFromRight(),this._analyzeSighash()}catch{throw new Error("Failed to extract preimage fields with any strategy: "+e.message)}else throw e}};Oe.prototype._extractFromLeft=function(){var e=0;this.fields.version=this.preimage.slice(e,e+4),e+=4,this.fields.hashPrevouts=this.preimage.slice(e,e+32),e+=32,this.fields.hashSequence=this.preimage.slice(e,e+32),e+=32,this.fields.outpoint=this.preimage.slice(e,e+36),e+=36;var t=Oe.decodeCompactSize(this.preimage,e);this.fields.scriptCodeLength=t.value,e=t.nextOffset,this.fields.scriptCode=this.preimage.slice(e,e+this.fields.scriptCodeLength),e+=this.fields.scriptCodeLength,this.fields.amount=this.preimage.slice(e,e+8),e+=8,this.fields.sequence=this.preimage.slice(e,e+4),e+=4,this.fields.hashOutputs=this.preimage.slice(e,e+32),e+=32,this.fields.locktime=this.preimage.slice(e,e+4),e+=4,this.fields.sighash=this.preimage.slice(e,e+4)};Oe.prototype._extractFromRight=function(){var e=this.preimage.length,t=e;t-=4,this.fields.sighash=this.preimage.slice(t,t+4),t-=4,this.fields.locktime=this.preimage.slice(t,t+4),t-=32,this.fields.hashOutputs=this.preimage.slice(t,t+32),t-=4,this.fields.sequence=this.preimage.slice(t,t+4),t-=8,this.fields.amount=this.preimage.slice(t,t+8);var r=104,i=Oe.decodeCompactSize(this.preimage,r);this.fields.scriptCodeLength=i.value,this.fields.scriptCode=this.preimage.slice(i.nextOffset,i.nextOffset+this.fields.scriptCodeLength),this.fields.version=this.preimage.slice(0,4),this.fields.hashPrevouts=this.preimage.slice(4,36),this.fields.hashSequence=this.preimage.slice(36,68),this.fields.outpoint=this.preimage.slice(68,104)};Oe.prototype._analyzeSighash=function(){if(this.fields.sighash){var e=this.fields.sighash.readUInt32LE(0);this.sighashInfo.flag=e;var t=e&31,r=(e&128)!==0,i=(e&64)!==0,n=h.Buffer.alloc(32);r&&this.fields.hashPrevouts.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashPrevouts"),this.sighashInfo.warnings.push("ANYONECANPAY flag detected - hashPrevouts is zero")),t===2&&this.fields.hashSequence.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashSequence"),this.sighashInfo.warnings.push("SIGHASH_NONE flag detected - hashSequence is zero")),(t===2||t===3)&&this.fields.hashOutputs.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashOutputs"),this.sighashInfo.warnings.push("SIGHASH_NONE/SINGLE flag detected - hashOutputs is zero"));var o=[];t===1?o.push("ALL"):t===2?o.push("NONE"):t===3&&o.push("SINGLE"),r&&o.push("ANYONECANPAY"),i&&o.push("FORKID"),this.sighashInfo.flagName=o.join(" | ")}};Oe.prototype._parsePreimageStructure=function(){for(var e=this.preimage,t=0,r={},i=[{name:"nVersion",len:4},{name:"hashPrevouts",len:32},{name:"hashSequence",len:32},{name:"outpoint_txid",len:32},{name:"outpoint_vout",len:4}],n=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],o=0;o<i.length;o++){var a=i[o];r[a.name]=e.slice(t,t+a.len).toString("hex"),t+=a.len}var s=Oe.decodeCompactSize(e,t);r.scriptLen=s.value,r.scriptLenSize=s.bytes,r.scriptLenRaw=e.slice(t,t+s.bytes).toString("hex"),t+=s.bytes,r.scriptCode=e.slice(t,t+r.scriptLen).toString("hex"),t+=r.scriptLen;for(var u=0;u<n.length;u++){var c=n[u];r[c.name]=e.slice(t,t+c.len).toString("hex"),t+=c.len}var l=i.reduce(function(w,E){return w+E.len},0),m=n.reduce(function(w,E){return w+E.len},0);return r._structure={leftFixed:l,scriptLenVarint:s.bytes,scriptCode:r.scriptLen,rightFixed:m,totalCalculated:l+s.bytes+r.scriptLen+m,totalActual:e.length},r};Oe.prototype._generateBidirectionalASM=function(e,t,r){var i=["value","nSequence","hashOutputs","nLocktime","sighashType"],n=["nVersion","hashPrevouts","hashSequence","outpoint_txid","outpoint_vout"];if(i.includes(e))return this._generateRightExtractionASM(e,r);if(n.includes(e))return this._generateLeftExtractionASM(e,r);if(e==="scriptCode")return this._generateDynamicExtractionASM(t,r);if(e==="scriptLen")return this._generateScriptLenExtractionASM(t,r);throw new Error("Unknown field: "+e)};Oe.prototype._generateRightExtractionASM=function(e,t){for(var r=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],i=0,n=0,o=!1,a=0;a<r.length;a++){var s=r[a];if(s.name===e){n=s.len,o=!0;break}i+=s.len}if(!o)throw new Error("Field not found in RIGHT fields: "+e);var u=52,c=u-i,l=[];return t?(l.push("# \u{1F504} Extract "+e+" from RIGHT side (bidirectional strategy)"),l.push("OP_SIZE # Push preimage size: [preimage, size]")):l.push("OP_SIZE"),t?l=l.concat([c+" OP_SUB # Calculate split point: [preimage, split_point]","OP_SPLIT # Split: [left_part, right_part]","OP_NIP # Drop left (OP_SPLIT leaves right on top): [right_part]",n+" OP_SPLIT # Extract field: ["+e+", remaining]","OP_DROP # Clean up: ["+e+"]","# \u2705 Result: "+e+" is now on top of stack"]):l=l.concat([c+" OP_SUB","OP_SPLIT","OP_NIP",n+" OP_SPLIT","OP_DROP"]),l.join(`
|
|
77
77
|
`)};Oe.prototype._generateLeftExtractionASM=function(e,t){var r=[{name:"nVersion",len:4,offset:0},{name:"hashPrevouts",len:32,offset:4},{name:"hashSequence",len:32,offset:36},{name:"outpoint_txid",len:32,offset:68},{name:"outpoint_vout",len:4,offset:100}],i=r.find(function(o){return o.name===e});if(!i)throw new Error("Field not found in LEFT fields: "+e);var n=[];return t?n=["# \u{1F504} Extract "+e+" from LEFT side (bidirectional strategy)",i.offset+" OP_SPLIT # Skip to field: [prefix, remainder]","OP_NIP # Drop prefix (OP_SPLIT leaves remainder on top): [remainder]",i.len+" OP_SPLIT # Extract field: ["+e+", suffix]","OP_DROP # Clean up: ["+e+"]","# \u2705 Result: "+e+" is now on top of stack"]:n=[i.offset+" OP_SPLIT","OP_NIP",i.len+" OP_SPLIT","OP_DROP"],n.join(`
|
|
78
78
|
`)};Oe.prototype._generateDynamicExtractionASM=function(e,t){var r=104+e.scriptLenSize;return["# \u{1F3AF} Extract scriptCode DYNAMICALLY with CompactSize varint support",r+" OP_SPLIT # Skip left zone + scriptLen varint: [left_zone, remainder]","OP_NIP # Drop left (OP_SPLIT leaves remainder on top): [remainder]",e.scriptLen+" OP_SPLIT # Extract scriptCode: [scriptCode, right_zone]","OP_DROP # Clean up: [scriptCode]","# \u2705 Result: scriptCode extracted with "+e.scriptLenSize+"-byte varint awareness"].join(`
|
|
@@ -95,8 +95,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
95
95
|
[${a+1}/${n.length}] Step (${u})`);try{if(typeof i.step=="function")i.step();else{console.log("\u26A0\uFE0F Step-by-step execution not supported in this BSV version"),console.log("\u{1F4A1} Consider using runFullEvaluation instead");break}console.log(`\u{1F9E9} Executed: ${u}`),A8(i.stack,i.altstack)}catch(c){console.log(`\u26A0\uFE0F Error executing ${u}: ${c.message}`);break}}o&&o.close(),console.log(`
|
|
96
96
|
===========================================`),console.log("\u2705 Final Stack State:"),A8(i.stack||[],i.altstack||[]),console.log("===========================================")}function PN(e,t,r){console.log("==========================================="),console.log("\u{1F50D} SCRIPT INTERPRETER DEBUGGER (FULL RUN)"),console.log(`===========================================
|
|
97
97
|
`);let i=new Lr.Script.Interpreter,n=new Lr.crypto.BN(1e5),o=i.verify(e,t,r,0,Lr.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n);console.log("\u{1F510} Locking Script:",t.toASM()),console.log("\u{1F513} Unlocking Script:",e.toASM()),console.log("-------------------------------------------"),console.log("\u2705 Result:",o?"TRUE (Success)":"\u274C FALSE (Failure)"),console.log("Final Stack:",i.stack.map(a=>a.toString("hex"))),console.log("AltStack:",i.altstack.map(a=>a.toString("hex"))),console.log("===========================================")}async function TN(){if(typeof A.default>"u"||!A.default.argv){console.log("\u2699\uFE0F CLI mode not available in browser environment");return}let e=A.default.argv.slice(2),t=w=>{let E=e.indexOf(w);return E!==-1&&e[E+1]?e[E+1]:null},r=t("--unlocking"),i=t("--locking"),n=t("--combined"),o=e.includes("--step"),a=e.includes("--truth"),s,u,c;if(n)c=C6(n);else{s=C6(r),u=C6(i);let w=h.Buffer.concat([s.toBuffer(),u.toBuffer()]);c=Lr.Script.fromBuffer(w)}let l=new Lr.Transaction,m=new Lr.Transaction.Input({prevTxId:"0".repeat(64),outputIndex:0,script:Lr.Script.empty(),satoshis:1e5,output:new Lr.Transaction.Output({satoshis:1e5,script:Lr.Script.empty()})});l.addInput(m),l.addOutput(new Lr.Transaction.Output({satoshis:1e5,script:Lr.Script.empty()})),o?await AN(c,l,!0):a?PN(s||Lr.Script.empty(),u||Lr.Script.empty(),l):console.log("\u2699\uFE0F No mode specified. Use --step or --truth")}P8.exports={parseScript:C6,printStack:A8,stepThroughScript:AN,runFullEvaluation:PN,main:TN};typeof Fr<"u"&&Fr.main===P8&&TN()});var Go=k((_ge,NN)=>{"use strict";v();var vi=Ae(),L6=fr(),Kie=cr(),RN=Vr(),T8=RN.SIGHASH_ALL|RN.SIGHASH_FORKID;function BN(){var e=vi.Script.Interpreter;return e.SCRIPT_VERIFY_P2SH|e.SCRIPT_VERIFY_STRICTENC|e.SCRIPT_VERIFY_DERSIG|e.SCRIPT_VERIFY_LOW_S|e.SCRIPT_VERIFY_MINIMALDATA|e.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|e.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY|e.SCRIPT_ENABLE_SIGHASH_FORKID|e.SCRIPT_ENABLE_MAGNETIC_OPCODES|e.SCRIPT_ENABLE_MONOLITH_OPCODES}function Vie(e){return vi.Script.Interpreter.useGenesisLimits(e)}function Gie(e,t,r){r=r||{};var i=new vi.Script.Interpreter,n=i.verify(e,t,r.tx||new vi.Transaction,r.inputIndex||0,r.flags||BN(),new L6(r.satoshis||0));return{ok:n,err:i.errstr||""}}function MN(e,t,r,i,n){return vi.Transaction.sighash.sighashPreimage(e,n||T8,t,r,new L6(i))}function Zie(e,t,r,i,n){return Kie.sha256sha256(MN(e,t,r,i,n))}function Wie(e,t,r,i,n,o){o=o||T8;var a=vi.Transaction.sighash.sign(e,t,o,r,i,new L6(n));return h.Buffer.concat([a.toDER(),h.Buffer.from([o])])}function Yie(e,t,r){r=r||{};var i=new vi.Transaction().addOutput(new vi.Transaction.Output({script:e,satoshis:t})),n=new vi.Transaction;return n.addInput(new vi.Transaction.Input({prevTxId:i.hash,outputIndex:0,script:vi.Script.empty()}),e,t),r.outputs&&r.outputs.forEach(function(o){n.addOutput(o)}),{funding:i,spend:n}}function $ie(e,t){var r=e.toAddress?e.toAddress():e;return new vi.Transaction.Output({script:vi.Script.buildPublicKeyHashOut(r),satoshis:t})}function Xie(e){return e===0?vi.Opcode.OP_0:e===-1?vi.Opcode.OP_1NEGATE:e>=1&&e<=16?vi.Opcode["OP_"+e]:new L6(e).toScriptNumBuffer()}NN.exports={SIGHASH:T8,flags:BN,enableGenesis:Vie,verify:Gie,rawPreimage:MN,sighashDigest:Zie,signInput:Wie,fundAndSpend:Yie,p2pkhOutput:$ie,scriptNum:Xie}});var FN=k((Sge,UN)=>{"use strict";v();var CN=Ae(),DN=cr(),LN=Go(),ao=CN.Script,Ar=CN.Opcode,_1=LN.signInput,qN=LN.scriptNum;function Jie(e){var t=DN.sha256(e),r=new ao().add(Ar.OP_SHA256).add(t).add(Ar.OP_EQUAL);return{lock:r,meta:{name:"hash-lock",digest:t.toString("hex")},unlock:function(i,n,o){return new ao().add(o||e)}}}function Qie(e){var t=e.toPublicKey(),r=ao.buildPublicKeyHashOut(t.toAddress());return{lock:r,meta:{name:"p2pkh",address:t.toAddress().toString()},unlock:function(i,n){return new ao().add(_1(i,e,0,r,n)).add(t.toBuffer())}}}function ene(e,t){var r=e.toPublicKey(),i=new ao().add(qN(t)).add(Ar.OP_CHECKLOCKTIMEVERIFY).add(Ar.OP_DROP).add(r.toBuffer()).add(Ar.OP_CHECKSIG);return{lock:i,meta:{name:"cltv-timelock",locktime:t},unlock:function(n,o){return new ao().add(_1(n,e,0,i,o))}}}function tne(e,t){var r=t.map(function(n){return n.toPublicKey()}),i=new ao().add(Ar["OP_"+e]);return r.forEach(function(n){i.add(n.toBuffer())}),i.add(Ar["OP_"+r.length]).add(Ar.OP_CHECKMULTISIG),{lock:i,meta:{name:e+"-of-"+r.length+"-multisig"},unlock:function(n,o,a){a=a||t.slice(0,e);var s=new ao().add(Ar.OP_0);return a.forEach(function(u){s.add(_1(n,u,0,i,o))}),s}}}function rne(e){var t=DN.sha256(e.secret),r=new ao().add(Ar.OP_IF).add(Ar.OP_SHA256).add(t).add(Ar.OP_EQUALVERIFY).add(e.receiver.toPublicKey().toBuffer()).add(Ar.OP_CHECKSIG).add(Ar.OP_ELSE).add(qN(e.timeout)).add(Ar.OP_CHECKLOCKTIMEVERIFY).add(Ar.OP_DROP).add(e.sender.toPublicKey().toBuffer()).add(Ar.OP_CHECKSIG).add(Ar.OP_ENDIF);return{lock:r,meta:{name:"htlc",digest:t.toString("hex"),timeout:e.timeout},unlockClaim:function(i,n){return new ao().add(_1(i,e.receiver,0,r,n)).add(e.secret).add(Ar.OP_1)},unlockRefund:function(i,n){return new ao().add(_1(i,e.sender,0,r,n)).add(Ar.OP_0)}}}UN.exports={hashLock:Jie,p2pkh:Qie,timeLockCLTV:ene,multisig:tne,htlc:rne}});var Pl=k((Ege,WN)=>{"use strict";v();var R8=Ae(),q6=fr(),HN=cr(),B8=Go(),jN=R8.Script,Nt=R8.Opcode,M8=B8.SIGHASH,U6=B8.scriptNum,Al=h.Buffer.from("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","hex"),N8=new q6("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16),ine=h.Buffer.concat([h.Buffer.from([2]),Al]),zN=h.Buffer.from(Al).reverse(),KN=h.Buffer.concat([h.Buffer.from(N8.toBuffer()).reverse(),h.Buffer.from([0])]),nne=h.Buffer.concat([h.Buffer.from([48,68,2,32]),Al,h.Buffer.from([2,32])]);function k8(e,t){var r;for(r=0;r<t-1;r++)e.add(Nt.OP_1).add(Nt.OP_SPLIT);for(r=0;r<t-1;r++)e.add(Nt.OP_SWAP).add(Nt.OP_CAT);return e}var Zo=R8.crypto.Signature,one=Zo.SIGHASH_ALL|Zo.SIGHASH_FORKID,ane=Zo.SIGHASH_SINGLE|Zo.SIGHASH_FORKID,sne=Zo.SIGHASH_SINGLE|Zo.SIGHASH_ANYONECANPAY|Zo.SIGHASH_FORKID,une=Zo.SIGHASH_ALL|Zo.SIGHASH_ANYONECANPAY|Zo.SIGHASH_FORKID;function C8(e,t){var r=t&&t.sighashType||M8;return e.add(Nt.OP_HASH256),k8(e,32),e.add(zN).add(Nt.OP_ADD),e.add(KN).add(Nt.OP_MOD),e.add(U6(32)).add(Nt.OP_NUM2BIN),k8(e,32),e.add(Al).add(Nt.OP_DUP),e.add(Nt.OP_2).add(Nt.OP_SWAP).add(Nt.OP_CAT),e.add(Nt.OP_TOALTSTACK),e.add(h.Buffer.from([48,68,2,32])).add(Nt.OP_SWAP).add(Nt.OP_CAT),e.add(h.Buffer.from([2,32])).add(Nt.OP_CAT),e.add(Nt.OP_SWAP).add(Nt.OP_CAT),e.add(h.Buffer.from([r])).add(Nt.OP_CAT),e.add(Nt.OP_FROMALTSTACK).add(Nt.OP_CHECKSIG),e}function fne(){return C8(new jN)}function VN(e){return e.add(U6(40)).add(Nt.OP_RIGHT).add(U6(32)).add(Nt.OP_LEFT),e}function cne(e){return GN(e,M8)}function GN(e,t){var r=h.Buffer.from([t&255,0,0,0]);return e.add(Nt.OP_DUP).add(U6(4)).add(Nt.OP_RIGHT).add(r).add(Nt.OP_EQUALVERIFY),e}function lne(e){var t=h.Buffer.concat(e.map(function(r){return r.toBufferWriter().toBuffer()}));return HN.sha256sha256(t)}function hne(e){var t=new jN().add(Nt.OP_DUP);return C8(t),t.add(Nt.OP_VERIFY),VN(t),t.add(h.Buffer.from(e)).add(Nt.OP_EQUAL),t}var dne=new q6("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex");function ZN(e){var t=HN.sha256sha256(e);if(t[0]<1||t[0]>127)return null;var r=new q6(t).add(new q6(Al)).mod(N8);if(r.gt(dne))return null;var i=r.toBuffer("be",32);return i[0]>=1?i:null}function pne(e,t,r,i,n){typeof n=="number"&&(n={maxTries:n}),n=n||{};var o=n.maxTries||5e3,a=n.start||0,s=n.field||"nLockTime",u=n.sighashType||M8;if(s!=="nLockTime"&&s!=="sequence")throw new Error("grind field must be 'nLockTime' or 'sequence'");for(var c=e.inputs[t],l=0;l<o;l++){var m=a+l;s==="nLockTime"?e.nLockTime=m:c.sequenceNumber=4294967294-m;var w=B8.rawPreimage(e,t,r,i,u);if(ZN(w))return{preimage:w,tries:l+1,field:s,nonce:m}}throw new Error("OP_PUSH_TX grind failed after "+o+" tries")}WN.exports={Gx:Al,N:N8,PUBKEY:ine,gxLe:zN,N_LE:KN,DER_PREFIX:nne,reverseBytes:k8,pushTxCore:C8,authenticator:fne,extractHashOutputs:VN,assertSighashAll:cne,assertSighashType:GN,SIGHASH_ALL_FORKID:one,SIGHASH_SINGLE_FORKID:ane,SIGHASH_SINGLE_ANYONECANPAY_FORKID:sne,SIGHASH_ALL_ANYONECANPAY_FORKID:une,hashOutputs:lne,valueCovenant:hne,sFromPreimage:ZN,grind:pne}});var L8=k((Ige,$N)=>{"use strict";v();var YN=Ae(),D8=Pl(),gne=Go(),vne=YN.Script,Pr=YN.Opcode,Tl=gne.scriptNum;function mne(e){var t=new vne;return t.add(Pr.OP_DUP),D8.pushTxCore(t),t.add(Pr.OP_VERIFY),D8.assertSighashAll(t),t.add(Pr.OP_DUP),t.add(Tl(104)).add(Pr.OP_SPLIT).add(Pr.OP_NIP),t.add(Pr.OP_SIZE).add(Tl(52)).add(Pr.OP_SUB).add(Pr.OP_SPLIT).add(Pr.OP_DROP),t.add(Pr.OP_OVER),t.add(Tl(52)).add(Pr.OP_RIGHT).add(Tl(8)).add(Pr.OP_LEFT),t.add(Pr.OP_BIN2NUM).add(Tl(e)).add(Pr.OP_SUB),t.add(Tl(8)).add(Pr.OP_NUM2BIN),t.add(Pr.OP_SWAP).add(Pr.OP_CAT),t.add(Pr.OP_HASH256),t.add(Pr.OP_SWAP),D8.extractHashOutputs(t),t.add(Pr.OP_EQUAL),t}$N.exports={pelsCovenant:mne}});var F8=k((Pge,JN)=>{"use strict";v();var H6=Ae(),XN=cr(),U8=Go(),$t=H6.Opcode,kl=U8.scriptNum;function F6(e){return e instanceof H6.PrivateKey?e.toPublicKey().toBuffer():e instanceof H6.PublicKey?e.toBuffer():e}function yne(){return{name:"single-key",commit:function(e){return XN.sha256ripemd160(F6(e))},emit:function(e){return e.add($t.OP_OVER).add($t.OP_HASH160).add($t.OP_EQUALVERIFY),e.add($t.OP_CHECKSIGVERIFY),e},unlockArgs:function(e,t,r,i,n){var o=U8.signInput(e,n,t,r,i);return[o,n.toPublicKey().toBuffer()]}}}function q8(e,t){var r=t.length;if(e<1||e>r||r<1||r>16)throw new Error("multisig requires 1 <= m <= n <= 16");var i=new H6.Script().add($t["OP_"+e]);return t.forEach(function(n){i.add(h.Buffer.from(n))}),i.add($t["OP_"+r]).add($t.OP_CHECKMULTISIG),i.toBuffer()}function bne(e,t){if(e<1||e>t||t<1||t>16)throw new Error("multisig requires 1 <= m <= n <= 16");return{name:e+"-of-"+t+"-multisig",m:e,n:t,commit:function(r){if(r.length!==t)throw new Error("expected "+t+" public keys");return XN.sha256ripemd160(q8(e,r.map(F6)))},emit:function(r){r.add($t.OP_OVER).add($t.OP_HASH160).add($t.OP_EQUALVERIFY),r.add(kl(1)).add($t.OP_SPLIT).add($t.OP_NIP),r.add($t.OP_SIZE).add(kl(2)).add($t.OP_SUB).add($t.OP_SPLIT).add($t.OP_DROP);for(var i=0;i<this.n;i++)r.add(kl(34)).add($t.OP_SPLIT),r.add($t.OP_SWAP).add(kl(1)).add($t.OP_SPLIT).add($t.OP_NIP),r.add($t.OP_TOALTSTACK);for(r.add($t.OP_DROP),r.add(kl(this.m)),i=0;i<this.n;i++)r.add($t.OP_FROMALTSTACK);return r.add(kl(this.n)),r.add($t.OP_CHECKMULTISIGVERIFY),r},unlockArgs:function(r,i,n,o,a){var s=a.keys;if(s.length!==t)throw new Error("expected "+t+" public keys in signer.keys");var u=q8(e,s.map(F6)),c=s.map(F6).map(function(w){return w.toString("hex")}),l=a.signWith.map(function(w){var E=c.indexOf(w.toPublicKey().toBuffer().toString("hex"));if(E<0)throw new Error("signWith key is not in the committed key set");return{idx:E,priv:w}}).sort(function(w,E){return E.idx-w.idx}).slice(0,e);if(l.length<e)throw new Error("need at least "+e+" signing keys");var m=l.map(function(w){return U8.signInput(r,w.priv,i,n,o)});return[$t.OP_0].concat(m).concat([u])}}}function _ne(e){if(!e||typeof e.emit!="function"||typeof e.unlockArgs!="function"||typeof e.commit!="function")throw new Error("predicate authorizer needs { commit, emit, unlockArgs } functions");return{name:e.name||"predicate",commit:e.commit,emit:e.emit,unlockArgs:e.unlockArgs}}JN.exports={singleKey:yne,multisig:bne,predicate:_ne,redeemScript:q8}});var z8=k((kge,aC)=>{"use strict";v();var H8=Ae(),w1=Pl(),j8=Go(),S1=F8(),j6=H8.Script,Ie=H8.Opcode,Wo=j8.scriptNum;function eC(e,t){var r=h.Buffer.isBuffer(e)?e:t.commit(e);if(r.length!==20)throw new Error("owner commitment must be 20 bytes (HASH160)");return r}function QN(e,t){return t.length?e.add(h.Buffer.from(t)):e.add(Ie.OP_0)}function tC(e,t){return e.add(Ie.OP_DUP),w1.pushTxCore(e),e.add(Ie.OP_VERIFY),w1.assertSighashAll(e),e.add(Ie.OP_DUP).add(Wo(52)).add(Ie.OP_RIGHT).add(Wo(8)).add(Ie.OP_LEFT).add(Ie.OP_TOALTSTACK),e.add(Ie.OP_DUP),w1.extractHashOutputs(e),e.add(Ie.OP_TOALTSTACK),e.add(Wo(104)).add(Ie.OP_SPLIT).add(Ie.OP_NIP).add(Ie.OP_SIZE).add(Wo(52)).add(Ie.OP_SUB).add(Ie.OP_SPLIT).add(Ie.OP_DROP),e.add(Ie.OP_DUP).add(Wo(4)).add(Wo(20)).add(Ie.OP_SUBSTR),e.add(Ie.OP_SWAP).add(Ie.OP_TOALTSTACK),t.emit(e),e.add(Ie.OP_FROMALTSTACK),e}function rC(e){return e.add(Wo(4)).add(Ie.OP_SPLIT).add(Wo(20)).add(Ie.OP_SPLIT).add(Ie.OP_NIP),e.add(Ie.OP_TOALTSTACK),e.add(Ie.OP_SWAP).add(Ie.OP_CAT),e.add(Ie.OP_FROMALTSTACK).add(Ie.OP_CAT),e}function iC(e){var t=e.toBuffer().length;if(t<=252||t>65535)throw new Error("token script length must use a 3-byte varint (253..65535); got "+t);return e}function wne(e,t,r){r=r||S1.singleKey();var i=new j6;return i.add(eC(t,r)),i.add(Ie.OP_DROP),tC(i,r),rC(i),i.add(Ie.OP_FROMALTSTACK),i.add(Ie.OP_SWAP),i.add(Ie.OP_FROMALTSTACK),i.add(Ie.OP_BIN2NUM).add(Wo(e)).add(Ie.OP_SUB).add(Wo(8)).add(Ie.OP_NUM2BIN),i.add(Ie.OP_SWAP).add(Ie.OP_CAT),i.add(Ie.OP_HASH256),i.add(Ie.OP_EQUAL),iC(i)}function nC(e,t){t=t||S1.singleKey();var r=new j6;return r.add(eC(e,t)),r.add(Ie.OP_DROP),tC(r,t),rC(r),r.add(Ie.OP_CAT),r.add(Ie.OP_SWAP).add(Ie.OP_CAT),r.add(Ie.OP_CAT),r.add(Ie.OP_FROMALTSTACK),r.add(Ie.OP_FROMALTSTACK).add(Ie.OP_DROP),r.add(Ie.OP_SWAP).add(Ie.OP_HASH256).add(Ie.OP_EQUAL),iC(r)}function Sne(e){return S1.singleKey().commit(e)}function xne(e,t,r,i,n,o){o=o||{};var a=o.auth||S1.singleKey(),s=o.inputIndex||0;if(t.length!==20)throw new Error("newOwnerHash must be 20 bytes (HASH160)");if(i<=1&&!o.allowLowValue)throw new Error("unlockTransfer: single-output token sets output = input - fee, which burns a "+i+"-sat UTXO (e.g. a 1-sat ordinal). Use Token.transferOrdinal / ownershipTokenMulti to preserve the satoshi.");w1.grind(r,s,n,i,o.grind);var u=j8.rawPreimage(r,s,n,i),c=a.unlockArgs(r,s,n,i,e),l=new j6().add(h.Buffer.from(t));return c.forEach(function(m){l.add(m)}),l.add(h.Buffer.from(u)),l}function oC(e,t,r,i,n,o,a){a=a||{};var s=a.auth||S1.singleKey(),u=a.inputIndex||0;if(t.length!==20)throw new Error("newOwnerHash must be 20 bytes (HASH160)");if(!o||o.tokenValue==null||o.tokenValue.length!==8)throw new Error("layout.tokenValue must be the 8-byte LE value of the token output");w1.grind(r,u,n,i,a.grind);var c=j8.rawPreimage(r,u,n,i),l=s.unlockArgs(r,u,n,i,e),m=new j6;return QN(m,o.before||h.Buffer.alloc(0)),QN(m,o.after||h.Buffer.alloc(0)),m.add(h.Buffer.from(o.tokenValue)),m.add(h.Buffer.from(t)),l.forEach(function(w){m.add(w)}),m.add(h.Buffer.from(c)),m}function Ene(e,t){return nC(e,t)}function One(e,t,r,i,n,o){o=o||{},i==null&&(i=1);var a=o.tokenIndex||0,s=r.outputs||[],u=s[a];if(!u)throw new Error("transferOrdinal: spend has no output at tokenIndex "+a);if(u.satoshis!==i)throw new Error("transferOrdinal: token output value ("+u.satoshis+" sat) must equal the ordinal value ("+i+" sat) to avoid burning the inscription");function c(E){return E.toBufferWriter().toBuffer()}var l=h.Buffer.concat(s.slice(0,a).map(c)),m=h.Buffer.concat(s.slice(a+1).map(c)),w=new H8.crypto.BN(i).toBuffer({endian:"little",size:8});return oC(e,t,r,i,n,{before:l,after:m,tokenValue:w},o)}aC.exports={ownershipToken:wne,ownershipTokenMulti:nC,ordinalLock:Ene,ownerId:Sne,unlockTransfer:xne,unlockTransferMulti:oC,transferOrdinal:One}});var $8=k((Bge,sC)=>{"use strict";v();var Z8=Ae(),z6=Pl(),Ine=L8(),Ane=z8(),W8=Go(),V8=Z8.Script,xn=Z8.Opcode,G8=Z8.Transaction,K8=W8.scriptNum;function Pne(e,t){return e instanceof G8.Output?e:e instanceof V8?new G8.Output({script:e,satoshis:t}):W8.p2pkhOutput(e,t)}function Tne(e,t,r,i,n,o){o=o||5e4;for(var a=0;a<o;a++){e.nLockTime=n+a;var s=W8.rawPreimage(e,t,r,i);if(z6.sFromPreimage(s))return s}throw new Error("covenant grind failed after "+o+" tries")}function $a(){if(!(this instanceof $a))return new $a;this._outputs=[],this._minLockTime=null}$a.prototype.payTo=function(e,t){return this._outputs.push(Pne(e,t)),this};$a.prototype.lockUntil=function(e){return this._minLockTime=e,this};$a.prototype.outputs=function(){return this._outputs.map(function(e){return new G8.Output(e.toObject())})};$a.prototype.describe=function(){var e=[];return this._outputs.forEach(function(t,r){e.push("output["+r+"] = "+t.satoshis+" sat to "+t.script.toASM().slice(0,24)+"...")}),this._minLockTime!==null&&e.push("nLockTime >= "+this._minLockTime),"spend allowed iff: "+e.join(" AND ")};$a.prototype.compile=function(){if(this._outputs.length===0&&this._minLockTime===null)throw new Error("empty policy: add at least one constraint (payTo / lockUntil)");var e=this,t=new V8().add(xn.OP_DUP);if(z6.pushTxCore(t),t.add(xn.OP_VERIFY),this._outputs.length){var r=z6.hashOutputs(this._outputs);t.add(xn.OP_DUP),z6.extractHashOutputs(t),t.add(h.Buffer.from(r)).add(xn.OP_EQUALVERIFY)}return this._minLockTime!==null&&(t.add(xn.OP_DUP),t.add(K8(8)).add(xn.OP_RIGHT).add(K8(4)).add(xn.OP_LEFT),t.add(xn.OP_BIN2NUM).add(K8(this._minLockTime)).add(xn.OP_GREATERTHANOREQUAL).add(xn.OP_VERIFY)),t.add(xn.OP_DROP).add(xn.OP_1),{lock:t,outputs:e.outputs(),describe:function(){return e.describe()},unlock:function(i,n,o){o=o||0;var a=e._minLockTime===null?0:e._minLockTime;return e._minLockTime!==null&&(i.inputs[o].sequenceNumber=4294967294),new V8().add(Tne(i,o,t,n,a))}}};function Y8(){return new $a}Y8.perpetual=function(e){return Ine.pelsCovenant(e)};Y8.token=function(e,t){return Ane.ownershipToken(e,t)};sC.exports={policy:Y8,Policy:$a}});var hC=k((Nge,lC)=>{"use strict";v();var K6=Ae(),kne=Go();function fC(e){if(e===0)return"OP_0";if(e>=1&&e<=75)return"PUSH("+e+")";if(e===76)return"OP_PUSHDATA1";if(e===77)return"OP_PUSHDATA2";if(e===78)return"OP_PUSHDATA4";try{return K6.Opcode.fromNumber(e).toString()}catch{return"0x"+e.toString(16)}}function uC(e,t){t=t||16;var r=h.Buffer.from(e).toString("hex");return r.length<=t*2?r||"0":r.slice(0,t*2)+"...("+e.length+"B)"}function Rne(e,t,r){r=r||{};var i=new K6.Script.Interpreter,n=[];i.stepListener=function(a,s,u){n.push({phase:i.script===t?"lock":"unlock",op:fC(a.opcode&&typeof a.opcode.toNumber=="function"?a.opcode.toNumber():a.opcode.num),stack:s.map(function(c){return uC(c)}),altstack:u.map(function(c){return uC(c)})})};var o=i.verify(e,t,r.tx||new K6.Transaction,r.inputIndex||0,typeof r.flags=="number"?r.flags:kne.flags(),new K6.crypto.BN(r.satoshis||0));return{ok:o,err:i.errstr||"",steps:n}}function cC(e){var t=[],r=null;return e.steps.forEach(function(i,n){i.phase!==r&&(t.push("-- "+i.phase+" script --"),r=i.phase);var o=i.stack.length?i.stack.join(" | "):"(empty)",a=i.altstack.length?" alt:["+i.altstack.join(" | ")+"]":"";t.push(String(n).padStart(3)+" "+i.op.padEnd(16)+" -> ["+o+"]"+a)}),t.push((e.ok?"VALID":"INVALID")+(e.err?" ("+e.err+")":"")),t.join(`
|
|
98
|
-
`)}function Bne(e){return console.log(cC(e)),e}lC.exports={trace:Rne,format:cC,print:Bne,opLabel:fC}});var pC=k((Dge,dC)=>{"use strict";v();var x1=Ae(),re={Covenant:tN(),Preimage:Vo(),SIGHASH:nN(),Builder:aN(),UTXOGenerator:gN(),ScriptTester:mN(),CovenantBuilder:S8().CovenantBuilder,CovenantTemplates:S8().CovenantTemplates,OpcodeMap:b8(),ScriptUtils:EN(),StackExaminer:IN(),ScriptInterpreter:kN(),CovenantHelpers:Go(),Locks:FN(),PushTx:Pl(),PELS:L8(),Token:z8(),Authorizers:F8(),DSL:$8(),Policy:$8().Policy,Debugger:hC()};re.policy=re.DSL.policy;re.trace=function(e,t,r){return re.Debugger.trace(e,t,r)};re.enableGenesis=function(e){return re.CovenantHelpers.enableGenesis(e)};re.verifyScript=function(e,t,r){return re.CovenantHelpers.verify(e,t,r)};re.perpetualCovenant=function(e){return re.PELS.pelsCovenant(e)};re.ownershipToken=function(e,t){return re.Token.ownershipToken(e,t)};re.valueCovenant=function(e){return re.PushTx.valueCovenant(e)};re.ordinalLock=function(e,t){return re.Token.ordinalLock(e,t)};re.transferOrdinal=function(e,t,r,i,n,o){return re.Token.transferOrdinal(e,t,r,i,n,o)};re.createCovenant=function(e,t){return new re.Covenant(e,t)};re.extractPreimage=function(e,t){return new re.Preimage(e,t)};re.analyzeSIGHASH=function(e){return new re.SIGHASH(e)};re.buildCovenant=function(e,t){return new re.Builder(e,t)};re.createUTXOGenerator=function(e){return new re.UTXOGenerator(e)};re.createTestEnvironment=function(e){return re.UTXOGenerator.createTestEnvironment(e)};re.testScript=function(e,t,r){return re.ScriptTester.test(e,t,r)};re.testCovenant=function(e,t,r){return re.ScriptTester.testCovenant(e,t,r)};re.testFieldExtraction=function(e,t,r){return re.ScriptTester.testFieldExtraction(e,t,r)};re.debugScript=function(e,t){var r=new re.ScriptTester(t);return r.debug(e)};re.explainZeroHashes=function(){return re.SIGHASH.explainZeroMystery()};re.getAllSIGHASHTypes=function(){return re.SIGHASH.getAllTypes()};re.demonstrateAllSIGHASH=function(){return re.SIGHASH.generateAllDemonstrations()};re.createCovenantBuilder=function(){return new re.CovenantBuilder};re.createValueLockCovenant=function(e){return re.CovenantTemplates.valueLock(e)};re.createHashLockCovenant=function(e){return re.CovenantTemplates.hashLock(e)};re.createComplexValidationCovenant=function(e){return re.CovenantTemplates.complexValidation(e)};re.getOpcodeMap=function(){return re.OpcodeMap.opcodeMap};re.simulateScript=function(e,t){return re.OpcodeMap.utils.simulate(e,t)};re.createASMFromJS=function(e){return re.OpcodeMap.utils.createASM(e)};re.scriptToASM=function(e){return re.ScriptUtils.scriptToASM(e)};re.asmToScript=function(e){return re.ScriptUtils.asmToScript(e)};re.asmToHex=function(e){return re.ScriptUtils.asmToHex(e)};re.hexToASM=function(e){return re.ScriptUtils.hexToASM(e)};re.scriptToHex=function(e){return re.ScriptUtils.scriptToHex(e)};re.validateASM=function(e){return re.ScriptUtils.validateASM(e)};re.validateScript=function(e){return re.ScriptUtils.validateScript(e)};re.estimateScriptSize=function(e){return re.ScriptUtils.estimateScriptSize(e)};re.optimizeScript=function(e){return re.ScriptUtils.optimizeScript(e)};re.compareScripts=function(e,t){return re.ScriptUtils.compareScripts(e,t)};re.explainScript=function(e){return re.ScriptUtils.explainScript(e)};re.scriptMetrics=function(e){return re.ScriptUtils.scriptMetrics(e)};re.analyzeComplexity=function(e){return re.ScriptUtils.analyzeComplexity(e)};re.findOptimizations=function(e){return re.ScriptUtils.findOptimizations(e)};re.covenantToEnglish=function(e){return re.ScriptUtils.covenantToEnglish(e)};re.batchTestScripts=function(e,t){return re.ScriptUtils.batchTestScripts(e,t)};re.examineStack=function(e,t){return re.StackExaminer.runScript(e,t)};re.debugScriptExecution=function(e,t,r){return r=r||{},r.stepMode?re.ScriptInterpreter.stepThroughScript(re.ScriptInterpreter.parseScript(e+" "+t),new x1.Transaction,!0):re.ScriptInterpreter.runFullEvaluation(re.ScriptInterpreter.parseScript(e),re.ScriptInterpreter.parseScript(t),new x1.Transaction)};re.parseScript=function(e){return re.ScriptInterpreter.parseScript(e)};re.printStack=function(e,t){return re.ScriptInterpreter.printStack(e,t)};re.createQuickCovenant=function(e,t){let r=re.createCovenantBuilder();switch(e){case"value_lock":return r.comment(`Value lock: minimum ${t.value} satoshis`).extractField("value").push(t.value).greaterThanOrEqual().verify().build();case"hash_lock":return r.comment(`Hash lock: requires preimage of ${t.hash}`).push("secret_placeholder").sha256().push(t.hash).equalVerify().build();case"time_lock":return r.comment(`Time lock: requires nLockTime > ${t.timestamp}`).extractField("nLockTime").push(t.timestamp).greaterThan().verify().build();case"multi_condition":let i=r.comment("Multi-condition covenant");return t.conditions.forEach(n=>{switch(n.type){case"value":i=i.extractField("value").push(n.value).greaterThanOrEqual().verify();break;case"hash":i=i.push("secret_placeholder").sha256().push(n.hash).equalVerify();break;case"time":i=i.extractField("nLockTime").push(n.timestamp).greaterThan().verify();break}}),i.build();default:throw new Error(`Unknown covenant type: ${e}`)}};re.completeCovenantFlow=function(e,t,r){var i=new re.Covenant(e);return i.completeFlow(t,r)};re.getEducationalResources=function(){return{zeroHashMystery:re.SIGHASH.explainZeroMystery(),sighashTypes:re.SIGHASH.getAllTypes(),exampleDemonstrations:re.SIGHASH.generateAllDemonstrations()}};re.utils={};re.utils.reconstructP2pkhScript=function(e){return x1.Script.buildPublicKeyHashOut(e).toHex()};re.utils.createCovenantAddress=function(e){var t=x1.crypto.Hash.sha256ripemd160(e.toBuffer());return x1.Address.fromScriptHash(t)};re.utils.decodeCompactSize=function(e,t){return re.Preimage.decodeCompactSize(e,t)};re.version=Fm();re.description="Smart Contract Framework for Bitcoin SV";re.features={BIP143_PREIMAGE:!0,COMPACT_SIZE_VARINT:!0,BIDIRECTIONAL_EXTRACTION:!0,SIGHASH_DETECTION:!0,ZERO_HASH_WARNINGS:!0,MULTI_FIELD_VALIDATION:!0,REAL_UTXO_GENERATION:!0,SCRIPT_TESTING:!0,LOCAL_VERIFICATION:!0,JAVASCRIPT_TO_SCRIPT:!0,OPCODE_MAPPING:!0,COVENANT_BUILDER:!0,SCRIPT_ANALYSIS:!0,SCRIPT_OPTIMIZATION:!0,SCRIPT_CONVERSION:!0,BATCH_TESTING:!0,QUICK_COVENANTS:!0,SCRIPT_EXPLANATIONS:!0,STACK_EXAMINATION:!0,SCRIPT_DEBUGGING:!0,STEP_BY_STEP_EXECUTION:!0,INTERACTIVE_DEBUGGING:!0};re.interpretScript=re.debugScriptExecution;re.getScriptMetrics=re.scriptMetrics;dC.exports=re});var gC=k((qge,E1)=>{"use strict";v();var V6=function(){var e=typeof A.default<"u"&&A.default.env&&A.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)},Xa={MEMORY:"memory",SESSION:"session",LOCAL:"local"};function Si(e){e=e||{},this.options={storage:e.storage||Xa.MEMORY,storageKey:e.storageKey||"smartledger-utxos",autoSave:e.autoSave!==!1,maxUTXOs:e.maxUTXOs||1e3};var t=[Xa.MEMORY,Xa.SESSION,Xa.LOCAL];if(t.indexOf(this.options.storage)===-1)throw new Error("Invalid storage type: "+this.options.storage);this.utxos=new Map,this.addressIndex=new Map,this.spentUTXOs=new Map,this.metadata={totalUTXOs:0,totalValue:0,createdAt:new Date().toISOString(),lastModified:new Date().toISOString()},this.loadFromStorage()}Si.prototype.getStorage=function(){return this.options.storage===Xa.SESSION?typeof sessionStorage<"u"?sessionStorage:null:this.options.storage===Xa.LOCAL&&typeof localStorage<"u"?localStorage:null};Si.prototype.loadFromStorage=function(){var e=this.getStorage();if(e)try{var t=e.getItem(this.options.storageKey);if(!t)return;var r=JSON.parse(t);if(!r.utxos)return;var i=this;r.utxos.forEach(function(n){var o=n.txid+":"+n.vout;i.utxos.set(o,n),i.addressIndex.has(n.address)||i.addressIndex.set(n.address,new Set),i.addressIndex.get(n.address).add(o)}),r.metadata&&(this.metadata=r.metadata),V6("\u2705 BrowserUTXOManager: Loaded "+this.utxos.size+" UTXOs from "+this.options.storage+" storage")}catch(n){console.error("Failed to load UTXOs from storage:",n)}};Si.prototype.saveToStorage=function(){if(this.options.storage!==Xa.MEMORY){var e=this.getStorage();if(e)try{var t={utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",timestamp:new Date().toISOString()};e.setItem(this.options.storageKey,JSON.stringify(t)),V6("\u{1F4BE} BrowserUTXOManager: Saved "+this.utxos.size+" UTXOs to "+this.options.storage+" storage")}catch(r){console.error("Failed to save UTXOs to storage:",r)}}};Si.prototype.addUTXO=function(e){if(!e||!e.txid||typeof e.vout!="number")throw new Error("Invalid UTXO: missing txid or vout");var t=e.txid+":"+e.vout;if(this.utxos.has(t))return V6("\u26A0\uFE0F UTXO already exists: "+t),!1;var r={txid:e.txid,vout:e.vout,address:e.address||"",satoshis:e.satoshis||0,script:e.script||"",status:"available",addedAt:new Date().toISOString()};return this.utxos.set(t,r),r.address&&(this.addressIndex.has(r.address)||this.addressIndex.set(r.address,new Set),this.addressIndex.get(r.address).add(t)),this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),!0};Si.prototype.getUTXOsForAddress=function(e){var t=this.addressIndex.get(e);if(!t)return[];var r=[],i=this;return t.forEach(function(n){var o=i.utxos.get(n);o&&o.status==="available"&&r.push(o)}),r};Si.prototype.getBalance=function(e){var t=this.getUTXOsForAddress(e);return t.reduce(function(r,i){return r+(i.satoshis||0)},0)};Si.prototype.spendUTXOs=function(e,t){t=t||"browser-spend";for(var r=[],i=0;i<e.length;i++){var n=e[i],o=n.txid+":"+n.vout,a=this.utxos.get(o);a&&a.status==="available"&&(a.status="spent",a.spentAt=new Date().toISOString(),a.spentInTx=t,this.spentUTXOs.set(o,{txid:a.txid,vout:a.vout,spentInTx:t,spentAt:a.spentAt}),r.push(a))}return this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),r};Si.prototype.getUTXO=function(e,t){var r=e+":"+t,i=this.utxos.get(r);return{exists:!!i,utxo:i,status:i?i.status:"not-found"}};Si.prototype.createMockUTXOs=function(e,t,r){t=t||5,r=r||1e5;for(var i=[],n=0;n<t;n++){for(var o="",a=0;a<64;a++)o+=Math.floor(Math.random()*16).toString(16);var s={txid:o,vout:n,address:e,satoshis:r+Math.floor(Math.random()*1e4),script:"",status:"available"};this.addUTXO(s),i.push(s)}return i};Si.prototype.getStats=function(){var e=0,t=0,r=0;return this.utxos.forEach(function(i){e+=i.satoshis||0,i.status==="available"?t++:i.status==="spent"&&r++}),{totalUTXOs:this.utxos.size,totalAvailable:t,totalSpent:r,totalValue:e,totalAddresses:this.addressIndex.size,storageType:this.options.storage,metadata:this.metadata}};Si.prototype.updateMetadata=function(){var e=this.getStats();this.metadata.totalUTXOs=e.totalUTXOs,this.metadata.totalValue=e.totalValue,this.metadata.lastModified=new Date().toISOString()};Si.prototype.exportData=function(){return JSON.stringify({utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",exportedAt:new Date().toISOString()})};Si.prototype.importData=function(e,t){t=t||!1;try{var r=JSON.parse(e);if(t||(this.utxos.clear(),this.addressIndex.clear(),this.spentUTXOs.clear()),r.utxos&&Array.isArray(r.utxos)){var i=this;r.utxos.forEach(function(n){i.addUTXO(n)})}return V6("\u2705 BrowserUTXOManager: Imported "+(r.utxos&&r.utxos.length||0)+" UTXOs"),!0}catch(n){return console.error("Failed to import UTXO data:",n),!1}};typeof E1<"u"&&E1.exports?(E1.exports=Si,E1.exports.STORAGE_TYPES=Xa):typeof window<"u"&&(window.BrowserUTXOManager=Si,window.BrowserUTXOManager.STORAGE_TYPES=Xa)});var mC=k((Fge,vC)=>{"use strict";v();var X8=class{constructor(t,r={}){this.bsv=t,this.options={difficulty:r.difficulty||1,blockTime:r.blockTime||1e4,validateScripts:r.validateScripts!==!1,logLevel:r.logLevel||"info",...r},this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[]}acceptTransaction(t){try{return this.options.validateScripts&&!this.validateTransactionSignatures(t)?(this.log("warn","\u274C Transaction rejected: Invalid signatures"),!1):(this.mempool.push(t),this.log("info",`\u2705 Transaction accepted into mempool: ${t.id||"unknown"}`),!0)}catch(r){return this.log("error",`\u274C Transaction rejected: ${r.message}`),!1}}validateTransactionSignatures(t){try{let r=t.verify();return this.log("debug",`\u{1F4CA} Transaction verification result: ${r}`),r===!0}catch(r){return this.log("warn",`\u26A0\uFE0F Signature validation error: ${r.message}`),!1}}mineBlock(t=10){let r=this.mempool.splice(0,t),i={height:this.currentBlock.height+1,timestamp:Date.now(),transactions:r,transactionCount:r.length,previousBlockHash:this.currentBlock.hash||"0000000000000000000000000000000000000000000000000000000000000000"},n=JSON.stringify({height:i.height,timestamp:i.timestamp,previousBlockHash:i.previousBlockHash,transactions:r.map(o=>o.id||o.toString())});return i.hash=this.bsv.crypto.Hash.sha256(h.Buffer.from(n)).toString("hex"),this.currentBlock=i,this.log("info",`\u26CF\uFE0F Mined block ${i.height} with ${r.length} transactions`),this.log("debug",`\u{1F4E6} Block hash: ${i.hash}`),i}getMempoolStats(){return{transactionCount:this.mempool.length,transactions:this.mempool.map(t=>({id:t.id||"unknown",size:t.toBuffer?t.toBuffer().length:0,inputs:t.inputs?t.inputs.length:0,outputs:t.outputs?t.outputs.length:0}))}}getBlockchainStats(){return{currentHeight:this.currentBlock.height,currentBlockHash:this.currentBlock.hash,currentBlockTimestamp:this.currentBlock.timestamp,mempoolSize:this.mempool.length,difficulty:this.options.difficulty,blockTime:this.options.blockTime}}reset(){this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[],this.log("info","\u{1F504} Miner reset to genesis state")}log(t,r){let i={error:0,warn:1,info:2,debug:3},n=i[this.options.logLevel]||2;if(i[t]<=n){let o=new Date().toISOString();console.log(`[${o}] [${t.toUpperCase()}] ${r}`)}}};vC.exports=X8});var bC=k((jge,yC)=>{v();var Ne=Ae(),Rl=class{static createSignature(t,r,i,n,o,a=null){a=a||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;let s=Ne.Transaction.sighash.sign(t,r,a,i,n,new Ne.crypto.BN(o));return h.Buffer.concat([s.toDER(),h.Buffer.from([a])])}static createMultisigScript(t,r){let i=new Ne.Script().add(Ne.Opcode[`OP_${t}`]);for(let n of r)i=i.add(n.toBuffer());return i.add(Ne.Opcode[`OP_${r.length}`]).add(Ne.Opcode.OP_CHECKMULTISIG)}static createMultisigUnlocking(t){let r=new Ne.Script().add(Ne.Opcode.OP_0);for(let i of t)r=r.add(i);return r}static createTimelockScript(t,r){let i=h.Buffer.from(t.toString(16).padStart(8,"0"),"hex").reverse();return new Ne.Script().add(i).add(Ne.Opcode.OP_CHECKLOCKTIMEVERIFY).add(Ne.Opcode.OP_DROP).add(r.toBuffer())}static createConditionalScript(t,r=null){let i=new Ne.Script().add(Ne.Opcode.OP_IF).add(t.toBuffer());return r&&(i=i.add(Ne.Opcode.OP_ELSE).add(r.toBuffer())),i.add(Ne.Opcode.OP_ENDIF)}static createP2PKHScript(t){return new Ne.Script().add(Ne.Opcode.OP_DUP).add(Ne.Opcode.OP_HASH160).add(t.toAddress().hashBuffer).add(Ne.Opcode.OP_EQUALVERIFY).add(Ne.Opcode.OP_CHECKSIG)}static createP2PKHUnlocking(t,r){return new Ne.Script().add(t).add(r.toBuffer())}static getPreimage(t,r,i,n,o=null){return o=o||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID,Ne.Transaction.sighash.sighash(t,o,r,i,new Ne.crypto.BN(n))}static createDataScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(t)}static createOpReturnScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(Ne.Opcode.OP_FALSE).add(Ne.Opcode.OP_RETURN).add(t)}static validateTransaction(t){try{return t.verify()}catch(r){return console.error("Transaction validation error:",r.message),!1}}static validateScript(t,r,i,n){try{return new Ne.Script.Interpreter().verify(t,r,i,n,Ne.Script.Interpreter.SCRIPT_VERIFY_P2SH|Ne.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|Ne.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID|Ne.Script.Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES|Ne.Script.Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES)}catch(o){return console.error("Script validation error:",o.message),!1}}static createLowFeeTransaction(t,r,i=10){let n=new Ne.Transaction().feePerKb(i);for(let o of t)n=n.from(o);for(let o of r)n=n.to(o.address,o.satoshis);return n}};Rl.SIGHASH_ALL=Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;Rl.SIGHASH_NONE=Ne.crypto.Signature.SIGHASH_NONE|Ne.crypto.Signature.SIGHASH_FORKID;Rl.SIGHASH_SINGLE=Ne.crypto.Signature.SIGHASH_SINGLE|Ne.crypto.Signature.SIGHASH_FORKID;yC.exports=Rl});var G6=k((Kge,OC)=>{"use strict";v();var I1=Ae(),wC=h.Buffer.from("ord","utf8");function J8(){return I1.Script}function SC(){return I1.Opcode}function Mne(e){var t=J8();if(e.lock){if(e.lock instanceof t)return e.lock;if(h.Buffer.isBuffer(e.lock))return t.fromBuffer(e.lock);if(typeof e.lock=="string")return t.fromHex(e.lock);throw new Error("lock must be a Script, Buffer, or hex string")}if(e.address){var r=e.address instanceof I1.Address?e.address:I1.Address.fromString(String(e.address));return t.buildPublicKeyHashOut(r)}throw new Error("buildInscription requires an address or a lock script")}function _C(e,t){return h.Buffer.isBuffer(e)?e:e==null?h.Buffer.alloc(0):h.Buffer.from(String(e),t||"utf8")}function xC(e){e=e||{};var t=SC(),r=Mne(e),i=_C(e.contentType||"text/plain"),n=_C(e.content),o=J8().fromBuffer(r.toBuffer());return o.add(t.OP_FALSE),o.add(t.OP_IF),o.add(wC),o.add(t.OP_1),o.add(i),o.add(t.OP_0),o.add(n),o.add(t.OP_ENDIF),o}function O1(e,t){return e&&e.opcodenum===t&&e.buf==null}function EC(e){for(var t=J8(),r=SC(),i=e instanceof t?e:h.Buffer.isBuffer(e)?t.fromBuffer(e):t.fromHex(e),n=i.chunks,o=-1,a=0;a+2<n.length;a++)if(O1(n[a],r.OP_FALSE)&&O1(n[a+1],r.OP_IF)&&n[a+2].buf&&n[a+2].buf.equals(wC)){o=a;break}if(o===-1)return null;for(var s=new t,u=0;u<o;u++)s.chunks.push(n[u]);for(var c=h.Buffer.alloc(0),l=h.Buffer.alloc(0),m=o+3;m<n.length;m++){var w=n[m];if(O1(w,r.OP_ENDIF))break;O1(w,r.OP_1)&&n[m+1]&&n[m+1].buf?(c=n[m+1].buf,m++):O1(w,r.OP_0)&&n[m+1]&&n[m+1].buf&&(l=n[m+1].buf,m++)}return{contentType:c.toString("utf8"),content:l,contentText:l.toString("utf8"),lock:s}}function Nne(e){try{return EC(e)!==null}catch{return!1}}function Cne(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;return new I1.Transaction.Output({script:xC(e),satoshis:t})}OC.exports={buildInscription:xC,parseInscription:EC,isInscription:Nne,createInscriptionOutput:Cne}});var BC=k((Gge,RC)=>{"use strict";v();var qr=Ae(),Ml=Pl(),Q8=Go(),AC=G6(),Yo=qr.Script,Xt=qr.Opcode,PC=qr.encoding.BufferReader,Y6=Ml.SIGHASH_ALL_ANYONECANPAY_FORKID;function IC(e,t){return t&&t.length?e.add(h.Buffer.from(t)):e.add(Xt.OP_0)}function Z6(e){return e.toBufferWriter().toBuffer()}function Nl(e,t){if(typeof e!="number"||!isFinite(e)||e<0||Math.floor(e)!==e)throw new Error(t+" must be a non-negative integer number of satoshis (got "+e+")");return e}function X6(e){return e instanceof Yo?e:h.Buffer.isBuffer(e)?Yo.fromBuffer(e):Yo.fromHex(e)}function TC(e){return e instanceof qr.Address?e:e&&typeof e.toAddress=="function"?e.toAddress():qr.Address.fromString(String(e))}function Dne(e){if(h.Buffer.isBuffer(e)){if(e.length!==20)throw new Error("seller pubkeyhash buffer must be 20 bytes (HASH160)");return e}return e instanceof qr.PublicKey?qr.crypto.Hash.sha256ripemd160(e.toBuffer()):TC(e).hashBuffer}function Cl(e,t){return Nl(t,"payment price"),new qr.Transaction.Output({script:Yo.buildPublicKeyHashOut(TC(e)),satoshis:t})}function W6(e){if(e instanceof qr.Transaction.Output)return e;if(h.Buffer.isBuffer(e))return qr.Transaction.Output.fromBufferReader(new PC(e));var t=e.payTo!=null?e.payTo:e.address,r=e.satoshis!=null?e.satoshis:e.price;if(t==null||r==null)throw new Error("payment spec needs {address|payTo, satoshis|price}");return Cl(t,r)}function Lne(e){if(e.payOutputs){if(!e.payOutputs.length)throw new Error("payOutputs must be a non-empty array");return e.payOutputs.map(W6)}if(e.payOutput!=null)return[W6(e.payOutput)];if(e.price!=null){var t=e.payTo!=null?e.payTo:e.seller,r=t instanceof qr.Transaction.Output?t:Cl(t,e.price),i=[r];return e.royalties&&e.royalties.forEach(function(n){i.push(W6(n))}),i}throw new Error("buildOrdLock requires a price, a payOutput, or payOutputs")}function qne(e){return h.Buffer.concat(e.map(Z6))}function t7(e){if(e=e||{},e.seller==null)throw new Error("buildOrdLock requires a seller");var t=Dne(e.seller),r=qne(Lne(e)),i=new Yo;if(i.add(Xt.OP_IF),i.add(Xt.OP_DUP).add(Xt.OP_HASH160),i.add(h.Buffer.from(t)).add(Xt.OP_EQUALVERIFY).add(Xt.OP_CHECKSIG),i.add(Xt.OP_ELSE),i.add(Xt.OP_DUP),Ml.pushTxCore(i,{sighashType:Y6}),i.add(Xt.OP_VERIFY),Ml.assertSighashType(i,Y6),Ml.extractHashOutputs(i),i.add(Xt.OP_TOALTSTACK),i.add(h.Buffer.from(r)).add(Xt.OP_CAT),i.add(Xt.OP_SWAP).add(Xt.OP_CAT),i.add(Xt.OP_HASH256),i.add(Xt.OP_FROMALTSTACK).add(Xt.OP_EQUAL),i.add(Xt.OP_ENDIF),e.inscription){var n=AC.buildInscription({lock:new Yo,contentType:e.inscription.contentType,content:e.inscription.content});n.chunks.forEach(function(o){i.chunks.push(o)})}return i}function Bl(e,t){return e&&e.opcodenum===t&&e.buf==null}function Une(e){for(var t=new PC(e),r=[];!t.eof();)r.push(qr.Transaction.Output.fromBufferReader(t));return r}function J6(e,t){var r=t&&t.network;try{for(var i=X6(e),n=i.chunks,o=0,a=-1,s=-1,u=-1,c=0;c<n.length;c++)if(Bl(n[c],Xt.OP_IF))o===0&&(a=c),o++;else if(Bl(n[c],Xt.OP_ELSE)&&o===1)s=c;else if(Bl(n[c],Xt.OP_ENDIF)&&(o--,o===0)){u=c;break}if(a===-1||s===-1||u===-1)return null;for(var l=null,m=a+1;m<s;m++)if(n[m].buf&&n[m].buf.length===20){l=n[m].buf;break}if(!l)return null;for(var w=null,E=s+1;E<u;E++)Bl(n[E],Xt.OP_TOALTSTACK)&&n[E+1]&&n[E+1].buf&&Bl(n[E+2],Xt.OP_CAT)&&Bl(n[E+3],Xt.OP_SWAP)&&(w=n[E+1].buf);if(!w)return null;var P=Une(w).map(function(U){var K=null;try{U.script.isPublicKeyHashOut()&&(K=U.script.toAddress(r).toString())}catch{}return{satoshis:U.satoshis,script:U.script,address:K}}),M=P.reduce(function(U,K){return U+K.satoshis},0),D=null,L=AC.parseInscription(i);return L&&(D={contentType:L.contentType,content:L.content,contentText:L.contentText}),{seller:{pubKeyHash:l,address:qr.Address.fromPublicKeyHash(l,r).toString()},payOutputs:P,payBlob:w,totalPrice:M,inscription:D}}catch{return null}}function Fne(e,t){return J6(e,t)!==null}function Hne(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;return new qr.Transaction.Output({script:t7(e),satoshis:t})}function kC(e){e=e||{};var t=e.spend,r=e.lockingScript;if(!t||!r)throw new Error("purchase requires { spend, lockingScript }");var i=e.inputIndex||0,n=e.payoutIndex!=null?e.payoutIndex:1,o=e.satoshis!=null?e.satoshis:1,a=t.outputs||[],s=e.parsed||J6(r),u=e.payoutCount!=null?e.payoutCount:s?s.payOutputs.length:1;if(n+u>a.length)throw new Error("purchase: spend has fewer outputs than the pinned block requires (need "+(n+u)+", have "+a.length+")");if(e.validate!==!1&&s){var c=h.Buffer.concat(a.slice(n,n+u).map(Z6));if(!c.equals(s.payBlob))throw new Error("purchase: outputs ["+n+".."+(n+u-1)+"] do not match the listing payment \u2014 the seller (or a royalty/fee payee) would not be paid")}var l=h.Buffer.concat(a.slice(0,n).map(Z6)),m=h.Buffer.concat(a.slice(n+u).map(Z6)),w=Object.assign({sighashType:Y6},e.grind||{}),E=Ml.grind(t,i,r,o,w),P=new Yo;return IC(P,m),IC(P,l),P.add(h.Buffer.from(E.preimage)),P.add(Xt.OP_FALSE),t.inputs[i].setScript(P),P}function jne(e){e=e||{};var t=e.privateKey,r=e.spend,i=e.lockingScript;if(!t||!r||!i)throw new Error("cancel requires { privateKey, spend, lockingScript }");var n=e.inputIndex||0,o=e.satoshis!=null?e.satoshis:1,a=e.sighashType!=null?e.sighashType:Q8.SIGHASH,s=Q8.signInput(r,t,n,i,o,a),u=new Yo;return u.add(h.Buffer.from(s)),u.add(t.toPublicKey().toBuffer()),u.add(Xt.OP_TRUE),r.inputs[n].setScript(u),u}function $6(e,t,r,i){e.addInput(new qr.Transaction.Input({prevTxId:t.txid||t.prevTxId,outputIndex:t.outputIndex!=null?t.outputIndex:t.vout,script:Yo.empty()}),X6(r),i)}function e7(e,t,r){Nl(r.satoshis,"input "+t+" satoshis");var i=X6(r.script),n=Q8.signInput(e,r.privateKey,t,i,r.satoshis,Ml.SIGHASH_ALL_FORKID),o=new Yo;o.add(h.Buffer.from(n)),o.add(r.privateKey.toPublicKey().toBuffer()),e.inputs[t].setScript(o)}function zne(e){e=e||{};var t=e.ordinal;if(!t||!t.script||!t.privateKey)throw new Error("buildListingTx requires ordinal { script, privateKey, txid, outputIndex }");var r=Nl(t.satoshis!=null?t.satoshis:1,"ordinal satoshis"),i=t7(e),n=e.funding||[],o=e.fee!=null?e.fee:500,a=n.reduce(function(c,l){return c+Nl(l.satoshis,"funding satoshis")},0),s=a-o;if(s<0)throw new Error("buildListingTx: insufficient funding \u2014 need "+o+" sat fee, funded "+a);var u=new qr.Transaction;return $6(u,t,t.script,r),n.forEach(function(c){$6(u,c,c.script,c.satoshis)}),u.addOutput(new qr.Transaction.Output({script:i,satoshis:r})),s>0&&u.addOutput(Cl(e.changeAddress||t.privateKey.toAddress(),s)),e7(u,0,{script:t.script,privateKey:t.privateKey,satoshis:r}),n.forEach(function(c,l){e7(u,1+l,c)}),{tx:u,listingScript:i,listingOutpoint:{txid:u.hash,outputIndex:0}}}function Kne(e){e=e||{};var t=e.listing;if(!t||!t.script)throw new Error("buildPurchaseTx requires listing.script");if(!e.ordinalDestination)throw new Error("buildPurchaseTx requires ordinalDestination");if(!e.funding||!e.funding.length)throw new Error("buildPurchaseTx requires funding coins");var r=X6(t.script),i=J6(r);if(!i)throw new Error("buildPurchaseTx: listing.script is not a parseable OrdLock");var n=Nl(t.satoshis!=null?t.satoshis:1,"listing satoshis"),o=e.payOutputs?e.payOutputs.map(W6):i.payOutputs.map(function(m){return new qr.Transaction.Output({script:m.script,satoshis:m.satoshis})}),a=o.reduce(function(m,w){return m+w.satoshis},0),s=e.fee!=null?e.fee:500,u=e.funding.reduce(function(m,w){return m+Nl(w.satoshis,"funding satoshis")},0),c=u-a-s;if(c<0)throw new Error("buildPurchaseTx: insufficient funding \u2014 need "+(a+s)+" sat (payments "+a+" + fee "+s+"), funded "+u);var l=new qr.Transaction;return $6(l,t,r,n),e.funding.forEach(function(m){$6(l,m,m.script,m.satoshis)}),l.addOutput(Cl(e.ordinalDestination,n)),o.forEach(function(m){l.addOutput(m)}),c>0&&l.addOutput(Cl(e.changeAddress||e.ordinalDestination,c)),kC({spend:l,lockingScript:r,parsed:i,satoshis:n,inputIndex:0,payoutIndex:1,payoutCount:o.length,grind:e.grind}),e.funding.forEach(function(m,w){e7(l,1+w,m)}),l}RC.exports={ORDLOCK_SIGHASH:Y6,buildOrdLock:t7,parseOrdLock:J6,isOrdLock:Fne,listInscriptionOutput:Hne,payOutputFor:Cl,purchase:kC,cancel:jne,buildListingTx:zne,buildPurchaseTx:Kne}});var zC=k((Wge,jC)=>{"use strict";v();var NC=G6(),CC="application/bsv-20",MC=18;function Vne(e){return typeof e=="string"&&/^\d+$/.test(e)}function Gne(e,t){if(typeof e=="number"){if(!Number.isInteger(e)||e<0)throw new Error(t+" must be a non-negative integer");return String(e)}if(Vne(e))return e.replace(/^0+(?=\d)/,"");throw new Error(t+" must be a non-negative integer (string or number)")}function A1(e,t){var r=Gne(e,t);if(!/[1-9]/.test(r))throw new Error(t+" must be greater than zero");return r}function r7(e){if(typeof e!="string"||!e.length)throw new Error("tick is required");if(h.Buffer.byteLength(e,"utf8")>4)throw new Error("tick must be 1\u20134 UTF-8 bytes");return e}function DC(e){var t=typeof e=="string"?Number(e):e;if(!Number.isInteger(t)||t<0||t>MC)throw new Error("dec must be an integer 0\u2026"+MC);return String(t)}function Zne(e){if(typeof e!="string"||!/^[0-9a-fA-F]{64}_\d+$/.test(e))throw new Error('id must be "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}function Q6(e,t){return t=t||{},NC.buildInscription({lock:t.lock,address:t.address,contentType:t.contentType||CC,content:JSON.stringify(e)})}function LC(e){e=e||{};var t={p:"bsv-20",op:"deploy",tick:r7(e.tick),max:A1(e.max,"max")};return e.lim!=null&&(t.lim=A1(e.lim,"lim")),e.dec!=null&&(t.dec=DC(e.dec)),Q6(t,e)}function qC(e){e=e||{};var t={p:"bsv-20",op:"mint",tick:r7(e.tick),amt:A1(e.amt,"amt")};return Q6(t,e)}function UC(e){e=e||{};var t={p:"bsv-20",op:"transfer",amt:A1(e.amt,"amt")};return e.id!=null?t.id=Zne(e.id):t.tick=r7(e.tick),Q6(t,e)}function FC(e){e=e||{};var t={p:"bsv-20",op:"deploy+mint",amt:A1(e.amt,"amt")};return e.dec!=null&&(t.dec=DC(e.dec)),e.sym!=null&&(t.sym=String(e.sym)),e.icon!=null&&(t.icon=String(e.icon)),Q6(t,e)}function e5(e,t){var r=Ae();return new r.Transaction.Output({script:e,satoshis:t??1})}function Wne(e){return e5(LC(e),e&&e.satoshis)}function Yne(e){return e5(qC(e),e&&e.satoshis)}function $ne(e){return e5(UC(e),e&&e.satoshis)}function Xne(e){return e5(FC(e),e&&e.satoshis)}function Jne(e){var t=Ae();if(e&&typeof e=="object"&&!h.Buffer.isBuffer(e)&&!(e instanceof t.Script)||typeof e=="string"&&e.trim()[0]==="{")return e;var r=NC.parseInscription(e);return r?r.contentText:null}function HC(e){try{var t=Jne(e);if(t==null)return null;var r=typeof t=="object"?t:JSON.parse(t);return!r||r.p!=="bsv-20"||typeof r.op!="string"?null:r}catch{return null}}function Qne(e){return HC(e)!==null}jC.exports={CONTENT_TYPE:CC,buildDeploy:LC,buildMint:qC,buildTransfer:UC,buildDeployMint:FC,createDeployOutput:Wne,createMintOutput:Yne,createTransferOutput:$ne,createDeployMintOutput:Xne,parseBsv20:HC,isBsv20:Qne}});var VC=k(($ge,KC)=>{"use strict";v();var P1=G6(),$o=BC(),eoe=zC();function toe(e){if(!Array.isArray(e)||!e.length)throw new Error("batchInscriptionOutputs requires a non-empty array of items");return e.map(function(t){return P1.createInscriptionOutput(t)})}KC.exports={buildInscription:P1.buildInscription,parseInscription:P1.parseInscription,isInscription:P1.isInscription,createInscriptionOutput:P1.createInscriptionOutput,batchInscriptionOutputs:toe,ORDLOCK_SIGHASH:$o.ORDLOCK_SIGHASH,buildOrdLock:$o.buildOrdLock,parseOrdLock:$o.parseOrdLock,isOrdLock:$o.isOrdLock,listInscriptionOutput:$o.listInscriptionOutput,payOutputFor:$o.payOutputFor,purchaseOrdLock:$o.purchase,cancelOrdLock:$o.cancel,buildListingTx:$o.buildListingTx,buildPurchaseTx:$o.buildPurchaseTx,BSV20:eoe}});var t5=k((Qge,ZC)=>{"use strict";v();var Ls=Ae(),i7=Ls.PublicKey,T1=Ls.PrivateKey,GC=Ls.crypto.Hash,En=Ls.util.preconditions,Jge=Ls.errors;function Ct(e){return this instanceof Ct?(this.options=e||{},this.network=this.options.network||"mainnet",this.registry=this.options.registry||null,this):new Ct(e)}Ct.fromPublicKey=function(e,t){t=t||{},typeof e=="string"&&(e=i7.fromString(e)),En.checkArgument(e instanceof i7,"Invalid public key");var r=e.toString("hex"),i=t.network||"mainnet",n=t.path||"",o="did:smartledger:"+r;return i!=="mainnet"&&(o+=":"+i),n&&(o+=":"+n),o};Ct.fromPrivateKey=function(e,t){return typeof e=="string"&&(e=T1.fromWIF(e)),En.checkArgument(e instanceof T1,"Invalid private key"),Ct.fromPublicKey(e.toPublicKey(),t)};Ct.parseDID=function(e){if(En.checkArgument(typeof e=="string","DID must be a string"),!e.startsWith("did:smartledger:"))throw new Error("Invalid SmartLedger DID format");var t=e.split(":");if(t.length<3)throw new Error("Invalid DID format");var r={method:"smartledger",identifier:t[2],network:"mainnet",path:""};return t.length>3&&t[3]!==""&&(r.network=t[3]),t.length>4&&(r.path=t.slice(4).join(":")),r};Ct.isValidDID=function(e){try{var t=Ct.parseDID(e);return!(!/^[0-9a-fA-F]{66}$/.test(t.identifier)&&!/^[0-9a-fA-F]{130}$/.test(t.identifier)||!["mainnet","testnet","regtest"].includes(t.network))}catch{return!1}};Ct.getPublicKey=function(e){var t=Ct.parseDID(e);return i7.fromString(t.identifier)};Ct.createDocument=function(e,t){t=t||{},En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.getPublicKey(e),i=e+"#keys-1",n={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/secp256k1-2019/v1"],id:e,verificationMethod:[{id:i,type:"EcdsaSecp256k1VerificationKey2019",controller:e,publicKeyHex:r.toString("hex")}],authentication:[i],assertionMethod:[i],keyAgreement:[i],capabilityInvocation:[i],capabilityDelegation:[i]};return t.services&&Array.isArray(t.services)&&(n.service=t.services),t.verificationMethods&&(n.verificationMethod=n.verificationMethod.concat(t.verificationMethods)),t.created&&(n.created=t.created),t.updated&&(n.updated=t.updated),n};Ct.resolve=async function(e,t){t=t||{};try{En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.createDocument(e,t);return{"@context":"https://w3id.org/did-resolution/v1",didDocument:r,didResolutionMetadata:{contentType:"application/did+ld+json",retrieved:new Date().toISOString()},didDocumentMetadata:{method:{published:!0,recoveryCommitment:null,updateCommitment:null}}}}catch(i){return{"@context":"https://w3id.org/did-resolution/v1",didDocument:null,didResolutionMetadata:{error:"notFound",errorMessage:i.message},didDocumentMetadata:{}}}};Ct.verifyOwnership=function(e,t,r){try{var i=Ct.getPublicKey(e),n=GC.sha256(h.Buffer.isBuffer(r)?r:h.Buffer.from(r,"utf8")),o=Ls.crypto.Signature.fromString(t),a=new Ls.crypto.ECDSA;return a.hashbuf=n,a.pubkey=i,a.sig=o,a.verify().verified===!0}catch{return!1}};Ct.signMessage=function(e,t){En.checkArgument(t instanceof T1,"Invalid private key");var r=GC.sha256(h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8")),i=new Ls.crypto.ECDSA;return i.hashbuf=r,i.privkey=t,i.pubkey=t.toPublicKey(),i.sign().toString()};Ct.createProofOfOwnership=function(e,t){En.checkArgument(e instanceof T1,"Invalid private key"),En.checkArgument(typeof t=="string","Challenge must be a string");var r=Ct.fromPrivateKey(e),i=new Date().toISOString(),n=t+":"+i+":"+r,o=Ct.signMessage(n,e);return{type:"EcdsaSecp256k1Signature2019",created:i,verificationMethod:r+"#keys-1",proofPurpose:"authentication",challenge:t,jws:o}};Ct.verifyProofOfOwnership=function(e,t){try{En.checkArgument(e&&typeof e=="object","Invalid proof object"),En.checkArgument(typeof t=="string","DID must be a string");var r=e.challenge+":"+e.created+":"+t;return Ct.verifyOwnership(t,e.jws,r)}catch{return!1}};Ct.createDIDURL=function(e,t){return En.checkArgument(typeof e=="string","DID must be a string"),En.checkArgument(typeof t=="string","Fragment must be a string"),e+"#"+t};Ct.generateTestDID=function(e){e=e||{};var t=new T1,r=Ct.fromPrivateKey(t,e),i=Ct.createDocument(r,e);return{did:r,privateKey:t.toWIF(),publicKey:t.toPublicKey().toString("hex"),document:i}};ZC.exports=Ct});var r5=k((ive,$C)=>{"use strict";v();var Dl=Ae(),roe=t5(),WC=Dl.PrivateKey,qs=Dl.crypto.Hash,YC=Dl.crypto.ECDSA,tve=Dl.crypto.Signature,Us=Dl.util.preconditions,rve=xt();function lr(e,t){return this instanceof lr?(typeof e=="string"&&(e=WC.fromWIF(e)),Us.checkArgument(e instanceof WC,"Invalid private key"),this.privateKey=e,this.publicKey=e.toPublicKey(),this.options=t||{},this.did=roe.fromPrivateKey(e,this.options),this):new lr(e,t)}lr._sortValue=function(e){return Array.isArray(e)?e.map(function(t){return lr._sortValue(t)}):e!==null&&typeof e=="object"?Object.keys(e).sort().reduce(function(t,r){return t[r]=lr._sortValue(e[r]),t},{}):e};lr._canonicalizeJSON=function(e){return JSON.stringify(lr._sortValue(e))};lr._hashCredential=function(e){var t=lr._canonicalizeJSON(e);return qs.sha256(h.Buffer.from(t,"utf8"))};lr.prototype.createCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid credential subject");var r=new Date().toISOString(),i=t.id||"urn:uuid:"+this._generateUUID(),n={"@context":["https://www.w3.org/2018/credentials/v1"],id:i,type:["VerifiableCredential"],issuer:this.did,issuanceDate:r,credentialSubject:e};return t.type&&(Array.isArray(t.type)?n.type=n.type.concat(t.type):n.type.push(t.type)),t.context&&(Array.isArray(t.context)?n["@context"]=n["@context"].concat(t.context):n["@context"].push(t.context)),t.expirationDate&&(n.expirationDate=t.expirationDate),t.termsOfUse&&(n.termsOfUse=t.termsOfUse),t.evidence&&(n.evidence=t.evidence),t.refreshService&&(n.refreshService=t.refreshService),n};lr.prototype.signCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid credential");var r=JSON.parse(JSON.stringify(e));delete r.proof;var i=lr._hashCredential(r),n=new YC;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:t.proofPurpose||"assertionMethod",jws:a};t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain);var u=JSON.parse(JSON.stringify(r));return u.proof=s,u.rootHash=i.toString("hex"),u};lr.prototype._createJWSSignature=function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o};lr.prototype.createEmailCredential=function(e,t){t=t||{},Us.checkArgument(typeof e=="string"&&e.includes("@"),"Invalid email address");var r={id:t.subjectId||"did:smartledger:"+qs.sha256(h.Buffer.from(e)).toString("hex"),email:e,verified:!0,verificationMethod:"email_verification",verificationTimestamp:new Date().toISOString()},i={type:"EmailVerifiedCredential",context:"https://smartledger.technology/contexts/email/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};lr.prototype.createAgeCredential=function(e,t,r){r=r||{},Us.checkArgument(typeof e=="number"&&e>0,"Invalid age");var i={id:r.subjectId||"urn:uuid:"+this._generateUUID(),ageOver:e,verified:!0,verificationMethod:"age_verification"};t&&(i.birthDateHash=qs.sha256(h.Buffer.from(t.toISOString())).toString("hex"));var n={type:"AgeVerifiedCredential",context:"https://smartledger.technology/contexts/age/v1",...r},o=this.createCredential(i,n);return this.signCredential(o,r)};lr.prototype.createKYCCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid KYC data");var r={id:t.subjectId||"urn:uuid:"+this._generateUUID(),kycLevel:e.level||"basic",verified:!0,verificationMethod:"kyc_verification",verificationTimestamp:new Date().toISOString(),verifyingAuthority:e.authority||this.did};e.firstName&&(r.firstNameHash=qs.sha256(h.Buffer.from(e.firstName)).toString("hex")),e.lastName&&(r.lastNameHash=qs.sha256(h.Buffer.from(e.lastName)).toString("hex")),e.ssn&&(r.ssnHash=qs.sha256(h.Buffer.from(e.ssn)).toString("hex"));var i={type:"KYCVerifiedCredential",context:"https://smartledger.technology/contexts/kyc/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};lr.prototype.createOrganizationCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid organization data");var r={id:t.subjectId||"did:smartledger:org:"+qs.sha256(h.Buffer.from(e.name||"")).toString("hex"),name:e.name,type:e.type||"Organization",verified:!0,verificationMethod:"organization_verification",verificationTimestamp:new Date().toISOString()};e.taxId&&(r.taxIdHash=qs.sha256(h.Buffer.from(e.taxId)).toString("hex")),e.incorporationState&&(r.incorporationState=e.incorporationState),e.industry&&(r.industry=e.industry);var i={type:"OrganizationCredential",context:"https://smartledger.technology/contexts/organization/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};lr.prototype._generateUUID=function(){var e=Dl.crypto.Random.getRandomBuffer(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;var t=e.toString("hex");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")};lr.prototype.createPresentation=function(e,t){t=t||{},Us.checkArgument(Array.isArray(e),"Credentials must be an array");var r={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],id:t.id||"urn:uuid:"+this._generateUUID(),holder:this.did,verifiableCredential:e};t.context&&(Array.isArray(t.context)?r["@context"]=r["@context"].concat(t.context):r["@context"].push(t.context));var i=lr._hashCredential(r),n=new YC;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:"authentication",jws:a};return t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain),r.proof=s,r};lr.prototype.getIssuerInfo=function(){return{did:this.did,publicKey:this.publicKey.toString("hex"),verificationMethod:this.did+"#keys-1"}};$C.exports=lr});var eD=k((sve,QC)=>{"use strict";v();var k1=Ae(),i5=t5(),n7=r5(),ove=k1.PublicKey,ave=k1.crypto.Hash,XC=k1.crypto.ECDSA,ioe=k1.crypto.Signature,JC=k1.util.preconditions;function Mt(e){return this instanceof Mt?(this.options=e||{},this.trustedIssuers=this.options.trustedIssuers||[],this):new Mt(e)}Mt.verifyCredential=async function(e,t){t=t||{};try{JC.checkArgument(e&&typeof e=="object","Invalid credential");var r={valid:!1,errors:[],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}},i=Mt._validateStructure(e);r.checks.structure=i.valid,i.valid||(r.errors=r.errors.concat(i.errors));var n=await Mt._verifySignature(e);r.checks.signature=n.valid,n.valid?(r.issuerDID=n.issuerDID,r.verificationMethod=n.verificationMethod):r.errors=r.errors.concat(n.errors);var o=await Mt._validateIssuer(e,t);r.checks.issuer=o.valid,o.valid||(r.errors=r.errors.concat(o.errors)),o.warnings&&(r.warnings=r.warnings.concat(o.warnings));var a=Mt._validateTemporal(e);if(r.checks.temporal=a.valid,a.valid||(r.errors=r.errors.concat(a.errors)),a.warnings&&(r.warnings=r.warnings.concat(a.warnings)),t.schema){var s=Mt._validateSchema(e,t.schema);r.checks.schema=s.valid,s.valid||(r.errors=r.errors.concat(s.errors))}else r.checks.schema=!0;return r.valid=Object.values(r.checks).every(u=>u===!0),r}catch(u){return{valid:!1,errors:["Verification failed: "+u.message],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}}}};Mt.verifyPresentation=async function(e,t){t=t||{};try{JC.checkArgument(e&&typeof e=="object","Invalid presentation");var r={valid:!1,errors:[],warnings:[],credentialResults:[],presentationValid:!1};if(!e.type||!e.type.includes("VerifiablePresentation"))return r.errors.push("Invalid presentation type"),r;if(!e.holder)return r.errors.push("Missing presentation holder"),r;var i=await Mt._verifyPresentationSignature(e);if(r.presentationValid=i.valid,i.valid||(r.errors=r.errors.concat(i.errors)),e.verifiableCredential&&Array.isArray(e.verifiableCredential))for(var n=0;n<e.verifiableCredential.length;n++){var o=e.verifiableCredential[n],a=await Mt.verifyCredential(o,t);r.credentialResults.push({index:n,result:a}),a.valid||r.errors.push("Credential "+n+" is invalid")}var s=r.credentialResults.every(u=>u.result.valid);return r.valid=r.presentationValid&&s,r}catch(u){return{valid:!1,errors:["Presentation verification failed: "+u.message],warnings:[],credentialResults:[],presentationValid:!1}}};Mt._validateStructure=function(e){var t=[];return e["@context"]?Array.isArray(e["@context"])?e["@context"].includes("https://www.w3.org/2018/credentials/v1")||t.push("Missing required W3C credentials context"):t.push("@context must be an array"):t.push("Missing @context"),e.type?Array.isArray(e.type)?e.type.includes("VerifiableCredential")||t.push("Must include VerifiableCredential type"):t.push("type must be an array"):t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof"),{valid:t.length===0,errors:t}};Mt._normalizeDID=function(e){var t=e&&typeof e=="object"?e.id:e;return typeof t!="string"||t.length===0?null:t.split("#")[0]};Mt._verifySignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing proof"]};if(t.type!=="EcdsaSecp256k1Signature2019")return{valid:!1,errors:["Unsupported proof type: "+t.type]};if(!t.verificationMethod)return{valid:!1,errors:["Missing verification method"]};if(!t.jws)return{valid:!1,errors:["Missing JWS signature"]};var r=t.verificationMethod,i=r.split("#")[0],n=Mt._normalizeDID(e.issuer);if(!n)return{valid:!1,errors:["Missing or invalid credential issuer"]};if(n!==i)return{valid:!1,errors:["Verification method DID ("+i+") does not match credential issuer ("+n+")"]};var o=i5.getPublicKey(i),a=JSON.parse(JSON.stringify(e));delete a.proof,delete a.rootHash;var s=n7._hashCredential(a),u=Mt._parseJWSSignature(t.jws),c=new XC;c.hashbuf=s,c.pubkey=o,c.sig=u;var l=c.verify().verified;return l?{valid:!0,issuerDID:i,verificationMethod:r}:{valid:!1,errors:["Signature verification failed"]}}catch(m){return{valid:!1,errors:["Signature verification error: "+m.message]}}};Mt._parseJWSSignature=function(e){var t=e.split(".");if(t.length!==3)throw new Error("Invalid JWS format");var r=t[2],i=h.Buffer.from(r,"base64url");return ioe.fromDER(i)};Mt._verifyPresentationSignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing presentation proof"]};var r=e.holder,i=i5.getPublicKey(r),n=JSON.parse(JSON.stringify(e));delete n.proof;var o=n7._hashCredential(n),a=Mt._parseJWSSignature(t.jws),s=new XC;s.hashbuf=o,s.pubkey=i,s.sig=a;var u=s.verify().verified;return{valid:u,errors:u?[]:["Presentation signature verification failed"]}}catch(c){return{valid:!1,errors:["Presentation signature error: "+c.message]}}};Mt._validateIssuer=async function(e,t){var r=[],i=[];try{var n=e.issuer;if(!i5.isValidDID(n))return r.push("Invalid issuer DID format"),{valid:!1,errors:r};var o=await i5.resolve(n);if(!o.didDocument)return r.push("Unable to resolve issuer DID"),{valid:!1,errors:r};if(t.trustedIssuers&&Array.isArray(t.trustedIssuers)){var a=Mt._normalizeDID(n),s=t.trustedIssuers.map(function(u){return Mt._normalizeDID(u)}).filter(Boolean);if(!a||s.indexOf(a)===-1)return r.push("Issuer not in trusted list"),{valid:!1,errors:r,warnings:i}}return{valid:r.length===0,errors:r,warnings:i}}catch(u){return{valid:!1,errors:["Issuer validation error: "+u.message],warnings:i}}};Mt._validateTemporal=function(e){var t=[],r=[],i=new Date;if(e.issuanceDate){var n=new Date(e.issuanceDate);isNaN(n.getTime())?t.push("Invalid issuanceDate format"):n>i&&t.push("Credential issued in the future")}if(e.expirationDate){var o=new Date(e.expirationDate);isNaN(o.getTime())?t.push("Invalid expirationDate format"):o<=i?t.push("Credential has expired"):o<=new Date(i.getTime()+1440*60*1e3)&&r.push("Credential expires within 24 hours")}return{valid:t.length===0,errors:t,warnings:r}};Mt._validateSchema=function(e,t){var r=[];if(t.requiredFields&&t.requiredFields.forEach(function(n){Mt._getNestedProperty(e,n)||r.push("Missing required field: "+n)}),t.requiredTypes){var i=t.requiredTypes.some(function(n){return e.type&&e.type.includes(n)});i||r.push("Missing required credential type")}return{valid:r.length===0,errors:r}};Mt._getNestedProperty=function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)};Mt.verifyCredentialHash=function(e){try{if(!e.rootHash)return!1;var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.rootHash;var r=n7._hashCredential(t),i=h.Buffer.from(e.rootHash,"hex");return h.Buffer.compare(r,i)===0}catch{return!1}};Mt.extractClaims=function(e){try{var t={issuer:e.issuer,subject:e.credentialSubject.id||"unknown",types:e.type||[],issuanceDate:e.issuanceDate,expirationDate:e.expirationDate,claims:{}};return Object.keys(e.credentialSubject).forEach(function(r){r!=="id"&&(t.claims[r]=e.credentialSubject[r])}),t}catch{return null}};Mt.createReport=function(e){var t=[];return t.push("=== Credential Verification Report ==="),t.push("Overall Status: "+(e.valid?"VALID":"INVALID")),t.push(""),t.push("Verification Checks:"),Object.keys(e.checks).forEach(function(r){var i=e.checks[r]?"\u2713":"\u2717";t.push(" "+i+" "+r.charAt(0).toUpperCase()+r.slice(1))}),t.push(""),e.errors.length>0&&(t.push("Errors:"),e.errors.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.warnings.length>0&&(t.push("Warnings:"),e.warnings.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.issuerDID&&t.push("Issuer: "+e.issuerDID),e.verificationMethod&&t.push("Verification Method: "+e.verificationMethod),t.join(`
|
|
99
|
-
`)};QC.exports=Mt});var rD=k((cve,tD)=>{"use strict";v();var If=Ae(),noe=r5(),so=If.crypto.Hash,fve=If.crypto.BN,oi=If.util.preconditions;function rr(e){return this instanceof rr?(this.options=e||{},this):new rr(e)}rr.createMerkleTree=function(e,t){t=t||If.crypto.Random.getRandomBuffer(32).toString("hex"),oi.checkArgument(e&&typeof e=="object","Invalid credential");var r=rr._extractFields(e),i=r.map(function(o){var a=o.path+":"+JSON.stringify(o.value)+":"+t;return{path:o.path,value:o.value,hash:so.sha256(h.Buffer.from(a,"utf8")).toString("hex"),salt:t}}),n=rr._buildMerkleTree(i.map(o=>o.hash));return{salt:t,leaves:i,tree:n,root:n[n.length-1][0]}};rr.generateSelectiveProof=function(e,t,r){oi.checkArgument(e&&typeof e=="object","Invalid credential"),typeof t=="string"&&(t=[t]),oi.checkArgument(Array.isArray(t),"Disclose paths must be array");var i=rr.createMerkleTree(e,r),n=[],o=[];return t.forEach(function(a){var s=i.leaves.find(l=>l.path===a);if(s){n.push(s);var u=i.leaves.findIndex(l=>l.path===a),c=rr._generateMerkleProof(i.tree,u);o.push({path:a,leafIndex:u,proof:c})}}),{type:"SelectiveDisclosureProof",created:new Date().toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,credentialRoot:i.root,credentialHash:e.rootHash||noe._hashCredential(e).toString("hex"),disclosedFields:n.map(function(a){return{path:a.path,value:a.value,hash:a.hash}}),merkleProofs:o,salt:r}};rr.verifySelectiveProof=function(e,t){try{oi.checkArgument(e&&typeof e=="object","Invalid proof"),oi.checkArgument(typeof t=="string","Expected root must be string");for(var r={valid:!1,errors:[],verifiedFields:[]},i=0;i<e.disclosedFields.length;i++){var n=e.disclosedFields[i],o=e.merkleProofs.find(c=>c.path===n.path);if(!o){r.errors.push("Missing Merkle proof for field: "+n.path);continue}var a=n.path+":"+JSON.stringify(n.value)+":"+e.salt,s=so.sha256(h.Buffer.from(a,"utf8")).toString("hex");if(s!==n.hash){r.errors.push("Field hash mismatch for: "+n.path);continue}var u=rr._verifyMerkleProof(n.hash,o.proof,t);if(!u){r.errors.push("Invalid Merkle proof for: "+n.path);continue}r.verifiedFields.push({path:n.path,value:n.value,verified:!0})}return r.valid=r.errors.length===0&&r.verifiedFields.length>0,r}catch(c){return{valid:!1,errors:["Proof verification failed: "+c.message],verifiedFields:[]}}};rr.generateAgeProof=function(e,t,r){oi.checkArgument(e instanceof Date,"Birth date must be Date object"),oi.checkArgument(typeof t=="number","Minimum age must be number"),r=r||If.crypto.Random.getRandomBuffer(32).toString("hex");var i=new Date,n=Math.floor((i-e)/(365.25*24*60*60*1e3));if(n<t)throw new Error("Age requirement not met");var o=e.toISOString().split("T")[0],a=so.sha256(h.Buffer.from(o+":"+r,"utf8")).toString("hex"),s={minimumAge:t,ageAttestation:n>=t,timestamp:i.toISOString(),salt:r},u=so.sha256(h.Buffer.from(JSON.stringify(s),"utf8")).toString("hex");return{type:"AgeProof",created:new Date().toISOString(),proofPurpose:"ageVerification",minimumAge:t,meetsRequirement:!0,birthDateCommitment:a,ageProofHash:u,challengeResponse:rr._generateAgeChallenge(e,t,r)}};rr.verifyAgeProof=function(e,t){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),oi.checkArgument(typeof t=="number","Required age must be number"),e.type!=="AgeProof"||e.minimumAge!==t||!e.meetsRequirement?!1:e.challengeResponse&&e.challengeResponse.length>0}catch{return!1}};rr.generateRangeProof=function(e,t,r,i){oi.checkArgument(typeof e=="number","Value must be number"),oi.checkArgument(typeof t=="number","Min must be number"),oi.checkArgument(typeof r=="number","Max must be number"),oi.checkArgument(e>=t&&e<=r,"Value not in range"),i=i||If.crypto.Random.getRandomBuffer(32).toString("hex");var n=so.sha256(h.Buffer.from(e.toString()+":"+i,"utf8")).toString("hex"),o={min:t,max:r,inRange:!0,timestamp:new Date().toISOString(),salt:i},a=so.sha256(h.Buffer.from(JSON.stringify(o),"utf8")).toString("hex");return{type:"RangeProof",created:new Date().toISOString(),proofPurpose:"rangeVerification",range:{min:t,max:r},valueCommitment:n,proofHash:a,inRange:!0}};rr.verifyRangeProof=function(e,t,r){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),e.type!=="RangeProof"||e.range.min!==t||e.range.max!==r?!1:e.inRange===!0}catch{return!1}};rr._extractFields=function(e,t){t=t||"";var r=[];return Object.keys(e).forEach(function(i){var n=t?t+"."+i:i,o=e[i];o&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)?r=r.concat(rr._extractFields(o,n)):r.push({path:n,value:o})}),r};rr._buildMerkleTree=function(e){if(e.length===0)throw new Error("Cannot build tree from empty leaves");for(var t=[e];t[t.length-1].length>1;){for(var r=t[t.length-1],i=[],n=0;n<r.length;n+=2){var o=r[n],a=n+1<r.length?r[n+1]:o,s=o+a,u=so.sha256(h.Buffer.from(s,"hex")).toString("hex");i.push(u)}t.push(i)}return t};rr._generateMerkleProof=function(e,t){for(var r=[],i=t,n=0;n<e.length-1;n++){var o=e[n],a=i%2===0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r};rr._verifyMerkleProof=function(e,t,r){for(var i=e,n=0;n<t.length;n++){var o=t[n],a=o.isLeft?o.hash+i:i+o.hash;i=so.sha256(h.Buffer.from(a,"hex")).toString("hex")}return i===r};rr._generateAgeChallenge=function(e,t,r){var i=so.sha256(h.Buffer.from(e.toISOString()+t+r,"utf8"));return i.toString("hex")};rr.generateMembershipProof=function(e,t,r){oi.checkArgument(Array.isArray(e),"Set must be array"),oi.checkArgument(e.includes(t),"Value not in set"),r=r||If.crypto.Random.getRandomBuffer(32).toString("hex");var i=e.map(function(o){return so.sha256(h.Buffer.from(JSON.stringify(o)+":"+r,"utf8")).toString("hex")}),n=so.sha256(h.Buffer.from(JSON.stringify(t)+":"+r,"utf8")).toString("hex");return{type:"MembershipProof",created:new Date().toISOString(),proofPurpose:"membershipVerification",setCommitments:i,valueCommitment:n,isMember:!0}};rr.verifyMembershipProof=function(e){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),e.type!=="MembershipProof"||!Array.isArray(e.setCommitments)?!1:e.setCommitments.includes(e.valueCommitment)&&e.isMember}catch{return!1}};tD.exports=rr});var oD=k((dve,nD)=>{"use strict";v();var Af=Ae(),o7=Af.Transaction,ooe=Af.Script,a7=Af.PrivateKey,hve=Af.Address,R1=Af.crypto.Hash,iD=Af.SPV,Fs=Af.util.preconditions;function Tr(e,t){return this instanceof Tr?(typeof e=="string"&&(e=a7.fromWIF(e)),e!==null?(Fs.checkArgument(e instanceof a7,"Invalid private key"),this.privateKey=e,this.address=e.toAddress()):(this.privateKey=null,this.address=null),this.options=t||{},this.network=this.options.network||"mainnet",this.PROTOCOL_ID="SMARTLEDGER.ATTEST",this.VERSION=1,this):new Tr(e,t)}Tr.prototype.anchorCredential=async function(e,t,r){t=t||{},typeof e=="string"&&(e=h.Buffer.from(e,"hex")),Fs.checkArgument(h.Buffer.isBuffer(e),"Invalid credential hash"),Fs.checkArgument(e.length===32,"Hash must be 32 bytes");var i=this._createAnchorPayload("CREDENTIAL",e,t),n=await this._createAnchorTransaction(i,r);return{txid:n.hash,transaction:n,anchorHash:e.toString("hex"),metadata:t,timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"CREDENTIAL"}}};Tr.prototype.anchorBatch=async function(e,t,r){t=t||{},Fs.checkArgument(Array.isArray(e),"Credential hashes must be array"),Fs.checkArgument(e.length>0,"Must provide at least one hash");var i=this._createMerkleRoot(e),n=this._createAnchorPayload("BATCH",i,{...t,batchSize:e.length,merkleRoot:i.toString("hex")}),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,merkleRoot:i.toString("hex"),batchSize:e.length,credentialHashes:e.map(a=>h.Buffer.isBuffer(a)?a.toString("hex"):a),metadata:t,timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"BATCH"}}};Tr.prototype.registerDID=async function(e,t,r){Fs.checkArgument(typeof e=="string","DID must be string"),Fs.checkArgument(t&&typeof t=="object","Invalid DID document");var i=R1.sha256(h.Buffer.from(JSON.stringify(t),"utf8")),n=this._createAnchorPayload("DID_REG",i,{did:e,operation:"create",documentHash:i.toString("hex")}),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,did:e,documentHash:i.toString("hex"),timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"DID_REG"}}};Tr.prototype.revokeCredential=async function(e,t,r){Fs.checkArgument(typeof e=="string","Credential ID must be string"),t=t||"unspecified";var i={credentialId:e,reason:t,timestamp:new Date().toISOString(),issuer:this.address.toString()},n=R1.sha256(h.Buffer.from(JSON.stringify(i),"utf8")),o=this._createAnchorPayload("REVOKE",n,{credentialId:e,reason:t}),a=await this._createAnchorTransaction(o,r);return{txid:a.hash,transaction:a,credentialId:e,reason:t,revocationHash:n.toString("hex"),timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"REVOKE"}}};Tr.prototype._createAnchorPayload=function(e,t,r){var i=Math.floor(Date.now()/1e3),n=h.Buffer.concat([h.Buffer.from(this.PROTOCOL_ID,"utf8"),h.Buffer.from([this.VERSION]),h.Buffer.from(e.padEnd(10,"\0"),"utf8"),h.Buffer.from([i>>24,i>>16,i>>8,i]),t,h.Buffer.from(JSON.stringify(r),"utf8")]);return n};Tr.prototype._createAnchorTransaction=async function(e,t){if(!t||t.length===0)throw new Error("UTXOs required for anchor transaction");var r=200+e.length,i=this.options.feeRate||1,n=r*i,o=t.reduce((c,l)=>c+l.satoshis,0);if(o<n)throw new Error("Insufficient funds for anchor transaction");var a=new o7;t.forEach(c=>{a.from(c)});var s=ooe.buildDataOut(e);a.addOutput(new o7.Output({script:s,satoshis:0}));var u=o-n;return u>546&&a.to(this.address,u),a.sign(this.privateKey),a};Tr.prototype._createMerkleRoot=function(e){if(e.length===0)throw new Error("Cannot create Merkle root from empty array");for(var t=e.map(u=>h.Buffer.isBuffer(u)?u:h.Buffer.from(u,"hex"));t.length>1;){for(var r=[],i=0;i<t.length;i+=2){var n=t[i],o=i+1<t.length?t[i+1]:n,a=h.Buffer.concat([n,o]),s=R1.sha256(a);r.push(s)}t=r}return t[0]};Tr.parseAnchorData=function(e){if(!h.Buffer.isBuffer(e))throw new Error("Data must be Buffer");if(e.length<50)throw new Error("Data too short for SmartLedger anchor");var t=0,r=18,i=e.slice(t,t+r).toString("utf8");if(t+=r,i!=="SMARTLEDGER.ATTEST")throw new Error("Invalid protocol identifier");var n=e[t];t+=1;var o=e.slice(t,t+10).toString("utf8").replace(/\0/g,"");t+=10;var a=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];t+=4;var s=e.slice(t,t+32);t+=32;var u=e.slice(t),c={};try{c=JSON.parse(u.toString("utf8"))}catch{}return{protocol:i,version:n,type:o,timestamp:new Date(a*1e3),hash:s.toString("hex"),metadata:c}};Tr.verifyAnchor=async function(e,t,r){if(r=r||{},!e||!t)throw new Error("verifyAnchor requires both txid and expectedHash");if(r.spvProof&&(r.header||r.headerChain)&&r.rawTx)return Tr._verifyAnchorSPV(e,t,r);if(typeof r.chainProvider!="function")throw new Error("verifyAnchor needs either a trustless SPV proof \u2014 { spvProof: { index, nodes }, header, rawTx } \u2014 or a trusted options.chainProvider(txid) returning { confirmations, blockHeight, opReturns }. Refusing to fabricate a result.");var i=r.minConfirmations!=null?r.minConfirmations:1,n=await r.chainProvider(e),o=n&&n.confirmations||0,a=n&&n.opReturns||[],s=String(t).toLowerCase(),u=a.some(function(l){return String(l).toLowerCase().indexOf(s)!==-1}),c=o>=i&&u;return{verified:c,txid:e,hash:t,committed:u,confirmations:o,blockHeight:n&&n.blockHeight||null,timestamp:new Date().toISOString(),proof:{type:"blockchain_anchor",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}};Tr._verifyAnchorSPV=function(e,t,r){var i=r.spvProof||{},n=null,o=r.header;r.headerChain&&(n=iD.verifyHeaderChain(r.headerChain,{requirePow:r.requirePow!==!1,trustedHash:r.trustedHash}),o=r.headerChain[0]);var a=iD.verifyTxInclusion({txid:e,index:i.index,nodes:i.nodes,header:o,requirePow:r.requirePow!==!1}),s=h.Buffer.isBuffer(r.rawTx)?r.rawTx:h.Buffer.from(r.rawTx,"hex"),u=h.Buffer.from(R1.sha256sha256(s)).reverse().toString("hex"),c=u.toLowerCase()===String(e).toLowerCase(),l=c&&Tr._rawTxCommitsTo(s,t),m=n?n.count:r.header?1:0,w=r.minConfirmations!=null?r.minConfirmations:1,E=n?n.valid:!0,P=m>=w;return{verified:a.valid&&c&&l&&E&&P,chainVerified:a.valid,committed:l,txidBound:c,powValid:a.powValid,confirmations:m,headerChainValid:n?n.valid:null,headerChainReason:n&&n.reason||null,tipHash:n?n.tipHash:null,txid:e,hash:t,blockHash:a.blockHash,merkleRoot:a.merkleRoot,timestamp:new Date().toISOString(),proof:{type:n?"spv_merkle_inclusion_with_confirmations":"spv_merkle_inclusion",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}};Tr._rawTxCommitsTo=function(e,t){var r=String(t).toLowerCase(),i;try{i=new o7(e)}catch{return!1}return i.outputs.some(function(n){var o=n.script;if(!o||!o.chunks||!o.chunks.length)return!1;var a=o.chunks[0].opcodenum===106||o.chunks[0].opcodenum===0&&o.chunks[1]&&o.chunks[1].opcodenum===106;return a?o.chunks.some(function(s){return s.buf&&s.buf.toString("hex").toLowerCase().indexOf(r)!==-1}):!1})};Tr.getCostEstimate=function(e,t){t=t||{};var r=t.feeRate||1,i=200,n=32,o=e*(i+n)*r,a=(i+e*n)*r;return{individual:{totalCost:o,costPerHash:i*r,transactions:e},batch:{totalCost:a,costPerHash:Math.ceil(a/e),transactions:1},savings:{absolute:o-a,percentage:Math.round((o-a)/o*100)}}};Tr.createUTXO=function(e,t,r,i){return{txid:e,outputIndex:t,satoshis:r,script:i}};Tr.generateTestData=function(){var e=new a7,t=new Tr(e),r=R1.sha256(h.Buffer.from("test credential data")),i={issuer:"did:smartledger:test",type:"EmailVerifiedCredential",environment:"test"};return{privateKey:e.toWIF(),address:e.toAddress().toString(),credentialHash:r.toString("hex"),metadata:i,anchor:t}};nD.exports=Tr});var sD=k((gve,aD)=>{"use strict";v();var s7=Bt(),B1={EmailVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/email/v1"],type:["VerifiableCredential","EmailVerifiedCredential"],requiredFields:["credentialSubject.email","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["email","verified"],properties:{email:{type:"string",format:"email"},verified:{type:"boolean"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},AgeVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/age/v1"],type:["VerifiableCredential","AgeVerifiedCredential"],requiredFields:["credentialSubject.ageOver","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["ageOver","verified"],properties:{ageOver:{type:"number",minimum:0,maximum:150},verified:{type:"boolean"},birthDateHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verificationMethod:{type:"string"}}}}},KYCVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/kyc/v1"],type:["VerifiableCredential","KYCVerifiedCredential"],requiredFields:["credentialSubject.kycLevel","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["kycLevel","verified","verifyingAuthority"],properties:{kycLevel:{type:"string",enum:["basic","enhanced","premium","institutional"]},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},firstNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},lastNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"}}}}},OrganizationCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/organization/v1"],type:["VerifiableCredential","OrganizationCredential"],requiredFields:["credentialSubject.name","credentialSubject.type","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["name","type","verified"],properties:{name:{type:"string"},type:{type:"string",enum:["Corporation","LLC","Partnership","NGO","Government","Other"]},verified:{type:"boolean"},taxIdHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},incorporationState:{type:"string"},industry:{type:"string"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},SSNVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ssn/v1"],type:["VerifiableCredential","SSNVerifiedCredential"],requiredFields:["credentialSubject.ssnHash","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["ssnHash","verified","verifyingAuthority"],properties:{ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},issuingState:{type:"string"}}}}},EducationalCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/education/v1"],type:["VerifiableCredential","EducationalCredential"],requiredFields:["credentialSubject.degree","credentialSubject.institution","credentialSubject.graduationDate"],properties:{credentialSubject:{type:"object",required:["degree","institution","graduationDate"],properties:{degree:{type:"string"},institution:{type:"string"},graduationDate:{type:"string",format:"date"},gpa:{type:"number",minimum:0,maximum:4},major:{type:"string"},honors:{type:"array",items:{type:"string"}}}}}},ProfessionalLicenseCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/license/v1"],type:["VerifiableCredential","ProfessionalLicenseCredential"],requiredFields:["credentialSubject.licenseType","credentialSubject.licenseNumber","credentialSubject.issuingAuthority","credentialSubject.isValid"],properties:{credentialSubject:{type:"object",required:["licenseType","licenseNumber","issuingAuthority","isValid"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},issuingState:{type:"string"},isValid:{type:"boolean"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"}}}}}},aoe={getSchema:function(e){return B1[e]||null},getAllSchemas:function(){return B1},validate:function(e,t){try{s7.checkArgument(e&&typeof e=="object","Invalid credential");var r;if(typeof t=="string"){if(r=B1[t],!r)return{valid:!1,errors:["Unknown schema type: "+t]}}else if(typeof t=="object")r=t;else return{valid:!1,errors:["Invalid schema parameter"]};var i=[],n=[];return this._validateCredentialStructure(e,i),this._validateCredentialTypes(e,r,i),this._validateRequiredFields(e,r,i),this._validateFieldProperties(e,r,i,n),{valid:i.length===0,errors:i,warnings:n}}catch(o){return{valid:!1,errors:["Schema validation error: "+o.message]}}},_validateCredentialStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.type||t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject")},_validateCredentialTypes:function(e,t,r){if(!Array.isArray(e.type)){r.push("Credential type must be array");return}if(t.type&&Array.isArray(t.type))for(var i=0;i<t.type.length;i++)e.type.includes(t.type[i])||r.push("Missing required type: "+t.type[i])},_validateRequiredFields:function(e,t,r){if(t.requiredFields&&Array.isArray(t.requiredFields))for(var i=0;i<t.requiredFields.length;i++){var n=t.requiredFields[i],o=this._getNestedProperty(e,n);o==null&&r.push("Missing required field: "+n)}},_validateFieldProperties:function(e,t,r,i){t.properties&&t.properties.credentialSubject&&this._validateObjectProperties(e.credentialSubject,t.properties.credentialSubject,"credentialSubject",r,i)},_validateObjectProperties:function(e,t,r,i,n){!e||typeof e!="object"||t.properties&&Object.keys(t.properties).forEach(function(o){var a=e[o],s=t.properties[o],u=r+"."+o;a!=null&&this._validateProperty(a,s,u,i,n)}.bind(this))},_validateProperty:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type){i.push("Invalid type for "+r+": expected "+t.type+", got "+o);return}}if(t.type==="string"&&(t.format==="email"&&!this._isValidEmail(e)&&i.push("Invalid email format for "+r),t.format==="date"&&!this._isValidDate(e)&&i.push("Invalid date format for "+r),t.format==="date-time"&&!this._isValidDateTime(e)&&i.push("Invalid date-time format for "+r),t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e)),t.type==="number"&&(t.minimum!==void 0&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),t.maximum!==void 0&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum)),t.type==="array"&&t.items)for(var a=0;a<e.length;a++)this._validateProperty(e[a],t.items,r+"["+a+"]",i,n)},_getNestedProperty:function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)},_isValidEmail:function(e){var t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.test(e)},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())},addSchema:function(e,t){s7.checkArgument(typeof e=="string","Schema name must be string"),s7.checkArgument(t&&typeof t=="object","Invalid schema definition"),B1[e]=t},createTemplate:function(e){var t=B1[e];if(!t)throw new Error("Unknown credential type: "+e);var r={"@context":t["@context"]||["https://www.w3.org/2018/credentials/v1"],type:t.type||["VerifiableCredential"],issuer:"did:smartledger:ISSUER_DID_HERE",issuanceDate:new Date().toISOString(),credentialSubject:this._createSubjectTemplate(t.properties?t.properties.credentialSubject:{})};return r},_createSubjectTemplate:function(e){var t={id:"SUBJECT_ID_HERE"};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t},_getDefaultValue:function(e){switch(e.type){case"string":return e.enum?e.enum[0]:e.format==="email"?"example@example.com":e.format==="date"?"2023-01-01":e.format==="date-time"?new Date().toISOString():"PLACEHOLDER_STRING";case"number":return e.minimum||0;case"boolean":return!0;case"array":return[];case"object":return{};default:return null}}};aD.exports=aoe});var fD=k((mve,uD)=>{"use strict";v();var soe=t5(),Ll=r5(),uoe=eD(),foe=rD(),M1=oD(),coe=sD();function pt(e){if(!(this instanceof pt))return new pt(e);e=e||{},this.didResolver=soe,this.attestationVerifier=uoe,this.zkProver=foe,this.schemaValidator=coe,this._attestationSignerOptions=e.attestationSigner||{},this._anchorOptions=e.anchor||{}}pt.prototype.createDID=function(e){return this.didResolver.fromPublicKey(e)};pt.prototype.resolveDID=function(e){return this.didResolver.resolve(e)};pt.prototype.verifyDIDOwnership=function(e,t){return this.didResolver.verifyOwnership(e,t)};pt.prototype.createEmailCredential=function(e,t,r,i){var n=new Ll(i,this._attestationSignerOptions);return n.createEmailCredential(r,{issuerDID:e,subjectId:t})};pt.prototype.createAgeCredential=function(e,t,r,i,n){var o=new Ll(n,this._attestationSignerOptions);return o.createAgeCredential(r,i,{issuerDID:e,subjectId:t})};pt.prototype.createKYCCredential=function(e,t,r,i,n){var o=new Ll(n,this._attestationSignerOptions),a=Object.assign({level:r},i);return o.createKYCCredential(a,{issuerDID:e,subjectId:t})};pt.prototype.createOrganizationCredential=function(e,t,r,i){var n=new Ll(i,this._attestationSignerOptions);return n.createOrganizationCredential(r,{issuerDID:e,subjectId:t})};pt.prototype.createPresentation=function(e,t,r,i){var n=new Ll(r,this._attestationSignerOptions);return n.createPresentation(e,t,r,i)};pt.prototype.signCredential=function(e,t){var r=new Ll(t,this._attestationSignerOptions);return r.signCredential(e,t)};pt.prototype.verifyCredential=function(e,t){return this.attestationVerifier.verifyCredential(e,t)};pt.prototype.verifyPresentation=function(e,t){return this.attestationVerifier.verifyPresentation(e,t)};pt.prototype.extractClaims=function(e){return this.attestationVerifier.extractClaims(e)};pt.prototype.generateSelectiveProof=function(e,t,r){return this.zkProver.generateSelectiveProof(e,t,r)};pt.prototype.verifySelectiveProof=function(e,t){return this.zkProver.verifySelectiveProof(e,t)};pt.prototype.generateAgeProof=function(e,t,r){var i=new Date("1995-06-15");return this.zkProver.generateAgeProof(i,t,r)};pt.prototype.verifyAgeProof=function(e,t,r){return this.zkProver.verifyAgeProof(e,t,r)};pt.prototype.generateRangeProof=function(e,t,r,i){return this.zkProver.generateRangeProof(e,t,r,i)};pt.prototype.verifyRangeProof=function(e,t,r){return this.zkProver.verifyRangeProof(e,t,r)};pt.prototype.generateMembershipProof=function(e,t,r){return this.zkProver.generateMembershipProof(e,t,r)};pt.prototype.verifyMembershipProof=function(e,t){return this.zkProver.verifyMembershipProof(e,t)};pt.prototype.anchorCredential=function(e,t,r){var i=new M1(t,this._anchorOptions);return i.anchorCredential(e,t,r)};pt.prototype.anchorBatch=function(e,t,r){var i=new M1(t,this._anchorOptions);return i.anchorBatch(e,t,r)};pt.prototype.registerDID=function(e,t,r,i){var n=new M1(r,this._anchorOptions);return n.registerDID(e,t,r,i)};pt.prototype.revokeCredential=function(e,t,r,i){var n=new M1(r,this._anchorOptions);return n.revokeCredential(e,t,r,i)};pt.prototype.queryAnchoredData=function(e){var t=new M1(null,this._anchorOptions);return t.queryAnchoredData(e)};pt.prototype.validateCredential=function(e,t){return this.schemaValidator.validate(e,t)};pt.prototype.getSchema=function(e){return this.schemaValidator.getSchema(e)};pt.prototype.getAllSchemas=function(){return this.schemaValidator.getAllSchemas()};pt.prototype.addSchema=function(e,t){return this.schemaValidator.addSchema(e,t)};pt.prototype.createTemplate=function(e){return this.schemaValidator.createTemplate(e)};pt.prototype.generateNonce=function(e){e=e||32;var t=_r();return t.randomBytes(e).toString("hex")};pt.prototype.hashData=function(e,t){var r=_r(),i=r.createHash("sha256");return i.update(e),t&&i.update(t),i.digest("hex")};pt.prototype.getVersion=function(){return"1.0.0"};pt.prototype.getInfo=function(){return{name:"SmartLedger BSV Global Digital Attestation Framework",version:this.getVersion(),description:"W3C-compliant verifiable credentials with DID resolution, zero-knowledge proofs, and blockchain anchoring",components:{didResolver:"DID Resolution and Management",attestationSigner:"Verifiable Credential Creation",attestationVerifier:"Credential and Presentation Verification",zkProver:"Zero-Knowledge Proof Generation and Verification",anchor:"Blockchain Anchoring and Timestamping",schemaValidator:"W3C VC Schema Validation"},standards:["W3C Verifiable Credentials Data Model v1.1","W3C Decentralized Identifiers (DIDs) v1.0","RFC 7515 JSON Web Signature (JWS)","BSV Blockchain Protocol"]}};uD.exports=pt});var lD=k((bve,cD)=>{"use strict";v();var n5=_r();async function loe(e){e=e||{};var t=e.alg||"ES256",r=e.kid||"key-"+Date.now();if(t!=="ES256"&&t!=="ES256K")throw new Error("Invalid algorithm. Must be ES256 or ES256K");var i;t==="ES256"?i=n5.generateKeyPairSync("ec",{namedCurve:"P-256",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}}):i=n5.generateKeyPairSync("ec",{namedCurve:"secp256k1",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});var n=n5.createPublicKey(i.publicKey).export({format:"jwk"}),o=n5.createPrivateKey(i.privateKey).export({format:"jwk"});return n.kid=r,n.alg=t,n.use="sig",n.kty="EC",o.kid=r,o.alg=t,o.use="sig",o.kty="EC",{privateJwk:o,publicJwk:n,kid:r,alg:t}}function hoe(e){if(!e.domain)throw new Error("domain is required");var t=e.domain,r="did:web:"+t.replace(/:/g,"%3A"),i=[],n=[];if(e.p256){var o={id:r+"#"+e.p256.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.p256.jwk};i.push(o),n.push(e.p256.jwk)}if(e.k1){var a={id:r+"#"+e.k1.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.k1.jwk};i.push(a),n.push(e.k1.jwk)}if(i.length===0)throw new Error("At least one key (p256 or k1) must be provided");var s={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:r,verificationMethod:i,authentication:i.map(function(c){return c.id}),assertionMethod:i.map(function(c){return c.id})};e.controllerName&&(s.controller=e.controllerName);var u={keys:n};return{did:r,didDocument:s,jwks:u}}function doe(e){if(!e.domain||!e.newKey)throw new Error("domain and newKey are required");var t=e.domain,r="did:web:"+t.replace(/:/g,"%3A"),i=e.keepOldForDays||30,n={id:r+"#"+e.newKey.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.newKey.jwk},o={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:r,verificationMethod:[n],authentication:[n.id],assertionMethod:[n.id],rotationInfo:{rotatedAt:new Date().toISOString(),gracePeriodDays:i}},a={keys:[e.newKey.jwk]};return{didDocument:o,jwks:a}}cD.exports={generateIssuerKeys:loe,buildDidWebDocuments:hoe,rotateIssuerKey:doe}});var u7=k((wve,hD)=>{"use strict";v();var N1=_r(),C1={ES256:"P-256",ES256K:"secp256k1"},poe=["ES256","ES256K"];function o5(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function a5(e){for(e=e.replace(/-/g,"+").replace(/_/g,"/");e.length%4;)e+="=";return h.Buffer.from(e,"base64")}async function goe(e){if(!e.issuerDid||!e.subjectId||!e.credentialSubject||!e.privateJwk)throw new Error("issuerDid, subjectId, credentialSubject, and privateJwk are required");var t=e.alg||"ES256";if(!C1[t])throw new Error("Unsupported algorithm: "+t);if(e.privateJwk.crv&&e.privateJwk.crv!==C1[t])throw new Error("Key curve "+e.privateJwk.crv+" does not match alg "+t);var r=e.kid||e.privateJwk.kid,i=e.types||["VerifiableCredential"],n=e.expSeconds||365*24*60*60,o=Math.floor(Date.now()/1e3),a=new Date().toISOString(),s={"@context":["https://www.w3.org/2018/credentials/v1"],type:i,issuer:e.issuerDid,issuanceDate:a,credentialSubject:Object.assign({id:e.subjectId},e.credentialSubject)},u={iss:e.issuerDid,sub:e.subjectId,iat:o,exp:o+n,vc:s},c={alg:t,typ:"JWT",kid:r},l=o5(h.Buffer.from(JSON.stringify(c))),m=o5(h.Buffer.from(JSON.stringify(u))),w=l+"."+m,E=N1.createPrivateKey({key:e.privateJwk,format:"jwk"}),P=N1.sign("sha256",h.Buffer.from(w),{key:E,dsaEncoding:"ieee-p1363"}),M=o5(P),D=w+"."+M;return{jwt:D}}async function voe(e,t){t=t||{};try{if(typeof e!="string")return{valid:!1,error:"Invalid JWT format"};var r=e.split(".");if(r.length!==3)return{valid:!1,error:"Invalid JWT format"};var i=r[0],n=r[1],o=r[2],a=JSON.parse(a5(i).toString()),s=JSON.parse(a5(n).toString()),u=a5(o),c=t.allowedAlgs||poe;if(!a.alg||c.indexOf(a.alg)===-1||!C1[a.alg])return{valid:!1,error:"Algorithm not allowed: "+a.alg,header:a,payload:s};var l=Math.floor(Date.now()/1e3),m=t.clockToleranceSec||60;if(t.requireExpiration&&!s.exp)return{valid:!1,error:"JWT missing required exp claim",header:a,payload:s};if(s.exp&&s.exp<l-m)return{valid:!1,error:"JWT expired",header:a,payload:s};if(s.nbf&&s.nbf>l+m)return{valid:!1,error:"JWT not yet valid",header:a,payload:s};if(t.expectedIssuerDid&&s.iss!==t.expectedIssuerDid)return{valid:!1,error:"Unexpected issuer",header:a,payload:s};var w;if(t.didResolver){var E=await t.didResolver(s.iss);if(!E||!E.jwks||!E.jwks.keys)return{valid:!1,error:"Failed to resolve issuer DID",header:a,payload:s};var P=E.jwks.keys.find(function(U){return U.kid===a.kid});if(!P)return{valid:!1,error:"Key not found in JWKS",header:a,payload:s};w=P}else return{valid:!1,error:"DID resolver required for verification",header:a,payload:s};if(w.crv&&w.crv!==C1[a.alg])return{valid:!1,error:"Key curve does not match algorithm",header:a,payload:s};var M=i+"."+n,D=N1.createPublicKey({key:w,format:"jwk"}),L=N1.verify("sha256",h.Buffer.from(M),{key:D,dsaEncoding:"ieee-p1363"},u);if(!L&&t.allowLegacyDER)try{L=N1.verify("sha256",h.Buffer.from(M),{key:D,dsaEncoding:"der"},u)}catch{L=!1}return L?{valid:!0,header:a,payload:s}:{valid:!1,error:"Invalid signature",header:a,payload:s}}catch(U){return{valid:!1,error:U.message||"Verification failed"}}}hD.exports={issueVcJwt:goe,verifyVcJwt:voe,base64UrlEncode:o5,base64UrlDecode:a5,ALG_TO_CRV:C1}});var pD=k((xve,dD)=>{"use strict";v();function moe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}dD.exports=moe});var D1=k(xi=>{"use strict";v();var yoe=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function boe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}xi.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)boe(r,i)&&(e[i]=r[i])}}return e};xi.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var _oe={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+i),n);return}for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){var t,r,i,n,o,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(a=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,n),n+=o.length;return a}},woe={arraySet:function(e,t,r,i,n){for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};xi.setTyped=function(e){e?(xi.Buf8=Uint8Array,xi.Buf16=Uint16Array,xi.Buf32=Int32Array,xi.assign(xi,_oe)):(xi.Buf8=Array,xi.Buf16=Array,xi.Buf32=Array,xi.assign(xi,woe))};xi.setTyped(yoe)});var LD=k(Fl=>{"use strict";v();var Soe=D1(),xoe=4,gD=0,vD=1,Eoe=2;function Ul(e){for(var t=e.length;--t>=0;)e[t]=0}var Ooe=0,SD=1,Ioe=2,Aoe=3,Poe=258,g7=29,j1=256,q1=j1+1+g7,ql=30,v7=19,xD=2*q1+1,Pf=15,f7=16,Toe=7,m7=256,ED=16,OD=17,ID=18,d7=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s5=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],koe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],AD=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Roe=512,Ja=new Array((q1+2)*2);Ul(Ja);var L1=new Array(ql*2);Ul(L1);var U1=new Array(Roe);Ul(U1);var F1=new Array(Poe-Aoe+1);Ul(F1);var y7=new Array(g7);Ul(y7);var u5=new Array(ql);Ul(u5);function c7(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}var PD,TD,kD;function l7(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function RD(e){return e<256?U1[e]:U1[256+(e>>>7)]}function H1(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Ni(e,t,r){e.bi_valid>f7-r?(e.bi_buf|=t<<e.bi_valid&65535,H1(e,e.bi_buf),e.bi_buf=t>>f7-e.bi_valid,e.bi_valid+=r-f7):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Xo(e,t,r){Ni(e,r[t*2],r[t*2+1])}function BD(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Boe(e){e.bi_valid===16?(H1(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Moe(e,t){var r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,l,m,w,E,P,M=0;for(w=0;w<=Pf;w++)e.bl_count[w]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<xD;c++)l=e.heap[c],w=r[r[l*2+1]*2+1]+1,w>u&&(w=u,M++),r[l*2+1]=w,!(l>i)&&(e.bl_count[w]++,E=0,l>=s&&(E=a[l-s]),P=r[l*2],e.opt_len+=P*(w+E),o&&(e.static_len+=P*(n[l*2+1]+E)));if(M!==0){do{for(w=u-1;e.bl_count[w]===0;)w--;e.bl_count[w]--,e.bl_count[w+1]+=2,e.bl_count[u]--,M-=2}while(M>0);for(w=u;w!==0;w--)for(l=e.bl_count[w];l!==0;)m=e.heap[--c],!(m>i)&&(r[m*2+1]!==w&&(e.opt_len+=(w-r[m*2+1])*r[m*2],r[m*2+1]=w),l--)}}function MD(e,t,r){var i=new Array(Pf+1),n=0,o,a;for(o=1;o<=Pf;o++)i[o]=n=n+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=BD(i[s]++,s))}}function Noe(){var e,t,r,i,n,o=new Array(Pf+1);for(r=0,i=0;i<g7-1;i++)for(y7[i]=r,e=0;e<1<<d7[i];e++)F1[r++]=i;for(F1[r-1]=i,n=0,i=0;i<16;i++)for(u5[i]=n,e=0;e<1<<s5[i];e++)U1[n++]=i;for(n>>=7;i<ql;i++)for(u5[i]=n<<7,e=0;e<1<<s5[i]-7;e++)U1[256+n++]=i;for(t=0;t<=Pf;t++)o[t]=0;for(e=0;e<=143;)Ja[e*2+1]=8,e++,o[8]++;for(;e<=255;)Ja[e*2+1]=9,e++,o[9]++;for(;e<=279;)Ja[e*2+1]=7,e++,o[7]++;for(;e<=287;)Ja[e*2+1]=8,e++,o[8]++;for(MD(Ja,q1+1,o),e=0;e<ql;e++)L1[e*2+1]=5,L1[e*2]=BD(e,5);PD=new c7(Ja,d7,j1+1,q1,Pf),TD=new c7(L1,s5,0,ql,Pf),kD=new c7(new Array(0),koe,0,v7,Toe)}function ND(e){var t;for(t=0;t<q1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ql;t++)e.dyn_dtree[t*2]=0;for(t=0;t<v7;t++)e.bl_tree[t*2]=0;e.dyn_ltree[m7*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function CD(e){e.bi_valid>8?H1(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Coe(e,t,r,i){CD(e),i&&(H1(e,r),H1(e,~r)),Soe.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function mD(e,t,r,i){var n=t*2,o=r*2;return e[n]<e[o]||e[n]===e[o]&&i[t]<=i[r]}function h7(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&mD(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!mD(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function yD(e,t,r){var i,n,o=0,a,s;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],n=e.pending_buf[e.l_buf+o],o++,i===0?Xo(e,n,t):(a=F1[n],Xo(e,a+j1+1,t),s=d7[a],s!==0&&(n-=y7[a],Ni(e,n,s)),i--,a=RD(i),Xo(e,a,r),s=s5[a],s!==0&&(i-=u5[a],Ni(e,i,s)));while(o<e.last_lit);Xo(e,m7,t)}function p7(e,t){var r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,u=-1,c;for(e.heap_len=0,e.heap_max=xD,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=u=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=i[c*2+1]);for(t.max_code=u,a=e.heap_len>>1;a>=1;a--)h7(e,r,a);c=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],h7(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[c*2]=r[a*2]+r[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=c,e.heap[1]=c++,h7(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Moe(e,t),MD(r,u,e.bl_count)}function bD(e,t,r){var i,n=-1,o,a=t[1],s=0,u=7,c=4;for(a===0&&(u=138,c=3),t[(r+1)*2+1]=65535,i=0;i<=r;i++)o=a,a=t[(i+1)*2+1],!(++s<u&&o===a)&&(s<c?e.bl_tree[o*2]+=s:o!==0?(o!==n&&e.bl_tree[o*2]++,e.bl_tree[ED*2]++):s<=10?e.bl_tree[OD*2]++:e.bl_tree[ID*2]++,s=0,n=o,a===0?(u=138,c=3):o===a?(u=6,c=3):(u=7,c=4))}function _D(e,t,r){var i,n=-1,o,a=t[1],s=0,u=7,c=4;for(a===0&&(u=138,c=3),i=0;i<=r;i++)if(o=a,a=t[(i+1)*2+1],!(++s<u&&o===a)){if(s<c)do Xo(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==n&&(Xo(e,o,e.bl_tree),s--),Xo(e,ED,e.bl_tree),Ni(e,s-3,2)):s<=10?(Xo(e,OD,e.bl_tree),Ni(e,s-3,3)):(Xo(e,ID,e.bl_tree),Ni(e,s-11,7));s=0,n=o,a===0?(u=138,c=3):o===a?(u=6,c=3):(u=7,c=4)}}function Doe(e){var t;for(bD(e,e.dyn_ltree,e.l_desc.max_code),bD(e,e.dyn_dtree,e.d_desc.max_code),p7(e,e.bl_desc),t=v7-1;t>=3&&e.bl_tree[AD[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Loe(e,t,r,i){var n;for(Ni(e,t-257,5),Ni(e,r-1,5),Ni(e,i-4,4),n=0;n<i;n++)Ni(e,e.bl_tree[AD[n]*2+1],3);_D(e,e.dyn_ltree,t-1),_D(e,e.dyn_dtree,r-1)}function qoe(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return gD;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return vD;for(r=32;r<j1;r++)if(e.dyn_ltree[r*2]!==0)return vD;return gD}var wD=!1;function Uoe(e){wD||(Noe(),wD=!0),e.l_desc=new l7(e.dyn_ltree,PD),e.d_desc=new l7(e.dyn_dtree,TD),e.bl_desc=new l7(e.bl_tree,kD),e.bi_buf=0,e.bi_valid=0,ND(e)}function DD(e,t,r,i){Ni(e,(Ooe<<1)+(i?1:0),3),Coe(e,t,r,!0)}function Foe(e){Ni(e,SD<<1,3),Xo(e,m7,Ja),Boe(e)}function Hoe(e,t,r,i){var n,o,a=0;e.level>0?(e.strm.data_type===Eoe&&(e.strm.data_type=qoe(e)),p7(e,e.l_desc),p7(e,e.d_desc),a=Doe(e),n=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&t!==-1?DD(e,t,r,i):e.strategy===xoe||o===n?(Ni(e,(SD<<1)+(i?1:0),3),yD(e,Ja,L1)):(Ni(e,(Ioe<<1)+(i?1:0),3),Loe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),yD(e,e.dyn_ltree,e.dyn_dtree)),ND(e),i&&CD(e)}function joe(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(F1[r]+j1+1)*2]++,e.dyn_dtree[RD(t)*2]++),e.last_lit===e.lit_bufsize-1}Fl._tr_init=Uoe;Fl._tr_stored_block=DD;Fl._tr_flush_block=Hoe;Fl._tr_tally=joe;Fl._tr_align=Foe});var b7=k((Tve,qD)=>{"use strict";v();function zoe(e,t,r,i){for(var n=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+t[i++]|0,o=o+n|0;while(--a);n%=65521,o%=65521}return n|o<<16|0}qD.exports=zoe});var _7=k((Rve,UD)=>{"use strict";v();function Koe(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Voe=Koe();function Goe(e,t,r,i){var n=Voe,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^n[(e^t[a])&255];return e^-1}UD.exports=Goe});var HD=k((Mve,FD)=>{"use strict";v();FD.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var $D=k(ea=>{"use strict";v();var Ei=D1(),On=LD(),VD=b7(),Hs=_7(),Zoe=HD(),Bf=0,Woe=1,Yoe=3,Gs=4,jD=5,Qo=0,zD=1,In=-2,$oe=-3,w7=-5,Xoe=-1,Joe=1,f5=2,Qoe=3,eae=4,tae=0,rae=2,d5=8,iae=9,nae=15,oae=8,aae=29,sae=256,x7=sae+1+aae,uae=30,fae=19,cae=2*x7+1,lae=15,bt=3,Ks=258,uo=Ks+bt+1,hae=32,p5=42,E7=69,c5=73,l5=91,h5=103,Tf=113,K1=666,Ur=1,V1=2,kf=3,zl=4,dae=3;function Vs(e,t){return e.msg=Zoe[t],t}function KD(e){return(e<<1)-(e>4?9:0)}function zs(e){for(var t=e.length;--t>=0;)e[t]=0}function js(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(Ei.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function ai(e,t){On._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,js(e.strm)}function Pt(e,t){e.pending_buf[e.pending++]=t}function z1(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function pae(e,t,r,i){var n=e.avail_in;return n>i&&(n=i),n===0?0:(e.avail_in-=n,Ei.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=VD(e.adler,t,n,r):e.state.wrap===2&&(e.adler=Hs(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function GD(e,t){var r=e.max_chain_length,i=e.strstart,n,o,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-uo?e.strstart-(e.w_size-uo):0,c=e.window,l=e.w_mask,m=e.prev,w=e.strstart+Ks,E=c[i+a-1],P=c[i+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(n=t,!(c[n+a]!==P||c[n+a-1]!==E||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<w);if(o=Ks-(w-i),i=w-Ks,o>a){if(e.match_start=t,a=o,o>=s)break;E=c[i+a-1],P=c[i+a]}}while((t=m[t&l])>u&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Rf(e){var t=e.w_size,r,i,n,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-uo)){Ei.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do n=e.head[--r],e.head[r]=n>=t?n-t:0;while(--i);i=t,r=i;do n=e.prev[--r],e.prev[r]=n>=t?n-t:0;while(--i);o+=t}if(e.strm.avail_in===0)break;if(i=pae(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=bt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+bt-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<bt)););}while(e.lookahead<uo&&e.strm.avail_in!==0)}function gae(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rf(e),e.lookahead===0&&t===Bf)return Ur;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,ai(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-uo&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):(e.strstart>e.block_start&&(ai(e,!1),e.strm.avail_out===0),Ur)}function S7(e,t){for(var r,i;;){if(e.lookahead<uo){if(Rf(e),e.lookahead<uo&&t===Bf)return Ur;if(e.lookahead===0)break}if(r=0,e.lookahead>=bt&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-uo&&(e.match_length=GD(e,r)),e.match_length>=bt)if(i=On._tr_tally(e,e.strstart-e.match_start,e.match_length-bt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=bt){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=e.strstart<bt-1?e.strstart:bt-1,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function Hl(e,t){for(var r,i,n;;){if(e.lookahead<uo){if(Rf(e),e.lookahead<uo&&t===Bf)return Ur;if(e.lookahead===0)break}if(r=0,e.lookahead>=bt&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=bt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-uo&&(e.match_length=GD(e,r),e.match_length<=5&&(e.strategy===Joe||e.match_length===bt&&e.strstart-e.match_start>4096)&&(e.match_length=bt-1)),e.prev_length>=bt&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-bt,i=On._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-bt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=bt-1,e.strstart++,i&&(ai(e,!1),e.strm.avail_out===0))return Ur}else if(e.match_available){if(i=On._tr_tally(e,0,e.window[e.strstart-1]),i&&ai(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ur}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=On._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<bt-1?e.strstart:bt-1,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function vae(e,t){for(var r,i,n,o,a=e.window;;){if(e.lookahead<=Ks){if(Rf(e),e.lookahead<=Ks&&t===Bf)return Ur;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=bt&&e.strstart>0&&(n=e.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){o=e.strstart+Ks;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<o);e.match_length=Ks-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=bt?(r=On._tr_tally(e,1,e.match_length-bt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function mae(e,t){for(var r;;){if(e.lookahead===0&&(Rf(e),e.lookahead===0)){if(t===Bf)return Ur;break}if(e.match_length=0,r=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function Jo(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}var jl;jl=[new Jo(0,0,0,0,gae),new Jo(4,4,8,4,S7),new Jo(4,5,16,8,S7),new Jo(4,6,32,32,S7),new Jo(4,4,16,16,Hl),new Jo(8,16,32,32,Hl),new Jo(8,16,128,128,Hl),new Jo(8,32,128,256,Hl),new Jo(32,128,258,1024,Hl),new Jo(32,258,258,4096,Hl)];function yae(e){e.window_size=2*e.w_size,zs(e.head),e.max_lazy_match=jl[e.level].max_lazy,e.good_match=jl[e.level].good_length,e.nice_match=jl[e.level].nice_length,e.max_chain_length=jl[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=bt-1,e.match_available=0,e.ins_h=0}function bae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=d5,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ei.Buf16(cae*2),this.dyn_dtree=new Ei.Buf16((2*uae+1)*2),this.bl_tree=new Ei.Buf16((2*fae+1)*2),zs(this.dyn_ltree),zs(this.dyn_dtree),zs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ei.Buf16(lae+1),this.heap=new Ei.Buf16(2*x7+1),zs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ei.Buf16(2*x7+1),zs(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ZD(e){var t;return!e||!e.state?Vs(e,In):(e.total_in=e.total_out=0,e.data_type=rae,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?p5:Tf,e.adler=t.wrap===2?0:1,t.last_flush=Bf,On._tr_init(t),Qo)}function WD(e){var t=ZD(e);return t===Qo&&yae(e.state),t}function _ae(e,t){return!e||!e.state||e.state.wrap!==2?In:(e.state.gzhead=t,Qo)}function YD(e,t,r,i,n,o){if(!e)return In;var a=1;if(t===Xoe&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>iae||r!==d5||i<8||i>15||t<0||t>9||o<0||o>eae)return Vs(e,In);i===8&&(i=9);var s=new bae;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+bt-1)/bt),s.window=new Ei.Buf8(s.w_size*2),s.head=new Ei.Buf16(s.hash_size),s.prev=new Ei.Buf16(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Ei.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,WD(e)}function wae(e,t){return YD(e,t,d5,nae,oae,tae)}function Sae(e,t){var r,i,n,o;if(!e||!e.state||t>jD||t<0)return e?Vs(e,In):In;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===K1&&t!==Gs)return Vs(e,e.avail_out===0?w7:In);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===p5)if(i.wrap===2)e.adler=0,Pt(i,31),Pt(i,139),Pt(i,8),i.gzhead?(Pt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Pt(i,i.gzhead.time&255),Pt(i,i.gzhead.time>>8&255),Pt(i,i.gzhead.time>>16&255),Pt(i,i.gzhead.time>>24&255),Pt(i,i.level===9?2:i.strategy>=f5||i.level<2?4:0),Pt(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Pt(i,i.gzhead.extra.length&255),Pt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Hs(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=E7):(Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,i.level===9?2:i.strategy>=f5||i.level<2?4:0),Pt(i,dae),i.status=Tf);else{var a=d5+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=f5||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,a|=s<<6,i.strstart!==0&&(a|=hae),a+=31-a%31,i.status=Tf,z1(i,a),i.strstart!==0&&(z1(i,e.adler>>>16),z1(i,e.adler&65535)),e.adler=1}if(i.status===E7)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),js(e),n=i.pending,i.pending===i.pending_buf_size));)Pt(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=c5)}else i.status=c5;if(i.status===c5)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),js(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,Pt(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=l5)}else i.status=l5;if(i.status===l5)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),js(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,Pt(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=h5)}else i.status=h5;if(i.status===h5&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&js(e),i.pending+2<=i.pending_buf_size&&(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),e.adler=0,i.status=Tf)):i.status=Tf),i.pending!==0){if(js(e),e.avail_out===0)return i.last_flush=-1,Qo}else if(e.avail_in===0&&KD(t)<=KD(r)&&t!==Gs)return Vs(e,w7);if(i.status===K1&&e.avail_in!==0)return Vs(e,w7);if(e.avail_in!==0||i.lookahead!==0||t!==Bf&&i.status!==K1){var u=i.strategy===f5?mae(i,t):i.strategy===Qoe?vae(i,t):jl[i.level].func(i,t);if((u===kf||u===zl)&&(i.status=K1),u===Ur||u===kf)return e.avail_out===0&&(i.last_flush=-1),Qo;if(u===V1&&(t===Woe?On._tr_align(i):t!==jD&&(On._tr_stored_block(i,0,0,!1),t===Yoe&&(zs(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),js(e),e.avail_out===0))return i.last_flush=-1,Qo}return t!==Gs?Qo:i.wrap<=0?zD:(i.wrap===2?(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),Pt(i,e.adler>>16&255),Pt(i,e.adler>>24&255),Pt(i,e.total_in&255),Pt(i,e.total_in>>8&255),Pt(i,e.total_in>>16&255),Pt(i,e.total_in>>24&255)):(z1(i,e.adler>>>16),z1(i,e.adler&65535)),js(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Qo:zD)}function xae(e){var t;return!e||!e.state?In:(t=e.state.status,t!==p5&&t!==E7&&t!==c5&&t!==l5&&t!==h5&&t!==Tf&&t!==K1?Vs(e,In):(e.state=null,t===Tf?Vs(e,$oe):Qo))}function Eae(e,t){var r=t.length,i,n,o,a,s,u,c,l;if(!e||!e.state||(i=e.state,a=i.wrap,a===2||a===1&&i.status!==p5||i.lookahead))return In;for(a===1&&(e.adler=VD(e.adler,t,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(zs(i.head),i.strstart=0,i.block_start=0,i.insert=0),l=new Ei.Buf8(i.w_size),Ei.arraySet(l,t,r-i.w_size,i.w_size,0),t=l,r=i.w_size),s=e.avail_in,u=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,Rf(i);i.lookahead>=bt;){n=i.strstart,o=i.lookahead-(bt-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+bt-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=bt-1,Rf(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=bt-1,i.match_available=0,e.next_in=u,e.input=c,e.avail_in=s,i.wrap=a,Qo}ea.deflateInit=wae;ea.deflateInit2=YD;ea.deflateReset=WD;ea.deflateResetKeep=ZD;ea.deflateSetHeader=_ae;ea.deflate=Sae;ea.deflateEnd=xae;ea.deflateSetDictionary=Eae;ea.deflateInfo="pako deflate (from Nodeca project)"});var JD=k((Lve,XD)=>{"use strict";v();var g5=30,Oae=12;XD.exports=function(t,r){var i,n,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F,H,z,G,B,g;i=t.state,n=t.next_in,B=t.input,o=n+(t.avail_in-5),a=t.next_out,g=t.output,s=a-(r-t.avail_out),u=a+(t.avail_out-257),c=i.dmax,l=i.wsize,m=i.whave,w=i.wnext,E=i.window,P=i.hold,M=i.bits,D=i.lencode,L=i.distcode,U=(1<<i.lenbits)-1,K=(1<<i.distbits)-1;e:do{M<15&&(P+=B[n++]<<M,M+=8,P+=B[n++]<<M,M+=8),N=D[P&U];t:for(;;){if(C=N>>>24,P>>>=C,M-=C,C=N>>>16&255,C===0)g[a++]=N&65535;else if(C&16){F=N&65535,C&=15,C&&(M<C&&(P+=B[n++]<<M,M+=8),F+=P&(1<<C)-1,P>>>=C,M-=C),M<15&&(P+=B[n++]<<M,M+=8,P+=B[n++]<<M,M+=8),N=L[P&K];r:for(;;){if(C=N>>>24,P>>>=C,M-=C,C=N>>>16&255,C&16){if(H=N&65535,C&=15,M<C&&(P+=B[n++]<<M,M+=8,M<C&&(P+=B[n++]<<M,M+=8)),H+=P&(1<<C)-1,H>c){t.msg="invalid distance too far back",i.mode=g5;break e}if(P>>>=C,M-=C,C=a-s,H>C){if(C=H-C,C>m&&i.sane){t.msg="invalid distance too far back",i.mode=g5;break e}if(z=0,G=E,w===0){if(z+=l-C,C<F){F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}}else if(w<C){if(z+=l+w-C,C-=w,C<F){F-=C;do g[a++]=E[z++];while(--C);if(z=0,w<F){C=w,F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}}}else if(z+=w-C,C<F){F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}for(;F>2;)g[a++]=G[z++],g[a++]=G[z++],g[a++]=G[z++],F-=3;F&&(g[a++]=G[z++],F>1&&(g[a++]=G[z++]))}else{z=a-H;do g[a++]=g[z++],g[a++]=g[z++],g[a++]=g[z++],F-=3;while(F>2);F&&(g[a++]=g[z++],F>1&&(g[a++]=g[z++]))}}else if((C&64)===0){N=L[(N&65535)+(P&(1<<C)-1)];continue r}else{t.msg="invalid distance code",i.mode=g5;break e}break}}else if((C&64)===0){N=D[(N&65535)+(P&(1<<C)-1)];continue t}else if(C&32){i.mode=Oae;break e}else{t.msg="invalid literal/length code",i.mode=g5;break e}break}}while(n<o&&a<u);F=M>>3,n-=F,M-=F<<3,P&=(1<<M)-1,t.next_in=n,t.next_out=a,t.avail_in=n<o?5+(o-n):5-(n-o),t.avail_out=a<u?257+(u-a):257-(a-u),i.hold=P,i.bits=M}});var oL=k((Uve,nL)=>{"use strict";v();var QD=D1(),Kl=15,eL=852,tL=592,rL=0,O7=1,iL=2,Iae=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Aae=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Pae=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Tae=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];nL.exports=function(t,r,i,n,o,a,s,u){var c=u.bits,l=0,m=0,w=0,E=0,P=0,M=0,D=0,L=0,U=0,K=0,N,C,F,H,z,G=null,B=0,g,O=new QD.Buf16(Kl+1),y=new QD.Buf16(Kl+1),f=null,d=0,_,x,b;for(l=0;l<=Kl;l++)O[l]=0;for(m=0;m<n;m++)O[r[i+m]]++;for(P=c,E=Kl;E>=1&&O[E]===0;E--);if(P>E&&(P=E),E===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,u.bits=1,0;for(w=1;w<E&&O[w]===0;w++);for(P<w&&(P=w),L=1,l=1;l<=Kl;l++)if(L<<=1,L-=O[l],L<0)return-1;if(L>0&&(t===rL||E!==1))return-1;for(y[1]=0,l=1;l<Kl;l++)y[l+1]=y[l]+O[l];for(m=0;m<n;m++)r[i+m]!==0&&(s[y[r[i+m]]++]=m);if(t===rL?(G=f=s,g=19):t===O7?(G=Iae,B-=257,f=Aae,d-=257,g=256):(G=Pae,f=Tae,g=-1),K=0,m=0,l=w,z=a,M=P,D=0,F=-1,U=1<<P,H=U-1,t===O7&&U>eL||t===iL&&U>tL)return 1;for(;;){_=l-D,s[m]<g?(x=0,b=s[m]):s[m]>g?(x=f[d+s[m]],b=G[B+s[m]]):(x=96,b=0),N=1<<l-D,C=1<<M,w=C;do C-=N,o[z+(K>>D)+C]=_<<24|x<<16|b|0;while(C!==0);for(N=1<<l-1;K&N;)N>>=1;if(N!==0?(K&=N-1,K+=N):K=0,m++,--O[l]===0){if(l===E)break;l=r[i+s[m]]}if(l>P&&(K&H)!==F){for(D===0&&(D=P),z+=w,M=l-D,L=1<<M;M+D<E&&(L-=O[M+D],!(L<=0));)M++,L<<=1;if(U+=1<<M,t===O7&&U>eL||t===iL&&U>tL)return 1;F=K&H,o[F]=P<<24|M<<16|z-a|0}}return K!==0&&(o[z+K]=l-D<<24|64<<16|0),u.bits=P,0}});var FL=k(fo=>{"use strict";v();var Zi=D1(),R7=b7(),ta=_7(),kae=JD(),G1=oL(),Rae=0,RL=1,BL=2,aL=4,Bae=5,v5=6,Mf=0,Mae=1,Nae=2,An=-2,ML=-3,B7=-4,Cae=-5,sL=8,NL=1,uL=2,fL=3,cL=4,lL=5,hL=6,dL=7,pL=8,gL=9,vL=10,b5=11,Qa=12,I7=13,mL=14,A7=15,yL=16,bL=17,_L=18,wL=19,m5=20,y5=21,SL=22,xL=23,EL=24,OL=25,IL=26,P7=27,AL=28,PL=29,ir=30,M7=31,Dae=32,Lae=852,qae=592,Uae=15,Fae=Uae;function TL(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Hae(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Zi.Buf16(320),this.work=new Zi.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function CL(e){var t;return!e||!e.state?An:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=NL,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Zi.Buf32(Lae),t.distcode=t.distdyn=new Zi.Buf32(qae),t.sane=1,t.back=-1,Mf)}function DL(e){var t;return!e||!e.state?An:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,CL(e))}function LL(e,t){var r,i;return!e||!e.state||(i=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?An:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,DL(e))}function qL(e,t){var r,i;return e?(i=new Hae,e.state=i,i.window=null,r=LL(e,t),r!==Mf&&(e.state=null),r):An}function jae(e){return qL(e,Fae)}var kL=!0,T7,k7;function zae(e){if(kL){var t;for(T7=new Zi.Buf32(512),k7=new Zi.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(G1(RL,e.lens,0,288,T7,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;G1(BL,e.lens,0,32,k7,0,e.work,{bits:5}),kL=!1}e.lencode=T7,e.lenbits=9,e.distcode=k7,e.distbits=5}function UL(e,t,r,i){var n,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Zi.Buf8(o.wsize)),i>=o.wsize?(Zi.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),Zi.arraySet(o.window,t,r-i,n,o.wnext),i-=n,i?(Zi.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function Kae(e,t){var r,i,n,o,a,s,u,c,l,m,w,E,P,M,D=0,L,U,K,N,C,F,H,z,G=new Zi.Buf8(4),B,g,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return An;r=e.state,r.mode===Qa&&(r.mode=I7),a=e.next_out,n=e.output,u=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,c=r.hold,l=r.bits,m=s,w=u,z=Mf;e:for(;;)switch(r.mode){case NL:if(r.wrap===0){r.mode=I7;break}for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0),c=0,l=0,r.mode=uL;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ir;break}if((c&15)!==sL){e.msg="unknown compression method",r.mode=ir;break}if(c>>>=4,l-=4,H=(c&15)+8,r.wbits===0)r.wbits=H;else if(H>r.wbits){e.msg="invalid window size",r.mode=ir;break}r.dmax=1<<H,e.adler=r.check=1,r.mode=c&512?vL:Qa,c=0,l=0;break;case uL:for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==sL){e.msg="unknown compression method",r.mode=ir;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=ir;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0,r.mode=fL;case fL:for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,G[2]=c>>>16&255,G[3]=c>>>24&255,r.check=ta(r.check,G,4,0)),c=0,l=0,r.mode=cL;case cL:for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0,r.mode=lL;case lL:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=hL;case hL:if(r.flags&1024&&(E=r.length,E>s&&(E=s),E&&(r.head&&(H=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Zi.arraySet(r.head.extra,i,o,E,H)),r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,r.length-=E),r.length))break e;r.length=0,r.mode=dL;case dL:if(r.flags&2048){if(s===0)break e;E=0;do H=i[o+E++],r.head&&H&&r.length<65536&&(r.head.name+=String.fromCharCode(H));while(H&&E<s);if(r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,H)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=pL;case pL:if(r.flags&4096){if(s===0)break e;E=0;do H=i[o+E++],r.head&&H&&r.length<65536&&(r.head.comment+=String.fromCharCode(H));while(H&&E<s);if(r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,H)break e}else r.head&&(r.head.comment=null);r.mode=gL;case gL:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=ir;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Qa;break;case vL:for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}e.adler=r.check=TL(c),c=0,l=0,r.mode=b5;case b5:if(r.havedict===0)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,Nae;e.adler=r.check=1,r.mode=Qa;case Qa:if(t===Bae||t===v5)break e;case I7:if(r.last){c>>>=l&7,l-=l&7,r.mode=P7;break}for(;l<3;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=mL;break;case 1:if(zae(r),r.mode=m5,t===v5){c>>>=2,l-=2;break e}break;case 2:r.mode=bL;break;case 3:e.msg="invalid block type",r.mode=ir}c>>>=2,l-=2;break;case mL:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ir;break}if(r.length=c&65535,c=0,l=0,r.mode=A7,t===v5)break e;case A7:r.mode=yL;case yL:if(E=r.length,E){if(E>s&&(E=s),E>u&&(E=u),E===0)break e;Zi.arraySet(n,i,o,E,a),s-=E,o+=E,u-=E,a+=E,r.length-=E;break}r.mode=Qa;break;case bL:for(;l<14;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ir;break}r.have=0,r.mode=_L;case _L:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.lens[O[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,B={bits:r.lenbits},z=G1(Rae,r.lens,0,19,r.lencode,0,r.work,B),r.lenbits=B.bits,z){e.msg="invalid code lengths set",r.mode=ir;break}r.have=0,r.mode=wL;case wL:for(;r.have<r.nlen+r.ndist;){for(;D=r.lencode[c&(1<<r.lenbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(K<16)c>>>=L,l-=L,r.lens[r.have++]=K;else{if(K===16){for(g=L+2;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c>>>=L,l-=L,r.have===0){e.msg="invalid bit length repeat",r.mode=ir;break}H=r.lens[r.have-1],E=3+(c&3),c>>>=2,l-=2}else if(K===17){for(g=L+3;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=L,l-=L,H=0,E=3+(c&7),c>>>=3,l-=3}else{for(g=L+7;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=L,l-=L,H=0,E=11+(c&127),c>>>=7,l-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ir;break}for(;E--;)r.lens[r.have++]=H}}if(r.mode===ir)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ir;break}if(r.lenbits=9,B={bits:r.lenbits},z=G1(RL,r.lens,0,r.nlen,r.lencode,0,r.work,B),r.lenbits=B.bits,z){e.msg="invalid literal/lengths set",r.mode=ir;break}if(r.distbits=6,r.distcode=r.distdyn,B={bits:r.distbits},z=G1(BL,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,B),r.distbits=B.bits,z){e.msg="invalid distances set",r.mode=ir;break}if(r.mode=m5,t===v5)break e;case m5:r.mode=y5;case y5:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,kae(e,w),a=e.next_out,n=e.output,u=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,c=r.hold,l=r.bits,r.mode===Qa&&(r.back=-1);break}for(r.back=0;D=r.lencode[c&(1<<r.lenbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(U&&(U&240)===0){for(N=L,C=U,F=K;D=r.lencode[F+((c&(1<<N+C)-1)>>N)],L=D>>>24,U=D>>>16&255,K=D&65535,!(N+L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=N,l-=N,r.back+=N}if(c>>>=L,l-=L,r.back+=L,r.length=K,U===0){r.mode=IL;break}if(U&32){r.back=-1,r.mode=Qa;break}if(U&64){e.msg="invalid literal/length code",r.mode=ir;break}r.extra=U&15,r.mode=SL;case SL:if(r.extra){for(g=r.extra;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=xL;case xL:for(;D=r.distcode[c&(1<<r.distbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if((U&240)===0){for(N=L,C=U,F=K;D=r.distcode[F+((c&(1<<N+C)-1)>>N)],L=D>>>24,U=D>>>16&255,K=D&65535,!(N+L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=N,l-=N,r.back+=N}if(c>>>=L,l-=L,r.back+=L,U&64){e.msg="invalid distance code",r.mode=ir;break}r.offset=K,r.extra=U&15,r.mode=EL;case EL:if(r.extra){for(g=r.extra;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ir;break}r.mode=OL;case OL:if(u===0)break e;if(E=w-u,r.offset>E){if(E=r.offset-E,E>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ir;break}E>r.wnext?(E-=r.wnext,P=r.wsize-E):P=r.wnext-E,E>r.length&&(E=r.length),M=r.window}else M=n,P=a-r.offset,E=r.length;E>u&&(E=u),u-=E,r.length-=E;do n[a++]=M[P++];while(--E);r.length===0&&(r.mode=y5);break;case IL:if(u===0)break e;n[a++]=r.length,u--,r.mode=y5;break;case P7:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=i[o++]<<l,l+=8}if(w-=u,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?ta(r.check,n,w,a-w):R7(r.check,n,w,a-w)),w=u,(r.flags?c:TL(c))!==r.check){e.msg="incorrect data check",r.mode=ir;break}c=0,l=0}r.mode=AL;case AL:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=ir;break}c=0,l=0}r.mode=PL;case PL:z=Mae;break e;case ir:z=ML;break e;case M7:return B7;case Dae:default:return An}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,(r.wsize||w!==e.avail_out&&r.mode<ir&&(r.mode<P7||t!==aL))&&UL(e,e.output,e.next_out,w-e.avail_out)?(r.mode=M7,B7):(m-=e.avail_in,w-=e.avail_out,e.total_in+=m,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?ta(r.check,n,w,e.next_out-w):R7(r.check,n,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Qa?128:0)+(r.mode===m5||r.mode===A7?256:0),(m===0&&w===0||t===aL)&&z===Mf&&(z=Cae),z)}function Vae(e){if(!e||!e.state)return An;var t=e.state;return t.window&&(t.window=null),e.state=null,Mf}function Gae(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?An:(r.head=t,t.done=!1,Mf)}function Zae(e,t){var r=t.length,i,n,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==b5)?An:i.mode===b5&&(n=1,n=R7(n,t,r,0),n!==i.check)?ML:(o=UL(e,t,r,r),o?(i.mode=M7,B7):(i.havedict=1,Mf))}fo.inflateReset=DL;fo.inflateReset2=LL;fo.inflateResetKeep=CL;fo.inflateInit=jae;fo.inflateInit2=qL;fo.inflate=Kae;fo.inflateEnd=Vae;fo.inflateGetHeader=Gae;fo.inflateSetDictionary=Zae;fo.inflateInfo="pako inflate (from Nodeca project)"});var jL=k((zve,HL)=>{"use strict";v();HL.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var KL=k(de=>{"use strict";v();var Wi=xs(),Wae=pD(),Z1=$D(),Nf=FL(),zL=jL();for(N7 in zL)de[N7]=zL[N7];var N7;de.NONE=0;de.DEFLATE=1;de.INFLATE=2;de.GZIP=3;de.GUNZIP=4;de.DEFLATERAW=5;de.INFLATERAW=6;de.UNZIP=7;var Yae=31,$ae=139;function mi(e){if(typeof e!="number"||e<de.DEFLATE||e>de.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}mi.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,Wi(this.init_done,"close before init"),Wi(this.mode<=de.UNZIP),this.mode===de.DEFLATE||this.mode===de.GZIP||this.mode===de.DEFLATERAW?Z1.deflateEnd(this.strm):(this.mode===de.INFLATE||this.mode===de.GUNZIP||this.mode===de.INFLATERAW||this.mode===de.UNZIP)&&Nf.inflateEnd(this.strm),this.mode=de.NONE,this.dictionary=null};mi.prototype.write=function(e,t,r,i,n,o,a){return this._write(!0,e,t,r,i,n,o,a)};mi.prototype.writeSync=function(e,t,r,i,n,o,a){return this._write(!1,e,t,r,i,n,o,a)};mi.prototype._write=function(e,t,r,i,n,o,a,s){if(Wi.equal(arguments.length,8),Wi(this.init_done,"write before init"),Wi(this.mode!==de.NONE,"already finalized"),Wi.equal(!1,this.write_in_progress,"write already in progress"),Wi.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,Wi.equal(!1,t===void 0,"must provide flush value"),this.write_in_progress=!0,t!==de.Z_NO_FLUSH&&t!==de.Z_PARTIAL_FLUSH&&t!==de.Z_SYNC_FLUSH&&t!==de.Z_FULL_FLUSH&&t!==de.Z_FINISH&&t!==de.Z_BLOCK)throw new Error("Invalid flush value");if(r==null&&(r=h.Buffer.alloc(0),n=0,i=0),this.strm.avail_in=n,this.strm.input=r,this.strm.next_in=i,this.strm.avail_out=s,this.strm.output=o,this.strm.next_out=a,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var u=this;return A.default.nextTick(function(){u._process(),u._after()}),this};mi.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]};mi.prototype._process=function(){var e=null;switch(this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=Z1.deflate(this.strm,this.flush);break;case de.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(e===null)break;if(this.strm.input[e]===Yae){if(this.gzip_id_bytes_read=1,e++,this.strm.avail_in===1)break}else{this.mode=de.INFLATE;break}case 1:if(e===null)break;this.strm.input[e]===$ae?(this.gzip_id_bytes_read=2,this.mode=de.GUNZIP):this.mode=de.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:for(this.err=Nf.inflate(this.strm,this.flush),this.err===de.Z_NEED_DICT&&this.dictionary&&(this.err=Nf.inflateSetDictionary(this.strm,this.dictionary),this.err===de.Z_OK?this.err=Nf.inflate(this.strm,this.flush):this.err===de.Z_DATA_ERROR&&(this.err=de.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===de.GUNZIP&&this.err===de.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=Nf.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}};mi.prototype._checkError=function(){switch(this.err){case de.Z_OK:case de.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===de.Z_FINISH)return this._error("unexpected end of file"),!1;break;case de.Z_STREAM_END:break;case de.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0};mi.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}};mi.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()};mi.prototype.init=function(e,t,r,i,n){Wi(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),Wi(e>=8&&e<=15,"invalid windowBits"),Wi(t>=-1&&t<=9,"invalid compression level"),Wi(r>=1&&r<=9,"invalid memlevel"),Wi(i===de.Z_FILTERED||i===de.Z_HUFFMAN_ONLY||i===de.Z_RLE||i===de.Z_FIXED||i===de.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,r,i,n),this._setDictionary()};mi.prototype.params=function(){throw new Error("deflateParams Not supported")};mi.prototype.reset=function(){this._reset(),this._setDictionary()};mi.prototype._init=function(e,t,r,i,n){switch(this.level=e,this.windowBits=t,this.memLevel=r,this.strategy=i,this.flush=de.Z_NO_FLUSH,this.err=de.Z_OK,(this.mode===de.GZIP||this.mode===de.GUNZIP)&&(this.windowBits+=16),this.mode===de.UNZIP&&(this.windowBits+=32),(this.mode===de.DEFLATERAW||this.mode===de.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new Wae,this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=Z1.deflateInit2(this.strm,this.level,de.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:case de.UNZIP:this.err=Nf.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==de.Z_OK&&this._error("Init error"),this.dictionary=n,this.write_in_progress=!1,this.init_done=!0};mi.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:this.err=Z1.deflateSetDictionary(this.strm,this.dictionary);break;default:break}this.err!==de.Z_OK&&this._error("Failed to set dictionary")}};mi.prototype._reset=function(){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:case de.GZIP:this.err=Z1.deflateReset(this.strm);break;case de.INFLATE:case de.INFLATERAW:case de.GUNZIP:this.err=Nf.inflateReset(this.strm);break;default:break}this.err!==de.Z_OK&&this._error("Failed to reset stream")};de.Zlib=mi});var L7=k(we=>{"use strict";v();var ra=zt().Buffer,WL=Qd().Transform,De=KL(),Zs=tn(),W1=xs().ok,D7=zt().kMaxLength,YL="Cannot create final Buffer. It would be larger than 0x"+D7.toString(16)+" bytes";De.Z_MIN_WINDOWBITS=8;De.Z_MAX_WINDOWBITS=15;De.Z_DEFAULT_WINDOWBITS=15;De.Z_MIN_CHUNK=64;De.Z_MAX_CHUNK=1/0;De.Z_DEFAULT_CHUNK=16*1024;De.Z_MIN_MEMLEVEL=1;De.Z_MAX_MEMLEVEL=9;De.Z_DEFAULT_MEMLEVEL=8;De.Z_MIN_LEVEL=-1;De.Z_MAX_LEVEL=9;De.Z_DEFAULT_LEVEL=De.Z_DEFAULT_COMPRESSION;var VL=Object.keys(De);for(_5=0;_5<VL.length;_5++)w5=VL[_5],w5.match(/^Z/)&&Object.defineProperty(we,w5,{enumerable:!0,value:De[w5],writable:!1});var w5,_5,x5={Z_OK:De.Z_OK,Z_STREAM_END:De.Z_STREAM_END,Z_NEED_DICT:De.Z_NEED_DICT,Z_ERRNO:De.Z_ERRNO,Z_STREAM_ERROR:De.Z_STREAM_ERROR,Z_DATA_ERROR:De.Z_DATA_ERROR,Z_MEM_ERROR:De.Z_MEM_ERROR,Z_BUF_ERROR:De.Z_BUF_ERROR,Z_VERSION_ERROR:De.Z_VERSION_ERROR},GL=Object.keys(x5);for(S5=0;S5<GL.length;S5++)C7=GL[S5],x5[x5[C7]]=C7;var C7,S5;Object.defineProperty(we,"codes",{enumerable:!0,value:Object.freeze(x5),writable:!1});we.Deflate=Cf;we.Inflate=Df;we.Gzip=Lf;we.Gunzip=qf;we.DeflateRaw=Uf;we.InflateRaw=Ff;we.Unzip=Hf;we.createDeflate=function(e){return new Cf(e)};we.createInflate=function(e){return new Df(e)};we.createDeflateRaw=function(e){return new Uf(e)};we.createInflateRaw=function(e){return new Ff(e)};we.createGzip=function(e){return new Lf(e)};we.createGunzip=function(e){return new qf(e)};we.createUnzip=function(e){return new Hf(e)};we.deflate=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Cf(t),e,r)};we.deflateSync=function(e,t){return zf(new Cf(t),e)};we.gzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Lf(t),e,r)};we.gzipSync=function(e,t){return zf(new Lf(t),e)};we.deflateRaw=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Uf(t),e,r)};we.deflateRawSync=function(e,t){return zf(new Uf(t),e)};we.unzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Hf(t),e,r)};we.unzipSync=function(e,t){return zf(new Hf(t),e)};we.inflate=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Df(t),e,r)};we.inflateSync=function(e,t){return zf(new Df(t),e)};we.gunzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new qf(t),e,r)};we.gunzipSync=function(e,t){return zf(new qf(t),e)};we.inflateRaw=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Ff(t),e,r)};we.inflateRawSync=function(e,t){return zf(new Ff(t),e)};function jf(e,t,r){var i=[],n=0;e.on("error",a),e.on("end",s),e.end(t),o();function o(){for(var u;(u=e.read())!==null;)i.push(u),n+=u.length;e.once("readable",o)}function a(u){e.removeListener("end",s),e.removeListener("readable",o),r(u)}function s(){var u,c=null;n>=D7?c=new RangeError(YL):u=ra.concat(i,n),i=[],e.close(),r(c,u)}}function zf(e,t){if(typeof t=="string"&&(t=ra.from(t)),!ra.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function Cf(e){if(!(this instanceof Cf))return new Cf(e);hr.call(this,e,De.DEFLATE)}function Df(e){if(!(this instanceof Df))return new Df(e);hr.call(this,e,De.INFLATE)}function Lf(e){if(!(this instanceof Lf))return new Lf(e);hr.call(this,e,De.GZIP)}function qf(e){if(!(this instanceof qf))return new qf(e);hr.call(this,e,De.GUNZIP)}function Uf(e){if(!(this instanceof Uf))return new Uf(e);hr.call(this,e,De.DEFLATERAW)}function Ff(e){if(!(this instanceof Ff))return new Ff(e);hr.call(this,e,De.INFLATERAW)}function Hf(e){if(!(this instanceof Hf))return new Hf(e);hr.call(this,e,De.UNZIP)}function ZL(e){return e===De.Z_NO_FLUSH||e===De.Z_PARTIAL_FLUSH||e===De.Z_SYNC_FLUSH||e===De.Z_FULL_FLUSH||e===De.Z_FINISH||e===De.Z_BLOCK}function hr(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||we.Z_DEFAULT_CHUNK,WL.call(this,e),e.flush&&!ZL(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!ZL(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||De.Z_NO_FLUSH,this._finishFlushFlag=typeof e.finishFlush<"u"?e.finishFlush:De.Z_FINISH,e.chunkSize&&(e.chunkSize<we.Z_MIN_CHUNK||e.chunkSize>we.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<we.Z_MIN_WINDOWBITS||e.windowBits>we.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<we.Z_MIN_LEVEL||e.level>we.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<we.Z_MIN_MEMLEVEL||e.memLevel>we.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=we.Z_FILTERED&&e.strategy!=we.Z_HUFFMAN_ONLY&&e.strategy!=we.Z_RLE&&e.strategy!=we.Z_FIXED&&e.strategy!=we.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!ra.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new De.Zlib(t);var i=this;this._hadError=!1,this._handle.onerror=function(a,s){E5(i),i._hadError=!0;var u=new Error(a);u.errno=s,u.code=we.codes[s],i.emit("error",u)};var n=we.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(n=e.level);var o=we.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(o=e.strategy),this._handle.init(e.windowBits||we.Z_DEFAULT_WINDOWBITS,n,e.memLevel||we.Z_DEFAULT_MEMLEVEL,o,e.dictionary),this._buffer=ra.allocUnsafe(this._chunkSize),this._offset=0,this._level=n,this._strategy=o,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}Zs.inherits(hr,WL);hr.prototype.params=function(e,t,r){if(e<we.Z_MIN_LEVEL||e>we.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=we.Z_FILTERED&&t!=we.Z_HUFFMAN_ONLY&&t!=we.Z_RLE&&t!=we.Z_FIXED&&t!=we.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(De.Z_SYNC_FLUSH,function(){W1(i._handle,"zlib binding closed"),i._handle.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else A.default.nextTick(r)};hr.prototype.reset=function(){return W1(this._handle,"zlib binding closed"),this._handle.reset()};hr.prototype._flush=function(e){this._transform(ra.alloc(0),"",e)};hr.prototype.flush=function(e,t){var r=this,i=this._writableState;(typeof e=="function"||e===void 0&&!t)&&(t=e,e=De.Z_FULL_FLUSH),i.ended?t&&A.default.nextTick(t):i.ending?t&&this.once("end",t):i.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(ra.alloc(0),"",t))};hr.prototype.close=function(e){E5(this,e),A.default.nextTick(Xae,this)};function E5(e,t){t&&A.default.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function Xae(e){e.emit("close")}hr.prototype._transform=function(e,t,r){var i,n=this._writableState,o=n.ending||n.ended,a=o&&(!e||n.length===e.length);if(e!==null&&!ra.isBuffer(e))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));a?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||De.Z_NO_FLUSH)),this._processChunk(e,i,r)};hr.prototype._processChunk=function(e,t,r){var i=e&&e.length,n=this._chunkSize-this._offset,o=0,a=this,s=typeof r=="function";if(!s){var u=[],c=0,l;this.on("error",function(M){l=M}),W1(this._handle,"zlib binding closed");do var m=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,n);while(!this._hadError&&P(m[0],m[1]));if(this._hadError)throw l;if(c>=D7)throw E5(this),new RangeError(YL);var w=ra.concat(u,c);return E5(this),w}W1(this._handle,"zlib binding closed");var E=this._handle.write(t,e,o,i,this._buffer,this._offset,n);E.buffer=e,E.callback=P;function P(M,D){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var L=n-D;if(W1(L>=0,"have should not go down"),L>0){var U=a._buffer.slice(a._offset,a._offset+L);a._offset+=L,s?a.push(U):(u.push(U),c+=U.length)}if((D===0||a._offset>=a._chunkSize)&&(n=a._chunkSize,a._offset=0,a._buffer=ra.allocUnsafe(a._chunkSize)),D===0){if(o+=i-M,i=M,!s)return!0;var K=a._handle.write(t,e,o,i,a._buffer,a._offset,a._chunkSize);K.callback=P,K.buffer=e;return}if(!s)return!1;r()}}};Zs.inherits(Cf,hr);Zs.inherits(Df,hr);Zs.inherits(Lf,hr);Zs.inherits(qf,hr);Zs.inherits(Uf,hr);Zs.inherits(Ff,hr);Zs.inherits(Hf,hr)});var eq=k(($ve,QL)=>{"use strict";v();var q7=u7(),Yve=_r(),$L=L7(),Jae=8*1024*1024;function XL(e,t){var r=t&&t.maxDecompressedBytes||Jae;return $L.gunzipSync(h.Buffer.from(e,"base64"),{maxOutputLength:r})}async function JL(e,t){if(!t.expectedIssuerDid)throw new Error("expectedIssuerDid is required to verify a status list (issuer pinning); refusing to read revocation state from an unpinned/unverified JWT");var r=t.didResolver;if(!r){var i=t.issuerJwks||(t.issuerPublicJwk?{keys:[t.issuerPublicJwk]}:null);if(!i)throw new Error("Provide params.didResolver, params.issuerJwks, or params.issuerPublicJwk to verify the status list signature");r=async function(){return{jwks:i}}}var n=await q7.verifyVcJwt(e,{didResolver:r,expectedIssuerDid:t.expectedIssuerDid,allowedAlgs:t.allowedAlgs,allowLegacyDER:t.allowLegacyDER,clockToleranceSec:t.clockToleranceSec});if(!n.valid)throw new Error("Status list signature verification failed: "+(n.error||"invalid signature"));return n.payload}async function Qae(e){if(!e.issuerDid||!e.privateJwk)throw new Error("issuerDid and privateJwk are required");var t=e.listId||e.issuerDid+"/status/"+Date.now(),r=e.listSize||1e5,i=Math.ceil(r/8),n=h.Buffer.alloc(i,0),o=L7(),a=o.gzipSync(n),s=a.toString("base64"),u={"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/vc/status-list/2021/v1"],type:["VerifiableCredential","StatusList2021Credential"],issuer:e.issuerDid,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,type:"StatusList2021",statusPurpose:"revocation",encodedList:s}},c=await q7.issueVcJwt({issuerDid:e.issuerDid,subjectId:t,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:u.credentialSubject,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"});return{listVcJwt:c.jwt,listId:t}}async function ese(e){if(!e.listVcJwt||e.index===void 0||!e.status||!e.privateJwk)throw new Error("listVcJwt, index, status, and privateJwk are required");var t=await JL(e.listVcJwt,e),r=t.vc.credentialSubject.encodedList,i=XL(r,e),n=Math.floor(e.index/8),o=e.index%8;if(n>=i.length)throw new Error("Index out of range");var a=e.status==="revoked"||e.status==="suspended"?1:0;a===1?i[n]|=1<<o:i[n]&=~(1<<o);var s=$L.gzipSync(i),u=s.toString("base64"),c={id:t.vc.credentialSubject.id,type:"StatusList2021",statusPurpose:"revocation",encodedList:u},l=await q7.issueVcJwt({issuerDid:t.iss,subjectId:t.vc.credentialSubject.id,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:c,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"});return{listVcJwt:l.jwt}}async function tse(e){if(!e.listVcJwt||e.index===void 0)throw new Error("listVcJwt and index are required");var t=await JL(e.listVcJwt,e),r=t.vc.credentialSubject.encodedList,i=XL(r,e),n=Math.floor(e.index/8),o=e.index%8;if(n>=i.length)throw new Error("Index out of range");var a=i[n]>>o&1;return a===1?"revoked":"valid"}QL.exports={createStatusList:Qae,updateStatusList:ese,getCredentialStatusEntry:tse}});var iq=k((Jve,rq)=>{"use strict";v();var rse=_r();function tq(e){var t;if(typeof e=="string")t=h.Buffer.from(e,"utf8");else if(h.Buffer.isBuffer(e))t=e;else if(e instanceof Uint8Array)t=h.Buffer.from(e);else throw new Error("Data must be string, Buffer, or Uint8Array");return rse.createHash("sha256").update(t).digest("hex")}function ise(e){if(!e.kind||!e.hash||!e.issuerDid)throw new Error("kind, hash, and issuerDid are required");var t=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];if(t.indexOf(e.kind)===-1)throw new Error("Invalid kind. Must be one of: "+t.join(", "));if(!/^[a-fA-F0-9]{64}$/.test(e.hash))throw new Error("Invalid hash format. Must be 64 hex characters");var r={protocol:"SmartLedger",version:"1.0",type:e.kind,hash:e.hash,issuer:e.issuerDid,timestamp:e.issuedAt||new Date().toISOString()};return{json:JSON.stringify(r)}}function nse(e,t){var r=tq(e);return r===t}function ose(e){try{var t=JSON.parse(e);if(t.protocol!=="SmartLedger")return{valid:!1,error:"Invalid protocol"};var r=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];return r.indexOf(t.type)===-1?{valid:!1,error:"Invalid anchor type"}:/^[a-fA-F0-9]{64}$/.test(t.hash)?{valid:!0,protocol:t.protocol,version:t.version,type:t.type,hash:t.hash,issuer:t.issuer,timestamp:t.timestamp}:{valid:!1,error:"Invalid hash format"}}catch(i){return{valid:!1,error:"Failed to parse anchor payload: "+i.message}}}rq.exports={sha256Hex:tq,buildAnchorPayload:ise,verifyAnchorHash:nse,parseAnchorPayload:ose}});var uq=k((tme,sq)=>{"use strict";v();var ia=Ae(),U7=ia.crypto.Hash,F7=ia.crypto.ECDSA,nq=ia.crypto.Signature,H7=ia.PrivateKey,kr=ia.util.preconditions,eme=xt();function oq(e,t){if(t=t||{},t.issuerPublicKey)return t.issuerPublicKey instanceof ia.PublicKey?t.issuerPublicKey:ia.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if(typeof r!="string")return null;try{var i=r.split("#")[0].split(":")[2];return i?ia.PublicKey.fromString(i):null}catch{return null}}var Vl={PROPERTY_TITLE:"PropertyTitle",VEHICLE_TITLE:"VehicleTitle",INTELLECTUAL_PROPERTY:"IntellectualProperty",MUSIC_LICENSE:"MusicLicense",SOFTWARE_LICENSE:"SoftwareLicense",FINANCIAL_INSTRUMENT:"FinancialInstrument",PROMISSORY_NOTE:"PromissoryNote",BOND:"Bond",EQUITY_SHARE:"EquityShare",PROFESSIONAL_LICENSE:"ProfessionalLicense",REGULATORY_PERMIT:"RegulatoryPermit",ACCESS_RIGHT:"AccessRight",VOTING_RIGHT:"VotingRight",ROYALTY_RIGHT:"RoyaltyRight",USAGE_RIGHT:"UsageRight"},aq={create:function(e,t,r,i,n,o){o=o||{},kr.checkArgument(typeof e=="string","Right type must be string"),kr.checkArgument(typeof t=="string","Issuer DID must be string"),kr.checkArgument(typeof r=="string","Subject DID must be string"),kr.checkArgument(i&&typeof i=="object","Claim must be object");var a=Object.values(Vl);kr.checkArgument(a.includes(e),"Invalid right type: "+e);var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightToken",e],issuer:t,issuanceDate:new Date().toISOString(),credentialSubject:{id:r,rightType:e,claim:i,jurisdiction:o.jurisdiction||"US",purpose:o.purpose||"legal_right",validFrom:o.validFrom||new Date().toISOString(),validUntil:o.validUntil||null,transferable:o.transferable!==!1,revocable:o.revocable!==!1}};return o.metadata&&(s.credentialSubject.metadata=o.metadata),s},prepareRightToken:function(e,t,r,i,n,o){o=o||{},kr.checkArgument(typeof e=="string","Right type must be string"),kr.checkArgument(typeof t=="string","Issuer DID must be string"),kr.checkArgument(typeof r=="string","Subject DID must be string"),kr.checkArgument(i&&typeof i=="object","Claim must be object"),kr.checkArgument(n instanceof H7,"Invalid issuer private key");var a=Object.values(Vl);kr.checkArgument(a.includes(e),"Invalid right type: "+e);try{var s=this.create(e,t,r,i,n,o),u=this._signToken(s,n);return{success:!0,rightToken:u,tokenHash:u.tokenHash,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction},externalOperations:{storeToken:{endpoint:"POST /rights/tokens",data:{token:u,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction}}},indexToken:{endpoint:"POST /rights/index",data:{tokenId:u.id,tokenHash:u.tokenHash,type:e,issuer:t,subject:r,issuedAt:u.issuanceDate}},notifyParties:{endpoint:"POST /notifications/right-issued",data:{tokenId:u.id,issuer:t,subject:r,rightType:e}}}}}catch(c){return{success:!1,error:c.message}}},prepareRightTokenVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateRightType(e,r),t.requireJurisdiction&&this._validateJurisdiction(e,t.allowedJurisdictions,r);var n={valid:r.length===0,errors:r,warnings:i,issuerDID:e.issuer,subjectDID:e.credentialSubject?e.credentialSubject.id:null,rightType:e.credentialSubject?e.credentialSubject.rightType:null,transferable:e.credentialSubject?e.credentialSubject.transferable:null,revocable:e.credentialSubject?e.credentialSubject.revocable:null,verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /rights/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/right-verification",data:{tokenId:e.id,rightType:n.rightType,issuer:n.issuerDID,subject:n.subjectDID,result:n.valid,verifiedAt:n.verifiedAt}},updateTokenStatus:n.valid?{endpoint:"PUT /rights/tokens/"+e.id+"/status",data:{status:"VERIFIED",verifiedAt:n.verifiedAt}}:null}}}catch(o){return{success:!1,error:"Verification preparation failed: "+o.message}}},prepareRightTokenTransfer:function(e,t,r,i){i=i||{},kr.checkArgument(e&&typeof e=="object","Invalid token"),kr.checkArgument(typeof t=="string","New owner DID must be string"),kr.checkArgument(r instanceof H7,"Invalid current owner key");try{var n=this.prepareRightTokenVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot transfer invalid token: "+n.verification.errors.join(", ")};if(!e.credentialSubject.transferable)return{success:!1,error:"Token is not transferable"};var o=e.credentialSubject&&e.credentialSubject.id,a=oq({issuer:o},{issuerPublicKey:i.currentOwnerPublicKey});if(!a)return{success:!1,error:"Cannot resolve current owner public key from token.credentialSubject.id; pass options.currentOwnerPublicKey"};if(r.toPublicKey().toString()!==a.toString())return{success:!1,error:"Unauthorized transfer: signing key does not match the current owner"};var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightTransfer"],issuer:e.credentialSubject.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,originalToken:e.id,transferFrom:e.credentialSubject.id,transferTo:t,transferDate:new Date().toISOString(),transferReason:i.reason||"ownership_transfer",consideration:i.consideration||null}},u=this._signToken(s,r),c=JSON.parse(JSON.stringify(e));c.id="urn:uuid:"+this._generateUUID(),c.issuanceDate=new Date().toISOString(),c.credentialSubject.id=t,c.credentialSubject.transferHistory=c.credentialSubject.transferHistory||[],c.credentialSubject.transferHistory.push({transferId:u.id,transferDate:u.issuanceDate,from:e.credentialSubject.id,to:t}),delete c.proof;var l=this._signToken(c,r);return{success:!0,newToken:l,transferProof:u,transferId:u.id,externalOperations:{recordTransfer:{endpoint:"POST /rights/transfers",data:{originalTokenId:e.id,newTokenId:l.id,transferProof:u,fromOwner:e.credentialSubject.id,toOwner:t,transferDate:u.issuanceDate}},updateOwnership:{endpoint:"PUT /rights/tokens/"+e.id+"/ownership",data:{newOwner:t,transferId:u.id,transferDate:u.issuanceDate,previousOwner:e.credentialSubject.id}},notifyParties:{endpoint:"POST /notifications/right-transferred",data:{originalTokenId:e.id,newTokenId:l.id,fromOwner:e.credentialSubject.id,toOwner:t,rightType:e.credentialSubject.rightType}},auditTransfer:{endpoint:"POST /audit/right-transfer",data:{originalTokenId:e.id,newTokenId:l.id,transferId:u.id,fromOwner:e.credentialSubject.id,toOwner:t,transferredAt:u.issuanceDate}}}}}catch(m){return{success:!1,error:m.message}}},prepareObligationToken:function(e,t,r,i){kr.checkArgument(e&&typeof e=="object","Invalid right token"),kr.checkArgument(typeof t=="string","Obligor DID must be string"),kr.checkArgument(r&&typeof r=="object","Obligation must be object"),kr.checkArgument(i instanceof H7,"Invalid issuer key");try{var n={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken"],issuer:e.issuer,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,obligationType:"correlative_obligation",correlativeRight:e.id,rightHolder:e.credentialSubject.id,obligation:r,jurisdiction:e.credentialSubject.jurisdiction,purpose:e.credentialSubject.purpose}},o=this._signToken(n,i);return{success:!0,obligationToken:o,correlativeRight:e.id,externalOperations:{storeObligation:{endpoint:"POST /obligations/tokens",data:{obligationToken:o,correlativeRightId:e.id,obligor:t,rightHolder:e.credentialSubject.id}},linkToRight:{endpoint:"POST /rights/tokens/"+e.id+"/obligations",data:{obligationId:o.id,obligor:t,obligationType:"correlative_obligation"}},notifyObligor:{endpoint:"POST /notifications/obligation-created",data:{obligationId:o.id,obligor:t,rightHolder:e.credentialSubject.id,correlativeRight:e.id}}}}}catch(a){return{success:!1,error:a.message}}},prepareRightTypeValidation:function(e){kr.checkArgument(typeof e=="string","Right type must be string");var t=Object.values(Vl),r=t.includes(e);return{success:!0,validation:{type:e,valid:r,availableTypes:t,category:this._categorizeRightType(e),description:this._getRightTypeDescription(e)},externalOperations:{validateType:{endpoint:"POST /rights/validate-type",data:{type:e,valid:r}}}}},_categorizeRightType:function(e){var t={PropertyTitle:"PROPERTY_RIGHT",VehicleTitle:"PROPERTY_RIGHT",IntellectualProperty:"IP_RIGHT",MusicLicense:"IP_RIGHT",SoftwareLicense:"IP_RIGHT",FinancialInstrument:"FINANCIAL_RIGHT",PromissoryNote:"FINANCIAL_RIGHT",Bond:"FINANCIAL_RIGHT",EquityShare:"FINANCIAL_RIGHT",ProfessionalLicense:"LICENSE_RIGHT",RegulatoryPermit:"LICENSE_RIGHT",AccessRight:"ACCESS_RIGHT",VotingRight:"GOVERNANCE_RIGHT",RoyaltyRight:"IP_RIGHT",UsageRight:"ACCESS_RIGHT"};return t[e]||"UNKNOWN"},_getRightTypeDescription:function(e){var t={PropertyTitle:"Legal ownership of real estate property",VehicleTitle:"Legal ownership of motor vehicle",IntellectualProperty:"Rights to intellectual property assets",MusicLicense:"License for music performance and usage",SoftwareLicense:"License for software usage and distribution",FinancialInstrument:"Rights related to financial instruments",PromissoryNote:"Promise to pay a specified amount",Bond:"Debt security representing loan",EquityShare:"Ownership stake in company",ProfessionalLicense:"License for professional practice",RegulatoryPermit:"Permit for regulated activities",AccessRight:"Right to access resources or locations",VotingRight:"Right to participate in governance",RoyaltyRight:"Right to receive royalty payments",UsageRight:"Right to use specific assets or services"};return t[e]||"Unknown right type"},getRightTypes:function(){return Vl},verifyToken:function(e,t){var r=[];try{if(kr.checkArgument(e&&typeof e=="object","Invalid token"),!e.proof||!e.proof.jws)return r.push("Missing signature proof"),{valid:!1,errors:r};var i=t instanceof ia.PublicKey?t:ia.PublicKey.fromString(t),n=this._canonicalizeToken(e),o=U7.sha256(h.Buffer.from(n));if(e.tokenHash&&e.tokenHash!==o.toString("hex"))return r.push("Token hash mismatch"),{valid:!1,errors:r};var a=e.proof.jws.split(".");if(a.length!==3||!a[2])return r.push("Malformed JWS"),{valid:!1,errors:r};var s=nq.fromDER(h.Buffer.from(a[2],"base64url")),u=new F7;return u.hashbuf=o,u.sig=s,u.pubkey=i,u.verify().verified||r.push("Signature verification failed"),{valid:r.length===0,errors:r,tokenHash:o.toString("hex"),verifiedAt:new Date().toISOString()}}catch(c){return r.push(c.message),{valid:!1,errors:r}}},_signToken:function(e,t){var r=this._canonicalizeToken(e),i=U7.sha256(h.Buffer.from(r)),n=new F7;n.hashbuf=i,n.privkey=t,n.pubkey=t.toPublicKey(),n.sign();var o=n.sig,a={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(i,o)},s=JSON.parse(JSON.stringify(e));return s.proof=a,s.tokenHash=i.toString("hex"),s},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=t.toDER().toString("base64url");return i+".."+n},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),(!e.type||!Array.isArray(e.type))&&t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws){t.push("Missing signature proof");return}var i=this._canonicalizeToken(e),n=U7.sha256(h.Buffer.from(i));if(e.tokenHash&&e.tokenHash!==n.toString("hex")){t.push("Token hash mismatch");return}var o=oq(e,r);if(!o){t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");return}var a=e.proof.jws.split(".");if(a.length!==3||!a[2]){t.push("Malformed JWS");return}var s=nq.fromDER(h.Buffer.from(a[2],"base64url")),u=new F7;u.hashbuf=n,u.sig=s,u.pubkey=o,u.verify().verified!==!0&&t.push("Signature verification failed")}catch(c){t.push("Signature verification failed: "+c.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date,n=new Date(e.issuanceDate);if(n>i&&t.push("Token issued in the future"),e.credentialSubject.validFrom){var o=new Date(e.credentialSubject.validFrom);i<o&&r.push("Token not yet valid")}if(e.credentialSubject.validUntil){var a=new Date(e.credentialSubject.validUntil);i>a&&t.push("Token expired")}},_validateRightType:function(e,t){if(!e.credentialSubject.rightType){t.push("Missing rightType");return}var r=Object.values(Vl);r.includes(e.credentialSubject.rightType)||t.push("Invalid right type: "+e.credentialSubject.rightType)},_validateJurisdiction:function(e,t,r){if(!e.credentialSubject.jurisdiction){r.push("Missing jurisdiction");return}t&&Array.isArray(t)&&(t.includes(e.credentialSubject.jurisdiction)||r.push("Jurisdiction not allowed: "+e.credentialSubject.jurisdiction))},_generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}};aq.RightTypes=Vl;sq.exports=aq});var lq=k((ime,cq)=>{"use strict";v();var fq=Ae(),Gl=fq.crypto.Hash,Yi=fq.util.preconditions,Kf={PropertyTitle:{title:"Property Title",description:"Real estate property ownership title",type:"object",required:["propertyId","address","ownershipType"],properties:{propertyId:{type:"string",description:"Unique property identifier"},address:{type:"object",required:["street","city","state","country"],properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"string"},postalCode:{type:"string"}}},ownershipType:{type:"string",enum:["fee_simple","leasehold","joint_tenancy","tenancy_in_common"]},titleNumber:{type:"string"},registeredDate:{type:"string",format:"date-time"},legalDescription:{type:"string"},encumbrances:{type:"array",items:{type:"object",properties:{type:{type:"string"},amount:{type:"number"},description:{type:"string"}}}}}},VehicleTitle:{title:"Vehicle Title",description:"Motor vehicle ownership title",type:"object",required:["vin","make","model","year"],properties:{vin:{type:"string",pattern:"^[A-HJ-NPR-Z0-9]{17}$",description:"Vehicle Identification Number"},make:{type:"string"},model:{type:"string"},year:{type:"integer",minimum:1900,maximum:2030},titleNumber:{type:"string"},registeredState:{type:"string"},mileage:{type:"integer",minimum:0},color:{type:"string"},fuelType:{type:"string",enum:["gasoline","diesel","electric","hybrid","other"]},liens:{type:"array",items:{type:"object",properties:{lienholderName:{type:"string"},lienAmount:{type:"number"},lienDate:{type:"string",format:"date"}}}}}},PromissoryNote:{title:"Promissory Note",description:"Legal promise to pay a specified amount",type:"object",required:["principal","interestRate","maturityDate","borrower","lender"],properties:{principalAmount:{type:"number",minimum:0,description:"Principal amount in base currency units"},currency:{type:"string",default:"USD"},interestRate:{type:"number",minimum:0,maximum:100,description:"Annual interest rate percentage"},maturityDate:{type:"string",format:"date",description:"Date when principal and interest are due"},payee:{type:"string",description:"DID of the payee (creditor)"},payor:{type:"string",description:"DID of the payor (debtor)"},paymentSchedule:{type:"string",enum:["lump_sum","monthly","quarterly","annually"]},collateral:{type:"array",items:{type:"object",properties:{description:{type:"string"},value:{type:"number"},type:{type:"string"}}}},defaultProvisions:{type:"string"},governingLaw:{type:"string"}}},IntellectualProperty:{title:"Intellectual Property",description:"Intellectual property rights and licensing",type:"object",required:["ipType","title","registrationNumber"],properties:{ipType:{type:"string",enum:["patent","trademark","copyright","trade_secret"]},title:{type:"string"},creator:{type:"string",description:"Creator DID"},registrationNumber:{type:"string"},registrationDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},jurisdiction:{type:"string"},description:{type:"string"},claims:{type:"array",items:{type:"string"}},priorArt:{type:"array",items:{type:"object",properties:{reference:{type:"string"},date:{type:"string",format:"date"},relevance:{type:"string"}}}}}},ProfessionalLicense:{title:"Professional License",description:"Professional practice license or certification",type:"object",required:["licenseType","licenseNumber","issuingAuthority","expirationDate"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},licensee:{type:"string",description:"Licensee DID"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},renewalDate:{type:"string",format:"date"},jurisdiction:{type:"string"},scope:{type:"string"},restrictions:{type:"array",items:{type:"string"}},continuing_education:{type:"object",properties:{hours_required:{type:"integer"},deadline:{type:"string",format:"date"},completed_hours:{type:"integer"}}}}},MusicLicense:{title:"Music License",description:"Music performance and usage licensing",type:"object",required:["songTitle","artist","licenseType","royaltyRate"],properties:{workTitle:{type:"string"},composer:{type:"string",description:"Composer DID"},performer:{type:"string",description:"Performer DID"},licenseType:{type:"string",enum:["mechanical","performance","synchronization","master_use"]},territory:{type:"string"},duration:{type:"string"},royaltyRate:{type:"number",minimum:0,maximum:100},advancePayment:{type:"number",minimum:0},exclusivity:{type:"boolean"},mediaTypes:{type:"array",items:{type:"string",enum:["cd","vinyl","digital","streaming","broadcast","film","tv"]}},usage_restrictions:{type:"string"},copyrightNotice:{type:"string"}}}},ase={prepareClaimValidation:function(e,t){try{Yi.checkArgument(e&&typeof e=="object","Invalid claim"),Yi.checkArgument(typeof t=="string","Schema name must be string");var r=Kf[t];if(!r)return{success:!1,error:"Unknown schema: "+t};var i=[],n=[];this._validateObject(e,r,"",i,n);var o={valid:i.length===0,errors:i,warnings:n,schema:t,claimHash:this.hash(e),canonical:this.canonicalize(e)};return{success:!0,validation:o,claim:e,schema:r,externalOperations:{store:{endpoint:"POST /claims/validate",data:{claim:e,validation:o,schema:t}},index:{endpoint:"POST /claims/index",data:{claimHash:o.claimHash,schemaName:t,valid:o.valid}}}}}catch(a){return{success:!1,error:"Validation preparation failed: "+a.message}}},prepareClaimAttestation:function(e,t,r){try{Yi.checkArgument(e&&typeof e=="object","Invalid claim"),Yi.checkArgument(typeof t=="string","Schema name must be string"),Yi.checkArgument(r&&typeof r=="object","Invalid attestor");var i=this.prepareClaimValidation(e,t);if(!i.success||!i.validation.valid)return{success:!1,error:"Cannot attest invalid claim",validation:i};var n={type:"LTP_CLAIM_ATTESTATION",claimHash:i.validation.claimHash,schemaName:t,attestor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},attestedAt:new Date().toISOString(),confidence:r.confidence||100,evidence:r.evidence||null,notes:r.notes||null},o=Gl.sha256(h.Buffer.from(this.canonicalize(n))).toString("hex");return n.attestationHash=o,{success:!0,attestation:n,claim:e,validation:i.validation,externalOperations:{storeAttestation:{endpoint:"POST /claims/"+i.validation.claimHash+"/attestations",data:n},notifyStakeholders:{endpoint:"POST /notifications/claim-attested",data:{claimHash:i.validation.claimHash,attestorDid:n.attestor.did,attestationHash:o}}}}}catch(a){return{success:!1,error:"Attestation preparation failed: "+a.message}}},prepareClaimDispute:function(e,t,r){try{Yi.checkArgument(typeof e=="string","Claim hash must be string"),Yi.checkArgument(t&&typeof t=="object","Invalid disputant"),Yi.checkArgument(r&&typeof r=="object","Invalid dispute");var i={type:"LTP_CLAIM_DISPUTE",claimHash:e,disputant:{did:t.did||t.id,name:t.name||"Unknown",jurisdiction:t.jurisdiction||null},dispute:{reason:r.reason||"UNSPECIFIED",category:r.category||"ACCURACY",description:r.description||"",evidence:r.evidence||null,requestedAction:r.requestedAction||"REVIEW"},disputedAt:new Date().toISOString(),status:"FILED",priority:r.priority||"NORMAL"},n=Gl.sha256(h.Buffer.from(this.canonicalize(i))).toString("hex");return i.disputeHash=n,{success:!0,dispute:i,disputeId:this._generateDisputeId(e),externalOperations:{fileDispute:{endpoint:"POST /claims/"+e+"/disputes",data:i},notifyStakeholders:{endpoint:"POST /notifications/claim-disputed",data:{claimHash:e,disputantDid:i.disputant.did,disputeHash:n}},escalate:{endpoint:"POST /disputes/escalate",data:{disputeHash:n,priority:i.priority}}}}}catch(o){return{success:!1,error:"Dispute preparation failed: "+o.message}}},prepareBulkClaimValidation:function(e,t){try{Yi.checkArgument(Array.isArray(e),"Claims must be array"),Yi.checkArgument(typeof t=="string","Schema name must be string");var r=[],i=[],n=0;e.forEach(function(s,u){try{var c=this.prepareClaimValidation(s,t);c.success&&c.validation.valid&&n++,r.push({index:u,result:c})}catch(l){i.push({index:u,error:l.message})}}.bind(this));var o=this._generateBatchId(),a=Gl.sha256(h.Buffer.from(JSON.stringify(r.map(s=>s.result.validation.claimHash)))).toString("hex");return{success:!0,batchId:o,batchHash:a,totalClaims:e.length,validClaims:n,invalidClaims:e.length-n,validations:r,errors:i,externalOperations:{storeBatch:{endpoint:"POST /claims/batch-validate",data:{batchId:o,batchHash:a,schemaName:t,validations:r}},generateReport:{endpoint:"POST /reports/bulk-validation",data:{batchId:o,summary:{total:e.length,valid:n,invalid:e.length-n}}}}}}catch(s){return{success:!1,error:"Bulk validation preparation failed: "+s.message}}},canonicalize:function(e){Yi.checkArgument(e&&typeof e=="object","Invalid claim");var t=this._sortObjectKeys(e);return JSON.stringify(t)},hash:function(e){var t=this.canonicalize(e);return Gl.sha256(h.Buffer.from(t)).toString("hex")},prepareClaimTemplate:function(e,t){t=t||{};try{var r=Kf[e];if(!r)return{success:!1,error:"Unknown schema: "+e};var i=this._createTemplateFromSchema(r),n=this._generateFormStructure(r);return{success:!0,schemaName:e,template:i,schema:r,formStructure:n,validation:{required:r.required||[],patterns:this._extractPatterns(r),enums:this._extractEnums(r)},externalOperations:{generateForm:{endpoint:"POST /forms/generate",data:{schemaName:e,formStructure:n,template:i}},saveTemplate:{endpoint:"POST /templates/claim",data:{schemaName:e,template:i,customizations:t.customizations||{}}}}}}catch(o){return{success:!1,error:"Template preparation failed: "+o.message}}},getSchemas:function(){return Kf},getSchemaNames:function(){return Object.keys(Kf)},getSchema:function(e){return Kf[e]||null},addSchema:function(e,t){Yi.checkArgument(typeof e=="string","Schema name must be string"),Yi.checkArgument(t&&typeof t=="object","Invalid schema"),Kf[e]=t},createTemplate:function(e){var t=Kf[e];if(!t)throw new Error("Unknown schema: "+e);return this._createTemplateFromSchema(t)},_generateDisputeId:function(e){var t="dispute_"+e+"_"+Date.now();return Gl.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_generateBatchId:function(){var e="batch_"+Date.now()+"_"+Math.random();return Gl.sha256(h.Buffer.from(e)).toString("hex").substring(0,16)},_generateFormStructure:function(e){var t={type:"form",title:e.title||"Legal Claim Form",description:e.description||"",fields:[]};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r],n={name:r,label:this._humanizeFieldName(r),type:this._mapSchemaTypeToFormType(i),required:e.required&&e.required.includes(r),validation:this._extractFieldValidation(i)};i.enum&&(n.options=i.enum.map(function(o){return{value:o,label:this._humanizeValue(o)}}.bind(this))),t.fields.push(n)}.bind(this)),t},_extractPatterns:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.pattern&&(t[r]=i.pattern)}),t},_extractEnums:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.enum&&(t[r]=i.enum)}),t},_mapSchemaTypeToFormType:function(e){switch(e.type){case"string":return e.enum?"select":e.format==="date"?"date":e.format==="date-time"?"datetime":"text";case"number":case"integer":return"number";case"boolean":return"checkbox";case"array":return"list";case"object":return"fieldset";default:return"text"}},_extractFieldValidation:function(e){var t={};return e.pattern&&(t.pattern=e.pattern),e.minimum!==void 0&&(t.min=e.minimum),e.maximum!==void 0&&(t.max=e.maximum),e.format&&(t.format=e.format),t},_humanizeFieldName:function(e){return e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).replace(/_/g," ")},_humanizeValue:function(e){return e.replace(/_/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})},_validateObject:function(e,t,r,i,n){t.type==="object"?(t.required&&Array.isArray(t.required)&&t.required.forEach(function(o){e.hasOwnProperty(o)||i.push("Missing required field: "+this._getFieldPath(r,o))}.bind(this)),t.properties&&Object.keys(e).forEach(function(o){var a=this._getFieldPath(r,o),s=t.properties[o];s?this._validateValue(e[o],s,a,i,n):n.push("Unknown field: "+a)}.bind(this))):this._validateValue(e,t,r,i,n)},_validateValue:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type){i.push("Invalid type for "+r+": expected "+t.type+", got "+o);return}}if(t.type==="string"&&(t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e),t.format==="date"&&!this._isValidDate(e)&&i.push("Invalid date format for "+r),t.format==="date-time"&&!this._isValidDateTime(e)&&i.push("Invalid date-time format for "+r)),(t.type==="number"||t.type==="integer")&&(t.minimum!==void 0&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),t.maximum!==void 0&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum),t.type==="integer"&&!Number.isInteger(e)&&i.push("Value must be integer for "+r)),t.type==="array"&&t.items)for(var a=0;a<e.length;a++)this._validateValue(e[a],t.items,r+"["+a+"]",i,n);t.type==="object"&&this._validateObject(e,t,r,i,n)},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_createTemplateFromSchema:function(e){if(e.type==="object"){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t}return this._getDefaultValue(e)},_getDefaultValue:function(e){if(e.default!==void 0)return e.default;switch(e.type){case"string":return e.enum?e.enum[0]:e.format==="date"?"2023-01-01":e.format==="date-time"?new Date().toISOString():"PLACEHOLDER_STRING";case"number":case"integer":return e.minimum||0;case"boolean":return!1;case"array":return[];case"object":return this._createTemplateFromSchema(e);default:return null}},_getFieldPath:function(e,t){return e?e+"."+t:t},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())}};cq.exports=ase});var pq=k((ome,dq)=>{"use strict";v();var hq=Ae(),Y1=hq.crypto.Hash,Zl=hq.util.preconditions,sse={prepareTokenCommitment:function(e,t){t=t||{},Zl.checkArgument(e&&typeof e=="object","Invalid token");try{var r=this._createCommitment(e,t),i=this._formatOpReturn(r,t),n=this._createTxTemplate(i,t);return{success:!0,commitment:r,opReturnData:i,txTemplate:n,preparedAt:new Date().toISOString(),metadata:{tokenId:e.id,purpose:t.purpose||"legal_token_anchor",version:"LTP.v1"}}}catch(o){return{success:!1,error:o.message}}},prepareBatchCommitment:function(e,t){t=t||{},Zl.checkArgument(Array.isArray(e),"Tokens must be array");try{var r=this._createBatchCommitment(e,t),i=this._formatOpReturn(r,t),n=this._createTxTemplate(i,t);return{success:!0,batchCommitment:r,opReturnData:i,txTemplate:n,tokenCount:e.length,preparedAt:new Date().toISOString(),metadata:{purpose:t.purpose||"legal_token_batch_anchor",version:"LTP.v1"}}}catch(o){return{success:!1,error:o.message}}},verifyTokenAnchor:function(e,t,r){Zl.checkArgument(e&&typeof e=="object","Invalid token"),Zl.checkArgument(typeof t=="string","Transaction ID must be string");try{var i=this._createCommitment(e,{}),n=this._extractOpReturn(r);if(!n)return{valid:!1,error:"No OP_RETURN data found in transaction"};var o=this._verifyCommitment(i,n);return{valid:o,chainVerified:!1,txid:t,commitment:i,anchorData:n,verifiedAt:new Date().toISOString()}}catch(a){return{valid:!1,error:a.message}}},formatRevocation:function(e,t){Zl.checkArgument(typeof e=="string","Token ID must be string"),Zl.checkArgument(t&&typeof t=="object","Invalid revocation data");try{var r={type:"LTP_REVOCATION",tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:new Date().toISOString(),effectiveDate:t.effectiveDate||new Date().toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null},i=Y1.sha256(h.Buffer.from(JSON.stringify(r))).toString("hex");return{success:!0,revocation:r,revocationHash:i,opReturnData:this._formatOpReturn({hash:i,type:"REVOCATION"},{})}}catch(n){return{success:!1,error:n.message}}},_createCommitment:function(e,t){var r=this._canonicalizeToken(e),i={type:"LTP_TOKEN",tokenHash:Y1.sha256(h.Buffer.from(r)).toString("hex"),tokenId:e.id,timestamp:new Date().toISOString(),purpose:t.purpose||"legal_token"},n=Y1.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex");return{hash:n,data:i,canonical:r}},_createBatchCommitment:function(e,t){var r=[],i=[];e.forEach(function(s){var u=this._createCommitment(s,t);r.push(u.hash),i.push(s.id)}.bind(this));var n=this._createMerkleRoot(r),o={type:"LTP_BATCH",merkleRoot:n,tokenCount:e.length,tokenIds:i,timestamp:new Date().toISOString(),purpose:t.purpose||"batch_anchor"},a=Y1.sha256(h.Buffer.from(JSON.stringify(o))).toString("hex");return{hash:a,data:o,merkleRoot:n,tokenHashes:r}},_formatOpReturn:function(e,t){var r=t.prefix||"LTP.v1",i=e.hash;return{prefix:r,data:i,full:r+"."+i,bytes:h.Buffer.from(r+"."+i,"utf8"),size:h.Buffer.from(r+"."+i,"utf8").length}},_createTxTemplate:function(e,t){try{var r={version:1,inputs:[],outputs:[{satoshis:0,script:"OP_RETURN "+e.data}],locktime:0};return t.feeOutput&&r.outputs.push(t.feeOutput),{template:r,opReturn:e,estimatedSize:this._estimateSize(r),instructions:{step1:"Add input UTXOs to cover fees",step2:"Add change output if needed",step3:"Sign transaction with appropriate keys",step4:"Broadcast to BSV network"}}}catch(i){throw new Error("Failed to create transaction template: "+i.message)}},_extractOpReturn:function(e){try{if(!e||!e.outputs)return null;for(var t=0;t<e.outputs.length;t++){var r=e.outputs[t];if(r.script&&r.script.startsWith("OP_RETURN")){var i=r.script.replace("OP_RETURN ","");return{raw:i,decoded:h.Buffer.from(i,"hex").toString("utf8")}}}return null}catch{return null}},_verifyCommitment:function(e,t){try{return!t||!t.decoded?!1:t.decoded.includes(e.hash)}catch{return!1}},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,delete t.anchorTx,delete t.anchorBlock,JSON.stringify(this._sortObjectKeys(t))},_createMerkleRoot:function(e){if(e.length===0)return null;if(e.length===1)return e[0];for(var t=e.slice();t.length>1;){for(var r=[],i=0;i<t.length;i+=2){var n=t[i],o=t[i+1]||n,a=h.Buffer.concat([h.Buffer.from(n,"hex"),h.Buffer.from(o,"hex")]),s=Y1.sha256(a).toString("hex");r.push(s)}t=r}return t[0]},_estimateSize:function(e){var t=10,r=e.outputs.length*34,i=148;return{base:t+r,withOneInput:t+r+i,bytesPerInput:i}},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};dq.exports=sse});var mq=k((sme,vq)=>{"use strict";v();var Wl=Ae(),co=Wl.crypto.Hash,gq=Wl.crypto.ECDSA,use=Wl.crypto.Signature,fse=Wl.PrivateKey,Oi=Wl.util.preconditions,cse={prepareSignatureProof:function(e,t,r){r=r||{},Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(t instanceof fse,"Invalid private key");try{var i=this._canonicalizeForSigning(e),n=co.sha256(h.Buffer.from(i)),o=new gq;o.hashbuf=n,o.privkey=t,o.pubkey=t.toPublicKey(),o.sign();var a=o.sig,s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:r.purpose||"assertionMethod",jws:this._createJWS(n,a),proofValue:a.toDER().toString("hex")};return{success:!0,proof:s,tokenHash:n.toString("hex"),canonical:i,signingKey:{publicKey:t.toPublicKey().toString(),keyId:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1"},externalOperations:{storeProof:{endpoint:"POST /proofs/signature",data:{tokenHash:n.toString("hex"),proof:s,signingKey:t.toPublicKey().toString()}},verifyProof:{endpoint:"POST /proofs/verify-signature",data:{tokenHash:n.toString("hex"),signature:a.toDER().toString("hex"),publicKey:t.toPublicKey().toString()}}}}}catch(u){return{success:!1,error:u.message}}},prepareSignatureVerification:function(e,t){try{if(Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(typeof t=="string","Public key must be string"),!e.proof)return{success:!1,error:"No proof found in token"};var r=this._canonicalizeForSigning(e),i=co.sha256(h.Buffer.from(r)),n=use.fromDER(h.Buffer.from(e.proof.proofValue,"hex")),o={tokenHash:i.toString("hex"),signature:n.toDER().toString("hex"),publicKey:t,proof:e.proof,canonical:r},a=new gq;a.hashbuf=i,a.sig=n,a.pubkey=Wl.PublicKey.fromString(t);var s=a.verify().verified===!0;return{success:!0,verification:{valid:s,tokenHash:i.toString("hex"),signatureValid:s,publicKey:t,verifiedAt:new Date().toISOString()},verificationData:o,externalOperations:{recordVerification:{endpoint:"POST /proofs/verification-record",data:{tokenHash:i.toString("hex"),result:s,publicKey:t,verifiedAt:new Date().toISOString()}},auditVerification:{endpoint:"POST /audit/proof-verification",data:{tokenId:e.id,proofType:e.proof.type,result:s,verifier:t}}}}}catch(u){return{success:!1,error:u.message}}},prepareSelectiveDisclosure:function(e,t,r){Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(Array.isArray(t),"Revealed fields must be array"),Oi.checkArgument(typeof r=="string","Nonce must be string");try{var i=this._createFieldCommitments(e,r),n=this._createMerkleTree(i),o=[],a=[];t.forEach(function(u){var c=this._getNestedValue(e,u),l=this._findFieldCommitment(i,u);if(l){o.push({path:u,value:c,commitment:l.hash,salt:l.salt});var m=this._generateMerkleProof(n,l.index);a.push({path:u,leafIndex:l.index,proof:m})}}.bind(this));var s={type:"LegalTokenSelectiveDisclosure",created:new Date().toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,nonce:r,merkleRoot:n.root,disclosures:o,merkleProofs:a,totalFields:i.length};return{success:!0,proof:s,hiddenFieldCount:i.length-o.length,revealedFieldCount:o.length,externalOperations:{storeDisclosure:{endpoint:"POST /proofs/selective-disclosure",data:{tokenId:e.id,proof:s,merkleRoot:n.root}},verifyDisclosure:{endpoint:"POST /proofs/verify-disclosure",data:{proof:s,expectedNonce:r}},auditDisclosure:{endpoint:"POST /audit/selective-disclosure",data:{tokenId:e.id,revealedFields:t,totalFields:i.length,disclosedAt:new Date().toISOString()}}}}}catch(u){return{success:!1,error:u.message}}},prepareSelectiveDisclosureVerification:function(e,t){try{if(Oi.checkArgument(e&&typeof e=="object","Invalid proof"),Oi.checkArgument(typeof t=="string","Expected nonce must be string"),e.nonce!==t)return{success:!1,error:"Nonce mismatch"};var r=[],i=[];e.disclosures.forEach(function(o,a){var s=e.merkleProofs[a],u=this._hashField(o.path,o.value,o.salt);if(u!==o.commitment){i.push("Invalid commitment for field: "+o.path);return}var c=this._verifyMerkleProof(o.commitment,s.leafIndex,s.proof,e.merkleRoot);c?r.push({path:o.path,value:o.value,verified:!0}):i.push("Invalid Merkle proof for field: "+o.path)}.bind(this));var n={valid:i.length===0,errors:i,disclosures:r,merkleRoot:e.merkleRoot,totalFields:e.totalFields,verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /proofs/disclosure-verification",data:{proofId:e.id||"unknown",result:n.valid,verifiedFields:r.length,totalFields:e.totalFields,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/disclosure-verification",data:{merkleRoot:e.merkleRoot,disclosuresVerified:r.length,errors:i.length,result:n.valid}}}}}catch(o){return{success:!1,error:o.message}}},prepareLegalValidityProof:function(e,t,r){Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(t&&typeof t=="object","Invalid jurisdiction"),Oi.checkArgument(typeof r=="string","Nonce must be string");try{var i=t.requirements||[],n=[],o=!0;i.forEach(function(s){var u=this._checkLegalRequirement(e,s);n.push(u),u.satisfied||(o=!1)}.bind(this));var a={type:"LegalValidityProof",created:new Date().toISOString(),proofPurpose:"legalValidity",jurisdiction:t.code,nonce:r,valid:o,checks:n,complianceHash:this._hashCompliance(e,t,r)};return{success:!0,proof:a,valid:o,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(s=>s.satisfied).length,failedRequirements:n.filter(s=>!s.satisfied).length,overallCompliance:o},externalOperations:{submitCompliance:{endpoint:"POST /compliance/legal-validity",data:{tokenId:e.id,jurisdiction:t.code,proof:a,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(s=>s.satisfied).length,failedRequirements:n.filter(s=>!s.satisfied).length,overallCompliance:o}}},auditCompliance:{endpoint:"POST /audit/compliance-check",data:{tokenId:e.id,jurisdiction:t.code,result:o,checkedAt:new Date().toISOString(),requirements:n}},notifyRegulator:o?null:{endpoint:"POST /notifications/compliance-failure",data:{tokenId:e.id,jurisdiction:t.code,failedRequirements:n.filter(s=>!s.satisfied)}}}}}catch(s){return{success:!1,error:s.message}}},prepareZeroKnowledgeProof:function(e,t,r){Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(t&&typeof t=="object","Invalid statement"),Oi.checkArgument(typeof r=="string","Nonce must be string");try{var i=co.sha256(h.Buffer.from(this._canonicalizeForSigning(e)+r)).toString("hex"),n={type:"LegalTokenZKProof",created:new Date().toISOString(),proofPurpose:"zeroKnowledge",statement:{claim:t.claim||"UNSPECIFIED",predicate:t.predicate||"SATISFIES",threshold:t.threshold||null},commitment:i,nonce:r,proofData:this._generateZKProofData(e,t,r)};return{success:!0,proof:n,commitment:i,externalOperations:{storeZKProof:{endpoint:"POST /proofs/zero-knowledge",data:{tokenId:e.id,proof:n,statement:t}},verifyZKProof:{endpoint:"POST /proofs/verify-zk",data:{proof:n,expectedNonce:r}},auditZKProof:{endpoint:"POST /audit/zk-proof",data:{tokenId:e.id,statement:t.claim,proofGenerated:new Date().toISOString()}}}}}catch(o){return{success:!1,error:o.message}}},_generateZKProofData:function(e,t,r){var i={challenge:co.sha256(h.Buffer.from(t.claim+r)).toString("hex"),response:co.sha256(h.Buffer.from(this._canonicalizeForSigning(e)+t.claim)).toString("hex"),witness:co.sha256(h.Buffer.from(r+e.id+t.predicate)).toString("hex")};return i},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o},_canonicalizeForSigning:function(e){var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.tokenHash;var r=this._sortObjectKeys(t);return JSON.stringify(r)},_createFieldCommitments:function(e,t){var r=[],i=0;return this._traverseObject(e,"",function(n,o){if(n!=="proof"&&n!=="tokenHash"){var a=co.sha256(h.Buffer.from(t+n+i)).toString("hex"),s=this._hashField(n,o,a);r.push({path:n,value:o,salt:a,hash:s,index:i}),i++}}.bind(this)),r},_hashField:function(e,t,r){var i=e+":"+JSON.stringify(t)+":"+r;return co.sha256(h.Buffer.from(i)).toString("hex")},_createMerkleTree:function(e){var t=e.map(function(l){return l.hash});if(t.length===0)return{root:null,levels:[]};for(var r=[t],i=t;i.length>1;){for(var n=[],o=0;o<i.length;o+=2){var a=i[o],s=i[o+1]||a,u=h.Buffer.concat([h.Buffer.from(a,"hex"),h.Buffer.from(s,"hex")]),c=co.sha256(u).toString("hex");n.push(c)}r.push(n),i=n}return{root:i[0],levels:r}},_generateMerkleProof:function(e,t){for(var r=[],i=t,n=0;n<e.levels.length-1;n++){var o=e.levels[n],a=i%2===0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r},_verifyMerkleProof:function(e,t,r,i){for(var n=e,o=t,a=0;a<r.length;a++){var s=r[a],u=o%2===0,c;s.isLeft?c=h.Buffer.concat([h.Buffer.from(s.hash,"hex"),h.Buffer.from(n,"hex")]):c=h.Buffer.concat([h.Buffer.from(n,"hex"),h.Buffer.from(s.hash,"hex")]),n=co.sha256(c).toString("hex"),o=Math.floor(o/2)}return n===i},_traverseObject:function(e,t,r){Array.isArray(e)?e.forEach(function(i,n){var o=t+"["+n+"]";this._traverseObject(i,o,r)}.bind(this)):e!==null&&typeof e=="object"?Object.keys(e).forEach(function(i){var n=t?t+"."+i:i;this._traverseObject(e[i],n,r)}.bind(this)):r(t,e)},_getNestedValue:function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)},_findFieldCommitment:function(e,t){return e.find(function(r){return r.path===t})},_checkLegalRequirement:function(e,t){switch(t.type){case"field_present":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r!=null};case"field_value":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r===t.expectedValue};case"temporal_validity":var i=new Date,n=new Date(e.issuanceDate);return{requirement:t.type,satisfied:n<=i};default:return{requirement:t.type,satisfied:!1,error:"Unknown requirement type"}}},_hashCompliance:function(e,t,r){var i={tokenId:e.id,jurisdiction:t.code,nonce:r,timestamp:new Date().toISOString()};return co.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex")},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};vq.exports=cse});var bq=k((lme,yq)=>{"use strict";v();var O5=Ae(),Vf=O5.crypto.Hash,fme=O5.Address,cme=O5.Transaction,Ci=O5.util.preconditions,lse={prepareRegistry:function(e){e=e||{},Ci.checkArgument(typeof e=="object","Config must be object");var t={id:e.id||this._generateRegistryId(),name:e.name||"Legal Token Registry",jurisdiction:e.jurisdiction||"GLOBAL",authority:e.authority||null,created:new Date().toISOString(),version:"1.0.0",config:{allowPublicRegistration:e.allowPublicRegistration||!1,requireApproval:e.requireApproval||!0,enableRevocation:e.enableRevocation!==!1,enableAuditTrail:e.enableAuditTrail!==!1,retentionPeriod:e.retentionPeriod||"7Y",complianceLevel:e.complianceLevel||"STANDARD"},dataStructure:{tokens:"Map<tokenId, registrationRecord>",revocations:"Map<tokenId, revocationRecord>",auditLog:"Array<auditEntry>",statistics:{totalTokens:0,activeTokens:0,revokedTokens:0,registrations:0}},externalStorage:{required:!0,type:"database_or_blockchain",endpoints:{store:"POST /registry/{id}/tokens",retrieve:"GET /registry/{id}/tokens/{tokenId}",search:"GET /registry/{id}/search",revoke:"POST /registry/{id}/revocations"}}},r=this._prepareAuditEntry({action:"REGISTRY_CREATED",actor:e.authority,timestamp:t.created,metadata:{jurisdiction:t.jurisdiction,config:t.config}});return{success:!0,registry:t,initialAudit:r,instructions:{step1:"Store registry configuration in external system",step2:"Initialize token storage with provided data structure",step3:"Set up audit logging with provided templates",step4:"Configure external endpoints for registry operations"}}},prepareTokenRegistration:function(e,t,r){r=r||{},Ci.checkArgument(e&&typeof e=="object","Invalid token"),Ci.checkArgument(t&&typeof t=="object","Invalid registry config");try{var i=this._validateTokenForRegistration(e,t);if(!i.valid)return{success:!1,error:"Token validation failed: "+i.error};var n={tokenId:e.id,tokenHash:this._hashToken(e),token:e,status:t.requireApproval?"PENDING":"ACTIVE",registeredBy:r.registeredBy||"UNKNOWN",registeredAt:new Date().toISOString(),approvedBy:null,approvedAt:null,metadata:r.metadata||{},compliance:{jurisdiction:e.jurisdiction||t.jurisdiction,level:this._calculateComplianceLevel(e),checks:i.checks||[]}},o=this._prepareAuditEntry({action:"TOKEN_REGISTERED",actor:r.registeredBy,tokenId:e.id,timestamp:n.registeredAt,metadata:{status:n.status,tokenType:e.type,compliance:n.compliance}});return{success:!0,registrationRecord:n,auditEntry:o,registrationId:this._generateRegistrationId(e.id),validation:i,externalOperations:{store:{endpoint:"POST /registry/"+t.id+"/tokens",data:n},audit:{endpoint:"POST /registry/"+t.id+"/audit",data:o}}}}catch(a){return{success:!1,error:a.message}}},prepareTokenApproval:function(e,t,r){try{Ci.checkArgument(typeof e=="string","Token ID must be string"),Ci.checkArgument(typeof t=="string","Approver must be string"),Ci.checkArgument(r&&typeof r=="object","Invalid registry config");var i={tokenId:e,status:"ACTIVE",approvedBy:t,approvedAt:new Date().toISOString()},n=this._prepareAuditEntry({action:"TOKEN_APPROVED",actor:t,tokenId:e,timestamp:i.approvedAt});return{success:!0,approvalData:i,auditEntry:n,externalOperations:{update:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:i},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:n}}}}catch(o){return{success:!1,error:o.message}}},prepareTokenRevocation:function(e,t,r){try{if(Ci.checkArgument(typeof e=="string","Token ID must be string"),Ci.checkArgument(t&&typeof t=="object","Invalid revocation"),Ci.checkArgument(r&&typeof r=="object","Invalid registry config"),!r.enableRevocation)return{success:!1,error:"Revocation is disabled for this registry"};var i={tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:new Date().toISOString(),effectiveDate:t.effectiveDate||new Date().toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null,revocationHash:this._generateRevocationHash(e,t)},n={tokenId:e,status:"REVOKED",revokedAt:i.revokedAt,revocationReason:i.reason},o=this._prepareAuditEntry({action:"TOKEN_REVOKED",actor:t.revokedBy,tokenId:e,timestamp:i.revokedAt,metadata:{reason:i.reason,legalBasis:i.legalBasis}});return{success:!0,revocationRecord:i,statusUpdate:n,auditEntry:o,revocationId:this._generateRevocationId(e),externalOperations:{storeRevocation:{endpoint:"POST /registry/"+r.id+"/revocations",data:i},updateStatus:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:n},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:o}}}}catch(a){return{success:!1,error:a.message}}},prepareTokenStatusQuery:function(e,t){try{return Ci.checkArgument(typeof e=="string","Token ID must be string"),Ci.checkArgument(t&&typeof t=="object","Invalid registry config"),{success:!0,query:{tokenId:e,registryId:t.id},externalOperations:{retrieve:{endpoint:"GET /registry/"+t.id+"/tokens/"+e,method:"GET"},checkRevocation:{endpoint:"GET /registry/"+t.id+"/revocations/"+e,method:"GET"}},expectedResponse:{found:"boolean",status:"string (PENDING|ACTIVE|REVOKED)",registeredAt:"ISO datetime",registeredBy:"string",approvedAt:"ISO datetime or null",approvedBy:"string or null",revokedAt:"ISO datetime or null",revocationReason:"string or null",compliance:"object",revocation:"object or null"}}}catch(r){return{success:!1,error:r.message}}},prepareTokenSearch:function(e,t){e=e||{};try{Ci.checkArgument(t&&typeof t=="object","Invalid registry config");var r=[];e.status&&r.push("status="+encodeURIComponent(e.status)),e.type&&r.push("type="+encodeURIComponent(e.type)),e.registeredBy&&r.push("registeredBy="+encodeURIComponent(e.registeredBy)),e.jurisdiction&&r.push("jurisdiction="+encodeURIComponent(e.jurisdiction)),e.dateFrom&&r.push("dateFrom="+encodeURIComponent(e.dateFrom)),e.dateTo&&r.push("dateTo="+encodeURIComponent(e.dateTo)),e.includeTokens&&r.push("includeTokens=true"),e.sortBy&&r.push("sortBy="+encodeURIComponent(e.sortBy)),e.sortOrder&&r.push("sortOrder="+encodeURIComponent(e.sortOrder));var i=e.offset||0,n=e.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,searchCriteria:e,externalOperations:{search:{endpoint:"GET /registry/"+t.id+"/search"+o,method:"GET"}},expectedResponse:{success:"boolean",results:"Array<tokenRecord>",totalCount:"number",totalRegistrations:"number",offset:"number",limit:"number",hasMore:"boolean"}}}catch(a){return{success:!1,error:a.message}}},prepareStatisticsQuery:function(e){return Ci.checkArgument(e&&typeof e=="object","Invalid registry config"),{success:!0,query:{registryId:e.id},externalOperations:{getStatistics:{endpoint:"GET /registry/"+e.id+"/statistics",method:"GET"}},expectedResponse:{id:"string",name:"string",jurisdiction:"string",created:"ISO datetime",statistics:{totalTokens:"number",activeTokens:"number",revokedTokens:"number",registrations:"number"},auditEntries:"number",lastActivity:"ISO datetime"}}},prepareAuditLogQuery:function(e,t){if(t=t||{},Ci.checkArgument(e&&typeof e=="object","Invalid registry config"),!e.enableAuditTrail)return{success:!1,error:"Audit trail is disabled"};var r=[];t.action&&r.push("action="+encodeURIComponent(t.action)),t.actor&&r.push("actor="+encodeURIComponent(t.actor)),t.tokenId&&r.push("tokenId="+encodeURIComponent(t.tokenId)),t.dateFrom&&r.push("dateFrom="+encodeURIComponent(t.dateFrom)),t.dateTo&&r.push("dateTo="+encodeURIComponent(t.dateTo));var i=t.offset||0,n=t.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,auditOptions:t,externalOperations:{getAuditLog:{endpoint:"GET /registry/"+e.id+"/audit"+o,method:"GET"}},expectedResponse:{success:"boolean",entries:"Array<auditEntry>",totalEntries:"number",offset:"number",limit:"number",hasMore:"boolean"}}},_generateRegistryId:function(){var e="reg_"+Date.now()+"_"+Math.random();return"reg_"+Vf.sha256(h.Buffer.from(e)).toString("hex").substring(0,16)},_generateRegistrationId:function(e){var t="reg_"+e+"_"+Date.now();return Vf.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_generateRevocationId:function(e){var t="rev_"+e+"_"+Date.now();return Vf.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_hashToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,Vf.sha256(h.Buffer.from(JSON.stringify(t))).toString("hex")},_generateRevocationHash:function(e,t){var r=e+(t.reason||"")+(t.revokedBy||"")+Date.now();return Vf.sha256(h.Buffer.from(r)).toString("hex")},_validateTokenForRegistration:function(e,t){var r=[],i=!0;return e.id?r.push({field:"id",valid:!0}):(r.push({field:"id",valid:!1,error:"Missing token ID"}),i=!1),e.type?r.push({field:"type",valid:!0}):(r.push({field:"type",valid:!1,error:"Missing token type"}),i=!1),e.issuanceDate?r.push({field:"issuanceDate",valid:!0}):(r.push({field:"issuanceDate",valid:!1,error:"Missing issuance date"}),i=!1),e.proof?r.push({field:"proof",valid:!0}):(r.push({field:"proof",valid:!1,error:"Missing cryptographic proof"}),i=!1),{valid:i,checks:r}},_calculateComplianceLevel:function(e){var t="BASIC";return e.proof&&e.proof.type&&(t="STANDARD"),e.jurisdiction&&e.legalBasis&&(t="ENHANCED"),e.attestations&&e.attestations.length>0&&(t="PREMIUM"),t},_prepareAuditEntry:function(e){var t={id:this._generateAuditId(),action:e.action,actor:e.actor||"SYSTEM",tokenId:e.tokenId||null,timestamp:e.timestamp||new Date().toISOString(),metadata:e.metadata||{},hash:this._generateAuditHash(e)};return t},_generateAuditId:function(){var e="audit_"+Date.now()+"_"+Math.random();return"audit_"+Vf.sha256(h.Buffer.from(e)).toString("hex").substring(0,12)},_generateAuditHash:function(e){var t=(e.action||"")+(e.actor||"")+(e.tokenId||"")+(e.timestamp||"");return Vf.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)}};yq.exports=lse});var xq=k((dme,Sq)=>{"use strict";v();var Ws=Ae(),j7=Ws.crypto.Hash,_q=Ws.crypto.ECDSA,hse=Ws.crypto.Signature,wq=Ws.PrivateKey,$i=Ws.util.preconditions;function dse(e,t){if(t=t||{},t.issuerPublicKey)return t.issuerPublicKey instanceof Ws.PublicKey?t.issuerPublicKey:Ws.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if(typeof r!="string")return null;try{var i=r.split("#")[0].split(":")[2];return i?Ws.PublicKey.fromString(i):null}catch{return null}}var I5={CORRELATIVE_OBLIGATION:"CorrelativeObligation",CONTRACTUAL_OBLIGATION:"ContractualObligation",PAYMENT_OBLIGATION:"PaymentObligation",DELIVERY_OBLIGATION:"DeliveryObligation",PERFORMANCE_OBLIGATION:"PerformanceObligation",MAINTENANCE_OBLIGATION:"MaintenanceObligation",COMPLIANCE_OBLIGATION:"ComplianceObligation",REPORTING_OBLIGATION:"ReportingObligation",CONFIDENTIALITY_OBLIGATION:"ConfidentialityObligation",NON_COMPETE_OBLIGATION:"NonCompeteObligation",INDEMNIFICATION_OBLIGATION:"IndemnificationObligation",WARRANTY_OBLIGATION:"WarrantyObligation",SUPPORT_OBLIGATION:"SupportObligation",REGULATORY_OBLIGATION:"RegulatoryObligation",FIDUCIARY_OBLIGATION:"FiduciaryObligation"},Yl={CRITICAL:"CRITICAL",HIGH:"HIGH",MEDIUM:"MEDIUM",LOW:"LOW",DEFERRED:"DEFERRED"},Di={PENDING:"PENDING",ACTIVE:"ACTIVE",IN_PROGRESS:"IN_PROGRESS",COMPLETED:"COMPLETED",OVERDUE:"OVERDUE",BREACHED:"BREACHED",WAIVED:"WAIVED",TERMINATED:"TERMINATED"},A5={prepareObligationToken:function(e,t,r,i,n,o){o=o||{},$i.checkArgument(typeof e=="string","Obligation type must be string"),$i.checkArgument(typeof t=="string","Issuer DID must be string"),$i.checkArgument(typeof r=="string","Obligor DID must be string"),$i.checkArgument(i&&typeof i=="object","Obligation must be object"),$i.checkArgument(n instanceof wq,"Invalid issuer private key");var a=Object.values(I5);$i.checkArgument(a.includes(e),"Invalid obligation type: "+e);try{var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken",e],issuer:t,issuanceDate:new Date().toISOString(),credentialSubject:{id:r,obligationType:e,obligation:i,jurisdiction:o.jurisdiction||"US",priority:o.priority||Yl.MEDIUM,status:Di.PENDING,dueDate:o.dueDate||null,effectiveDate:o.effectiveDate||new Date().toISOString(),expirationDate:o.expirationDate||null,correlativeRight:o.correlativeRight||null,rightHolder:o.rightHolder||null,enforceable:o.enforceable!==!1,penalties:o.penalties||null,remedies:o.remedies||null}};o.metadata&&(s.credentialSubject.metadata=o.metadata);var u=this._signToken(s,n);return{success:!0,obligationToken:u,tokenHash:u.tokenHash,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight},externalOperations:{storeToken:{endpoint:"POST /obligations/tokens",data:{token:u,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight}}},indexToken:{endpoint:"POST /obligations/index",data:{tokenId:u.id,tokenHash:u.tokenHash,type:e,issuer:t,obligor:r,issuedAt:u.issuanceDate,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},notifyObligor:{endpoint:"POST /notifications/obligation-issued",data:{tokenId:u.id,issuer:t,obligor:r,obligationType:e,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},scheduleReminders:s.credentialSubject.dueDate?{endpoint:"POST /obligations/schedule-reminders",data:{tokenId:u.id,obligor:r,dueDate:s.credentialSubject.dueDate,reminderSchedule:o.reminderSchedule||["7d","3d","1d"]}}:null}}}catch(c){return{success:!1,error:c.message}}},prepareObligationVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateObligationType(e,r),this._validateObligationStatus(e,r,i),this._validateObligationPriority(e,i);var n={valid:r.length===0,errors:r,warnings:i,issuerDID:e.issuer,obligorDID:e.credentialSubject?e.credentialSubject.id:null,obligationType:e.credentialSubject?e.credentialSubject.obligationType:null,status:e.credentialSubject?e.credentialSubject.status:null,priority:e.credentialSubject?e.credentialSubject.priority:null,isOverdue:this._checkIfOverdue(e),verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /obligations/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt,isOverdue:n.isOverdue}},auditVerification:{endpoint:"POST /audit/obligation-verification",data:{tokenId:e.id,obligationType:n.obligationType,issuer:n.issuerDID,obligor:n.obligorDID,result:n.valid,verifiedAt:n.verifiedAt}},updateStatus:n.isOverdue&&e.credentialSubject.status===Di.ACTIVE?{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:Di.OVERDUE,updatedAt:n.verifiedAt,reason:"Due date passed"}}:null}}}catch(o){return{success:!1,error:"Verification preparation failed: "+o.message}}},prepareObligationFulfillment:function(e,t,r,i){i=i||{},$i.checkArgument(e&&typeof e=="object","Invalid token"),$i.checkArgument(t&&typeof t=="object","Invalid fulfillment"),$i.checkArgument(r instanceof wq,"Invalid obligor key");try{var n=this.prepareObligationVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot fulfill invalid obligation: "+n.verification.errors.join(", ")};if(e.credentialSubject.status===Di.COMPLETED)return{success:!1,error:"Obligation already fulfilled"};if(e.credentialSubject.status===Di.TERMINATED)return{success:!1,error:"Obligation has been terminated"};var o={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationFulfillment"],issuer:e.credentialSubject.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:e.id,fulfillmentType:t.type||"FULL_FULFILLMENT",fulfillmentDate:new Date().toISOString(),evidence:t.evidence||null,description:t.description||"",completionPercentage:t.completionPercentage||100,attestations:t.attestations||[],notes:t.notes||null}},a=this._signToken(o,r),s=o.credentialSubject.completionPercentage>=100?Di.COMPLETED:Di.IN_PROGRESS;return{success:!0,fulfillmentRecord:a,newStatus:s,fulfillmentId:a.id,externalOperations:{recordFulfillment:{endpoint:"POST /obligations/fulfillments",data:{obligationId:e.id,fulfillmentRecord:a,obligor:e.credentialSubject.id,fulfillmentDate:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:s,fulfillmentId:a.id,updatedAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},notifyRightHolder:e.credentialSubject.rightHolder?{endpoint:"POST /notifications/obligation-fulfilled",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,completionPercentage:o.credentialSubject.completionPercentage,newStatus:s}}:null,auditFulfillment:{endpoint:"POST /audit/obligation-fulfillment",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,fulfilledAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}}}}}catch(u){return{success:!1,error:u.message}}},prepareObligationBreachAssessment:function(e,t,r){$i.checkArgument(e&&typeof e=="object","Invalid token"),$i.checkArgument(t&&typeof t=="object","Invalid breach details"),$i.checkArgument(r&&typeof r=="object","Invalid assessor");try{var i={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationBreachAssessment"],issuer:r.did||r.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:e.id,breachType:t.type||"MATERIAL_BREACH",breachDate:t.date||new Date().toISOString(),description:t.description||"",severity:t.severity||"MODERATE",evidence:t.evidence||[],assessor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},damages:t.damages||null,recommendedRemedies:t.recommendedRemedies||[],assessmentDate:new Date().toISOString()}},n=j7.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex");return i.credentialSubject.assessmentHash=n,{success:!0,breachAssessment:i,breachId:i.id,severity:t.severity||"MODERATE",externalOperations:{recordBreach:{endpoint:"POST /obligations/breaches",data:{obligationId:e.id,breachAssessment:i,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachDate:t.date||new Date().toISOString(),severity:t.severity||"MODERATE"}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:Di.BREACHED,breachId:i.id,breachDate:t.date||new Date().toISOString(),updatedAt:new Date().toISOString()}},notifyParties:{endpoint:"POST /notifications/obligation-breached",data:{obligationId:e.id,breachId:i.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachType:t.type||"MATERIAL_BREACH",severity:t.severity||"MODERATE"}},escalateBreach:t.severity==="CRITICAL"?{endpoint:"POST /legal/escalate-breach",data:{obligationId:e.id,breachId:i.id,severity:t.severity,jurisdiction:e.credentialSubject.jurisdiction}}:null,auditBreach:{endpoint:"POST /audit/obligation-breach",data:{obligationId:e.id,breachId:i.id,obligor:e.credentialSubject.id,assessedAt:i.credentialSubject.assessmentDate,severity:t.severity||"MODERATE"}}}}}catch(o){return{success:!1,error:o.message}}},prepareObligationMonitoringReport:function(e,t){t=t||{},$i.checkArgument(Array.isArray(e),"Obligations must be array");try{var r={reportId:"rpt_"+this._generateUUID(),generatedAt:new Date().toISOString(),criteria:t,summary:{totalObligations:e.length,byStatus:{},byPriority:{},byType:{},overdue:0,dueSoon:0,completed:0},obligations:[],alerts:[],recommendations:[]},i=new Date,n=new Date(i.getTime()+10080*60*1e3);return e.forEach(function(o){var a={id:o.id,type:o.credentialSubject.obligationType,status:o.credentialSubject.status,priority:o.credentialSubject.priority,obligor:o.credentialSubject.id,dueDate:o.credentialSubject.dueDate,isOverdue:this._checkIfOverdue(o),isDueSoon:!1};if(o.credentialSubject.dueDate){var s=new Date(o.credentialSubject.dueDate);a.isDueSoon=s<=n&&s>i}r.summary.byStatus[a.status]=(r.summary.byStatus[a.status]||0)+1,r.summary.byPriority[a.priority]=(r.summary.byPriority[a.priority]||0)+1,r.summary.byType[a.type]=(r.summary.byType[a.type]||0)+1,a.isOverdue&&r.summary.overdue++,a.isDueSoon&&r.summary.dueSoon++,a.status===Di.COMPLETED&&r.summary.completed++,a.isOverdue&&a.priority===Yl.CRITICAL&&r.alerts.push({type:"CRITICAL_OVERDUE",obligationId:o.id,message:"Critical obligation is overdue",priority:"HIGH"}),a.isDueSoon&&a.priority===Yl.HIGH&&r.alerts.push({type:"HIGH_PRIORITY_DUE_SOON",obligationId:o.id,message:"High priority obligation due soon",priority:"MEDIUM"}),r.obligations.push(a)}.bind(this)),r.summary.overdue>0&&r.recommendations.push({type:"OVERDUE_MANAGEMENT",message:"Consider prioritizing overdue obligations",count:r.summary.overdue}),r.summary.dueSoon>5&&r.recommendations.push({type:"WORKLOAD_MANAGEMENT",message:"High number of obligations due soon - consider workload distribution",count:r.summary.dueSoon}),{success:!0,report:r,externalOperations:{storeReport:{endpoint:"POST /obligations/monitoring-reports",data:{report:r,generatedAt:r.generatedAt}},sendAlerts:r.alerts.length>0?{endpoint:"POST /notifications/obligation-alerts",data:{reportId:r.reportId,alerts:r.alerts,summary:r.summary}}:null,updateDashboard:{endpoint:"PUT /dashboard/obligation-metrics",data:{summary:r.summary,lastUpdated:r.generatedAt}}}}}catch(o){return{success:!1,error:o.message}}},getObligationTypes:function(){return I5},getObligationPriority:function(){return Yl},getObligationStatus:function(){return Di},_signToken:function(e,t){var r=this._canonicalizeToken(e),i=j7.sha256(h.Buffer.from(r)),n=new _q;n.hashbuf=i,n.privkey=t,n.pubkey=t.toPublicKey(),n.sign();var o=n.sig,a={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(i,o)},s=JSON.parse(JSON.stringify(e));return s.proof=a,s.tokenHash=i.toString("hex"),s},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),(!e.type||!Array.isArray(e.type))&&t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws){t.push("Missing signature proof");return}var i=this._canonicalizeToken(e),n=j7.sha256(h.Buffer.from(i));if(e.tokenHash&&e.tokenHash!==n.toString("hex")){t.push("Token hash mismatch");return}var o=dse(e,r);if(!o){t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");return}var a=e.proof.jws.split(".");if(a.length!==3||!a[2]){t.push("Malformed JWS");return}var s=hse.fromDER(h.Buffer.from(a[2],"base64url")),u=new _q;u.hashbuf=n,u.sig=s,u.pubkey=o,u.verify().verified!==!0&&t.push("Signature verification failed")}catch(c){t.push("Signature verification failed: "+c.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date,n=new Date(e.issuanceDate);if(n>i&&t.push("Token issued in the future"),e.credentialSubject.effectiveDate){var o=new Date(e.credentialSubject.effectiveDate);i<o&&r.push("Obligation not yet effective")}if(e.credentialSubject.expirationDate){var a=new Date(e.credentialSubject.expirationDate);i>a&&t.push("Obligation expired")}},_validateObligationType:function(e,t){if(!e.credentialSubject.obligationType){t.push("Missing obligationType");return}var r=Object.values(I5);r.includes(e.credentialSubject.obligationType)||t.push("Invalid obligation type: "+e.credentialSubject.obligationType)},_validateObligationStatus:function(e,t,r){if(!e.credentialSubject.status){t.push("Missing status");return}var i=Object.values(Di);i.includes(e.credentialSubject.status)||t.push("Invalid obligation status: "+e.credentialSubject.status),this._checkIfOverdue(e)&&e.credentialSubject.status===Di.ACTIVE&&r.push("Obligation is overdue but status is still ACTIVE")},_validateObligationPriority:function(e,t){if(e.credentialSubject.priority){var r=Object.values(Yl);r.includes(e.credentialSubject.priority)||t.push("Invalid obligation priority: "+e.credentialSubject.priority)}},_checkIfOverdue:function(e){if(!e.credentialSubject.dueDate)return!1;var t=new Date,r=new Date(e.credentialSubject.dueDate);return t>r&&e.credentialSubject.status!==Di.COMPLETED},_generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}};A5.ObligationTypes=I5;A5.ObligationPriority=Yl;A5.ObligationStatus=Di;Sq.exports=A5});var Iq=k((gme,Oq)=>{"use strict";v();var Gf=uq(),P5=lq(),$1=pq(),z7=mq(),na=bq(),pse=xq(),Eq=Ae(),K7=Eq.PrivateKey,Xi=Eq.util.preconditions,wt=function(e){return this instanceof wt?(this.config=e||{},this.registry=null,this.config.registry&&(this.registry=na.createRegistry(this.config.registry)),this):new wt(e)};wt.prototype.createRightToken=function(e,t,r){Xi.checkArgument(e&&typeof e=="object","Invalid right data"),Xi.checkArgument(t instanceof K7,"Invalid private key"),r=r||{};try{var i=Gf.create(e.type,e.owner,e.owner,e,t,r);if(!i)return{success:!1,error:"Failed to create token"};if(r.addProof!==!1&&(i=Gf._signToken(i,t)),r.anchor){var n=$1.anchorToken(i,r.anchor);n.success&&(i.anchorTx=n.txid,i.anchorBlock=n.blockHeight)}if(this.registry&&r.register!==!1){var o=na.registerToken(this.registry,i,{registeredBy:r.registeredBy||"SYSTEM"});o.success&&(i.registrationId=o.registrationId,i.registrationStatus=o.status)}return{success:!0,token:i,type:"LegalRightToken"}}catch(a){return{success:!1,error:a.message}}};wt.prototype.validateClaim=function(e,t){return P5.validate(e,t)};wt.prototype.createSelectiveDisclosure=function(e,t,r){return z7.prepareSelectiveDisclosure(e,t,r)};wt.prototype.verifyToken=function(e,t){return!e||!e.proof?{valid:!1,error:"No proof found in token"}:Gf.verifyToken(e,t)};wt.prototype.transferRight=function(e,t,r,i){Xi.checkArgument(e&&typeof e=="object","Invalid token"),Xi.checkArgument(typeof t=="string","New owner must be string"),Xi.checkArgument(r instanceof K7,"Invalid owner key"),i=i||{};try{var n=this.verifyToken(e,r.toPublicKey().toString());if(!n.valid)return{success:!1,error:"Invalid token or ownership proof"};var o=Gf.prepareRightTokenTransfer(e,t,r,i);if(!o.success)return{success:!1,error:o.error};var a=o.newToken,s=o.transferProof;if(i.anchor){var u=$1.anchorToken(a,i.anchor);u.success&&(a.transferAnchorTx=u.txid)}if(this.registry){var c=na.registerToken(this.registry,a,{registeredBy:i.registeredBy||t,metadata:{transferFrom:e.owner,transferTo:t,originalTokenId:e.id}});c.success&&(a.registrationId=c.registrationId)}return{success:!0,token:a,transferId:s.id,transferredAt:s.issuanceDate,transferProof:s}}catch(l){return{success:!1,error:l.message}}};wt.prototype.createObligation=function(e,t,r){Xi.checkArgument(e&&typeof e=="object","Invalid right token"),Xi.checkArgument(t&&typeof t=="object","Invalid obligation data"),Xi.checkArgument(r instanceof K7,"Invalid private key");try{var i=Gf.prepareObligationToken(e,t.obligor,t,r);return i.success?{success:!0,obligation:i.obligationToken,rightTokenId:e.id}:{success:!1,error:i.error}}catch(n){return{success:!1,error:n.message}}};wt.prototype.revokeToken=function(e,t,r){return Xi.checkArgument(typeof e=="string","Token ID must be string"),Xi.checkArgument(t&&typeof t=="object","Invalid revocation data"),Xi.checkArgument(typeof r=="string","Authority must be string"),this.registry?na.revokeToken(this.registry,e,{reason:t.reason,revokedBy:r,legalBasis:t.legalBasis,evidence:t.evidence}):{success:!1,error:"No registry available for revocation"}};wt.prototype.checkTokenStatus=function(e){return Xi.checkArgument(typeof e=="string","Token ID must be string"),this.registry?na.checkTokenStatus(this.registry,e):{found:!1,error:"No registry available"}};wt.prototype.searchTokens=function(e){return this.registry?na.searchTokens(this.registry,e):{success:!1,error:"No registry available"}};wt.prototype.getRegistryStats=function(){return this.registry?na.getStatistics(this.registry):{error:"No registry available"}};wt.prototype.createLegalValidityProof=function(e,t,r){return z7.prepareLegalValidityProof(e,t,r)};wt.prototype.anchorTokenBatch=function(e,t){return $1.anchorBatch(e,t)};wt.prototype.verifyAnchor=function(e,t){return $1.verifyAnchor(e,t)};wt.prototype.getRightTypes=function(){return Gf.getRightTypes()};wt.prototype.getClaimSchemas=function(){return P5.getSchemas()};wt.prototype.createRegistry=function(e){return this.registry=na.createRegistry(e),this.registry};wt.prototype.setRegistry=function(e){Xi.checkArgument(e&&typeof e=="object","Invalid registry"),this.registry=e};wt.create=function(e){return new wt(e)};wt.createRightToken=function(e,t,r){var i=new wt;return i.createRightToken(e,t,r)};wt.validateClaim=function(e,t){return P5.validate(e,t)};wt.verifyToken=function(e,t){var r=new wt;return r.verifyToken(e,t)};wt.createRegistry=function(e){return na.createRegistry(e)};wt.Right=Gf;wt.Claim=P5;wt.Anchor=$1;wt.Proof=z7;wt.Registry=na;wt.Obligation=pse;Oq.exports=wt});var Ae=k((mme,Aq)=>{"use strict";v();var j=Aq.exports;j.deps=j.deps||{};j.deps._=xt();j.deps.Buffer=typeof h.Buffer<"u"?h.Buffer:null;if(typeof window>"u")j.deps.bnjs=Nn(),j.deps.bs58=Z2();else{try{j.deps.bnjs=Nn()}catch{}try{j.deps.bs58=Z2()}catch{}}j.version="v"+Fm();j.versionGuard=function(e){if(e!==void 0){var t=`
|
|
98
|
+
`)}function Bne(e){return console.log(cC(e)),e}lC.exports={trace:Rne,format:cC,print:Bne,opLabel:fC}});var pC=k((Dge,dC)=>{"use strict";v();var x1=Ae(),re={Covenant:tN(),Preimage:Vo(),SIGHASH:nN(),Builder:aN(),UTXOGenerator:gN(),ScriptTester:mN(),CovenantBuilder:S8().CovenantBuilder,CovenantTemplates:S8().CovenantTemplates,OpcodeMap:b8(),ScriptUtils:EN(),StackExaminer:IN(),ScriptInterpreter:kN(),CovenantHelpers:Go(),Locks:FN(),PushTx:Pl(),PELS:L8(),Token:z8(),Authorizers:F8(),DSL:$8(),Policy:$8().Policy,Debugger:hC()};re.policy=re.DSL.policy;re.trace=function(e,t,r){return re.Debugger.trace(e,t,r)};re.enableGenesis=function(e){return re.CovenantHelpers.enableGenesis(e)};re.verifyScript=function(e,t,r){return re.CovenantHelpers.verify(e,t,r)};re.perpetualCovenant=function(e){return re.PELS.pelsCovenant(e)};re.ownershipToken=function(e,t){return re.Token.ownershipToken(e,t)};re.valueCovenant=function(e){return re.PushTx.valueCovenant(e)};re.ordinalLock=function(e,t){return re.Token.ordinalLock(e,t)};re.transferOrdinal=function(e,t,r,i,n,o){return re.Token.transferOrdinal(e,t,r,i,n,o)};re.createCovenant=function(e,t){return new re.Covenant(e,t)};re.extractPreimage=function(e,t){return new re.Preimage(e,t)};re.analyzeSIGHASH=function(e){return new re.SIGHASH(e)};re.buildCovenant=function(e,t){return new re.Builder(e,t)};re.createUTXOGenerator=function(e){return new re.UTXOGenerator(e)};re.createTestEnvironment=function(e){return re.UTXOGenerator.createTestEnvironment(e)};re.testScript=function(e,t,r){return re.ScriptTester.test(e,t,r)};re.testCovenant=function(e,t,r){return re.ScriptTester.testCovenant(e,t,r)};re.testFieldExtraction=function(e,t,r){return re.ScriptTester.testFieldExtraction(e,t,r)};re.debugScript=function(e,t){var r=new re.ScriptTester(t);return r.debug(e)};re.explainZeroHashes=function(){return re.SIGHASH.explainZeroMystery()};re.getAllSIGHASHTypes=function(){return re.SIGHASH.getAllTypes()};re.demonstrateAllSIGHASH=function(){return re.SIGHASH.generateAllDemonstrations()};re.createCovenantBuilder=function(){return new re.CovenantBuilder};re.createValueLockCovenant=function(e){return re.CovenantTemplates.valueLock(e)};re.createHashLockCovenant=function(e){return re.CovenantTemplates.hashLock(e)};re.createComplexValidationCovenant=function(e){return re.CovenantTemplates.complexValidation(e)};re.getOpcodeMap=function(){return re.OpcodeMap.opcodeMap};re.simulateScript=function(e,t){return re.OpcodeMap.utils.simulate(e,t)};re.createASMFromJS=function(e){return re.OpcodeMap.utils.createASM(e)};re.scriptToASM=function(e){return re.ScriptUtils.scriptToASM(e)};re.asmToScript=function(e){return re.ScriptUtils.asmToScript(e)};re.asmToHex=function(e){return re.ScriptUtils.asmToHex(e)};re.hexToASM=function(e){return re.ScriptUtils.hexToASM(e)};re.scriptToHex=function(e){return re.ScriptUtils.scriptToHex(e)};re.validateASM=function(e){return re.ScriptUtils.validateASM(e)};re.validateScript=function(e){return re.ScriptUtils.validateScript(e)};re.estimateScriptSize=function(e){return re.ScriptUtils.estimateScriptSize(e)};re.optimizeScript=function(e){return re.ScriptUtils.optimizeScript(e)};re.compareScripts=function(e,t){return re.ScriptUtils.compareScripts(e,t)};re.explainScript=function(e){return re.ScriptUtils.explainScript(e)};re.scriptMetrics=function(e){return re.ScriptUtils.scriptMetrics(e)};re.analyzeComplexity=function(e){return re.ScriptUtils.analyzeComplexity(e)};re.findOptimizations=function(e){return re.ScriptUtils.findOptimizations(e)};re.covenantToEnglish=function(e){return re.ScriptUtils.covenantToEnglish(e)};re.batchTestScripts=function(e,t){return re.ScriptUtils.batchTestScripts(e,t)};re.examineStack=function(e,t){return re.StackExaminer.runScript(e,t)};re.debugScriptExecution=function(e,t,r){return r=r||{},r.stepMode?re.ScriptInterpreter.stepThroughScript(re.ScriptInterpreter.parseScript(e+" "+t),new x1.Transaction,!0):re.ScriptInterpreter.runFullEvaluation(re.ScriptInterpreter.parseScript(e),re.ScriptInterpreter.parseScript(t),new x1.Transaction)};re.parseScript=function(e){return re.ScriptInterpreter.parseScript(e)};re.printStack=function(e,t){return re.ScriptInterpreter.printStack(e,t)};re.createQuickCovenant=function(e,t){let r=re.createCovenantBuilder();switch(e){case"value_lock":return r.comment(`Value lock: minimum ${t.value} satoshis`).extractField("value").push(t.value).greaterThanOrEqual().verify().build();case"hash_lock":return r.comment(`Hash lock: requires preimage of ${t.hash}`).push("secret_placeholder").sha256().push(t.hash).equalVerify().build();case"time_lock":return r.comment(`Time lock: requires nLockTime > ${t.timestamp}`).extractField("nLockTime").push(t.timestamp).greaterThan().verify().build();case"multi_condition":let i=r.comment("Multi-condition covenant");return t.conditions.forEach(n=>{switch(n.type){case"value":i=i.extractField("value").push(n.value).greaterThanOrEqual().verify();break;case"hash":i=i.push("secret_placeholder").sha256().push(n.hash).equalVerify();break;case"time":i=i.extractField("nLockTime").push(n.timestamp).greaterThan().verify();break}}),i.build();default:throw new Error(`Unknown covenant type: ${e}`)}};re.completeCovenantFlow=function(e,t,r){var i=new re.Covenant(e);return i.completeFlow(t,r)};re.getEducationalResources=function(){return{zeroHashMystery:re.SIGHASH.explainZeroMystery(),sighashTypes:re.SIGHASH.getAllTypes(),exampleDemonstrations:re.SIGHASH.generateAllDemonstrations()}};re.utils={};re.utils.reconstructP2pkhScript=function(e){return x1.Script.buildPublicKeyHashOut(e).toHex()};re.utils.createCovenantAddress=function(e){var t=x1.crypto.Hash.sha256ripemd160(e.toBuffer());return x1.Address.fromScriptHash(t)};re.utils.decodeCompactSize=function(e,t){return re.Preimage.decodeCompactSize(e,t)};re.version=Fm();re.description="Smart Contract Framework for Bitcoin SV";re.features={BIP143_PREIMAGE:!0,COMPACT_SIZE_VARINT:!0,BIDIRECTIONAL_EXTRACTION:!0,SIGHASH_DETECTION:!0,ZERO_HASH_WARNINGS:!0,MULTI_FIELD_VALIDATION:!0,REAL_UTXO_GENERATION:!0,SCRIPT_TESTING:!0,LOCAL_VERIFICATION:!0,JAVASCRIPT_TO_SCRIPT:!0,OPCODE_MAPPING:!0,COVENANT_BUILDER:!0,SCRIPT_ANALYSIS:!0,SCRIPT_OPTIMIZATION:!0,SCRIPT_CONVERSION:!0,BATCH_TESTING:!0,QUICK_COVENANTS:!0,SCRIPT_EXPLANATIONS:!0,STACK_EXAMINATION:!0,SCRIPT_DEBUGGING:!0,STEP_BY_STEP_EXECUTION:!0,INTERACTIVE_DEBUGGING:!0};re.interpretScript=re.debugScriptExecution;re.getScriptMetrics=re.scriptMetrics;dC.exports=re});var gC=k((qge,E1)=>{"use strict";v();var V6=function(){var e=typeof A.default<"u"&&A.default.env&&A.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)},Xa={MEMORY:"memory",SESSION:"session",LOCAL:"local"};function Si(e){e=e||{},this.options={storage:e.storage||Xa.MEMORY,storageKey:e.storageKey||"smartledger-utxos",autoSave:e.autoSave!==!1,maxUTXOs:e.maxUTXOs||1e3};var t=[Xa.MEMORY,Xa.SESSION,Xa.LOCAL];if(t.indexOf(this.options.storage)===-1)throw new Error("Invalid storage type: "+this.options.storage);this.utxos=new Map,this.addressIndex=new Map,this.spentUTXOs=new Map,this.metadata={totalUTXOs:0,totalValue:0,createdAt:new Date().toISOString(),lastModified:new Date().toISOString()},this.loadFromStorage()}Si.prototype.getStorage=function(){return this.options.storage===Xa.SESSION?typeof sessionStorage<"u"?sessionStorage:null:this.options.storage===Xa.LOCAL&&typeof localStorage<"u"?localStorage:null};Si.prototype.loadFromStorage=function(){var e=this.getStorage();if(e)try{var t=e.getItem(this.options.storageKey);if(!t)return;var r=JSON.parse(t);if(!r.utxos)return;var i=this;r.utxos.forEach(function(n){var o=n.txid+":"+n.vout;i.utxos.set(o,n),i.addressIndex.has(n.address)||i.addressIndex.set(n.address,new Set),i.addressIndex.get(n.address).add(o)}),r.metadata&&(this.metadata=r.metadata),V6("\u2705 BrowserUTXOManager: Loaded "+this.utxos.size+" UTXOs from "+this.options.storage+" storage")}catch(n){console.error("Failed to load UTXOs from storage:",n)}};Si.prototype.saveToStorage=function(){if(this.options.storage!==Xa.MEMORY){var e=this.getStorage();if(e)try{var t={utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",timestamp:new Date().toISOString()};e.setItem(this.options.storageKey,JSON.stringify(t)),V6("\u{1F4BE} BrowserUTXOManager: Saved "+this.utxos.size+" UTXOs to "+this.options.storage+" storage")}catch(r){console.error("Failed to save UTXOs to storage:",r)}}};Si.prototype.addUTXO=function(e){if(!e||!e.txid||typeof e.vout!="number")throw new Error("Invalid UTXO: missing txid or vout");var t=e.txid+":"+e.vout;if(this.utxos.has(t))return V6("\u26A0\uFE0F UTXO already exists: "+t),!1;var r={txid:e.txid,vout:e.vout,address:e.address||"",satoshis:e.satoshis||0,script:e.script||"",status:"available",addedAt:new Date().toISOString()};return this.utxos.set(t,r),r.address&&(this.addressIndex.has(r.address)||this.addressIndex.set(r.address,new Set),this.addressIndex.get(r.address).add(t)),this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),!0};Si.prototype.getUTXOsForAddress=function(e){var t=this.addressIndex.get(e);if(!t)return[];var r=[],i=this;return t.forEach(function(n){var o=i.utxos.get(n);o&&o.status==="available"&&r.push(o)}),r};Si.prototype.getBalance=function(e){var t=this.getUTXOsForAddress(e);return t.reduce(function(r,i){return r+(i.satoshis||0)},0)};Si.prototype.spendUTXOs=function(e,t){t=t||"browser-spend";for(var r=[],i=0;i<e.length;i++){var n=e[i],o=n.txid+":"+n.vout,a=this.utxos.get(o);a&&a.status==="available"&&(a.status="spent",a.spentAt=new Date().toISOString(),a.spentInTx=t,this.spentUTXOs.set(o,{txid:a.txid,vout:a.vout,spentInTx:t,spentAt:a.spentAt}),r.push(a))}return this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),r};Si.prototype.getUTXO=function(e,t){var r=e+":"+t,i=this.utxos.get(r);return{exists:!!i,utxo:i,status:i?i.status:"not-found"}};Si.prototype.createMockUTXOs=function(e,t,r){t=t||5,r=r||1e5;for(var i=[],n=0;n<t;n++){for(var o="",a=0;a<64;a++)o+=Math.floor(Math.random()*16).toString(16);var s={txid:o,vout:n,address:e,satoshis:r+Math.floor(Math.random()*1e4),script:"",status:"available"};this.addUTXO(s),i.push(s)}return i};Si.prototype.getStats=function(){var e=0,t=0,r=0;return this.utxos.forEach(function(i){e+=i.satoshis||0,i.status==="available"?t++:i.status==="spent"&&r++}),{totalUTXOs:this.utxos.size,totalAvailable:t,totalSpent:r,totalValue:e,totalAddresses:this.addressIndex.size,storageType:this.options.storage,metadata:this.metadata}};Si.prototype.updateMetadata=function(){var e=this.getStats();this.metadata.totalUTXOs=e.totalUTXOs,this.metadata.totalValue=e.totalValue,this.metadata.lastModified=new Date().toISOString()};Si.prototype.exportData=function(){return JSON.stringify({utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",exportedAt:new Date().toISOString()})};Si.prototype.importData=function(e,t){t=t||!1;try{var r=JSON.parse(e);if(t||(this.utxos.clear(),this.addressIndex.clear(),this.spentUTXOs.clear()),r.utxos&&Array.isArray(r.utxos)){var i=this;r.utxos.forEach(function(n){i.addUTXO(n)})}return V6("\u2705 BrowserUTXOManager: Imported "+(r.utxos&&r.utxos.length||0)+" UTXOs"),!0}catch(n){return console.error("Failed to import UTXO data:",n),!1}};typeof E1<"u"&&E1.exports?(E1.exports=Si,E1.exports.STORAGE_TYPES=Xa):typeof window<"u"&&(window.BrowserUTXOManager=Si,window.BrowserUTXOManager.STORAGE_TYPES=Xa)});var mC=k((Fge,vC)=>{"use strict";v();var X8=class{constructor(t,r={}){this.bsv=t,this.options={difficulty:r.difficulty||1,blockTime:r.blockTime||1e4,validateScripts:r.validateScripts!==!1,logLevel:r.logLevel||"info",...r},this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[]}acceptTransaction(t){try{return this.options.validateScripts&&!this.validateTransactionSignatures(t)?(this.log("warn","\u274C Transaction rejected: Invalid signatures"),!1):(this.mempool.push(t),this.log("info",`\u2705 Transaction accepted into mempool: ${t.id||"unknown"}`),!0)}catch(r){return this.log("error",`\u274C Transaction rejected: ${r.message}`),!1}}validateTransactionSignatures(t){try{let r=t.verify();return this.log("debug",`\u{1F4CA} Transaction verification result: ${r}`),r===!0}catch(r){return this.log("warn",`\u26A0\uFE0F Signature validation error: ${r.message}`),!1}}mineBlock(t=10){let r=this.mempool.splice(0,t),i={height:this.currentBlock.height+1,timestamp:Date.now(),transactions:r,transactionCount:r.length,previousBlockHash:this.currentBlock.hash||"0000000000000000000000000000000000000000000000000000000000000000"},n=JSON.stringify({height:i.height,timestamp:i.timestamp,previousBlockHash:i.previousBlockHash,transactions:r.map(o=>o.id||o.toString())});return i.hash=this.bsv.crypto.Hash.sha256(h.Buffer.from(n)).toString("hex"),this.currentBlock=i,this.log("info",`\u26CF\uFE0F Mined block ${i.height} with ${r.length} transactions`),this.log("debug",`\u{1F4E6} Block hash: ${i.hash}`),i}getMempoolStats(){return{transactionCount:this.mempool.length,transactions:this.mempool.map(t=>({id:t.id||"unknown",size:t.toBuffer?t.toBuffer().length:0,inputs:t.inputs?t.inputs.length:0,outputs:t.outputs?t.outputs.length:0}))}}getBlockchainStats(){return{currentHeight:this.currentBlock.height,currentBlockHash:this.currentBlock.hash,currentBlockTimestamp:this.currentBlock.timestamp,mempoolSize:this.mempool.length,difficulty:this.options.difficulty,blockTime:this.options.blockTime}}reset(){this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[],this.log("info","\u{1F504} Miner reset to genesis state")}log(t,r){let i={error:0,warn:1,info:2,debug:3},n=i[this.options.logLevel]||2;if(i[t]<=n){let o=new Date().toISOString();console.log(`[${o}] [${t.toUpperCase()}] ${r}`)}}};vC.exports=X8});var bC=k((jge,yC)=>{v();var Ne=Ae(),Rl=class{static createSignature(t,r,i,n,o,a=null){a=a||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;let s=Ne.Transaction.sighash.sign(t,r,a,i,n,new Ne.crypto.BN(o));return h.Buffer.concat([s.toDER(),h.Buffer.from([a])])}static createMultisigScript(t,r){let i=new Ne.Script().add(Ne.Opcode[`OP_${t}`]);for(let n of r)i=i.add(n.toBuffer());return i.add(Ne.Opcode[`OP_${r.length}`]).add(Ne.Opcode.OP_CHECKMULTISIG)}static createMultisigUnlocking(t){let r=new Ne.Script().add(Ne.Opcode.OP_0);for(let i of t)r=r.add(i);return r}static createTimelockScript(t,r){let i=h.Buffer.from(t.toString(16).padStart(8,"0"),"hex").reverse();return new Ne.Script().add(i).add(Ne.Opcode.OP_CHECKLOCKTIMEVERIFY).add(Ne.Opcode.OP_DROP).add(r.toBuffer())}static createConditionalScript(t,r=null){let i=new Ne.Script().add(Ne.Opcode.OP_IF).add(t.toBuffer());return r&&(i=i.add(Ne.Opcode.OP_ELSE).add(r.toBuffer())),i.add(Ne.Opcode.OP_ENDIF)}static createP2PKHScript(t){return new Ne.Script().add(Ne.Opcode.OP_DUP).add(Ne.Opcode.OP_HASH160).add(t.toAddress().hashBuffer).add(Ne.Opcode.OP_EQUALVERIFY).add(Ne.Opcode.OP_CHECKSIG)}static createP2PKHUnlocking(t,r){return new Ne.Script().add(t).add(r.toBuffer())}static getPreimage(t,r,i,n,o=null){return o=o||Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID,Ne.Transaction.sighash.sighash(t,o,r,i,new Ne.crypto.BN(n))}static createDataScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(t)}static createOpReturnScript(t){return typeof t=="string"&&(t=h.Buffer.from(t,"utf8")),new Ne.Script().add(Ne.Opcode.OP_FALSE).add(Ne.Opcode.OP_RETURN).add(t)}static validateTransaction(t){try{return t.verify()}catch(r){return console.error("Transaction validation error:",r.message),!1}}static validateScript(t,r,i,n){try{return new Ne.Script.Interpreter().verify(t,r,i,n,Ne.Script.Interpreter.SCRIPT_VERIFY_P2SH|Ne.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|Ne.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID|Ne.Script.Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES|Ne.Script.Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES)}catch(o){return console.error("Script validation error:",o.message),!1}}static createLowFeeTransaction(t,r,i=10){let n=new Ne.Transaction().feePerKb(i);for(let o of t)n=n.from(o);for(let o of r)n=n.to(o.address,o.satoshis);return n}};Rl.SIGHASH_ALL=Ne.crypto.Signature.SIGHASH_ALL|Ne.crypto.Signature.SIGHASH_FORKID;Rl.SIGHASH_NONE=Ne.crypto.Signature.SIGHASH_NONE|Ne.crypto.Signature.SIGHASH_FORKID;Rl.SIGHASH_SINGLE=Ne.crypto.Signature.SIGHASH_SINGLE|Ne.crypto.Signature.SIGHASH_FORKID;yC.exports=Rl});var G6=k((Kge,OC)=>{"use strict";v();var I1=Ae(),wC=h.Buffer.from("ord","utf8");function J8(){return I1.Script}function SC(){return I1.Opcode}function Mne(e){var t=J8();if(e.lock){if(e.lock instanceof t)return e.lock;if(h.Buffer.isBuffer(e.lock))return t.fromBuffer(e.lock);if(typeof e.lock=="string")return t.fromHex(e.lock);throw new Error("lock must be a Script, Buffer, or hex string")}if(e.address){var r=e.address instanceof I1.Address?e.address:I1.Address.fromString(String(e.address));return t.buildPublicKeyHashOut(r)}throw new Error("buildInscription requires an address or a lock script")}function _C(e,t){return h.Buffer.isBuffer(e)?e:e==null?h.Buffer.alloc(0):h.Buffer.from(String(e),t||"utf8")}function xC(e){e=e||{};var t=SC(),r=Mne(e),i=_C(e.contentType||"text/plain"),n=_C(e.content),o=J8().fromBuffer(r.toBuffer());return o.add(t.OP_FALSE),o.add(t.OP_IF),o.add(wC),o.add(t.OP_1),o.add(i),o.add(t.OP_0),o.add(n),o.add(t.OP_ENDIF),o}function O1(e,t){return e&&e.opcodenum===t&&e.buf==null}function EC(e){for(var t=J8(),r=SC(),i=e instanceof t?e:h.Buffer.isBuffer(e)?t.fromBuffer(e):t.fromHex(e),n=i.chunks,o=-1,a=0;a+2<n.length;a++)if(O1(n[a],r.OP_FALSE)&&O1(n[a+1],r.OP_IF)&&n[a+2].buf&&n[a+2].buf.equals(wC)){o=a;break}if(o===-1)return null;for(var s=new t,u=0;u<o;u++)s.chunks.push(n[u]);for(var c=h.Buffer.alloc(0),l=h.Buffer.alloc(0),m=o+3;m<n.length;m++){var w=n[m];if(O1(w,r.OP_ENDIF))break;O1(w,r.OP_1)&&n[m+1]&&n[m+1].buf?(c=n[m+1].buf,m++):O1(w,r.OP_0)&&n[m+1]&&n[m+1].buf&&(l=n[m+1].buf,m++)}return{contentType:c.toString("utf8"),content:l,contentText:l.toString("utf8"),lock:s}}function Nne(e){try{return EC(e)!==null}catch{return!1}}function Cne(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;return new I1.Transaction.Output({script:xC(e),satoshis:t})}OC.exports={buildInscription:xC,parseInscription:EC,isInscription:Nne,createInscriptionOutput:Cne}});var BC=k((Gge,RC)=>{"use strict";v();var qr=Ae(),Ml=Pl(),Q8=Go(),AC=G6(),Yo=qr.Script,Xt=qr.Opcode,PC=qr.encoding.BufferReader,Y6=Ml.SIGHASH_ALL_ANYONECANPAY_FORKID;function IC(e,t){return t&&t.length?e.add(h.Buffer.from(t)):e.add(Xt.OP_0)}function Z6(e){return e.toBufferWriter().toBuffer()}function Nl(e,t){if(typeof e!="number"||!isFinite(e)||e<0||Math.floor(e)!==e)throw new Error(t+" must be a non-negative integer number of satoshis (got "+e+")");return e}function X6(e){return e instanceof Yo?e:h.Buffer.isBuffer(e)?Yo.fromBuffer(e):Yo.fromHex(e)}function TC(e){return e instanceof qr.Address?e:e&&typeof e.toAddress=="function"?e.toAddress():qr.Address.fromString(String(e))}function Dne(e){if(h.Buffer.isBuffer(e)){if(e.length!==20)throw new Error("seller pubkeyhash buffer must be 20 bytes (HASH160)");return e}return e instanceof qr.PublicKey?qr.crypto.Hash.sha256ripemd160(e.toBuffer()):TC(e).hashBuffer}function Cl(e,t){return Nl(t,"payment price"),new qr.Transaction.Output({script:Yo.buildPublicKeyHashOut(TC(e)),satoshis:t})}function W6(e){if(e instanceof qr.Transaction.Output)return e;if(h.Buffer.isBuffer(e))return qr.Transaction.Output.fromBufferReader(new PC(e));var t=e.payTo!=null?e.payTo:e.address,r=e.satoshis!=null?e.satoshis:e.price;if(t==null||r==null)throw new Error("payment spec needs {address|payTo, satoshis|price}");return Cl(t,r)}function Lne(e){if(e.payOutputs){if(!e.payOutputs.length)throw new Error("payOutputs must be a non-empty array");return e.payOutputs.map(W6)}if(e.payOutput!=null)return[W6(e.payOutput)];if(e.price!=null){var t=e.payTo!=null?e.payTo:e.seller,r=t instanceof qr.Transaction.Output?t:Cl(t,e.price),i=[r];return e.royalties&&e.royalties.forEach(function(n){i.push(W6(n))}),i}throw new Error("buildOrdLock requires a price, a payOutput, or payOutputs")}function qne(e){return h.Buffer.concat(e.map(Z6))}function t7(e){if(e=e||{},e.seller==null)throw new Error("buildOrdLock requires a seller");var t=Dne(e.seller),r=qne(Lne(e)),i=new Yo;if(i.add(Xt.OP_IF),i.add(Xt.OP_DUP).add(Xt.OP_HASH160),i.add(h.Buffer.from(t)).add(Xt.OP_EQUALVERIFY).add(Xt.OP_CHECKSIG),i.add(Xt.OP_ELSE),i.add(Xt.OP_DUP),Ml.pushTxCore(i,{sighashType:Y6}),i.add(Xt.OP_VERIFY),Ml.assertSighashType(i,Y6),Ml.extractHashOutputs(i),i.add(Xt.OP_TOALTSTACK),i.add(h.Buffer.from(r)).add(Xt.OP_CAT),i.add(Xt.OP_SWAP).add(Xt.OP_CAT),i.add(Xt.OP_HASH256),i.add(Xt.OP_FROMALTSTACK).add(Xt.OP_EQUAL),i.add(Xt.OP_ENDIF),e.inscription){var n=AC.buildInscription({lock:new Yo,contentType:e.inscription.contentType,content:e.inscription.content});n.chunks.forEach(function(o){i.chunks.push(o)})}return i}function Bl(e,t){return e&&e.opcodenum===t&&e.buf==null}function Une(e){for(var t=new PC(e),r=[];!t.eof();)r.push(qr.Transaction.Output.fromBufferReader(t));return r}function J6(e,t){var r=t&&t.network;try{for(var i=X6(e),n=i.chunks,o=0,a=-1,s=-1,u=-1,c=0;c<n.length;c++)if(Bl(n[c],Xt.OP_IF))o===0&&(a=c),o++;else if(Bl(n[c],Xt.OP_ELSE)&&o===1)s=c;else if(Bl(n[c],Xt.OP_ENDIF)&&(o--,o===0)){u=c;break}if(a===-1||s===-1||u===-1)return null;for(var l=null,m=a+1;m<s;m++)if(n[m].buf&&n[m].buf.length===20){l=n[m].buf;break}if(!l)return null;for(var w=null,E=s+1;E<u;E++)Bl(n[E],Xt.OP_TOALTSTACK)&&n[E+1]&&n[E+1].buf&&Bl(n[E+2],Xt.OP_CAT)&&Bl(n[E+3],Xt.OP_SWAP)&&(w=n[E+1].buf);if(!w)return null;var P=Une(w).map(function(U){var K=null;try{U.script.isPublicKeyHashOut()&&(K=U.script.toAddress(r).toString())}catch{}return{satoshis:U.satoshis,script:U.script,address:K}}),M=P.reduce(function(U,K){return U+K.satoshis},0),D=null,L=AC.parseInscription(i);return L&&(D={contentType:L.contentType,content:L.content,contentText:L.contentText}),{seller:{pubKeyHash:l,address:qr.Address.fromPublicKeyHash(l,r).toString()},payOutputs:P,payBlob:w,totalPrice:M,inscription:D}}catch{return null}}function Fne(e,t){return J6(e,t)!==null}function Hne(e){e=e||{};var t=e.satoshis!=null?e.satoshis:1;return new qr.Transaction.Output({script:t7(e),satoshis:t})}function kC(e){e=e||{};var t=e.spend,r=e.lockingScript;if(!t||!r)throw new Error("purchase requires { spend, lockingScript }");var i=e.inputIndex||0,n=e.payoutIndex!=null?e.payoutIndex:1,o=e.satoshis!=null?e.satoshis:1,a=t.outputs||[],s=e.parsed||J6(r),u=e.payoutCount!=null?e.payoutCount:s?s.payOutputs.length:1;if(n+u>a.length)throw new Error("purchase: spend has fewer outputs than the pinned block requires (need "+(n+u)+", have "+a.length+")");if(e.validate!==!1&&s){var c=h.Buffer.concat(a.slice(n,n+u).map(Z6));if(!c.equals(s.payBlob))throw new Error("purchase: outputs ["+n+".."+(n+u-1)+"] do not match the listing payment \u2014 the seller (or a royalty/fee payee) would not be paid")}var l=h.Buffer.concat(a.slice(0,n).map(Z6)),m=h.Buffer.concat(a.slice(n+u).map(Z6)),w=Object.assign({sighashType:Y6},e.grind||{}),E=Ml.grind(t,i,r,o,w),P=new Yo;return IC(P,m),IC(P,l),P.add(h.Buffer.from(E.preimage)),P.add(Xt.OP_FALSE),t.inputs[i].setScript(P),P}function jne(e){e=e||{};var t=e.privateKey,r=e.spend,i=e.lockingScript;if(!t||!r||!i)throw new Error("cancel requires { privateKey, spend, lockingScript }");var n=e.inputIndex||0,o=e.satoshis!=null?e.satoshis:1,a=e.sighashType!=null?e.sighashType:Q8.SIGHASH,s=Q8.signInput(r,t,n,i,o,a),u=new Yo;return u.add(h.Buffer.from(s)),u.add(t.toPublicKey().toBuffer()),u.add(Xt.OP_TRUE),r.inputs[n].setScript(u),u}function $6(e,t,r,i){e.addInput(new qr.Transaction.Input({prevTxId:t.txid||t.prevTxId,outputIndex:t.outputIndex!=null?t.outputIndex:t.vout,script:Yo.empty()}),X6(r),i)}function e7(e,t,r){Nl(r.satoshis,"input "+t+" satoshis");var i=X6(r.script),n=Q8.signInput(e,r.privateKey,t,i,r.satoshis,Ml.SIGHASH_ALL_FORKID),o=new Yo;o.add(h.Buffer.from(n)),o.add(r.privateKey.toPublicKey().toBuffer()),e.inputs[t].setScript(o)}function zne(e){e=e||{};var t=e.ordinal;if(!t||!t.script||!t.privateKey)throw new Error("buildListingTx requires ordinal { script, privateKey, txid, outputIndex }");var r=Nl(t.satoshis!=null?t.satoshis:1,"ordinal satoshis"),i=t7(e),n=e.funding||[],o=e.fee!=null?e.fee:500,a=n.reduce(function(c,l){return c+Nl(l.satoshis,"funding satoshis")},0),s=a-o;if(s<0)throw new Error("buildListingTx: insufficient funding \u2014 need "+o+" sat fee, funded "+a);var u=new qr.Transaction;return $6(u,t,t.script,r),n.forEach(function(c){$6(u,c,c.script,c.satoshis)}),u.addOutput(new qr.Transaction.Output({script:i,satoshis:r})),s>0&&u.addOutput(Cl(e.changeAddress||t.privateKey.toAddress(),s)),e7(u,0,{script:t.script,privateKey:t.privateKey,satoshis:r}),n.forEach(function(c,l){e7(u,1+l,c)}),{tx:u,listingScript:i,listingOutpoint:{txid:u.hash,outputIndex:0}}}function Kne(e){e=e||{};var t=e.listing;if(!t||!t.script)throw new Error("buildPurchaseTx requires listing.script");if(!e.ordinalDestination)throw new Error("buildPurchaseTx requires ordinalDestination");if(!e.funding||!e.funding.length)throw new Error("buildPurchaseTx requires funding coins");var r=X6(t.script),i=J6(r);if(!i)throw new Error("buildPurchaseTx: listing.script is not a parseable OrdLock");var n=Nl(t.satoshis!=null?t.satoshis:1,"listing satoshis"),o=e.payOutputs?e.payOutputs.map(W6):i.payOutputs.map(function(m){return new qr.Transaction.Output({script:m.script,satoshis:m.satoshis})}),a=o.reduce(function(m,w){return m+w.satoshis},0),s=e.fee!=null?e.fee:500,u=e.funding.reduce(function(m,w){return m+Nl(w.satoshis,"funding satoshis")},0),c=u-a-s;if(c<0)throw new Error("buildPurchaseTx: insufficient funding \u2014 need "+(a+s)+" sat (payments "+a+" + fee "+s+"), funded "+u);var l=new qr.Transaction;return $6(l,t,r,n),e.funding.forEach(function(m){$6(l,m,m.script,m.satoshis)}),l.addOutput(Cl(e.ordinalDestination,n)),o.forEach(function(m){l.addOutput(m)}),c>0&&l.addOutput(Cl(e.changeAddress||e.ordinalDestination,c)),kC({spend:l,lockingScript:r,parsed:i,satoshis:n,inputIndex:0,payoutIndex:1,payoutCount:o.length,grind:e.grind}),e.funding.forEach(function(m,w){e7(l,1+w,m)}),l}RC.exports={ORDLOCK_SIGHASH:Y6,buildOrdLock:t7,parseOrdLock:J6,isOrdLock:Fne,listInscriptionOutput:Hne,payOutputFor:Cl,purchase:kC,cancel:jne,buildListingTx:zne,buildPurchaseTx:Kne}});var zC=k((Wge,jC)=>{"use strict";v();var NC=G6(),CC="application/bsv-20",MC=18;function Vne(e){return typeof e=="string"&&/^\d+$/.test(e)}function Gne(e,t){if(typeof e=="number"){if(!Number.isInteger(e)||e<0)throw new Error(t+" must be a non-negative integer");return String(e)}if(Vne(e))return e.replace(/^0+(?=\d)/,"");throw new Error(t+" must be a non-negative integer (string or number)")}function A1(e,t){var r=Gne(e,t);if(!/[1-9]/.test(r))throw new Error(t+" must be greater than zero");return r}function r7(e){if(typeof e!="string"||!e.length)throw new Error("tick is required");if(h.Buffer.byteLength(e,"utf8")>4)throw new Error("tick must be 1\u20134 UTF-8 bytes");return e}function DC(e){var t=typeof e=="string"?Number(e):e;if(!Number.isInteger(t)||t<0||t>MC)throw new Error("dec must be an integer 0\u2026"+MC);return String(t)}function Zne(e){if(typeof e!="string"||!/^[0-9a-fA-F]{64}_\d+$/.test(e))throw new Error('id must be "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}function Q6(e,t){return t=t||{},NC.buildInscription({lock:t.lock,address:t.address,contentType:t.contentType||CC,content:JSON.stringify(e)})}function LC(e){e=e||{};var t={p:"bsv-20",op:"deploy",tick:r7(e.tick),max:A1(e.max,"max")};return e.lim!=null&&(t.lim=A1(e.lim,"lim")),e.dec!=null&&(t.dec=DC(e.dec)),Q6(t,e)}function qC(e){e=e||{};var t={p:"bsv-20",op:"mint",tick:r7(e.tick),amt:A1(e.amt,"amt")};return Q6(t,e)}function UC(e){e=e||{};var t={p:"bsv-20",op:"transfer",amt:A1(e.amt,"amt")};return e.id!=null?t.id=Zne(e.id):t.tick=r7(e.tick),Q6(t,e)}function FC(e){e=e||{};var t={p:"bsv-20",op:"deploy+mint",amt:A1(e.amt,"amt")};return e.dec!=null&&(t.dec=DC(e.dec)),e.sym!=null&&(t.sym=String(e.sym)),e.icon!=null&&(t.icon=String(e.icon)),Q6(t,e)}function e5(e,t){var r=Ae();return new r.Transaction.Output({script:e,satoshis:t??1})}function Wne(e){return e5(LC(e),e&&e.satoshis)}function Yne(e){return e5(qC(e),e&&e.satoshis)}function $ne(e){return e5(UC(e),e&&e.satoshis)}function Xne(e){return e5(FC(e),e&&e.satoshis)}function Jne(e){var t=Ae();if(e&&typeof e=="object"&&!h.Buffer.isBuffer(e)&&!(e instanceof t.Script)||typeof e=="string"&&e.trim()[0]==="{")return e;var r=NC.parseInscription(e);return r?r.contentText:null}function HC(e){try{var t=Jne(e);if(t==null)return null;var r=typeof t=="object"?t:JSON.parse(t);return!r||r.p!=="bsv-20"||typeof r.op!="string"?null:r}catch{return null}}function Qne(e){return HC(e)!==null}jC.exports={CONTENT_TYPE:CC,buildDeploy:LC,buildMint:qC,buildTransfer:UC,buildDeployMint:FC,createDeployOutput:Wne,createMintOutput:Yne,createTransferOutput:$ne,createDeployMintOutput:Xne,parseBsv20:HC,isBsv20:Qne}});var VC=k(($ge,KC)=>{"use strict";v();var P1=G6(),$o=BC(),eoe=zC();function toe(e){if(!Array.isArray(e)||!e.length)throw new Error("batchInscriptionOutputs requires a non-empty array of items");return e.map(function(t){return P1.createInscriptionOutput(t)})}KC.exports={buildInscription:P1.buildInscription,parseInscription:P1.parseInscription,isInscription:P1.isInscription,createInscriptionOutput:P1.createInscriptionOutput,batchInscriptionOutputs:toe,ORDLOCK_SIGHASH:$o.ORDLOCK_SIGHASH,buildOrdLock:$o.buildOrdLock,parseOrdLock:$o.parseOrdLock,isOrdLock:$o.isOrdLock,listInscriptionOutput:$o.listInscriptionOutput,payOutputFor:$o.payOutputFor,purchaseOrdLock:$o.purchase,cancelOrdLock:$o.cancel,buildListingTx:$o.buildListingTx,buildPurchaseTx:$o.buildPurchaseTx,BSV20:eoe}});var t5=k((Qge,ZC)=>{"use strict";v();var Ls=Ae(),i7=Ls.PublicKey,T1=Ls.PrivateKey,GC=Ls.crypto.Hash,En=Ls.util.preconditions,Jge=Ls.errors;function Ct(e){return this instanceof Ct?(this.options=e||{},this.network=this.options.network||"mainnet",this.registry=this.options.registry||null,this):new Ct(e)}Ct.fromPublicKey=function(e,t){t=t||{},typeof e=="string"&&(e=i7.fromString(e)),En.checkArgument(e instanceof i7,"Invalid public key");var r=e.toString("hex"),i=t.network||"mainnet",n=t.path||"",o="did:smartledger:"+r;return i!=="mainnet"&&(o+=":"+i),n&&(o+=":"+n),o};Ct.fromPrivateKey=function(e,t){return typeof e=="string"&&(e=T1.fromWIF(e)),En.checkArgument(e instanceof T1,"Invalid private key"),Ct.fromPublicKey(e.toPublicKey(),t)};Ct.parseDID=function(e){if(En.checkArgument(typeof e=="string","DID must be a string"),!e.startsWith("did:smartledger:"))throw new Error("Invalid SmartLedger DID format");var t=e.split(":");if(t.length<3)throw new Error("Invalid DID format");var r={method:"smartledger",identifier:t[2],network:"mainnet",path:""};return t.length>3&&t[3]!==""&&(r.network=t[3]),t.length>4&&(r.path=t.slice(4).join(":")),r};Ct.isValidDID=function(e){try{var t=Ct.parseDID(e);return!(!/^[0-9a-fA-F]{66}$/.test(t.identifier)&&!/^[0-9a-fA-F]{130}$/.test(t.identifier)||!["mainnet","testnet","regtest"].includes(t.network))}catch{return!1}};Ct.getPublicKey=function(e){var t=Ct.parseDID(e);return i7.fromString(t.identifier)};Ct.createDocument=function(e,t){t=t||{},En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.getPublicKey(e),i=e+"#keys-1",n={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/secp256k1-2019/v1"],id:e,verificationMethod:[{id:i,type:"EcdsaSecp256k1VerificationKey2019",controller:e,publicKeyHex:r.toString("hex")}],authentication:[i],assertionMethod:[i],keyAgreement:[i],capabilityInvocation:[i],capabilityDelegation:[i]};return t.services&&Array.isArray(t.services)&&(n.service=t.services),t.verificationMethods&&(n.verificationMethod=n.verificationMethod.concat(t.verificationMethods)),t.created&&(n.created=t.created),t.updated&&(n.updated=t.updated),n};Ct.resolve=async function(e,t){t=t||{};try{En.checkArgument(Ct.isValidDID(e),"Invalid DID");var r=Ct.createDocument(e,t);return{"@context":"https://w3id.org/did-resolution/v1",didDocument:r,didResolutionMetadata:{contentType:"application/did+ld+json",retrieved:new Date().toISOString()},didDocumentMetadata:{method:{published:!0,recoveryCommitment:null,updateCommitment:null}}}}catch(i){return{"@context":"https://w3id.org/did-resolution/v1",didDocument:null,didResolutionMetadata:{error:"notFound",errorMessage:i.message},didDocumentMetadata:{}}}};Ct.verifyOwnership=function(e,t,r){try{var i=Ct.getPublicKey(e),n=GC.sha256(h.Buffer.isBuffer(r)?r:h.Buffer.from(r,"utf8")),o=Ls.crypto.Signature.fromString(t),a=new Ls.crypto.ECDSA;return a.hashbuf=n,a.pubkey=i,a.sig=o,a.verify()===!0}catch{return!1}};Ct.signMessage=function(e,t){En.checkArgument(t instanceof T1,"Invalid private key");var r=GC.sha256(h.Buffer.isBuffer(e)?e:h.Buffer.from(e,"utf8")),i=new Ls.crypto.ECDSA;return i.hashbuf=r,i.privkey=t,i.pubkey=t.toPublicKey(),i.sign().toString()};Ct.createProofOfOwnership=function(e,t){En.checkArgument(e instanceof T1,"Invalid private key"),En.checkArgument(typeof t=="string","Challenge must be a string");var r=Ct.fromPrivateKey(e),i=new Date().toISOString(),n=t+":"+i+":"+r,o=Ct.signMessage(n,e);return{type:"EcdsaSecp256k1Signature2019",created:i,verificationMethod:r+"#keys-1",proofPurpose:"authentication",challenge:t,jws:o}};Ct.verifyProofOfOwnership=function(e,t){try{En.checkArgument(e&&typeof e=="object","Invalid proof object"),En.checkArgument(typeof t=="string","DID must be a string");var r=e.challenge+":"+e.created+":"+t;return Ct.verifyOwnership(t,e.jws,r)}catch{return!1}};Ct.createDIDURL=function(e,t){return En.checkArgument(typeof e=="string","DID must be a string"),En.checkArgument(typeof t=="string","Fragment must be a string"),e+"#"+t};Ct.generateTestDID=function(e){e=e||{};var t=new T1,r=Ct.fromPrivateKey(t,e),i=Ct.createDocument(r,e);return{did:r,privateKey:t.toWIF(),publicKey:t.toPublicKey().toString("hex"),document:i}};ZC.exports=Ct});var r5=k((ive,$C)=>{"use strict";v();var Dl=Ae(),roe=t5(),WC=Dl.PrivateKey,qs=Dl.crypto.Hash,YC=Dl.crypto.ECDSA,tve=Dl.crypto.Signature,Us=Dl.util.preconditions,rve=xt();function lr(e,t){return this instanceof lr?(typeof e=="string"&&(e=WC.fromWIF(e)),Us.checkArgument(e instanceof WC,"Invalid private key"),this.privateKey=e,this.publicKey=e.toPublicKey(),this.options=t||{},this.did=roe.fromPrivateKey(e,this.options),this):new lr(e,t)}lr._sortValue=function(e){return Array.isArray(e)?e.map(function(t){return lr._sortValue(t)}):e!==null&&typeof e=="object"?Object.keys(e).sort().reduce(function(t,r){return t[r]=lr._sortValue(e[r]),t},{}):e};lr._canonicalizeJSON=function(e){return JSON.stringify(lr._sortValue(e))};lr._hashCredential=function(e){var t=lr._canonicalizeJSON(e);return qs.sha256(h.Buffer.from(t,"utf8"))};lr.prototype.createCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid credential subject");var r=new Date().toISOString(),i=t.id||"urn:uuid:"+this._generateUUID(),n={"@context":["https://www.w3.org/2018/credentials/v1"],id:i,type:["VerifiableCredential"],issuer:this.did,issuanceDate:r,credentialSubject:e};return t.type&&(Array.isArray(t.type)?n.type=n.type.concat(t.type):n.type.push(t.type)),t.context&&(Array.isArray(t.context)?n["@context"]=n["@context"].concat(t.context):n["@context"].push(t.context)),t.expirationDate&&(n.expirationDate=t.expirationDate),t.termsOfUse&&(n.termsOfUse=t.termsOfUse),t.evidence&&(n.evidence=t.evidence),t.refreshService&&(n.refreshService=t.refreshService),n};lr.prototype.signCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid credential");var r=JSON.parse(JSON.stringify(e));delete r.proof;var i=lr._hashCredential(r),n=new YC;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:t.proofPurpose||"assertionMethod",jws:a};t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain);var u=JSON.parse(JSON.stringify(r));return u.proof=s,u.rootHash=i.toString("hex"),u};lr.prototype._createJWSSignature=function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o};lr.prototype.createEmailCredential=function(e,t){t=t||{},Us.checkArgument(typeof e=="string"&&e.includes("@"),"Invalid email address");var r={id:t.subjectId||"did:smartledger:"+qs.sha256(h.Buffer.from(e)).toString("hex"),email:e,verified:!0,verificationMethod:"email_verification",verificationTimestamp:new Date().toISOString()},i={type:"EmailVerifiedCredential",context:"https://smartledger.technology/contexts/email/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};lr.prototype.createAgeCredential=function(e,t,r){r=r||{},Us.checkArgument(typeof e=="number"&&e>0,"Invalid age");var i={id:r.subjectId||"urn:uuid:"+this._generateUUID(),ageOver:e,verified:!0,verificationMethod:"age_verification"};t&&(i.birthDateHash=qs.sha256(h.Buffer.from(t.toISOString())).toString("hex"));var n={type:"AgeVerifiedCredential",context:"https://smartledger.technology/contexts/age/v1",...r},o=this.createCredential(i,n);return this.signCredential(o,r)};lr.prototype.createKYCCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid KYC data");var r={id:t.subjectId||"urn:uuid:"+this._generateUUID(),kycLevel:e.level||"basic",verified:!0,verificationMethod:"kyc_verification",verificationTimestamp:new Date().toISOString(),verifyingAuthority:e.authority||this.did};e.firstName&&(r.firstNameHash=qs.sha256(h.Buffer.from(e.firstName)).toString("hex")),e.lastName&&(r.lastNameHash=qs.sha256(h.Buffer.from(e.lastName)).toString("hex")),e.ssn&&(r.ssnHash=qs.sha256(h.Buffer.from(e.ssn)).toString("hex"));var i={type:"KYCVerifiedCredential",context:"https://smartledger.technology/contexts/kyc/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};lr.prototype.createOrganizationCredential=function(e,t){t=t||{},Us.checkArgument(e&&typeof e=="object","Invalid organization data");var r={id:t.subjectId||"did:smartledger:org:"+qs.sha256(h.Buffer.from(e.name||"")).toString("hex"),name:e.name,type:e.type||"Organization",verified:!0,verificationMethod:"organization_verification",verificationTimestamp:new Date().toISOString()};e.taxId&&(r.taxIdHash=qs.sha256(h.Buffer.from(e.taxId)).toString("hex")),e.incorporationState&&(r.incorporationState=e.incorporationState),e.industry&&(r.industry=e.industry);var i={type:"OrganizationCredential",context:"https://smartledger.technology/contexts/organization/v1",...t},n=this.createCredential(r,i);return this.signCredential(n,t)};lr.prototype._generateUUID=function(){var e=Dl.crypto.Random.getRandomBuffer(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;var t=e.toString("hex");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")};lr.prototype.createPresentation=function(e,t){t=t||{},Us.checkArgument(Array.isArray(e),"Credentials must be an array");var r={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],id:t.id||"urn:uuid:"+this._generateUUID(),holder:this.did,verifiableCredential:e};t.context&&(Array.isArray(t.context)?r["@context"]=r["@context"].concat(t.context):r["@context"].push(t.context));var i=lr._hashCredential(r),n=new YC;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:"authentication",jws:a};return t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain),r.proof=s,r};lr.prototype.getIssuerInfo=function(){return{did:this.did,publicKey:this.publicKey.toString("hex"),verificationMethod:this.did+"#keys-1"}};$C.exports=lr});var eD=k((sve,QC)=>{"use strict";v();var k1=Ae(),i5=t5(),n7=r5(),ove=k1.PublicKey,ave=k1.crypto.Hash,XC=k1.crypto.ECDSA,ioe=k1.crypto.Signature,JC=k1.util.preconditions;function Mt(e){return this instanceof Mt?(this.options=e||{},this.trustedIssuers=this.options.trustedIssuers||[],this):new Mt(e)}Mt.verifyCredential=async function(e,t){t=t||{};try{JC.checkArgument(e&&typeof e=="object","Invalid credential");var r={valid:!1,errors:[],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}},i=Mt._validateStructure(e);r.checks.structure=i.valid,i.valid||(r.errors=r.errors.concat(i.errors));var n=await Mt._verifySignature(e);r.checks.signature=n.valid,n.valid?(r.issuerDID=n.issuerDID,r.verificationMethod=n.verificationMethod):r.errors=r.errors.concat(n.errors);var o=await Mt._validateIssuer(e,t);r.checks.issuer=o.valid,o.valid||(r.errors=r.errors.concat(o.errors)),o.warnings&&(r.warnings=r.warnings.concat(o.warnings));var a=Mt._validateTemporal(e);if(r.checks.temporal=a.valid,a.valid||(r.errors=r.errors.concat(a.errors)),a.warnings&&(r.warnings=r.warnings.concat(a.warnings)),t.schema){var s=Mt._validateSchema(e,t.schema);r.checks.schema=s.valid,s.valid||(r.errors=r.errors.concat(s.errors))}else r.checks.schema=!0;return r.valid=Object.values(r.checks).every(u=>u===!0),r}catch(u){return{valid:!1,errors:["Verification failed: "+u.message],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}}}};Mt.verifyPresentation=async function(e,t){t=t||{};try{JC.checkArgument(e&&typeof e=="object","Invalid presentation");var r={valid:!1,errors:[],warnings:[],credentialResults:[],presentationValid:!1};if(!e.type||!e.type.includes("VerifiablePresentation"))return r.errors.push("Invalid presentation type"),r;if(!e.holder)return r.errors.push("Missing presentation holder"),r;var i=await Mt._verifyPresentationSignature(e);if(r.presentationValid=i.valid,i.valid||(r.errors=r.errors.concat(i.errors)),e.verifiableCredential&&Array.isArray(e.verifiableCredential))for(var n=0;n<e.verifiableCredential.length;n++){var o=e.verifiableCredential[n],a=await Mt.verifyCredential(o,t);r.credentialResults.push({index:n,result:a}),a.valid||r.errors.push("Credential "+n+" is invalid")}var s=r.credentialResults.every(u=>u.result.valid);return r.valid=r.presentationValid&&s,r}catch(u){return{valid:!1,errors:["Presentation verification failed: "+u.message],warnings:[],credentialResults:[],presentationValid:!1}}};Mt._validateStructure=function(e){var t=[];return e["@context"]?Array.isArray(e["@context"])?e["@context"].includes("https://www.w3.org/2018/credentials/v1")||t.push("Missing required W3C credentials context"):t.push("@context must be an array"):t.push("Missing @context"),e.type?Array.isArray(e.type)?e.type.includes("VerifiableCredential")||t.push("Must include VerifiableCredential type"):t.push("type must be an array"):t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof"),{valid:t.length===0,errors:t}};Mt._normalizeDID=function(e){var t=e&&typeof e=="object"?e.id:e;return typeof t!="string"||t.length===0?null:t.split("#")[0]};Mt._verifySignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing proof"]};if(t.type!=="EcdsaSecp256k1Signature2019")return{valid:!1,errors:["Unsupported proof type: "+t.type]};if(!t.verificationMethod)return{valid:!1,errors:["Missing verification method"]};if(!t.jws)return{valid:!1,errors:["Missing JWS signature"]};var r=t.verificationMethod,i=r.split("#")[0],n=Mt._normalizeDID(e.issuer);if(!n)return{valid:!1,errors:["Missing or invalid credential issuer"]};if(n!==i)return{valid:!1,errors:["Verification method DID ("+i+") does not match credential issuer ("+n+")"]};var o=i5.getPublicKey(i),a=JSON.parse(JSON.stringify(e));delete a.proof,delete a.rootHash;var s=n7._hashCredential(a),u=Mt._parseJWSSignature(t.jws),c=new XC;c.hashbuf=s,c.pubkey=o,c.sig=u;var l=c.verify();return l?{valid:!0,issuerDID:i,verificationMethod:r}:{valid:!1,errors:["Signature verification failed"]}}catch(m){return{valid:!1,errors:["Signature verification error: "+m.message]}}};Mt._parseJWSSignature=function(e){var t=e.split(".");if(t.length!==3)throw new Error("Invalid JWS format");var r=t[2],i=h.Buffer.from(r,"base64url");return ioe.fromDER(i)};Mt._verifyPresentationSignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing presentation proof"]};var r=e.holder,i=i5.getPublicKey(r),n=JSON.parse(JSON.stringify(e));delete n.proof;var o=n7._hashCredential(n),a=Mt._parseJWSSignature(t.jws),s=new XC;s.hashbuf=o,s.pubkey=i,s.sig=a;var u=s.verify();return{valid:u,errors:u?[]:["Presentation signature verification failed"]}}catch(c){return{valid:!1,errors:["Presentation signature error: "+c.message]}}};Mt._validateIssuer=async function(e,t){var r=[],i=[];try{var n=e.issuer;if(!i5.isValidDID(n))return r.push("Invalid issuer DID format"),{valid:!1,errors:r};var o=await i5.resolve(n);if(!o.didDocument)return r.push("Unable to resolve issuer DID"),{valid:!1,errors:r};if(t.trustedIssuers&&Array.isArray(t.trustedIssuers)){var a=Mt._normalizeDID(n),s=t.trustedIssuers.map(function(u){return Mt._normalizeDID(u)}).filter(Boolean);if(!a||s.indexOf(a)===-1)return r.push("Issuer not in trusted list"),{valid:!1,errors:r,warnings:i}}return{valid:r.length===0,errors:r,warnings:i}}catch(u){return{valid:!1,errors:["Issuer validation error: "+u.message],warnings:i}}};Mt._validateTemporal=function(e){var t=[],r=[],i=new Date;if(e.issuanceDate){var n=new Date(e.issuanceDate);isNaN(n.getTime())?t.push("Invalid issuanceDate format"):n>i&&t.push("Credential issued in the future")}if(e.expirationDate){var o=new Date(e.expirationDate);isNaN(o.getTime())?t.push("Invalid expirationDate format"):o<=i?t.push("Credential has expired"):o<=new Date(i.getTime()+1440*60*1e3)&&r.push("Credential expires within 24 hours")}return{valid:t.length===0,errors:t,warnings:r}};Mt._validateSchema=function(e,t){var r=[];if(t.requiredFields&&t.requiredFields.forEach(function(n){Mt._getNestedProperty(e,n)||r.push("Missing required field: "+n)}),t.requiredTypes){var i=t.requiredTypes.some(function(n){return e.type&&e.type.includes(n)});i||r.push("Missing required credential type")}return{valid:r.length===0,errors:r}};Mt._getNestedProperty=function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)};Mt.verifyCredentialHash=function(e){try{if(!e.rootHash)return!1;var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.rootHash;var r=n7._hashCredential(t),i=h.Buffer.from(e.rootHash,"hex");return h.Buffer.compare(r,i)===0}catch{return!1}};Mt.extractClaims=function(e){try{var t={issuer:e.issuer,subject:e.credentialSubject.id||"unknown",types:e.type||[],issuanceDate:e.issuanceDate,expirationDate:e.expirationDate,claims:{}};return Object.keys(e.credentialSubject).forEach(function(r){r!=="id"&&(t.claims[r]=e.credentialSubject[r])}),t}catch{return null}};Mt.createReport=function(e){var t=[];return t.push("=== Credential Verification Report ==="),t.push("Overall Status: "+(e.valid?"VALID":"INVALID")),t.push(""),t.push("Verification Checks:"),Object.keys(e.checks).forEach(function(r){var i=e.checks[r]?"\u2713":"\u2717";t.push(" "+i+" "+r.charAt(0).toUpperCase()+r.slice(1))}),t.push(""),e.errors.length>0&&(t.push("Errors:"),e.errors.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.warnings.length>0&&(t.push("Warnings:"),e.warnings.forEach(function(r){t.push(" \u2022 "+r)}),t.push("")),e.issuerDID&&t.push("Issuer: "+e.issuerDID),e.verificationMethod&&t.push("Verification Method: "+e.verificationMethod),t.join(`
|
|
99
|
+
`)};QC.exports=Mt});var rD=k((cve,tD)=>{"use strict";v();var If=Ae(),noe=r5(),so=If.crypto.Hash,fve=If.crypto.BN,oi=If.util.preconditions;function rr(e){return this instanceof rr?(this.options=e||{},this):new rr(e)}rr.createMerkleTree=function(e,t){t=t||If.crypto.Random.getRandomBuffer(32).toString("hex"),oi.checkArgument(e&&typeof e=="object","Invalid credential");var r=rr._extractFields(e),i=r.map(function(o){var a=o.path+":"+JSON.stringify(o.value)+":"+t;return{path:o.path,value:o.value,hash:so.sha256(h.Buffer.from(a,"utf8")).toString("hex"),salt:t}}),n=rr._buildMerkleTree(i.map(o=>o.hash));return{salt:t,leaves:i,tree:n,root:n[n.length-1][0]}};rr.generateSelectiveProof=function(e,t,r){oi.checkArgument(e&&typeof e=="object","Invalid credential"),typeof t=="string"&&(t=[t]),oi.checkArgument(Array.isArray(t),"Disclose paths must be array");var i=rr.createMerkleTree(e,r),n=[],o=[];return t.forEach(function(a){var s=i.leaves.find(l=>l.path===a);if(s){n.push(s);var u=i.leaves.findIndex(l=>l.path===a),c=rr._generateMerkleProof(i.tree,u);o.push({path:a,leafIndex:u,proof:c})}}),{type:"SelectiveDisclosureProof",created:new Date().toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,credentialRoot:i.root,credentialHash:e.rootHash||noe._hashCredential(e).toString("hex"),disclosedFields:n.map(function(a){return{path:a.path,value:a.value,hash:a.hash}}),merkleProofs:o,salt:r}};rr.verifySelectiveProof=function(e,t){try{oi.checkArgument(e&&typeof e=="object","Invalid proof"),oi.checkArgument(typeof t=="string","Expected root must be string");for(var r={valid:!1,errors:[],verifiedFields:[]},i=0;i<e.disclosedFields.length;i++){var n=e.disclosedFields[i],o=e.merkleProofs.find(c=>c.path===n.path);if(!o){r.errors.push("Missing Merkle proof for field: "+n.path);continue}var a=n.path+":"+JSON.stringify(n.value)+":"+e.salt,s=so.sha256(h.Buffer.from(a,"utf8")).toString("hex");if(s!==n.hash){r.errors.push("Field hash mismatch for: "+n.path);continue}var u=rr._verifyMerkleProof(n.hash,o.proof,t);if(!u){r.errors.push("Invalid Merkle proof for: "+n.path);continue}r.verifiedFields.push({path:n.path,value:n.value,verified:!0})}return r.valid=r.errors.length===0&&r.verifiedFields.length>0,r}catch(c){return{valid:!1,errors:["Proof verification failed: "+c.message],verifiedFields:[]}}};rr.generateAgeProof=function(e,t,r){oi.checkArgument(e instanceof Date,"Birth date must be Date object"),oi.checkArgument(typeof t=="number","Minimum age must be number"),r=r||If.crypto.Random.getRandomBuffer(32).toString("hex");var i=new Date,n=Math.floor((i-e)/(365.25*24*60*60*1e3));if(n<t)throw new Error("Age requirement not met");var o=e.toISOString().split("T")[0],a=so.sha256(h.Buffer.from(o+":"+r,"utf8")).toString("hex"),s={minimumAge:t,ageAttestation:n>=t,timestamp:i.toISOString(),salt:r},u=so.sha256(h.Buffer.from(JSON.stringify(s),"utf8")).toString("hex");return{type:"AgeProof",created:new Date().toISOString(),proofPurpose:"ageVerification",minimumAge:t,meetsRequirement:!0,birthDateCommitment:a,ageProofHash:u,challengeResponse:rr._generateAgeChallenge(e,t,r)}};rr.verifyAgeProof=function(e,t){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),oi.checkArgument(typeof t=="number","Required age must be number"),e.type!=="AgeProof"||e.minimumAge!==t||!e.meetsRequirement?!1:e.challengeResponse&&e.challengeResponse.length>0}catch{return!1}};rr.generateRangeProof=function(e,t,r,i){oi.checkArgument(typeof e=="number","Value must be number"),oi.checkArgument(typeof t=="number","Min must be number"),oi.checkArgument(typeof r=="number","Max must be number"),oi.checkArgument(e>=t&&e<=r,"Value not in range"),i=i||If.crypto.Random.getRandomBuffer(32).toString("hex");var n=so.sha256(h.Buffer.from(e.toString()+":"+i,"utf8")).toString("hex"),o={min:t,max:r,inRange:!0,timestamp:new Date().toISOString(),salt:i},a=so.sha256(h.Buffer.from(JSON.stringify(o),"utf8")).toString("hex");return{type:"RangeProof",created:new Date().toISOString(),proofPurpose:"rangeVerification",range:{min:t,max:r},valueCommitment:n,proofHash:a,inRange:!0}};rr.verifyRangeProof=function(e,t,r){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),e.type!=="RangeProof"||e.range.min!==t||e.range.max!==r?!1:e.inRange===!0}catch{return!1}};rr._extractFields=function(e,t){t=t||"";var r=[];return Object.keys(e).forEach(function(i){var n=t?t+"."+i:i,o=e[i];o&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)?r=r.concat(rr._extractFields(o,n)):r.push({path:n,value:o})}),r};rr._buildMerkleTree=function(e){if(e.length===0)throw new Error("Cannot build tree from empty leaves");for(var t=[e];t[t.length-1].length>1;){for(var r=t[t.length-1],i=[],n=0;n<r.length;n+=2){var o=r[n],a=n+1<r.length?r[n+1]:o,s=o+a,u=so.sha256(h.Buffer.from(s,"hex")).toString("hex");i.push(u)}t.push(i)}return t};rr._generateMerkleProof=function(e,t){for(var r=[],i=t,n=0;n<e.length-1;n++){var o=e[n],a=i%2===0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r};rr._verifyMerkleProof=function(e,t,r){for(var i=e,n=0;n<t.length;n++){var o=t[n],a=o.isLeft?o.hash+i:i+o.hash;i=so.sha256(h.Buffer.from(a,"hex")).toString("hex")}return i===r};rr._generateAgeChallenge=function(e,t,r){var i=so.sha256(h.Buffer.from(e.toISOString()+t+r,"utf8"));return i.toString("hex")};rr.generateMembershipProof=function(e,t,r){oi.checkArgument(Array.isArray(e),"Set must be array"),oi.checkArgument(e.includes(t),"Value not in set"),r=r||If.crypto.Random.getRandomBuffer(32).toString("hex");var i=e.map(function(o){return so.sha256(h.Buffer.from(JSON.stringify(o)+":"+r,"utf8")).toString("hex")}),n=so.sha256(h.Buffer.from(JSON.stringify(t)+":"+r,"utf8")).toString("hex");return{type:"MembershipProof",created:new Date().toISOString(),proofPurpose:"membershipVerification",setCommitments:i,valueCommitment:n,isMember:!0}};rr.verifyMembershipProof=function(e){try{return oi.checkArgument(e&&typeof e=="object","Invalid proof"),e.type!=="MembershipProof"||!Array.isArray(e.setCommitments)?!1:e.setCommitments.includes(e.valueCommitment)&&e.isMember}catch{return!1}};tD.exports=rr});var oD=k((dve,nD)=>{"use strict";v();var Af=Ae(),o7=Af.Transaction,ooe=Af.Script,a7=Af.PrivateKey,hve=Af.Address,R1=Af.crypto.Hash,iD=Af.SPV,Fs=Af.util.preconditions;function Tr(e,t){return this instanceof Tr?(typeof e=="string"&&(e=a7.fromWIF(e)),e!==null?(Fs.checkArgument(e instanceof a7,"Invalid private key"),this.privateKey=e,this.address=e.toAddress()):(this.privateKey=null,this.address=null),this.options=t||{},this.network=this.options.network||"mainnet",this.PROTOCOL_ID="SMARTLEDGER.ATTEST",this.VERSION=1,this):new Tr(e,t)}Tr.prototype.anchorCredential=async function(e,t,r){t=t||{},typeof e=="string"&&(e=h.Buffer.from(e,"hex")),Fs.checkArgument(h.Buffer.isBuffer(e),"Invalid credential hash"),Fs.checkArgument(e.length===32,"Hash must be 32 bytes");var i=this._createAnchorPayload("CREDENTIAL",e,t),n=await this._createAnchorTransaction(i,r);return{txid:n.hash,transaction:n,anchorHash:e.toString("hex"),metadata:t,timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"CREDENTIAL"}}};Tr.prototype.anchorBatch=async function(e,t,r){t=t||{},Fs.checkArgument(Array.isArray(e),"Credential hashes must be array"),Fs.checkArgument(e.length>0,"Must provide at least one hash");var i=this._createMerkleRoot(e),n=this._createAnchorPayload("BATCH",i,{...t,batchSize:e.length,merkleRoot:i.toString("hex")}),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,merkleRoot:i.toString("hex"),batchSize:e.length,credentialHashes:e.map(a=>h.Buffer.isBuffer(a)?a.toString("hex"):a),metadata:t,timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"BATCH"}}};Tr.prototype.registerDID=async function(e,t,r){Fs.checkArgument(typeof e=="string","DID must be string"),Fs.checkArgument(t&&typeof t=="object","Invalid DID document");var i=R1.sha256(h.Buffer.from(JSON.stringify(t),"utf8")),n=this._createAnchorPayload("DID_REG",i,{did:e,operation:"create",documentHash:i.toString("hex")}),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,did:e,documentHash:i.toString("hex"),timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"DID_REG"}}};Tr.prototype.revokeCredential=async function(e,t,r){Fs.checkArgument(typeof e=="string","Credential ID must be string"),t=t||"unspecified";var i={credentialId:e,reason:t,timestamp:new Date().toISOString(),issuer:this.address.toString()},n=R1.sha256(h.Buffer.from(JSON.stringify(i),"utf8")),o=this._createAnchorPayload("REVOKE",n,{credentialId:e,reason:t}),a=await this._createAnchorTransaction(o,r);return{txid:a.hash,transaction:a,credentialId:e,reason:t,revocationHash:n.toString("hex"),timestamp:new Date().toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"REVOKE"}}};Tr.prototype._createAnchorPayload=function(e,t,r){var i=Math.floor(Date.now()/1e3),n=h.Buffer.concat([h.Buffer.from(this.PROTOCOL_ID,"utf8"),h.Buffer.from([this.VERSION]),h.Buffer.from(e.padEnd(10,"\0"),"utf8"),h.Buffer.from([i>>24,i>>16,i>>8,i]),t,h.Buffer.from(JSON.stringify(r),"utf8")]);return n};Tr.prototype._createAnchorTransaction=async function(e,t){if(!t||t.length===0)throw new Error("UTXOs required for anchor transaction");var r=200+e.length,i=this.options.feeRate||1,n=r*i,o=t.reduce((c,l)=>c+l.satoshis,0);if(o<n)throw new Error("Insufficient funds for anchor transaction");var a=new o7;t.forEach(c=>{a.from(c)});var s=ooe.buildDataOut(e);a.addOutput(new o7.Output({script:s,satoshis:0}));var u=o-n;return u>546&&a.to(this.address,u),a.sign(this.privateKey),a};Tr.prototype._createMerkleRoot=function(e){if(e.length===0)throw new Error("Cannot create Merkle root from empty array");for(var t=e.map(u=>h.Buffer.isBuffer(u)?u:h.Buffer.from(u,"hex"));t.length>1;){for(var r=[],i=0;i<t.length;i+=2){var n=t[i],o=i+1<t.length?t[i+1]:n,a=h.Buffer.concat([n,o]),s=R1.sha256(a);r.push(s)}t=r}return t[0]};Tr.parseAnchorData=function(e){if(!h.Buffer.isBuffer(e))throw new Error("Data must be Buffer");if(e.length<50)throw new Error("Data too short for SmartLedger anchor");var t=0,r=18,i=e.slice(t,t+r).toString("utf8");if(t+=r,i!=="SMARTLEDGER.ATTEST")throw new Error("Invalid protocol identifier");var n=e[t];t+=1;var o=e.slice(t,t+10).toString("utf8").replace(/\0/g,"");t+=10;var a=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];t+=4;var s=e.slice(t,t+32);t+=32;var u=e.slice(t),c={};try{c=JSON.parse(u.toString("utf8"))}catch{}return{protocol:i,version:n,type:o,timestamp:new Date(a*1e3),hash:s.toString("hex"),metadata:c}};Tr.verifyAnchor=async function(e,t,r){if(r=r||{},!e||!t)throw new Error("verifyAnchor requires both txid and expectedHash");if(r.spvProof&&(r.header||r.headerChain)&&r.rawTx)return Tr._verifyAnchorSPV(e,t,r);if(typeof r.chainProvider!="function")throw new Error("verifyAnchor needs either a trustless SPV proof \u2014 { spvProof: { index, nodes }, header, rawTx } \u2014 or a trusted options.chainProvider(txid) returning { confirmations, blockHeight, opReturns }. Refusing to fabricate a result.");var i=r.minConfirmations!=null?r.minConfirmations:1,n=await r.chainProvider(e),o=n&&n.confirmations||0,a=n&&n.opReturns||[],s=String(t).toLowerCase(),u=a.some(function(l){return String(l).toLowerCase().indexOf(s)!==-1}),c=o>=i&&u;return{verified:c,txid:e,hash:t,committed:u,confirmations:o,blockHeight:n&&n.blockHeight||null,timestamp:new Date().toISOString(),proof:{type:"blockchain_anchor",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}};Tr._verifyAnchorSPV=function(e,t,r){var i=r.spvProof||{},n=null,o=r.header;r.headerChain&&(n=iD.verifyHeaderChain(r.headerChain,{requirePow:r.requirePow!==!1,trustedHash:r.trustedHash}),o=r.headerChain[0]);var a=iD.verifyTxInclusion({txid:e,index:i.index,nodes:i.nodes,header:o,requirePow:r.requirePow!==!1}),s=h.Buffer.isBuffer(r.rawTx)?r.rawTx:h.Buffer.from(r.rawTx,"hex"),u=h.Buffer.from(R1.sha256sha256(s)).reverse().toString("hex"),c=u.toLowerCase()===String(e).toLowerCase(),l=c&&Tr._rawTxCommitsTo(s,t),m=n?n.count:r.header?1:0,w=r.minConfirmations!=null?r.minConfirmations:1,E=n?n.valid:!0,P=m>=w;return{verified:a.valid&&c&&l&&E&&P,chainVerified:a.valid,committed:l,txidBound:c,powValid:a.powValid,confirmations:m,headerChainValid:n?n.valid:null,headerChainReason:n&&n.reason||null,tipHash:n?n.tipHash:null,txid:e,hash:t,blockHash:a.blockHash,merkleRoot:a.merkleRoot,timestamp:new Date().toISOString(),proof:{type:n?"spv_merkle_inclusion_with_confirmations":"spv_merkle_inclusion",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}};Tr._rawTxCommitsTo=function(e,t){var r=String(t).toLowerCase(),i;try{i=new o7(e)}catch{return!1}return i.outputs.some(function(n){var o=n.script;if(!o||!o.chunks||!o.chunks.length)return!1;var a=o.chunks[0].opcodenum===106||o.chunks[0].opcodenum===0&&o.chunks[1]&&o.chunks[1].opcodenum===106;return a?o.chunks.some(function(s){return s.buf&&s.buf.toString("hex").toLowerCase().indexOf(r)!==-1}):!1})};Tr.getCostEstimate=function(e,t){t=t||{};var r=t.feeRate||1,i=200,n=32,o=e*(i+n)*r,a=(i+e*n)*r;return{individual:{totalCost:o,costPerHash:i*r,transactions:e},batch:{totalCost:a,costPerHash:Math.ceil(a/e),transactions:1},savings:{absolute:o-a,percentage:Math.round((o-a)/o*100)}}};Tr.createUTXO=function(e,t,r,i){return{txid:e,outputIndex:t,satoshis:r,script:i}};Tr.generateTestData=function(){var e=new a7,t=new Tr(e),r=R1.sha256(h.Buffer.from("test credential data")),i={issuer:"did:smartledger:test",type:"EmailVerifiedCredential",environment:"test"};return{privateKey:e.toWIF(),address:e.toAddress().toString(),credentialHash:r.toString("hex"),metadata:i,anchor:t}};nD.exports=Tr});var sD=k((gve,aD)=>{"use strict";v();var s7=Bt(),B1={EmailVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/email/v1"],type:["VerifiableCredential","EmailVerifiedCredential"],requiredFields:["credentialSubject.email","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["email","verified"],properties:{email:{type:"string",format:"email"},verified:{type:"boolean"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},AgeVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/age/v1"],type:["VerifiableCredential","AgeVerifiedCredential"],requiredFields:["credentialSubject.ageOver","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["ageOver","verified"],properties:{ageOver:{type:"number",minimum:0,maximum:150},verified:{type:"boolean"},birthDateHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verificationMethod:{type:"string"}}}}},KYCVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/kyc/v1"],type:["VerifiableCredential","KYCVerifiedCredential"],requiredFields:["credentialSubject.kycLevel","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["kycLevel","verified","verifyingAuthority"],properties:{kycLevel:{type:"string",enum:["basic","enhanced","premium","institutional"]},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},firstNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},lastNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"}}}}},OrganizationCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/organization/v1"],type:["VerifiableCredential","OrganizationCredential"],requiredFields:["credentialSubject.name","credentialSubject.type","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["name","type","verified"],properties:{name:{type:"string"},type:{type:"string",enum:["Corporation","LLC","Partnership","NGO","Government","Other"]},verified:{type:"boolean"},taxIdHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},incorporationState:{type:"string"},industry:{type:"string"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},SSNVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ssn/v1"],type:["VerifiableCredential","SSNVerifiedCredential"],requiredFields:["credentialSubject.ssnHash","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["ssnHash","verified","verifyingAuthority"],properties:{ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},issuingState:{type:"string"}}}}},EducationalCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/education/v1"],type:["VerifiableCredential","EducationalCredential"],requiredFields:["credentialSubject.degree","credentialSubject.institution","credentialSubject.graduationDate"],properties:{credentialSubject:{type:"object",required:["degree","institution","graduationDate"],properties:{degree:{type:"string"},institution:{type:"string"},graduationDate:{type:"string",format:"date"},gpa:{type:"number",minimum:0,maximum:4},major:{type:"string"},honors:{type:"array",items:{type:"string"}}}}}},ProfessionalLicenseCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/license/v1"],type:["VerifiableCredential","ProfessionalLicenseCredential"],requiredFields:["credentialSubject.licenseType","credentialSubject.licenseNumber","credentialSubject.issuingAuthority","credentialSubject.isValid"],properties:{credentialSubject:{type:"object",required:["licenseType","licenseNumber","issuingAuthority","isValid"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},issuingState:{type:"string"},isValid:{type:"boolean"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"}}}}}},aoe={getSchema:function(e){return B1[e]||null},getAllSchemas:function(){return B1},validate:function(e,t){try{s7.checkArgument(e&&typeof e=="object","Invalid credential");var r;if(typeof t=="string"){if(r=B1[t],!r)return{valid:!1,errors:["Unknown schema type: "+t]}}else if(typeof t=="object")r=t;else return{valid:!1,errors:["Invalid schema parameter"]};var i=[],n=[];return this._validateCredentialStructure(e,i),this._validateCredentialTypes(e,r,i),this._validateRequiredFields(e,r,i),this._validateFieldProperties(e,r,i,n),{valid:i.length===0,errors:i,warnings:n}}catch(o){return{valid:!1,errors:["Schema validation error: "+o.message]}}},_validateCredentialStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.type||t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject")},_validateCredentialTypes:function(e,t,r){if(!Array.isArray(e.type)){r.push("Credential type must be array");return}if(t.type&&Array.isArray(t.type))for(var i=0;i<t.type.length;i++)e.type.includes(t.type[i])||r.push("Missing required type: "+t.type[i])},_validateRequiredFields:function(e,t,r){if(t.requiredFields&&Array.isArray(t.requiredFields))for(var i=0;i<t.requiredFields.length;i++){var n=t.requiredFields[i],o=this._getNestedProperty(e,n);o==null&&r.push("Missing required field: "+n)}},_validateFieldProperties:function(e,t,r,i){t.properties&&t.properties.credentialSubject&&this._validateObjectProperties(e.credentialSubject,t.properties.credentialSubject,"credentialSubject",r,i)},_validateObjectProperties:function(e,t,r,i,n){!e||typeof e!="object"||t.properties&&Object.keys(t.properties).forEach(function(o){var a=e[o],s=t.properties[o],u=r+"."+o;a!=null&&this._validateProperty(a,s,u,i,n)}.bind(this))},_validateProperty:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type){i.push("Invalid type for "+r+": expected "+t.type+", got "+o);return}}if(t.type==="string"&&(t.format==="email"&&!this._isValidEmail(e)&&i.push("Invalid email format for "+r),t.format==="date"&&!this._isValidDate(e)&&i.push("Invalid date format for "+r),t.format==="date-time"&&!this._isValidDateTime(e)&&i.push("Invalid date-time format for "+r),t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e)),t.type==="number"&&(t.minimum!==void 0&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),t.maximum!==void 0&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum)),t.type==="array"&&t.items)for(var a=0;a<e.length;a++)this._validateProperty(e[a],t.items,r+"["+a+"]",i,n)},_getNestedProperty:function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)},_isValidEmail:function(e){var t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return t.test(e)},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())},addSchema:function(e,t){s7.checkArgument(typeof e=="string","Schema name must be string"),s7.checkArgument(t&&typeof t=="object","Invalid schema definition"),B1[e]=t},createTemplate:function(e){var t=B1[e];if(!t)throw new Error("Unknown credential type: "+e);var r={"@context":t["@context"]||["https://www.w3.org/2018/credentials/v1"],type:t.type||["VerifiableCredential"],issuer:"did:smartledger:ISSUER_DID_HERE",issuanceDate:new Date().toISOString(),credentialSubject:this._createSubjectTemplate(t.properties?t.properties.credentialSubject:{})};return r},_createSubjectTemplate:function(e){var t={id:"SUBJECT_ID_HERE"};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t},_getDefaultValue:function(e){switch(e.type){case"string":return e.enum?e.enum[0]:e.format==="email"?"example@example.com":e.format==="date"?"2023-01-01":e.format==="date-time"?new Date().toISOString():"PLACEHOLDER_STRING";case"number":return e.minimum||0;case"boolean":return!0;case"array":return[];case"object":return{};default:return null}}};aD.exports=aoe});var fD=k((mve,uD)=>{"use strict";v();var soe=t5(),Ll=r5(),uoe=eD(),foe=rD(),M1=oD(),coe=sD();function pt(e){if(!(this instanceof pt))return new pt(e);e=e||{},this.didResolver=soe,this.attestationVerifier=uoe,this.zkProver=foe,this.schemaValidator=coe,this._attestationSignerOptions=e.attestationSigner||{},this._anchorOptions=e.anchor||{}}pt.prototype.createDID=function(e){return this.didResolver.fromPublicKey(e)};pt.prototype.resolveDID=function(e){return this.didResolver.resolve(e)};pt.prototype.verifyDIDOwnership=function(e,t){return this.didResolver.verifyOwnership(e,t)};pt.prototype.createEmailCredential=function(e,t,r,i){var n=new Ll(i,this._attestationSignerOptions);return n.createEmailCredential(r,{issuerDID:e,subjectId:t})};pt.prototype.createAgeCredential=function(e,t,r,i,n){var o=new Ll(n,this._attestationSignerOptions);return o.createAgeCredential(r,i,{issuerDID:e,subjectId:t})};pt.prototype.createKYCCredential=function(e,t,r,i,n){var o=new Ll(n,this._attestationSignerOptions),a=Object.assign({level:r},i);return o.createKYCCredential(a,{issuerDID:e,subjectId:t})};pt.prototype.createOrganizationCredential=function(e,t,r,i){var n=new Ll(i,this._attestationSignerOptions);return n.createOrganizationCredential(r,{issuerDID:e,subjectId:t})};pt.prototype.createPresentation=function(e,t,r,i){var n=new Ll(r,this._attestationSignerOptions);return n.createPresentation(e,t,r,i)};pt.prototype.signCredential=function(e,t){var r=new Ll(t,this._attestationSignerOptions);return r.signCredential(e,t)};pt.prototype.verifyCredential=function(e,t){return this.attestationVerifier.verifyCredential(e,t)};pt.prototype.verifyPresentation=function(e,t){return this.attestationVerifier.verifyPresentation(e,t)};pt.prototype.extractClaims=function(e){return this.attestationVerifier.extractClaims(e)};pt.prototype.generateSelectiveProof=function(e,t,r){return this.zkProver.generateSelectiveProof(e,t,r)};pt.prototype.verifySelectiveProof=function(e,t){return this.zkProver.verifySelectiveProof(e,t)};pt.prototype.generateAgeProof=function(e,t,r){var i=new Date("1995-06-15");return this.zkProver.generateAgeProof(i,t,r)};pt.prototype.verifyAgeProof=function(e,t,r){return this.zkProver.verifyAgeProof(e,t,r)};pt.prototype.generateRangeProof=function(e,t,r,i){return this.zkProver.generateRangeProof(e,t,r,i)};pt.prototype.verifyRangeProof=function(e,t,r){return this.zkProver.verifyRangeProof(e,t,r)};pt.prototype.generateMembershipProof=function(e,t,r){return this.zkProver.generateMembershipProof(e,t,r)};pt.prototype.verifyMembershipProof=function(e,t){return this.zkProver.verifyMembershipProof(e,t)};pt.prototype.anchorCredential=function(e,t,r){var i=new M1(t,this._anchorOptions);return i.anchorCredential(e,t,r)};pt.prototype.anchorBatch=function(e,t,r){var i=new M1(t,this._anchorOptions);return i.anchorBatch(e,t,r)};pt.prototype.registerDID=function(e,t,r,i){var n=new M1(r,this._anchorOptions);return n.registerDID(e,t,r,i)};pt.prototype.revokeCredential=function(e,t,r,i){var n=new M1(r,this._anchorOptions);return n.revokeCredential(e,t,r,i)};pt.prototype.queryAnchoredData=function(e){var t=new M1(null,this._anchorOptions);return t.queryAnchoredData(e)};pt.prototype.validateCredential=function(e,t){return this.schemaValidator.validate(e,t)};pt.prototype.getSchema=function(e){return this.schemaValidator.getSchema(e)};pt.prototype.getAllSchemas=function(){return this.schemaValidator.getAllSchemas()};pt.prototype.addSchema=function(e,t){return this.schemaValidator.addSchema(e,t)};pt.prototype.createTemplate=function(e){return this.schemaValidator.createTemplate(e)};pt.prototype.generateNonce=function(e){e=e||32;var t=_r();return t.randomBytes(e).toString("hex")};pt.prototype.hashData=function(e,t){var r=_r(),i=r.createHash("sha256");return i.update(e),t&&i.update(t),i.digest("hex")};pt.prototype.getVersion=function(){return"1.0.0"};pt.prototype.getInfo=function(){return{name:"SmartLedger BSV Global Digital Attestation Framework",version:this.getVersion(),description:"W3C-compliant verifiable credentials with DID resolution, zero-knowledge proofs, and blockchain anchoring",components:{didResolver:"DID Resolution and Management",attestationSigner:"Verifiable Credential Creation",attestationVerifier:"Credential and Presentation Verification",zkProver:"Zero-Knowledge Proof Generation and Verification",anchor:"Blockchain Anchoring and Timestamping",schemaValidator:"W3C VC Schema Validation"},standards:["W3C Verifiable Credentials Data Model v1.1","W3C Decentralized Identifiers (DIDs) v1.0","RFC 7515 JSON Web Signature (JWS)","BSV Blockchain Protocol"]}};uD.exports=pt});var lD=k((bve,cD)=>{"use strict";v();var n5=_r();async function loe(e){e=e||{};var t=e.alg||"ES256",r=e.kid||"key-"+Date.now();if(t!=="ES256"&&t!=="ES256K")throw new Error("Invalid algorithm. Must be ES256 or ES256K");var i;t==="ES256"?i=n5.generateKeyPairSync("ec",{namedCurve:"P-256",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}}):i=n5.generateKeyPairSync("ec",{namedCurve:"secp256k1",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});var n=n5.createPublicKey(i.publicKey).export({format:"jwk"}),o=n5.createPrivateKey(i.privateKey).export({format:"jwk"});return n.kid=r,n.alg=t,n.use="sig",n.kty="EC",o.kid=r,o.alg=t,o.use="sig",o.kty="EC",{privateJwk:o,publicJwk:n,kid:r,alg:t}}function hoe(e){if(!e.domain)throw new Error("domain is required");var t=e.domain,r="did:web:"+t.replace(/:/g,"%3A"),i=[],n=[];if(e.p256){var o={id:r+"#"+e.p256.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.p256.jwk};i.push(o),n.push(e.p256.jwk)}if(e.k1){var a={id:r+"#"+e.k1.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.k1.jwk};i.push(a),n.push(e.k1.jwk)}if(i.length===0)throw new Error("At least one key (p256 or k1) must be provided");var s={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:r,verificationMethod:i,authentication:i.map(function(c){return c.id}),assertionMethod:i.map(function(c){return c.id})};e.controllerName&&(s.controller=e.controllerName);var u={keys:n};return{did:r,didDocument:s,jwks:u}}function doe(e){if(!e.domain||!e.newKey)throw new Error("domain and newKey are required");var t=e.domain,r="did:web:"+t.replace(/:/g,"%3A"),i=e.keepOldForDays||30,n={id:r+"#"+e.newKey.kid,type:"JsonWebKey2020",controller:r,publicKeyJwk:e.newKey.jwk},o={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:r,verificationMethod:[n],authentication:[n.id],assertionMethod:[n.id],rotationInfo:{rotatedAt:new Date().toISOString(),gracePeriodDays:i}},a={keys:[e.newKey.jwk]};return{didDocument:o,jwks:a}}cD.exports={generateIssuerKeys:loe,buildDidWebDocuments:hoe,rotateIssuerKey:doe}});var u7=k((wve,hD)=>{"use strict";v();var N1=_r(),C1={ES256:"P-256",ES256K:"secp256k1"},poe=["ES256","ES256K"];function o5(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function a5(e){for(e=e.replace(/-/g,"+").replace(/_/g,"/");e.length%4;)e+="=";return h.Buffer.from(e,"base64")}async function goe(e){if(!e.issuerDid||!e.subjectId||!e.credentialSubject||!e.privateJwk)throw new Error("issuerDid, subjectId, credentialSubject, and privateJwk are required");var t=e.alg||"ES256";if(!C1[t])throw new Error("Unsupported algorithm: "+t);if(e.privateJwk.crv&&e.privateJwk.crv!==C1[t])throw new Error("Key curve "+e.privateJwk.crv+" does not match alg "+t);var r=e.kid||e.privateJwk.kid,i=e.types||["VerifiableCredential"],n=e.expSeconds||365*24*60*60,o=Math.floor(Date.now()/1e3),a=new Date().toISOString(),s={"@context":["https://www.w3.org/2018/credentials/v1"],type:i,issuer:e.issuerDid,issuanceDate:a,credentialSubject:Object.assign({id:e.subjectId},e.credentialSubject)},u={iss:e.issuerDid,sub:e.subjectId,iat:o,exp:o+n,vc:s},c={alg:t,typ:"JWT",kid:r},l=o5(h.Buffer.from(JSON.stringify(c))),m=o5(h.Buffer.from(JSON.stringify(u))),w=l+"."+m,E=N1.createPrivateKey({key:e.privateJwk,format:"jwk"}),P=N1.sign("sha256",h.Buffer.from(w),{key:E,dsaEncoding:"ieee-p1363"}),M=o5(P),D=w+"."+M;return{jwt:D}}async function voe(e,t){t=t||{};try{if(typeof e!="string")return{valid:!1,error:"Invalid JWT format"};var r=e.split(".");if(r.length!==3)return{valid:!1,error:"Invalid JWT format"};var i=r[0],n=r[1],o=r[2],a=JSON.parse(a5(i).toString()),s=JSON.parse(a5(n).toString()),u=a5(o),c=t.allowedAlgs||poe;if(!a.alg||c.indexOf(a.alg)===-1||!C1[a.alg])return{valid:!1,error:"Algorithm not allowed: "+a.alg,header:a,payload:s};var l=Math.floor(Date.now()/1e3),m=t.clockToleranceSec||60;if(t.requireExpiration&&!s.exp)return{valid:!1,error:"JWT missing required exp claim",header:a,payload:s};if(s.exp&&s.exp<l-m)return{valid:!1,error:"JWT expired",header:a,payload:s};if(s.nbf&&s.nbf>l+m)return{valid:!1,error:"JWT not yet valid",header:a,payload:s};if(t.expectedIssuerDid&&s.iss!==t.expectedIssuerDid)return{valid:!1,error:"Unexpected issuer",header:a,payload:s};var w;if(t.didResolver){var E=await t.didResolver(s.iss);if(!E||!E.jwks||!E.jwks.keys)return{valid:!1,error:"Failed to resolve issuer DID",header:a,payload:s};var P=E.jwks.keys.find(function(U){return U.kid===a.kid});if(!P)return{valid:!1,error:"Key not found in JWKS",header:a,payload:s};w=P}else return{valid:!1,error:"DID resolver required for verification",header:a,payload:s};if(w.crv&&w.crv!==C1[a.alg])return{valid:!1,error:"Key curve does not match algorithm",header:a,payload:s};var M=i+"."+n,D=N1.createPublicKey({key:w,format:"jwk"}),L=N1.verify("sha256",h.Buffer.from(M),{key:D,dsaEncoding:"ieee-p1363"},u);if(!L&&t.allowLegacyDER)try{L=N1.verify("sha256",h.Buffer.from(M),{key:D,dsaEncoding:"der"},u)}catch{L=!1}return L?{valid:!0,header:a,payload:s}:{valid:!1,error:"Invalid signature",header:a,payload:s}}catch(U){return{valid:!1,error:U.message||"Verification failed"}}}hD.exports={issueVcJwt:goe,verifyVcJwt:voe,base64UrlEncode:o5,base64UrlDecode:a5,ALG_TO_CRV:C1}});var pD=k((xve,dD)=>{"use strict";v();function moe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}dD.exports=moe});var D1=k(xi=>{"use strict";v();var yoe=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function boe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}xi.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)boe(r,i)&&(e[i]=r[i])}}return e};xi.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var _oe={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+i),n);return}for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){var t,r,i,n,o,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(a=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,n),n+=o.length;return a}},woe={arraySet:function(e,t,r,i,n){for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};xi.setTyped=function(e){e?(xi.Buf8=Uint8Array,xi.Buf16=Uint16Array,xi.Buf32=Int32Array,xi.assign(xi,_oe)):(xi.Buf8=Array,xi.Buf16=Array,xi.Buf32=Array,xi.assign(xi,woe))};xi.setTyped(yoe)});var LD=k(Fl=>{"use strict";v();var Soe=D1(),xoe=4,gD=0,vD=1,Eoe=2;function Ul(e){for(var t=e.length;--t>=0;)e[t]=0}var Ooe=0,SD=1,Ioe=2,Aoe=3,Poe=258,g7=29,j1=256,q1=j1+1+g7,ql=30,v7=19,xD=2*q1+1,Pf=15,f7=16,Toe=7,m7=256,ED=16,OD=17,ID=18,d7=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],s5=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],koe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],AD=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Roe=512,Ja=new Array((q1+2)*2);Ul(Ja);var L1=new Array(ql*2);Ul(L1);var U1=new Array(Roe);Ul(U1);var F1=new Array(Poe-Aoe+1);Ul(F1);var y7=new Array(g7);Ul(y7);var u5=new Array(ql);Ul(u5);function c7(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}var PD,TD,kD;function l7(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function RD(e){return e<256?U1[e]:U1[256+(e>>>7)]}function H1(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Ni(e,t,r){e.bi_valid>f7-r?(e.bi_buf|=t<<e.bi_valid&65535,H1(e,e.bi_buf),e.bi_buf=t>>f7-e.bi_valid,e.bi_valid+=r-f7):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Xo(e,t,r){Ni(e,r[t*2],r[t*2+1])}function BD(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Boe(e){e.bi_valid===16?(H1(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Moe(e,t){var r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,l,m,w,E,P,M=0;for(w=0;w<=Pf;w++)e.bl_count[w]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<xD;c++)l=e.heap[c],w=r[r[l*2+1]*2+1]+1,w>u&&(w=u,M++),r[l*2+1]=w,!(l>i)&&(e.bl_count[w]++,E=0,l>=s&&(E=a[l-s]),P=r[l*2],e.opt_len+=P*(w+E),o&&(e.static_len+=P*(n[l*2+1]+E)));if(M!==0){do{for(w=u-1;e.bl_count[w]===0;)w--;e.bl_count[w]--,e.bl_count[w+1]+=2,e.bl_count[u]--,M-=2}while(M>0);for(w=u;w!==0;w--)for(l=e.bl_count[w];l!==0;)m=e.heap[--c],!(m>i)&&(r[m*2+1]!==w&&(e.opt_len+=(w-r[m*2+1])*r[m*2],r[m*2+1]=w),l--)}}function MD(e,t,r){var i=new Array(Pf+1),n=0,o,a;for(o=1;o<=Pf;o++)i[o]=n=n+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=BD(i[s]++,s))}}function Noe(){var e,t,r,i,n,o=new Array(Pf+1);for(r=0,i=0;i<g7-1;i++)for(y7[i]=r,e=0;e<1<<d7[i];e++)F1[r++]=i;for(F1[r-1]=i,n=0,i=0;i<16;i++)for(u5[i]=n,e=0;e<1<<s5[i];e++)U1[n++]=i;for(n>>=7;i<ql;i++)for(u5[i]=n<<7,e=0;e<1<<s5[i]-7;e++)U1[256+n++]=i;for(t=0;t<=Pf;t++)o[t]=0;for(e=0;e<=143;)Ja[e*2+1]=8,e++,o[8]++;for(;e<=255;)Ja[e*2+1]=9,e++,o[9]++;for(;e<=279;)Ja[e*2+1]=7,e++,o[7]++;for(;e<=287;)Ja[e*2+1]=8,e++,o[8]++;for(MD(Ja,q1+1,o),e=0;e<ql;e++)L1[e*2+1]=5,L1[e*2]=BD(e,5);PD=new c7(Ja,d7,j1+1,q1,Pf),TD=new c7(L1,s5,0,ql,Pf),kD=new c7(new Array(0),koe,0,v7,Toe)}function ND(e){var t;for(t=0;t<q1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ql;t++)e.dyn_dtree[t*2]=0;for(t=0;t<v7;t++)e.bl_tree[t*2]=0;e.dyn_ltree[m7*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function CD(e){e.bi_valid>8?H1(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Coe(e,t,r,i){CD(e),i&&(H1(e,r),H1(e,~r)),Soe.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function mD(e,t,r,i){var n=t*2,o=r*2;return e[n]<e[o]||e[n]===e[o]&&i[t]<=i[r]}function h7(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&mD(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!mD(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function yD(e,t,r){var i,n,o=0,a,s;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],n=e.pending_buf[e.l_buf+o],o++,i===0?Xo(e,n,t):(a=F1[n],Xo(e,a+j1+1,t),s=d7[a],s!==0&&(n-=y7[a],Ni(e,n,s)),i--,a=RD(i),Xo(e,a,r),s=s5[a],s!==0&&(i-=u5[a],Ni(e,i,s)));while(o<e.last_lit);Xo(e,m7,t)}function p7(e,t){var r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,u=-1,c;for(e.heap_len=0,e.heap_max=xD,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=u=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=i[c*2+1]);for(t.max_code=u,a=e.heap_len>>1;a>=1;a--)h7(e,r,a);c=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],h7(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[c*2]=r[a*2]+r[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=c,e.heap[1]=c++,h7(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Moe(e,t),MD(r,u,e.bl_count)}function bD(e,t,r){var i,n=-1,o,a=t[1],s=0,u=7,c=4;for(a===0&&(u=138,c=3),t[(r+1)*2+1]=65535,i=0;i<=r;i++)o=a,a=t[(i+1)*2+1],!(++s<u&&o===a)&&(s<c?e.bl_tree[o*2]+=s:o!==0?(o!==n&&e.bl_tree[o*2]++,e.bl_tree[ED*2]++):s<=10?e.bl_tree[OD*2]++:e.bl_tree[ID*2]++,s=0,n=o,a===0?(u=138,c=3):o===a?(u=6,c=3):(u=7,c=4))}function _D(e,t,r){var i,n=-1,o,a=t[1],s=0,u=7,c=4;for(a===0&&(u=138,c=3),i=0;i<=r;i++)if(o=a,a=t[(i+1)*2+1],!(++s<u&&o===a)){if(s<c)do Xo(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==n&&(Xo(e,o,e.bl_tree),s--),Xo(e,ED,e.bl_tree),Ni(e,s-3,2)):s<=10?(Xo(e,OD,e.bl_tree),Ni(e,s-3,3)):(Xo(e,ID,e.bl_tree),Ni(e,s-11,7));s=0,n=o,a===0?(u=138,c=3):o===a?(u=6,c=3):(u=7,c=4)}}function Doe(e){var t;for(bD(e,e.dyn_ltree,e.l_desc.max_code),bD(e,e.dyn_dtree,e.d_desc.max_code),p7(e,e.bl_desc),t=v7-1;t>=3&&e.bl_tree[AD[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Loe(e,t,r,i){var n;for(Ni(e,t-257,5),Ni(e,r-1,5),Ni(e,i-4,4),n=0;n<i;n++)Ni(e,e.bl_tree[AD[n]*2+1],3);_D(e,e.dyn_ltree,t-1),_D(e,e.dyn_dtree,r-1)}function qoe(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return gD;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return vD;for(r=32;r<j1;r++)if(e.dyn_ltree[r*2]!==0)return vD;return gD}var wD=!1;function Uoe(e){wD||(Noe(),wD=!0),e.l_desc=new l7(e.dyn_ltree,PD),e.d_desc=new l7(e.dyn_dtree,TD),e.bl_desc=new l7(e.bl_tree,kD),e.bi_buf=0,e.bi_valid=0,ND(e)}function DD(e,t,r,i){Ni(e,(Ooe<<1)+(i?1:0),3),Coe(e,t,r,!0)}function Foe(e){Ni(e,SD<<1,3),Xo(e,m7,Ja),Boe(e)}function Hoe(e,t,r,i){var n,o,a=0;e.level>0?(e.strm.data_type===Eoe&&(e.strm.data_type=qoe(e)),p7(e,e.l_desc),p7(e,e.d_desc),a=Doe(e),n=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&t!==-1?DD(e,t,r,i):e.strategy===xoe||o===n?(Ni(e,(SD<<1)+(i?1:0),3),yD(e,Ja,L1)):(Ni(e,(Ioe<<1)+(i?1:0),3),Loe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),yD(e,e.dyn_ltree,e.dyn_dtree)),ND(e),i&&CD(e)}function joe(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(F1[r]+j1+1)*2]++,e.dyn_dtree[RD(t)*2]++),e.last_lit===e.lit_bufsize-1}Fl._tr_init=Uoe;Fl._tr_stored_block=DD;Fl._tr_flush_block=Hoe;Fl._tr_tally=joe;Fl._tr_align=Foe});var b7=k((Tve,qD)=>{"use strict";v();function zoe(e,t,r,i){for(var n=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+t[i++]|0,o=o+n|0;while(--a);n%=65521,o%=65521}return n|o<<16|0}qD.exports=zoe});var _7=k((Rve,UD)=>{"use strict";v();function Koe(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Voe=Koe();function Goe(e,t,r,i){var n=Voe,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^n[(e^t[a])&255];return e^-1}UD.exports=Goe});var HD=k((Mve,FD)=>{"use strict";v();FD.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var $D=k(ea=>{"use strict";v();var Ei=D1(),On=LD(),VD=b7(),Hs=_7(),Zoe=HD(),Bf=0,Woe=1,Yoe=3,Gs=4,jD=5,Qo=0,zD=1,In=-2,$oe=-3,w7=-5,Xoe=-1,Joe=1,f5=2,Qoe=3,eae=4,tae=0,rae=2,d5=8,iae=9,nae=15,oae=8,aae=29,sae=256,x7=sae+1+aae,uae=30,fae=19,cae=2*x7+1,lae=15,bt=3,Ks=258,uo=Ks+bt+1,hae=32,p5=42,E7=69,c5=73,l5=91,h5=103,Tf=113,K1=666,Ur=1,V1=2,kf=3,zl=4,dae=3;function Vs(e,t){return e.msg=Zoe[t],t}function KD(e){return(e<<1)-(e>4?9:0)}function zs(e){for(var t=e.length;--t>=0;)e[t]=0}function js(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(Ei.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function ai(e,t){On._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,js(e.strm)}function Pt(e,t){e.pending_buf[e.pending++]=t}function z1(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function pae(e,t,r,i){var n=e.avail_in;return n>i&&(n=i),n===0?0:(e.avail_in-=n,Ei.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=VD(e.adler,t,n,r):e.state.wrap===2&&(e.adler=Hs(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function GD(e,t){var r=e.max_chain_length,i=e.strstart,n,o,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-uo?e.strstart-(e.w_size-uo):0,c=e.window,l=e.w_mask,m=e.prev,w=e.strstart+Ks,E=c[i+a-1],P=c[i+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(n=t,!(c[n+a]!==P||c[n+a-1]!==E||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<w);if(o=Ks-(w-i),i=w-Ks,o>a){if(e.match_start=t,a=o,o>=s)break;E=c[i+a-1],P=c[i+a]}}while((t=m[t&l])>u&&--r!==0);return a<=e.lookahead?a:e.lookahead}function Rf(e){var t=e.w_size,r,i,n,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-uo)){Ei.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,r=i;do n=e.head[--r],e.head[r]=n>=t?n-t:0;while(--i);i=t,r=i;do n=e.prev[--r],e.prev[r]=n>=t?n-t:0;while(--i);o+=t}if(e.strm.avail_in===0)break;if(i=pae(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=bt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+bt-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<bt)););}while(e.lookahead<uo&&e.strm.avail_in!==0)}function gae(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rf(e),e.lookahead===0&&t===Bf)return Ur;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,ai(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-uo&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):(e.strstart>e.block_start&&(ai(e,!1),e.strm.avail_out===0),Ur)}function S7(e,t){for(var r,i;;){if(e.lookahead<uo){if(Rf(e),e.lookahead<uo&&t===Bf)return Ur;if(e.lookahead===0)break}if(r=0,e.lookahead>=bt&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-uo&&(e.match_length=GD(e,r)),e.match_length>=bt)if(i=On._tr_tally(e,e.strstart-e.match_start,e.match_length-bt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=bt){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=e.strstart<bt-1?e.strstart:bt-1,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function Hl(e,t){for(var r,i,n;;){if(e.lookahead<uo){if(Rf(e),e.lookahead<uo&&t===Bf)return Ur;if(e.lookahead===0)break}if(r=0,e.lookahead>=bt&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=bt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-uo&&(e.match_length=GD(e,r),e.match_length<=5&&(e.strategy===Joe||e.match_length===bt&&e.strstart-e.match_start>4096)&&(e.match_length=bt-1)),e.prev_length>=bt&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-bt,i=On._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-bt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+bt-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=bt-1,e.strstart++,i&&(ai(e,!1),e.strm.avail_out===0))return Ur}else if(e.match_available){if(i=On._tr_tally(e,0,e.window[e.strstart-1]),i&&ai(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ur}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=On._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<bt-1?e.strstart:bt-1,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function vae(e,t){for(var r,i,n,o,a=e.window;;){if(e.lookahead<=Ks){if(Rf(e),e.lookahead<=Ks&&t===Bf)return Ur;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=bt&&e.strstart>0&&(n=e.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){o=e.strstart+Ks;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<o);e.match_length=Ks-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=bt?(r=On._tr_tally(e,1,e.match_length-bt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function mae(e,t){for(var r;;){if(e.lookahead===0&&(Rf(e),e.lookahead===0)){if(t===Bf)return Ur;break}if(e.match_length=0,r=On._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ai(e,!1),e.strm.avail_out===0))return Ur}return e.insert=0,t===Gs?(ai(e,!0),e.strm.avail_out===0?kf:zl):e.last_lit&&(ai(e,!1),e.strm.avail_out===0)?Ur:V1}function Jo(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}var jl;jl=[new Jo(0,0,0,0,gae),new Jo(4,4,8,4,S7),new Jo(4,5,16,8,S7),new Jo(4,6,32,32,S7),new Jo(4,4,16,16,Hl),new Jo(8,16,32,32,Hl),new Jo(8,16,128,128,Hl),new Jo(8,32,128,256,Hl),new Jo(32,128,258,1024,Hl),new Jo(32,258,258,4096,Hl)];function yae(e){e.window_size=2*e.w_size,zs(e.head),e.max_lazy_match=jl[e.level].max_lazy,e.good_match=jl[e.level].good_length,e.nice_match=jl[e.level].nice_length,e.max_chain_length=jl[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=bt-1,e.match_available=0,e.ins_h=0}function bae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=d5,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ei.Buf16(cae*2),this.dyn_dtree=new Ei.Buf16((2*uae+1)*2),this.bl_tree=new Ei.Buf16((2*fae+1)*2),zs(this.dyn_ltree),zs(this.dyn_dtree),zs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ei.Buf16(lae+1),this.heap=new Ei.Buf16(2*x7+1),zs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ei.Buf16(2*x7+1),zs(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ZD(e){var t;return!e||!e.state?Vs(e,In):(e.total_in=e.total_out=0,e.data_type=rae,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?p5:Tf,e.adler=t.wrap===2?0:1,t.last_flush=Bf,On._tr_init(t),Qo)}function WD(e){var t=ZD(e);return t===Qo&&yae(e.state),t}function _ae(e,t){return!e||!e.state||e.state.wrap!==2?In:(e.state.gzhead=t,Qo)}function YD(e,t,r,i,n,o){if(!e)return In;var a=1;if(t===Xoe&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>iae||r!==d5||i<8||i>15||t<0||t>9||o<0||o>eae)return Vs(e,In);i===8&&(i=9);var s=new bae;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+bt-1)/bt),s.window=new Ei.Buf8(s.w_size*2),s.head=new Ei.Buf16(s.hash_size),s.prev=new Ei.Buf16(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Ei.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,WD(e)}function wae(e,t){return YD(e,t,d5,nae,oae,tae)}function Sae(e,t){var r,i,n,o;if(!e||!e.state||t>jD||t<0)return e?Vs(e,In):In;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===K1&&t!==Gs)return Vs(e,e.avail_out===0?w7:In);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===p5)if(i.wrap===2)e.adler=0,Pt(i,31),Pt(i,139),Pt(i,8),i.gzhead?(Pt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Pt(i,i.gzhead.time&255),Pt(i,i.gzhead.time>>8&255),Pt(i,i.gzhead.time>>16&255),Pt(i,i.gzhead.time>>24&255),Pt(i,i.level===9?2:i.strategy>=f5||i.level<2?4:0),Pt(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Pt(i,i.gzhead.extra.length&255),Pt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Hs(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=E7):(Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,0),Pt(i,i.level===9?2:i.strategy>=f5||i.level<2?4:0),Pt(i,dae),i.status=Tf);else{var a=d5+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=f5||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,a|=s<<6,i.strstart!==0&&(a|=hae),a+=31-a%31,i.status=Tf,z1(i,a),i.strstart!==0&&(z1(i,e.adler>>>16),z1(i,e.adler&65535)),e.adler=1}if(i.status===E7)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),js(e),n=i.pending,i.pending===i.pending_buf_size));)Pt(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=c5)}else i.status=c5;if(i.status===c5)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),js(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,Pt(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=l5)}else i.status=l5;if(i.status===l5)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),js(e),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,Pt(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Hs(e.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=h5)}else i.status=h5;if(i.status===h5&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&js(e),i.pending+2<=i.pending_buf_size&&(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),e.adler=0,i.status=Tf)):i.status=Tf),i.pending!==0){if(js(e),e.avail_out===0)return i.last_flush=-1,Qo}else if(e.avail_in===0&&KD(t)<=KD(r)&&t!==Gs)return Vs(e,w7);if(i.status===K1&&e.avail_in!==0)return Vs(e,w7);if(e.avail_in!==0||i.lookahead!==0||t!==Bf&&i.status!==K1){var u=i.strategy===f5?mae(i,t):i.strategy===Qoe?vae(i,t):jl[i.level].func(i,t);if((u===kf||u===zl)&&(i.status=K1),u===Ur||u===kf)return e.avail_out===0&&(i.last_flush=-1),Qo;if(u===V1&&(t===Woe?On._tr_align(i):t!==jD&&(On._tr_stored_block(i,0,0,!1),t===Yoe&&(zs(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),js(e),e.avail_out===0))return i.last_flush=-1,Qo}return t!==Gs?Qo:i.wrap<=0?zD:(i.wrap===2?(Pt(i,e.adler&255),Pt(i,e.adler>>8&255),Pt(i,e.adler>>16&255),Pt(i,e.adler>>24&255),Pt(i,e.total_in&255),Pt(i,e.total_in>>8&255),Pt(i,e.total_in>>16&255),Pt(i,e.total_in>>24&255)):(z1(i,e.adler>>>16),z1(i,e.adler&65535)),js(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Qo:zD)}function xae(e){var t;return!e||!e.state?In:(t=e.state.status,t!==p5&&t!==E7&&t!==c5&&t!==l5&&t!==h5&&t!==Tf&&t!==K1?Vs(e,In):(e.state=null,t===Tf?Vs(e,$oe):Qo))}function Eae(e,t){var r=t.length,i,n,o,a,s,u,c,l;if(!e||!e.state||(i=e.state,a=i.wrap,a===2||a===1&&i.status!==p5||i.lookahead))return In;for(a===1&&(e.adler=VD(e.adler,t,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(zs(i.head),i.strstart=0,i.block_start=0,i.insert=0),l=new Ei.Buf8(i.w_size),Ei.arraySet(l,t,r-i.w_size,i.w_size,0),t=l,r=i.w_size),s=e.avail_in,u=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,Rf(i);i.lookahead>=bt;){n=i.strstart,o=i.lookahead-(bt-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+bt-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=bt-1,Rf(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=bt-1,i.match_available=0,e.next_in=u,e.input=c,e.avail_in=s,i.wrap=a,Qo}ea.deflateInit=wae;ea.deflateInit2=YD;ea.deflateReset=WD;ea.deflateResetKeep=ZD;ea.deflateSetHeader=_ae;ea.deflate=Sae;ea.deflateEnd=xae;ea.deflateSetDictionary=Eae;ea.deflateInfo="pako deflate (from Nodeca project)"});var JD=k((Lve,XD)=>{"use strict";v();var g5=30,Oae=12;XD.exports=function(t,r){var i,n,o,a,s,u,c,l,m,w,E,P,M,D,L,U,K,N,C,F,H,z,G,B,g;i=t.state,n=t.next_in,B=t.input,o=n+(t.avail_in-5),a=t.next_out,g=t.output,s=a-(r-t.avail_out),u=a+(t.avail_out-257),c=i.dmax,l=i.wsize,m=i.whave,w=i.wnext,E=i.window,P=i.hold,M=i.bits,D=i.lencode,L=i.distcode,U=(1<<i.lenbits)-1,K=(1<<i.distbits)-1;e:do{M<15&&(P+=B[n++]<<M,M+=8,P+=B[n++]<<M,M+=8),N=D[P&U];t:for(;;){if(C=N>>>24,P>>>=C,M-=C,C=N>>>16&255,C===0)g[a++]=N&65535;else if(C&16){F=N&65535,C&=15,C&&(M<C&&(P+=B[n++]<<M,M+=8),F+=P&(1<<C)-1,P>>>=C,M-=C),M<15&&(P+=B[n++]<<M,M+=8,P+=B[n++]<<M,M+=8),N=L[P&K];r:for(;;){if(C=N>>>24,P>>>=C,M-=C,C=N>>>16&255,C&16){if(H=N&65535,C&=15,M<C&&(P+=B[n++]<<M,M+=8,M<C&&(P+=B[n++]<<M,M+=8)),H+=P&(1<<C)-1,H>c){t.msg="invalid distance too far back",i.mode=g5;break e}if(P>>>=C,M-=C,C=a-s,H>C){if(C=H-C,C>m&&i.sane){t.msg="invalid distance too far back",i.mode=g5;break e}if(z=0,G=E,w===0){if(z+=l-C,C<F){F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}}else if(w<C){if(z+=l+w-C,C-=w,C<F){F-=C;do g[a++]=E[z++];while(--C);if(z=0,w<F){C=w,F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}}}else if(z+=w-C,C<F){F-=C;do g[a++]=E[z++];while(--C);z=a-H,G=g}for(;F>2;)g[a++]=G[z++],g[a++]=G[z++],g[a++]=G[z++],F-=3;F&&(g[a++]=G[z++],F>1&&(g[a++]=G[z++]))}else{z=a-H;do g[a++]=g[z++],g[a++]=g[z++],g[a++]=g[z++],F-=3;while(F>2);F&&(g[a++]=g[z++],F>1&&(g[a++]=g[z++]))}}else if((C&64)===0){N=L[(N&65535)+(P&(1<<C)-1)];continue r}else{t.msg="invalid distance code",i.mode=g5;break e}break}}else if((C&64)===0){N=D[(N&65535)+(P&(1<<C)-1)];continue t}else if(C&32){i.mode=Oae;break e}else{t.msg="invalid literal/length code",i.mode=g5;break e}break}}while(n<o&&a<u);F=M>>3,n-=F,M-=F<<3,P&=(1<<M)-1,t.next_in=n,t.next_out=a,t.avail_in=n<o?5+(o-n):5-(n-o),t.avail_out=a<u?257+(u-a):257-(a-u),i.hold=P,i.bits=M}});var oL=k((Uve,nL)=>{"use strict";v();var QD=D1(),Kl=15,eL=852,tL=592,rL=0,O7=1,iL=2,Iae=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Aae=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Pae=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Tae=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];nL.exports=function(t,r,i,n,o,a,s,u){var c=u.bits,l=0,m=0,w=0,E=0,P=0,M=0,D=0,L=0,U=0,K=0,N,C,F,H,z,G=null,B=0,g,O=new QD.Buf16(Kl+1),y=new QD.Buf16(Kl+1),f=null,d=0,_,x,b;for(l=0;l<=Kl;l++)O[l]=0;for(m=0;m<n;m++)O[r[i+m]]++;for(P=c,E=Kl;E>=1&&O[E]===0;E--);if(P>E&&(P=E),E===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,u.bits=1,0;for(w=1;w<E&&O[w]===0;w++);for(P<w&&(P=w),L=1,l=1;l<=Kl;l++)if(L<<=1,L-=O[l],L<0)return-1;if(L>0&&(t===rL||E!==1))return-1;for(y[1]=0,l=1;l<Kl;l++)y[l+1]=y[l]+O[l];for(m=0;m<n;m++)r[i+m]!==0&&(s[y[r[i+m]]++]=m);if(t===rL?(G=f=s,g=19):t===O7?(G=Iae,B-=257,f=Aae,d-=257,g=256):(G=Pae,f=Tae,g=-1),K=0,m=0,l=w,z=a,M=P,D=0,F=-1,U=1<<P,H=U-1,t===O7&&U>eL||t===iL&&U>tL)return 1;for(;;){_=l-D,s[m]<g?(x=0,b=s[m]):s[m]>g?(x=f[d+s[m]],b=G[B+s[m]]):(x=96,b=0),N=1<<l-D,C=1<<M,w=C;do C-=N,o[z+(K>>D)+C]=_<<24|x<<16|b|0;while(C!==0);for(N=1<<l-1;K&N;)N>>=1;if(N!==0?(K&=N-1,K+=N):K=0,m++,--O[l]===0){if(l===E)break;l=r[i+s[m]]}if(l>P&&(K&H)!==F){for(D===0&&(D=P),z+=w,M=l-D,L=1<<M;M+D<E&&(L-=O[M+D],!(L<=0));)M++,L<<=1;if(U+=1<<M,t===O7&&U>eL||t===iL&&U>tL)return 1;F=K&H,o[F]=P<<24|M<<16|z-a|0}}return K!==0&&(o[z+K]=l-D<<24|64<<16|0),u.bits=P,0}});var FL=k(fo=>{"use strict";v();var Zi=D1(),R7=b7(),ta=_7(),kae=JD(),G1=oL(),Rae=0,RL=1,BL=2,aL=4,Bae=5,v5=6,Mf=0,Mae=1,Nae=2,An=-2,ML=-3,B7=-4,Cae=-5,sL=8,NL=1,uL=2,fL=3,cL=4,lL=5,hL=6,dL=7,pL=8,gL=9,vL=10,b5=11,Qa=12,I7=13,mL=14,A7=15,yL=16,bL=17,_L=18,wL=19,m5=20,y5=21,SL=22,xL=23,EL=24,OL=25,IL=26,P7=27,AL=28,PL=29,ir=30,M7=31,Dae=32,Lae=852,qae=592,Uae=15,Fae=Uae;function TL(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Hae(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Zi.Buf16(320),this.work=new Zi.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function CL(e){var t;return!e||!e.state?An:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=NL,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Zi.Buf32(Lae),t.distcode=t.distdyn=new Zi.Buf32(qae),t.sane=1,t.back=-1,Mf)}function DL(e){var t;return!e||!e.state?An:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,CL(e))}function LL(e,t){var r,i;return!e||!e.state||(i=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?An:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,DL(e))}function qL(e,t){var r,i;return e?(i=new Hae,e.state=i,i.window=null,r=LL(e,t),r!==Mf&&(e.state=null),r):An}function jae(e){return qL(e,Fae)}var kL=!0,T7,k7;function zae(e){if(kL){var t;for(T7=new Zi.Buf32(512),k7=new Zi.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(G1(RL,e.lens,0,288,T7,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;G1(BL,e.lens,0,32,k7,0,e.work,{bits:5}),kL=!1}e.lencode=T7,e.lenbits=9,e.distcode=k7,e.distbits=5}function UL(e,t,r,i){var n,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Zi.Buf8(o.wsize)),i>=o.wsize?(Zi.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),Zi.arraySet(o.window,t,r-i,n,o.wnext),i-=n,i?(Zi.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function Kae(e,t){var r,i,n,o,a,s,u,c,l,m,w,E,P,M,D=0,L,U,K,N,C,F,H,z,G=new Zi.Buf8(4),B,g,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return An;r=e.state,r.mode===Qa&&(r.mode=I7),a=e.next_out,n=e.output,u=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,c=r.hold,l=r.bits,m=s,w=u,z=Mf;e:for(;;)switch(r.mode){case NL:if(r.wrap===0){r.mode=I7;break}for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0),c=0,l=0,r.mode=uL;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ir;break}if((c&15)!==sL){e.msg="unknown compression method",r.mode=ir;break}if(c>>>=4,l-=4,H=(c&15)+8,r.wbits===0)r.wbits=H;else if(H>r.wbits){e.msg="invalid window size",r.mode=ir;break}r.dmax=1<<H,e.adler=r.check=1,r.mode=c&512?vL:Qa,c=0,l=0;break;case uL:for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==sL){e.msg="unknown compression method",r.mode=ir;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=ir;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0,r.mode=fL;case fL:for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,G[2]=c>>>16&255,G[3]=c>>>24&255,r.check=ta(r.check,G,4,0)),c=0,l=0,r.mode=cL;case cL:for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0,r.mode=lL;case lL:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(G[0]=c&255,G[1]=c>>>8&255,r.check=ta(r.check,G,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=hL;case hL:if(r.flags&1024&&(E=r.length,E>s&&(E=s),E&&(r.head&&(H=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Zi.arraySet(r.head.extra,i,o,E,H)),r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,r.length-=E),r.length))break e;r.length=0,r.mode=dL;case dL:if(r.flags&2048){if(s===0)break e;E=0;do H=i[o+E++],r.head&&H&&r.length<65536&&(r.head.name+=String.fromCharCode(H));while(H&&E<s);if(r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,H)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=pL;case pL:if(r.flags&4096){if(s===0)break e;E=0;do H=i[o+E++],r.head&&H&&r.length<65536&&(r.head.comment+=String.fromCharCode(H));while(H&&E<s);if(r.flags&512&&(r.check=ta(r.check,i,E,o)),s-=E,o+=E,H)break e}else r.head&&(r.head.comment=null);r.mode=gL;case gL:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=ir;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Qa;break;case vL:for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}e.adler=r.check=TL(c),c=0,l=0,r.mode=b5;case b5:if(r.havedict===0)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,Nae;e.adler=r.check=1,r.mode=Qa;case Qa:if(t===Bae||t===v5)break e;case I7:if(r.last){c>>>=l&7,l-=l&7,r.mode=P7;break}for(;l<3;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=mL;break;case 1:if(zae(r),r.mode=m5,t===v5){c>>>=2,l-=2;break e}break;case 2:r.mode=bL;break;case 3:e.msg="invalid block type",r.mode=ir}c>>>=2,l-=2;break;case mL:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ir;break}if(r.length=c&65535,c=0,l=0,r.mode=A7,t===v5)break e;case A7:r.mode=yL;case yL:if(E=r.length,E){if(E>s&&(E=s),E>u&&(E=u),E===0)break e;Zi.arraySet(n,i,o,E,a),s-=E,o+=E,u-=E,a+=E,r.length-=E;break}r.mode=Qa;break;case bL:for(;l<14;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ir;break}r.have=0,r.mode=_L;case _L:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.lens[O[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,B={bits:r.lenbits},z=G1(Rae,r.lens,0,19,r.lencode,0,r.work,B),r.lenbits=B.bits,z){e.msg="invalid code lengths set",r.mode=ir;break}r.have=0,r.mode=wL;case wL:for(;r.have<r.nlen+r.ndist;){for(;D=r.lencode[c&(1<<r.lenbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(K<16)c>>>=L,l-=L,r.lens[r.have++]=K;else{if(K===16){for(g=L+2;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c>>>=L,l-=L,r.have===0){e.msg="invalid bit length repeat",r.mode=ir;break}H=r.lens[r.have-1],E=3+(c&3),c>>>=2,l-=2}else if(K===17){for(g=L+3;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=L,l-=L,H=0,E=3+(c&7),c>>>=3,l-=3}else{for(g=L+7;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=L,l-=L,H=0,E=11+(c&127),c>>>=7,l-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ir;break}for(;E--;)r.lens[r.have++]=H}}if(r.mode===ir)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ir;break}if(r.lenbits=9,B={bits:r.lenbits},z=G1(RL,r.lens,0,r.nlen,r.lencode,0,r.work,B),r.lenbits=B.bits,z){e.msg="invalid literal/lengths set",r.mode=ir;break}if(r.distbits=6,r.distcode=r.distdyn,B={bits:r.distbits},z=G1(BL,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,B),r.distbits=B.bits,z){e.msg="invalid distances set",r.mode=ir;break}if(r.mode=m5,t===v5)break e;case m5:r.mode=y5;case y5:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,kae(e,w),a=e.next_out,n=e.output,u=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,c=r.hold,l=r.bits,r.mode===Qa&&(r.back=-1);break}for(r.back=0;D=r.lencode[c&(1<<r.lenbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(U&&(U&240)===0){for(N=L,C=U,F=K;D=r.lencode[F+((c&(1<<N+C)-1)>>N)],L=D>>>24,U=D>>>16&255,K=D&65535,!(N+L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=N,l-=N,r.back+=N}if(c>>>=L,l-=L,r.back+=L,r.length=K,U===0){r.mode=IL;break}if(U&32){r.back=-1,r.mode=Qa;break}if(U&64){e.msg="invalid literal/length code",r.mode=ir;break}r.extra=U&15,r.mode=SL;case SL:if(r.extra){for(g=r.extra;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=xL;case xL:for(;D=r.distcode[c&(1<<r.distbits)-1],L=D>>>24,U=D>>>16&255,K=D&65535,!(L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if((U&240)===0){for(N=L,C=U,F=K;D=r.distcode[F+((c&(1<<N+C)-1)>>N)],L=D>>>24,U=D>>>16&255,K=D&65535,!(N+L<=l);){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}c>>>=N,l-=N,r.back+=N}if(c>>>=L,l-=L,r.back+=L,U&64){e.msg="invalid distance code",r.mode=ir;break}r.offset=K,r.extra=U&15,r.mode=EL;case EL:if(r.extra){for(g=r.extra;l<g;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ir;break}r.mode=OL;case OL:if(u===0)break e;if(E=w-u,r.offset>E){if(E=r.offset-E,E>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ir;break}E>r.wnext?(E-=r.wnext,P=r.wsize-E):P=r.wnext-E,E>r.length&&(E=r.length),M=r.window}else M=n,P=a-r.offset,E=r.length;E>u&&(E=u),u-=E,r.length-=E;do n[a++]=M[P++];while(--E);r.length===0&&(r.mode=y5);break;case IL:if(u===0)break e;n[a++]=r.length,u--,r.mode=y5;break;case P7:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=i[o++]<<l,l+=8}if(w-=u,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?ta(r.check,n,w,a-w):R7(r.check,n,w,a-w)),w=u,(r.flags?c:TL(c))!==r.check){e.msg="incorrect data check",r.mode=ir;break}c=0,l=0}r.mode=AL;case AL:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=i[o++]<<l,l+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=ir;break}c=0,l=0}r.mode=PL;case PL:z=Mae;break e;case ir:z=ML;break e;case M7:return B7;case Dae:default:return An}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=l,(r.wsize||w!==e.avail_out&&r.mode<ir&&(r.mode<P7||t!==aL))&&UL(e,e.output,e.next_out,w-e.avail_out)?(r.mode=M7,B7):(m-=e.avail_in,w-=e.avail_out,e.total_in+=m,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?ta(r.check,n,w,e.next_out-w):R7(r.check,n,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Qa?128:0)+(r.mode===m5||r.mode===A7?256:0),(m===0&&w===0||t===aL)&&z===Mf&&(z=Cae),z)}function Vae(e){if(!e||!e.state)return An;var t=e.state;return t.window&&(t.window=null),e.state=null,Mf}function Gae(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?An:(r.head=t,t.done=!1,Mf)}function Zae(e,t){var r=t.length,i,n,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==b5)?An:i.mode===b5&&(n=1,n=R7(n,t,r,0),n!==i.check)?ML:(o=UL(e,t,r,r),o?(i.mode=M7,B7):(i.havedict=1,Mf))}fo.inflateReset=DL;fo.inflateReset2=LL;fo.inflateResetKeep=CL;fo.inflateInit=jae;fo.inflateInit2=qL;fo.inflate=Kae;fo.inflateEnd=Vae;fo.inflateGetHeader=Gae;fo.inflateSetDictionary=Zae;fo.inflateInfo="pako inflate (from Nodeca project)"});var jL=k((zve,HL)=>{"use strict";v();HL.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var KL=k(de=>{"use strict";v();var Wi=xs(),Wae=pD(),Z1=$D(),Nf=FL(),zL=jL();for(N7 in zL)de[N7]=zL[N7];var N7;de.NONE=0;de.DEFLATE=1;de.INFLATE=2;de.GZIP=3;de.GUNZIP=4;de.DEFLATERAW=5;de.INFLATERAW=6;de.UNZIP=7;var Yae=31,$ae=139;function mi(e){if(typeof e!="number"||e<de.DEFLATE||e>de.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}mi.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,Wi(this.init_done,"close before init"),Wi(this.mode<=de.UNZIP),this.mode===de.DEFLATE||this.mode===de.GZIP||this.mode===de.DEFLATERAW?Z1.deflateEnd(this.strm):(this.mode===de.INFLATE||this.mode===de.GUNZIP||this.mode===de.INFLATERAW||this.mode===de.UNZIP)&&Nf.inflateEnd(this.strm),this.mode=de.NONE,this.dictionary=null};mi.prototype.write=function(e,t,r,i,n,o,a){return this._write(!0,e,t,r,i,n,o,a)};mi.prototype.writeSync=function(e,t,r,i,n,o,a){return this._write(!1,e,t,r,i,n,o,a)};mi.prototype._write=function(e,t,r,i,n,o,a,s){if(Wi.equal(arguments.length,8),Wi(this.init_done,"write before init"),Wi(this.mode!==de.NONE,"already finalized"),Wi.equal(!1,this.write_in_progress,"write already in progress"),Wi.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,Wi.equal(!1,t===void 0,"must provide flush value"),this.write_in_progress=!0,t!==de.Z_NO_FLUSH&&t!==de.Z_PARTIAL_FLUSH&&t!==de.Z_SYNC_FLUSH&&t!==de.Z_FULL_FLUSH&&t!==de.Z_FINISH&&t!==de.Z_BLOCK)throw new Error("Invalid flush value");if(r==null&&(r=h.Buffer.alloc(0),n=0,i=0),this.strm.avail_in=n,this.strm.input=r,this.strm.next_in=i,this.strm.avail_out=s,this.strm.output=o,this.strm.next_out=a,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var u=this;return A.default.nextTick(function(){u._process(),u._after()}),this};mi.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]};mi.prototype._process=function(){var e=null;switch(this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=Z1.deflate(this.strm,this.flush);break;case de.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(e===null)break;if(this.strm.input[e]===Yae){if(this.gzip_id_bytes_read=1,e++,this.strm.avail_in===1)break}else{this.mode=de.INFLATE;break}case 1:if(e===null)break;this.strm.input[e]===$ae?(this.gzip_id_bytes_read=2,this.mode=de.GUNZIP):this.mode=de.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:for(this.err=Nf.inflate(this.strm,this.flush),this.err===de.Z_NEED_DICT&&this.dictionary&&(this.err=Nf.inflateSetDictionary(this.strm,this.dictionary),this.err===de.Z_OK?this.err=Nf.inflate(this.strm,this.flush):this.err===de.Z_DATA_ERROR&&(this.err=de.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===de.GUNZIP&&this.err===de.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=Nf.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}};mi.prototype._checkError=function(){switch(this.err){case de.Z_OK:case de.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===de.Z_FINISH)return this._error("unexpected end of file"),!1;break;case de.Z_STREAM_END:break;case de.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0};mi.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}};mi.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()};mi.prototype.init=function(e,t,r,i,n){Wi(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),Wi(e>=8&&e<=15,"invalid windowBits"),Wi(t>=-1&&t<=9,"invalid compression level"),Wi(r>=1&&r<=9,"invalid memlevel"),Wi(i===de.Z_FILTERED||i===de.Z_HUFFMAN_ONLY||i===de.Z_RLE||i===de.Z_FIXED||i===de.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,r,i,n),this._setDictionary()};mi.prototype.params=function(){throw new Error("deflateParams Not supported")};mi.prototype.reset=function(){this._reset(),this._setDictionary()};mi.prototype._init=function(e,t,r,i,n){switch(this.level=e,this.windowBits=t,this.memLevel=r,this.strategy=i,this.flush=de.Z_NO_FLUSH,this.err=de.Z_OK,(this.mode===de.GZIP||this.mode===de.GUNZIP)&&(this.windowBits+=16),this.mode===de.UNZIP&&(this.windowBits+=32),(this.mode===de.DEFLATERAW||this.mode===de.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new Wae,this.mode){case de.DEFLATE:case de.GZIP:case de.DEFLATERAW:this.err=Z1.deflateInit2(this.strm,this.level,de.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case de.INFLATE:case de.GUNZIP:case de.INFLATERAW:case de.UNZIP:this.err=Nf.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==de.Z_OK&&this._error("Init error"),this.dictionary=n,this.write_in_progress=!1,this.init_done=!0};mi.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:this.err=Z1.deflateSetDictionary(this.strm,this.dictionary);break;default:break}this.err!==de.Z_OK&&this._error("Failed to set dictionary")}};mi.prototype._reset=function(){switch(this.err=de.Z_OK,this.mode){case de.DEFLATE:case de.DEFLATERAW:case de.GZIP:this.err=Z1.deflateReset(this.strm);break;case de.INFLATE:case de.INFLATERAW:case de.GUNZIP:this.err=Nf.inflateReset(this.strm);break;default:break}this.err!==de.Z_OK&&this._error("Failed to reset stream")};de.Zlib=mi});var L7=k(we=>{"use strict";v();var ra=zt().Buffer,WL=Qd().Transform,De=KL(),Zs=tn(),W1=xs().ok,D7=zt().kMaxLength,YL="Cannot create final Buffer. It would be larger than 0x"+D7.toString(16)+" bytes";De.Z_MIN_WINDOWBITS=8;De.Z_MAX_WINDOWBITS=15;De.Z_DEFAULT_WINDOWBITS=15;De.Z_MIN_CHUNK=64;De.Z_MAX_CHUNK=1/0;De.Z_DEFAULT_CHUNK=16*1024;De.Z_MIN_MEMLEVEL=1;De.Z_MAX_MEMLEVEL=9;De.Z_DEFAULT_MEMLEVEL=8;De.Z_MIN_LEVEL=-1;De.Z_MAX_LEVEL=9;De.Z_DEFAULT_LEVEL=De.Z_DEFAULT_COMPRESSION;var VL=Object.keys(De);for(_5=0;_5<VL.length;_5++)w5=VL[_5],w5.match(/^Z/)&&Object.defineProperty(we,w5,{enumerable:!0,value:De[w5],writable:!1});var w5,_5,x5={Z_OK:De.Z_OK,Z_STREAM_END:De.Z_STREAM_END,Z_NEED_DICT:De.Z_NEED_DICT,Z_ERRNO:De.Z_ERRNO,Z_STREAM_ERROR:De.Z_STREAM_ERROR,Z_DATA_ERROR:De.Z_DATA_ERROR,Z_MEM_ERROR:De.Z_MEM_ERROR,Z_BUF_ERROR:De.Z_BUF_ERROR,Z_VERSION_ERROR:De.Z_VERSION_ERROR},GL=Object.keys(x5);for(S5=0;S5<GL.length;S5++)C7=GL[S5],x5[x5[C7]]=C7;var C7,S5;Object.defineProperty(we,"codes",{enumerable:!0,value:Object.freeze(x5),writable:!1});we.Deflate=Cf;we.Inflate=Df;we.Gzip=Lf;we.Gunzip=qf;we.DeflateRaw=Uf;we.InflateRaw=Ff;we.Unzip=Hf;we.createDeflate=function(e){return new Cf(e)};we.createInflate=function(e){return new Df(e)};we.createDeflateRaw=function(e){return new Uf(e)};we.createInflateRaw=function(e){return new Ff(e)};we.createGzip=function(e){return new Lf(e)};we.createGunzip=function(e){return new qf(e)};we.createUnzip=function(e){return new Hf(e)};we.deflate=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Cf(t),e,r)};we.deflateSync=function(e,t){return zf(new Cf(t),e)};we.gzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Lf(t),e,r)};we.gzipSync=function(e,t){return zf(new Lf(t),e)};we.deflateRaw=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Uf(t),e,r)};we.deflateRawSync=function(e,t){return zf(new Uf(t),e)};we.unzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Hf(t),e,r)};we.unzipSync=function(e,t){return zf(new Hf(t),e)};we.inflate=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Df(t),e,r)};we.inflateSync=function(e,t){return zf(new Df(t),e)};we.gunzip=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new qf(t),e,r)};we.gunzipSync=function(e,t){return zf(new qf(t),e)};we.inflateRaw=function(e,t,r){return typeof t=="function"&&(r=t,t={}),jf(new Ff(t),e,r)};we.inflateRawSync=function(e,t){return zf(new Ff(t),e)};function jf(e,t,r){var i=[],n=0;e.on("error",a),e.on("end",s),e.end(t),o();function o(){for(var u;(u=e.read())!==null;)i.push(u),n+=u.length;e.once("readable",o)}function a(u){e.removeListener("end",s),e.removeListener("readable",o),r(u)}function s(){var u,c=null;n>=D7?c=new RangeError(YL):u=ra.concat(i,n),i=[],e.close(),r(c,u)}}function zf(e,t){if(typeof t=="string"&&(t=ra.from(t)),!ra.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function Cf(e){if(!(this instanceof Cf))return new Cf(e);hr.call(this,e,De.DEFLATE)}function Df(e){if(!(this instanceof Df))return new Df(e);hr.call(this,e,De.INFLATE)}function Lf(e){if(!(this instanceof Lf))return new Lf(e);hr.call(this,e,De.GZIP)}function qf(e){if(!(this instanceof qf))return new qf(e);hr.call(this,e,De.GUNZIP)}function Uf(e){if(!(this instanceof Uf))return new Uf(e);hr.call(this,e,De.DEFLATERAW)}function Ff(e){if(!(this instanceof Ff))return new Ff(e);hr.call(this,e,De.INFLATERAW)}function Hf(e){if(!(this instanceof Hf))return new Hf(e);hr.call(this,e,De.UNZIP)}function ZL(e){return e===De.Z_NO_FLUSH||e===De.Z_PARTIAL_FLUSH||e===De.Z_SYNC_FLUSH||e===De.Z_FULL_FLUSH||e===De.Z_FINISH||e===De.Z_BLOCK}function hr(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||we.Z_DEFAULT_CHUNK,WL.call(this,e),e.flush&&!ZL(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!ZL(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||De.Z_NO_FLUSH,this._finishFlushFlag=typeof e.finishFlush<"u"?e.finishFlush:De.Z_FINISH,e.chunkSize&&(e.chunkSize<we.Z_MIN_CHUNK||e.chunkSize>we.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<we.Z_MIN_WINDOWBITS||e.windowBits>we.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<we.Z_MIN_LEVEL||e.level>we.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<we.Z_MIN_MEMLEVEL||e.memLevel>we.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=we.Z_FILTERED&&e.strategy!=we.Z_HUFFMAN_ONLY&&e.strategy!=we.Z_RLE&&e.strategy!=we.Z_FIXED&&e.strategy!=we.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!ra.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new De.Zlib(t);var i=this;this._hadError=!1,this._handle.onerror=function(a,s){E5(i),i._hadError=!0;var u=new Error(a);u.errno=s,u.code=we.codes[s],i.emit("error",u)};var n=we.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(n=e.level);var o=we.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(o=e.strategy),this._handle.init(e.windowBits||we.Z_DEFAULT_WINDOWBITS,n,e.memLevel||we.Z_DEFAULT_MEMLEVEL,o,e.dictionary),this._buffer=ra.allocUnsafe(this._chunkSize),this._offset=0,this._level=n,this._strategy=o,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}Zs.inherits(hr,WL);hr.prototype.params=function(e,t,r){if(e<we.Z_MIN_LEVEL||e>we.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=we.Z_FILTERED&&t!=we.Z_HUFFMAN_ONLY&&t!=we.Z_RLE&&t!=we.Z_FIXED&&t!=we.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(De.Z_SYNC_FLUSH,function(){W1(i._handle,"zlib binding closed"),i._handle.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else A.default.nextTick(r)};hr.prototype.reset=function(){return W1(this._handle,"zlib binding closed"),this._handle.reset()};hr.prototype._flush=function(e){this._transform(ra.alloc(0),"",e)};hr.prototype.flush=function(e,t){var r=this,i=this._writableState;(typeof e=="function"||e===void 0&&!t)&&(t=e,e=De.Z_FULL_FLUSH),i.ended?t&&A.default.nextTick(t):i.ending?t&&this.once("end",t):i.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(ra.alloc(0),"",t))};hr.prototype.close=function(e){E5(this,e),A.default.nextTick(Xae,this)};function E5(e,t){t&&A.default.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function Xae(e){e.emit("close")}hr.prototype._transform=function(e,t,r){var i,n=this._writableState,o=n.ending||n.ended,a=o&&(!e||n.length===e.length);if(e!==null&&!ra.isBuffer(e))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));a?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||De.Z_NO_FLUSH)),this._processChunk(e,i,r)};hr.prototype._processChunk=function(e,t,r){var i=e&&e.length,n=this._chunkSize-this._offset,o=0,a=this,s=typeof r=="function";if(!s){var u=[],c=0,l;this.on("error",function(M){l=M}),W1(this._handle,"zlib binding closed");do var m=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,n);while(!this._hadError&&P(m[0],m[1]));if(this._hadError)throw l;if(c>=D7)throw E5(this),new RangeError(YL);var w=ra.concat(u,c);return E5(this),w}W1(this._handle,"zlib binding closed");var E=this._handle.write(t,e,o,i,this._buffer,this._offset,n);E.buffer=e,E.callback=P;function P(M,D){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var L=n-D;if(W1(L>=0,"have should not go down"),L>0){var U=a._buffer.slice(a._offset,a._offset+L);a._offset+=L,s?a.push(U):(u.push(U),c+=U.length)}if((D===0||a._offset>=a._chunkSize)&&(n=a._chunkSize,a._offset=0,a._buffer=ra.allocUnsafe(a._chunkSize)),D===0){if(o+=i-M,i=M,!s)return!0;var K=a._handle.write(t,e,o,i,a._buffer,a._offset,a._chunkSize);K.callback=P,K.buffer=e;return}if(!s)return!1;r()}}};Zs.inherits(Cf,hr);Zs.inherits(Df,hr);Zs.inherits(Lf,hr);Zs.inherits(qf,hr);Zs.inherits(Uf,hr);Zs.inherits(Ff,hr);Zs.inherits(Hf,hr)});var eq=k(($ve,QL)=>{"use strict";v();var q7=u7(),Yve=_r(),$L=L7(),Jae=8*1024*1024;function XL(e,t){var r=t&&t.maxDecompressedBytes||Jae;return $L.gunzipSync(h.Buffer.from(e,"base64"),{maxOutputLength:r})}async function JL(e,t){if(!t.expectedIssuerDid)throw new Error("expectedIssuerDid is required to verify a status list (issuer pinning); refusing to read revocation state from an unpinned/unverified JWT");var r=t.didResolver;if(!r){var i=t.issuerJwks||(t.issuerPublicJwk?{keys:[t.issuerPublicJwk]}:null);if(!i)throw new Error("Provide params.didResolver, params.issuerJwks, or params.issuerPublicJwk to verify the status list signature");r=async function(){return{jwks:i}}}var n=await q7.verifyVcJwt(e,{didResolver:r,expectedIssuerDid:t.expectedIssuerDid,allowedAlgs:t.allowedAlgs,allowLegacyDER:t.allowLegacyDER,clockToleranceSec:t.clockToleranceSec});if(!n.valid)throw new Error("Status list signature verification failed: "+(n.error||"invalid signature"));return n.payload}async function Qae(e){if(!e.issuerDid||!e.privateJwk)throw new Error("issuerDid and privateJwk are required");var t=e.listId||e.issuerDid+"/status/"+Date.now(),r=e.listSize||1e5,i=Math.ceil(r/8),n=h.Buffer.alloc(i,0),o=L7(),a=o.gzipSync(n),s=a.toString("base64"),u={"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/vc/status-list/2021/v1"],type:["VerifiableCredential","StatusList2021Credential"],issuer:e.issuerDid,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,type:"StatusList2021",statusPurpose:"revocation",encodedList:s}},c=await q7.issueVcJwt({issuerDid:e.issuerDid,subjectId:t,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:u.credentialSubject,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"});return{listVcJwt:c.jwt,listId:t}}async function ese(e){if(!e.listVcJwt||e.index===void 0||!e.status||!e.privateJwk)throw new Error("listVcJwt, index, status, and privateJwk are required");var t=await JL(e.listVcJwt,e),r=t.vc.credentialSubject.encodedList,i=XL(r,e),n=Math.floor(e.index/8),o=e.index%8;if(n>=i.length)throw new Error("Index out of range");var a=e.status==="revoked"||e.status==="suspended"?1:0;a===1?i[n]|=1<<o:i[n]&=~(1<<o);var s=$L.gzipSync(i),u=s.toString("base64"),c={id:t.vc.credentialSubject.id,type:"StatusList2021",statusPurpose:"revocation",encodedList:u},l=await q7.issueVcJwt({issuerDid:t.iss,subjectId:t.vc.credentialSubject.id,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:c,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"});return{listVcJwt:l.jwt}}async function tse(e){if(!e.listVcJwt||e.index===void 0)throw new Error("listVcJwt and index are required");var t=await JL(e.listVcJwt,e),r=t.vc.credentialSubject.encodedList,i=XL(r,e),n=Math.floor(e.index/8),o=e.index%8;if(n>=i.length)throw new Error("Index out of range");var a=i[n]>>o&1;return a===1?"revoked":"valid"}QL.exports={createStatusList:Qae,updateStatusList:ese,getCredentialStatusEntry:tse}});var iq=k((Jve,rq)=>{"use strict";v();var rse=_r();function tq(e){var t;if(typeof e=="string")t=h.Buffer.from(e,"utf8");else if(h.Buffer.isBuffer(e))t=e;else if(e instanceof Uint8Array)t=h.Buffer.from(e);else throw new Error("Data must be string, Buffer, or Uint8Array");return rse.createHash("sha256").update(t).digest("hex")}function ise(e){if(!e.kind||!e.hash||!e.issuerDid)throw new Error("kind, hash, and issuerDid are required");var t=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];if(t.indexOf(e.kind)===-1)throw new Error("Invalid kind. Must be one of: "+t.join(", "));if(!/^[a-fA-F0-9]{64}$/.test(e.hash))throw new Error("Invalid hash format. Must be 64 hex characters");var r={protocol:"SmartLedger",version:"1.0",type:e.kind,hash:e.hash,issuer:e.issuerDid,timestamp:e.issuedAt||new Date().toISOString()};return{json:JSON.stringify(r)}}function nse(e,t){var r=tq(e);return r===t}function ose(e){try{var t=JSON.parse(e);if(t.protocol!=="SmartLedger")return{valid:!1,error:"Invalid protocol"};var r=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];return r.indexOf(t.type)===-1?{valid:!1,error:"Invalid anchor type"}:/^[a-fA-F0-9]{64}$/.test(t.hash)?{valid:!0,protocol:t.protocol,version:t.version,type:t.type,hash:t.hash,issuer:t.issuer,timestamp:t.timestamp}:{valid:!1,error:"Invalid hash format"}}catch(i){return{valid:!1,error:"Failed to parse anchor payload: "+i.message}}}rq.exports={sha256Hex:tq,buildAnchorPayload:ise,verifyAnchorHash:nse,parseAnchorPayload:ose}});var uq=k((tme,sq)=>{"use strict";v();var ia=Ae(),U7=ia.crypto.Hash,F7=ia.crypto.ECDSA,nq=ia.crypto.Signature,H7=ia.PrivateKey,kr=ia.util.preconditions,eme=xt();function oq(e,t){if(t=t||{},t.issuerPublicKey)return t.issuerPublicKey instanceof ia.PublicKey?t.issuerPublicKey:ia.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if(typeof r!="string")return null;try{var i=r.split("#")[0].split(":")[2];return i?ia.PublicKey.fromString(i):null}catch{return null}}var Vl={PROPERTY_TITLE:"PropertyTitle",VEHICLE_TITLE:"VehicleTitle",INTELLECTUAL_PROPERTY:"IntellectualProperty",MUSIC_LICENSE:"MusicLicense",SOFTWARE_LICENSE:"SoftwareLicense",FINANCIAL_INSTRUMENT:"FinancialInstrument",PROMISSORY_NOTE:"PromissoryNote",BOND:"Bond",EQUITY_SHARE:"EquityShare",PROFESSIONAL_LICENSE:"ProfessionalLicense",REGULATORY_PERMIT:"RegulatoryPermit",ACCESS_RIGHT:"AccessRight",VOTING_RIGHT:"VotingRight",ROYALTY_RIGHT:"RoyaltyRight",USAGE_RIGHT:"UsageRight"},aq={create:function(e,t,r,i,n,o){o=o||{},kr.checkArgument(typeof e=="string","Right type must be string"),kr.checkArgument(typeof t=="string","Issuer DID must be string"),kr.checkArgument(typeof r=="string","Subject DID must be string"),kr.checkArgument(i&&typeof i=="object","Claim must be object");var a=Object.values(Vl);kr.checkArgument(a.includes(e),"Invalid right type: "+e);var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightToken",e],issuer:t,issuanceDate:new Date().toISOString(),credentialSubject:{id:r,rightType:e,claim:i,jurisdiction:o.jurisdiction||"US",purpose:o.purpose||"legal_right",validFrom:o.validFrom||new Date().toISOString(),validUntil:o.validUntil||null,transferable:o.transferable!==!1,revocable:o.revocable!==!1}};return o.metadata&&(s.credentialSubject.metadata=o.metadata),s},prepareRightToken:function(e,t,r,i,n,o){o=o||{},kr.checkArgument(typeof e=="string","Right type must be string"),kr.checkArgument(typeof t=="string","Issuer DID must be string"),kr.checkArgument(typeof r=="string","Subject DID must be string"),kr.checkArgument(i&&typeof i=="object","Claim must be object"),kr.checkArgument(n instanceof H7,"Invalid issuer private key");var a=Object.values(Vl);kr.checkArgument(a.includes(e),"Invalid right type: "+e);try{var s=this.create(e,t,r,i,n,o),u=this._signToken(s,n);return{success:!0,rightToken:u,tokenHash:u.tokenHash,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction},externalOperations:{storeToken:{endpoint:"POST /rights/tokens",data:{token:u,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction}}},indexToken:{endpoint:"POST /rights/index",data:{tokenId:u.id,tokenHash:u.tokenHash,type:e,issuer:t,subject:r,issuedAt:u.issuanceDate}},notifyParties:{endpoint:"POST /notifications/right-issued",data:{tokenId:u.id,issuer:t,subject:r,rightType:e}}}}}catch(c){return{success:!1,error:c.message}}},prepareRightTokenVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateRightType(e,r),t.requireJurisdiction&&this._validateJurisdiction(e,t.allowedJurisdictions,r);var n={valid:r.length===0,errors:r,warnings:i,issuerDID:e.issuer,subjectDID:e.credentialSubject?e.credentialSubject.id:null,rightType:e.credentialSubject?e.credentialSubject.rightType:null,transferable:e.credentialSubject?e.credentialSubject.transferable:null,revocable:e.credentialSubject?e.credentialSubject.revocable:null,verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /rights/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/right-verification",data:{tokenId:e.id,rightType:n.rightType,issuer:n.issuerDID,subject:n.subjectDID,result:n.valid,verifiedAt:n.verifiedAt}},updateTokenStatus:n.valid?{endpoint:"PUT /rights/tokens/"+e.id+"/status",data:{status:"VERIFIED",verifiedAt:n.verifiedAt}}:null}}}catch(o){return{success:!1,error:"Verification preparation failed: "+o.message}}},prepareRightTokenTransfer:function(e,t,r,i){i=i||{},kr.checkArgument(e&&typeof e=="object","Invalid token"),kr.checkArgument(typeof t=="string","New owner DID must be string"),kr.checkArgument(r instanceof H7,"Invalid current owner key");try{var n=this.prepareRightTokenVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot transfer invalid token: "+n.verification.errors.join(", ")};if(!e.credentialSubject.transferable)return{success:!1,error:"Token is not transferable"};var o=e.credentialSubject&&e.credentialSubject.id,a=oq({issuer:o},{issuerPublicKey:i.currentOwnerPublicKey});if(!a)return{success:!1,error:"Cannot resolve current owner public key from token.credentialSubject.id; pass options.currentOwnerPublicKey"};if(r.toPublicKey().toString()!==a.toString())return{success:!1,error:"Unauthorized transfer: signing key does not match the current owner"};var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightTransfer"],issuer:e.credentialSubject.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,originalToken:e.id,transferFrom:e.credentialSubject.id,transferTo:t,transferDate:new Date().toISOString(),transferReason:i.reason||"ownership_transfer",consideration:i.consideration||null}},u=this._signToken(s,r),c=JSON.parse(JSON.stringify(e));c.id="urn:uuid:"+this._generateUUID(),c.issuanceDate=new Date().toISOString(),c.credentialSubject.id=t,c.credentialSubject.transferHistory=c.credentialSubject.transferHistory||[],c.credentialSubject.transferHistory.push({transferId:u.id,transferDate:u.issuanceDate,from:e.credentialSubject.id,to:t}),delete c.proof;var l=this._signToken(c,r);return{success:!0,newToken:l,transferProof:u,transferId:u.id,externalOperations:{recordTransfer:{endpoint:"POST /rights/transfers",data:{originalTokenId:e.id,newTokenId:l.id,transferProof:u,fromOwner:e.credentialSubject.id,toOwner:t,transferDate:u.issuanceDate}},updateOwnership:{endpoint:"PUT /rights/tokens/"+e.id+"/ownership",data:{newOwner:t,transferId:u.id,transferDate:u.issuanceDate,previousOwner:e.credentialSubject.id}},notifyParties:{endpoint:"POST /notifications/right-transferred",data:{originalTokenId:e.id,newTokenId:l.id,fromOwner:e.credentialSubject.id,toOwner:t,rightType:e.credentialSubject.rightType}},auditTransfer:{endpoint:"POST /audit/right-transfer",data:{originalTokenId:e.id,newTokenId:l.id,transferId:u.id,fromOwner:e.credentialSubject.id,toOwner:t,transferredAt:u.issuanceDate}}}}}catch(m){return{success:!1,error:m.message}}},prepareObligationToken:function(e,t,r,i){kr.checkArgument(e&&typeof e=="object","Invalid right token"),kr.checkArgument(typeof t=="string","Obligor DID must be string"),kr.checkArgument(r&&typeof r=="object","Obligation must be object"),kr.checkArgument(i instanceof H7,"Invalid issuer key");try{var n={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken"],issuer:e.issuer,issuanceDate:new Date().toISOString(),credentialSubject:{id:t,obligationType:"correlative_obligation",correlativeRight:e.id,rightHolder:e.credentialSubject.id,obligation:r,jurisdiction:e.credentialSubject.jurisdiction,purpose:e.credentialSubject.purpose}},o=this._signToken(n,i);return{success:!0,obligationToken:o,correlativeRight:e.id,externalOperations:{storeObligation:{endpoint:"POST /obligations/tokens",data:{obligationToken:o,correlativeRightId:e.id,obligor:t,rightHolder:e.credentialSubject.id}},linkToRight:{endpoint:"POST /rights/tokens/"+e.id+"/obligations",data:{obligationId:o.id,obligor:t,obligationType:"correlative_obligation"}},notifyObligor:{endpoint:"POST /notifications/obligation-created",data:{obligationId:o.id,obligor:t,rightHolder:e.credentialSubject.id,correlativeRight:e.id}}}}}catch(a){return{success:!1,error:a.message}}},prepareRightTypeValidation:function(e){kr.checkArgument(typeof e=="string","Right type must be string");var t=Object.values(Vl),r=t.includes(e);return{success:!0,validation:{type:e,valid:r,availableTypes:t,category:this._categorizeRightType(e),description:this._getRightTypeDescription(e)},externalOperations:{validateType:{endpoint:"POST /rights/validate-type",data:{type:e,valid:r}}}}},_categorizeRightType:function(e){var t={PropertyTitle:"PROPERTY_RIGHT",VehicleTitle:"PROPERTY_RIGHT",IntellectualProperty:"IP_RIGHT",MusicLicense:"IP_RIGHT",SoftwareLicense:"IP_RIGHT",FinancialInstrument:"FINANCIAL_RIGHT",PromissoryNote:"FINANCIAL_RIGHT",Bond:"FINANCIAL_RIGHT",EquityShare:"FINANCIAL_RIGHT",ProfessionalLicense:"LICENSE_RIGHT",RegulatoryPermit:"LICENSE_RIGHT",AccessRight:"ACCESS_RIGHT",VotingRight:"GOVERNANCE_RIGHT",RoyaltyRight:"IP_RIGHT",UsageRight:"ACCESS_RIGHT"};return t[e]||"UNKNOWN"},_getRightTypeDescription:function(e){var t={PropertyTitle:"Legal ownership of real estate property",VehicleTitle:"Legal ownership of motor vehicle",IntellectualProperty:"Rights to intellectual property assets",MusicLicense:"License for music performance and usage",SoftwareLicense:"License for software usage and distribution",FinancialInstrument:"Rights related to financial instruments",PromissoryNote:"Promise to pay a specified amount",Bond:"Debt security representing loan",EquityShare:"Ownership stake in company",ProfessionalLicense:"License for professional practice",RegulatoryPermit:"Permit for regulated activities",AccessRight:"Right to access resources or locations",VotingRight:"Right to participate in governance",RoyaltyRight:"Right to receive royalty payments",UsageRight:"Right to use specific assets or services"};return t[e]||"Unknown right type"},getRightTypes:function(){return Vl},verifyToken:function(e,t){var r=[];try{if(kr.checkArgument(e&&typeof e=="object","Invalid token"),!e.proof||!e.proof.jws)return r.push("Missing signature proof"),{valid:!1,errors:r};var i=t instanceof ia.PublicKey?t:ia.PublicKey.fromString(t),n=this._canonicalizeToken(e),o=U7.sha256(h.Buffer.from(n));if(e.tokenHash&&e.tokenHash!==o.toString("hex"))return r.push("Token hash mismatch"),{valid:!1,errors:r};var a=e.proof.jws.split(".");if(a.length!==3||!a[2])return r.push("Malformed JWS"),{valid:!1,errors:r};var s=nq.fromDER(h.Buffer.from(a[2],"base64url")),u=new F7;return u.hashbuf=o,u.sig=s,u.pubkey=i,u.verify()||r.push("Signature verification failed"),{valid:r.length===0,errors:r,tokenHash:o.toString("hex"),verifiedAt:new Date().toISOString()}}catch(c){return r.push(c.message),{valid:!1,errors:r}}},_signToken:function(e,t){var r=this._canonicalizeToken(e),i=U7.sha256(h.Buffer.from(r)),n=new F7;n.hashbuf=i,n.privkey=t,n.pubkey=t.toPublicKey(),n.sign();var o=n.sig,a={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(i,o)},s=JSON.parse(JSON.stringify(e));return s.proof=a,s.tokenHash=i.toString("hex"),s},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=t.toDER().toString("base64url");return i+".."+n},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),(!e.type||!Array.isArray(e.type))&&t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws){t.push("Missing signature proof");return}var i=this._canonicalizeToken(e),n=U7.sha256(h.Buffer.from(i));if(e.tokenHash&&e.tokenHash!==n.toString("hex")){t.push("Token hash mismatch");return}var o=oq(e,r);if(!o){t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");return}var a=e.proof.jws.split(".");if(a.length!==3||!a[2]){t.push("Malformed JWS");return}var s=nq.fromDER(h.Buffer.from(a[2],"base64url")),u=new F7;u.hashbuf=n,u.sig=s,u.pubkey=o,u.verify()!==!0&&t.push("Signature verification failed")}catch(c){t.push("Signature verification failed: "+c.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date,n=new Date(e.issuanceDate);if(n>i&&t.push("Token issued in the future"),e.credentialSubject.validFrom){var o=new Date(e.credentialSubject.validFrom);i<o&&r.push("Token not yet valid")}if(e.credentialSubject.validUntil){var a=new Date(e.credentialSubject.validUntil);i>a&&t.push("Token expired")}},_validateRightType:function(e,t){if(!e.credentialSubject.rightType){t.push("Missing rightType");return}var r=Object.values(Vl);r.includes(e.credentialSubject.rightType)||t.push("Invalid right type: "+e.credentialSubject.rightType)},_validateJurisdiction:function(e,t,r){if(!e.credentialSubject.jurisdiction){r.push("Missing jurisdiction");return}t&&Array.isArray(t)&&(t.includes(e.credentialSubject.jurisdiction)||r.push("Jurisdiction not allowed: "+e.credentialSubject.jurisdiction))},_generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}};aq.RightTypes=Vl;sq.exports=aq});var lq=k((ime,cq)=>{"use strict";v();var fq=Ae(),Gl=fq.crypto.Hash,Yi=fq.util.preconditions,Kf={PropertyTitle:{title:"Property Title",description:"Real estate property ownership title",type:"object",required:["propertyId","address","ownershipType"],properties:{propertyId:{type:"string",description:"Unique property identifier"},address:{type:"object",required:["street","city","state","country"],properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"string"},postalCode:{type:"string"}}},ownershipType:{type:"string",enum:["fee_simple","leasehold","joint_tenancy","tenancy_in_common"]},titleNumber:{type:"string"},registeredDate:{type:"string",format:"date-time"},legalDescription:{type:"string"},encumbrances:{type:"array",items:{type:"object",properties:{type:{type:"string"},amount:{type:"number"},description:{type:"string"}}}}}},VehicleTitle:{title:"Vehicle Title",description:"Motor vehicle ownership title",type:"object",required:["vin","make","model","year"],properties:{vin:{type:"string",pattern:"^[A-HJ-NPR-Z0-9]{17}$",description:"Vehicle Identification Number"},make:{type:"string"},model:{type:"string"},year:{type:"integer",minimum:1900,maximum:2030},titleNumber:{type:"string"},registeredState:{type:"string"},mileage:{type:"integer",minimum:0},color:{type:"string"},fuelType:{type:"string",enum:["gasoline","diesel","electric","hybrid","other"]},liens:{type:"array",items:{type:"object",properties:{lienholderName:{type:"string"},lienAmount:{type:"number"},lienDate:{type:"string",format:"date"}}}}}},PromissoryNote:{title:"Promissory Note",description:"Legal promise to pay a specified amount",type:"object",required:["principal","interestRate","maturityDate","borrower","lender"],properties:{principalAmount:{type:"number",minimum:0,description:"Principal amount in base currency units"},currency:{type:"string",default:"USD"},interestRate:{type:"number",minimum:0,maximum:100,description:"Annual interest rate percentage"},maturityDate:{type:"string",format:"date",description:"Date when principal and interest are due"},payee:{type:"string",description:"DID of the payee (creditor)"},payor:{type:"string",description:"DID of the payor (debtor)"},paymentSchedule:{type:"string",enum:["lump_sum","monthly","quarterly","annually"]},collateral:{type:"array",items:{type:"object",properties:{description:{type:"string"},value:{type:"number"},type:{type:"string"}}}},defaultProvisions:{type:"string"},governingLaw:{type:"string"}}},IntellectualProperty:{title:"Intellectual Property",description:"Intellectual property rights and licensing",type:"object",required:["ipType","title","registrationNumber"],properties:{ipType:{type:"string",enum:["patent","trademark","copyright","trade_secret"]},title:{type:"string"},creator:{type:"string",description:"Creator DID"},registrationNumber:{type:"string"},registrationDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},jurisdiction:{type:"string"},description:{type:"string"},claims:{type:"array",items:{type:"string"}},priorArt:{type:"array",items:{type:"object",properties:{reference:{type:"string"},date:{type:"string",format:"date"},relevance:{type:"string"}}}}}},ProfessionalLicense:{title:"Professional License",description:"Professional practice license or certification",type:"object",required:["licenseType","licenseNumber","issuingAuthority","expirationDate"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},licensee:{type:"string",description:"Licensee DID"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},renewalDate:{type:"string",format:"date"},jurisdiction:{type:"string"},scope:{type:"string"},restrictions:{type:"array",items:{type:"string"}},continuing_education:{type:"object",properties:{hours_required:{type:"integer"},deadline:{type:"string",format:"date"},completed_hours:{type:"integer"}}}}},MusicLicense:{title:"Music License",description:"Music performance and usage licensing",type:"object",required:["songTitle","artist","licenseType","royaltyRate"],properties:{workTitle:{type:"string"},composer:{type:"string",description:"Composer DID"},performer:{type:"string",description:"Performer DID"},licenseType:{type:"string",enum:["mechanical","performance","synchronization","master_use"]},territory:{type:"string"},duration:{type:"string"},royaltyRate:{type:"number",minimum:0,maximum:100},advancePayment:{type:"number",minimum:0},exclusivity:{type:"boolean"},mediaTypes:{type:"array",items:{type:"string",enum:["cd","vinyl","digital","streaming","broadcast","film","tv"]}},usage_restrictions:{type:"string"},copyrightNotice:{type:"string"}}}},ase={prepareClaimValidation:function(e,t){try{Yi.checkArgument(e&&typeof e=="object","Invalid claim"),Yi.checkArgument(typeof t=="string","Schema name must be string");var r=Kf[t];if(!r)return{success:!1,error:"Unknown schema: "+t};var i=[],n=[];this._validateObject(e,r,"",i,n);var o={valid:i.length===0,errors:i,warnings:n,schema:t,claimHash:this.hash(e),canonical:this.canonicalize(e)};return{success:!0,validation:o,claim:e,schema:r,externalOperations:{store:{endpoint:"POST /claims/validate",data:{claim:e,validation:o,schema:t}},index:{endpoint:"POST /claims/index",data:{claimHash:o.claimHash,schemaName:t,valid:o.valid}}}}}catch(a){return{success:!1,error:"Validation preparation failed: "+a.message}}},prepareClaimAttestation:function(e,t,r){try{Yi.checkArgument(e&&typeof e=="object","Invalid claim"),Yi.checkArgument(typeof t=="string","Schema name must be string"),Yi.checkArgument(r&&typeof r=="object","Invalid attestor");var i=this.prepareClaimValidation(e,t);if(!i.success||!i.validation.valid)return{success:!1,error:"Cannot attest invalid claim",validation:i};var n={type:"LTP_CLAIM_ATTESTATION",claimHash:i.validation.claimHash,schemaName:t,attestor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},attestedAt:new Date().toISOString(),confidence:r.confidence||100,evidence:r.evidence||null,notes:r.notes||null},o=Gl.sha256(h.Buffer.from(this.canonicalize(n))).toString("hex");return n.attestationHash=o,{success:!0,attestation:n,claim:e,validation:i.validation,externalOperations:{storeAttestation:{endpoint:"POST /claims/"+i.validation.claimHash+"/attestations",data:n},notifyStakeholders:{endpoint:"POST /notifications/claim-attested",data:{claimHash:i.validation.claimHash,attestorDid:n.attestor.did,attestationHash:o}}}}}catch(a){return{success:!1,error:"Attestation preparation failed: "+a.message}}},prepareClaimDispute:function(e,t,r){try{Yi.checkArgument(typeof e=="string","Claim hash must be string"),Yi.checkArgument(t&&typeof t=="object","Invalid disputant"),Yi.checkArgument(r&&typeof r=="object","Invalid dispute");var i={type:"LTP_CLAIM_DISPUTE",claimHash:e,disputant:{did:t.did||t.id,name:t.name||"Unknown",jurisdiction:t.jurisdiction||null},dispute:{reason:r.reason||"UNSPECIFIED",category:r.category||"ACCURACY",description:r.description||"",evidence:r.evidence||null,requestedAction:r.requestedAction||"REVIEW"},disputedAt:new Date().toISOString(),status:"FILED",priority:r.priority||"NORMAL"},n=Gl.sha256(h.Buffer.from(this.canonicalize(i))).toString("hex");return i.disputeHash=n,{success:!0,dispute:i,disputeId:this._generateDisputeId(e),externalOperations:{fileDispute:{endpoint:"POST /claims/"+e+"/disputes",data:i},notifyStakeholders:{endpoint:"POST /notifications/claim-disputed",data:{claimHash:e,disputantDid:i.disputant.did,disputeHash:n}},escalate:{endpoint:"POST /disputes/escalate",data:{disputeHash:n,priority:i.priority}}}}}catch(o){return{success:!1,error:"Dispute preparation failed: "+o.message}}},prepareBulkClaimValidation:function(e,t){try{Yi.checkArgument(Array.isArray(e),"Claims must be array"),Yi.checkArgument(typeof t=="string","Schema name must be string");var r=[],i=[],n=0;e.forEach(function(s,u){try{var c=this.prepareClaimValidation(s,t);c.success&&c.validation.valid&&n++,r.push({index:u,result:c})}catch(l){i.push({index:u,error:l.message})}}.bind(this));var o=this._generateBatchId(),a=Gl.sha256(h.Buffer.from(JSON.stringify(r.map(s=>s.result.validation.claimHash)))).toString("hex");return{success:!0,batchId:o,batchHash:a,totalClaims:e.length,validClaims:n,invalidClaims:e.length-n,validations:r,errors:i,externalOperations:{storeBatch:{endpoint:"POST /claims/batch-validate",data:{batchId:o,batchHash:a,schemaName:t,validations:r}},generateReport:{endpoint:"POST /reports/bulk-validation",data:{batchId:o,summary:{total:e.length,valid:n,invalid:e.length-n}}}}}}catch(s){return{success:!1,error:"Bulk validation preparation failed: "+s.message}}},canonicalize:function(e){Yi.checkArgument(e&&typeof e=="object","Invalid claim");var t=this._sortObjectKeys(e);return JSON.stringify(t)},hash:function(e){var t=this.canonicalize(e);return Gl.sha256(h.Buffer.from(t)).toString("hex")},prepareClaimTemplate:function(e,t){t=t||{};try{var r=Kf[e];if(!r)return{success:!1,error:"Unknown schema: "+e};var i=this._createTemplateFromSchema(r),n=this._generateFormStructure(r);return{success:!0,schemaName:e,template:i,schema:r,formStructure:n,validation:{required:r.required||[],patterns:this._extractPatterns(r),enums:this._extractEnums(r)},externalOperations:{generateForm:{endpoint:"POST /forms/generate",data:{schemaName:e,formStructure:n,template:i}},saveTemplate:{endpoint:"POST /templates/claim",data:{schemaName:e,template:i,customizations:t.customizations||{}}}}}}catch(o){return{success:!1,error:"Template preparation failed: "+o.message}}},getSchemas:function(){return Kf},getSchemaNames:function(){return Object.keys(Kf)},getSchema:function(e){return Kf[e]||null},addSchema:function(e,t){Yi.checkArgument(typeof e=="string","Schema name must be string"),Yi.checkArgument(t&&typeof t=="object","Invalid schema"),Kf[e]=t},createTemplate:function(e){var t=Kf[e];if(!t)throw new Error("Unknown schema: "+e);return this._createTemplateFromSchema(t)},_generateDisputeId:function(e){var t="dispute_"+e+"_"+Date.now();return Gl.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_generateBatchId:function(){var e="batch_"+Date.now()+"_"+Math.random();return Gl.sha256(h.Buffer.from(e)).toString("hex").substring(0,16)},_generateFormStructure:function(e){var t={type:"form",title:e.title||"Legal Claim Form",description:e.description||"",fields:[]};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r],n={name:r,label:this._humanizeFieldName(r),type:this._mapSchemaTypeToFormType(i),required:e.required&&e.required.includes(r),validation:this._extractFieldValidation(i)};i.enum&&(n.options=i.enum.map(function(o){return{value:o,label:this._humanizeValue(o)}}.bind(this))),t.fields.push(n)}.bind(this)),t},_extractPatterns:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.pattern&&(t[r]=i.pattern)}),t},_extractEnums:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.enum&&(t[r]=i.enum)}),t},_mapSchemaTypeToFormType:function(e){switch(e.type){case"string":return e.enum?"select":e.format==="date"?"date":e.format==="date-time"?"datetime":"text";case"number":case"integer":return"number";case"boolean":return"checkbox";case"array":return"list";case"object":return"fieldset";default:return"text"}},_extractFieldValidation:function(e){var t={};return e.pattern&&(t.pattern=e.pattern),e.minimum!==void 0&&(t.min=e.minimum),e.maximum!==void 0&&(t.max=e.maximum),e.format&&(t.format=e.format),t},_humanizeFieldName:function(e){return e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).replace(/_/g," ")},_humanizeValue:function(e){return e.replace(/_/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})},_validateObject:function(e,t,r,i,n){t.type==="object"?(t.required&&Array.isArray(t.required)&&t.required.forEach(function(o){e.hasOwnProperty(o)||i.push("Missing required field: "+this._getFieldPath(r,o))}.bind(this)),t.properties&&Object.keys(e).forEach(function(o){var a=this._getFieldPath(r,o),s=t.properties[o];s?this._validateValue(e[o],s,a,i,n):n.push("Unknown field: "+a)}.bind(this))):this._validateValue(e,t,r,i,n)},_validateValue:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type){i.push("Invalid type for "+r+": expected "+t.type+", got "+o);return}}if(t.type==="string"&&(t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e),t.format==="date"&&!this._isValidDate(e)&&i.push("Invalid date format for "+r),t.format==="date-time"&&!this._isValidDateTime(e)&&i.push("Invalid date-time format for "+r)),(t.type==="number"||t.type==="integer")&&(t.minimum!==void 0&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),t.maximum!==void 0&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum),t.type==="integer"&&!Number.isInteger(e)&&i.push("Value must be integer for "+r)),t.type==="array"&&t.items)for(var a=0;a<e.length;a++)this._validateValue(e[a],t.items,r+"["+a+"]",i,n);t.type==="object"&&this._validateObject(e,t,r,i,n)},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_createTemplateFromSchema:function(e){if(e.type==="object"){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t}return this._getDefaultValue(e)},_getDefaultValue:function(e){if(e.default!==void 0)return e.default;switch(e.type){case"string":return e.enum?e.enum[0]:e.format==="date"?"2023-01-01":e.format==="date-time"?new Date().toISOString():"PLACEHOLDER_STRING";case"number":case"integer":return e.minimum||0;case"boolean":return!1;case"array":return[];case"object":return this._createTemplateFromSchema(e);default:return null}},_getFieldPath:function(e,t){return e?e+"."+t:t},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())}};cq.exports=ase});var pq=k((ome,dq)=>{"use strict";v();var hq=Ae(),Y1=hq.crypto.Hash,Zl=hq.util.preconditions,sse={prepareTokenCommitment:function(e,t){t=t||{},Zl.checkArgument(e&&typeof e=="object","Invalid token");try{var r=this._createCommitment(e,t),i=this._formatOpReturn(r,t),n=this._createTxTemplate(i,t);return{success:!0,commitment:r,opReturnData:i,txTemplate:n,preparedAt:new Date().toISOString(),metadata:{tokenId:e.id,purpose:t.purpose||"legal_token_anchor",version:"LTP.v1"}}}catch(o){return{success:!1,error:o.message}}},prepareBatchCommitment:function(e,t){t=t||{},Zl.checkArgument(Array.isArray(e),"Tokens must be array");try{var r=this._createBatchCommitment(e,t),i=this._formatOpReturn(r,t),n=this._createTxTemplate(i,t);return{success:!0,batchCommitment:r,opReturnData:i,txTemplate:n,tokenCount:e.length,preparedAt:new Date().toISOString(),metadata:{purpose:t.purpose||"legal_token_batch_anchor",version:"LTP.v1"}}}catch(o){return{success:!1,error:o.message}}},verifyTokenAnchor:function(e,t,r){Zl.checkArgument(e&&typeof e=="object","Invalid token"),Zl.checkArgument(typeof t=="string","Transaction ID must be string");try{var i=this._createCommitment(e,{}),n=this._extractOpReturn(r);if(!n)return{valid:!1,error:"No OP_RETURN data found in transaction"};var o=this._verifyCommitment(i,n);return{valid:o,chainVerified:!1,txid:t,commitment:i,anchorData:n,verifiedAt:new Date().toISOString()}}catch(a){return{valid:!1,error:a.message}}},formatRevocation:function(e,t){Zl.checkArgument(typeof e=="string","Token ID must be string"),Zl.checkArgument(t&&typeof t=="object","Invalid revocation data");try{var r={type:"LTP_REVOCATION",tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:new Date().toISOString(),effectiveDate:t.effectiveDate||new Date().toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null},i=Y1.sha256(h.Buffer.from(JSON.stringify(r))).toString("hex");return{success:!0,revocation:r,revocationHash:i,opReturnData:this._formatOpReturn({hash:i,type:"REVOCATION"},{})}}catch(n){return{success:!1,error:n.message}}},_createCommitment:function(e,t){var r=this._canonicalizeToken(e),i={type:"LTP_TOKEN",tokenHash:Y1.sha256(h.Buffer.from(r)).toString("hex"),tokenId:e.id,timestamp:new Date().toISOString(),purpose:t.purpose||"legal_token"},n=Y1.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex");return{hash:n,data:i,canonical:r}},_createBatchCommitment:function(e,t){var r=[],i=[];e.forEach(function(s){var u=this._createCommitment(s,t);r.push(u.hash),i.push(s.id)}.bind(this));var n=this._createMerkleRoot(r),o={type:"LTP_BATCH",merkleRoot:n,tokenCount:e.length,tokenIds:i,timestamp:new Date().toISOString(),purpose:t.purpose||"batch_anchor"},a=Y1.sha256(h.Buffer.from(JSON.stringify(o))).toString("hex");return{hash:a,data:o,merkleRoot:n,tokenHashes:r}},_formatOpReturn:function(e,t){var r=t.prefix||"LTP.v1",i=e.hash;return{prefix:r,data:i,full:r+"."+i,bytes:h.Buffer.from(r+"."+i,"utf8"),size:h.Buffer.from(r+"."+i,"utf8").length}},_createTxTemplate:function(e,t){try{var r={version:1,inputs:[],outputs:[{satoshis:0,script:"OP_RETURN "+e.data}],locktime:0};return t.feeOutput&&r.outputs.push(t.feeOutput),{template:r,opReturn:e,estimatedSize:this._estimateSize(r),instructions:{step1:"Add input UTXOs to cover fees",step2:"Add change output if needed",step3:"Sign transaction with appropriate keys",step4:"Broadcast to BSV network"}}}catch(i){throw new Error("Failed to create transaction template: "+i.message)}},_extractOpReturn:function(e){try{if(!e||!e.outputs)return null;for(var t=0;t<e.outputs.length;t++){var r=e.outputs[t];if(r.script&&r.script.startsWith("OP_RETURN")){var i=r.script.replace("OP_RETURN ","");return{raw:i,decoded:h.Buffer.from(i,"hex").toString("utf8")}}}return null}catch{return null}},_verifyCommitment:function(e,t){try{return!t||!t.decoded?!1:t.decoded.includes(e.hash)}catch{return!1}},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,delete t.anchorTx,delete t.anchorBlock,JSON.stringify(this._sortObjectKeys(t))},_createMerkleRoot:function(e){if(e.length===0)return null;if(e.length===1)return e[0];for(var t=e.slice();t.length>1;){for(var r=[],i=0;i<t.length;i+=2){var n=t[i],o=t[i+1]||n,a=h.Buffer.concat([h.Buffer.from(n,"hex"),h.Buffer.from(o,"hex")]),s=Y1.sha256(a).toString("hex");r.push(s)}t=r}return t[0]},_estimateSize:function(e){var t=10,r=e.outputs.length*34,i=148;return{base:t+r,withOneInput:t+r+i,bytesPerInput:i}},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};dq.exports=sse});var mq=k((sme,vq)=>{"use strict";v();var Wl=Ae(),co=Wl.crypto.Hash,gq=Wl.crypto.ECDSA,use=Wl.crypto.Signature,fse=Wl.PrivateKey,Oi=Wl.util.preconditions,cse={prepareSignatureProof:function(e,t,r){r=r||{},Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(t instanceof fse,"Invalid private key");try{var i=this._canonicalizeForSigning(e),n=co.sha256(h.Buffer.from(i)),o=new gq;o.hashbuf=n,o.privkey=t,o.pubkey=t.toPublicKey(),o.sign();var a=o.sig,s={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:r.purpose||"assertionMethod",jws:this._createJWS(n,a),proofValue:a.toDER().toString("hex")};return{success:!0,proof:s,tokenHash:n.toString("hex"),canonical:i,signingKey:{publicKey:t.toPublicKey().toString(),keyId:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1"},externalOperations:{storeProof:{endpoint:"POST /proofs/signature",data:{tokenHash:n.toString("hex"),proof:s,signingKey:t.toPublicKey().toString()}},verifyProof:{endpoint:"POST /proofs/verify-signature",data:{tokenHash:n.toString("hex"),signature:a.toDER().toString("hex"),publicKey:t.toPublicKey().toString()}}}}}catch(u){return{success:!1,error:u.message}}},prepareSignatureVerification:function(e,t){try{if(Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(typeof t=="string","Public key must be string"),!e.proof)return{success:!1,error:"No proof found in token"};var r=this._canonicalizeForSigning(e),i=co.sha256(h.Buffer.from(r)),n=use.fromDER(h.Buffer.from(e.proof.proofValue,"hex")),o={tokenHash:i.toString("hex"),signature:n.toDER().toString("hex"),publicKey:t,proof:e.proof,canonical:r},a=new gq;a.hashbuf=i,a.sig=n,a.pubkey=Wl.PublicKey.fromString(t);var s=a.verify()===!0;return{success:!0,verification:{valid:s,tokenHash:i.toString("hex"),signatureValid:s,publicKey:t,verifiedAt:new Date().toISOString()},verificationData:o,externalOperations:{recordVerification:{endpoint:"POST /proofs/verification-record",data:{tokenHash:i.toString("hex"),result:s,publicKey:t,verifiedAt:new Date().toISOString()}},auditVerification:{endpoint:"POST /audit/proof-verification",data:{tokenId:e.id,proofType:e.proof.type,result:s,verifier:t}}}}}catch(u){return{success:!1,error:u.message}}},prepareSelectiveDisclosure:function(e,t,r){Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(Array.isArray(t),"Revealed fields must be array"),Oi.checkArgument(typeof r=="string","Nonce must be string");try{var i=this._createFieldCommitments(e,r),n=this._createMerkleTree(i),o=[],a=[];t.forEach(function(u){var c=this._getNestedValue(e,u),l=this._findFieldCommitment(i,u);if(l){o.push({path:u,value:c,commitment:l.hash,salt:l.salt});var m=this._generateMerkleProof(n,l.index);a.push({path:u,leafIndex:l.index,proof:m})}}.bind(this));var s={type:"LegalTokenSelectiveDisclosure",created:new Date().toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,nonce:r,merkleRoot:n.root,disclosures:o,merkleProofs:a,totalFields:i.length};return{success:!0,proof:s,hiddenFieldCount:i.length-o.length,revealedFieldCount:o.length,externalOperations:{storeDisclosure:{endpoint:"POST /proofs/selective-disclosure",data:{tokenId:e.id,proof:s,merkleRoot:n.root}},verifyDisclosure:{endpoint:"POST /proofs/verify-disclosure",data:{proof:s,expectedNonce:r}},auditDisclosure:{endpoint:"POST /audit/selective-disclosure",data:{tokenId:e.id,revealedFields:t,totalFields:i.length,disclosedAt:new Date().toISOString()}}}}}catch(u){return{success:!1,error:u.message}}},prepareSelectiveDisclosureVerification:function(e,t){try{if(Oi.checkArgument(e&&typeof e=="object","Invalid proof"),Oi.checkArgument(typeof t=="string","Expected nonce must be string"),e.nonce!==t)return{success:!1,error:"Nonce mismatch"};var r=[],i=[];e.disclosures.forEach(function(o,a){var s=e.merkleProofs[a],u=this._hashField(o.path,o.value,o.salt);if(u!==o.commitment){i.push("Invalid commitment for field: "+o.path);return}var c=this._verifyMerkleProof(o.commitment,s.leafIndex,s.proof,e.merkleRoot);c?r.push({path:o.path,value:o.value,verified:!0}):i.push("Invalid Merkle proof for field: "+o.path)}.bind(this));var n={valid:i.length===0,errors:i,disclosures:r,merkleRoot:e.merkleRoot,totalFields:e.totalFields,verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /proofs/disclosure-verification",data:{proofId:e.id||"unknown",result:n.valid,verifiedFields:r.length,totalFields:e.totalFields,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/disclosure-verification",data:{merkleRoot:e.merkleRoot,disclosuresVerified:r.length,errors:i.length,result:n.valid}}}}}catch(o){return{success:!1,error:o.message}}},prepareLegalValidityProof:function(e,t,r){Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(t&&typeof t=="object","Invalid jurisdiction"),Oi.checkArgument(typeof r=="string","Nonce must be string");try{var i=t.requirements||[],n=[],o=!0;i.forEach(function(s){var u=this._checkLegalRequirement(e,s);n.push(u),u.satisfied||(o=!1)}.bind(this));var a={type:"LegalValidityProof",created:new Date().toISOString(),proofPurpose:"legalValidity",jurisdiction:t.code,nonce:r,valid:o,checks:n,complianceHash:this._hashCompliance(e,t,r)};return{success:!0,proof:a,valid:o,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(s=>s.satisfied).length,failedRequirements:n.filter(s=>!s.satisfied).length,overallCompliance:o},externalOperations:{submitCompliance:{endpoint:"POST /compliance/legal-validity",data:{tokenId:e.id,jurisdiction:t.code,proof:a,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(s=>s.satisfied).length,failedRequirements:n.filter(s=>!s.satisfied).length,overallCompliance:o}}},auditCompliance:{endpoint:"POST /audit/compliance-check",data:{tokenId:e.id,jurisdiction:t.code,result:o,checkedAt:new Date().toISOString(),requirements:n}},notifyRegulator:o?null:{endpoint:"POST /notifications/compliance-failure",data:{tokenId:e.id,jurisdiction:t.code,failedRequirements:n.filter(s=>!s.satisfied)}}}}}catch(s){return{success:!1,error:s.message}}},prepareZeroKnowledgeProof:function(e,t,r){Oi.checkArgument(e&&typeof e=="object","Invalid token"),Oi.checkArgument(t&&typeof t=="object","Invalid statement"),Oi.checkArgument(typeof r=="string","Nonce must be string");try{var i=co.sha256(h.Buffer.from(this._canonicalizeForSigning(e)+r)).toString("hex"),n={type:"LegalTokenZKProof",created:new Date().toISOString(),proofPurpose:"zeroKnowledge",statement:{claim:t.claim||"UNSPECIFIED",predicate:t.predicate||"SATISFIES",threshold:t.threshold||null},commitment:i,nonce:r,proofData:this._generateZKProofData(e,t,r)};return{success:!0,proof:n,commitment:i,externalOperations:{storeZKProof:{endpoint:"POST /proofs/zero-knowledge",data:{tokenId:e.id,proof:n,statement:t}},verifyZKProof:{endpoint:"POST /proofs/verify-zk",data:{proof:n,expectedNonce:r}},auditZKProof:{endpoint:"POST /audit/zk-proof",data:{tokenId:e.id,statement:t.claim,proofGenerated:new Date().toISOString()}}}}}catch(o){return{success:!1,error:o.message}}},_generateZKProofData:function(e,t,r){var i={challenge:co.sha256(h.Buffer.from(t.claim+r)).toString("hex"),response:co.sha256(h.Buffer.from(this._canonicalizeForSigning(e)+t.claim)).toString("hex"),witness:co.sha256(h.Buffer.from(r+e.id+t.predicate)).toString("hex")};return i},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o},_canonicalizeForSigning:function(e){var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.tokenHash;var r=this._sortObjectKeys(t);return JSON.stringify(r)},_createFieldCommitments:function(e,t){var r=[],i=0;return this._traverseObject(e,"",function(n,o){if(n!=="proof"&&n!=="tokenHash"){var a=co.sha256(h.Buffer.from(t+n+i)).toString("hex"),s=this._hashField(n,o,a);r.push({path:n,value:o,salt:a,hash:s,index:i}),i++}}.bind(this)),r},_hashField:function(e,t,r){var i=e+":"+JSON.stringify(t)+":"+r;return co.sha256(h.Buffer.from(i)).toString("hex")},_createMerkleTree:function(e){var t=e.map(function(l){return l.hash});if(t.length===0)return{root:null,levels:[]};for(var r=[t],i=t;i.length>1;){for(var n=[],o=0;o<i.length;o+=2){var a=i[o],s=i[o+1]||a,u=h.Buffer.concat([h.Buffer.from(a,"hex"),h.Buffer.from(s,"hex")]),c=co.sha256(u).toString("hex");n.push(c)}r.push(n),i=n}return{root:i[0],levels:r}},_generateMerkleProof:function(e,t){for(var r=[],i=t,n=0;n<e.levels.length-1;n++){var o=e.levels[n],a=i%2===0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r},_verifyMerkleProof:function(e,t,r,i){for(var n=e,o=t,a=0;a<r.length;a++){var s=r[a],u=o%2===0,c;s.isLeft?c=h.Buffer.concat([h.Buffer.from(s.hash,"hex"),h.Buffer.from(n,"hex")]):c=h.Buffer.concat([h.Buffer.from(n,"hex"),h.Buffer.from(s.hash,"hex")]),n=co.sha256(c).toString("hex"),o=Math.floor(o/2)}return n===i},_traverseObject:function(e,t,r){Array.isArray(e)?e.forEach(function(i,n){var o=t+"["+n+"]";this._traverseObject(i,o,r)}.bind(this)):e!==null&&typeof e=="object"?Object.keys(e).forEach(function(i){var n=t?t+"."+i:i;this._traverseObject(e[i],n,r)}.bind(this)):r(t,e)},_getNestedValue:function(e,t){return t.split(".").reduce(function(r,i){return r&&r[i]},e)},_findFieldCommitment:function(e,t){return e.find(function(r){return r.path===t})},_checkLegalRequirement:function(e,t){switch(t.type){case"field_present":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r!=null};case"field_value":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r===t.expectedValue};case"temporal_validity":var i=new Date,n=new Date(e.issuanceDate);return{requirement:t.type,satisfied:n<=i};default:return{requirement:t.type,satisfied:!1,error:"Unknown requirement type"}}},_hashCompliance:function(e,t,r){var i={tokenId:e.id,jurisdiction:t.code,nonce:r,timestamp:new Date().toISOString()};return co.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex")},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};vq.exports=cse});var bq=k((lme,yq)=>{"use strict";v();var O5=Ae(),Vf=O5.crypto.Hash,fme=O5.Address,cme=O5.Transaction,Ci=O5.util.preconditions,lse={prepareRegistry:function(e){e=e||{},Ci.checkArgument(typeof e=="object","Config must be object");var t={id:e.id||this._generateRegistryId(),name:e.name||"Legal Token Registry",jurisdiction:e.jurisdiction||"GLOBAL",authority:e.authority||null,created:new Date().toISOString(),version:"1.0.0",config:{allowPublicRegistration:e.allowPublicRegistration||!1,requireApproval:e.requireApproval||!0,enableRevocation:e.enableRevocation!==!1,enableAuditTrail:e.enableAuditTrail!==!1,retentionPeriod:e.retentionPeriod||"7Y",complianceLevel:e.complianceLevel||"STANDARD"},dataStructure:{tokens:"Map<tokenId, registrationRecord>",revocations:"Map<tokenId, revocationRecord>",auditLog:"Array<auditEntry>",statistics:{totalTokens:0,activeTokens:0,revokedTokens:0,registrations:0}},externalStorage:{required:!0,type:"database_or_blockchain",endpoints:{store:"POST /registry/{id}/tokens",retrieve:"GET /registry/{id}/tokens/{tokenId}",search:"GET /registry/{id}/search",revoke:"POST /registry/{id}/revocations"}}},r=this._prepareAuditEntry({action:"REGISTRY_CREATED",actor:e.authority,timestamp:t.created,metadata:{jurisdiction:t.jurisdiction,config:t.config}});return{success:!0,registry:t,initialAudit:r,instructions:{step1:"Store registry configuration in external system",step2:"Initialize token storage with provided data structure",step3:"Set up audit logging with provided templates",step4:"Configure external endpoints for registry operations"}}},prepareTokenRegistration:function(e,t,r){r=r||{},Ci.checkArgument(e&&typeof e=="object","Invalid token"),Ci.checkArgument(t&&typeof t=="object","Invalid registry config");try{var i=this._validateTokenForRegistration(e,t);if(!i.valid)return{success:!1,error:"Token validation failed: "+i.error};var n={tokenId:e.id,tokenHash:this._hashToken(e),token:e,status:t.requireApproval?"PENDING":"ACTIVE",registeredBy:r.registeredBy||"UNKNOWN",registeredAt:new Date().toISOString(),approvedBy:null,approvedAt:null,metadata:r.metadata||{},compliance:{jurisdiction:e.jurisdiction||t.jurisdiction,level:this._calculateComplianceLevel(e),checks:i.checks||[]}},o=this._prepareAuditEntry({action:"TOKEN_REGISTERED",actor:r.registeredBy,tokenId:e.id,timestamp:n.registeredAt,metadata:{status:n.status,tokenType:e.type,compliance:n.compliance}});return{success:!0,registrationRecord:n,auditEntry:o,registrationId:this._generateRegistrationId(e.id),validation:i,externalOperations:{store:{endpoint:"POST /registry/"+t.id+"/tokens",data:n},audit:{endpoint:"POST /registry/"+t.id+"/audit",data:o}}}}catch(a){return{success:!1,error:a.message}}},prepareTokenApproval:function(e,t,r){try{Ci.checkArgument(typeof e=="string","Token ID must be string"),Ci.checkArgument(typeof t=="string","Approver must be string"),Ci.checkArgument(r&&typeof r=="object","Invalid registry config");var i={tokenId:e,status:"ACTIVE",approvedBy:t,approvedAt:new Date().toISOString()},n=this._prepareAuditEntry({action:"TOKEN_APPROVED",actor:t,tokenId:e,timestamp:i.approvedAt});return{success:!0,approvalData:i,auditEntry:n,externalOperations:{update:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:i},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:n}}}}catch(o){return{success:!1,error:o.message}}},prepareTokenRevocation:function(e,t,r){try{if(Ci.checkArgument(typeof e=="string","Token ID must be string"),Ci.checkArgument(t&&typeof t=="object","Invalid revocation"),Ci.checkArgument(r&&typeof r=="object","Invalid registry config"),!r.enableRevocation)return{success:!1,error:"Revocation is disabled for this registry"};var i={tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:new Date().toISOString(),effectiveDate:t.effectiveDate||new Date().toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null,revocationHash:this._generateRevocationHash(e,t)},n={tokenId:e,status:"REVOKED",revokedAt:i.revokedAt,revocationReason:i.reason},o=this._prepareAuditEntry({action:"TOKEN_REVOKED",actor:t.revokedBy,tokenId:e,timestamp:i.revokedAt,metadata:{reason:i.reason,legalBasis:i.legalBasis}});return{success:!0,revocationRecord:i,statusUpdate:n,auditEntry:o,revocationId:this._generateRevocationId(e),externalOperations:{storeRevocation:{endpoint:"POST /registry/"+r.id+"/revocations",data:i},updateStatus:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:n},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:o}}}}catch(a){return{success:!1,error:a.message}}},prepareTokenStatusQuery:function(e,t){try{return Ci.checkArgument(typeof e=="string","Token ID must be string"),Ci.checkArgument(t&&typeof t=="object","Invalid registry config"),{success:!0,query:{tokenId:e,registryId:t.id},externalOperations:{retrieve:{endpoint:"GET /registry/"+t.id+"/tokens/"+e,method:"GET"},checkRevocation:{endpoint:"GET /registry/"+t.id+"/revocations/"+e,method:"GET"}},expectedResponse:{found:"boolean",status:"string (PENDING|ACTIVE|REVOKED)",registeredAt:"ISO datetime",registeredBy:"string",approvedAt:"ISO datetime or null",approvedBy:"string or null",revokedAt:"ISO datetime or null",revocationReason:"string or null",compliance:"object",revocation:"object or null"}}}catch(r){return{success:!1,error:r.message}}},prepareTokenSearch:function(e,t){e=e||{};try{Ci.checkArgument(t&&typeof t=="object","Invalid registry config");var r=[];e.status&&r.push("status="+encodeURIComponent(e.status)),e.type&&r.push("type="+encodeURIComponent(e.type)),e.registeredBy&&r.push("registeredBy="+encodeURIComponent(e.registeredBy)),e.jurisdiction&&r.push("jurisdiction="+encodeURIComponent(e.jurisdiction)),e.dateFrom&&r.push("dateFrom="+encodeURIComponent(e.dateFrom)),e.dateTo&&r.push("dateTo="+encodeURIComponent(e.dateTo)),e.includeTokens&&r.push("includeTokens=true"),e.sortBy&&r.push("sortBy="+encodeURIComponent(e.sortBy)),e.sortOrder&&r.push("sortOrder="+encodeURIComponent(e.sortOrder));var i=e.offset||0,n=e.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,searchCriteria:e,externalOperations:{search:{endpoint:"GET /registry/"+t.id+"/search"+o,method:"GET"}},expectedResponse:{success:"boolean",results:"Array<tokenRecord>",totalCount:"number",totalRegistrations:"number",offset:"number",limit:"number",hasMore:"boolean"}}}catch(a){return{success:!1,error:a.message}}},prepareStatisticsQuery:function(e){return Ci.checkArgument(e&&typeof e=="object","Invalid registry config"),{success:!0,query:{registryId:e.id},externalOperations:{getStatistics:{endpoint:"GET /registry/"+e.id+"/statistics",method:"GET"}},expectedResponse:{id:"string",name:"string",jurisdiction:"string",created:"ISO datetime",statistics:{totalTokens:"number",activeTokens:"number",revokedTokens:"number",registrations:"number"},auditEntries:"number",lastActivity:"ISO datetime"}}},prepareAuditLogQuery:function(e,t){if(t=t||{},Ci.checkArgument(e&&typeof e=="object","Invalid registry config"),!e.enableAuditTrail)return{success:!1,error:"Audit trail is disabled"};var r=[];t.action&&r.push("action="+encodeURIComponent(t.action)),t.actor&&r.push("actor="+encodeURIComponent(t.actor)),t.tokenId&&r.push("tokenId="+encodeURIComponent(t.tokenId)),t.dateFrom&&r.push("dateFrom="+encodeURIComponent(t.dateFrom)),t.dateTo&&r.push("dateTo="+encodeURIComponent(t.dateTo));var i=t.offset||0,n=t.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,auditOptions:t,externalOperations:{getAuditLog:{endpoint:"GET /registry/"+e.id+"/audit"+o,method:"GET"}},expectedResponse:{success:"boolean",entries:"Array<auditEntry>",totalEntries:"number",offset:"number",limit:"number",hasMore:"boolean"}}},_generateRegistryId:function(){var e="reg_"+Date.now()+"_"+Math.random();return"reg_"+Vf.sha256(h.Buffer.from(e)).toString("hex").substring(0,16)},_generateRegistrationId:function(e){var t="reg_"+e+"_"+Date.now();return Vf.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_generateRevocationId:function(e){var t="rev_"+e+"_"+Date.now();return Vf.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)},_hashToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,Vf.sha256(h.Buffer.from(JSON.stringify(t))).toString("hex")},_generateRevocationHash:function(e,t){var r=e+(t.reason||"")+(t.revokedBy||"")+Date.now();return Vf.sha256(h.Buffer.from(r)).toString("hex")},_validateTokenForRegistration:function(e,t){var r=[],i=!0;return e.id?r.push({field:"id",valid:!0}):(r.push({field:"id",valid:!1,error:"Missing token ID"}),i=!1),e.type?r.push({field:"type",valid:!0}):(r.push({field:"type",valid:!1,error:"Missing token type"}),i=!1),e.issuanceDate?r.push({field:"issuanceDate",valid:!0}):(r.push({field:"issuanceDate",valid:!1,error:"Missing issuance date"}),i=!1),e.proof?r.push({field:"proof",valid:!0}):(r.push({field:"proof",valid:!1,error:"Missing cryptographic proof"}),i=!1),{valid:i,checks:r}},_calculateComplianceLevel:function(e){var t="BASIC";return e.proof&&e.proof.type&&(t="STANDARD"),e.jurisdiction&&e.legalBasis&&(t="ENHANCED"),e.attestations&&e.attestations.length>0&&(t="PREMIUM"),t},_prepareAuditEntry:function(e){var t={id:this._generateAuditId(),action:e.action,actor:e.actor||"SYSTEM",tokenId:e.tokenId||null,timestamp:e.timestamp||new Date().toISOString(),metadata:e.metadata||{},hash:this._generateAuditHash(e)};return t},_generateAuditId:function(){var e="audit_"+Date.now()+"_"+Math.random();return"audit_"+Vf.sha256(h.Buffer.from(e)).toString("hex").substring(0,12)},_generateAuditHash:function(e){var t=(e.action||"")+(e.actor||"")+(e.tokenId||"")+(e.timestamp||"");return Vf.sha256(h.Buffer.from(t)).toString("hex").substring(0,16)}};yq.exports=lse});var xq=k((dme,Sq)=>{"use strict";v();var Ws=Ae(),j7=Ws.crypto.Hash,_q=Ws.crypto.ECDSA,hse=Ws.crypto.Signature,wq=Ws.PrivateKey,$i=Ws.util.preconditions;function dse(e,t){if(t=t||{},t.issuerPublicKey)return t.issuerPublicKey instanceof Ws.PublicKey?t.issuerPublicKey:Ws.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if(typeof r!="string")return null;try{var i=r.split("#")[0].split(":")[2];return i?Ws.PublicKey.fromString(i):null}catch{return null}}var I5={CORRELATIVE_OBLIGATION:"CorrelativeObligation",CONTRACTUAL_OBLIGATION:"ContractualObligation",PAYMENT_OBLIGATION:"PaymentObligation",DELIVERY_OBLIGATION:"DeliveryObligation",PERFORMANCE_OBLIGATION:"PerformanceObligation",MAINTENANCE_OBLIGATION:"MaintenanceObligation",COMPLIANCE_OBLIGATION:"ComplianceObligation",REPORTING_OBLIGATION:"ReportingObligation",CONFIDENTIALITY_OBLIGATION:"ConfidentialityObligation",NON_COMPETE_OBLIGATION:"NonCompeteObligation",INDEMNIFICATION_OBLIGATION:"IndemnificationObligation",WARRANTY_OBLIGATION:"WarrantyObligation",SUPPORT_OBLIGATION:"SupportObligation",REGULATORY_OBLIGATION:"RegulatoryObligation",FIDUCIARY_OBLIGATION:"FiduciaryObligation"},Yl={CRITICAL:"CRITICAL",HIGH:"HIGH",MEDIUM:"MEDIUM",LOW:"LOW",DEFERRED:"DEFERRED"},Di={PENDING:"PENDING",ACTIVE:"ACTIVE",IN_PROGRESS:"IN_PROGRESS",COMPLETED:"COMPLETED",OVERDUE:"OVERDUE",BREACHED:"BREACHED",WAIVED:"WAIVED",TERMINATED:"TERMINATED"},A5={prepareObligationToken:function(e,t,r,i,n,o){o=o||{},$i.checkArgument(typeof e=="string","Obligation type must be string"),$i.checkArgument(typeof t=="string","Issuer DID must be string"),$i.checkArgument(typeof r=="string","Obligor DID must be string"),$i.checkArgument(i&&typeof i=="object","Obligation must be object"),$i.checkArgument(n instanceof wq,"Invalid issuer private key");var a=Object.values(I5);$i.checkArgument(a.includes(e),"Invalid obligation type: "+e);try{var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken",e],issuer:t,issuanceDate:new Date().toISOString(),credentialSubject:{id:r,obligationType:e,obligation:i,jurisdiction:o.jurisdiction||"US",priority:o.priority||Yl.MEDIUM,status:Di.PENDING,dueDate:o.dueDate||null,effectiveDate:o.effectiveDate||new Date().toISOString(),expirationDate:o.expirationDate||null,correlativeRight:o.correlativeRight||null,rightHolder:o.rightHolder||null,enforceable:o.enforceable!==!1,penalties:o.penalties||null,remedies:o.remedies||null}};o.metadata&&(s.credentialSubject.metadata=o.metadata);var u=this._signToken(s,n);return{success:!0,obligationToken:u,tokenHash:u.tokenHash,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight},externalOperations:{storeToken:{endpoint:"POST /obligations/tokens",data:{token:u,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight}}},indexToken:{endpoint:"POST /obligations/index",data:{tokenId:u.id,tokenHash:u.tokenHash,type:e,issuer:t,obligor:r,issuedAt:u.issuanceDate,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},notifyObligor:{endpoint:"POST /notifications/obligation-issued",data:{tokenId:u.id,issuer:t,obligor:r,obligationType:e,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},scheduleReminders:s.credentialSubject.dueDate?{endpoint:"POST /obligations/schedule-reminders",data:{tokenId:u.id,obligor:r,dueDate:s.credentialSubject.dueDate,reminderSchedule:o.reminderSchedule||["7d","3d","1d"]}}:null}}}catch(c){return{success:!1,error:c.message}}},prepareObligationVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateObligationType(e,r),this._validateObligationStatus(e,r,i),this._validateObligationPriority(e,i);var n={valid:r.length===0,errors:r,warnings:i,issuerDID:e.issuer,obligorDID:e.credentialSubject?e.credentialSubject.id:null,obligationType:e.credentialSubject?e.credentialSubject.obligationType:null,status:e.credentialSubject?e.credentialSubject.status:null,priority:e.credentialSubject?e.credentialSubject.priority:null,isOverdue:this._checkIfOverdue(e),verifiedAt:new Date().toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /obligations/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt,isOverdue:n.isOverdue}},auditVerification:{endpoint:"POST /audit/obligation-verification",data:{tokenId:e.id,obligationType:n.obligationType,issuer:n.issuerDID,obligor:n.obligorDID,result:n.valid,verifiedAt:n.verifiedAt}},updateStatus:n.isOverdue&&e.credentialSubject.status===Di.ACTIVE?{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:Di.OVERDUE,updatedAt:n.verifiedAt,reason:"Due date passed"}}:null}}}catch(o){return{success:!1,error:"Verification preparation failed: "+o.message}}},prepareObligationFulfillment:function(e,t,r,i){i=i||{},$i.checkArgument(e&&typeof e=="object","Invalid token"),$i.checkArgument(t&&typeof t=="object","Invalid fulfillment"),$i.checkArgument(r instanceof wq,"Invalid obligor key");try{var n=this.prepareObligationVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot fulfill invalid obligation: "+n.verification.errors.join(", ")};if(e.credentialSubject.status===Di.COMPLETED)return{success:!1,error:"Obligation already fulfilled"};if(e.credentialSubject.status===Di.TERMINATED)return{success:!1,error:"Obligation has been terminated"};var o={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationFulfillment"],issuer:e.credentialSubject.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:e.id,fulfillmentType:t.type||"FULL_FULFILLMENT",fulfillmentDate:new Date().toISOString(),evidence:t.evidence||null,description:t.description||"",completionPercentage:t.completionPercentage||100,attestations:t.attestations||[],notes:t.notes||null}},a=this._signToken(o,r),s=o.credentialSubject.completionPercentage>=100?Di.COMPLETED:Di.IN_PROGRESS;return{success:!0,fulfillmentRecord:a,newStatus:s,fulfillmentId:a.id,externalOperations:{recordFulfillment:{endpoint:"POST /obligations/fulfillments",data:{obligationId:e.id,fulfillmentRecord:a,obligor:e.credentialSubject.id,fulfillmentDate:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:s,fulfillmentId:a.id,updatedAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},notifyRightHolder:e.credentialSubject.rightHolder?{endpoint:"POST /notifications/obligation-fulfilled",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,completionPercentage:o.credentialSubject.completionPercentage,newStatus:s}}:null,auditFulfillment:{endpoint:"POST /audit/obligation-fulfillment",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,fulfilledAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}}}}}catch(u){return{success:!1,error:u.message}}},prepareObligationBreachAssessment:function(e,t,r){$i.checkArgument(e&&typeof e=="object","Invalid token"),$i.checkArgument(t&&typeof t=="object","Invalid breach details"),$i.checkArgument(r&&typeof r=="object","Invalid assessor");try{var i={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationBreachAssessment"],issuer:r.did||r.id,issuanceDate:new Date().toISOString(),credentialSubject:{id:e.id,breachType:t.type||"MATERIAL_BREACH",breachDate:t.date||new Date().toISOString(),description:t.description||"",severity:t.severity||"MODERATE",evidence:t.evidence||[],assessor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},damages:t.damages||null,recommendedRemedies:t.recommendedRemedies||[],assessmentDate:new Date().toISOString()}},n=j7.sha256(h.Buffer.from(JSON.stringify(i))).toString("hex");return i.credentialSubject.assessmentHash=n,{success:!0,breachAssessment:i,breachId:i.id,severity:t.severity||"MODERATE",externalOperations:{recordBreach:{endpoint:"POST /obligations/breaches",data:{obligationId:e.id,breachAssessment:i,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachDate:t.date||new Date().toISOString(),severity:t.severity||"MODERATE"}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:Di.BREACHED,breachId:i.id,breachDate:t.date||new Date().toISOString(),updatedAt:new Date().toISOString()}},notifyParties:{endpoint:"POST /notifications/obligation-breached",data:{obligationId:e.id,breachId:i.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachType:t.type||"MATERIAL_BREACH",severity:t.severity||"MODERATE"}},escalateBreach:t.severity==="CRITICAL"?{endpoint:"POST /legal/escalate-breach",data:{obligationId:e.id,breachId:i.id,severity:t.severity,jurisdiction:e.credentialSubject.jurisdiction}}:null,auditBreach:{endpoint:"POST /audit/obligation-breach",data:{obligationId:e.id,breachId:i.id,obligor:e.credentialSubject.id,assessedAt:i.credentialSubject.assessmentDate,severity:t.severity||"MODERATE"}}}}}catch(o){return{success:!1,error:o.message}}},prepareObligationMonitoringReport:function(e,t){t=t||{},$i.checkArgument(Array.isArray(e),"Obligations must be array");try{var r={reportId:"rpt_"+this._generateUUID(),generatedAt:new Date().toISOString(),criteria:t,summary:{totalObligations:e.length,byStatus:{},byPriority:{},byType:{},overdue:0,dueSoon:0,completed:0},obligations:[],alerts:[],recommendations:[]},i=new Date,n=new Date(i.getTime()+10080*60*1e3);return e.forEach(function(o){var a={id:o.id,type:o.credentialSubject.obligationType,status:o.credentialSubject.status,priority:o.credentialSubject.priority,obligor:o.credentialSubject.id,dueDate:o.credentialSubject.dueDate,isOverdue:this._checkIfOverdue(o),isDueSoon:!1};if(o.credentialSubject.dueDate){var s=new Date(o.credentialSubject.dueDate);a.isDueSoon=s<=n&&s>i}r.summary.byStatus[a.status]=(r.summary.byStatus[a.status]||0)+1,r.summary.byPriority[a.priority]=(r.summary.byPriority[a.priority]||0)+1,r.summary.byType[a.type]=(r.summary.byType[a.type]||0)+1,a.isOverdue&&r.summary.overdue++,a.isDueSoon&&r.summary.dueSoon++,a.status===Di.COMPLETED&&r.summary.completed++,a.isOverdue&&a.priority===Yl.CRITICAL&&r.alerts.push({type:"CRITICAL_OVERDUE",obligationId:o.id,message:"Critical obligation is overdue",priority:"HIGH"}),a.isDueSoon&&a.priority===Yl.HIGH&&r.alerts.push({type:"HIGH_PRIORITY_DUE_SOON",obligationId:o.id,message:"High priority obligation due soon",priority:"MEDIUM"}),r.obligations.push(a)}.bind(this)),r.summary.overdue>0&&r.recommendations.push({type:"OVERDUE_MANAGEMENT",message:"Consider prioritizing overdue obligations",count:r.summary.overdue}),r.summary.dueSoon>5&&r.recommendations.push({type:"WORKLOAD_MANAGEMENT",message:"High number of obligations due soon - consider workload distribution",count:r.summary.dueSoon}),{success:!0,report:r,externalOperations:{storeReport:{endpoint:"POST /obligations/monitoring-reports",data:{report:r,generatedAt:r.generatedAt}},sendAlerts:r.alerts.length>0?{endpoint:"POST /notifications/obligation-alerts",data:{reportId:r.reportId,alerts:r.alerts,summary:r.summary}}:null,updateDashboard:{endpoint:"PUT /dashboard/obligation-metrics",data:{summary:r.summary,lastUpdated:r.generatedAt}}}}}catch(o){return{success:!1,error:o.message}}},getObligationTypes:function(){return I5},getObligationPriority:function(){return Yl},getObligationStatus:function(){return Di},_signToken:function(e,t){var r=this._canonicalizeToken(e),i=j7.sha256(h.Buffer.from(r)),n=new _q;n.hashbuf=i,n.privkey=t,n.pubkey=t.toPublicKey(),n.sign();var o=n.sig,a={type:"EcdsaSecp256k1Signature2019",created:new Date().toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(i,o)},s=JSON.parse(JSON.stringify(e));return s.proof=a,s.tokenHash=i.toString("hex"),s},_createJWS:function(e,t){var r={alg:"ES256K",typ:"JWT"},i=h.Buffer.from(JSON.stringify(r)).toString("base64url"),n=e.toString("base64url"),o=t.toDER().toString("base64url");return i+".."+o},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(e!==null&&typeof e=="object"){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),(!e.type||!Array.isArray(e.type))&&t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws){t.push("Missing signature proof");return}var i=this._canonicalizeToken(e),n=j7.sha256(h.Buffer.from(i));if(e.tokenHash&&e.tokenHash!==n.toString("hex")){t.push("Token hash mismatch");return}var o=dse(e,r);if(!o){t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");return}var a=e.proof.jws.split(".");if(a.length!==3||!a[2]){t.push("Malformed JWS");return}var s=hse.fromDER(h.Buffer.from(a[2],"base64url")),u=new _q;u.hashbuf=n,u.sig=s,u.pubkey=o,u.verify()!==!0&&t.push("Signature verification failed")}catch(c){t.push("Signature verification failed: "+c.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date,n=new Date(e.issuanceDate);if(n>i&&t.push("Token issued in the future"),e.credentialSubject.effectiveDate){var o=new Date(e.credentialSubject.effectiveDate);i<o&&r.push("Obligation not yet effective")}if(e.credentialSubject.expirationDate){var a=new Date(e.credentialSubject.expirationDate);i>a&&t.push("Obligation expired")}},_validateObligationType:function(e,t){if(!e.credentialSubject.obligationType){t.push("Missing obligationType");return}var r=Object.values(I5);r.includes(e.credentialSubject.obligationType)||t.push("Invalid obligation type: "+e.credentialSubject.obligationType)},_validateObligationStatus:function(e,t,r){if(!e.credentialSubject.status){t.push("Missing status");return}var i=Object.values(Di);i.includes(e.credentialSubject.status)||t.push("Invalid obligation status: "+e.credentialSubject.status),this._checkIfOverdue(e)&&e.credentialSubject.status===Di.ACTIVE&&r.push("Obligation is overdue but status is still ACTIVE")},_validateObligationPriority:function(e,t){if(e.credentialSubject.priority){var r=Object.values(Yl);r.includes(e.credentialSubject.priority)||t.push("Invalid obligation priority: "+e.credentialSubject.priority)}},_checkIfOverdue:function(e){if(!e.credentialSubject.dueDate)return!1;var t=new Date,r=new Date(e.credentialSubject.dueDate);return t>r&&e.credentialSubject.status!==Di.COMPLETED},_generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}};A5.ObligationTypes=I5;A5.ObligationPriority=Yl;A5.ObligationStatus=Di;Sq.exports=A5});var Iq=k((gme,Oq)=>{"use strict";v();var Gf=uq(),P5=lq(),$1=pq(),z7=mq(),na=bq(),pse=xq(),Eq=Ae(),K7=Eq.PrivateKey,Xi=Eq.util.preconditions,wt=function(e){return this instanceof wt?(this.config=e||{},this.registry=null,this.config.registry&&(this.registry=na.createRegistry(this.config.registry)),this):new wt(e)};wt.prototype.createRightToken=function(e,t,r){Xi.checkArgument(e&&typeof e=="object","Invalid right data"),Xi.checkArgument(t instanceof K7,"Invalid private key"),r=r||{};try{var i=Gf.create(e.type,e.owner,e.owner,e,t,r);if(!i)return{success:!1,error:"Failed to create token"};if(r.addProof!==!1&&(i=Gf._signToken(i,t)),r.anchor){var n=$1.anchorToken(i,r.anchor);n.success&&(i.anchorTx=n.txid,i.anchorBlock=n.blockHeight)}if(this.registry&&r.register!==!1){var o=na.registerToken(this.registry,i,{registeredBy:r.registeredBy||"SYSTEM"});o.success&&(i.registrationId=o.registrationId,i.registrationStatus=o.status)}return{success:!0,token:i,type:"LegalRightToken"}}catch(a){return{success:!1,error:a.message}}};wt.prototype.validateClaim=function(e,t){return P5.validate(e,t)};wt.prototype.createSelectiveDisclosure=function(e,t,r){return z7.prepareSelectiveDisclosure(e,t,r)};wt.prototype.verifyToken=function(e,t){return!e||!e.proof?{valid:!1,error:"No proof found in token"}:Gf.verifyToken(e,t)};wt.prototype.transferRight=function(e,t,r,i){Xi.checkArgument(e&&typeof e=="object","Invalid token"),Xi.checkArgument(typeof t=="string","New owner must be string"),Xi.checkArgument(r instanceof K7,"Invalid owner key"),i=i||{};try{var n=this.verifyToken(e,r.toPublicKey().toString());if(!n.valid)return{success:!1,error:"Invalid token or ownership proof"};var o=Gf.prepareRightTokenTransfer(e,t,r,i);if(!o.success)return{success:!1,error:o.error};var a=o.newToken,s=o.transferProof;if(i.anchor){var u=$1.anchorToken(a,i.anchor);u.success&&(a.transferAnchorTx=u.txid)}if(this.registry){var c=na.registerToken(this.registry,a,{registeredBy:i.registeredBy||t,metadata:{transferFrom:e.owner,transferTo:t,originalTokenId:e.id}});c.success&&(a.registrationId=c.registrationId)}return{success:!0,token:a,transferId:s.id,transferredAt:s.issuanceDate,transferProof:s}}catch(l){return{success:!1,error:l.message}}};wt.prototype.createObligation=function(e,t,r){Xi.checkArgument(e&&typeof e=="object","Invalid right token"),Xi.checkArgument(t&&typeof t=="object","Invalid obligation data"),Xi.checkArgument(r instanceof K7,"Invalid private key");try{var i=Gf.prepareObligationToken(e,t.obligor,t,r);return i.success?{success:!0,obligation:i.obligationToken,rightTokenId:e.id}:{success:!1,error:i.error}}catch(n){return{success:!1,error:n.message}}};wt.prototype.revokeToken=function(e,t,r){return Xi.checkArgument(typeof e=="string","Token ID must be string"),Xi.checkArgument(t&&typeof t=="object","Invalid revocation data"),Xi.checkArgument(typeof r=="string","Authority must be string"),this.registry?na.revokeToken(this.registry,e,{reason:t.reason,revokedBy:r,legalBasis:t.legalBasis,evidence:t.evidence}):{success:!1,error:"No registry available for revocation"}};wt.prototype.checkTokenStatus=function(e){return Xi.checkArgument(typeof e=="string","Token ID must be string"),this.registry?na.checkTokenStatus(this.registry,e):{found:!1,error:"No registry available"}};wt.prototype.searchTokens=function(e){return this.registry?na.searchTokens(this.registry,e):{success:!1,error:"No registry available"}};wt.prototype.getRegistryStats=function(){return this.registry?na.getStatistics(this.registry):{error:"No registry available"}};wt.prototype.createLegalValidityProof=function(e,t,r){return z7.prepareLegalValidityProof(e,t,r)};wt.prototype.anchorTokenBatch=function(e,t){return $1.anchorBatch(e,t)};wt.prototype.verifyAnchor=function(e,t){return $1.verifyAnchor(e,t)};wt.prototype.getRightTypes=function(){return Gf.getRightTypes()};wt.prototype.getClaimSchemas=function(){return P5.getSchemas()};wt.prototype.createRegistry=function(e){return this.registry=na.createRegistry(e),this.registry};wt.prototype.setRegistry=function(e){Xi.checkArgument(e&&typeof e=="object","Invalid registry"),this.registry=e};wt.create=function(e){return new wt(e)};wt.createRightToken=function(e,t,r){var i=new wt;return i.createRightToken(e,t,r)};wt.validateClaim=function(e,t){return P5.validate(e,t)};wt.verifyToken=function(e,t){var r=new wt;return r.verifyToken(e,t)};wt.createRegistry=function(e){return na.createRegistry(e)};wt.Right=Gf;wt.Claim=P5;wt.Anchor=$1;wt.Proof=z7;wt.Registry=na;wt.Obligation=pse;Oq.exports=wt});var Ae=k((mme,Aq)=>{"use strict";v();var j=Aq.exports;j.deps=j.deps||{};j.deps._=xt();j.deps.Buffer=typeof h.Buffer<"u"?h.Buffer:null;if(typeof window>"u")j.deps.bnjs=Nn(),j.deps.bs58=Z2();else{try{j.deps.bnjs=Nn()}catch{}try{j.deps.bs58=Z2()}catch{}}j.version="v"+Fm();j.versionGuard=function(e){if(e!==void 0){var t=`
|
|
100
100
|
More than one instance of bsv found.
|
|
101
101
|
Please make sure to require bsv and check that submodules do
|
|
102
102
|
not also include their own bsv dependency.`;console.warn(t)}};j.versionGuard(globalThis._bsv);globalThis._bsv=j.version;j.isHardened=!0;j.hardenedBy="SmartLedger";j.baseVersion="v1.5.6";j.securityFeatures=["canonical-signatures","malleability-protection","enhanced-validation","elliptic-patches"];j.crypto={};j.crypto.BN=fr();j.crypto.ECDSA=i6();j.crypto.Hash=cr();j.crypto.Random=Ku();j.crypto.Point=gn();j.crypto.Signature=Vr();j.crypto.Shamir=A4();j.crypto.SmartVerify=h6();j.crypto.EllipticFixed=d6();j.encoding={};j.encoding.Base58=E0();j.encoding.Base58Check=el();j.encoding.BufferReader=Da();j.encoding.BufferWriter=Wn();j.encoding.Varint=ol();j.util={};j.util.js=pi();j.util.preconditions=Bt();j.errors=ln();j.Address=hf();j.Block=cB();j.MerkleBlock=D4();j.BlockHeader=X0();j.SPV=xB();j.HDPrivateKey=H4();j.HDPublicKey=F4();j.Networks=ws();j.Opcode=Gp();j.PrivateKey=G0();j.PublicKey=$n();j.Script=bn();j.Transaction=Ts();j.Input=Ts().Input;j.Output=Ts().Output;j.UnspentOutput=Ts().UnspentOutput;j.Message=jB();j.Mnemonic=bM();j.ECIES=$M();j.Signature=Vr();j.Shamir=A4();j.SmartLedger={version:j.version,hardenedBy:j.hardenedBy,baseVersion:j.baseVersion,securityFeatures:j.securityFeatures,SmartVerify:h6(),EllipticFixed:d6()};j.SmartVerify=h6();j.EllipticFixed=d6();try{j.SmartContract=pC()}catch(e){typeof window>"u"&&console.warn("SmartContract module not available:",e.message)}try{j.BrowserUTXOManager=gC()}catch(e){typeof window>"u"&&console.warn("[bsv] BrowserUTXOManager failed to load:",e.message)}if(typeof window>"u"&&typeof Fr=="function")try{V7=!1,Object.defineProperty(j,"SmartUTXO",{configurable:!0,enumerable:!0,get:function(){return!V7&&!(A.default.env&&A.default.env.BSV_HIDE_DEPRECATIONS)&&(V7=!0,console.warn("[bsv] bsv.SmartUTXO is a development-only simulator and is deprecated; it will be removed in v6.0.0. Import directly: require('@smartledger/bsv/lib/smartutxo'). Set BSV_HIDE_DEPRECATIONS=1 to silence this warning.")),T5||(T5=m8()),T5}}),j.SmartMiner=mC(),j.CustomScriptHelper=bC()}catch{}var T5,V7;j.Ordinals=VC();j.GDAF=fD();try{j.DIDWeb=lD()}catch(e){typeof window>"u"&&console.warn("[bsv] DIDWeb module failed to load:",e.message)}try{j.VcJwt=u7()}catch(e){typeof window>"u"&&console.warn("[bsv] VcJwt module failed to load:",e.message)}try{j.StatusList=eq()}catch(e){typeof window>"u"&&console.warn("[bsv] StatusList module failed to load:",e.message)}try{j.Anchor=iq()}catch(e){typeof window>"u"&&console.warn("[bsv] Anchor module failed to load:",e.message)}j.createDID=function(e){var t=new j.GDAF;return t.createDID(e)};j.resolveDID=function(e){var t=new j.GDAF;return t.resolveDID(e)};j.createEmailCredential=function(e,t,r,i){var n=new j.GDAF;return n.createEmailCredential(e,t,r,i)};j.createAgeCredential=function(e,t,r,i,n){var o=new j.GDAF;return o.createAgeCredential(e,t,r,i,n)};j.createKYCCredential=function(e,t,r,i,n){var o=new j.GDAF;return o.createKYCCredential(e,t,r,i,n)};j.verifyCredential=function(e,t){var r=new j.GDAF;return r.verifyCredential(e,t)};j.validateCredential=function(e,t){var r=new j.GDAF;return r.validateCredential(e,t)};j.generateSelectiveProof=function(e,t,r){var i=new j.GDAF;return i.generateSelectiveProof(e,t,r)};j.generateAgeProof=function(e,t,r){var i=new j.GDAF;return i.generateAgeProof(e,t,r)};j.verifyAgeProof=function(e,t,r){var i=new j.GDAF;return i.verifyAgeProof(e,t,r)};j.createPresentation=function(e,t,r,i){var n=new j.GDAF;return n.createPresentation(e,t,r,i)};j.getCredentialSchemas=function(){var e=new j.GDAF;return e.getAllSchemas()};j.createCredentialTemplate=function(e){var t=new j.GDAF;return t.createTemplate(e)};j.LTP=Iq();j.prepareRightToken=function(e,t,r,i,n,o){return j.LTP.Right.prepareRightToken(e,t,r,i,n,o)};j.prepareRightTokenVerification=function(e,t){return j.LTP.Right.prepareRightTokenVerification(e,t)};j.prepareRightTokenTransfer=function(e,t,r,i){return j.LTP.Right.prepareRightTokenTransfer(e,t,r,i)};j.prepareRightTypeValidation=function(e){return j.LTP.Right.prepareRightTypeValidation(e)};j.prepareObligationToken=function(e,t,r,i,n,o){return j.LTP.Obligation.prepareObligationToken(e,t,r,i,n,o)};j.prepareObligationVerification=function(e,t){return j.LTP.Obligation.prepareObligationVerification(e,t)};j.prepareObligationFulfillment=function(e,t,r,i){return j.LTP.Obligation.prepareObligationFulfillment(e,t,r,i)};j.prepareObligationBreachAssessment=function(e,t,r){return j.LTP.Obligation.prepareObligationBreachAssessment(e,t,r)};j.prepareObligationMonitoringReport=function(e,t){return j.LTP.Obligation.prepareObligationMonitoringReport(e,t)};j.prepareClaimValidation=function(e,t){return j.LTP.Claim.prepareClaimValidation(e,t)};j.prepareClaimAttestation=function(e,t,r){return j.LTP.Claim.prepareClaimAttestation(e,t,r)};j.prepareClaimDispute=function(e,t,r){return j.LTP.Claim.prepareClaimDispute(e,t,r)};j.prepareBulkClaimValidation=function(e,t){return j.LTP.Claim.prepareBulkClaimValidation(e,t)};j.prepareClaimTemplate=function(e,t){return j.LTP.Claim.prepareClaimTemplate(e,t)};j.prepareSignatureProof=function(e,t,r){return j.LTP.Proof.prepareSignatureProof(e,t,r)};j.prepareSignatureVerification=function(e,t){return j.LTP.Proof.prepareSignatureVerification(e,t)};j.prepareSelectiveDisclosure=function(e,t,r){return j.LTP.Proof.prepareSelectiveDisclosure(e,t,r)};j.prepareSelectiveDisclosureVerification=function(e,t){return j.LTP.Proof.prepareSelectiveDisclosureVerification(e,t)};j.prepareLegalValidityProof=function(e,t,r){return j.LTP.Proof.prepareLegalValidityProof(e,t,r)};j.prepareZeroKnowledgeProof=function(e,t,r){return j.LTP.Proof.prepareZeroKnowledgeProof(e,t,r)};j.prepareRegistry=function(e){return j.LTP.Registry.prepareRegistry(e)};j.prepareTokenRegistration=function(e,t,r){return j.LTP.Registry.prepareTokenRegistration(e,t,r)};j.prepareTokenApproval=function(e,t,r){return j.LTP.Registry.prepareTokenApproval(e,t,r)};j.prepareTokenRevocation=function(e,t,r){return j.LTP.Registry.prepareTokenRevocation(e,t,r)};j.prepareTokenStatusQuery=function(e,t){return j.LTP.Registry.prepareTokenStatusQuery(e,t)};j.prepareTokenSearch=function(e,t){return j.LTP.Registry.prepareTokenSearch(e,t)};j.prepareStatisticsQuery=function(e){return j.LTP.Registry.prepareStatisticsQuery(e)};j.prepareAuditLogQuery=function(e,t){return j.LTP.Registry.prepareAuditLogQuery(e,t)};j.prepareTokenCommitment=function(e,t){return j.LTP.Anchor.prepareTokenCommitment(e,t)};j.prepareBatchCommitment=function(e,t){return j.LTP.Anchor.prepareBatchCommitment(e,t)};j.verifyTokenAnchor=function(e,t,r){return j.LTP.Anchor.verifyTokenAnchor(e,t,r)};j.formatRevocation=function(e,t){return j.LTP.Anchor.formatRevocation(e,t)};j.createRightToken=function(e,t,r){var i=new j.LTP;return i.createRightToken(e,t,r)};j.verifyLegalToken=function(e,t){var r=new j.LTP;return r.verifyToken(e,t)};j.validateLegalClaim=function(e,t){var r=new j.LTP;return r.validateClaim(e,t)};j.createSelectiveDisclosure=function(e,t,r){var i=new j.LTP;return i.createSelectiveDisclosure(e,t,r)};j.createLegalRegistry=function(e){return j.LTP.Registry.prepareRegistry(e)};j.createLegalValidityProof=function(e,t,r){var i=new j.LTP;return i.createLegalValidityProof(e,t,r)};j.getRightTypes=function(){return j.LTP.Right.getRightTypes()};j.getObligationTypes=function(){return j.LTP.Obligation.getObligationTypes()};j.getObligationPriority=function(){return j.LTP.Obligation.getObligationPriority()};j.getObligationStatus=function(){return j.LTP.Obligation.getObligationStatus()};j.getClaimSchemas=function(){return j.LTP.Claim.getSchemas()};j.getClaimSchemaNames=function(){return j.LTP.Claim.getSchemaNames()};j.getClaimSchema=function(e){return j.LTP.Claim.getSchema(e)};j.createClaimTemplate=function(e){return j.LTP.Claim.createTemplate(e)};j.canonicalizeClaim=function(e){return j.LTP.Claim.canonicalize(e)};j.hashClaim=function(e){return j.LTP.Claim.hash(e)};j.addCustomClaimSchema=function(e,t){return j.LTP.Claim.addSchema(e,t)};j.Transaction.sighash=qa()});var gse=k((_me,Pq)=>{v();Pq.exports=Ae()});return gse();})();
|