@blockcerts/blockcerts-verifier 1.52.0 → 1.52.1
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/dist/ie11.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +2 -2
package/dist/ie11.js
CHANGED
|
@@ -656,7 +656,7 @@ if("@preserve"in t)return"@null"===t["@preserve"]?null:t["@preserve"];if(q6(t))r
|
|
|
656
656
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
657
657
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
658
658
|
*/var k8=U5.IdentifierIssuer,S8=T4.expand,Q8=J4.flatten,_8=s6.fromRDF,N8=B6.toRDF,D8=_6.frameMergedOrDefault,F8=B5.isArray,P8=B5.isObject,U8=B5.isString,L8=C5.isSubjectReference,M8=d4.getInitialContext,T8=d4.process,R8=d4.getAllContexts,O8=i8.compact,H8=i8.compactIri,K8=i8.removePreserve,j8=G4.createNodeMap,G8=G4.createMergedNodeMap,q8=G4.mergeNodeMaps,V8=void 0!==cW&&cW.versions&&cW.versions.node,z8=!V8&&("undefined"!=typeof window||"undefined"!=typeof self),J8=function(e){var t={};function n(t,n){var r=n.documentLoader,i=void 0===r?e.documentLoader:r,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,["documentLoader"]);return Object.assign({},{documentLoader:i},o,t)}return e.compact=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A,c,h,f,d,p,g,v,y=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(y.length<2)){t.next=2;break}throw new TypeError("Could not compact, too few arguments.");case 2:if(null!==o){t.next=4;break}throw new x5("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});case 4:if(null!==i){t.next=6;break}return t.abrupt("return",null);case 6:if((a=n(a,{base:U8(i)?i:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new k8("_:b")})).link&&(a.skipExpansion=!0),a.compactToRelative||delete a.base,!a.skipExpansion){t.next=12;break}t.t0=i,t.next=15;break;case 12:return t.next=14,e.expand(i,a);case 14:t.t0=t.sent;case 15:return s=t.t0,t.next=18,e.processContext(M8(a),o,a);case 18:u=t.sent,l=O8({activeCtx:u,element:s,options:a,compactionMap:a.compactionMap}),a.compactArrays&&!a.graph&&F8(l)?1===l.length?l=l[0]:0===l.length&&(l={}):a.graph&&P8(l)&&(l=[l]),P8(o)&&"@context"in o&&(o=o["@context"]),o=U5.clone(o),F8(o)||(o=[o]),A=o,o=[];for(c=0;c<A.length;++c)(!P8(A[c])||Object.keys(A[c]).length>0)&&o.push(A[c]);if(h=o.length>0,1===o.length&&(o=o[0]),F8(l))f=H8({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),d=l,l={},h&&(l["@context"]=o),l[f]=d;else if(P8(l)&&h)for(g in p=l,l={"@context":o},p)l[g]=p[g];return a.framing&&(v=H8({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),// remove @preserve from results
|
|
659
|
-
a.link={},l[v]=K8(u,l[v],a)),t.abrupt("return",l);case 28:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.expand=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s,u,l,A,c,h,f=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(f.length<1)){t.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(o=n(o,{keepFreeFloatingNodes:!1})).expansionMap&&(o.expansionMap=void 0),a={},s=[],"expandContext"in o&&(u=U5.clone(o.expandContext),P8(u)&&"@context"in u?a.expandContext=u:a.expandContext={"@context":u},s.push(a.expandContext)),!U8(i)){t.next=12;break}return t.next=8,e.get(i,o);case 8:A=t.sent,l=A.documentUrl,a.input=A.document,A.contextUrl&&(a.remoteContext={"@context":A.contextUrl},s.push(a.remoteContext)),t.next=13;break;case 12:a.input=U5.clone(i);case 13:return"base"in o||(o.base=l||""),t.next=16,R8(a,o);case 16:return c=M8(o),s.forEach((function(e){c=T8({activeCtx:c,localCtx:e,options:o})})),h=S8({activeCtx:c,element:a.input,options:o,expansionMap:o.expansionMap}),t.abrupt("return",(P8(h)&&"@graph"in h&&1===Object.keys(h).length?h=h["@graph"]:null===h&&(h=[]),F8(h)||(h=[h]),h));case 20:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.flatten=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(A.length<1)){t.next=2;break}return t.abrupt("return",new TypeError("Could not flatten, too few arguments."));case 2:return o="function"==typeof o?null:o||null,a=n(a,{base:U8(i)?i:""}),t.next=5,e.expand(i,a);case 5:if(s=t.sent,u=Q8(s),null!==o){t.next=9;break}return t.abrupt("return",u);case 9:return a.graph=!0,a.skipExpansion=!0,t.next=12,e.compact(u,o,a);case 12:return l=t.sent,t.abrupt("return",l);case 14:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.frame=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A,c,h,f,d,p=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(p.length<2)){t.next=2;break}throw new TypeError("Could not frame, too few arguments.");case 2:if(a=n(a,{base:U8(i)?i:"",embed:"@last",explicit:!1,requireAll:!0,omitDefault:!1,pruneBlankNodeIdentifiers:!0,bnodesToClear:[]}),!U8(o)){t.next=7;break}return t.next=5,e.get(o,a);case 5:s=t.sent,o=s.document,s.contextUrl&&((u=o["@context"])?F8(u)?u.push(s.contextUrl):u=[u,s.contextUrl]:u=s.contextUrl,o["@context"]=u);case 7:return l=o&&o["@context"]||{},t.next=10,e.expand(i,a);case 10:return A=t.sent,(c=U5.clone(a)).isFrame=!0,c.keepFreeFloatingNodes=!0,t.next=15,e.expand(o,c);case 15:return h=t.sent,c.merged=!("@graph"in o),f=D8(A,h,c),c.graph=!0,c.skipExpansion=!0,c.link={},c.framing=!0,t.next=21,e.compact(f,l,c);case 21:return d=t.sent,t.abrupt("return",d);case 23:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.link=U5.callbackify(function(){var t=x8(r().mark((function t(n,i,o){var a;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={},t.abrupt("return",(i&&(a["@context"]=i),a["@embed"]="@link",e.frame(n,a,o)));case 2:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.normalize=e.canonize=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s,u,l=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(l.length<1)){t.next=2;break}throw new TypeError("Could not canonize, too few arguments.");case 2:if(!("inputFormat"in(o=n(o,{base:U8(i)?i:"",algorithm:"URDNA2015",skipExpansion:!1})))){t.next=7;break}if("application/n-quads"===o.inputFormat||"application/nquads"===o.inputFormat){t.next=5;break}throw new x5("Unknown canonicalization input format.","jsonld.CanonizeError");case 5:return a=H5.parse(i),t.abrupt("return",a3.canonize(a,o));case 7:return delete(s=U5.clone(o)).format,s.produceGeneralizedRdf=!1,t.next=11,e.toRDF(i,s);case 11:return u=t.sent,t.abrupt("return",a3.canonize(u,o));case 13:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.fromRDF=U5.callbackify(function(){var e=x8(r().mark((function e(i,o){var a,s,u,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(l.length<1)){e.next=2;break}throw new TypeError("Could not convert from RDF, too few arguments.");case 2:if(o=n(o,{format:U8(i)?"application/n-quads":void 0}),a=o.format,u=o.rdfParser,!a){e.next=10;break}if(u=u||t[a]){e.next=8;break}throw new x5("Unknown input format.","jsonld.UnknownFormat",{format:a});case 8:e.next=11;break;case 10:u=function(){return i};case 11:return s=u.length>1?new Promise((function(e,t){u(i,(function(n,r){n?t(n):e(r)}))})):Promise.resolve(u(i)),e.next=14,s;case 14:return s=e.sent,Array.isArray(s)||(s=H5.legacyDatasetToQuads(s)),e.abrupt("return",_8(s,o));case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),e.toRDF=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s,u=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(u.length<1)){t.next=2;break}throw new TypeError("Could not convert to RDF, too few arguments.");case 2:if(!(o=n(o,{base:U8(i)?i:"",skipExpansion:!1})).skipExpansion){t.next=6;break}t.t0=i,t.next=9;break;case 6:return t.next=8,e.expand(i,o);case 8:t.t0=t.sent;case 9:if(a=t.t0,s=N8(a,o),!o.format){t.next=17;break}if("application/n-quads"!==o.format&&"application/nquads"!==o.format){t.next=16;break}return t.next=15,H5.serialize(s);case 15:return t.abrupt("return",t.sent);case 16:throw new x5("Unknown output format.","jsonld.UnknownFormat",{format:o.format});case 17:return t.abrupt("return",s);case 18:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.createNodeMap=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(s.length<1)){t.next=2;break}throw new TypeError("Could not create node map, too few arguments.");case 2:return o=n(o,{base:U8(i)?i:""}),t.next=5,e.expand(i,o);case 5:return a=t.sent,t.abrupt("return",G8(a,o));case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.merge=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A,c,h,f,d,p,g,v,y,m,w,b,I,B,E=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(E.length<1)){t.next=2;break}throw new TypeError("Could not merge, too few arguments.");case 2:if(F8(i)){t.next=4;break}throw new TypeError('Could not merge, "docs" must be an array.');case 4:return o="function"==typeof o?null:o||null,a=n(a,{}),t.next=7,Promise.all(i.map((function(t){var n=Object.assign({},a);return e.expand(t,n)})));case 7:s=t.sent,u=!0,"mergeNodes"in a&&(u=a.mergeNodes),l=a.issuer||new k8("_:b"),A={"@default":{}},c=0;case 12:if(!(c<s.length)){t.next=29;break}if(h=U5.relabelBlankNodes(s[c],{issuer:new k8("_:b"+c+"-")}),j8(h,f=u||0===c?A:{"@default":{}},"@default",l),f===A){t.next=26;break}t.t0=r().keys(f);case 16:if((t.t1=t.t0()).done){t.next=26;break}if(d=t.t1.value,p=f[d],d in A){t.next=22;break}return A[d]=p,t.abrupt("continue",16);case 22:for(v in g=A[d],p)v in g||(g[v]=p[v]);t.next=16;break;case 26:++c,t.next=12;break;case 29:for(y=q8(A),m=[],w=Object.keys(y).sort(),b=0;b<w.length;++b)I=y[w[b]],L8(I)||m.push(I);if(null!==o){t.next=33;break}return t.abrupt("return",m);case 33:return a.graph=!0,a.skipExpansion=!0,t.next=36,e.compact(m,o,a);case 36:return B=t.sent,t.abrupt("return",B);case 38:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),Object.defineProperty(e,"documentLoader",{get:function(){return e._documentLoader},set:function(t){return e._documentLoader=U5.normalizeDocumentLoader(t)}}),e.documentLoader=function(){var e=x8(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new x5("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.loadDocument=U5.callbackify(x8(r().mark((function t(){var n=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.documentLoader.apply(null,n));case 1:case"end":return t.stop()}}),t)})))),e.get=U5.callbackify(function(){var t=x8(r().mark((function t(n,i){var o,a;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="function"==typeof i.documentLoader?U5.normalizeDocumentLoader(i.documentLoader):e.documentLoader,t.next=3,o(n);case 3:if(a=t.sent,t.prev=4,a.document){t.next=7;break}throw new x5("No remote document found at the given URL.","jsonld.NullRemoteDocument");case 7:U8(a.document)&&(a.document=JSON.parse(a.document)),t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(4),new x5("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:t.t0,remoteDoc:a});case 13:return t.abrupt("return",a);case 14:case"end":return t.stop()}}),t,null,[[4,10]])})));return function(e,n){return t.apply(this,arguments)}}()),e.processContext=U5.callbackify(function(){var e=x8(r().mark((function e(t,i,o){var a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n(o,{base:""}),null!==i){e.next=2;break}return e.abrupt("return",M8(o));case 2:return i=U5.clone(i),P8(i)&&"@context"in i||(i={"@context":i}),e.next=5,R8(i,o);case 5:return a=e.sent,e.abrupt("return",T8({activeCtx:t,localCtx:a,options:o}));case 7:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),e.getContextValue=d4.getContextValue,e.documentLoaders={},e.documentLoaders.node=p8,e.documentLoaders.xhr=B8,e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new x5('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",H5.parse),e.registerRDFParser("application/nquads",H5.parse),e.registerRDFParser("rdfa-api",function(){function e(){s(this,e)}return l(e,[{key:"parse",value:function(e){for(var t={"@default":[]},n=e.getSubjects(),r=0;r<n.length;++r){var i=n[r];if(null!==i){var o=e.getSubjectTriples(i);if(null!==o){var a=o.predicates;for(var s in a)for(var u=a[s].objects,l=0;l<u.length;++l){var A=u[l],c={};0===i.indexOf("_:")?c.subject={type:"blank node",value:i}:c.subject={type:"IRI",value:i},0===s.indexOf("_:")?c.predicate={type:"blank node",value:s}:c.predicate={type:"IRI",value:s};var h=A.value;if(A.type===J5){var f=new("undefined"==typeof XMLSerializer?i3.XMLSerializer:XMLSerializer);h="";for(var d=0;d<A.value.length;d++)A.value[d].nodeType===O5.ELEMENT_NODE?h+=f.serializeToString(A.value[d]):A.value[d].nodeType===O5.TEXT_NODE&&(h+=A.value[d].nodeValue)}c.object={},A.type===z5?0===A.value.indexOf("_:")?c.object.type="blank node":c.object.type="IRI":(c.object.type="literal",A.type===V5?A.language?(c.object.datatype=q5,c.object.language=A.language):c.object.datatype=Y5:c.object.datatype=A.type),c.object.value=h,t["@default"].push(c)}}}}return t}}]),e}().parse),e.url=Z5,e.util=U5,Object.assign(e,U5),e.promises=e,e.RequestQueue=l8,e.JsonLdProcessor=function(e){var t=function(){function e(){s(this,e)}return l(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}(e),z8&&void 0===FY.JsonLdProcessor&&Object.defineProperty(FY,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor}),V8?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),e},Y8=function e(){return J8((function(){return e()}))};J8(Y8);var X8=Y8,W8=UY((function(e){_2.gte(cW.version,"8.6.0")?e.exports=b5:e.exports=X8}));W8.jsonld;var Z8=UY((function(e){!function(t){var n={bytesToHex:function(e){return function(e){return e.map((function(e){return 2,(t=e.toString(16)).length>2?t:Array(2-t.length+1).join("0")+t;var t})).join("")}(e)},hexToBytes:function(e){if(e.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map((function(e){return parseInt(e,16)}))}};e.exports?e.exports=n:t.convertHex=n}(FY)})),$8=UY((function(e){!function(t){var n={bytesToString:function(e){return e.map((function(e){return String.fromCharCode(e)})).join("")},stringToBytes:function(e){return e.split("").map((function(e){return e.charCodeAt(0)}))}};n.UTF8={bytesToString:function(e){return decodeURIComponent(escape(n.bytesToString(e)))},stringToBytes:function(e){return n.stringToBytes(unescape(encodeURIComponent(e)))}},e.exports?e.exports=n:t.convertString=n}(FY)})),e9=UY((function(e){!function(t){var n={};e.exports?(n.bytesToHex=Z8.bytesToHex,n.convertString=$8,e.exports=a):(n.bytesToHex=t.convertHex.bytesToHex,n.convertString=t.convertString,t.sha256=a);var r=[];!function(){function e(e){for(var t=Math.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(r[i]=t(Math.pow(n,1/3)),i++),n++}();var i=[],o=function(e,t,n){for(var o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],A=e[5],c=e[6],h=e[7],f=0;f<64;f++){if(f<16)i[f]=0|t[n+f];else{var d=i[f-15],p=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=i[f-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;i[f]=p+i[f-7]+v+i[f-16]}var y=o&a^o&s^a&s,m=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),w=h+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&A^~l&c)+r[f]+i[f];h=c,c=A,A=l,l=u+w|0,u=s,s=a,a=o,o=w+(m+y)|0}e[0]=e[0]+o|0,e[1]=e[1]+a|0,e[2]=e[2]+s|0,e[3]=e[3]+u|0,e[4]=e[4]+l|0,e[5]=e[5]+A|0,e[6]=e[6]+c|0,e[7]=e[7]+h|0};function a(e,t){e.constructor===String&&(e=n.convertString.UTF8.stringToBytes(e));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t}(e),a=8*e.length;i[a>>5]|=128<<24-a%32,i[15+(a+64>>9<<4)]=a;for(var s=0;s<i.length;s+=16)o(r,i,s);var u=function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t}(r);return t&&t.asBytes?u:t&&t.asString?n.convertString.bytesToString(u):n.bytesToHex(u)}a.x2=function(e,t){return a(a(e,{asBytes:!0}),t)}}(FY)}));function t9(e){e=e.trim();for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t}function n9(e,t){return sY(this,void 0,void 0,r().mark((function n(){var i,o,a,s;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e["@context"],o=e,!function(e){return e===oY.V1_1||e===oY.V1_2}(t)&&(i.find((function(e){return e===Object(e)&&"@vocab"in e}))?i=null:i.push({"@vocab":"http://fallback.org/"})),a="undefined"!=typeof window&&void 0!==window.XMLHttpRequest?W8.documentLoaders.xhr():W8.documentLoaders.node(),W8.documentLoader=function(e,t){return e in bY?t(null,{contextUrl:null,document:bY[e],documentUrl:e}):a(e,t)},s={algorithm:"URDNA2015",format:"application/nquads"},n.abrupt("return",(i&&(s.expandContext=i),new Promise((function(e,t){W8.normalize(o,s,(function(n,r){if(n)console.error(n),t(new NY("computeLocalHash",CY("errors","failedJsonLdNormalization")));else{var i=function(e){var t=/<http:\/\/fallback\.org\/(.*)>/.exec(e);if(t){for(var n=[],r=0;r<t.length;r++)n.push(t[r]);return n}return null}(r);i?t(new NY("computeLocalHash","".concat(CY("errors","foundUnmappedFields"),": ").concat(i.join(", ")))):e(e9(function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(r)))}}))}))));case 7:case"end":return n.stop()}}),n)})))}var r9=UY((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),i9=UY((function(e,t){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=OX.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=OX:(r(OX,t),t.Buffer=i),i.prototype=Object.create(n.prototype),r(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return OX.SlowBuffer(e)}}));i9.Buffer;var o9=QZ.EventEmitter;function a9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u9=OX.Buffer,l9=i3.inspect,A9=l9&&l9.custom||"inspect";function c9(e,t,n){u9.prototype.copy.call(e,t,n)}var h9=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u9.alloc(0);for(var t=u9.allocUnsafe(e>>>0),n=this.head,r=0;n;)c9(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u9.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:A9,value:function(e,t){return l9(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a9(Object(n),!0).forEach((function(t){s9(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a9(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function f9(e,t){p9(e,t),d9(e)}function d9(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function p9(e,t){e.emit("error",t)}var g9=function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ZX(p9,this,e)):ZX(p9,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?n._writableState?n._writableState.errorEmitted?ZX(d9,n):(n._writableState.errorEmitted=!0,ZX(f9,n,e)):ZX(f9,n,e):t?(ZX(d9,n),t(e)):ZX(d9,n)})),this)},v9=function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},y9=function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)},m9={};function w9(e,t,n){n||(n=Error);var r=function(e){var n,r;function i(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);r.prototype.name=n.name,r.prototype.code=e,m9[e]=r}function b9(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}w9("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),w9("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(r," ").concat(b9(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(r," ").concat(b9(t,"type"))}return a+". Received type ".concat(i(n))}),TypeError),w9("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),w9("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),w9("ERR_STREAM_PREMATURE_CLOSE","Premature close"),w9("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),w9("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),w9("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),w9("ERR_STREAM_WRITE_AFTER_END","write after end"),w9("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w9("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),w9("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var I9={codes:m9},B9=I9.codes.ERR_INVALID_OPT_VALUE,E9=function(e,t,n,r){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new B9(r?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384};function C9(e){try{if(!FY.localStorage)return!1}catch(e){return!1}var t=FY.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var x9,k9=V9;function S9(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}V9.WritableState=q9;var Q9,_9=function(e,t){if(C9("noDeprecation"))return e;var n=!1;return function(){if(!n){if(C9("throwDeprecation"))throw new Error(t);C9("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}},N9=OX.Buffer,D9=FY.Uint8Array||function(){},F9=E9,P9=I9.codes,U9=P9.ERR_INVALID_ARG_TYPE,L9=P9.ERR_METHOD_NOT_IMPLEMENTED,M9=P9.ERR_MULTIPLE_CALLBACK,T9=P9.ERR_STREAM_CANNOT_PIPE,R9=P9.ERR_STREAM_DESTROYED,O9=P9.ERR_STREAM_NULL_VALUES,H9=P9.ERR_STREAM_WRITE_AFTER_END,K9=P9.ERR_UNKNOWN_ENCODING,j9=y9;function G9(){}function q9(e,t,n){x9=x9||e7,e=e||{},"boolean"!=typeof n&&(n=t instanceof x9),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=F9(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new M9;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(ZX(i,r),ZX(Z9,e,t),e._writableState.errorEmitted=!0,j9(e,r)):(i(r),e._writableState.errorEmitted=!0,j9(e,r),Z9(e,t))}(e,n,r,t,i);else{var o=X9(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||Y9(e,n),r?ZX(J9,e,n,o,i):J9(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new S9(this)}function V9(e){var t=this instanceof(x9=x9||e7);if(!t&&!Q9.call(V9,this))return new V9(e);this._writableState=new q9(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o9.call(this)}function z9(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new R9("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function J9(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),Z9(e,t)}function Y9(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var a=0,s=!0;n;)i[a]=n,n.isBuf||(s=!1),n=n.next,a+=1;i.allBuffers=s,z9(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new S9(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,A=n.callback;if(z9(e,t,!1,t.objectMode?1:u.length,u,l,A),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function X9(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function W9(e,t){e._final((function(n){t.pendingcb--,n&&j9(e,n),t.prefinished=!0,e.emit("prefinish"),Z9(e,t)}))}function Z9(e,t){var n=X9(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,ZX(W9,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}r9(V9,o9),q9.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(q9.prototype,"buffer",{get:_9((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(Q9=Function.prototype[Symbol.hasInstance],Object.defineProperty(V9,Symbol.hasInstance,{value:function(e){return!!Q9.call(this,e)||this===V9&&e&&e._writableState instanceof q9}})):Q9=function(e){return e instanceof this},V9.prototype.pipe=function(){j9(this,new T9)},V9.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,a=!i.objectMode&&(r=e,N9.isBuffer(r)||r instanceof D9);return a&&!N9.isBuffer(e)&&(e=function(e){return N9.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=G9),i.ending?function(e,t){var n=new H9;j9(e,n),ZX(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new O9:"string"==typeof n||t.objectMode||(i=new U9("chunk",["string","Buffer"],n)),!i||(j9(e,i),ZX(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=N9.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else z9(e,t,!1,s,r,i,o);return u}(this,i,a,e,t,n)),o},V9.prototype.cork=function(){this._writableState.corked++},V9.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||Y9(this,e))},V9.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new K9(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(V9.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(V9.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),V9.prototype._write=function(e,t,n){n(new L9("_write()"))},V9.prototype._writev=null,V9.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,Z9(e,t),n&&(t.finished?ZX(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(V9.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(V9.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),V9.prototype.destroy=g9,V9.prototype._undestroy=v9,V9.prototype._destroy=function(e,t){t(e)};var $9=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},e7=i7;r9(i7,O7);for(var t7=$9(k9.prototype),n7=0;n7<t7.length;n7++){var r7=t7[n7];i7.prototype[r7]||(i7.prototype[r7]=k9.prototype[r7])}function i7(e){if(!(this instanceof i7))return new i7(e);O7.call(this,e),k9.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",o7)))}function o7(){this._writableState.ended||ZX(a7,this)}function a7(e){e.end()}Object.defineProperty(i7.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(i7.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(i7.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(i7.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});var s7=i9.Buffer,u7=s7.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},l7=A7;function A7(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(s7.isEncoding===u7||!u7(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f7,this.end=d7,t=4;break;case"utf8":this.fillLast=h7,t=4;break;case"base64":this.text=p7,this.end=g7,t=3;break;default:return this.write=v7,void(this.end=y7)}this.lastNeed=0,this.lastTotal=0,this.lastChar=s7.allocUnsafe(t)}function c7(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function h7(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f7(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d7(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p7(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g7(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v7(e){return e.toString(this.encoding)}function y7(e){return e&&e.length?this.write(e):""}A7.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},A7.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},A7.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=c7(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=c7(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=c7(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},A7.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var m7={StringDecoder:l7},w7=I9.codes.ERR_STREAM_PREMATURE_CLOSE;function b7(){}var I7,B7=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),r=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(r||b7);var i=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,a=function(){t.writable||u()},s=t._writableState&&t._writableState.finished,u=function(){o=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,A=function(){i=!1,l=!0,o||r.call(t)},c=function(e){r.call(t,e)},h=function(){var e;return i&&!l?(t._readableState&&t._readableState.ended||(e=new w7),r.call(t,e)):o&&!s?(t._writableState&&t._writableState.ended||(e=new w7),r.call(t,e)):void 0},f=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",h),t.req?f():t.on("request",f)):o&&!t._writableState&&(t.on("end",a),t.on("close",a)),t.on("end",A),t.on("finish",u),!1!==n.error&&t.on("error",c),t.on("close",h),function(){t.removeListener("complete",u),t.removeListener("abort",h),t.removeListener("request",f),t.req&&t.req.removeListener("finish",u),t.removeListener("end",a),t.removeListener("close",a),t.removeListener("finish",u),t.removeListener("end",A),t.removeListener("error",c),t.removeListener("close",h)}};function E7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var C7=Symbol("lastResolve"),x7=Symbol("lastReject"),k7=Symbol("error"),S7=Symbol("ended"),Q7=Symbol("lastPromise"),_7=Symbol("handlePromise"),N7=Symbol("stream");function D7(e,t){return{value:e,done:t}}function F7(e){var t=e[C7];if(null!==t){var n=e[N7].read();null!==n&&(e[Q7]=null,e[C7]=null,e[x7]=null,t(D7(n,!1)))}}function P7(e){ZX(F7,e)}var U7,L7=Object.getPrototypeOf((function(){})),M7=Object.setPrototypeOf((E7(I7={get stream(){return this[N7]},next:function(){var e=this,t=this[k7];if(null!==t)return Promise.reject(t);if(this[S7])return Promise.resolve(D7(void 0,!0));if(this[N7].destroyed)return new Promise((function(t,n){ZX((function(){e[k7]?n(e[k7]):t(D7(void 0,!0))}))}));var n,r=this[Q7];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[S7]?n(D7(void 0,!0)):t[_7](n,r)}),r)}}(r,this));else{var i=this[N7].read();if(null!==i)return Promise.resolve(D7(i,!1));n=new Promise(this[_7])}return this[Q7]=n,n}},Symbol.asyncIterator,(function(){return this})),E7(I7,"return",(function(){var e=this;return new Promise((function(t,n){e[N7].destroy(null,(function(e){e?n(e):t(D7(void 0,!0))}))}))})),I7),L7),T7=function(e){var t,n=Object.create(M7,(E7(t={},N7,{value:e,writable:!0}),E7(t,C7,{value:null,writable:!0}),E7(t,x7,{value:null,writable:!0}),E7(t,k7,{value:null,writable:!0}),E7(t,S7,{value:e._readableState.endEmitted,writable:!0}),E7(t,_7,{value:function(e,t){var r=n[N7].read();r?(n[Q7]=null,n[C7]=null,n[x7]=null,e(D7(r,!1))):(n[C7]=e,n[x7]=t)},writable:!0}),t));return n[Q7]=null,B7(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[x7];return null!==t&&(n[Q7]=null,n[C7]=null,n[x7]=null,t(e)),void(n[k7]=e)}var r=n[C7];null!==r&&(n[Q7]=null,n[C7]=null,n[x7]=null,r(D7(void 0,!0))),n[S7]=!0})),e.on("readable",P7.bind(null,n)),n},R7=function(){throw new Error("Readable.from is not available in the browser")},O7=ree;ree.ReadableState=nee;var H7,K7=function(e,t){return e.listeners(t).length},j7=OX.Buffer,G7=FY.Uint8Array||function(){};H7=i3&&i3.debuglog?i3.debuglog("stream"):function(){};var q7,V7,z7,J7=E9,Y7=I9.codes,X7=Y7.ERR_INVALID_ARG_TYPE,W7=Y7.ERR_STREAM_PUSH_AFTER_EOF,Z7=Y7.ERR_METHOD_NOT_IMPLEMENTED,$7=Y7.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r9(ree,o9);var eee=y9,tee=["error","close","destroy","pause","resume"];function nee(e,t,n){U7=U7||e7,e=e||{},"boolean"!=typeof n&&(n=t instanceof U7),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=J7(this,e,"readableHighWaterMark",n),this.buffer=new h9,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(q7||(q7=m7.StringDecoder),this.decoder=new q7(e.encoding),this.encoding=e.encoding)}function ree(e){if(U7=U7||e7,!(this instanceof ree))return new ree(e);var t=this instanceof U7;this._readableState=new nee(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o9.call(this)}function iee(e,t,n,r,i){H7("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(H7("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?see(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,uee(e)))}}(e,a);else if(i||(o=function(e,t){var n,r;return r=t,j7.isBuffer(r)||r instanceof G7||"string"==typeof t||void 0===t||e.objectMode||(n=new X7("chunk",["string","Buffer","Uint8Array"],t)),n}(a,t)),o)eee(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===j7.prototype||(t=function(e){return j7.from(e)}(t)),r)a.endEmitted?eee(e,new $7):oee(e,a,t,!0);else if(a.ended)eee(e,new W7);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?oee(e,a,t,!1):lee(e,a)):oee(e,a,t,!1)}else r||(a.reading=!1,lee(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function oee(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&see(e)),lee(e,t)}function aee(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function see(e){var t=e._readableState;H7("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(H7("emitReadable",t.flowing),t.emittedReadable=!0,ZX(uee,e))}function uee(e){var t=e._readableState;H7("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,dee(e)}function lee(e,t){t.readingMore||(t.readingMore=!0,ZX(Aee,e,t))}function Aee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(H7("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function cee(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function hee(e){H7("readable nexttick read 0"),e.read(0)}function fee(e,t){H7("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),dee(e),t.flowing&&!t.reading&&e.read(0)}function dee(e){var t=e._readableState;for(H7("flow",t.flowing);t.flowing&&null!==e.read(););}function pee(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function gee(e){var t=e._readableState;H7("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,ZX(vee,t,e))}function vee(e,t){if(H7("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function yee(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Object.defineProperty(ree.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),ree.prototype.destroy=g9,ree.prototype._undestroy=v9,ree.prototype._destroy=function(e,t){t(e)},ree.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=j7.from(e,t),t=""),n=!0),iee(this,e,t,!1,n)},ree.prototype.unshift=function(e){return iee(this,e,null,!0,!1)},ree.prototype.isPaused=function(){return!1===this._readableState.flowing},ree.prototype.setEncoding=function(e){q7||(q7=m7.StringDecoder);var t=new q7(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},ree.prototype.read=function(e){H7("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return H7("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gee(this):see(this),null;if(0===(e=aee(e,t))&&t.ended)return 0===t.length&&gee(this),null;var r,i=t.needReadable;return H7("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&H7("length less than watermark",i=!0),t.ended||t.reading?H7("reading or ended",i=!1):i&&(H7("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=aee(n,t))),null===(r=e>0?pee(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&gee(this)),null!==r&&this.emit("data",r),r},ree.prototype._read=function(e){eee(this,new Z7("_read()"))},ree.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,H7("pipe count=%d opts=%j",r.pipesCount,t);var i=t&&!1===t.end||e===cW.stdout||e===cW.stderr?h:o;function o(){H7("onend"),e.end()}r.endEmitted?ZX(i):n.once("end",i),e.on("unpipe",(function t(i,f){H7("onunpipe"),i===n&&f&&!1===f.hasUnpiped&&(f.hasUnpiped=!0,H7("cleanup"),e.removeListener("close",A),e.removeListener("finish",c),e.removeListener("drain",a),e.removeListener("error",l),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",h),n.removeListener("data",u),s=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||a())}));var a=function(e){return function(){var t=e._readableState;H7("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&K7(e,"data")&&(t.flowing=!0,dee(e))}}(n);e.on("drain",a);var s=!1;function u(t){H7("ondata");var i=e.write(t);H7("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==yee(r.pipes,e))&&!s&&(H7("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function l(t){H7("onerror",t),h(),e.removeListener("error",l),0===K7(e,"error")&&eee(e,t)}function A(){e.removeListener("finish",c),h()}function c(){H7("onfinish"),e.removeListener("close",A),h()}function h(){H7("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",l),e.once("close",A),e.once("finish",c),e.emit("pipe",n),r.flowing||(H7("pipe resume"),n.resume()),e},ree.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=yee(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},ree.prototype.on=function(e,t){var n=o9.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,H7("on readable",r.length,r.reading),r.length?see(this):r.reading||ZX(hee,this))),n},ree.prototype.addListener=ree.prototype.on,ree.prototype.removeListener=function(e,t){var n=o9.prototype.removeListener.call(this,e,t);return"readable"===e&&ZX(cee,this),n},ree.prototype.removeAllListeners=function(e){var t=o9.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||ZX(cee,this),t},ree.prototype.resume=function(){var e=this._readableState;return e.flowing||(H7("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ZX(fee,e,t))}(this,e)),e.paused=!1,this},ree.prototype.pause=function(){return H7("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(H7("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ree.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(H7("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){H7("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<tee.length;o++)e.on(tee[o],this.emit.bind(this,tee[o]));return this._read=function(t){H7("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(ree.prototype[Symbol.asyncIterator]=function(){return void 0===V7&&(V7=T7),V7(this)}),Object.defineProperty(ree.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ree.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ree.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),ree._fromList=pee,Object.defineProperty(ree.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(ree.from=function(e,t){return void 0===z7&&(z7=R7),z7(ree,e,t)});var mee=xee,wee=I9.codes,bee=wee.ERR_METHOD_NOT_IMPLEMENTED,Iee=wee.ERR_MULTIPLE_CALLBACK,Bee=wee.ERR_TRANSFORM_ALREADY_TRANSFORMING,Eee=wee.ERR_TRANSFORM_WITH_LENGTH_0;function Cee(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new Iee);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function xee(e){if(!(this instanceof xee))return new xee(e);e7.call(this,e),this._transformState={afterTransform:Cee.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",kee)}function kee(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?See(this,null,null):this._flush((function(t,n){See(e,t,n)}))}function See(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Eee;if(e._transformState.transforming)throw new Bee;return e.push(null)}r9(xee,e7),xee.prototype.push=function(e,t){return this._transformState.needTransform=!1,e7.prototype.push.call(this,e,t)},xee.prototype._transform=function(e,t,n){n(new bee("_transform()"))},xee.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},xee.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},xee.prototype._destroy=function(e,t){e7.prototype._destroy.call(this,e,(function(e){t(e)}))};var Qee,_ee=Nee;function Nee(e){if(!(this instanceof Nee))return new Nee(e);mee.call(this,e)}r9(Nee,mee),Nee.prototype._transform=function(e,t,n){n(null,e)};var Dee=I9.codes,Fee=Dee.ERR_MISSING_ARGS,Pee=Dee.ERR_STREAM_DESTROYED;function Uee(e){if(e)throw e}function Lee(e,t,n,r){r=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(r);var i=!1;e.on("close",(function(){i=!0})),void 0===Qee&&(Qee=B7),Qee(e,{readable:t,writable:n},(function(e){if(e)return r(e);i=!0,r()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void r(t||new Pee("pipe"))}}function Mee(e){e()}function Tee(e,t){return e.pipe(t)}function Ree(e){return e.length?"function"!=typeof e[e.length-1]?Uee:e.pop():Uee}var Oee=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ree(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Fee("streams");var o=t.map((function(e,n){var a=n<t.length-1;return Lee(e,a,n>0,(function(e){r||(r=e),e&&o.forEach(Mee),a||(o.forEach(Mee),i(r))}))}));return t.reduce(Tee)},Hee=UY((function(e,t){(t=e.exports=O7).Stream=t,t.Readable=t,t.Writable=k9,t.Duplex=e7,t.Transform=mee,t.PassThrough=_ee,t.finished=B7,t.pipeline=Oee}));Hee.Stream,Hee.Readable,Hee.Writable,Hee.Duplex,Hee.Transform,Hee.PassThrough,Hee.finished,Hee.pipeline;var Kee=i9.Buffer,jee=Hee.Transform;function Gee(e){jee.call(this),this._block=Kee.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r9(Gee,jee),Gee.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},Gee.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},Gee.prototype.update=function(e,t){if(function(e,t){if(!Kee.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");Kee.isBuffer(e)||(e=Kee.from(e,t));for(var n=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)n[i++]=e[r++];this._update(),this._blockOffset=0}for(;r<e.length;)n[this._blockOffset++]=e[r++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},Gee.prototype._update=function(){throw new Error("_update is not implemented")},Gee.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},Gee.prototype._digest=function(){throw new Error("_digest is not implemented")};var qee=Gee,Vee=i9.Buffer,zee=new Array(16);function Jee(){qee.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Yee(e,t){return e<<t|e>>>32-t}function Xee(e,t,n,r,i,o,a){return Yee(e+(t&n|~t&r)+i+o|0,a)+t|0}function Wee(e,t,n,r,i,o,a){return Yee(e+(t&r|n&~r)+i+o|0,a)+t|0}function Zee(e,t,n,r,i,o,a){return Yee(e+(t^n^r)+i+o|0,a)+t|0}function $ee(e,t,n,r,i,o,a){return Yee(e+(n^(t|~r))+i+o|0,a)+t|0}r9(Jee,qee),Jee.prototype._update=function(){for(var e=zee,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=Xee(n,r,i,o,e[0],3614090360,7),o=Xee(o,n,r,i,e[1],3905402710,12),i=Xee(i,o,n,r,e[2],606105819,17),r=Xee(r,i,o,n,e[3],3250441966,22),n=Xee(n,r,i,o,e[4],4118548399,7),o=Xee(o,n,r,i,e[5],1200080426,12),i=Xee(i,o,n,r,e[6],2821735955,17),r=Xee(r,i,o,n,e[7],4249261313,22),n=Xee(n,r,i,o,e[8],1770035416,7),o=Xee(o,n,r,i,e[9],2336552879,12),i=Xee(i,o,n,r,e[10],4294925233,17),r=Xee(r,i,o,n,e[11],2304563134,22),n=Xee(n,r,i,o,e[12],1804603682,7),o=Xee(o,n,r,i,e[13],4254626195,12),i=Xee(i,o,n,r,e[14],2792965006,17),n=Wee(n,r=Xee(r,i,o,n,e[15],1236535329,22),i,o,e[1],4129170786,5),o=Wee(o,n,r,i,e[6],3225465664,9),i=Wee(i,o,n,r,e[11],643717713,14),r=Wee(r,i,o,n,e[0],3921069994,20),n=Wee(n,r,i,o,e[5],3593408605,5),o=Wee(o,n,r,i,e[10],38016083,9),i=Wee(i,o,n,r,e[15],3634488961,14),r=Wee(r,i,o,n,e[4],3889429448,20),n=Wee(n,r,i,o,e[9],568446438,5),o=Wee(o,n,r,i,e[14],3275163606,9),i=Wee(i,o,n,r,e[3],4107603335,14),r=Wee(r,i,o,n,e[8],1163531501,20),n=Wee(n,r,i,o,e[13],2850285829,5),o=Wee(o,n,r,i,e[2],4243563512,9),i=Wee(i,o,n,r,e[7],1735328473,14),n=Zee(n,r=Wee(r,i,o,n,e[12],2368359562,20),i,o,e[5],4294588738,4),o=Zee(o,n,r,i,e[8],2272392833,11),i=Zee(i,o,n,r,e[11],1839030562,16),r=Zee(r,i,o,n,e[14],4259657740,23),n=Zee(n,r,i,o,e[1],2763975236,4),o=Zee(o,n,r,i,e[4],1272893353,11),i=Zee(i,o,n,r,e[7],4139469664,16),r=Zee(r,i,o,n,e[10],3200236656,23),n=Zee(n,r,i,o,e[13],681279174,4),o=Zee(o,n,r,i,e[0],3936430074,11),i=Zee(i,o,n,r,e[3],3572445317,16),r=Zee(r,i,o,n,e[6],76029189,23),n=Zee(n,r,i,o,e[9],3654602809,4),o=Zee(o,n,r,i,e[12],3873151461,11),i=Zee(i,o,n,r,e[15],530742520,16),n=$ee(n,r=Zee(r,i,o,n,e[2],3299628645,23),i,o,e[0],4096336452,6),o=$ee(o,n,r,i,e[7],1126891415,10),i=$ee(i,o,n,r,e[14],2878612391,15),r=$ee(r,i,o,n,e[5],4237533241,21),n=$ee(n,r,i,o,e[12],1700485571,6),o=$ee(o,n,r,i,e[3],2399980690,10),i=$ee(i,o,n,r,e[10],4293915773,15),r=$ee(r,i,o,n,e[1],2240044497,21),n=$ee(n,r,i,o,e[8],1873313359,6),o=$ee(o,n,r,i,e[15],4264355552,10),i=$ee(i,o,n,r,e[6],2734768916,15),r=$ee(r,i,o,n,e[13],1309151649,21),n=$ee(n,r,i,o,e[4],4149444226,6),o=$ee(o,n,r,i,e[11],3174756917,10),i=$ee(i,o,n,r,e[2],718787259,15),r=$ee(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},Jee.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Vee.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var ete=Jee,tte=OX.Buffer,nte=new Array(16),rte=[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],ite=[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],ote=[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],ate=[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],ste=[0,1518500249,1859775393,2400959708,2840853838],ute=[1352829926,1548603684,1836072691,2053994217,0];function lte(){qee.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function Ate(e,t){return e<<t|e>>>32-t}function cte(e,t,n,r,i,o,a,s){return Ate(e+(t^n^r)+o+a|0,s)+i|0}function hte(e,t,n,r,i,o,a,s){return Ate(e+(t&n|~t&r)+o+a|0,s)+i|0}function fte(e,t,n,r,i,o,a,s){return Ate(e+((t|~n)^r)+o+a|0,s)+i|0}function dte(e,t,n,r,i,o,a,s){return Ate(e+(t&r|n&~r)+o+a|0,s)+i|0}function pte(e,t,n,r,i,o,a,s){return Ate(e+(t^(n|~r))+o+a|0,s)+i|0}r9(lte,qee),lte.prototype._update=function(){for(var e=nte,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,u=0|this._b,l=0|this._c,A=0|this._d,c=0|this._e,h=0;h<80;h+=1){var f,d;h<16?(f=cte(n,r,i,o,a,e[rte[h]],ste[0],ote[h]),d=pte(s,u,l,A,c,e[ite[h]],ute[0],ate[h])):h<32?(f=hte(n,r,i,o,a,e[rte[h]],ste[1],ote[h]),d=dte(s,u,l,A,c,e[ite[h]],ute[1],ate[h])):h<48?(f=fte(n,r,i,o,a,e[rte[h]],ste[2],ote[h]),d=fte(s,u,l,A,c,e[ite[h]],ute[2],ate[h])):h<64?(f=dte(n,r,i,o,a,e[rte[h]],ste[3],ote[h]),d=hte(s,u,l,A,c,e[ite[h]],ute[3],ate[h])):(f=pte(n,r,i,o,a,e[rte[h]],ste[4],ote[h]),d=cte(s,u,l,A,c,e[ite[h]],ute[4],ate[h])),n=a,a=o,o=Ate(i,10),i=r,r=f,s=c,c=A,A=Ate(l,10),l=u,u=d}var p=this._b+i+A|0;this._b=this._c+o+c|0,this._c=this._d+a+s|0,this._d=this._e+n+u|0,this._e=this._a+r+l|0,this._a=p},lte.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=tte.alloc?tte.alloc(20):new tte(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var gte=lte,vte=i9.Buffer;function yte(e,t){this._block=vte.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}yte.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=vte.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var s=o%r,u=Math.min(i-a,r-s),l=0;l<u;l++)n[s+l]=e[a+l];a+=u,(o+=u)%r==0&&this._update(n)}return this._len+=i,this},yte.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},yte.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var mte=yte,wte=i9.Buffer,bte=[1518500249,1859775393,-1894007588,-899497514],Ite=new Array(80);function Bte(){this.init(),this._w=Ite,mte.call(this,64,56)}function Ete(e){return e<<30|e>>>2}function Cte(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r9(Bte,mte),Bte.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Bte.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=n[u-3]^n[u-8]^n[u-14]^n[u-16];for(var l=0;l<80;++l){var A=~~(l/20),c=0|((t=r)<<5|t>>>27)+Cte(A,i,o,a)+s+n[l]+bte[A];s=a,a=o,o=Ete(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Bte.prototype._hash=function(){var e=wte.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var xte=Bte,kte=i9.Buffer,Ste=[1518500249,1859775393,-1894007588,-899497514],Qte=new Array(80);function _te(){this.init(),this._w=Qte,mte.call(this,64,56)}function Nte(e){return e<<5|e>>>27}function Dte(e){return e<<30|e>>>2}function Fte(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r9(_te,mte),_te.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},_te.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=(t=n[u-3]^n[u-8]^n[u-14]^n[u-16])<<1|t>>>31;for(var l=0;l<80;++l){var A=~~(l/20),c=Nte(r)+Fte(A,i,o,a)+s+n[l]+Ste[A]|0;s=a,a=o,o=Dte(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},_te.prototype._hash=function(){var e=kte.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var Pte=_te,Ute=i9.Buffer,Lte=[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],Mte=new Array(64);function Tte(){this.init(),this._w=Mte,mte.call(this,64,56)}function Rte(e,t,n){return n^e&(t^n)}function Ote(e,t,n){return e&t|n&(e|t)}function Hte(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Kte(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function jte(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Gte(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}r9(Tte,mte),Tte.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Tte.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,u=0|this._g,l=0|this._h,A=0;A<16;++A)t[A]=e.readInt32BE(4*A);for(;A<64;++A)t[A]=Gte(t[A-2])+t[A-7]+jte(t[A-15])+t[A-16]|0;for(var c=0;c<64;++c){var h=l+Kte(a)+Rte(a,s,u)+Lte[c]+t[c]|0,f=Hte(n)+Ote(n,r,i)|0;l=u,u=s,s=a,a=o+h|0,o=i,i=r,r=n,n=h+f|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0},Tte.prototype._hash=function(){var e=Ute.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var qte=Tte,Vte=i9.Buffer,zte=new Array(64);function Jte(){this.init(),this._w=zte,mte.call(this,64,56)}r9(Jte,qte),Jte.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Jte.prototype._hash=function(){var e=Vte.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Yte=Jte,Xte=i9.Buffer,Wte=[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],Zte=new Array(160);function $te(){this.init(),this._w=Zte,mte.call(this,128,112)}function ene(e,t,n){return n^e&(t^n)}function tne(e,t,n){return e&t|n&(e|t)}function nne(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function rne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ine(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function one(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function ane(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function sne(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function une(e,t){return e>>>0<t>>>0?1:0}r9($te,mte),$te.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},$te.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,u=0|this._gh,l=0|this._hh,A=0|this._al,c=0|this._bl,h=0|this._cl,f=0|this._dl,d=0|this._el,p=0|this._fl,g=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var m=t[y-30],w=t[y-30+1],b=ine(m,w),I=one(w,m),B=ane(m=t[y-4],w=t[y-4+1]),E=sne(w,m),C=t[y-14],x=t[y-14+1],k=t[y-32],S=t[y-32+1],Q=I+x|0,_=b+C+une(Q,I)|0;_=(_=_+B+une(Q=Q+E|0,E)|0)+k+une(Q=Q+S|0,S)|0,t[y]=_,t[y+1]=Q}for(var N=0;N<160;N+=2){_=t[N],Q=t[N+1];var D=tne(n,r,i),F=tne(A,c,h),P=nne(n,A),U=nne(A,n),L=rne(a,d),M=rne(d,a),T=Wte[N],R=Wte[N+1],O=ene(a,s,u),H=ene(d,p,g),K=v+M|0,j=l+L+une(K,v)|0;j=(j=(j=j+O+une(K=K+H|0,H)|0)+T+une(K=K+R|0,R)|0)+_+une(K=K+Q|0,Q)|0;var G=U+F|0,q=P+D+une(G,U)|0;l=u,v=g,u=s,g=p,s=a,p=d,a=o+j+une(d=f+K|0,f)|0,o=i,f=h,i=r,h=c,r=n,c=A,n=j+q+une(A=K+G|0,K)|0}this._al=this._al+A|0,this._bl=this._bl+c|0,this._cl=this._cl+h|0,this._dl=this._dl+f|0,this._el=this._el+d|0,this._fl=this._fl+p|0,this._gl=this._gl+g|0,this._hl=this._hl+v|0,this._ah=this._ah+n+une(this._al,A)|0,this._bh=this._bh+r+une(this._bl,c)|0,this._ch=this._ch+i+une(this._cl,h)|0,this._dh=this._dh+o+une(this._dl,f)|0,this._eh=this._eh+a+une(this._el,d)|0,this._fh=this._fh+s+une(this._fl,p)|0,this._gh=this._gh+u+une(this._gl,g)|0,this._hh=this._hh+l+une(this._hl,v)|0},$te.prototype._hash=function(){var e=Xte.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var lne=$te,Ane=i9.Buffer,cne=new Array(160);function hne(){this.init(),this._w=cne,mte.call(this,128,112)}r9(hne,lne),hne.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},hne.prototype._hash=function(){var e=Ane.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var fne=hne,dne=UY((function(e){var t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n};t.sha=xte,t.sha1=Pte,t.sha224=Yte,t.sha256=qte,t.sha384=fne,t.sha512=lne})),pne=i9.Buffer,gne=Q$.Transform,vne=VZ.StringDecoder;function yne(e){gne.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r9(yne,gne),yne.prototype.update=function(e,t,n){"string"==typeof e&&(e=pne.from(e,t));var r=this._update(e);return this.hashMode?this:(n&&(r=this._toString(r,n)),r)},yne.prototype.setAutoPadding=function(){},yne.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},yne.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},yne.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},yne.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},yne.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},yne.prototype._finalOrDigest=function(e){var t=this.__final()||pne.alloc(0);return e&&(t=this._toString(t,e,!0)),t},yne.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new vne(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r};var mne=yne;function wne(e){mne.call(this,"digest"),this._hash=e}r9(wne,mne),wne.prototype._update=function(e){this._hash.update(e)},wne.prototype._final=function(){return this._hash.digest()};var bne=function(e){return"md5"===(e=e.toLowerCase())?new ete:"rmd160"===e||"ripemd160"===e?new gte:new wne(dne(e))},Ine=i9.Buffer,Bne=Ine.alloc(128);function Ene(e,t){mne.call(this,"digest"),"string"==typeof t&&(t=Ine.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=Ine.concat([t,Bne],64));for(var n=this._ipad=Ine.allocUnsafe(64),r=this._opad=Ine.allocUnsafe(64),i=0;i<64;i++)n[i]=54^t[i],r[i]=92^t[i];this._hash=[n]}r9(Ene,mne),Ene.prototype._update=function(e){this._hash.push(e)},Ene.prototype._final=function(){var e=this._alg(Ine.concat(this._hash));return this._alg(Ine.concat([this._opad,e]))};var Cne=Ene,xne=function(e){return(new ete).update(e).digest()},kne=i9.Buffer,Sne=kne.alloc(128);function Qne(e,t){mne.call(this,"digest"),"string"==typeof t&&(t=kne.from(t));var n="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>n?t=("rmd160"===e?new gte:dne(e)).update(t).digest():t.length<n&&(t=kne.concat([t,Sne],n));for(var r=this._ipad=kne.allocUnsafe(n),i=this._opad=kne.allocUnsafe(n),o=0;o<n;o++)r[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new gte:dne(e),this._hash.update(r)}r9(Qne,mne),Qne.prototype._update=function(e){this._hash.update(e)},Qne.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new gte:dne(this._alg)).update(this._opad).update(e).digest()};var _ne=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new Qne("rmd160",t):"md5"===e?new Cne(xne,t):new Qne(e,t)},Nne=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash160=function(e){var t=bne("sha256").update(e).digest();try{return bne("rmd160").update(t).digest()}catch(e){return bne("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return _ne("sha512",e).update(t).digest()}}));PY(Nne),Nne.hash160,Nne.hmacSHA512;var Dne=i9.Buffer,Fne=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var i=e.charAt(r),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=r}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function A(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return Dne.alloc(0);var n=0;if(" "!==e[n]){for(var r=0,i=0;e[n]===s;)r++,n++;for(var o=(e.length-n)*u+1>>>0,l=new Uint8Array(o);e[n];){var A=t[e.charCodeAt(n)];if(255===A)return;for(var c=0,h=o-1;(0!==A||c<i)&&-1!==h;h--,c++)A+=a*l[h]>>>0,l[h]=A%256>>>0,A=A/256>>>0;if(0!==A)throw new Error("Non-zero carry");i=c,n++}if(" "!==e[n]){for(var f=o-i;f!==o&&0===l[f];)f++;var d=Dne.allocUnsafe(r+(o-f));d.fill(0,0,r);for(var p=r;f!==o;)d[p++]=l[f++];return d}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=Dne.from(t)),!Dne.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*l+1>>>0,A=new Uint8Array(u);i!==o;){for(var c=t[i],h=0,f=u-1;(0!==c||h<r)&&-1!==f;f--,h++)c+=256*A[f]>>>0,A[f]=c%a>>>0,c=c/a>>>0;if(0!==c)throw new Error("Non-zero carry");r=h,i++}for(var d=u-r;d!==u&&0===A[d];)d++;for(var p=s.repeat(n);d<u;++d)p+=e.charAt(A[d]);return p},decodeUnsafe:A,decode:function(e){var t=A(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Pne=i9.Buffer,Une=function(e){function t(t){var n=t.slice(0,-4),r=t.slice(-4),i=e(n);if(!(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3]))return n}return{encode:function(t){var n=e(t);return Fne.encode(Pne.concat([t,n],t.length+4))},decode:function(e){var n=t(Fne.decode(e));if(!n)throw new Error("Invalid checksum");return n},decodeUnsafe:function(e){var n=Fne.decodeUnsafe(e);if(n)return t(n)}}}((function(e){var t=bne("sha256").update(e).digest();return bne("sha256").update(t).digest()})),Lne=UY((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==i(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i3.Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==i(e)&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==i(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=u(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=u(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,A=n;A<s;A+=r)u=l(e,A,A+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var c=1;for(u=l(e,A,e.length,t),A=0;A<a;A++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var A=["","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"],c=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var A=u>>>26,c=67108863&u,h=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=h;f++){var d=l-f|0;A+=(a=(i=0|e.words[d])*(o=0|t.words[f])+c)/67108864|0,c=67108863&a}n.words[l]=0|c,u=0|A}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?A[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=h[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modn(f).toString(e);r=(d=d.idivn(f)).isZero()?p+r:A[l-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(o),A=this.clone();if(u){for(s=0;!A.isZero();s++)a=A.andln(255),A.iushrn(8),l[s]=a;for(;s<o;s++)l[s]=0}else{for(s=0;s<o-i;s++)l[s]=0;for(s=0;!A.isZero();s++)a=A.andln(255),A.iushrn(8),l[o-s-1]=a}return l},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,l=0,A=0|a[0],c=8191&A,h=A>>>13,f=0|a[1],d=8191&f,p=f>>>13,g=0|a[2],v=8191&g,y=g>>>13,m=0|a[3],w=8191&m,b=m>>>13,I=0|a[4],B=8191&I,E=I>>>13,C=0|a[5],x=8191&C,k=C>>>13,S=0|a[6],Q=8191&S,_=S>>>13,N=0|a[7],D=8191&N,F=N>>>13,P=0|a[8],U=8191&P,L=P>>>13,M=0|a[9],T=8191&M,R=M>>>13,O=0|s[0],H=8191&O,K=O>>>13,j=0|s[1],G=8191&j,q=j>>>13,V=0|s[2],z=8191&V,J=V>>>13,Y=0|s[3],X=8191&Y,W=Y>>>13,Z=0|s[4],$=8191&Z,ee=Z>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,Ae=0|s[8],ce=8191&Ae,he=Ae>>>13,fe=0|s[9],de=8191&fe,pe=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(l+(r=Math.imul(c,H))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(h,H)|0))<<13)|0;l=((o=Math.imul(h,K))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(d,H),i=(i=Math.imul(d,K))+Math.imul(p,H)|0,o=Math.imul(p,K);var ve=(l+(r=r+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(h,G)|0))<<13)|0;l=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),i=(i=Math.imul(v,K))+Math.imul(y,H)|0,o=Math.imul(y,K),r=r+Math.imul(d,G)|0,i=(i=i+Math.imul(d,q)|0)+Math.imul(p,G)|0,o=o+Math.imul(p,q)|0;var ye=(l+(r=r+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(h,z)|0))<<13)|0;l=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,H),i=(i=Math.imul(w,K))+Math.imul(b,H)|0,o=Math.imul(b,K),r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0,r=r+Math.imul(d,z)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(p,z)|0,o=o+Math.imul(p,J)|0;var me=(l+(r=r+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(h,X)|0))<<13)|0;l=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(E,H)|0,o=Math.imul(E,K),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,q)|0,r=r+Math.imul(v,z)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,J)|0,r=r+Math.imul(d,X)|0,i=(i=i+Math.imul(d,W)|0)+Math.imul(p,X)|0,o=o+Math.imul(p,W)|0;var we=(l+(r=r+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,K))+Math.imul(k,H)|0,o=Math.imul(k,K),r=r+Math.imul(B,G)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,q)|0,r=r+Math.imul(w,z)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,J)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(d,$)|0,i=(i=i+Math.imul(d,ee)|0)+Math.imul(p,$)|0,o=o+Math.imul(p,ee)|0;var be=(l+(r=r+Math.imul(c,ne)|0)|0)+((8191&(i=(i=i+Math.imul(c,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(Q,H),i=(i=Math.imul(Q,K))+Math.imul(_,H)|0,o=Math.imul(_,K),r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(B,z)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,W)|0,r=r+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(d,ne)|0,i=(i=i+Math.imul(d,re)|0)+Math.imul(p,ne)|0,o=o+Math.imul(p,re)|0;var Ie=(l+(r=r+Math.imul(c,oe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ae)|0)+Math.imul(h,oe)|0))<<13)|0;l=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,H),i=(i=Math.imul(D,K))+Math.imul(F,H)|0,o=Math.imul(F,K),r=r+Math.imul(Q,G)|0,i=(i=i+Math.imul(Q,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(x,z)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(B,X)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,W)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(d,oe)|0,i=(i=i+Math.imul(d,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var Be=(l+(r=r+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((o=o+Math.imul(h,le)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(U,H),i=(i=Math.imul(U,K))+Math.imul(L,H)|0,o=Math.imul(L,K),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,q)|0,r=r+Math.imul(Q,z)|0,i=(i=i+Math.imul(Q,J)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,J)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,r=r+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(d,ue)|0,i=(i=i+Math.imul(d,le)|0)+Math.imul(p,ue)|0,o=o+Math.imul(p,le)|0;var Ee=(l+(r=r+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,he)|0)+Math.imul(h,ce)|0))<<13)|0;l=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),i=(i=Math.imul(T,K))+Math.imul(R,H)|0,o=Math.imul(R,K),r=r+Math.imul(U,G)|0,i=(i=i+Math.imul(U,q)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,q)|0,r=r+Math.imul(D,z)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(F,z)|0,o=o+Math.imul(F,J)|0,r=r+Math.imul(Q,X)|0,i=(i=i+Math.imul(Q,W)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,le)|0,r=r+Math.imul(d,ce)|0,i=(i=i+Math.imul(d,he)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,he)|0;var Ce=(l+(r=r+Math.imul(c,de)|0)|0)+((8191&(i=(i=i+Math.imul(c,pe)|0)+Math.imul(h,de)|0))<<13)|0;l=((o=o+Math.imul(h,pe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(T,G),i=(i=Math.imul(T,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(U,z)|0,i=(i=i+Math.imul(U,J)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(D,X)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,W)|0,r=r+Math.imul(Q,$)|0,i=(i=i+Math.imul(Q,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,le)|0,r=r+Math.imul(v,ce)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,he)|0;var xe=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;l=((o=o+Math.imul(p,pe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,J))+Math.imul(R,z)|0,o=Math.imul(R,J),r=r+Math.imul(U,X)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,ee)|0,r=r+Math.imul(Q,ne)|0,i=(i=i+Math.imul(Q,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,he)|0;var ke=(l+(r=r+Math.imul(v,de)|0)|0)+((8191&(i=(i=i+Math.imul(v,pe)|0)+Math.imul(y,de)|0))<<13)|0;l=((o=o+Math.imul(y,pe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(T,X),i=(i=Math.imul(T,W))+Math.imul(R,X)|0,o=Math.imul(R,W),r=r+Math.imul(U,$)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(F,ne)|0,o=o+Math.imul(F,re)|0,r=r+Math.imul(Q,oe)|0,i=(i=i+Math.imul(Q,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,le)|0,r=r+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,he)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,he)|0;var Se=(l+(r=r+Math.imul(w,de)|0)|0)+((8191&(i=(i=i+Math.imul(w,pe)|0)+Math.imul(b,de)|0))<<13)|0;l=((o=o+Math.imul(b,pe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(T,$),i=(i=Math.imul(T,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(U,ne)|0,i=(i=i+Math.imul(U,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,r=r+Math.imul(Q,ue)|0,i=(i=i+Math.imul(Q,le)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,le)|0,r=r+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,he)|0;var Qe=(l+(r=r+Math.imul(B,de)|0)|0)+((8191&(i=(i=i+Math.imul(B,pe)|0)+Math.imul(E,de)|0))<<13)|0;l=((o=o+Math.imul(E,pe)|0)+(i>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(T,ne),i=(i=Math.imul(T,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,r=r+Math.imul(Q,ce)|0,i=(i=i+Math.imul(Q,he)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,he)|0;var _e=(l+(r=r+Math.imul(x,de)|0)|0)+((8191&(i=(i=i+Math.imul(x,pe)|0)+Math.imul(k,de)|0))<<13)|0;l=((o=o+Math.imul(k,pe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(T,oe),i=(i=Math.imul(T,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(U,ue)|0,i=(i=i+Math.imul(U,le)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,le)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,he)|0)+Math.imul(F,ce)|0,o=o+Math.imul(F,he)|0;var Ne=(l+(r=r+Math.imul(Q,de)|0)|0)+((8191&(i=(i=i+Math.imul(Q,pe)|0)+Math.imul(_,de)|0))<<13)|0;l=((o=o+Math.imul(_,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(T,ue),i=(i=Math.imul(T,le))+Math.imul(R,ue)|0,o=Math.imul(R,le),r=r+Math.imul(U,ce)|0,i=(i=i+Math.imul(U,he)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,he)|0;var De=(l+(r=r+Math.imul(D,de)|0)|0)+((8191&(i=(i=i+Math.imul(D,pe)|0)+Math.imul(F,de)|0))<<13)|0;l=((o=o+Math.imul(F,pe)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(T,ce),i=(i=Math.imul(T,he))+Math.imul(R,ce)|0,o=Math.imul(R,he);var Fe=(l+(r=r+Math.imul(U,de)|0)|0)+((8191&(i=(i=i+Math.imul(U,pe)|0)+Math.imul(L,de)|0))<<13)|0;l=((o=o+Math.imul(L,pe)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var Pe=(l+(r=Math.imul(T,de))|0)+((8191&(i=(i=Math.imul(T,pe))+Math.imul(R,de)|0))<<13)|0;return l=((o=Math.imul(R,pe))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=me,u[4]=we,u[5]=be,u[6]=Ie,u[7]=Be,u[8]=Ee,u[9]=Ce,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Qe,u[14]=_e,u[15]=Ne,u[16]=De,u[17]=Fe,u[18]=Pe,0!==l&&(u[19]=l,n.length++),n};function p(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=f),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var A=o-l,c=(0|e.words[A])*(0|t.words[l]),h=67108863&c;s=67108863&(h=h+s|0),i+=(a=(a=a+(c/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):p(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},g.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},g.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),A=0;A<i;A+=s)for(var c=u,h=l,f=0;f<a;f++){var d=n[A+f],p=r[A+f],g=n[A+f+a],v=r[A+f+a],y=c*g-h*v;v=c*v+h*g,g=y,n[A+f]=d+g,r[A+f]=p+v,n[A+f+a]=d-g,r[A+f+a]=p-v,f!==s&&(y=u*c-l*h,h=u*h+l*c,c=y)}},g.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},g.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},g.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},g.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),u=new Array(r),l=new Array(r),A=new Array(r),c=new Array(r),h=n.words;h.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,l,r),this.transform(a,o,s,u,r,i),this.transform(l,o,A,c,r,i);for(var f=0;f<r;f++){var d=s[f]*A[f]-u[f]*c[f];u[f]=s[f]*c[f]+u[f]*A[f],s[f]=d}return this.conjugate(s,u,r),this.transform(s,u,h,o,r,i),this.conjugate(h,o,r),this.normalize13b(h,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var A=0;for(l=this.length-1;l>=0&&(0!==A||l>=i);l--){var c=0|this.words[l];this.words[l]=A<<26-o|c>>>o,A=c&s}return u&&0!==A&&(u.words[u.length++]=A),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!=(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var A=r.clone()._ishlnsubmul(i,1,u);0===A.negative&&(r=A,s&&(s.words[u]=1));for(var c=u-1;c>=0;c--){var h=67108864*(0|r.words[i.length+c])+(0|r.words[i.length+c-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,c);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,c),r.isZero()||(r.negative^=1);s&&(s.words[c]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var A=r.clone(),c=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(A),a.isub(c)),i.iushrn(1),a.iushrn(1);for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(A),u.isub(c)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,A=1;0==(t.words[0]&A)&&l<26;++l,A<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new B(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},r(m,y),m.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(w,y),r(b,y),r(I,y),I.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new w;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return v[e]=t,t},B.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},B.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new o(2*A*A).toRed(this);0!==this.pow(A,l).cmp(u);)A.redIAdd(u);for(var c=this.pow(A,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),d=a;0!==f.cmp(s);){for(var p=f,g=0;0!==p.cmp(s);g++)p=p.redSqr();n(g<d);var v=this.pow(c,new o(1).iushln(d-g-1));h=h.redMul(v),c=v.redSqr(),f=f.redMul(c),d=g}return h},B.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},B.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var l=t.words[r],A=u-1;A>=0;A--){var c=l>>A&1;i!==n[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4==++s||0===r&&0===A)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},r(E,B),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,FY)})),Mne="lib/elliptic.js",Tne=["lib"],Rne={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},One={type:"git",url:"git@github.com:indutny/elliptic"},Hne=["EC","Elliptic","curve","Cryptography"],Kne="Fedor Indutny <fedor@indutny.com>",jne={url:"https://github.com/indutny/elliptic/issues"},Gne="https://github.com/indutny/elliptic",qne={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},Vne={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},zne={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:Mne,files:Tne,scripts:Rne,repository:One,keywords:Hne,author:Kne,license:"MIT",bugs:jne,homepage:Gne,devDependencies:qne,dependencies:Vne},Jne=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.4",description:"EC cryptography",main:Mne,files:Tne,scripts:Rne,repository:One,keywords:Hne,author:Kne,license:"MIT",bugs:jne,homepage:Gne,devDependencies:qne,dependencies:Vne,default:zne}),Yne=Xne;function Xne(e,t){if(!e)throw new Error(t||"Assertion failed")}Xne.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var Wne,Zne=UY((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16));else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),$ne=UY((function(e,t){var n=t;n.assert=Yne,n.toArray=Zne.toArray,n.zero2=Zne.zero2,n.toHex=Zne.toHex,n.encode=Zne.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<r.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,l=t.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),a=0==(1&u)?0:3!=(r=e.andln(7)+i&7)&&5!==r||2!==l?u:-u,n[0].push(a),s=0==(1&l)?0:3!=(r=t.andln(7)+o&7)&&5!==r||2!==u?l:-l,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new Lne(e,"hex","le")}})),ere=function(e){return Wne||(Wne=new tre(null)),Wne.generate(e)};function tre(e){this.rand=e}var nre=tre;if(tre.prototype.generate=function(e){return this._rand(e)},tre.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==("undefined"==typeof self?"undefined":i(self)))self.crypto&&self.crypto.getRandomValues?tre.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?tre.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==("undefined"==typeof window?"undefined":i(window))&&(tre.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var rre=i3;if("function"!=typeof rre.randomBytes)throw new Error("Not supported");tre.prototype._rand=function(e){return rre.randomBytes(e)}}catch(e){}ere.Rand=nre;var ire=$ne.getNAF,ore=$ne.getJSF,are=$ne.assert;function sre(e,t){this.type=e,this.p=new Lne(t.p,16),this.red=t.prime?Lne.red(t.prime):Lne.mont(this.p),this.zero=new Lne(0).toRed(this.red),this.one=new Lne(1).toRed(this.red),this.two=new Lne(2).toRed(this.red),this.n=t.n&&new Lne(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ure=sre;function lre(e,t){this.curve=e,this.type=t,this.precomputed=null}sre.prototype.point=function(){throw new Error("Not implemented")},sre.prototype.validate=function(){throw new Error("Not implemented")},sre.prototype._fixedNafMul=function(e,t){are(e.precomputed);var n=e._getDoubles(),r=ire(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<r.length;o+=n.step){a=0;for(var u=o+n.step-1;u>=o;u--)a=(a<<1)+r[u];s.push(a)}for(var l=this.jpoint(null,null,null),A=this.jpoint(null,null,null),c=i;c>0;c--){for(o=0;o<s.length;o++)(a=s[o])===c?A=A.mixedAdd(n.points[o]):a===-c&&(A=A.mixedAdd(n.points[o].neg()));l=l.add(A)}return l.toP()},sre.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=ire(t,n,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var l=o[s];are(0!==l),a="affine"===e.type?l>0?a.mixedAdd(i[l-1>>1]):a.mixedAdd(i[-l-1>>1].neg()):l>0?a.add(i[l-1>>1]):a.add(i[-l-1>>1].neg())}return"affine"===e.type?a.toP():a},sre.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,l=this._wnafT2,A=this._wnafT3,c=0;for(o=0;o<r;o++){var h=(s=t[o])._getNAFPoints(e);u[o]=h.wnd,l[o]=h.points}for(o=r-1;o>=1;o-=2){var f=o-1,d=o;if(1===u[f]&&1===u[d]){var p=[t[f],null,null,t[d]];0===t[f].y.cmp(t[d].y)?(p[1]=t[f].add(t[d]),p[2]=t[f].toJ().mixedAdd(t[d].neg())):0===t[f].y.cmp(t[d].y.redNeg())?(p[1]=t[f].toJ().mixedAdd(t[d]),p[2]=t[f].add(t[d].neg())):(p[1]=t[f].toJ().mixedAdd(t[d]),p[2]=t[f].toJ().mixedAdd(t[d].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=ore(n[f],n[d]);for(c=Math.max(v[0].length,c),A[f]=new Array(c),A[d]=new Array(c),a=0;a<c;a++){var y=0|v[0][a],m=0|v[1][a];A[f][a]=g[3*(y+1)+(m+1)],A[d][a]=0,l[f]=p}}else A[f]=ire(n[f],u[f],this._bitLength),A[d]=ire(n[d],u[d],this._bitLength),c=Math.max(A[f].length,c),c=Math.max(A[d].length,c)}var w=this.jpoint(null,null,null),b=this._wnafT4;for(o=c;o>=0;o--){for(var I=0;o>=0;){var B=!0;for(a=0;a<r;a++)b[a]=0|A[a][o],0!==b[a]&&(B=!1);if(!B)break;I++,o--}if(o>=0&&I++,w=w.dblp(I),o<0)break;for(a=0;a<r;a++){var E=b[a];0!==E&&(E>0?s=l[a][E-1>>1]:E<0&&(s=l[a][-E-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<r;o++)l[o]=null;return i?w:w.toP()},sre.BasePoint=lre,lre.prototype.eq=function(){throw new Error("Not implemented")},lre.prototype.validate=function(){return this.curve.validate(this)},sre.prototype.decodePoint=function(e,t){e=$ne.toArray(e,t);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?are(e[e.length-1]%2==0):7===e[0]&&are(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},lre.prototype.encodeCompressed=function(e){return this.encode(e,!0)},lre.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},lre.prototype.encode=function(e,t){return $ne.encode(this._encode(t),e)},lre.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},lre.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},lre.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)r=r.dbl();n.push(r)}return{step:e,points:n}},lre.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},lre.prototype._getBeta=function(){return null},lre.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t};var Are=$ne.assert;function cre(e){ure.call(this,"short",e),this.a=new Lne(e.a,16).toRed(this.red),this.b=new Lne(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}r9(cre,ure);var hre=cre;function fre(e,t,n,r){ure.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new Lne(t,16),this.y=new Lne(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function dre(e,t,n,r){ure.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Lne(0)):(this.x=new Lne(t,16),this.y=new Lne(n,16),this.z=new Lne(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function pre(e){ure.call(this,"mont",e),this.a=new Lne(e.a,16).toRed(this.red),this.b=new Lne(e.b,16).toRed(this.red),this.i4=new Lne(4).toRed(this.red).redInvm(),this.two=new Lne(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}cre.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new Lne(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new Lne(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?n=i[0]:(n=i[1],Are(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new Lne(e.a,16),b:new Lne(e.b,16)}})):this._getEndoBasis(n)}}},cre.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Lne.mont(e),n=new Lne(2).toRed(t).redInvm(),r=n.redNeg(),i=new Lne(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},cre.prototype._getEndoBasis=function(e){for(var t,n,r,i,o,a,s,u,l,A=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,h=this.n.clone(),f=new Lne(1),d=new Lne(0),p=new Lne(0),g=new Lne(1),v=0;0!==c.cmpn(0);){var y=h.div(c);u=h.sub(y.mul(c)),l=p.sub(y.mul(f));var m=g.sub(y.mul(d));if(!r&&u.cmp(A)<0)t=s.neg(),n=f,r=u.neg(),i=l;else if(r&&2==++v)break;s=u,h=c,c=u,p=f,f=l,g=d,d=m}o=u.neg(),a=l;var w=r.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},cre.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),l=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(l).neg()}},cre.prototype.pointFromX=function(e,t){(e=new Lne(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},cre.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},cre.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,r,i,2*o,n),A=0;A<2*o;A++)r[A]=null,i[A]=null;return l},r9(fre,ure.BasePoint),cre.prototype.point=function(e,t,n){return new fre(this,e,t,n)},cre.prototype.pointFromJSON=function(e,t){return fre.fromJSON(this,e,t)},fre.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},fre.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},fre.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var o=t[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},fre.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},fre.prototype.isInfinity=function(){return this.inf},fre.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},fre.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},fre.prototype.getX=function(){return this.x.fromRed()},fre.prototype.getY=function(){return this.y.fromRed()},fre.prototype.mul=function(e){return e=new Lne(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},fre.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},fre.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},fre.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},fre.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},fre.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r9(dre,ure.BasePoint),cre.prototype.jpoint=function(e,t,n){return new dre(this,e,t,n)},dre.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},dre.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},dre.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),A=l.redMul(s),c=r.redMul(l),h=u.redSqr().redIAdd(A).redISub(c).redISub(c),f=u.redMul(c.redISub(h)).redISub(o.redMul(A)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,d)},dre.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),A=n.redMul(u),c=s.redSqr().redIAdd(l).redISub(A).redISub(A),h=s.redMul(A.redISub(c)).redISub(i.redMul(l)),f=this.z.redMul(a);return this.curve.jpoint(c,h,f)},dre.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var A=o.redSqr(),c=l.redSqr(),h=c.redSqr(),f=A.redAdd(A).redIAdd(A).redIAdd(r.redMul(u)),d=o.redMul(c),p=f.redSqr().redISub(d.redAdd(d)),g=d.redISub(p),v=f.redMul(g);v=v.redIAdd(v).redISub(h);var y=l.redMul(s);t+1<e&&(u=u.redMul(h)),o=p,s=y,l=v}return this.curve.jpoint(o,l.redMul(i),s)},dre.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},dre.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),c=this.y.redSqr(),h=c.redSqr(),f=this.x.redAdd(c).redSqr().redISub(A).redISub(h);f=f.redIAdd(f);var d=A.redAdd(A).redIAdd(A),p=d.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=p.redISub(f).redISub(f),t=d.redMul(f.redISub(e)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},dre.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),c=this.y.redSqr(),h=this.x.redMul(c),f=this.x.redSub(A).redMul(this.x.redAdd(A));f=f.redAdd(f).redIAdd(f);var d=h.redIAdd(h),p=(d=d.redIAdd(d)).redAdd(d);e=f.redSqr().redISub(p),n=this.y.redAdd(this.z).redSqr().redISub(c).redISub(A);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(d.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,n)},dre.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=t.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(a),A=s.redSqr().redISub(l.redAdd(l)),c=l.redISub(A),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(c).redISub(h),d=n.redAdd(n).redMul(r);return this.curve.jpoint(A,f,d)},dre.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),A=t.redMul(l);A=(A=A.redIAdd(A)).redIAdd(A);var c=this.x.redMul(s).redISub(A);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.y.redMul(l.redMul(u.redISub(l)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(c,h,f)},dre.prototype.mul=function(e,t){return e=new Lne(e,t),this.curve._wnafMul(this,e)},dre.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},dre.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},dre.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},dre.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},r9(pre,ure);var gre=pre;function vre(e,t,n){ure.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Lne(t,16),this.z=new Lne(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}pre.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},r9(vre,ure.BasePoint),pre.prototype.decodePoint=function(e,t){return this.point($ne.toArray(e,t),1)},pre.prototype.point=function(e,t){return new vre(this,e,t)},pre.prototype.pointFromJSON=function(e){return vre.fromJSON(this,e)},vre.prototype.precompute=function(){},vre.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},vre.fromJSON=function(e,t){return new vre(e,t[0],t[1]||e.one)},vre.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},vre.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},vre.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},vre.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},vre.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},vre.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},vre.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},vre.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},vre.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},vre.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},vre.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var yre=$ne.assert;function mre(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,ure.call(this,"edwards",e),this.a=new Lne(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Lne(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Lne(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),yre(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}r9(mre,ure);var wre=mre;function bre(e,t,n,r,i){ure.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Lne(t,16),this.y=new Lne(n,16),this.z=r?new Lne(r,16):this.curve.one,this.t=i&&new Lne(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}mre.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},mre.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},mre.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},mre.prototype.pointFromX=function(e,t){(e=new Lne(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=r.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},mre.prototype.pointFromY=function(e,t){(e=new Lne(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},mre.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},r9(bre,ure.BasePoint),mre.prototype.pointFromJSON=function(e){return bre.fromJSON(this,e)},mre.prototype.point=function(e,t,n,r){return new bre(this,e,t,n,r)},bre.fromJSON=function(e,t){return new bre(e,t[0],t[1],t[2])},bre.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},bre.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},bre.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),u=i.redMul(a),l=o.redMul(s),A=i.redMul(s),c=a.redMul(o);return this.curve.point(u,l,c,A)},bre.prototype._projDbl=function(){var e,t,n,r,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var l=(r=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(l.redSub(this.curve.two)),t=l.redMul(r.redSub(u)),n=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),o=l.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=l.redMul(r.redSub(u)),n=l.redMul(o))}else r=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=r.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(r)).redMul(o),t=this.curve._mulC(r).redMul(s.redISub(u)),n=r.redMul(o);return this.curve.point(e,t,n)},bre.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},bre.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),l=o.redMul(a),A=s.redMul(u),c=o.redMul(u),h=a.redMul(s);return this.curve.point(l,A,h,c)},bre.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),l=i.redAdd(s),A=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),c=r.redMul(u).redMul(A);return this.curve.twisted?(t=r.redMul(l).redMul(a.redSub(this.curve._mulA(o))),n=u.redMul(l)):(t=r.redMul(l).redMul(a.redSub(o)),n=this.curve._mulC(u).redMul(l)),this.curve.point(c,t,n)},bre.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},bre.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},bre.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},bre.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},bre.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},bre.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},bre.prototype.getX=function(){return this.normalize(),this.x.fromRed()},bre.prototype.getY=function(){return this.normalize(),this.y.fromRed()},bre.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},bre.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},bre.prototype.toP=bre.prototype.normalize,bre.prototype.mixedAdd=bre.prototype.add;var Ire=UY((function(e,t){var n=t;n.base=ure,n.short=hre,n.mont=gre,n.edwards=wre}));function Bre(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function Ere(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Cre(e){return 1===e.length?"0"+e:e}function xre(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var kre={inherits:r9,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):Bre(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},toHex:function(e){for(var t="",n=0;n<e.length;n++)t+=Cre(e[n].toString(16));return t},htonl:Ere,toHex32:function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=Ere(i)),n+=xre(i.toString(16))}return n},zero2:Cre,zero8:xre,join32:function(e,t,n,r){var i=n-t;Yne(i%4==0);for(var o=new Array(i/4),a=0,s=t;a<o.length;a++,s+=4){var u;u="big"===r?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o},split32:function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var o=e[r];"big"===t?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,n){return e+t+n>>>0},sum32_4:function(e,t,n,r){return e+t+n+r>>>0},sum32_5:function(e,t,n,r,i){return e+t+n+r+i>>>0},sum64:function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o<r?1:0)+n+i;e[t]=a>>>0,e[t+1]=o},sum64_hi:function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},sum64_lo:function(e,t,n,r){return t+r>>>0},sum64_4_hi:function(e,t,n,r,i,o,a,s){var u=0,l=t;return u+=(l=l+r>>>0)<t?1:0,u+=(l=l+o>>>0)<o?1:0,e+n+i+a+(u+=(l=l+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},sum64_5_hi:function(e,t,n,r,i,o,a,s,u,l){var A=0,c=t;return A+=(c=c+r>>>0)<t?1:0,A+=(c=c+o>>>0)<o?1:0,A+=(c=c+s>>>0)<s?1:0,e+n+i+a+u+(A+=(c=c+l>>>0)<l?1:0)>>>0},sum64_5_lo:function(e,t,n,r,i,o,a,s,u,l){return t+r+o+s+l>>>0},rotr64_hi:function(e,t,n){return(t<<32-n|e>>>n)>>>0},rotr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0},shr64_hi:function(e,t,n){return e>>>n},shr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0}};function Sre(){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}var Qre=Sre;Sre.prototype.update=function(e,t){if(e=kre.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=kre.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Sre.prototype.digest=function(e){return this.update(this._pad()),Yne(null===this.pending),this._digest(e)},Sre.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r};var _re={BlockHash:Qre},Nre=kre.rotr32;function Dre(e,t,n){return e&t^~e&n}function Fre(e,t,n){return e&t^e&n^t&n}function Pre(e,t,n){return e^t^n}var Ure=function(e,t,n,r){return 0===e?Dre(t,n,r):1===e||3===e?Pre(t,n,r):2===e?Fre(t,n,r):void 0},Lre=Dre,Mre=Fre,Tre=function(e){return Nre(e,2)^Nre(e,13)^Nre(e,22)},Rre=function(e){return Nre(e,6)^Nre(e,11)^Nre(e,25)},Ore=function(e){return Nre(e,7)^Nre(e,18)^e>>>3},Hre=function(e){return Nre(e,17)^Nre(e,19)^e>>>10},Kre=kre.rotl32,jre=kre.sum32,Gre=kre.sum32_5,qre=Ure,Vre=_re.BlockHash,zre=[1518500249,1859775393,2400959708,3395469782];function Jre(){if(!(this instanceof Jre))return new Jre;Vre.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}kre.inherits(Jre,Vre);var Yre=Jre;Jre.blockSize=512,Jre.outSize=160,Jre.hmacStrength=80,Jre.padLength=64,Jre.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Kre(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),A=Gre(Kre(i,5),qre(l,o,a,s),u,n[r],zre[l]);u=s,s=a,a=Kre(o,30),o=i,i=A}this.h[0]=jre(this.h[0],i),this.h[1]=jre(this.h[1],o),this.h[2]=jre(this.h[2],a),this.h[3]=jre(this.h[3],s),this.h[4]=jre(this.h[4],u)},Jre.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"big"):kre.split32(this.h,"big")};var Xre=kre.sum32,Wre=kre.sum32_4,Zre=kre.sum32_5,$re=Lre,eie=Mre,tie=Tre,nie=Rre,rie=Ore,iie=Hre,oie=_re.BlockHash,aie=[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 sie(){if(!(this instanceof sie))return new sie;oie.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=aie,this.W=new Array(64)}kre.inherits(sie,oie);var uie=sie;function lie(){if(!(this instanceof lie))return new lie;uie.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sie.blockSize=512,sie.outSize=256,sie.hmacStrength=192,sie.padLength=64,sie.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Wre(iie(n[r-2]),n[r-7],rie(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],l=this.h[5],A=this.h[6],c=this.h[7];for(Yne(this.k.length===n.length),r=0;r<n.length;r++){var h=Zre(c,nie(u),$re(u,l,A),this.k[r],n[r]),f=Xre(tie(i),eie(i,o,a));c=A,A=l,l=u,u=Xre(s,h),s=a,a=o,o=i,i=Xre(h,f)}this.h[0]=Xre(this.h[0],i),this.h[1]=Xre(this.h[1],o),this.h[2]=Xre(this.h[2],a),this.h[3]=Xre(this.h[3],s),this.h[4]=Xre(this.h[4],u),this.h[5]=Xre(this.h[5],l),this.h[6]=Xre(this.h[6],A),this.h[7]=Xre(this.h[7],c)},sie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"big"):kre.split32(this.h,"big")},kre.inherits(lie,uie);var Aie=lie;lie.blockSize=512,lie.outSize=224,lie.hmacStrength=192,lie.padLength=64,lie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h.slice(0,7),"big"):kre.split32(this.h.slice(0,7),"big")};var cie=kre.rotr64_hi,hie=kre.rotr64_lo,fie=kre.shr64_hi,die=kre.shr64_lo,pie=kre.sum64,gie=kre.sum64_hi,vie=kre.sum64_lo,yie=kre.sum64_4_hi,mie=kre.sum64_4_lo,wie=kre.sum64_5_hi,bie=kre.sum64_5_lo,Iie=_re.BlockHash,Bie=[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 Eie(){if(!(this instanceof Eie))return new Eie;Iie.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Bie,this.W=new Array(160)}kre.inherits(Eie,Iie);var Cie=Eie;function xie(e,t,n,r,i){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function kie(e,t,n,r,i,o){var a=t&r^~t&o;return a<0&&(a+=4294967296),a}function Sie(e,t,n,r,i){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function Qie(e,t,n,r,i,o){var a=t&r^t&o^r&o;return a<0&&(a+=4294967296),a}function _ie(e,t){var n=cie(e,t,28)^cie(t,e,2)^cie(t,e,7);return n<0&&(n+=4294967296),n}function Nie(e,t){var n=hie(e,t,28)^hie(t,e,2)^hie(t,e,7);return n<0&&(n+=4294967296),n}function Die(e,t){var n=cie(e,t,14)^cie(e,t,18)^cie(t,e,9);return n<0&&(n+=4294967296),n}function Fie(e,t){var n=hie(e,t,14)^hie(e,t,18)^hie(t,e,9);return n<0&&(n+=4294967296),n}function Pie(e,t){var n=cie(e,t,1)^cie(e,t,8)^fie(e,t,7);return n<0&&(n+=4294967296),n}function Uie(e,t){var n=hie(e,t,1)^hie(e,t,8)^die(e,t,7);return n<0&&(n+=4294967296),n}function Lie(e,t){var n=cie(e,t,19)^cie(t,e,29)^fie(e,t,6);return n<0&&(n+=4294967296),n}function Mie(e,t){var n=hie(e,t,19)^hie(t,e,29)^die(e,t,6);return n<0&&(n+=4294967296),n}function Tie(){if(!(this instanceof Tie))return new Tie;Cie.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Eie.blockSize=1024,Eie.outSize=512,Eie.hmacStrength=192,Eie.padLength=128,Eie.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=Lie(n[r-4],n[r-3]),o=Mie(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=Pie(n[r-30],n[r-29]),l=Uie(n[r-30],n[r-29]),A=n[r-32],c=n[r-31];n[r]=yie(i,o,a,s,u,l,A,c),n[r+1]=mie(i,o,a,s,u,l,A,c)}},Eie.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],l=this.h[6],A=this.h[7],c=this.h[8],h=this.h[9],f=this.h[10],d=this.h[11],p=this.h[12],g=this.h[13],v=this.h[14],y=this.h[15];Yne(this.k.length===n.length);for(var m=0;m<n.length;m+=2){var w=v,b=y,I=Die(c,h),B=Fie(c,h),E=xie(c,0,f,0,p),C=kie(0,h,0,d,0,g),x=this.k[m],k=this.k[m+1],S=n[m],Q=n[m+1],_=wie(w,b,I,B,E,C,x,k,S,Q),N=bie(w,b,I,B,E,C,x,k,S,Q);w=_ie(r,i),b=Nie(r,i),I=Sie(r,0,o,0,s),B=Qie(0,i,0,a,0,u);var D=gie(w,b,I,B),F=vie(w,b,I,B);v=p,y=g,p=f,g=d,f=c,d=h,c=gie(l,A,_,N),h=vie(A,A,_,N),l=s,A=u,s=o,u=a,o=r,a=i,r=gie(_,N,D,F),i=vie(_,N,D,F)}pie(this.h,0,r,i),pie(this.h,2,o,a),pie(this.h,4,s,u),pie(this.h,6,l,A),pie(this.h,8,c,h),pie(this.h,10,f,d),pie(this.h,12,p,g),pie(this.h,14,v,y)},Eie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"big"):kre.split32(this.h,"big")},kre.inherits(Tie,Cie);var Rie=Tie;Tie.blockSize=1024,Tie.outSize=384,Tie.hmacStrength=192,Tie.padLength=128,Tie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h.slice(0,12),"big"):kre.split32(this.h.slice(0,12),"big")};var Oie={sha1:Yre,sha224:Aie,sha256:uie,sha384:Rie,sha512:Cie},Hie=kre.rotl32,Kie=kre.sum32,jie=kre.sum32_3,Gie=kre.sum32_4,qie=_re.BlockHash;function Vie(){if(!(this instanceof Vie))return new Vie;qie.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}kre.inherits(Vie,qie);var zie=Vie;function Jie(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function Yie(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Xie(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Vie.blockSize=512,Vie.outSize=160,Vie.hmacStrength=192,Vie.padLength=64,Vie.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=n,u=r,l=i,A=o,c=a,h=0;h<80;h++){var f=Kie(Hie(Gie(n,Jie(h,r,i,o),e[Wie[h]+t],Yie(h)),$ie[h]),a);n=a,a=o,o=Hie(i,10),i=r,r=f,f=Kie(Hie(Gie(s,Jie(79-h,u,l,A),e[Zie[h]+t],Xie(h)),eoe[h]),c),s=c,c=A,A=Hie(l,10),l=u,u=f}f=jie(this.h[1],i,A),this.h[1]=jie(this.h[2],o,c),this.h[2]=jie(this.h[3],a,s),this.h[3]=jie(this.h[4],n,u),this.h[4]=jie(this.h[0],r,l),this.h[0]=f},Vie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"little"):kre.split32(this.h,"little")};var Wie=[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],Zie=[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],$ie=[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],eoe=[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],toe={ripemd160:zie};function noe(e,t,n){if(!(this instanceof noe))return new noe(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(kre.toArray(t,n))}var roe=noe;noe.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),Yne(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},noe.prototype.update=function(e,t){return this.inner.update(e,t),this},noe.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var ioe=UY((function(e,t){var n=t;n.utils=kre,n.common=_re,n.sha=Oie,n.ripemd=toe,n.hmac=roe,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),ooe={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},aoe=UY((function(e,t){var n,r=t,i=$ne.assert;function o(e){"short"===e.type?this.curve=new Ire.short(e):"edwards"===e.type?this.curve=new Ire.edwards(e):this.curve=new Ire.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:ioe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:ioe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:ioe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:ioe.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:ioe.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ioe.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ioe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=ooe}catch(e){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:ioe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function soe(e){if(!(this instanceof soe))return new soe(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Zne.toArray(e.entropy,e.entropyEnc||"hex"),n=Zne.toArray(e.nonce,e.nonceEnc||"hex"),r=Zne.toArray(e.pers,e.persEnc||"hex");Yne(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var uoe=soe;soe.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},soe.prototype._hmac=function(){return new ioe.hmac(this.hash,this.K)},soe.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},soe.prototype.reseed=function(e,t,n,r){"string"!=typeof t&&(r=n,n=t,t=null),e=Zne.toArray(e,t),n=Zne.toArray(n,r),Yne(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},soe.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=Zne.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(n),this._reseed++,Zne.encode(o,t)};var loe=$ne.assert;function Aoe(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var coe=Aoe;Aoe.fromPublic=function(e,t,n){return t instanceof Aoe?t:new Aoe(e,{pub:t,pubEnc:n})},Aoe.fromPrivate=function(e,t,n){return t instanceof Aoe?t:new Aoe(e,{priv:t,privEnc:n})},Aoe.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Aoe.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Aoe.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Aoe.prototype._importPrivate=function(e,t){this.priv=new Lne(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Aoe.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?loe(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||loe(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Aoe.prototype.derive=function(e){return e.validate()||loe(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Aoe.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},Aoe.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Aoe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var hoe=$ne.assert;function foe(e,t){if(e instanceof foe)return e;this._importDER(e,t)||(hoe(e.r&&e.s,"Signature without r or s"),this.r=new Lne(e.r,16),this.s=new Lne(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var doe=foe;function poe(){this.place=0}function goe(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o<r;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function voe(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function yoe(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}foe.prototype._importDER=function(e,t){e=$ne.toArray(e,t);var n=new poe;if(48!==e[n.place++])return!1;var r=goe(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=goe(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=goe(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new Lne(o),this.s=new Lne(s),this.recoveryParam=null,!0},foe.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=voe(t),n=voe(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];yoe(r,t.length),(r=r.concat(t)).push(2),yoe(r,n.length);var i=r.concat(n),o=[48];return yoe(o,i.length),o=o.concat(i),$ne.encode(o,e)};var moe=$ne.assert;function woe(e){if(!(this instanceof woe))return new woe(e);"string"==typeof e&&(moe(Object.prototype.hasOwnProperty.call(aoe,e),"Unknown curve "+e),e=aoe[e]),e instanceof aoe.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var boe=woe;woe.prototype.keyPair=function(e){return new coe(this,e)},woe.prototype.keyFromPrivate=function(e,t){return coe.fromPrivate(this,e,t)},woe.prototype.keyFromPublic=function(e,t){return coe.fromPublic(this,e,t)},woe.prototype.genKeyPair=function(e){e||(e={});for(var t=new uoe({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ere(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new Lne(2));;){var i=new Lne(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},woe.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},woe.prototype.sign=function(e,t,n,r){"object"==i(n)&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Lne(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),s=e.toArray("be",o),u=new uoe({hash:this.hash,entropy:a,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),l=this.n.sub(new Lne(1)),A=0;;A++){var c=r.k?r.k(A):new Lne(u.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(l)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new doe({r:d,s:p,recoveryParam:g})}}}}}},woe.prototype.verify=function(e,t,n,r){e=this._truncateToN(new Lne(e,16)),n=this.keyFromPublic(n,r);var i=(t=new doe(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},woe.prototype.recoverPubKey=function(e,t,n,r){moe((3&n)===n,"The recovery param is more than two bits"),t=new doe(t,r);var i=this.n,o=new Lne(e),a=t.r,s=t.s,u=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var A=t.r.invm(i),c=i.sub(o).mul(A).umod(i),h=s.mul(A).umod(i);return this.g.mulAdd(c,a,h)},woe.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new doe(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var Ioe=$ne.assert,Boe=$ne.parseBytes,Eoe=$ne.cachedProperty;function Coe(e,t){this.eddsa=e,this._secret=Boe(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Boe(t.pub)}Coe.fromPublic=function(e,t){return t instanceof Coe?t:new Coe(e,{pub:t})},Coe.fromSecret=function(e,t){return t instanceof Coe?t:new Coe(e,{secret:t})},Coe.prototype.secret=function(){return this._secret},Eoe(Coe,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Eoe(Coe,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Eoe(Coe,"privBytes",(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r})),Eoe(Coe,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Eoe(Coe,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Eoe(Coe,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Coe.prototype.sign=function(e){return Ioe(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Coe.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Coe.prototype.getSecret=function(e){return Ioe(this._secret,"KeyPair is public only"),$ne.encode(this.secret(),e)},Coe.prototype.getPublic=function(e){return $ne.encode(this.pubBytes(),e)};var xoe=Coe,koe=$ne.assert,Soe=$ne.cachedProperty,Qoe=$ne.parseBytes;function _oe(e,t){this.eddsa=e,"object"!=i(t)&&(t=Qoe(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),koe(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Lne&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Soe(_oe,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Soe(_oe,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Soe(_oe,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Soe(_oe,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),_oe.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},_oe.prototype.toHex=function(){return $ne.encode(this.toBytes(),"hex").toUpperCase()};var Noe=_oe,Doe=$ne.assert,Foe=$ne.parseBytes;function Poe(e){if(Doe("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Poe))return new Poe(e);e=aoe[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=ioe.sha512}var Uoe=Poe;Poe.prototype.sign=function(e,t){e=Foe(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),s=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Poe.prototype.verify=function(e,t,n){e=Foe(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},Poe.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return $ne.intFromLE(e.digest()).umod(this.curve.n)},Poe.prototype.keyFromPublic=function(e){return xoe.fromPublic(this,e)},Poe.prototype.keyFromSecret=function(e){return xoe.fromSecret(this,e)},Poe.prototype.makeSignature=function(e){return e instanceof Noe?e:new Noe(this,e)},Poe.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},Poe.prototype.decodePoint=function(e){var t=(e=$ne.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),r=0!=(128&e[t]),i=$ne.intFromLE(n);return this.curve.pointFromY(i,r)},Poe.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},Poe.prototype.decodeInt=function(e){return $ne.intFromLE(e)},Poe.prototype.isPoint=function(e){return e instanceof this.pointClass};var Loe=LY(Jne),Moe=UY((function(e,t){var n=t;n.version=Loe.version,n.utils=$ne,n.rand=ere,n.curve=Ire,n.curves=aoe,n.ec=boe,n.eddsa=Uoe})),Toe=nX.alloc(1,1),Roe=nX.alloc(1,0),Ooe=new Moe.ec("secp256k1"),Hoe=nX.alloc(32,0),Koe=nX.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),joe=nX.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),Goe=Ooe.curve.n,qoe=Goe.shrn(1),Voe=Ooe.curve.g;function zoe(e){return TX(e)&&32===e.length}function Joe(e){return!!zoe(e)&&e.compare(Koe)<0}function Yoe(e){if(!TX(e))return!1;if(e.length<33)return!1;var t=e[0],n=e.slice(1,33);if(0===n.compare(Hoe))return!1;if(n.compare(joe)>=0)return!1;if((2===t||3===t)&&33===e.length){try{tae(e)}catch(e){return!1}return!0}var r=e.slice(33);return 0!==r.compare(Hoe)&&!(r.compare(joe)>=0)&&4===t&&65===e.length}function Xoe(e){return 4!==e[0]}function Woe(e){return!!zoe(e)&&e.compare(Hoe)>0&&e.compare(Koe)<0}function Zoe(e,t){return void 0===e&&void 0!==t?Xoe(t):void 0===e||e}function $oe(e){return new Lne(e)}function eae(e){return e.toArrayLike(nX,"be",32)}function tae(e){return Ooe.curve.decodePoint(e)}function nae(e,t){return nX.from(e._encode(t))}function rae(e,t,n){if(!zoe(e))throw new TypeError("Expected Hash");if(!Woe(t))throw new TypeError("Expected Private");if(void 0!==n&&!zoe(n))throw new TypeError("Expected Extra Data (32 bytes)");var r,i,o=$oe(t),a=$oe(e);(function(e,t,n,r,i){var o=nX.alloc(32,0),a=nX.alloc(32,1);o=_ne("sha256",o).update(a).update(Roe).update(t).update(e).update(i||"").digest(),a=_ne("sha256",o).update(a).digest(),o=_ne("sha256",o).update(a).update(Toe).update(t).update(e).update(i||"").digest(),a=_ne("sha256",o).update(a).digest();for(var s=a=_ne("sha256",o).update(a).digest();!r(s)||!n(s);)o=_ne("sha256",o).update(a).update(Roe).digest(),a=_ne("sha256",o).update(a).digest(),s=a=_ne("sha256",o).update(a).digest()})(e,t,(function(e){var t=$oe(e),n=Voe.mul(t);return!n.isInfinity()&&(0!==(r=n.x.umod(Goe)).isZero()&&0!==(i=t.invm(Goe).mul(a.add(o.mul(r))).umod(Goe)).isZero())}),Woe,n),i.cmp(qoe)>0&&(i=Goe.sub(i));var s=nX.allocUnsafe(64);return eae(r).copy(s,0),eae(i).copy(s,32),s}var iae={isPoint:Yoe,isPointCompressed:function(e){return!!Yoe(e)&&Xoe(e)},isPrivate:Woe,pointAdd:function(e,t,n){if(!Yoe(e))throw new TypeError("Expected Point");if(!Yoe(t))throw new TypeError("Expected Point");var r=tae(e),i=tae(t),o=r.add(i);return o.isInfinity()?null:nae(o,Zoe(n,e))},pointAddScalar:function(e,t,n){if(!Yoe(e))throw new TypeError("Expected Point");if(!Joe(t))throw new TypeError("Expected Tweak");var r=Zoe(n,e),i=tae(e);if(0===t.compare(Hoe))return nae(i,r);var o=$oe(t),a=Voe.mul(o),s=i.add(a);return s.isInfinity()?null:nae(s,r)},pointCompress:function(e,t){if(!Yoe(e))throw new TypeError("Expected Point");var n=tae(e);if(n.isInfinity())throw new TypeError("Expected Point");return nae(n,Zoe(t,e))},pointFromScalar:function(e,t){if(!Woe(e))throw new TypeError("Expected Private");var n=$oe(e),r=Voe.mul(n);return r.isInfinity()?null:nae(r,Zoe(t))},pointMultiply:function(e,t,n){if(!Yoe(e))throw new TypeError("Expected Point");if(!Joe(t))throw new TypeError("Expected Tweak");var r=Zoe(n,e),i=tae(e),o=$oe(t),a=i.mul(o);return a.isInfinity()?null:nae(a,r)},privateAdd:function(e,t){if(!Woe(e))throw new TypeError("Expected Private");if(!Joe(t))throw new TypeError("Expected Tweak");var n=$oe(e),r=$oe(t),i=eae(n.add(r).umod(Goe));return Woe(i)?i:null},privateSub:function(e,t){if(!Woe(e))throw new TypeError("Expected Private");if(!Joe(t))throw new TypeError("Expected Tweak");var n=$oe(e),r=$oe(t),i=eae(n.sub(r).umod(Goe));return Woe(i)?i:null},sign:function(e,t){return rae(e,t)},signWithEntropy:function(e,t,n){return rae(e,t,n)},verify:function(e,t,n,r){if(!zoe(e))throw new TypeError("Expected Hash");if(!Yoe(t))throw new TypeError("Expected Point");if(!function(e){var t=e.slice(0,32),n=e.slice(32,64);return TX(e)&&64===e.length&&t.compare(Koe)<0&&n.compare(Koe)<0}(n))throw new TypeError("Expected Signature");var i=tae(t),o=$oe(n.slice(0,32)),a=$oe(n.slice(32,64));if(r&&a.cmp(qoe)>0)return!1;if(o.gtn(0)<=0)return!1;if(a.gtn(0)<=0)return!1;var s=$oe(e),u=a.invm(Goe),l=s.mul(u).umod(Goe),A=o.mul(u).umod(Goe),c=Voe.mulAdd(l,i,A);return!c.isInfinity()&&c.x.umod(Goe).eq(o)}},oae={Array:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return null!=e&&e.constructor===Array})),Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==i(e)},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var aae in oae.Null=oae.Nil,oae)oae[aae].toJSON=function(e){return e}.bind(null,aae);var sae=oae;function uae(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function lae(e){return sae.Nil(e)?"":uae(e.constructor)}function Aae(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function cae(e){return sae.Function(e)?e.toJSON?e.toJSON():uae(e):sae.Array(e)?"Array":e&&sae.Object(e)?"Object":void 0!==e?e:""}function hae(e,t,n){var r=function(e){return sae.Function(e)?"":sae.String(e)?JSON.stringify(e):e&&sae.Object(e)?"":e}(t);return"Expected "+cae(e)+", got"+(""!==n?" "+n:"")+(""!==r?" "+r:"")}function fae(e,t,n){n=n||lae(t),this.message=hae(e,t,n),Aae(this,fae),this.__type=e,this.__value=t,this.__valueTypeName=n}function dae(e,t,n,r,i){e?(i=i||lae(r),this.message=function(e,t,n,r,i){var o='" of type ';return"key"===t&&(o='" with key type '),hae('property "'+cae(n)+o+cae(e),r,i)}(e,n,t,r,i)):this.message='Unexpected property "'+t+'"',Aae(this,fae),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=i}fae.prototype=Object.create(Error.prototype),fae.prototype.constructor=fae,dae.prototype=Object.create(Error.prototype),dae.prototype.constructor=fae;var pae=fae,gae=dae,vae=function(e,t){return new fae(e,{},t)},yae=function(e,t,n){return e instanceof dae?(t=t+"."+e.__property,e=new dae(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof fae&&(e=new dae(e.__type,t,n,e.__value,e.__valueTypeName)),Aae(e),e},mae=cae,wae=lae;function bae(e){return TX(e)}function Iae(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function Bae(e,t){var n=e.toJSON();function r(r){if(!e(r))return!1;if(r.length===t)return!0;throw vae(n+"(Length: "+t+")",n+"(Length: "+r.length+")")}return r.toJSON=function(){return n},r}var Eae=Bae.bind(null,sae.Array),Cae=Bae.bind(null,bae),xae=Bae.bind(null,Iae),kae=Bae.bind(null,sae.String),Sae=Math.pow(2,53)-1,Qae={ArrayN:Eae,Buffer:bae,BufferN:Cae,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:Iae,HexN:xae,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-Sae&&e<=Sae&&Math.floor(e)===e},Range:function(e,t,n){function r(r,i){return n(r,i)&&r>e&&r<t}return n=n||sae.Number,r.toJSON=function(){return"".concat(n.toJSON()," between [").concat(e,", ").concat(t,"]")},r},StringN:kae,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=Sae&&Math.floor(e)===e}};for(var _ae in Qae)Qae[_ae].toJSON=function(e){return e}.bind(null,_ae);var Nae=Qae,Dae=mae,Fae=pae,Pae=gae,Uae=yae,Lae=wae,Mae={arrayOf:function(e,t){function n(n,r){return!!sae.Array(n)&&!sae.Nil(n)&&!(void 0!==t.minLength&&n.length<t.minLength)&&!(void 0!==t.maxLength&&n.length>t.maxLength)&&(void 0===t.length||n.length===t.length)&&n.every((function(t,n){try{return Rae(e,t,r)}catch(e){throw Uae(e,n)}}))}return e=Tae(e),t=t||{},n.toJSON=function(){var n="["+Dae(e)+"]";return void 0!==t.length?n+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(n+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),n},n},maybe:function e(t){function n(n,r){return sae.Nil(n)||t(n,r,e)}return t=Tae(t),n.toJSON=function(){return"?"+Dae(t)},n},map:function(e,t){function n(n,r){if(!sae.Object(n))return!1;if(sae.Nil(n))return!1;for(var i in n){try{t&&Rae(t,i,r)}catch(e){throw Uae(e,i,"key")}try{var o=n[i];Rae(e,o,r)}catch(e){throw Uae(e,i)}}return!0}return e=Tae(e),t&&(t=Tae(t)),n.toJSON=t?function(){return"{"+Dae(t)+": "+Dae(e)+"}"}:function(){return"{"+Dae(e)+"}"},n},object:function(e){var t={};for(var n in e)t[n]=Tae(e[n]);function r(e,n){if(!sae.Object(e))return!1;if(sae.Nil(e))return!1;var r;try{for(r in t)Rae(t[r],e[r],n)}catch(e){throw Uae(e,r)}if(n)for(r in e)if(!t[r])throw new Pae(void 0,r);return!0}return r.toJSON=function(){return Dae(t)},r},anyOf:function(){var e=[].slice.call(arguments).map(Tae);function t(t,n){return e.some((function(e){try{return Rae(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(Dae).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(Tae);function t(t,n){return e.every((function(e){try{return Rae(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(Dae).join(" & ")},t},quacksLike:function(e){function t(t){return e===Lae(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(Tae);function t(t,n){return!sae.Nil(t)&&!sae.Nil(t.length)&&(!n||t.length===e.length)&&e.every((function(e,r){try{return Rae(e,t[r],n)}catch(e){throw Uae(e,r)}}))}return t.toJSON=function(){return"("+e.map(Dae).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function Tae(e){if(sae.String(e))return"?"===e[0]?Mae.maybe(e.slice(1)):sae[e]||Mae.quacksLike(e);if(e&&sae.Object(e)){if(sae.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return Mae.arrayOf(e[0])}return Mae.object(e)}return sae.Function(e)?e:Mae.value(e)}function Rae(e,t,n,r){if(sae.Function(e)){if(e(t,n))return!0;throw new Fae(r||e,t)}return Rae(Tae(e),t,n)}for(var Oae in Mae.oneOf=Mae.anyOf,sae)Rae[Oae]=sae[Oae];for(Oae in Mae)Rae[Oae]=Mae[Oae];for(Oae in Nae)Rae[Oae]=Nae[Oae];Rae.compile=Tae,Rae.TfTypeError=Fae,Rae.TfPropertyTypeError=Pae;var Hae=Rae;function Kae(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function jae(e,t,n){var r=new nX(n?34:33);return r.writeUInt8(e,0),t.copy(r,1),n&&(r[33]=1),r}var Gae=function(e,t){return Kae(Une.decode(e),t)},qae=function(e,t,n){return"number"==typeof e?Une.encode(jae(e,t,n)):Une.encode(jae(e.version,e.privateKey,e.compressed))},Vae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Hae.BufferN(32),r=Hae.compile({wif:Hae.UInt8,bip32:{public:Hae.UInt32,private:Hae.UInt32}}),i={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},o=2147483648,a=Math.pow(2,31)-1;function u(e){return Hae.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function A(e){return Hae.UInt32(e)&&e<=a}var c=function(){function e(t,n,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;s(this,e),this.__D=t,this.__Q=n,this.chainCode=i,this.network=o,this.__DEPTH=a,this.__INDEX=u,this.__PARENT_FINGERPRINT=l,Hae(r,o),this.lowR=!1}return l(e,[{key:"depth",get:function(){return this.__DEPTH}},{key:"index",get:function(){return this.__INDEX}},{key:"parentFingerprint",get:function(){return this.__PARENT_FINGERPRINT}},{key:"publicKey",get:function(){return void 0===this.__Q&&(this.__Q=iae.pointFromScalar(this.__D,!0)),this.__Q}},{key:"privateKey",get:function(){return this.__D}},{key:"identifier",get:function(){return Nne.hash160(this.publicKey)}},{key:"fingerprint",get:function(){return this.identifier.slice(0,4)}},{key:"compressed",get:function(){return!0}},{key:"isNeutered",value:function(){return void 0===this.__D}},{key:"neutered",value:function(){return d(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}},{key:"toBase58",value:function(){var e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,n=nX.allocUnsafe(78);return n.writeUInt32BE(t,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),Une.encode(n)}},{key:"toWIF",value:function(){if(!this.privateKey)throw new TypeError("Missing private key");return qae(this.network.wif,this.privateKey,!0)}},{key:"derive",value:function(e){Hae(Hae.UInt32,e);var t=e>=o,n=nX.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");n[0]=0,this.privateKey.copy(n,1),n.writeUInt32BE(e,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(e,33);var r,i=Nne.hmacSHA512(this.chainCode,n),a=i.slice(0,32),s=i.slice(32);if(!iae.isPrivate(a))return this.derive(e+1);if(this.isNeutered()){var u=iae.pointAddScalar(this.publicKey,a,!0);if(null===u)return this.derive(e+1);r=d(u,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{var l=iae.privateAdd(this.privateKey,a);if(null==l)return this.derive(e+1);r=f(l,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return r}},{key:"deriveHardened",value:function(e){return Hae(A,e),this.derive(e+o)}},{key:"derivePath",value:function(e){Hae(u,e);var t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((function(e,t){var n;return"'"===t.slice(-1)?(n=parseInt(t.slice(0,-1),10),e.deriveHardened(n)):(n=parseInt(t,10),e.derive(n))}),this)}},{key:"sign",value:function(e,t){if(!this.privateKey)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return iae.sign(e,this.privateKey);for(var n=iae.sign(e,this.privateKey),r=nX.alloc(32,0),i=0;n[0]>127;)i++,r.writeUIntLE(i,0,6),n=iae.signWithEntropy(e,this.privateKey,r);return n}},{key:"verify",value:function(e,t){return iae.verify(e,this.publicKey,t)}}]),e}();function h(e,t,n){return f(e,t,n)}function f(e,t,r,o,a,s){if(Hae({privateKey:n,chainCode:n},{privateKey:e,chainCode:t}),r=r||i,!iae.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new c(e,void 0,t,r,o,a,s)}function d(e,t,r,o,a,s){if(Hae({publicKey:Hae.BufferN(33),chainCode:n},{publicKey:e,chainCode:t}),r=r||i,!iae.isPoint(e))throw new TypeError("Point is not on the curve");return new c(void 0,e,t,r,o,a,s)}t.fromBase58=function(e,t){var n=Une.decode(e);if(78!==n.length)throw new TypeError("Invalid buffer length");t=t||i;var r=n.readUInt32BE(0);if(r!==t.bip32.private&&r!==t.bip32.public)throw new TypeError("Invalid network version");var o=n[4],a=n.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");var s=n.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");var u,l=n.slice(13,45);if(r===t.bip32.private){if(0!==n.readUInt8(45))throw new TypeError("Invalid private key");u=f(n.slice(46,78),l,t,o,s,a)}else u=d(n.slice(45,78),l,t,o,s,a);return u},t.fromPrivateKey=h,t.fromPublicKey=function(e,t,n){return d(e,t,n)},t.fromSeed=function(e,t){if(Hae(Hae.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||i;var n=Nne.hmacSHA512(nX.from("Bitcoin seed","utf8"),e);return h(n.slice(0,32),n.slice(32),t)}}));PY(Vae),Vae.fromBase58,Vae.fromPrivateKey,Vae.fromPublicKey,Vae.fromSeed;var zae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fromSeed=Vae.fromSeed,t.fromBase58=Vae.fromBase58,t.fromPublicKey=Vae.fromPublicKey,t.fromPrivateKey=Vae.fromPrivateKey}));PY(zae),zae.fromSeed,zae.fromBase58,zae.fromPublicKey,zae.fromPrivateKey;var Jae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}));PY(Jae),Jae.bitcoin,Jae.regtest,Jae.testnet;var Yae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,n){t=t||4,n=void 0===n||n;var r=e.length;if(0===r)return 0;if(r>t)throw new TypeError("Script number overflow");if(n&&0==(127&e[r-1])&&(r<=1||0==(128&e[r-2])))throw new Error("Non-minimally encoded script number");if(5===r){var i=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var a=0,s=0;s<r;++s)a|=e[s]<<8*s;return 128&e[r-1]?-(a&~(128<<8*(r-1))):a},t.encode=function(e){for(var t,n=Math.abs(e),r=(t=n)>2147483647?5:t>8388607?4:t>32767?3:t>127?2:t>0?1:0,i=nX.allocUnsafe(r),o=e<0,a=0;a<r;++a)i.writeUInt8(255&n,a),n>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i}}));PY(Yae),Yae.decode,Yae.encode;var Xae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Math.pow(2,31)-1;function r(e){return Hae.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return Hae.UInt32(e)&&e<=n},t.BIP32Path=r,r.toJSON=function(){return"BIP32 derivation path"},t.Signer=function(e){return(Hae.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign},t.Satoshi=function(e){return Hae.UInt53(e)&&e<=21e14},t.ECPoint=Hae.quacksLike("Point"),t.Network=Hae.compile({messagePrefix:Hae.oneOf(Hae.Buffer,Hae.String),bip32:{public:Hae.UInt32,private:Hae.UInt32},pubKeyHash:Hae.UInt8,scriptHash:Hae.UInt8,wif:Hae.UInt8}),t.Buffer256bit=Hae.BufferN(32),t.Hash160bit=Hae.BufferN(20),t.Hash256bit=Hae.BufferN(32),t.Number=Hae.Number,t.Array=Hae.Array,t.Boolean=Hae.Boolean,t.String=Hae.String,t.Buffer=Hae.Buffer,t.Hex=Hae.Hex,t.maybe=Hae.maybe,t.tuple=Hae.tuple,t.UInt8=Hae.UInt8,t.UInt32=Hae.UInt32,t.Function=Hae.Function,t.BufferN=Hae.BufferN,t.Null=Hae.Null,t.oneOf=Hae.oneOf}));PY(Xae),Xae.UInt31,Xae.BIP32Path,Xae.Signer,Xae.Satoshi,Xae.ECPoint,Xae.Network,Xae.Buffer256bit,Xae.Hash160bit,Xae.Hash256bit,Xae.Number,Xae.Array,Xae.Boolean,Xae.String,Xae.Buffer,Xae.Hex,Xae.maybe,Xae.tuple,Xae.UInt8,Xae.UInt32,Xae.Function,Xae.BufferN,Xae.Null,Xae.oneOf;var Wae=i9.Buffer,Zae=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var n=e[5+t];return!(0===n||6+t+n!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||n>1&&0===e[t+6]&&!(128&e[t+7]))},$ae=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var n=e[5+t];if(0===n)throw new Error("S length is zero");if(6+t+n!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(n>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},ese=function(e,t){var n=e.length,r=t.length;if(0===n)throw new Error("R length is zero");if(0===r)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(r>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Wae.allocUnsafe(6+n+r);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+n]=2,i[5+n]=t.length,t.copy(i,6+n),i},tse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=nX.alloc(1,0);function r(e){for(var t=0;0===e[t];)++t;return t===e.length?n:128&(e=e.slice(t))[0]?nX.concat([n,e],1+e.length):e}function i(e){0===e[0]&&(e=e.slice(1));var t=nX.alloc(32,0),n=Math.max(0,32-e.length);return e.copy(t,n),t}t.decode=function(e){var t=e.readUInt8(e.length-1),n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var r=$ae(e.slice(0,-1)),o=i(r.r),a=i(r.s);return{signature:nX.concat([o,a],64),hashType:t}},t.encode=function(e,t){Hae({signature:Xae.BufferN(64),hashType:Xae.UInt8},{signature:e,hashType:t});var n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var i=nX.allocUnsafe(1);i.writeUInt8(t,0);var o=r(e.slice(0,32)),a=r(e.slice(32,64));return nX.concat([ese(o,a),i])}}));PY(tse),tse.decode,tse.encode;var nse=LY(Object.freeze({__proto__:null,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_SUBSTR:127,OP_LEFT:128,OP_RIGHT: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_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255,default:{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_SUBSTR:127,OP_LEFT:128,OP_RIGHT: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_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}}));function rse(e){return e<nse.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}var ise={encodingLength:rse,encode:function(e,t,n){var r=rse(t);return 1===r?e.writeUInt8(t,n):2===r?(e.writeUInt8(nse.OP_PUSHDATA1,n),e.writeUInt8(t,n+1)):3===r?(e.writeUInt8(nse.OP_PUSHDATA2,n),e.writeUInt16LE(t,n+1)):(e.writeUInt8(nse.OP_PUSHDATA4,n),e.writeUInt32LE(t,n+1)),r},decode:function(e,t){var n,r,i=e.readUInt8(t);if(i<nse.OP_PUSHDATA1)n=i,r=1;else if(i===nse.OP_PUSHDATA1){if(t+2>e.length)return null;n=e.readUInt8(t+1),r=2}else if(i===nse.OP_PUSHDATA2){if(t+3>e.length)return null;n=e.readUInt16LE(t+1),r=3}else{if(t+5>e.length)return null;if(i!==nse.OP_PUSHDATA4)throw new Error("Unexpected opcode");n=e.readUInt32LE(t+1),r=5}return{opcode:i,number:n,size:r}}},ose={};for(var ase in nse)ose[nse[ase]]=ase;var sse=ose,use=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.OPS=nse;var n=t.OPS.OP_RESERVED;function r(e){return Xae.Buffer(e)||function(e){return Xae.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function i(e){return Xae.Array(e)&&e.every(r)}function o(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?n+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function a(e){return TX(e)}function s(e){return TX(e)}function u(e){if(a(e))return e;Hae(Xae.Array,e);var t=e.reduce((function(e,t){return s(t)?1===t.length&&void 0!==o(t)?e+1:e+ise.encodingLength(t.length)+t.length:e+1}),0),n=nX.allocUnsafe(t),r=0;if(e.forEach((function(e){if(s(e)){var t=o(e);if(void 0!==t)return n.writeUInt8(t,r),void(r+=1);r+=ise.encode(n,e.length,r),e.copy(n,r),r+=e.length}else n.writeUInt8(e,r),r+=1})),r!==n.length)throw new Error("Could not decode chunks");return n}function l(e){if(n=e,Xae.Array(n))return e;var n;Hae(Xae.Buffer,e);for(var r=[],i=0;i<e.length;){var a=e[i];if(a>t.OPS.OP_0&&a<=t.OPS.OP_PUSHDATA4){var s=ise.decode(e,i);if(null===s)return null;if((i+=s.size)+s.number>e.length)return null;var u=e.slice(i,i+s.number);i+=s.number;var l=o(u);void 0!==l?r.push(l):r.push(u)}else r.push(a),i+=1}return r}function A(e){var t=-129&e;return t>0&&t<4}t.isPushOnly=i,t.compile=u,t.decompile=l,t.toASM=function(e){return a(e)&&(e=l(e)),e.map((function(e){if(s(e)){var t=o(e);if(void 0===t)return e.toString("hex");e=t}return sse[e]})).join(" ")},t.fromASM=function(e){return Hae(Xae.String,e),u(e.split(" ").map((function(e){return void 0!==t.OPS[e]?t.OPS[e]:(Hae(Xae.Hex,e),nX.from(e,"hex"))})))},t.toStack=function(e){return e=l(e),Hae(i,e),e.map((function(e){return s(e)?e:e===t.OPS.OP_0?nX.allocUnsafe(0):Yae.encode(e-n)}))},t.isCanonicalPubKey=function(e){return iae.isPoint(e)},t.isDefinedHashType=A,t.isCanonicalScriptSignature=function(e){return!!TX(e)&&!!A(e[e.length-1])&&Zae(e.slice(0,-1))},t.number=Yae,t.signature=tse}));PY(use),use.OPS,use.isPushOnly,use.compile,use.decompile,use.toASM,use.fromASM,use.toStack,use.isCanonicalPubKey,use.isDefinedHashType,use.isCanonicalScriptSignature,use.number,use.signature;var lse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=n.call(this);return this[t]=e,e},set:function(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){var t;return function(){return void 0!==t||(t=e()),t}}}));PY(lse),lse.prop,lse.value;var Ase=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),data:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var r={name:"embed",network:e.network||Jae.bitcoin};if(lse.prop(r,"output",(function(){if(e.data)return use.compile([n.OP_RETURN].concat(e.data))})),lse.prop(r,"data",(function(){if(e.output)return use.decompile(e.output).slice(1)})),t.validate&&e.output){var i=use.decompile(e.output);if(i[0]!==n.OP_RETURN)throw new TypeError("Output is invalid");if(!i.slice(1).every(Hae.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}}));PY(Ase),Ase.p2data;var cse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS,r=n.OP_RESERVED;function i(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function o(e){return use.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===n.OP_0)}t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),m:Hae.maybe(Hae.Number),n:Hae.maybe(Hae.Number),output:Hae.maybe(Hae.Buffer),pubkeys:Hae.maybe(Hae.arrayOf(iae.isPoint)),signatures:Hae.maybe(Hae.arrayOf(o)),input:Hae.maybe(Hae.Buffer)},e);var a={network:e.network||Jae.bitcoin},s=[],u=!1;function l(e){u||(u=!0,s=use.decompile(e),a.m=s[0]-r,a.n=s[s.length-2]-r,a.pubkeys=s.slice(1,-2))}if(lse.prop(a,"output",(function(){if(e.m&&a.n&&e.pubkeys)return use.compile([].concat(r+e.m,e.pubkeys,r+a.n,n.OP_CHECKMULTISIG))})),lse.prop(a,"m",(function(){if(a.output)return l(a.output),a.m})),lse.prop(a,"n",(function(){if(a.pubkeys)return a.pubkeys.length})),lse.prop(a,"pubkeys",(function(){if(e.output)return l(e.output),a.pubkeys})),lse.prop(a,"signatures",(function(){if(e.input)return use.decompile(e.input).slice(1)})),lse.prop(a,"input",(function(){if(e.signatures)return use.compile([n.OP_0].concat(e.signatures))})),lse.prop(a,"witness",(function(){if(a.input)return[]})),lse.prop(a,"name",(function(){if(a.m&&a.n)return"p2ms(".concat(a.m," of ").concat(a.n,")")})),t.validate){if(e.output){if(l(e.output),!Hae.Number(s[0]))throw new TypeError("Output is invalid");if(!Hae.Number(s[s.length-2]))throw new TypeError("Output is invalid");if(s[s.length-1]!==n.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(a.m<=0||a.n>16||a.m>a.n||a.n!==s.length-3)throw new TypeError("Output is invalid");if(!a.pubkeys.every((function(e){return iae.isPoint(e)})))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==a.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==a.n)throw new TypeError("n mismatch");if(e.pubkeys&&!i(e.pubkeys,a.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(a.n=e.pubkeys.length,a.n<a.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<a.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>a.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==n.OP_0)throw new TypeError("Input is invalid");if(0===a.signatures.length||!a.signatures.every(o))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!i(e.signatures,a.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(a,e)}}));PY(cse),cse.p2ms;var hse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),pubkey:Hae.maybe(iae.isPoint),signature:Hae.maybe(use.isCanonicalScriptSignature),input:Hae.maybe(Hae.Buffer)},e);var r=lse.value((function(){return use.decompile(e.input)})),i={name:"p2pk",network:e.network||Jae.bitcoin};if(lse.prop(i,"output",(function(){if(e.pubkey)return use.compile([e.pubkey,n.OP_CHECKSIG])})),lse.prop(i,"pubkey",(function(){if(e.output)return e.output.slice(1,-1)})),lse.prop(i,"signature",(function(){if(e.input)return r()[0]})),lse.prop(i,"input",(function(){if(e.signature)return use.compile([e.signature])})),lse.prop(i,"witness",(function(){if(i.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==n.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!iae.isPoint(i.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(i.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(i.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!use.isCanonicalScriptSignature(i.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(i,e)}}));PY(hse),hse.p2pk;var fse=UY((function(e,t){function n(e){try{return bne("rmd160").update(e).digest()}catch(t){return bne("ripemd160").update(e).digest()}}function r(e){return bne("sha256").update(e).digest()}Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=n,t.sha1=function(e){return bne("sha1").update(e).digest()},t.sha256=r,t.hash160=function(e){return n(r(e))},t.hash256=function(e){return r(r(e))}}));PY(fse),fse.ripemd160,fse.sha1,fse.sha256,fse.hash160,fse.hash256;var dse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(20)),output:Hae.maybe(Hae.BufferN(25)),pubkey:Hae.maybe(iae.isPoint),signature:Hae.maybe(use.isCanonicalScriptSignature),input:Hae.maybe(Hae.Buffer)},e);var r=lse.value((function(){var t=Une.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),i=lse.value((function(){return use.decompile(e.input)})),o=e.network||Jae.bitcoin,a={name:"p2pkh",network:o};if(lse.prop(a,"address",(function(){if(a.hash){var e=nX.allocUnsafe(21);return e.writeUInt8(o.pubKeyHash,0),a.hash.copy(e,1),Une.encode(e)}})),lse.prop(a,"hash",(function(){return e.output?e.output.slice(3,23):e.address?r().hash:e.pubkey||a.pubkey?fse.hash160(e.pubkey||a.pubkey):void 0})),lse.prop(a,"output",(function(){if(a.hash)return use.compile([n.OP_DUP,n.OP_HASH160,a.hash,n.OP_EQUALVERIFY,n.OP_CHECKSIG])})),lse.prop(a,"pubkey",(function(){if(e.input)return i()[1]})),lse.prop(a,"signature",(function(){if(e.input)return i()[0]})),lse.prop(a,"input",(function(){if(e.pubkey&&e.signature)return use.compile([e.signature,e.pubkey])})),lse.prop(a,"witness",(function(){if(a.input)return[]})),t.validate){var s=nX.from([]);if(e.address){if(r().version!==o.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==r().hash.length)throw new TypeError("Invalid address");s=r().hash}if(e.hash){if(s.length>0&&!s.equals(e.hash))throw new TypeError("Hash mismatch");s=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==n.OP_DUP||e.output[1]!==n.OP_HASH160||20!==e.output[2]||e.output[23]!==n.OP_EQUALVERIFY||e.output[24]!==n.OP_CHECKSIG)throw new TypeError("Output is invalid");var u=e.output.slice(3,23);if(s.length>0&&!s.equals(u))throw new TypeError("Hash mismatch");s=u}if(e.pubkey){var l=fse.hash160(e.pubkey);if(s.length>0&&!s.equals(l))throw new TypeError("Hash mismatch");s=l}if(e.input){var A=i();if(2!==A.length)throw new TypeError("Input is invalid");if(!use.isCanonicalScriptSignature(A[0]))throw new TypeError("Input has invalid signature");if(!iae.isPoint(A[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(A[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(A[1]))throw new TypeError("Pubkey mismatch");var c=fse.hash160(A[1]);if(s.length>0&&!s.equals(c))throw new TypeError("Hash mismatch")}}return Object.assign(a,e)}}));PY(dse),dse.p2pkh;var pse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(20)),output:Hae.maybe(Hae.BufferN(23)),redeem:Hae.maybe({network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),input:Hae.maybe(Hae.Buffer),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))}),input:Hae.maybe(Hae.Buffer),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var r=e.network;r||(r=e.redeem&&e.redeem.network||Jae.bitcoin);var i={network:r},o=lse.value((function(){var t=Une.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),a=lse.value((function(){return use.decompile(e.input)})),s=lse.value((function(){var t=a();return{network:r,output:t[t.length-1],input:use.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(lse.prop(i,"address",(function(){if(i.hash){var e=nX.allocUnsafe(21);return e.writeUInt8(i.network.scriptHash,0),i.hash.copy(e,1),Une.encode(e)}})),lse.prop(i,"hash",(function(){return e.output?e.output.slice(2,22):e.address?o().hash:i.redeem&&i.redeem.output?fse.hash160(i.redeem.output):void 0})),lse.prop(i,"output",(function(){if(i.hash)return use.compile([n.OP_HASH160,i.hash,n.OP_EQUAL])})),lse.prop(i,"redeem",(function(){if(e.input)return s()})),lse.prop(i,"input",(function(){if(e.redeem&&e.redeem.input&&e.redeem.output)return use.compile([].concat(use.decompile(e.redeem.input),e.redeem.output))})),lse.prop(i,"witness",(function(){return i.redeem&&i.redeem.witness?i.redeem.witness:i.input?[]:void 0})),lse.prop(i,"name",(function(){var e=["p2sh"];return void 0!==i.redeem&&e.push(i.redeem.name),e.join("-")})),t.validate){var u=nX.from([]);if(e.address){if(o().version!==r.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==o().hash.length)throw new TypeError("Invalid address");u=o().hash}if(e.hash){if(u.length>0&&!u.equals(e.hash))throw new TypeError("Hash mismatch");u=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==n.OP_HASH160||20!==e.output[1]||e.output[22]!==n.OP_EQUAL)throw new TypeError("Output is invalid");var l=e.output.slice(2,22);if(u.length>0&&!u.equals(l))throw new TypeError("Hash mismatch");u=l}var A=function(e){if(e.output){var t=use.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");var n=fse.hash160(e.output);if(u.length>0&&!u.equals(n))throw new TypeError("Hash mismatch");u=n}if(e.input){var r=e.input.length>0,i=e.witness&&e.witness.length>0;if(!r&&!i)throw new TypeError("Empty input");if(r&&i)throw new TypeError("Input and witness provided");if(r){var o=use.decompile(e.input);if(!use.isPushOnly(o))throw new TypeError("Non push-only scriptSig")}}};if(e.input){var c=a();if(!c||c.length<1)throw new TypeError("Input too short");if(!TX(s().output))throw new TypeError("Input is invalid");A(s())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==r)throw new TypeError("Network mismatch");if(e.input){var h=s();if(e.redeem.output&&!e.redeem.output.equals(h.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(h.input))throw new TypeError("Redeem.input mismatch")}A(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(i,e)}}));PY(pse),pse.p2sh;for(var gse="qpzry9x8gf2tvdw0s3jn54khce6mua7l",vse={},yse=0;yse<gse.length;yse++){var mse=gse.charAt(yse);if(void 0!==vse[mse])throw new TypeError(mse+" is ambiguous");vse[mse]=yse}function wse(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function bse(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=wse(t)^r>>5}for(t=wse(t),n=0;n<e.length;++n){var i=e.charCodeAt(n);t=wse(t)^31&i}return t}function Ise(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=bse(o);if("string"==typeof s)return s;for(var u=[],l=0;l<a.length;++l){var A=a.charAt(l),c=vse[A];if(void 0===c)return"Unknown character "+A;s=wse(s)^c,l+6>=a.length||u.push(c)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:u}}function Bse(e,t,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=t)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}var Ese=function(e){var t=Ise.apply(null,arguments);if("object"==i(t))return t;throw new Error(t)},Cse=function(e,t,n){if(n=n||90,e.length+7+t.length>n)throw new TypeError("Exceeds length limit");var r=bse(e=e.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=e+"1",o=0;o<t.length;++o){var a=t[o];if(a>>5!=0)throw new Error("Non 5-bit word");r=wse(r)^a,i+=gse.charAt(a)}for(o=0;o<6;++o)r=wse(r);for(r^=1,o=0;o<6;++o)i+=gse.charAt(r>>5*(5-o)&31);return i},xse=function(e){var t=Bse(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},kse=function(e){var t=Bse(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)},Sse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS,r=nX.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(20)),input:Hae.maybe(Hae.BufferN(0)),network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.BufferN(22)),pubkey:Hae.maybe(iae.isPoint),signature:Hae.maybe(use.isCanonicalScriptSignature),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var i=lse.value((function(){var t=Ese(e.address),n=t.words.shift(),r=kse(t.words);return{version:n,prefix:t.prefix,data:nX.from(r)}})),o=e.network||Jae.bitcoin,a={name:"p2wpkh",network:o};if(lse.prop(a,"address",(function(){if(a.hash){var e=xse(a.hash);return e.unshift(0),Cse(o.bech32,e)}})),lse.prop(a,"hash",(function(){return e.output?e.output.slice(2,22):e.address?i().data:e.pubkey||a.pubkey?fse.hash160(e.pubkey||a.pubkey):void 0})),lse.prop(a,"output",(function(){if(a.hash)return use.compile([n.OP_0,a.hash])})),lse.prop(a,"pubkey",(function(){return e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0})),lse.prop(a,"signature",(function(){if(e.witness)return e.witness[0]})),lse.prop(a,"input",(function(){if(a.witness)return r})),lse.prop(a,"witness",(function(){if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){var s=nX.from([]);if(e.address){if(o&&o.bech32!==i().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i().version)throw new TypeError("Invalid address version");if(20!==i().data.length)throw new TypeError("Invalid address data");s=i().data}if(e.hash){if(s.length>0&&!s.equals(e.hash))throw new TypeError("Hash mismatch");s=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==n.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(s.length>0&&!s.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");s=e.output.slice(2)}if(e.pubkey){var u=fse.hash160(e.pubkey);if(s.length>0&&!s.equals(u))throw new TypeError("Hash mismatch");if(s=u,!iae.isPoint(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!use.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!iae.isPoint(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");var l=fse.hash160(e.witness[1]);if(s.length>0&&!s.equals(l))throw new TypeError("Hash mismatch")}}return Object.assign(a,e)}}));PY(Sse),Sse.p2wpkh;var Qse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS,r=nX.alloc(0);function i(e){return!(!TX(e)||65!==e.length||4!==e[0]||!iae.isPoint(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(32)),output:Hae.maybe(Hae.BufferN(34)),redeem:Hae.maybe({input:Hae.maybe(Hae.Buffer),network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))}),input:Hae.maybe(Hae.BufferN(0)),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var o=lse.value((function(){var t=Ese(e.address),n=t.words.shift(),r=kse(t.words);return{version:n,prefix:t.prefix,data:nX.from(r)}})),a=lse.value((function(){return use.decompile(e.redeem.input)})),s=e.network;s||(s=e.redeem&&e.redeem.network||Jae.bitcoin);var u={network:s};if(lse.prop(u,"address",(function(){if(u.hash){var e=xse(u.hash);return e.unshift(0),Cse(s.bech32,e)}})),lse.prop(u,"hash",(function(){return e.output?e.output.slice(2):e.address?o().data:u.redeem&&u.redeem.output?fse.sha256(u.redeem.output):void 0})),lse.prop(u,"output",(function(){if(u.hash)return use.compile([n.OP_0,u.hash])})),lse.prop(u,"redeem",(function(){if(e.witness)return{output:e.witness[e.witness.length-1],input:r,witness:e.witness.slice(0,-1)}})),lse.prop(u,"input",(function(){if(u.witness)return r})),lse.prop(u,"witness",(function(){if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){var t=use.toStack(a());return u.redeem=Object.assign({witness:t},e.redeem),u.redeem.input=r,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),lse.prop(u,"name",(function(){var e=["p2wsh"];return void 0!==u.redeem&&e.push(u.redeem.name),e.join("-")})),t.validate){var l=nX.from([]);if(e.address){if(o().prefix!==s.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==o().version)throw new TypeError("Invalid address version");if(32!==o().data.length)throw new TypeError("Invalid address data");l=o().data}if(e.hash){if(l.length>0&&!l.equals(e.hash))throw new TypeError("Hash mismatch");l=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==n.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");var A=e.output.slice(2);if(l.length>0&&!l.equals(A))throw new TypeError("Hash mismatch");l=A}if(e.redeem){if(e.redeem.network&&e.redeem.network!==s)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===use.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");var c=fse.sha256(e.redeem.output);if(l.length>0&&!l.equals(c))throw new TypeError("Hash mismatch");l=c}if(e.redeem.input&&!use.isPushOnly(a()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&a().some(i)||e.redeem.output&&(use.decompile(e.redeem.output)||[]).some(i))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){var h=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(h))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(i)||(use.decompile(h)||[]).some(i))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(u,e)}}));PY(Qse),Qse.p2wsh;var _se=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.embed=Ase.p2data,t.p2ms=cse.p2ms,t.p2pk=hse.p2pk,t.p2pkh=dse.p2pkh,t.p2sh=pse.p2sh,t.p2wpkh=Sse.p2wpkh,t.p2wsh=Qse.p2wsh}));PY(_se),_se.embed,_se.p2ms,_se.p2pk,_se.p2pkh,_se.p2sh,_se.p2wpkh,_se.p2wsh;var Nse=UY((function(e,t){function n(e){var t=Une.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function r(e){var t=Ese(e),n=kse(t.words.slice(1));return{version:t.words[0],prefix:t.prefix,data:nX.from(n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase58Check=n,t.fromBech32=r,t.toBase58Check=function(e,t){Hae(Xae.tuple(Xae.Hash160bit,Xae.UInt8),arguments);var n=nX.allocUnsafe(21);return n.writeUInt8(t,0),e.copy(n,1),Une.encode(n)},t.toBech32=function(e,t,n){var r=xse(e);return r.unshift(t),Cse(n,r)},t.fromOutputScript=function(e,t){t=t||Jae.bitcoin;try{return _se.p2pkh({output:e,network:t}).address}catch(e){}try{return _se.p2sh({output:e,network:t}).address}catch(e){}try{return _se.p2wpkh({output:e,network:t}).address}catch(e){}try{return _se.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(use.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){var i,o;t=t||Jae.bitcoin;try{i=n(e)}catch(e){}if(i){if(i.version===t.pubKeyHash)return _se.p2pkh({hash:i.hash}).output;if(i.version===t.scriptHash)return _se.p2sh({hash:i.hash}).output}else{try{o=r(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return _se.p2wpkh({hash:o.data}).output;if(32===o.data.length)return _se.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}));PY(Nse),Nse.fromBase58Check,Nse.fromBech32,Nse.toBase58Check,Nse.toBech32,Nse.fromOutputScript,Nse.toOutputScript;var Dse=UY((function(e){var t=65536,n=i9.Buffer,r=FY.crypto||FY.msCrypto;r&&r.getRandomValues?e.exports=function(e,i){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=n.allocUnsafe(e);if(e>0)if(e>t)for(var a=0;a<e;a+=t)r.getRandomValues(o.slice(a,a+t));else r.getRandomValues(o);return"function"==typeof i?ZX((function(){i(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}})),Fse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Hae.maybe(Hae.compile({compressed:Xae.maybe(Xae.Boolean),network:Xae.maybe(Xae.Network)})),r=function(){function e(t,n,r){s(this,e),this.__D=t,this.__Q=n,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||Jae.bitcoin,void 0!==n&&(this.__Q=iae.pointCompress(n,this.compressed))}return l(e,[{key:"privateKey",get:function(){return this.__D}},{key:"publicKey",get:function(){return this.__Q||(this.__Q=iae.pointFromScalar(this.__D,this.compressed)),this.__Q}},{key:"toWIF",value:function(){if(!this.__D)throw new Error("Missing private key");return qae(this.network.wif,this.__D,this.compressed)}},{key:"sign",value:function(e,t){if(!this.__D)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return iae.sign(e,this.__D);for(var n=iae.sign(e,this.__D),r=nX.alloc(32,0),i=0;n[0]>127;)i++,r.writeUIntLE(i,0,6),n=iae.signWithEntropy(e,this.__D,r);return n}},{key:"verify",value:function(e,t){return iae.verify(e,this.publicKey,t)}}]),e}();function i(e,t){if(Hae(Xae.Buffer256bit,e),!iae.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return Hae(n,t),new r(e,void 0,t)}t.fromPrivateKey=i,t.fromPublicKey=function(e,t){return Hae(iae.isPoint,e),Hae(n,t),new r(void 0,e,t)},t.fromWIF=function(e,t){var n=Gae(e),r=n.version;if(Xae.Array(t)){if(!(t=t.filter((function(e){return r===e.wif})).pop()))throw new Error("Unknown network version")}else if(t=t||Jae.bitcoin,r!==t.wif)throw new Error("Invalid network version");return i(n.privateKey,{compressed:n.compressed,network:t})},t.makeRandom=function(e){Hae(n,e),void 0===e&&(e={});var t,r=e.rng||Dse;do{t=r(32),Hae(Xae.Buffer256bit,t)}while(!iae.isPrivate(t));return i(t,e)}}));PY(Fse),Fse.fromPrivateKey,Fse.fromPublicKey,Fse.fromWIF,Fse.makeRandom;var Pse=i9.Buffer;function Use(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function Lse(e){return Use(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var Mse={encode:function e(t,n,r){if(Use(t),n||(n=Pse.allocUnsafe(Lse(t))),!Pse.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");return r||(r=0),t<253?(n.writeUInt8(t,r),e.bytes=1):t<=65535?(n.writeUInt8(253,r),n.writeUInt16LE(t,r+1),e.bytes=3):t<=4294967295?(n.writeUInt8(254,r),n.writeUInt32LE(t,r+1),e.bytes=5):(n.writeUInt8(255,r),n.writeUInt32LE(t>>>0,r+1),n.writeUInt32LE(t/4294967296|0,r+5),e.bytes=9),n},decode:function e(t,n){if(!Pse.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);var r=t.readUInt8(n);if(r<253)return e.bytes=1,r;if(253===r)return e.bytes=3,t.readUInt16LE(n+1);if(254===r)return e.bytes=5,t.readUInt32LE(n+1);e.bytes=9;var i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return Use(o),o},encodingLength:Lse},Tse=UY((function(e,t){function n(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function r(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return n((i*=4294967296)+r,9007199254740991),i+r}function i(e,t,r){return n(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}Object.defineProperty(t,"__esModule",{value:!0}),t.readUInt64LE=r,t.writeUInt64LE=i,t.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},t.cloneBuffer=function(e){var t=nX.allocUnsafe(e.length);return e.copy(t),t},t.BufferWriter=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,Hae(Xae.tuple(Xae.Buffer,Xae.UInt32),[t,n])}return l(e,[{key:"writeUInt8",value:function(e){this.offset=this.buffer.writeUInt8(e,this.offset)}},{key:"writeInt32",value:function(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}},{key:"writeUInt32",value:function(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}},{key:"writeUInt64",value:function(e){this.offset=i(this.buffer,e,this.offset)}},{key:"writeVarInt",value:function(e){Mse.encode(e,this.buffer,this.offset),this.offset+=Mse.encode.bytes}},{key:"writeSlice",value:function(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}},{key:"writeVarSlice",value:function(e){this.writeVarInt(e.length),this.writeSlice(e)}},{key:"writeVector",value:function(e){var t=this;this.writeVarInt(e.length),e.forEach((function(e){return t.writeVarSlice(e)}))}}]),e}(),t.BufferReader=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,Hae(Xae.tuple(Xae.Buffer,Xae.UInt32),[t,n])}return l(e,[{key:"readUInt8",value:function(){var e=this.buffer.readUInt8(this.offset);return this.offset++,e}},{key:"readInt32",value:function(){var e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt32",value:function(){var e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt64",value:function(){var e=r(this.buffer,this.offset);return this.offset+=8,e}},{key:"readVarInt",value:function(){var e=Mse.decode(this.buffer,this.offset);return this.offset+=Mse.decode.bytes,e}},{key:"readSlice",value:function(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readVarSlice",value:function(){return this.readSlice(this.readVarInt())}},{key:"readVector",value:function(){for(var e=this.readVarInt(),t=[],n=0;n<e;n++)t.push(this.readVarSlice());return t}}]),e}()}));PY(Tse),Tse.readUInt64LE,Tse.writeUInt64LE,Tse.reverseBuffer,Tse.cloneBuffer,Tse.BufferWriter,Tse.BufferReader;var Rse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=e.length;return Mse.encodingLength(t)+t}var i=nX.allocUnsafe(0),o=[],a=nX.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),u=nX.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),A=nX.from("ffffffffffffffff","hex"),c={script:i,valueBuffer:A},h=function(){function e(){s(this,e),this.version=1,this.locktime=0,this.ins=[],this.outs=[]}return l(e,[{key:"isCoinbase",value:function(){return 1===this.ins.length&&e.isCoinbaseHash(this.ins[0].hash)}},{key:"addInput",value:function(t,n,r,a){return Hae(Xae.tuple(Xae.Hash256bit,Xae.UInt32,Xae.maybe(Xae.UInt32),Xae.maybe(Xae.Buffer)),arguments),Xae.Null(r)&&(r=e.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:n,script:a||i,sequence:r,witness:o})-1}},{key:"addOutput",value:function(e,t){return Hae(Xae.tuple(Xae.Buffer,Xae.Satoshi),arguments),this.outs.push({script:e,value:t})-1}},{key:"hasWitnesses",value:function(){return this.ins.some((function(e){return 0!==e.witness.length}))}},{key:"weight",value:function(){return 3*this.byteLength(!1)+this.byteLength(!0)}},{key:"virtualSize",value:function(){return Math.ceil(this.weight()/4)}},{key:"byteLength",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e&&this.hasWitnesses();return(t?10:8)+Mse.encodingLength(this.ins.length)+Mse.encodingLength(this.outs.length)+this.ins.reduce((function(e,t){return e+40+r(t.script)}),0)+this.outs.reduce((function(e,t){return e+8+r(t.script)}),0)+(t?this.ins.reduce((function(e,t){return e+function(e){var t=e.length;return Mse.encodingLength(t)+e.reduce((function(e,t){return e+r(t)}),0)}(t.witness)}),0):0)}},{key:"clone",value:function(){var t=new e;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map((function(e){return{hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}})),t.outs=this.outs.map((function(e){return{script:e.script,value:e.value}})),t}},{key:"hashForSignature",value:function(t,r,o){if(Hae(Xae.tuple(Xae.UInt32,Xae.Buffer,Xae.Number),arguments),t>=this.ins.length)return u;var a=use.compile(use.decompile(r).filter((function(e){return e!==n.OPS.OP_CODESEPARATOR}))),s=this.clone();if((31&o)===e.SIGHASH_NONE)s.outs=[],s.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}));else if((31&o)===e.SIGHASH_SINGLE){if(t>=this.outs.length)return u;s.outs.length=t+1;for(var l=0;l<t;l++)s.outs[l]=c;s.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}))}o&e.SIGHASH_ANYONECANPAY?(s.ins=[s.ins[t]],s.ins[0].script=a):(s.ins.forEach((function(e){e.script=i})),s.ins[t].script=a);var A=nX.allocUnsafe(s.byteLength(!1)+4);return A.writeInt32LE(o,A.length-4),s.__toBuffer(A,0,!1),fse.hash256(A)}},{key:"hashForWitnessV0",value:function(t,n,i,o){Hae(Xae.tuple(Xae.UInt32,Xae.Buffer,Xae.Satoshi,Xae.UInt32),arguments);var s,u=nX.from([]),l=a,A=a,c=a;if(o&e.SIGHASH_ANYONECANPAY||(u=nX.allocUnsafe(36*this.ins.length),s=new Tse.BufferWriter(u,0),this.ins.forEach((function(e){s.writeSlice(e.hash),s.writeUInt32(e.index)})),A=fse.hash256(u)),o&e.SIGHASH_ANYONECANPAY||(31&o)===e.SIGHASH_SINGLE||(31&o)===e.SIGHASH_NONE||(u=nX.allocUnsafe(4*this.ins.length),s=new Tse.BufferWriter(u,0),this.ins.forEach((function(e){s.writeUInt32(e.sequence)})),c=fse.hash256(u)),(31&o)!==e.SIGHASH_SINGLE&&(31&o)!==e.SIGHASH_NONE){var h=this.outs.reduce((function(e,t){return e+8+r(t.script)}),0);u=nX.allocUnsafe(h),s=new Tse.BufferWriter(u,0),this.outs.forEach((function(e){s.writeUInt64(e.value),s.writeVarSlice(e.script)})),l=fse.hash256(u)}else if((31&o)===e.SIGHASH_SINGLE&&t<this.outs.length){var f=this.outs[t];u=nX.allocUnsafe(8+r(f.script)),(s=new Tse.BufferWriter(u,0)).writeUInt64(f.value),s.writeVarSlice(f.script),l=fse.hash256(u)}u=nX.allocUnsafe(156+r(n)),s=new Tse.BufferWriter(u,0);var d=this.ins[t];return s.writeUInt32(this.version),s.writeSlice(A),s.writeSlice(c),s.writeSlice(d.hash),s.writeUInt32(d.index),s.writeVarSlice(n),s.writeUInt64(i),s.writeUInt32(d.sequence),s.writeSlice(l),s.writeUInt32(this.locktime),s.writeUInt32(o),fse.hash256(u)}},{key:"getHash",value:function(e){return e&&this.isCoinbase()?nX.alloc(32,0):fse.hash256(this.__toBuffer(void 0,void 0,e))}},{key:"getId",value:function(){return Tse.reverseBuffer(this.getHash(!1)).toString("hex")}},{key:"toBuffer",value:function(e,t){return this.__toBuffer(e,t,!0)}},{key:"toHex",value:function(){return this.toBuffer(void 0,void 0).toString("hex")}},{key:"setInputScript",value:function(e,t){Hae(Xae.tuple(Xae.Number,Xae.Buffer),arguments),this.ins[e].script=t}},{key:"setWitness",value:function(e,t){Hae(Xae.tuple(Xae.Number,[Xae.Buffer]),arguments),this.ins[e].witness=t}},{key:"__toBuffer",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=nX.allocUnsafe(this.byteLength(r)));var i=new Tse.BufferWriter(t,n||0);i.writeInt32(this.version);var o=r&&this.hasWitnesses();return o&&(i.writeUInt8(e.ADVANCED_TRANSACTION_MARKER),i.writeUInt8(e.ADVANCED_TRANSACTION_FLAG)),i.writeVarInt(this.ins.length),this.ins.forEach((function(e){i.writeSlice(e.hash),i.writeUInt32(e.index),i.writeVarSlice(e.script),i.writeUInt32(e.sequence)})),i.writeVarInt(this.outs.length),this.outs.forEach((function(e){void 0!==e.value?i.writeUInt64(e.value):i.writeSlice(e.valueBuffer),i.writeVarSlice(e.script)})),o&&this.ins.forEach((function(e){i.writeVector(e.witness)})),i.writeUInt32(this.locktime),void 0!==n?t.slice(n,i.offset):t}}],[{key:"fromBuffer",value:function(t,n){var r=new Tse.BufferReader(t),i=new e;i.version=r.readInt32();var a=r.readUInt8(),s=r.readUInt8(),u=!1;a===e.ADVANCED_TRANSACTION_MARKER&&s===e.ADVANCED_TRANSACTION_FLAG?u=!0:r.offset-=2;for(var l=r.readVarInt(),A=0;A<l;++A)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:o});for(var c=r.readVarInt(),h=0;h<c;++h)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(u){for(var f=0;f<l;++f)i.ins[f].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),n)return i;if(r.offset!==t.length)throw new Error("Transaction has unexpected data");return i}},{key:"fromHex",value:function(t){return e.fromBuffer(nX.from(t,"hex"),!1)}},{key:"isCoinbaseHash",value:function(e){Hae(Xae.Hash256bit,e);for(var t=0;t<32;++t)if(0!==e[t])return!1;return!0}}]),e}();h.DEFAULT_SEQUENCE=4294967295,h.SIGHASH_ALL=1,h.SIGHASH_NONE=2,h.SIGHASH_SINGLE=3,h.SIGHASH_ANYONECANPAY=128,h.ADVANCED_TRANSACTION_MARKER=0,h.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=h}));PY(Rse),Rse.Transaction;var Ose=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=new TypeError("Cannot compute merkle root for zero transactions"),r=new TypeError("Cannot compute witness commit for non-segwit block"),o=function(){function e(){s(this,e),this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}return l(e,[{key:"getWitnessCommit",value:function(){if(!a(this.transactions))return null;var e=this.transactions[0].outs.filter((function(e){return e.script.slice(0,6).equals(nX.from("6a24aa21a9ed","hex"))})).map((function(e){return e.script.slice(6,38)}));if(0===e.length)return null;var t=e[e.length-1];return t instanceof nX&&32===t.length?t:null}},{key:"hasWitnessCommit",value:function(){return this.witnessCommit instanceof nX&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}},{key:"hasWitness",value:function(){return(e=this.transactions)instanceof Array&&e.some((function(e){return"object"==i(e)&&e.ins instanceof Array&&e.ins.some((function(e){return"object"==i(e)&&e.witness instanceof Array&&e.witness.length>0}))}));var e}},{key:"weight",value:function(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}},{key:"byteLength",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e||!this.transactions?80:80+Mse.encodingLength(this.transactions.length)+this.transactions.reduce((function(e,n){return e+n.byteLength(t)}),0)}},{key:"getHash",value:function(){return fse.hash256(this.toBuffer(!0))}},{key:"getId",value:function(){return Tse.reverseBuffer(this.getHash()).toString("hex")}},{key:"getUTCDate",value:function(){var e=new Date(0);return e.setUTCSeconds(this.timestamp),e}},{key:"toBuffer",value:function(e){var t=nX.allocUnsafe(this.byteLength(e)),n=new Tse.BufferWriter(t);return n.writeInt32(this.version),n.writeSlice(this.prevHash),n.writeSlice(this.merkleRoot),n.writeUInt32(this.timestamp),n.writeUInt32(this.bits),n.writeUInt32(this.nonce),e||!this.transactions||(Mse.encode(this.transactions.length,t,n.offset),n.offset+=Mse.encode.bytes,this.transactions.forEach((function(e){var r=e.byteLength();e.toBuffer(t,n.offset),n.offset+=r}))),t}},{key:"toHex",value:function(e){return this.toBuffer(e).toString("hex")}},{key:"checkTxRoots",value:function(){var e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}},{key:"checkProofOfWork",value:function(){var t=Tse.reverseBuffer(this.getHash()),n=e.calculateTarget(this.bits);return t.compare(n)<=0}},{key:"__checkMerkleRoot",value:function(){if(!this.transactions)throw n;var t=e.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(t)}},{key:"__checkWitnessCommit",value:function(){if(!this.transactions)throw n;if(!this.hasWitnessCommit())throw r;var t=e.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(t)}}],[{key:"fromBuffer",value:function(t){if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");var n=new Tse.BufferReader(t),r=new e;if(r.version=n.readInt32(),r.prevHash=n.readSlice(32),r.merkleRoot=n.readSlice(32),r.timestamp=n.readUInt32(),r.bits=n.readUInt32(),r.nonce=n.readUInt32(),80===t.length)return r;var i=function(){var e=Rse.Transaction.fromBuffer(n.buffer.slice(n.offset),!0);return n.offset+=e.byteLength(),e},o=n.readVarInt();r.transactions=[];for(var a=0;a<o;++a){var s=i();r.transactions.push(s)}var u=r.getWitnessCommit();return u&&(r.witnessCommit=u),r}},{key:"fromHex",value:function(t){return e.fromBuffer(nX.from(t,"hex"))}},{key:"calculateTarget",value:function(e){var t=((4278190080&e)>>24)-3,n=8388607&e,r=nX.alloc(32,0);return r.writeUIntBE(n,29-t,3),r}},{key:"calculateMerkleRoot",value:function(e,t){if(Hae([{getHash:Xae.Function}],e),0===e.length)throw n;if(t&&!a(e))throw r;var i=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var n=e.length,r=e.concat();n>1;){for(var i=0,o=0;o<n;o+=2,++i){var a=r[o],s=o+1===n?a:r[o+1],u=nX.concat([a,s]);r[i]=t(u)}n=i}return r[0]}(e.map((function(e){return e.getHash(t)})),fse.hash256);return t?fse.hash256(nX.concat([i,e[0].ins[0].witness[0]])):i}}]),e}();function a(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=o}));PY(Ose),Ose.Block;var Hse=UY((function(e,t){var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.GlobalTypes||(t.GlobalTypes={}))[n.UNSIGNED_TX=0]="UNSIGNED_TX",n[n.GLOBAL_XPUB=1]="GLOBAL_XPUB",t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(r=t.InputTypes||(t.InputTypes={}))[r.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",r[r.WITNESS_UTXO=1]="WITNESS_UTXO",r[r.PARTIAL_SIG=2]="PARTIAL_SIG",r[r.SIGHASH_TYPE=3]="SIGHASH_TYPE",r[r.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",r[r.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",r[r.BIP32_DERIVATION=6]="BIP32_DERIVATION",r[r.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",r[r.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",r[r.POR_COMMITMENT=9]="POR_COMMITMENT",t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],(i=t.OutputTypes||(t.OutputTypes={}))[i.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",i[i.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",i[i.BIP32_DERIVATION=2]="BIP32_DERIVATION",t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]}));PY(Hse),Hse.GlobalTypes,Hse.GLOBAL_TYPE_NAMES,Hse.InputTypes,Hse.INPUT_TYPE_NAMES,Hse.OutputTypes,Hse.OUTPUT_TYPE_NAMES;var Kse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");var t,n=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:n,path:"m"},i=F(function(e){return k(Array(e).keys())}(e.value.length/4-1));try{for(i.s();!(t=i.n()).done;){var o=t.value,a=e.value.readUInt32LE(4*o+4),s=!!(2147483648&a),u=2147483647&a;r.path+="/"+u.toString(10)+(s?"'":"")}}catch(e){i.e(e)}finally{i.f()}return r},t.encode=function(e){var t=nX.from([Hse.GlobalTypes.GLOBAL_XPUB]),n=nX.concat([t,e.extendedPubkey]),r=e.path.split("/"),i=nX.allocUnsafe(4*r.length);e.masterFingerprint.copy(i,0);var o=4;return r.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),i.writeUInt32LE(n,o),o+=4})),{key:n,value:i}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(e){var t=e.extendedPubkey,n=e.masterFingerprint,r=e.path;return TX(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&TX(n)&&4===n.length&&"string"==typeof r&&!!r.match(/^m(\/\d+'?)+$/)},t.canAddToArray=function(e,t,n){var r=t.extendedPubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.extendedPubkey.equals(t.extendedPubkey)})).length)}}));PY(Kse),Kse.decode,Kse.encode,Kse.expected,Kse.check,Kse.canAddToArray;var jse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function(e){return{key:nX.from([Hse.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}}}));PY(jse),jse.encode;var Gse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:nX.from([Hse.InputTypes.FINAL_SCRIPTSIG]),value:e}},t.expected="Buffer",t.check=function(e){return TX(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}));PY(Gse),Gse.decode,Gse.encode,Gse.expected,Gse.check,Gse.canAdd;var qse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:nX.from([Hse.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},t.expected="Buffer",t.check=function(e){return TX(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}));PY(qse),qse.decode,qse.encode,qse.expected,qse.check,qse.canAdd;var Vse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:nX.from([Hse.InputTypes.NON_WITNESS_UTXO]),value:e}},t.expected="Buffer",t.check=function(e){return TX(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}}));PY(Vse),Vse.decode,Vse.encode,Vse.expected,Vse.check,Vse.canAdd;var zse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(e){var t=nX.from([Hse.InputTypes.PARTIAL_SIG]);return{key:nX.concat([t,e.pubkey]),value:e.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(e){return TX(e.pubkey)&&TX(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!TX(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;var t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;var n=e[3+t+2];return!(n>33||n<1)&&e.length===3+t+2+n+2}(e.signature)},t.canAddToArray=function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)}}));PY(zse),zse.decode,zse.encode,zse.expected,zse.check,zse.canAddToArray;var Jse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(e){return{key:nX.from([Hse.InputTypes.POR_COMMITMENT]),value:nX.from(e,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}));PY(Jse),Jse.decode,Jse.encode,Jse.expected,Jse.check,Jse.canAdd;var Yse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(e){var t=nX.from([Hse.InputTypes.SIGHASH_TYPE]),n=nX.allocUnsafe(4);return n.writeUInt32LE(e,0),{key:t,value:n}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}));PY(Yse),Yse.decode,Yse.encode,Yse.expected,Yse.check,Yse.canAdd;var Xse=UY((function(e,t){function n(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function r(e){return n(e),e<253?1:e<=65535?3:e<=4294967295?5:9}Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function e(t,i,o){if(n(t),i||(i=nX.allocUnsafe(r(t))),!TX(i))throw new TypeError("buffer must be a Buffer instance");return o||(o=0),t<253?(i.writeUInt8(t,o),Object.assign(e,{bytes:1})):t<=65535?(i.writeUInt8(253,o),i.writeUInt16LE(t,o+1),Object.assign(e,{bytes:3})):t<=4294967295?(i.writeUInt8(254,o),i.writeUInt32LE(t,o+1),Object.assign(e,{bytes:5})):(i.writeUInt8(255,o),i.writeUInt32LE(t>>>0,o+1),i.writeUInt32LE(t/4294967296|0,o+5),Object.assign(e,{bytes:9})),i},t.decode=function e(t,r){if(!TX(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=t.readUInt8(r);if(i<253)return Object.assign(e,{bytes:1}),i;if(253===i)return Object.assign(e,{bytes:3}),t.readUInt16LE(r+1);if(254===i)return Object.assign(e,{bytes:5}),t.readUInt32LE(r+1);Object.assign(e,{bytes:9});var o=t.readUInt32LE(r+1),a=4294967296*t.readUInt32LE(r+5)+o;return n(a),a},t.encodingLength=r}));PY(Xse),Xse.encode,Xse.decode,Xse.encodingLength;var Wse=UY((function(e,t){function n(e){var t=e.key.length,n=e.value.length,r=Xse.encodingLength(t),i=Xse.encodingLength(n),o=nX.allocUnsafe(r+t+i+n);return Xse.encode(t,o,0),e.key.copy(o,r),Xse.encode(n,o,r+t),e.value.copy(o,r+t+i),o}function r(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}Object.defineProperty(t,"__esModule",{value:!0}),t.range=function(e){return k(Array(e).keys())},t.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},t.keyValsToBuffer=function(e){var t=e.map(n);return t.push(nX.from([0])),nX.concat(t)},t.keyValToBuffer=n,t.readUInt64LE=function(e,t){var n=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return r((i*=4294967296)+n,9007199254740991),i+n},t.writeUInt64LE=function(e,t,n){return r(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}}));PY(Wse),Wse.range,Wse.reverseBuffer,Wse.keyValsToBuffer,Wse.keyValToBuffer,Wse.readUInt64LE,Wse.writeUInt64LE;var Zse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));var t=Wse.readUInt64LE(e.value,0),n=8,r=Xse.decode(e.value,n);n+=Xse.encodingLength(r);var i=e.value.slice(n);if(i.length!==r)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},t.encode=function(e){var t=e.script,n=e.value,r=Xse.encodingLength(t.length),i=nX.allocUnsafe(8+r+t.length);return Wse.writeUInt64LE(i,n,0),Xse.encode(t.length,i,8),t.copy(i,8+r),{key:nX.from([Hse.InputTypes.WITNESS_UTXO]),value:i}},t.expected="{ script: Buffer; value: number; }",t.check=function(e){return TX(e.script)&&"number"==typeof e.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}}));PY(Zse),Zse.decode,Zse.encode,Zse.expected,Zse.check,Zse.canAdd;var $se=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");var n,r=t.key.slice(1),i={masterFingerprint:t.value.slice(0,4),pubkey:r,path:"m"},o=F(function(e){return k(Array(e).keys())}(t.value.length/4-1));try{for(o.s();!(n=o.n()).done;){var a=n.value,s=t.value.readUInt32LE(4*a+4),u=!!(2147483648&s),l=2147483647&s;i.path+="/"+l.toString(10)+(u?"'":"")}}catch(e){o.e(e)}finally{o.f()}return i},encode:function(t){var n=nX.from([e]),r=nX.concat([n,t.pubkey]),i=t.path.split("/"),o=nX.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);var a=4;return i.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),o.writeUInt32LE(n,a),a+=4})),{key:r,value:o}},check:function(e){return TX(e.pubkey)&&TX(e.masterFingerprint)&&"string"==typeof e.path&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)}}}}));PY($se),$se.makeConverter;var eue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){var n;if(e.includes(t.key[0])&&(33!==(n=t.key.slice(1)).length&&65!==n.length||![2,3,4].includes(n[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return n}}}));PY(eue),eue.makeChecker;var tue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:nX.from([e]),value:t}},check:function(e){return TX(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}));PY(tue),tue.makeConverter;var nue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:nX.from([e]),value:t}},check:function(e){return TX(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}));PY(nue),nue.makeConverter;var rue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={unsignedTx:jse,globalXpub:Kse,checkPubkey:eue.makeChecker([])};t.globals=n;var r={nonWitnessUtxo:Vse,partialSig:zse,sighashType:Yse,finalScriptSig:Gse,finalScriptWitness:qse,porCommitment:Jse,witnessUtxo:Zse,bip32Derivation:$se.makeConverter(Hse.InputTypes.BIP32_DERIVATION),redeemScript:tue.makeConverter(Hse.InputTypes.REDEEM_SCRIPT),witnessScript:nue.makeConverter(Hse.InputTypes.WITNESS_SCRIPT),checkPubkey:eue.makeChecker([Hse.InputTypes.PARTIAL_SIG,Hse.InputTypes.BIP32_DERIVATION])};t.inputs=r;var i={bip32Derivation:$se.makeConverter(Hse.OutputTypes.BIP32_DERIVATION),redeemScript:tue.makeConverter(Hse.OutputTypes.REDEEM_SCRIPT),witnessScript:nue.makeConverter(Hse.OutputTypes.WITNESS_SCRIPT),checkPubkey:eue.makeChecker([Hse.OutputTypes.BIP32_DERIVATION])};t.outputs=i}));PY(rue),rue.globals,rue.inputs,rue.outputs;var iue=UY((function(e,t){function n(e,t,n){if(!t.equals(nX.from([n])))throw new Error("Format Error: Invalid ".concat(e," key: ").concat(t.toString("hex")))}function r(e,t){var r,i=t.globalMapKeyVals,o=t.inputKeyVals,a=t.outputKeyVals,s={unsignedTx:e},u=0,l=F(i);try{for(l.s();!(r=l.n()).done;){var A=r.value;switch(A.key[0]){case Hse.GlobalTypes.UNSIGNED_TX:if(n("global",A.key,Hse.GlobalTypes.UNSIGNED_TX),u>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");u++;break;case Hse.GlobalTypes.GLOBAL_XPUB:void 0===s.globalXpub&&(s.globalXpub=[]),s.globalXpub.push(rue.globals.globalXpub.decode(A));break;default:s.unknownKeyVals||(s.unknownKeyVals=[]),s.unknownKeyVals.push(A)}}}catch(e){l.e(e)}finally{l.f()}var c,h=o.length,f=a.length,d=[],p=[],g=F(Wse.range(h));try{for(g.s();!(c=g.n()).done;){var v,y=c.value,m={},w=F(o[y]);try{for(w.s();!(v=w.n()).done;){var b=v.value;switch(rue.inputs.checkPubkey(b),b.key[0]){case Hse.InputTypes.NON_WITNESS_UTXO:if(n("input",b.key,Hse.InputTypes.NON_WITNESS_UTXO),void 0!==m.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");m.nonWitnessUtxo=rue.inputs.nonWitnessUtxo.decode(b);break;case Hse.InputTypes.WITNESS_UTXO:if(n("input",b.key,Hse.InputTypes.WITNESS_UTXO),void 0!==m.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");m.witnessUtxo=rue.inputs.witnessUtxo.decode(b);break;case Hse.InputTypes.PARTIAL_SIG:void 0===m.partialSig&&(m.partialSig=[]),m.partialSig.push(rue.inputs.partialSig.decode(b));break;case Hse.InputTypes.SIGHASH_TYPE:if(n("input",b.key,Hse.InputTypes.SIGHASH_TYPE),void 0!==m.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");m.sighashType=rue.inputs.sighashType.decode(b);break;case Hse.InputTypes.REDEEM_SCRIPT:if(n("input",b.key,Hse.InputTypes.REDEEM_SCRIPT),void 0!==m.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");m.redeemScript=rue.inputs.redeemScript.decode(b);break;case Hse.InputTypes.WITNESS_SCRIPT:if(n("input",b.key,Hse.InputTypes.WITNESS_SCRIPT),void 0!==m.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");m.witnessScript=rue.inputs.witnessScript.decode(b);break;case Hse.InputTypes.BIP32_DERIVATION:void 0===m.bip32Derivation&&(m.bip32Derivation=[]),m.bip32Derivation.push(rue.inputs.bip32Derivation.decode(b));break;case Hse.InputTypes.FINAL_SCRIPTSIG:n("input",b.key,Hse.InputTypes.FINAL_SCRIPTSIG),m.finalScriptSig=rue.inputs.finalScriptSig.decode(b);break;case Hse.InputTypes.FINAL_SCRIPTWITNESS:n("input",b.key,Hse.InputTypes.FINAL_SCRIPTWITNESS),m.finalScriptWitness=rue.inputs.finalScriptWitness.decode(b);break;case Hse.InputTypes.POR_COMMITMENT:n("input",b.key,Hse.InputTypes.POR_COMMITMENT),m.porCommitment=rue.inputs.porCommitment.decode(b);break;default:m.unknownKeyVals||(m.unknownKeyVals=[]),m.unknownKeyVals.push(b)}}}catch(e){w.e(e)}finally{w.f()}d.push(m)}}catch(e){g.e(e)}finally{g.f()}var I,B=F(Wse.range(f));try{for(B.s();!(I=B.n()).done;){var E,C=I.value,x={},k=F(a[C]);try{for(k.s();!(E=k.n()).done;){var S=E.value;switch(rue.outputs.checkPubkey(S),S.key[0]){case Hse.OutputTypes.REDEEM_SCRIPT:if(n("output",S.key,Hse.OutputTypes.REDEEM_SCRIPT),void 0!==x.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");x.redeemScript=rue.outputs.redeemScript.decode(S);break;case Hse.OutputTypes.WITNESS_SCRIPT:if(n("output",S.key,Hse.OutputTypes.WITNESS_SCRIPT),void 0!==x.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");x.witnessScript=rue.outputs.witnessScript.decode(S);break;case Hse.OutputTypes.BIP32_DERIVATION:void 0===x.bip32Derivation&&(x.bip32Derivation=[]),x.bip32Derivation.push(rue.outputs.bip32Derivation.decode(S));break;default:x.unknownKeyVals||(x.unknownKeyVals=[]),x.unknownKeyVals.push(S)}}}catch(e){k.e(e)}finally{k.f()}p.push(x)}}catch(e){B.e(e)}finally{B.f()}return{globalMap:s,inputs:d,outputs:p}}Object.defineProperty(t,"__esModule",{value:!0}),t.psbtFromBuffer=function(e,t){var n=0;function i(){var t=Xse.decode(e,n);n+=Xse.encodingLength(t);var r=e.slice(n,n+t);return n+=t,r}function o(){return{key:i(),value:i()}}function a(){if(n>=e.length)throw new Error("Format Error: Unexpected End of PSBT");var t=0===e.readUInt8(n);return t&&n++,t}if(1886610036!==function(){var t=e.readUInt32BE(n);return n+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){var t=e.readUInt8(n);return n+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");for(var s=[],u={};!a();){var l=o(),A=l.key.toString("hex");if(u[A])throw new Error("Format Error: Keys must be unique for global keymap: key "+A);u[A]=1,s.push(l)}var c=s.filter((function(e){return e.key[0]===Hse.GlobalTypes.UNSIGNED_TX}));if(1!==c.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");var h,f=t(c[0].value),d=f.getInputOutputCounts(),p=d.inputCount,g=d.outputCount,v=[],y=[],m=F(Wse.range(p));try{for(m.s();!(h=m.n()).done;){for(var w=h.value,b={},I=[];!a();){var B=o(),E=B.key.toString("hex");if(b[E])throw new Error("Format Error: Keys must be unique for each input: input index "+w+" key "+E);b[E]=1,I.push(B)}v.push(I)}}catch(e){m.e(e)}finally{m.f()}var C,x=F(Wse.range(g));try{for(x.s();!(C=x.n()).done;){for(var k=C.value,S={},Q=[];!a();){var _=o(),N=_.key.toString("hex");if(S[N])throw new Error("Format Error: Keys must be unique for each output: output index "+k+" key "+N);S[N]=1,Q.push(_)}y.push(Q)}}catch(e){x.e(e)}finally{x.f()}return r(f,{globalMapKeyVals:s,inputKeyVals:v,outputKeyVals:y})},t.checkKeyBuffer=n,t.psbtFromKeyVals=r}));PY(iue),iue.psbtFromBuffer,iue.checkKeyBuffer,iue.psbtFromKeyVals;var oue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.psbtToBuffer=function(e){var t=i({globalMap:e.globalMap,inputs:e.inputs,outputs:e.outputs}),n=t.globalKeyVals,r=t.inputKeyVals,o=t.outputKeyVals,a=Wse.keyValsToBuffer(n),s=function(e){return 0===e.length?[nX.from([0])]:e.map(Wse.keyValsToBuffer)},u=s(r),l=s(o),A=nX.allocUnsafe(5);return A.writeUIntBE(482972169471,0,5),nX.concat([A,a].concat(u,l))};var n=function(e,t){return e.key.compare(t.key)};function r(e,t){var r=new Set,i=Object.entries(e).reduce((function(e,n){var i=C(n,2),o=i[0],a=i[1];if("unknownKeyVals"===o)return e;var s=t[o];if(void 0===s)return e;var u=(Array.isArray(a)?a:[a]).map(s.encode);return u.map((function(e){return e.key.toString("hex")})).forEach((function(e){if(r.has(e))throw new Error("Serialize Error: Duplicate key: "+e);r.add(e)})),e.concat(u)}),[]),o=e.unknownKeyVals?e.unknownKeyVals.filter((function(e){return!r.has(e.key.toString("hex"))})):[];return i.concat(o).sort(n)}function i(e){var t=e.globalMap,n=e.inputs,i=e.outputs;return{globalKeyVals:r(t,rue.globals),inputKeyVals:n.map((function(e){return r(e,rue.inputs)})),outputKeyVals:i.map((function(e){return r(e,rue.outputs)}))}}t.psbtToKeyVals=i}));PY(oue),oue.psbtToBuffer,oue.psbtToKeyVals;var aue=UY((function(e,t){function n(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),n(iue),n(oue)}));PY(aue);var sue=UY((function(e,t){function n(e,t,n){return function(r){if(!e.has(r)){var i=n.filter((function(e){return e.key.toString("hex")===r}))[0];t.push(i),e.add(r)}}}function r(e){return e.globalMap.unsignedTx}function i(e){var t=new Set;return e.forEach((function(e){var n=e.key.toString("hex");if(t.has(n))throw new Error("Combine: KeyValue Map keys should be unique");t.add(n)})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.combine=function(e){var t=e[0],o=aue.psbtToKeyVals(t),a=e.slice(1);if(0===a.length)throw new Error("Combine: Nothing to combine");var s=r(t);if(void 0===s)throw new Error("Combine: Self missing transaction");var u,l=i(o.globalKeyVals),A=o.inputKeyVals.map(i),c=o.outputKeyVals.map(i),h=F(a);try{var f=function(){var e=u.value,t=r(e);if(void 0===t||!t.toBuffer().equals(s.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");var a=aue.psbtToKeyVals(e);i(a.globalKeyVals).forEach(n(l,o.globalKeyVals,a.globalKeyVals)),a.inputKeyVals.map(i).forEach((function(e,t){return e.forEach(n(A[t],o.inputKeyVals[t],a.inputKeyVals[t]))})),a.outputKeyVals.map(i).forEach((function(e,t){return e.forEach(n(c[t],o.outputKeyVals[t],a.outputKeyVals[t]))}))};for(h.s();!(u=h.n()).done;)f()}catch(e){h.e(e)}finally{h.f()}return aue.psbtFromKeyVals(s,{globalMapKeyVals:o.globalKeyVals,inputKeyVals:o.inputKeyVals,outputKeyVals:o.outputKeyVals})}}));PY(sue),sue.combine;var uue=UY((function(e,t){function n(e,t){var n=e[t];if(void 0===n)throw new Error("No input #".concat(t));return n}function r(e,t,n,r){throw new Error("Data for ".concat(e," key ").concat(t," is incorrect: Expected ").concat(n," and got ").concat(JSON.stringify(r)))}function i(e){return function(t,n){for(var i=function(){var i=a[o],s=t[i],u=rue[e+"s"][i]||{},l=u.canAdd,A=u.canAddToArray,c=u.check,h=u.expected;if(c)if(!!A){if(!Array.isArray(s)||n[i]&&!Array.isArray(n[i]))throw new Error("Key type ".concat(i," must be an array"));s.every(c)||r(e,i,h,s);var f=n[i]||[],d=new Set;if(!s.every((function(e){return A(f,e,d)})))throw new Error("Can not add duplicate data to array");n[i]=f.concat(s)}else{if(c(s)||r(e,i,h,s),!l(n,s))throw new Error("Can not add duplicate data to ".concat(e));n[i]=s}},o=0,a=Object.keys(t);o<a.length;o++)i()}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkForInput=n,t.checkForOutput=function(e,t){var n=e[t];if(void 0===n)throw new Error("No output #".concat(t));return n},t.checkHasKey=function(e,t,n){if(e.key[0]<n)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((function(t){return t.key.equals(e.key)})).length)throw new Error("Duplicate Key: ".concat(e.key.toString("hex")))},t.getEnumLength=function(e){var t=0;return Object.keys(e).forEach((function(e){Number(isNaN(Number(e)))&&t++})),t},t.inputCheckUncleanFinalized=function(e,t){var n=!1;if(t.nonWitnessUtxo||t.witnessUtxo){var r=!!t.redeemScript,i=!!t.witnessScript,o=!r||!!t.finalScriptSig,a=!i||!!t.finalScriptWitness,s=!!t.finalScriptSig||!!t.finalScriptWitness;n=o&&a&&s}if(!1===n)throw new Error("Input #".concat(e," has too much or too little data to clean"))},t.updateGlobal=i("global"),t.updateInput=i("input"),t.updateOutput=i("output"),t.addInputAttributes=function(e,r){var i=n(e,e.length-1);t.updateInput(r,i)},t.addOutputAttributes=function(e,r){var i=n(e,e.length-1);t.updateOutput(r,i)},t.defaultVersionSetter=function(e,t){if(!TX(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},t.defaultLocktimeSetter=function(e,t){if(!TX(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}));PY(uue),uue.checkForInput,uue.checkForOutput,uue.checkHasKey,uue.getEnumLength,uue.inputCheckUncleanFinalized,uue.updateGlobal,uue.updateInput,uue.updateOutput,uue.addInputAttributes,uue.addOutputAttributes,uue.defaultVersionSetter,uue.defaultLocktimeSetter;var lue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Psbt=function(){function e(t){s(this,e),this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:t}}return l(e,[{key:"toBase64",value:function(){return this.toBuffer().toString("base64")}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}},{key:"toBuffer",value:function(){return aue.psbtToBuffer(this)}},{key:"updateGlobal",value:function(e){return uue.updateGlobal(e,this.globalMap),this}},{key:"updateInput",value:function(e,t){var n=uue.checkForInput(this.inputs,e);return uue.updateInput(t,n),this}},{key:"updateOutput",value:function(e,t){var n=uue.checkForOutput(this.outputs,e);return uue.updateOutput(t,n),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return uue.checkHasKey(e,this.globalMap.unknownKeyVals,uue.getEnumLength(Hse.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){var n=uue.checkForInput(this.inputs,e);return uue.checkHasKey(t,n.unknownKeyVals,uue.getEnumLength(Hse.InputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){var n=uue.checkForOutput(this.outputs,e);return uue.checkHasKey(t,n.unknownKeyVals,uue.getEnumLength(Hse.OutputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addInput",value:function(e){var t=this;this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),uue.addInputAttributes(this.inputs,e),this}},{key:"addOutput",value:function(e){var t=this;this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),uue.addOutputAttributes(this.outputs,e),this}},{key:"clearFinalizedInput",value:function(e){var t=uue.checkForInput(this.inputs,e);uue.inputCheckUncleanFinalized(e,t);for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(i)||delete t[i]}return this}},{key:"combine",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=sue.combine([this].concat(t));return Object.assign(this,r),this}},{key:"getTransaction",value:function(){return this.globalMap.unsignedTx.toBuffer()}}],[{key:"fromBase64",value:function(e,t){var n=nX.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e,t){var n=nX.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(e,t){var n=aue.psbtFromBuffer(e,t),r=new this(n.globalMap.unsignedTx);return Object.assign(r,n),r}}]),e}()}));PY(lue),lue.Psbt;var Aue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={network:Jae.bitcoin,maximumFeeRate:5e3},r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new lue.Psbt(new o);s(this,e),this.data=r,this.opts=Object.assign({},n,t),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);var i=function(e,t,n,r){return Object.defineProperty(e,t,{enumerable:n,writable:r})};i(this,"__CACHE",!1,!0),i(this,"opts",!1,!0)}return l(e,[{key:"inputCount",get:function(){return this.data.inputs.length}},{key:"version",get:function(){return this.__CACHE.__TX.version},set:function(e){this.setVersion(e)}},{key:"locktime",get:function(){return this.__CACHE.__TX.locktime},set:function(e){this.setLocktime(e)}},{key:"txInputs",get:function(){return this.__CACHE.__TX.ins.map((function(e){return{hash:Tse.cloneBuffer(e.hash),index:e.index,sequence:e.sequence}}))}},{key:"txOutputs",get:function(){var e=this;return this.__CACHE.__TX.outs.map((function(t){var n;try{n=Nse.fromOutputScript(t.script,e.opts.network)}catch(t){}return{script:Tse.cloneBuffer(t.script),value:t.value,address:n}}))}},{key:"combine",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.data).combine.apply(e,k(n.map((function(e){return e.data})))),this}},{key:"clone",value:function(){var t=e.fromBuffer(this.data.toBuffer());return t.opts=JSON.parse(JSON.stringify(this.opts)),t}},{key:"setMaximumFeeRate",value:function(e){m(e),this.opts.maximumFeeRate=e}},{key:"setVersion",value:function(e){m(e),w(this.data.inputs,"setVersion");var t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}},{key:"setLocktime",value:function(e){m(e),w(this.data.inputs,"setLocktime");var t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}},{key:"setInputSequence",value:function(e,t){m(t),w(this.data.inputs,"setInputSequence");var n=this.__CACHE;if(n.__TX.ins.length<=e)throw new Error("Input index too high");return n.__TX.ins[e].sequence=t,n.__EXTRACTED_TX=void 0,this}},{key:"addInputs",value:function(e){var t=this;return e.forEach((function(e){return t.addInput(e)})),this}},{key:"addInput",value:function(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");w(this.data.inputs,"addInput"),e.witnessScript&&K(e.witnessScript);var t=this.__CACHE;this.data.addInput(e),B(t,t.__TX.ins[t.__TX.ins.length-1]);var n=this.data.inputs.length-1,r=this.data.inputs[n];return r.nonWitnessUtxo&&L(this.__CACHE,r,n),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}},{key:"addOutputs",value:function(e){var t=this;return e.forEach((function(e){return t.addOutput(e)})),this}},{key:"addOutput",value:function(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");w(this.data.inputs,"addOutput");var t=e,n=t.address;if("string"==typeof n){var r=this.opts.network,i=Nse.toOutputScript(n,r);e=Object.assign(e,{script:i})}var o=this.__CACHE;return this.data.addOutput(e),o.__FEE=void 0,o.__FEE_RATE=void 0,o.__EXTRACTED_TX=void 0,this}},{key:"extractTransaction",value:function(e){if(!this.data.inputs.every(A))throw new Error("Not finalized");var t=this.__CACHE;if(e||function(e,t,n){var r=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=r*i;if(r>=n.maximumFeeRate)throw new Error("Warning: You are paying around ".concat((o/1e8).toFixed(8)," in fees, which is ").concat(r," satoshi per byte for a transaction with a VSize of ").concat(i," bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction."))}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;var n=t.__TX.clone();return M(this.data.inputs,n,t,!0),n}},{key:"getFeeRate",value:function(){return Q("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}},{key:"getFee",value:function(){return Q("__FEE","fee",this.data.inputs,this.__CACHE)}},{key:"finalizeAllInputs",value:function(){var e=this;return uue.checkForInput(this.data.inputs,0),q(this.data.inputs.length).forEach((function(t){return e.finalizeInput(t)})),this}},{key:"finalizeInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_,n=uue.checkForInput(this.data.inputs,e),r=function(e,t,n){var r=n.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){var o=T(n,t,e),a=r.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||p(i.script))&&(i.isSegwit=!0),i}(e,n,this.__CACHE),i=r.script,o=r.isP2SH,a=r.isP2WSH,s=r.isSegwit;if(!i)throw new Error("No script found for input #".concat(e));b(n);var u=t(e,n,i,s,o,a),l=u.finalScriptSig,A=u.finalScriptWitness;if(l&&this.data.updateInput(e,{finalScriptSig:l}),A&&this.data.updateInput(e,{finalScriptWitness:A}),!l&&!A)throw new Error("Unknown error finalizing input #".concat(e));return this.data.clearFinalizedInput(e),this}},{key:"getInputType",value:function(e){var t=uue.checkForInput(this.data.inputs,e),n=H(R(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(!e)return;var t=use.decompile(e);if(!t)return;var n,r=t[t.length-1];if(!TX(r)||O(r)||(n=r,use.isCanonicalScriptSignature(n)))return;return use.decompile(r)?r:void 0}(t.finalScriptSig),t.witnessScript||function(e){if(!e)return;var t=U(e),n=t[t.length-1];if(O(n))return;return use.decompile(n)?n:void 0}(t.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+G(n.meaningfulScript)}},{key:"inputHasPubkey",value:function(e,t){return function(e,t,n,r){return j(e,H(R(n,t,r),n,"input",t.redeemScript,t.witnessScript).meaningfulScript)}(t,uue.checkForInput(this.data.inputs,e),e,this.__CACHE)}},{key:"inputHasHDKey",value:function(e,t){var n=uue.checkForInput(this.data.inputs,e),r=y(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"outputHasPubkey",value:function(e,t){return function(e,t,n,r){return j(e,H(r.__TX.outs[n].script,n,"output",t.redeemScript,t.witnessScript).meaningfulScript)}(t,uue.checkForOutput(this.data.outputs,e),e,this.__CACHE)}},{key:"outputHasHDKey",value:function(e,t){var n=uue.checkForOutput(this.data.outputs,e),r=y(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"validateSignaturesOfAllInputs",value:function(){var e=this;return uue.checkForInput(this.data.inputs,0),q(this.data.inputs.length).map((function(t){return e.validateSignaturesOfInput(t)})).reduce((function(e,t){return!0===t&&e}),!0)}},{key:"validateSignaturesOfInput",value:function(e,t){var n=this.data.inputs[e],r=(n||{}).partialSig;if(!n||!r||r.length<1)throw new Error("No signatures to validate");var i=t?r.filter((function(e){return e.pubkey.equals(t)})):r;if(i.length<1)throw new Error("No signatures for this pubkey");var o,a,s,u,l=[],A=F(i);try{for(A.s();!(u=A.n()).done;){var c=u.value,h=use.signature.decode(c.signature),f=s!==h.hashType?D(e,Object.assign({},n,{sighashType:h.hashType}),this.__CACHE,!0):{hash:o,script:a},d=f.hash,p=f.script;s=h.hashType,o=d,a=p,I(c.pubkey,p,"verify");var g=Fse.fromPublicKey(c.pubkey);l.push(g.verify(d,h.signature))}}catch(e){A.e(e)}finally{A.f()}return l.every((function(e){return!0===e}))}},{key:"signAllInputsHD",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");var n,r=[],i=F(q(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInputHD(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsHDAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey||!e.fingerprint)return i(new Error("Need HDSigner to sign input"));var o,a=[],s=[],u=F(q(t.data.inputs.length));try{for(u.s();!(o=u.n()).done;){var l=o.value;s.push(t.signInputHDAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInputHD",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return P(e,this.data.inputs,t).forEach((function(t){return n.signInput(e,t,r)})),this}},{key:"signInputHDAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];return new Promise((function(i,o){if(!t||!t.publicKey||!t.fingerprint)return o(new Error("Need HDSigner to sign input"));var a=P(e,n.data.inputs,t).map((function(t){return n.signInputAsync(e,t,r)}));return Promise.all(a).then((function(){i()})).catch(o)}))}},{key:"signAllInputs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];if(!e||!e.publicKey)throw new Error("Need Signer to sign input");var n,r=[],i=F(q(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInput(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey)return i(new Error("Need Signer to sign input"));var o,a=[],s=[],u=F(t.data.inputs.entries());try{for(u.s();!(o=u.n()).done;){var l=C(o.value,1)[0];s.push(t.signInputAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInput",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var r=N(this.data.inputs,e,t.publicKey,this.__CACHE,n),i=r.hash,o=r.sighashType,a=[{pubkey:t.publicKey,signature:use.signature.encode(t.sign(i),o)}];return this.data.updateInput(e,{partialSig:a}),this}},{key:"signInputAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];return Promise.resolve().then((function(){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var i=N(n.data.inputs,e,t.publicKey,n.__CACHE,r),o=i.hash,a=i.sighashType;return Promise.resolve(t.sign(o)).then((function(r){var i=[{pubkey:t.publicKey,signature:use.signature.encode(r,a)}];n.data.updateInput(e,{partialSig:i})}))}))}},{key:"toBuffer",value:function(){return a(this.__CACHE),this.data.toBuffer()}},{key:"toHex",value:function(){return a(this.__CACHE),this.data.toHex()}},{key:"toBase64",value:function(){return a(this.__CACHE),this.data.toBase64()}},{key:"updateGlobal",value:function(e){return this.data.updateGlobal(e),this}},{key:"updateInput",value:function(e,t){return t.witnessScript&&K(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&L(this.__CACHE,this.data.inputs[e],e),this}},{key:"updateOutput",value:function(e,t){return this.data.updateOutput(e,t),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return this.data.addUnknownKeyValToGlobal(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){return this.data.addUnknownKeyValToInput(e,t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}},{key:"clearFinalizedInput",value:function(e){return this.data.clearFinalizedInput(e),this}}],[{key:"fromBase64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nX.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nX.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=lue.Psbt.fromBuffer(t,i),s=new e(o,a);return n=s.__CACHE.__TX,r=s.__CACHE,n.ins.forEach((function(e){B(r,e)})),s}}]),e}();t.Psbt=r;var i=function(e){return new o(e)},o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nX.from([2,0,0,0,0,0,0,0,0,0]);s(this,e),this.tx=Rse.Transaction.fromBuffer(t),function(e){if(!e.ins.every((function(e){return e.script&&0===e.script.length&&e.witness&&0===e.witness.length})))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}return l(e,[{key:"getInputOutputCounts",value:function(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}},{key:"addInput",value:function(e){if(void 0===e.hash||void 0===e.index||!TX(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");var t="string"==typeof e.hash?Tse.reverseBuffer(nX.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}},{key:"addOutput",value:function(e){if(void 0===e.script||void 0===e.value||!TX(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}},{key:"toBuffer",value:function(){return this.tx.toBuffer()}}]),e}();function a(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function u(e,t,n){if(!t)return!1;var r;if(r=n?n.map((function(e){var n=Fse.fromPublicKey(e,{compressed:!0}).publicKey;return t.find((function(e){return e.pubkey.equals(n)}))})).filter((function(e){return!!e})):t,r.length>e)throw new Error("Too many signatures");return r.length===e}function A(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function c(e){return function(t){try{return e({output:t}),!0}catch(e){return!1}}}var h=c(_se.p2ms),f=c(_se.p2pk),d=c(_se.p2pkh),p=c(_se.p2wpkh),g=c(_se.p2wsh),v=c(_se.p2sh);function y(e){return function(t){return!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}}function m(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function w(e,t){e.forEach((function(e){var n=!1,r=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;r=function(e){var t=e.finalScriptSig&&use.decompile(e.finalScriptSig)||[],n=e.finalScriptWitness&&use.decompile(e.finalScriptWitness)||[];return t.concat(n).filter((function(e){return TX(e)&&use.isCanonicalScriptSignature(e)})).map((function(e){return{signature:e}}))}(e)}else r=e.partialSig;if(r.forEach((function(e){var r=use.signature.decode(e.signature).hashType,i=[];switch(r&Rse.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&r){case Rse.Transaction.SIGHASH_ALL:break;case Rse.Transaction.SIGHASH_SINGLE:case Rse.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(n=!0)})),n)throw new Error("Can not modify transaction, signatures exist.")}))}function b(e){if(e.sighashType&&e.partialSig){var t=e.partialSig,n=e.sighashType;t.forEach((function(e){var t=use.signature.decode(e.signature).hashType;if(n!==t)throw new Error("Signature sighash does not match input sighash type")}))}}function I(e,t,n){if(!j(e,t))throw new Error("Can not ".concat(n," for this input with the key ").concat(e.toString("hex")))}function B(e,t){var n=Tse.reverseBuffer(nX.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[n]=1}function E(e,t){return function(n,r,i,o){var a=e({redeem:{output:i}}).output;if(!r.equals(a))throw new Error("".concat(t," for ").concat(o," #").concat(n," doesn't match the scriptPubKey in the prevout"))}}var x=E(_se.p2sh,"Redeem script"),S=E(_se.p2wsh,"Witness script");function Q(e,t,n,r){if(!n.every(A))throw new Error("PSBT must be finalized to calculate ".concat(t));if("__FEE_RATE"===e&&r.__FEE_RATE)return r.__FEE_RATE;if("__FEE"===e&&r.__FEE)return r.__FEE;var i,o=!0;return r.__EXTRACTED_TX?(i=r.__EXTRACTED_TX,o=!1):i=r.__TX.clone(),M(n,i,r,o),"__FEE_RATE"===e?r.__FEE_RATE:"__FEE"===e?r.__FEE:void 0}function _(e,t,n,r,i,o){var a=G(n);if(!function(e,t,n){switch(n){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return u(1,e.partialSig);case"multisig":var r=_se.p2ms({output:t});return u(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,n,a))throw new Error("Can not finalize input #".concat(e));return function(e,t,n,r,i,o){var a,s,u=function(e,t,n){var r;switch(t){case"multisig":var i=function(e,t){return _se.p2ms({output:e}).pubkeys.map((function(e){return(t.filter((function(t){return t.pubkey.equals(e)}))[0]||{}).signature})).filter((function(e){return!!e}))}(e,n);r=_se.p2ms({output:e,signatures:i});break;case"pubkey":r=_se.p2pk({output:e,signature:n[0].signature});break;case"pubkeyhash":r=_se.p2pkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature});break;case"witnesspubkeyhash":r=_se.p2wpkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature})}return r}(e,t,n),l=o?_se.p2wsh({redeem:u}):null,A=i?_se.p2sh({redeem:l||u}):null;return r?(s=function(e){var t,n=nX.allocUnsafe(0);function r(e){var t=n.length,r=Xse.encodingLength(e);n=nX.concat([n,nX.allocUnsafe(r)]),Xse.encode(e,n,t)}function i(e){r(e.length),function(e){n=nX.concat([n,nX.from(e)])}(e)}return r((t=e).length),t.forEach(i),n}(l?l.witness:u.witness),A&&(a=A.input)):a=A?A.input:u.input,{finalScriptSig:a,finalScriptWitness:s}}(n,a,t.partialSig,r,i,o)}function N(e,t,n,r,i){var o=D(t,uue.checkForInput(e,t),r,!1,i),a=o.hash,s=o.sighashType;return I(n,o.script,"sign"),{hash:a,sighashType:s}}function D(e,t,n,r,i){var o,a,s=n.__TX,u=t.sighashType||Rse.Transaction.SIGHASH_ALL;if(i&&i.indexOf(u)<0){var l=function(e){var t=e&Rse.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case Rse.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case Rse.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case Rse.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(u);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ".concat(l))}if(t.nonWitnessUtxo){var A=T(n,t,e),c=s.ins[e].hash,h=A.getHash();if(!c.equals(h))throw new Error("Non-witness UTXO hash for input #".concat(e," doesn't match the hash specified in the prevout"));var f=s.ins[e].index;a=A.outs[f]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");a=t.witnessUtxo}var d=H(a.script,e,"input",t.redeemScript,t.witnessScript),g=d.meaningfulScript,v=d.type;if(["p2sh-p2wsh","p2wsh"].indexOf(v)>=0)o=s.hashForWitnessV0(e,g,a.value,u);else if(p(g)){var y=_se.p2pkh({hash:g.slice(2)}).output;o=s.hashForWitnessV0(e,y,a.value,u)}else{if(void 0===t.nonWitnessUtxo&&!1===n.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Input #".concat(e," has witnessUtxo but non-segwit script: ").concat(g.toString("hex")));r||!1===n.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),o=s.hashForSignature(e,g,u)}return{script:g,sighashType:u,hash:o}}function P(e,t,n){var r=uue.checkForInput(t,e);if(!r.bip32Derivation||0===r.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");var i=r.bip32Derivation.map((function(e){return e.masterFingerprint.equals(n.fingerprint)?e:void 0})).filter((function(e){return!!e}));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map((function(e){var t=n.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}))}function U(e){var t=0;function n(){var n=Xse.decode(e,t);return t+=Xse.decode.bytes,n}function r(){return function(n){return t+=n,e.slice(t-n,t)}(n())}return function(){for(var e=n(),t=[],i=0;i<e;i++)t.push(r());return t}()}function L(e,t,n){e.__NON_WITNESS_UTXO_BUF_CACHE[n]=t.nonWitnessUtxo;var r=Rse.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[n]=r;var i=e,o=n;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get:function(){var e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;var n=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=n,n},set:function(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function M(e,t,n,r){var i=0;e.forEach((function(e,o){if(r&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),r&&e.finalScriptWitness&&(t.ins[o].witness=U(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){var a=T(n,e,o),s=t.ins[o].index,u=a.outs[s];i+=u.value}}));var o=t.outs.reduce((function(e,t){return e+t.value}),0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");var s=t.virtualSize();n.__FEE=a,n.__EXTRACTED_TX=t,n.__FEE_RATE=Math.floor(a/s)}function T(e,t,n){var r=e.__NON_WITNESS_UTXO_TX_CACHE;return r[n]||L(e,t,n),r[n]}function R(e,t,n){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo)return T(n,t,e).outs[n.__TX.ins[e].index].script;throw new Error("Can't find pubkey in input without Utxo data")}function O(e){return 33===e.length&&use.isCanonicalPubKey(e)}function H(e,t,n,r,i){var o,a=v(e),s=a&&r&&g(r),u=g(e);if(a&&void 0===r)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((u||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");return s?(o=i,x(t,e,r,n),S(t,r,i,n),K(o)):u?(o=i,S(t,e,i,n),K(o)):a?(o=r,x(t,e,r,n)):o=e,{meaningfulScript:o,type:s?"p2sh-p2wsh":a?"p2sh":u?"p2wsh":"raw"}}function K(e){if(p(e)||v(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function j(e,t){var n=fse.hash160(e),r=use.decompile(t);if(null===r)throw new Error("Unknown script error");return r.some((function(t){return"number"!=typeof t&&(t.equals(e)||t.equals(n))}))}function G(e){return p(e)?"witnesspubkeyhash":d(e)?"pubkeyhash":h(e)?"multisig":f(e)?"pubkey":"nonstandard"}function q(e){return k(Array(e).keys())}}));PY(Aue),Aue.Psbt;var cue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){return e===n.OPS.OP_0||use.isCanonicalScriptSignature(e)}function i(e,t){var i=use.decompile(e);return!(i.length<2)&&i[0]===n.OPS.OP_0&&(t?i.slice(1).every(r):i.slice(1).every(use.isCanonicalScriptSignature))}t.check=i,i.toJSON=function(){return"multisig input"}}));PY(cue),cue.check;var hue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use,r=n.OPS.OP_RESERVED;function i(e,t){var i=use.decompile(e);if(i.length<4)return!1;if(i[i.length-1]!==n.OPS.OP_CHECKMULTISIG)return!1;if(!Xae.Number(i[0]))return!1;if(!Xae.Number(i[i.length-2]))return!1;var o=i[0]-r,a=i[i.length-2]-r;return!(o<=0)&&(!(a>16)&&(!(o>a)&&(a===i.length-3&&(!!t||i.slice(1,-2).every(use.isCanonicalPubKey)))))}t.check=i,i.toJSON=function(){return"multi-sig output"}}));PY(hue),hue.check;var fue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=cue,t.output=hue}));PY(fue),fue.input,fue.output;var due=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;function r(e){var t=use.compile(e);return t.length>1&&t[0]===n.OP_RETURN}t.check=r,r.toJSON=function(){return"null data output"};var i={check:r};t.output=i}));PY(due),due.check,due.output;var pue=UY((function(e,t){function n(e){var t=use.decompile(e);return 1===t.length&&use.isCanonicalScriptSignature(t[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"pubKey input"}}));PY(pue),pue.check;var gue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.decompile(e);return 2===t.length&&use.isCanonicalPubKey(t[0])&&t[1]===n.OPS.OP_CHECKSIG}t.check=r,r.toJSON=function(){return"pubKey output"}}));PY(gue),gue.check;var vue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=pue,t.output=gue}));PY(vue),vue.input,vue.output;var yue=UY((function(e,t){function n(e){var t=use.decompile(e);return 2===t.length&&use.isCanonicalScriptSignature(t[0])&&use.isCanonicalPubKey(t[1])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"pubKeyHash input"}}));PY(yue),yue.check;var mue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 25===t.length&&t[0]===n.OPS.OP_DUP&&t[1]===n.OPS.OP_HASH160&&20===t[2]&&t[23]===n.OPS.OP_EQUALVERIFY&&t[24]===n.OPS.OP_CHECKSIG}t.check=r,r.toJSON=function(){return"pubKeyHash output"}}));PY(mue),mue.check;var wue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=yue,t.output=mue}));PY(wue),wue.input,wue.output;var bue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 22===t.length&&t[0]===n.OPS.OP_0&&20===t[1]}t.check=r,r.toJSON=function(){return"Witness pubKeyHash output"}}));PY(bue),bue.check;var Iue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 34===t.length&&t[0]===n.OPS.OP_0&&32===t[1]}t.check=r,r.toJSON=function(){return"Witness scriptHash output"}}));PY(Iue),Iue.check;var Bue=UY((function(e,t){function n(e,t){var n=use.decompile(e);if(n.length<1)return!1;var r=n[n.length-1];if(!TX(r))return!1;var i=use.decompile(use.compile(n.slice(0,-1))),o=use.decompile(r);return!!o&&!!use.isPushOnly(i)&&(1===n.length?Iue.check(o)||bue.check(o):!(!wue.input.check(i)||!wue.output.check(o))||!(!fue.input.check(i,t)||!fue.output.check(o))||!(!vue.input.check(i)||!vue.output.check(o)))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"scriptHash input"}}));PY(Bue),Bue.check;var Eue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 23===t.length&&t[0]===n.OPS.OP_HASH160&&20===t[1]&&t[22]===n.OPS.OP_EQUAL}t.check=r,r.toJSON=function(){return"scriptHash output"}}));PY(Eue),Eue.check;var Cue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=Bue,t.output=Eue}));PY(Cue),Cue.input,Cue.output;var xue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use,r=nX.from("aa21a9ed","hex");function i(e){var t=use.compile(e);return t.length>37&&t[0]===n.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(r)}t.check=i,i.toJSON=function(){return"Witness commitment output"},t.encode=function(e){Hae(Xae.Hash256bit,e);var t=nX.allocUnsafe(36);return r.copy(t,0),e.copy(t,4),use.compile([n.OPS.OP_RETURN,t])},t.decode=function(e){return Hae(i,e),use.decompile(e)[1].slice(4,36)}}));PY(xue),xue.check,xue.encode,xue.decode;var kue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.output=xue}));PY(kue),kue.output;var Sue=UY((function(e,t){function n(e){var t,n=use.decompile(e);return 2===n.length&&use.isCanonicalScriptSignature(n[0])&&(t=n[1],use.isCanonicalPubKey(t)&&33===t.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"witnessPubKeyHash input"}}));PY(Sue),Sue.check;var Que=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=Sue,t.output=bue}));PY(Que),Que.input,Que.output;var _ue=UY((function(e,t){function n(e,t){if(Hae(Hae.Array,e),e.length<1)return!1;var n=e[e.length-1];if(!TX(n))return!1;var r=use.decompile(n);if(!r||0===r.length)return!1;var i=use.compile(e.slice(0,-1));return!(!wue.input.check(i)||!wue.output.check(r))||!(!fue.input.check(i,t)||!fue.output.check(r))||!(!vue.input.check(i)||!vue.output.check(r))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"witnessScriptHash input"}}));PY(_ue),_ue.check;var Nue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=_ue,t.output=Iue}));PY(Nue),Nue.input,Nue.output;var Due=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=n,t.output=function(e){if(Que.output.check(e))return n.P2WPKH;if(Nue.output.check(e))return n.P2WSH;if(wue.output.check(e))return n.P2PKH;if(Cue.output.check(e))return n.P2SH;var t=use.decompile(e);if(!t)throw new TypeError("Invalid script");return fue.output.check(t)?n.P2MS:vue.output.check(t)?n.P2PK:kue.output.check(t)?n.WITNESS_COMMITMENT:due.output.check(t)?n.NULLDATA:n.NONSTANDARD},t.input=function(e,t){var r=use.decompile(e);if(!r)throw new TypeError("Invalid script");return wue.input.check(r)?n.P2PKH:Cue.input.check(r,t)?n.P2SH:fue.input.check(r,t)?n.P2MS:vue.input.check(r)?n.P2PK:n.NONSTANDARD},t.witness=function(e,t){var r=use.decompile(e);if(!r)throw new TypeError("Invalid script");return Que.input.check(r)?n.P2WPKH:Nue.input.check(r,t)?n.P2WSH:n.NONSTANDARD}}));PY(Due),Due.types,Due.output,Due.input,Due.witness;var Fue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use,r=Due.types,o=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function a(e,t,n){try{Hae(e,t)}catch(e){throw new Error(n)}}var u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jae.bitcoin,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2500;s(this,e),this.network=t,this.maximumFeeRate=n,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new Rse.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}return l(e,[{key:"setLowR",value:function(e){return Hae(Hae.maybe(Hae.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}},{key:"setLockTime",value:function(e){if(Hae(Xae.UInt32,e),this.__INPUTS.some((function(e){return!!e.signatures&&e.signatures.some((function(e){return void 0!==e}))})))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}},{key:"setVersion",value:function(e){Hae(Xae.UInt32,e),this.__TX.version=e}},{key:"addInput",value:function(e,t,n,r){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");var i,o;if("string"==typeof(o=e)||o instanceof String)e=Tse.reverseBuffer(nX.from(e,"hex"));else if(function(e){return e instanceof Rse.Transaction}(e)){var a=e.outs[t];r=a.script,i=a.value,e=e.getHash(!1)}return this.__addInputUnsafe(e,t,{sequence:n,prevOutScript:r,value:i})}},{key:"addOutput",value:function(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=Nse.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}},{key:"build",value:function(){return this.__build(!1)}},{key:"buildIncomplete",value:function(){return this.__build(!0)}},{key:"sign",value:function(e,t,n,s,u,l){!function(e){var t,n=e.input,r=e.ourPubKey,i=e.keyPair,o=e.signatureHash,a=e.hashType,s=e.useLowR,u=!1,l=F(n.pubkeys.entries());try{for(l.s();!(t=l.n()).done;){var A=C(t.value,2),c=A[0],h=A[1];if(r.equals(h)){if(n.signatures[c])throw new Error("Signature already exists");if(33!==r.length&&n.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");var f=i.sign(o,s);n.signatures[c]=use.signature.encode(f,a),u=!0}}}catch(e){l.e(e)}finally{l.f()}if(!u)throw new Error("Key pair cannot sign for this input")}(function(e,t,n,s,u,l,A,h,d,p,g){var v;if("number"==typeof u)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),v=u;else{if("object"!=i(u))throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!o.has(t.prevOutScriptType))throw new TypeError('Unknown prevOutScriptType "'.concat(t.prevOutScriptType,'"'));a(Hae.Number,t.vin,"sign must include vin parameter as Number (input index)"),a(Xae.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),a(Hae.maybe(Hae.Number),t.hashType,"sign hashType parameter must be a number");var n=(e[t.vin]||[]).prevOutType,r=t.prevOutScriptType;switch(r){case"p2pkh":if(n&&"pubkeyhash"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2pkh: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2pk":if(n&&"pubkey"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2pk: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2wpkh":if(n&&"witnesspubkeyhash"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2wpkh: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessValue"));break;case"p2ms":if(n&&"multisig"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2ms: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2sh-p2wpkh":if(n&&"scripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2sh-p2wpkh: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.Buffer,t.redeemScript,"".concat(r," requires redeemScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessValue"));break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(n&&"scripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type ").concat(r,": ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.Buffer,t.redeemScript,"".concat(r," requires redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(n&&"witnessscripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type ").concat(r,": ").concat(n));a(Hae.Buffer,t.witnessScript,"".concat(r," requires witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessValue"));break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(n&&"scripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type ").concat(r,": ").concat(n));a(Hae.Buffer,t.witnessScript,"".concat(r," requires witnessScript")),a(Hae.Buffer,t.redeemScript,"".concat(r," requires witnessScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessScript"))}}(t,u),v=u.vin,l=u.keyPair,A=u.redeemScript,h=u.hashType,d=u.witnessValue,p=u.witnessScript}if(void 0===l)throw new Error("sign requires keypair");if(l.network&&l.network!==e)throw new TypeError("Inconsistent network");if(!t[v])throw new Error("No input at index: "+v);if(n(h=h||Rse.Transaction.SIGHASH_ALL))throw new Error("Transaction needs outputs");var y=t[v];if(void 0!==y.redeemScript&&A&&!y.redeemScript.equals(A))throw new Error("Inconsistent redeemScript");var m=l.publicKey||l.getPublicKey&&l.getPublicKey();if(!f(y)){if(void 0!==d){if(void 0!==y.value&&y.value!==d)throw new Error("Input did not match witnessValue");Hae(Xae.Satoshi,d),y.value=d}if(!f(y)){var w=function(e,t,n,i){if(n&&i){var o=_se.p2wsh({redeem:{output:i}}),a=_se.p2wsh({output:n}),s=_se.p2sh({redeem:{output:n}}),u=_se.p2sh({redeem:o});if(!o.hash.equals(a.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!s.hash.equals(u.hash))throw new Error("Redeem script inconsistent with prevOutScript");var l=c(o.redeem.output,t);if(!l.pubkeys)throw new Error(l.type+" not supported as witnessScript ("+use.toASM(i)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(l.signatures=e.signatures);var A=i;if(l.type===r.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:n,redeemScriptType:r.P2WSH,witnessScript:i,witnessScriptType:l.type,prevOutType:r.P2SH,prevOutScript:s.output,hasWitness:!0,signScript:A,signType:l.type,pubkeys:l.pubkeys,signatures:l.signatures,maxSignatures:l.maxSignatures}}if(n){var h=_se.p2sh({redeem:{output:n}});if(e.prevOutScript){var f;try{f=_se.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!h.hash.equals(f.hash))throw new Error("Redeem script inconsistent with prevOutScript")}var d=c(h.redeem.output,t);if(!d.pubkeys)throw new Error(d.type+" not supported as redeemScript ("+use.toASM(n)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(d.signatures=e.signatures);var p=n;return d.type===r.P2WPKH&&(p=_se.p2pkh({pubkey:d.pubkeys[0]}).output),{redeemScript:n,redeemScriptType:d.type,prevOutType:r.P2SH,prevOutScript:h.output,hasWitness:d.type===r.P2WPKH,signScript:p,signType:d.type,pubkeys:d.pubkeys,signatures:d.signatures,maxSignatures:d.maxSignatures}}if(i){var g=_se.p2wsh({redeem:{output:i}});if(e.prevOutScript){var v=_se.p2wsh({output:e.prevOutScript});if(!g.hash.equals(v.hash))throw new Error("Witness script inconsistent with prevOutScript")}var y=c(g.redeem.output,t);if(!y.pubkeys)throw new Error(y.type+" not supported as witnessScript ("+use.toASM(i)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(y.signatures=e.signatures);var m=i;if(y.type===r.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:i,witnessScriptType:y.type,prevOutType:r.P2WSH,prevOutScript:g.output,hasWitness:!0,signScript:m,signType:y.type,pubkeys:y.pubkeys,signatures:y.signatures,maxSignatures:y.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===r.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===r.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");var w=c(e.prevOutScript,t);if(!w.pubkeys)throw new Error(w.type+" not supported ("+use.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(w.signatures=e.signatures);var b=e.prevOutScript;return w.type===r.P2WPKH&&(b=_se.p2pkh({pubkey:w.pubkeys[0]}).output),{prevOutType:w.type,prevOutScript:e.prevOutScript,hasWitness:w.type===r.P2WPKH,signScript:b,signType:w.type,pubkeys:w.pubkeys,signatures:w.signatures,maxSignatures:w.maxSignatures}}var I=_se.p2pkh({pubkey:t}).output;return{prevOutType:r.P2PKH,prevOutScript:I,hasWitness:!1,signScript:I,signType:r.P2PKH,pubkeys:[t],signatures:[void 0]}}(y,m,A,p);Object.assign(y,w)}if(!f(y))throw Error(y.prevOutType+" not supported")}return{input:y,ourPubKey:m,keyPair:l,signatureHash:y.hasWitness?s.hashForWitnessV0(v,y.signScript,y.value,h):s.hashForSignature(v,y.signScript,h),hashType:h,useLowR:!!g}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,n,s,u,l,this.__USE_LOW_R))}},{key:"__addInputUnsafe",value:function(e,t,n){if(Rse.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");var r=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[r])throw new Error("Duplicate TxOut: "+r);var i={};if(void 0!==n.script&&(i=A(n.script,n.witness||[])),void 0!==n.value&&(i.value=n.value),!i.prevOutScript&&n.prevOutScript){var o;if(!i.pubkeys&&!i.signatures){var a=c(n.prevOutScript);a.pubkeys&&(i.pubkeys=a.pubkeys,i.signatures=a.signatures),o=a.type}i.prevOutScript=n.prevOutScript,i.prevOutType=o||Due.output(n.prevOutScript)}var s=this.__TX.addInput(e,t,n.sequence,n.scriptSig);return this.__INPUTS[s]=i,this.__PREV_TX_SET[r]=!0,s}},{key:"__build",value:function(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}var t=this.__TX.clone();if(this.__INPUTS.forEach((function(n,i){if(!n.prevOutType&&!e)throw new Error("Transaction is not complete");var o=h(n.prevOutType,n,e);if(o)t.setInputScript(i,o.input),t.setWitness(i,o.witness);else{if(!e&&n.prevOutType===r.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}})),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}},{key:"__canModifyInputs",value:function(){return this.__INPUTS.every((function(e){return!e.signatures||e.signatures.every((function(e){return!e||0!=(d(e)&Rse.Transaction.SIGHASH_ANYONECANPAY)}))}))}},{key:"__needsOutputs",value:function(e){return e===Rse.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some((function(e){return!!e.signatures&&e.signatures.some((function(e){return!!e&&!(d(e)&Rse.Transaction.SIGHASH_NONE)}))}))}},{key:"__canModifyOutputs",value:function(){var e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every((function(n){return void 0===n.signatures||n.signatures.every((function(n){if(!n)return!0;var r=31&d(n);return r===Rse.Transaction.SIGHASH_NONE||r===Rse.Transaction.SIGHASH_SINGLE&&e<=t}))}))}},{key:"__overMaximumFees",value:function(e){return(this.__INPUTS.reduce((function(e,t){return e+(t.value>>>0)}),0)-this.__TX.outs.reduce((function(e,t){return e+t.value}),0))/e>this.maximumFeeRate}}],[{key:"fromTransaction",value:function(t,n){var i=new e(n);return i.setVersion(t.version),i.setLockTime(t.locktime),t.outs.forEach((function(e){i.addOutput(e.script,e.value)})),t.ins.forEach((function(e){i.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})})),i.__INPUTS.forEach((function(e,n){!function(e,t,n){if(e.redeemScriptType===r.P2MS&&e.redeemScript&&e.pubkeys.length!==e.signatures.length){var i=e.signatures.concat();e.signatures=e.pubkeys.map((function(r){var o,a=Fse.fromPublicKey(r);return i.some((function(r,s){if(!r)return!1;var u=use.signature.decode(r),l=t.hashForSignature(n,e.redeemScript,u.hashType);return!!a.verify(l,u.signature)&&(i[s]=void 0,o=r,!0)})),o}))}}(e,t,n)})),i}}]),e}();function A(e,t,n,i){if(0===e.length&&0===t.length)return{};if(!n){var o=Due.input(e,!0),a=Due.witness(t,!0);o===r.NONSTANDARD&&(o=void 0),a===r.NONSTANDARD&&(a=void 0),n=o||a}switch(n){case r.P2WPKH:var s=_se.p2wpkh({witness:t}),u=s.output,l=s.pubkey,c=s.signature;return{prevOutScript:u,prevOutType:r.P2WPKH,pubkeys:[l],signatures:[c]};case r.P2PKH:var h=_se.p2pkh({input:e}),f=h.output,d=h.pubkey,p=h.signature;return{prevOutScript:f,prevOutType:r.P2PKH,pubkeys:[d],signatures:[p]};case r.P2PK:var g=_se.p2pk({input:e}).signature;return{prevOutType:r.P2PK,pubkeys:[void 0],signatures:[g]};case r.P2MS:var v=_se.p2ms({input:e,output:i},{allowIncomplete:!0}),y=v.m,m=v.pubkeys,w=v.signatures;return{prevOutType:r.P2MS,pubkeys:m,signatures:w,maxSignatures:y}}if(n===r.P2SH){var b=_se.p2sh({input:e,witness:t}),I=b.output,B=b.redeem,E=Due.output(B.output),C=A(B.input,B.witness,E,B.output);return C.prevOutType?{prevOutScript:I,prevOutType:r.P2SH,redeemScript:B.output,redeemScriptType:C.prevOutType,witnessScript:C.witnessScript,witnessScriptType:C.witnessScriptType,pubkeys:C.pubkeys,signatures:C.signatures}:{}}if(n===r.P2WSH){var x,k=_se.p2wsh({input:e,witness:t}),S=k.output,Q=k.redeem,_=Due.output(Q.output);return(x=_===r.P2WPKH?A(Q.input,Q.witness,_):A(use.compile(Q.witness),[],_,Q.output)).prevOutType?{prevOutScript:S,prevOutType:r.P2WSH,witnessScript:Q.output,witnessScriptType:x.prevOutType,pubkeys:x.pubkeys,signatures:x.signatures}:{}}return{prevOutType:r.NONSTANDARD,prevOutScript:e}}function c(e,t){Hae(Xae.Buffer,e);var n=Due.output(e);switch(n){case r.P2PKH:if(!t)return{type:n};var i=_se.p2pkh({output:e}).hash,o=fse.hash160(t);return i.equals(o)?{type:n,pubkeys:[t],signatures:[void 0]}:{type:n};case r.P2WPKH:if(!t)return{type:n};var a=_se.p2wpkh({output:e}).hash,s=fse.hash160(t);return a.equals(s)?{type:n,pubkeys:[t],signatures:[void 0]}:{type:n};case r.P2PK:return{type:n,pubkeys:[_se.p2pk({output:e}).pubkey],signatures:[void 0]};case r.P2MS:var u=_se.p2ms({output:e});return{type:n,pubkeys:u.pubkeys,signatures:u.pubkeys.map((function(){})),maxSignatures:u.m}}return{type:n}}function h(e,t,i){var o=t.pubkeys||[],a=t.signatures||[];switch(e){case r.P2PKH:if(0===o.length)break;if(0===a.length)break;return _se.p2pkh({pubkey:o[0],signature:a[0]});case r.P2WPKH:if(0===o.length)break;if(0===a.length)break;return _se.p2wpkh({pubkey:o[0],signature:a[0]});case r.P2PK:if(0===o.length)break;if(0===a.length)break;return _se.p2pk({signature:a[0]});case r.P2MS:var s=t.maxSignatures;a=i?a.map((function(e){return e||n.OPS.OP_0})):a.filter((function(e){return e}));var u=!i||s===a.length;return _se.p2ms({m:s,pubkeys:o,signatures:a},{allowIncomplete:i,validate:u});case r.P2SH:var l=h(t.redeemScriptType,t,i);if(!l)return;return _se.p2sh({redeem:{output:l.output||t.redeemScript,input:l.input,witness:l.witness}});case r.P2WSH:var A=h(t.witnessScriptType,t,i);if(!A)return;return _se.p2wsh({redeem:{output:t.witnessScript,input:A.input,witness:A.witness}})}}function f(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function d(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=u}));PY(Fue),Fue.TransactionBuilder;var Pue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bip32=zae,t.address=Nse,t.crypto=fse,t.ECPair=Fse,t.networks=Jae,t.payments=_se,t.script=use,t.Block=Ose.Block,t.Psbt=Aue.Psbt;var n=use;t.opcodes=n.OPS,t.Transaction=Rse.Transaction,t.TransactionBuilder=Fue.TransactionBuilder}));function Uue(e,t,n){var r="",i=function(e,t){var n=null;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&r.toLowerCase()===t.toLowerCase()&&(n=r);return e[n]}(e,t),o=C2(n);if(i?(i.created&&o<=i.created&&(r="invalidIssuingAddressCreationTime"),i.revoked&&o>=i.revoked&&(r="invalidIssuingAddressRevoked"),i.expires&&o>=i.expires&&(r="invalidIssuingAddressExpired")):r="invalidIssuingAddressUnknown",r)throw new NY("checkAuthenticity",CY("errors",r))}PY(Pue),Pue.bitcoin,Pue.bip32,Pue.address,Pue.crypto,Pue.ECPair,Pue.networks,Pue.payments,Pue.script,Pue.Block,Pue.Psbt,Pue.opcodes,Pue.Transaction,Pue.TransactionBuilder;var Lue=j$("Verifier"),Mue=function(){function e(t){var n=t.certificateJson,r=t.chain,i=t.expires,o=t.id,a=t.issuer,u=t.receipt,l=t.revocationKey,A=t.transactionId,c=t.version,h=t.explorerAPIs;s(this,e),this.chain=r,this.expires=i,this.id=o,this.issuer=a,this.receipt=u,this.revocationKey=l,this.version=c,this.transactionId=A,this.explorerAPIs=h;var f=n.document;f||(f=this._retrieveDocumentBeforeIssuance(n)),this.documentToVerify=Object.assign({},f),this._stepsStatuses=[]}return l(e,[{key:"verify",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return sY(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._stepCallback=e,this.version!==lY.V1_1){t.next=2;break}throw new NY("","Verification of 1.1 certificates is not supported by this component. See the python cert-verifier for legacy verification");case 2:if(!k2.chains.isMockChain(this.chain)){t.next=7;break}return t.next=5,this._verifyV2Mock();case 5:t.next=9;break;case 7:return t.next=9,this._verifyMain();case 9:return n=this._stepsStatuses.find((function(e){return"failure"===e.status})),t.abrupt("return",n?this._failed(n):this._succeed());case 11:case"end":return t.stop()}}),t,this)})))}},{key:"_getRevocationListUrl",value:function(e){var t;return(null===(t=this.issuer)||void 0===t?void 0:t.revocationList)?this.issuer.revocationList:e.revocationList}},{key:"_doAction",value:function(e,t){return sY(this,void 0,void 0,r().mark((function n(){var i,o;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this._isFailing()){n.next=2;break}return n.abrupt("return");case 2:return e&&(i=k2.i18n.getText("subSteps","".concat(e,"LabelPending")),Lue(i),this._updateStatusCallback(e,i,"starting")),n.prev=3,n.next=6,t();case 6:return o=n.sent,n.abrupt("return",(e&&(this._updateStatusCallback(e,i,"success"),this._stepsStatuses.push({step:e,label:i,status:"success"})),o));case 10:n.prev=10,n.t0=n.catch(3),e&&(this._updateStatusCallback(e,i,"failure",n.t0.message),this._stepsStatuses.push({code:e,label:i,status:"failure",errorMessage:n.t0.message}));case 13:case"end":return n.stop()}}),n,this,[[3,10]])})))}},{key:"_stepCallback",value:function(e){}},{key:"_verifyMain",value:function(){return sY(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTransactionId();case 2:return e.next=4,this.computeLocalHash();case 4:return e.next=6,this.fetchRemoteHash();case 6:return e.next=8,this.getIssuerProfile();case 8:return e.next=10,this.parseIssuerKeys();case 10:return e.next=12,this.compareHashes();case 12:return e.next=14,this.checkMerkleRoot();case 14:return e.next=16,this.checkReceipt();case 16:return e.next=18,this.checkRevokedStatus();case 18:return e.next=20,this.checkAuthenticity();case 20:return e.next=22,this.checkExpiresDate();case 22:case"end":return e.stop()}}),e,this)})))}},{key:"_verifyV2Mock",value:function(){return sY(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.computeLocalHash();case 2:return e.next=4,this.compareHashes();case 4:return e.next=6,this.checkReceipt();case 6:return e.next=8,this.checkExpiresDate();case 8:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionId",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("getTransactionId",(function(){return function(e){if("string"==typeof e&&e.length>0)return e;throw new NY("getTransactionId",CY("errors","isTransactionIdValid"))}(t.transactionId)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"computeLocalHash",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("computeLocalHash",(function(){return sY(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n9(this.documentToVerify,this.version);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 2:this.localHash=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"fetchRemoteHash",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("fetchRemoteHash",(function(){return sY(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k2.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 2:this.txData=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getIssuerProfile",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("getIssuerProfile",(function(){return sY(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k2.verifier.getIssuerProfile(this.issuer);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 2:this.issuer=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"parseIssuerKeys",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("parseIssuerKeys",(function(){return k2.verifier.parseIssuerKeys(t.issuer)}));case 2:this.issuerPublicKeyList=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"compareHashes",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("compareHashes",(function(){!function(e,t){if(e!==t)throw new NY("compareHashes",CY("errors","ensureHashesEqual"))}(t.localHash,t.receipt.targetHash)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkMerkleRoot",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkMerkleRoot",(function(){return function(e,t){if(e!==t)throw new NY("checkMerkleRoot",CY("errors","ensureMerkleRootEqual"));return!0}(t.receipt.merkleRoot,t.txData.remoteHash)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkReceipt",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkReceipt",(function(){return function(e){var t=e.targetHash,n=e.merkleRoot;try{var r=e.proof||e.path;if(r)for(var i in r){var o=r[i],a=void 0;if(void 0!==o.left)a=t9("".concat(o.left).concat(t)),t=e9(a);else{if(void 0===o.right)throw new NY("checkReceipt","Trigger catch error.");a=t9("".concat(t).concat(o.right)),t=e9(a)}}}catch(e){throw new NY("checkReceipt",CY("errors","ensureValidReceipt"))}if(t!==n)throw new NY("checkReceipt",CY("errors","invalidMerkleReceipt"))}(t.receipt)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkRevokedStatus",value:function(){var e;return sY(this,void 0,void 0,r().mark((function t(){var n,i,o=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.version!==lY.V1_2){t.next=4;break}i=(null===(e=this.txData)||void 0===e?void 0:e.revokedAddresses)||[],n=[k2.verifier.parseRevocationKey(this.issuer),this.revocationKey],t.next=8;break;case 4:return t.next=6,this._doAction(null,(function(){return sY(o,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k2.verifier.getRevokedAssertions(this._getRevocationListUrl(this.issuer),this.id);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 6:i=t.sent,n=this.id;case 8:return t.next=10,this._doAction("checkRevokedStatus",(function(){return function(e,t){if(e&&t){Array.isArray(t)||(t=[t]);var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.filter((function(e){return-1!==t.indexOf(e)})).filter((function(e,t,n){return n.indexOf(e)===t}))}(t=t.filter((function(e){return null!=e})),e.map((function(e){return e.id})));if(n.length>0){var r=e.findIndex((function(e){return e.id===n[0]}));if(r>-1)throw new NY("checkRevokedStatus",k2.certificates.generateRevocationReason(e[r].revocationReason))}}}(i,n)}));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"checkAuthenticity",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkAuthenticity",(function(){return Uue(t.issuerPublicKeyList,t.txData.issuingAddress,t.txData.time)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkExpiresDate",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkExpiresDate",(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){var t=C2(e);if(new Date>=t)throw new NY("checkExpiresDate",CY("errors","ensureNotExpired"))}}(t.expires)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"_failed",value:function(e){var t=e.errorMessage;return Lue("failure:".concat(t)),this._setFinalStep({status:"failure",message:t})}},{key:"_isFailing",value:function(){return this._stepsStatuses.some((function(e){return"failure"===e.status}))}},{key:"_retrieveDocumentBeforeIssuance",value:function(e){var t=Object.assign({},e);return delete t.signature,t}},{key:"_succeed",value:function(){var e=k2.chains.isMockChain(this.chain)?k2.i18n.getText("success","mocknet"):k2.i18n.getText("success","blockchain");return Lue(e),this._setFinalStep({status:"success",message:e})}},{key:"_setFinalStep",value:function(e){return{code:"final",status:e.status,message:e.message}}},{key:"_updateStatusCallback",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(null!=e){var i={code:e,label:t,status:n};r&&(i.errorMessage=r),this._stepCallback(i)}}}]),e}(),Tue=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,e),this.explorerAPIs=[],this._setOptions(n),"object"!=i(t))try{t=JSON.parse(t)}catch(t){throw new Error(k2.i18n.getText("errors","certificateNotValid"))}this.certificateJson=TY(t)}return l(e,[{key:"init",value:function(){return sY(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.parseJson(this.certificateJson);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"parseJson",value:function(e){return sY(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Q2(e);case 2:if((n=t.sent).isFormatValid){t.next=5;break}throw new Error(n.error);case 5:this._setProperties(n);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"verify",value:function(e){return sY(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Mue({certificateJson:this.certificateJson,chain:this.chain,expires:this.expires,id:this.id,issuer:this.issuer,receipt:this.receipt,revocationKey:this.revocationKey,transactionId:this.transactionId,version:this.version,explorerAPIs:TY(this.explorerAPIs)}),t.next=3,n.verify(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"_setOptions",value:function(e){this.options=Object.assign({},IY,e),this.locale=k2.i18n.ensureIsSupported("auto"===this.options.locale?k2.i18n.detectLocale():this.options.locale),this.explorerAPIs=this.options.explorerAPIs||[],EY.locale=this.locale}},{key:"_setProperties",value:function(e){var t=e.certificateImage,n=e.chain,r=e.description,i=e.expires,o=e.id,a=e.isFormatValid,s=e.issuedOn,u=e.issuer,l=e.metadataJson,A=e.name,c=e.publicKey,h=e.receipt,f=e.recipientFullName,d=e.recordLink,p=e.revocationKey,g=e.sealImage,v=e.signature,y=e.signatureImage,m=e.subtitle,w=e.version;this.isFormatValid=a,this.certificateImage=t,this.chain=n,this.description=r,this.expires=i,this.id=o,this.issuedOn=s,this.issuer=u,this.metadataJson=l,this.name=A,this.publicKey=c,this.receipt=h,this.recipientFullName=f,this.recordLink=d,this.revocationKey=p,this.sealImage=g,this.signature=v,this.signatureImage=y,this.subtitle=m,this.verificationSteps=k2.certificates.getVerificationMap(n),this.version=w,this._setTransactionDetails()}},{key:"_setTransactionDetails",value:function(){this.transactionId=k2.certificates.getTransactionId(this.receipt),this.rawTransactionLink=k2.certificates.getTransactionLink(this.transactionId,this.chain,!0),this.transactionLink=k2.certificates.getTransactionLink(this.transactionId,this.chain)}}]),e}();var Rue=Object.freeze({__proto__:null,displayHtmlHasNoWidthConstraint:Nt,download:function(e){return e+Dt},downloadPDF:function(e){return Lt(this,void 0,void 0,(function*(){yield Bo(e)}))},initializeVerificationSteps:function(e){const t=JSON.parse(JSON.stringify(e.verificationSteps));return t.map(((e,n)=>Object.assign(Object.assign({},e),{isLast:n===t.length-1,status:Vx.DEFAULT})))},retrieve:function(e){return XJ(e)||WJ(e)?fetch(e+Dt).then((function(e){return e.text()})).then((function(e){try{return{certificateDefinition:JSON.parse(e)}}catch(e){return console.log(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcertsUrl"}}})).catch(ZJ):(console.error("Invalid url to retrieve:",e),null)},read:function(e){return eY.apply(this,arguments)},parse:function(e,t={}){return Lt(this,void 0,void 0,(function*(){t.locale||(t.locale="auto");try{let n;return n=1===nk(e["@context"]).versionNumber?new Tue(e,t):new YJ(e,t),yield n.init(),{certificateDefinition:n}}catch(e){return console.error(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcerts"}}}))},isPathToCertificateValidURI:function(e){return XJ(e)||WJ(e)}});var Oue=Object.freeze({__proto__:null,dispatch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if(e&&"string"==typeof e&&t&&"object"===i(t)){var o=new CustomEvent(e,{detail:n({certificateDefinition:t},r)});window.dispatchEvent(o)}}}),Hue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!window.Proxy){var t=kt();return new t(e,Qt)}return new Proxy(e,Qt)}({certificates:Rue,events:Oue});function Kue(e,t){return e(t={exports:{}},t.exports),t.exports}function jue(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Gue=/javascript\s*\:/gim;var que={whiteList:jue(),getDefaultWhiteList:jue,onAttr:function(e,t,n){},onIgnoreAttr:function(e,t,n){},safeAttrValue:function(e,t){return Gue.test(t)?"":t}},Vue=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},zue=function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")};var Jue=function(e,t){";"!==(e=zue(e))[e.length-1]&&(e+=";");var n=e.length,r=!1,i=0,o=0,a="";function s(){if(!r){var n=Vue(e.slice(i,o)),s=n.indexOf(":");if(-1!==s){var u=Vue(n.slice(0,s)),l=Vue(n.slice(s+1));if(u){var A=t(i,a.length,u,l,n);A&&(a+=A+"; ")}}}i=o+1}for(;o<n;o++){var u=e[o];if("/"===u&&"*"===e[o+1]){var l=e.indexOf("*/",o+2);if(-1===l)break;i=(o=l+1)+1,r=!1}else"("===u?r=!0:")"===u?r=!1:";"===u?r||s():"\n"===u&&s()}return Vue(a)};function Yue(e){return null==e}function Xue(e){e=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{}),e.whiteList=e.whiteList||que.whiteList,e.onAttr=e.onAttr||que.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||que.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||que.safeAttrValue,this.options=e}Xue.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,n=t.whiteList,r=t.onAttr,i=t.onIgnoreAttr,o=t.safeAttrValue,a=Jue(e,(function(e,t,a,s,u){var l=n[a],A=!1;if(!0===l?A=l:"function"==typeof l?A=l(s):l instanceof RegExp&&(A=l.test(s)),!0!==A&&(A=!1),s=o(a,s)){var c,h={position:t,sourcePosition:e,source:u,isWhite:A};return A?Yue(c=r(a,s,h))?a+":"+s:c:Yue(c=i(a,s,h))?void 0:c}}));return a};var Wue=Xue,Zue=Kue((function(e,t){for(var n in t=e.exports=function(e,t){return new Wue(t).process(e)},t.FilterCSS=Wue,que)t[n]=que[n];"undefined"!=typeof window&&(window.filterCSS=e.exports)}));Zue.cssfilter,Zue.FilterCSS;var $ue=function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},ele=function(e,t,n){var r,i;if(Array.prototype.forEach)return e.forEach(t,n);for(r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e)},tle=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},nle=function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},rle=Zue.FilterCSS,ile=Zue.getDefaultWhiteList;function ole(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var ale=new rle;function sle(e){return e.replace(ule,"<").replace(lle,">")}var ule=/</g,lle=/>/g,Ale=/"/g,cle=/"/g,hle=/&#([a-zA-Z0-9]*);?/gim,fle=/:?/gim,dle=/&newline;?/gim,ple=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,gle=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,vle=/u\s*r\s*l\s*\(.*/gi;function yle(e){return e.replace(Ale,""")}function mle(e){return e.replace(cle,'"')}function wle(e){return e.replace(hle,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function ble(e){return e.replace(fle,":").replace(dle," ")}function Ile(e){for(var t="",n=0,r=e.length;n<r;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return tle(t)}function Ble(e){return e=Ile(e=ble(e=wle(e=mle(e))))}function Ele(e){return e=sle(e=yle(e))}var Cle=function(e,t,n,r){if(n=Ble(n),"href"===t||"src"===t){if("#"===(n=tle(n)))return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===t){if(ple.lastIndex=0,ple.test(n))return""}else if("style"===t){if(gle.lastIndex=0,gle.test(n))return"";if(vle.lastIndex=0,vle.test(n)&&(ple.lastIndex=0,ple.test(n)))return"";!1!==r&&(n=(r=r||ale).process(n))}return n=Ele(n)},xle=function(e,t){"function"!=typeof t&&(t=function(){});var n=!Array.isArray(e),r=[],i=!1;return{onIgnoreTag:function(o,a,s){if(function(t){return!!n||-1!==$ue(e,t)}(o)){if(s.isClosing){var u="[/removed]",l=s.position+u.length;return r.push([!1!==i?i:s.position,l]),i=!1,u}return i||(i=s.position),"[removed]"}return t(o,a,s)},remove:function(e){var t="",n=0;return ele(r,(function(r){t+=e.slice(n,r[0]),n=r[1]})),t+=e.slice(n)}}},kle=function(e){for(var t="",n=0;n<e.length;){var r=e.indexOf("\x3c!--",n);if(-1===r){t+=e.slice(n);break}t+=e.slice(n,r);var i=e.indexOf("--\x3e",r);if(-1===i)break;n=i+3}return t},Sle=function(e){var t=e.split("");return t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})),t.join("")},Qle={whiteList:{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},getDefaultWhiteList:ole,onTag:function(e,t,n){},onIgnoreTag:function(e,t,n){},onTagAttr:function(e,t,n){},onIgnoreTagAttr:function(e,t,n){},safeAttrValue:Cle,escapeHtml:sle,escapeQuote:yle,unescapeQuote:mle,escapeHtmlEntities:wle,escapeDangerHtml5Entities:ble,clearNonPrintableCharacter:Ile,friendlyAttrValue:Ble,escapeAttrValue:Ele,onIgnoreTagStripAll:function(){return""},StripTagBody:xle,stripCommentTag:kle,stripBlankChar:Sle,cssFilter:ale,getDefaultCSSWhiteList:ile};function _le(e){var t=nle(e);if(-1===t)var n=e.slice(1,-1);else n=e.slice(1,t+1);return"/"===(n=tle(n).toLowerCase()).slice(0,1)&&(n=n.slice(1)),"/"===n.slice(-1)&&(n=n.slice(0,-1)),n}function Nle(e){return"</"===e.slice(0,2)}var Dle=/[^a-zA-Z0-9_:\.\-]/gim;function Fle(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"="===n?t:-1}}function Ple(e,t){for(;t>0;t--){var n=e[t];if(" "!==n)return"="===n?t:-1}}function Ule(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}var Lle=function(e,t,n){var r="",i=0,o=!1,a=!1,s=0,u=e.length,l="",A="";e:for(s=0;s<u;s++){var c=e.charAt(s);if(!1===o){if("<"===c){o=s;continue}}else if(!1===a){if("<"===c){r+=n(e.slice(i,s)),o=s,i=s;continue}if(">"===c){r+=n(e.slice(i,o)),l=_le(A=e.slice(o,s+1)),r+=t(o,r.length,l,A,Nle(A)),i=s+1,o=!1;continue}if('"'===c||"'"===c)for(var h=1,f=e.charAt(s-h);""===f.trim()||"="===f;){if("="===f){a=c;continue e}f=e.charAt(s-++h)}}else if(c===a){a=!1;continue}}return i<e.length&&(r+=n(e.substr(i))),r},Mle=function(e,t){var n=0,r=[],i=!1,o=e.length;function a(e,n){if(!((e=(e=tle(e)).replace(Dle,"").toLowerCase()).length<1)){var i=t(e,n||"");i&&r.push(i)}}for(var s=0;s<o;s++){var u,l=e.charAt(s);if(!1!==i||"="!==l)if(!1===i||s!==n||'"'!==l&&"'"!==l||"="!==e.charAt(s-1))if(/\s|\n|\t/.test(l)){if(e=e.replace(/\s|\n|\t/g," "),!1===i){if(-1===(u=Fle(e,s))){a(tle(e.slice(n,s))),i=!1,n=s+1;continue}s=u-1;continue}if(-1===(u=Ple(e,s-1))){a(i,Ule(tle(e.slice(n,s)))),i=!1,n=s+1;continue}}else;else{if(-1===(u=e.indexOf(l,s+1)))break;a(i,tle(e.slice(n+1,u))),i=!1,n=(s=u)+1}else i=e.slice(n,s),n=s+1}return n<e.length&&(!1===i?a(e.slice(n)):a(i,Ule(tle(e.slice(n))))),tle(r.join(" "))},Tle={parseTag:Lle,parseAttr:Mle},Rle=Zue.FilterCSS,Ole=Tle.parseTag,Hle=Tle.parseAttr;function Kle(e){return null==e}function jle(e){e=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=Qle.onIgnoreTagStripAll),e.whiteList=e.whiteList||Qle.whiteList,e.onTag=e.onTag||Qle.onTag,e.onTagAttr=e.onTagAttr||Qle.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||Qle.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||Qle.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||Qle.safeAttrValue,e.escapeHtml=e.escapeHtml||Qle.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Rle(e.css))}jle.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,n=t.whiteList,r=t.onTag,i=t.onIgnoreTag,o=t.onTagAttr,a=t.onIgnoreTagAttr,s=t.safeAttrValue,u=t.escapeHtml,l=this.cssFilter;t.stripBlankChar&&(e=Qle.stripBlankChar(e)),t.allowCommentTag||(e=Qle.stripCommentTag(e));var A=!1;if(t.stripIgnoreTagBody){A=Qle.StripTagBody(t.stripIgnoreTagBody,i);i=A.onIgnoreTag}var c=Ole(e,(function(e,t,A,c,h){var f,d={sourcePosition:e,position:t,isClosing:h,isWhite:n.hasOwnProperty(A)};if(!Kle(f=r(A,c,d)))return f;if(d.isWhite){if(d.isClosing)return"</"+A+">";var p=function(e){var t=nle(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=tle(e.slice(t+1,-1)))[e.length-1];return n&&(e=tle(e.slice(0,-1))),{html:e,closing:n}}(c),g=n[A],v=Hle(p.html,(function(e,t){var n,r=-1!==$ue(g,e);return Kle(n=o(A,e,t,r))?r?(t=s(A,e,t,l))?e+'="'+t+'"':e:Kle(n=a(A,e,t,r))?void 0:n:n}));c="<"+A;return v&&(c+=" "+v),p.closing&&(c+=" /"),c+=">"}return Kle(f=i(A,c,d))?u(c):f}),u);return A&&(c=A.remove(c)),c};var Gle=jle,qle=Kue((function(e,t){function n(e,t){return new Gle(t).process(e)}for(var r in(t=e.exports=n).filterXSS=n,t.FilterXSS=Gle,Qle)t[r]=Qle[r];for(var r in Tle)t[r]=Tle[r];"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}));qle.xss,qle.filterXSS,qle.FilterXSS;var Vle=n(n({},Zue.getDefaultWhiteList()),{},{bottom:!0,left:!0,float:!0,overflow:!0,position:!0,right:!0,top:!0,transform:!0,opacity:!0,"transform-origin":!0,"flex-direction":!0,"flex-wrap":!0,"justify-content":!0,"align-items":!0,"white-space":!0,"line-height":!0,"grid-template-columns":!0,"grid-template-rows":!0,"grid-column":!0,"grid-row":!0,"grid-area":!0,"align-self":!0,"justify-self":!0,span:!0});var zle=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Jle=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Yle=/u\s*r\s*l\s*\(.*/gi,Xle={whiteList:function(){var e=qle.getDefaultWhiteList();return Object.keys(e).forEach((function(t){e[t].push("style"),e[t].push("class"),e[t].push("download")})),e}(),css:!1,stripIgnoreTagBody:!0,onTagAttr:function(e,t,n,r){if("style"===t)return"".concat(t,'="').concat(Zue(n,{whiteList:Vle}).replace(/; /g,";"),'"');if("img"===e&&"src"===t&&function(e){return!!e.match(/^data:.+;base64,/)}(n)){var i=function(e){return e.split("base64,")[1]}(n);try{return atob(i),"".concat(t,'="').concat(n,'"')}catch(e){return t}}},safeAttrValue:function(e,t,n,r){if(n=qle.friendlyAttrValue(n),"href"===t||"src"===t){if("#"===(n=function(e){if(String.prototype.trim)return e.trim();return e.replace(/(^\s*)|(\s*$)/g,"")}(n)))return"#";if(!function(e){return["http://","https://","mailto:","tel:","data:","#","/"].some((function(t){return e.substr(0,t.length)===t}))}(n))return""}else if("background"===t){if(zle.lastIndex=0,zle.test(n))return""}else if("style"===t){if(Jle.lastIndex=0,Jle.test(n))return"";if(Yle.lastIndex=0,Yle.test(n)&&(zle.lastIndex=0,zle.test(n)))return"";!1!==r&&(n=(r=r||qle.getDefaultCSSWhiteList()).process(n))}return n=qle.escapeAttrValue(n)}},Wle=new qle.FilterXSS(Xle);function Zle(e){return Wle.process(e)}function $le(e){const t=so("date","pattern");"Z"===e.slice(-1)?e=e.slice(0,e.length-1):e.includes("+")&&(e=e.split("+")[0]);const n=new Date(e);let r=function(e,t){const n=so("date","months");return e.replace("MM",n[t])}(t,n.getMonth());return r=function(e,t){return e.replace("DD",t)}(r,n.getDate().toString(10)),r=function(e,t){return e.replace("YYYY",t)}(r,n.getFullYear().toString(10)),r}function eAe(e){return e.certificateDefinition}function tAe(e){const t=eAe(e);return t?t.signers:[]}function nAe(e){const t=eAe(e);return t?t.issuedOn:""}function rAe(e){return eAe(e)?$le(nAe(e)):""}function iAe(e){const t=eAe(e);return t?t.recipientFullName:""}function oAe(e){const t=eAe(e);return t?t.name:""}function aAe(e){const t=eAe(e);return t?t.issuer.name:""}function sAe(e){const t=eAe(e);return t?t.issuer.image:""}function uAe(e){const t=eAe(e);if(!t)return"";const{displayHtml:n}=t.certificateJson;if(n)return Zle(n);const r=t.display;if(r)switch(r.contentMediaType){case St.TEXT_HTML:return Zle(r.content);case St.IMAGE_PNG:case St.IMAGE_JPEG:case St.IMAGE_GIF:case St.IMAGE_BMP:return`<img src="data:${r.contentMediaType};${r.contentEncoding},${r.content}"/>`;case St.APPLICATION_PDF:return`<embed width="100%" height="100%" type="application/pdf" src="data:${r.contentMediaType};${r.contentEncoding},${r.content}"/>`;default:return""}return""}function lAe(e){const t=eAe(e);return t&&XJ(t.recordLink)?t.recordLink:""}function AAe(e){const t=lAe(e);return t?Hue.certificates.download(t):""}function cAe(e){const t=eAe(e);if(t)try{return JSON.parse(t.metadataJson)}catch(e){return null}return null}function hAe(e){var t;const n=tAe(e);return 0===n.length?null!==(t=CAe(e,"transactionLink"))&&void 0!==t?t:[]:n.map((e=>e.transactionLink))}function fAe(e){var t;const n=tAe(e);return 0===n.length?null!==(t=CAe(e,"transactionId"))&&void 0!==t?t:[]:n.map((e=>e.transactionId))}function dAe(e){const t=tAe(e);if(0===t.length){const t=CAe(e,"chain");return t?t.map((e=>null==e?void 0:e.name)):[]}return t.map((e=>{var t;return null===(t=e.chain)||void 0===t?void 0:t.name}))}function pAe(e){return dAe(e).some((e=>"Mocknet"===e||(null==e?void 0:e.includes("Testnet"))))}function gAe(e,t){const n=dAe(e)[t];return!!n&&("Mocknet"===n||n.includes("Testnet"))}function vAe(e){return e.verifiedSteps||[]}function yAe(e,t){return vAe(e).find((e=>e.code===t))}function mAe(e){return vAe(e).some((e=>e.status===Vx.FAILURE))}function wAe(e){return e.finalStep}function bAe(e){return tAe(e).map((e=>e.issuerPublicKey))}function IAe(e){return tAe(e).map((e=>e.issuerProfileUrl))}function BAe(e){return tAe(e).map((e=>e.issuerProfileDomain))}function EAe(e){return tAe(e).map((e=>e.signatureSuiteType))}function CAe(e,t){const n=eAe(e);return n?[n[t]]:null}function xAe(e){const t=eAe(e);return t?t.certificateImage:""}function kAe(e){const t=eAe(e);return t?t.subtitle:""}function SAe(e){const t=eAe(e);return t?t.description:""}function QAe(e){const t=eAe(e);return t?t.signatureImage:""}function _Ae(e){const t=eAe(e);return t?t.sealImage:""}function NAe(e){return e.isGeneratingPDF}function DAe(e,t){switch(t.type){case mt:return function(e,t){var r=t.payload.resetSteps;return n(n({},e),{},{verifiedSteps:r})}(e,t);case dt:return function(e,t){return n(n({},e),t.payload.options)}(e,t);case pt:return function(e,t){return n(n(n({},e),t.payload),t.payload.certificateDefinition&&{verifiedSteps:Hue.certificates.initializeVerificationSteps(t.payload.certificateDefinition)})}(e,t);case gt:return function(e,t){return n(n({},e),{},{certificateDefinition:t.payload.definition})}(e,t);case vt:return function(e,t){return n(n({},e),{},{input:n(n({},e.input),{},{certificateUrl:t.payload.url})})}(e,t);case bt:return function(e,t){var n=t.payload,r=n.parentStepCode,i=n.status;return yAe(e,r).status=i,e}(e,t);case yt:return function(e,t){return n(n({},e),{},{input:n(n({},e.input),{},{isValid:t.payload.isValid})})}(e,t);case Et:return function(e,t){var r=t.payload.errorMessage;return n(n({},e),{},{errorMessage:r})}(e,t);case Ct:return function(e,t){return n(n({},e),{},{showVerificationModal:t.payload.showVerificationModal})}(e,t);case wt:return function(e,t){const{parentStep:n}=t.payload;return function(e,t){var n;let r=e.subSteps.findIndex((e=>e.code===t.code));r>-1?e.subSteps[r]=t:(null===(n=e.suites)||void 0===n?void 0:n.length)&&e.suites.forEach((e=>{r=e.subSteps.findIndex((e=>e.code===t.code)),r>-1&&(e.subSteps[r]=t)}))}(yAe(e,n),t.payload),e}(e,t);case It:return function(e,t){return n(n({},e),{},{verificationStatus:t.payload.status})}(e,t);case Bt:return function(e,t){return n(n({},e),{},{finalStep:t.payload.finalStep})}(e,t);case xt:return function(e,t){return Object.assign(Object.assign({},e),{isGeneratingPDF:t.payload.isGeneratingPDF})}(e,t);default:return e}}var FAe="full",PAe="bright",UAe="dark";function LAe(e={}){return Object.assign({input:{},verifiedSteps:[],finalStep:null,verificationStatus:Vx.DEFAULT,showVerificationModal:!1,displayMode:"card",disableDownloadPdf:!1,theme:PAe},e)}const MAe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:LAe(),t=[At];return ot(DAe,e,ut.apply(void 0,t))}();function TAe(e,{mapDispatchToProps:t={},mapStateToProps:n=(()=>({})),ownProps:r={}}){return class extends(function(e){return function(t){return function(t){c(r,t);var n=b(r);function r(){return s(this,r),n.apply(this,arguments)}return l(r,[{key:"connectedCallback",value:function(){var t=this;B(h(r.prototype),"connectedCallback",this)&&B(h(r.prototype),"connectedCallback",this).call(this),this._storeUnsubscribe=e.subscribe((function(){return t.stateChanged(e.getState())})),this.stateChanged(e.getState())}},{key:"disconnectedCallback",value:function(){this._storeUnsubscribe(),B(h(r.prototype),"disconnectedCallback",this)&&B(h(r.prototype),"disconnectedCallback",this).call(this)}},{key:"stateChanged",value:function(e){}}]),r}(t)}}(MAe)(Xe)){mapDispatchToProps(){return function(e,t){if("function"==typeof e)return at(e,t);if("object"!==i(e)||null===e)throw new Error(et(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=at(o,t))}return n}(t,MAe.dispatch)}mapStateToProps(e){return n(MAe.getState(),e)}static get properties(){return r}_render(t){const n=Object.assign(Object.assign(Object.assign({},this.mapDispatchToProps()),this.mapStateToProps(t)),t);return qe`${e(n)}`}_stateChanged(e){this._requestRender()}}}function RAe(e){return{type:Et,payload:{errorMessage:e}}}function OAe(e){return function(t){t({type:yt,payload:{isValid:e}}),t(RAe(e?null:"errors.invalidUrl"))}}function HAe(e){return e.status===Vx.SUCCESS}function KAe(e){return e.status===Vx.FAILURE}function jAe(e){return function(t,n){if(null==e)return;const r=yAe(n(),e);let i=r.status;i===Vx.DEFAULT&&function(e){var t,n;let r=!0;return(null===(t=e.suites)||void 0===t?void 0:t.length)&&(r=null===(n=e.suites)||void 0===n?void 0:n.flatMap((e=>e.subSteps)).some(HAe)),r||e.subSteps.some(HAe)}(r)&&(i=Vx.STARTING),i!==Vx.DEFAULT&&function(e){var t,n;let r=!0;return(null===(t=e.suites)||void 0===t?void 0:t.length)&&(r=null===(n=e.suites)||void 0===n?void 0:n.flatMap((e=>e.subSteps)).every(HAe)),r&&e.subSteps.every(HAe)}(r)&&(i=Vx.SUCCESS),function(e){var t,n;let r=!1;return(null===(t=e.suites)||void 0===t?void 0:t.length)&&(r=null===(n=e.suites)||void 0===n?void 0:n.flatMap((e=>e.subSteps)).some(KAe)),r||e.subSteps.some(KAe)}(r)&&(i=Vx.FAILURE),t({type:bt,payload:{parentStepCode:e,status:i}})}}const GAe=new(function(){function e(){s(this,e),this.queue=[],this.dispatchCb=null,this.isExecuting=!1,this.intervalId=null,this.dispatchNext=this.dispatchNext.bind(this)}return l(e,[{key:"registerCb",value:function(e){this.dispatchCb=e}},{key:"push",value:function(e){this.queue.push(e)}},{key:"dispatchNext",value:function(){var e=this.queue.shift();e?this.dispatchCb(e):this.intervalId&&(this.isExecuting=!1,clearInterval(this.intervalId))}},{key:"execute",value:function(){!this.isExecuting&&this.queue.length&&(this.isExecuting=!0,this.intervalId=setInterval(this.dispatchNext,200))}}]),e}());function qAe(e){return function(t,n){const r=function(e){return function(t){e({type:wt,payload:t}),e(jAe(t.parentStep))}}(t);GAe.dispatchCb||GAe.registerCb(r),GAe.push(e),GAe.execute()}}function VAe(){return function(e,t){var n=eAe(t()),r=[];n&&(r=Hue.certificates.initializeVerificationSteps(n)),e({type:mt,payload:{resetSteps:r}})}}function zAe(e){return{type:It,payload:{status:e}}}function JAe(e){return e.disableVerify}function YAe(e){return e.allowDownload}function XAe(e){return e.disableDownloadPdf}function WAe(e){return e.allowSocialShare}function ZAe(e){return e.showMetadata}function $Ae(e){return e.displayMode}function ece(e){return e.theme}function tce(e){return e.locale}function nce(e){return e.explorerAPIs}function rce(e){return e.clickableUrls}function ice(e){return e.didResolverUrl}function oce(e){return"string"==typeof e&&(e={label:e}),{type:Bt,payload:{finalStep:e}}}function ace(){return function(e,t){return Lt(this,void 0,void 0,(function*(){const n=t();if(JAe(n))return void console.warn("Verification is disabled");e({type:"VERIFY_CERTIFICATE"}),e(zAe(Vx.STARTING)),e(VAe());const r=eAe(n);if(r){Hue.events.dispatch("certificate-verify",r);const t=yield r.verify((t=>{e(qAe(t))}));e(oce(t.message)),e(zAe(t.status))}}))}}function sce(e){return{type:Ct,payload:{showVerificationModal:e}}}function uce(e){return function(t,n){return Lt(this,void 0,void 0,(function*(){const r=n(),i={locale:tce(r),explorerAPIs:nce(r),didResolverUrl:ice(r)},{certificateDefinition:o,errorMessage:a}=yield Hue.certificates.parse(e,i);t(RAe(a)),t({type:pt,payload:{certificateDefinition:o}}),Hue.events.dispatch("certificate-load",o),null!=o&&(yield t((function(e,t){return Lt(this,void 0,void 0,(function*(){(function(e){return e.disableAutoVerify})(t())||(e({type:ft}),e(sce(!0))),yield e(ace())}))})))}))}}function lce(e){return function(){var t=a(r().mark((function t(n){var i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Hue.certificates.isPathToCertificateValidURI(e),n(OAe(i)),i){t.next=4;break}return t.abrupt("return",null);case 4:return n({type:vt,payload:{url:e}}),t.next=7,Hue.certificates.retrieve(e);case 7:if(!(o=t.sent).certificateDefinition){t.next=13;break}return t.next=11,n(uce(o.certificateDefinition));case 11:t.next=14;break;case 13:n(RAe(o.errorMessage));case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}var Ace=/(-\w)/g,cce=function(e){return e[1].toUpperCase()};var hce,fce={src:String,"disable-auto-verify":Boolean,"disable-verify":Boolean,"allow-download":Boolean,"disable-download-pdf":Boolean,"allow-social-share":Boolean,"display-mode":String,"show-metadata":Boolean,"clickable-urls":Boolean,theme:0,locale:String,explorerAPIs:{},"did-resolver-url":String},dce=Object.keys(fce).map((function(e){return e.replace(Ace,cce)})).reduce((function(e,t){return e[t]=fce[t],e}),{});function pce(e){var t,n=Object.keys(oo).map((function(e){return e.toLowerCase()}));if(!(t=n.indexOf(e.toLowerCase())>-1)){var r=e.substr(0,2).toLowerCase(),i=n.map((function(e){return e.split("-")[0]})).indexOf(r);(t=i>-1)&&(e=n[i])}return t||(e=ro),function(e){var t=e.split("-");return t.length>1?"".concat(t[0].toLowerCase(),"-").concat(t[1].toUpperCase()):t[0].toLowerCase()}(e)}function gce(e){"auto"!==e&&e||(e=navigator.language||navigator.userLanguage||navigator.browserLanguage||ro),io.locale=pce(e)}var vce,yce=qe(hce||(hce=E(['<style>.buv-c-input{font-size:15px;color:#031532;border-radius:2px 0 0 2px;padding:12px 15px;background-color:#f3f4f5;border:solid 1px rgba(3,21,50,.13);box-sizing:border-box;width:100%}.buv-c-input.is-invalid{border:2px solid red}.buv-c-input::-moz-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-c-input::-webkit-input-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-c-input:-moz-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-c-input:-ms-input-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}</style>'])));function mce(e){return void 0===e.input.isValid||e.input.isValid}var wce,bce=TAe((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onInput,n=void 0===t?function(){}:t,r=e.isValid,i=void 0===r||r,o="buv-c-input ".concat(i?"":"is-invalid");return qe(vce||(vce=E(["\n ","\n <label \n for='certificate-json-url'\n class='buv-u-visually-hidden'>","</label>\n <input \n type='text'\n id='certificate-json-url'\n placeholder='","'\n class$='","'\n on-input='","'\n />\n "])),yce,so("text.urlInput"),so("text.urlInputPlaceholder"),o,(function(e){n(e.target.value)}))}),{mapDispatchToProps:{onInput:lce},mapStateToProps:function(e){return{isValid:mce(e)}}});window.customElements.define("buv-input",bce);var Ice,Bce=qe(wce||(wce=E(["<style>.buv-c-verify-button{background-color:#2ab27b;border-radius:0 2px 2px 0;color:#fff;cursor:pointer;display:block;font-size:15px;font-weight:400;padding:12px 38px;border:1px solid #2ab27b;width:100%}.buv-c-verify-button__label{cursor:pointer}.buv-c-verify-button--hollow{background:#fff;color:#2ab27b;font-weight:100;text-transform:uppercase;padding:12px 30px;font-size:13px}.buv-c-verify-button--link{background:none;color:#031532;border:0;text-decoration:underline;padding:0;margin-top:5px;font-size:13px}.buv-c-verify-button.is-disabled{pointer-events:none}</style>"])));var Ece,Cce={onClick:function(){return function(e){e({type:"START_VERIFICATION_PROCESS"}),e(sce(!0)),e(ace())}}},xce=TAe((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isHollow,n=void 0!==t&&t,r=e.isDisabled,i=void 0!==r&&r,o=e.onClick,a=void 0===o?function(){}:o,s=e.type,u=void 0===s?"":s,l=["buv-c-verify-button",n?"buv-c-verify-button--hollow":"",i?"is-disabled":"","link"===u?"buv-c-verify-button--link":""].join(" ");return qe(Ice||(Ice=E(["\n ","\n <button class$='","' on-click='","' disabled?='","'>\n <label class='buv-c-verify-button__label'><slot>","</slot></label>\n </button>\n "])),Bce,l,a,i,so("text.verify"))}),{mapDispatchToProps:Cce,mapStateToProps:function(e){return{isDisabled:JAe(e)||!eAe(e)}},ownProps:{isHollow:Boolean,type:String}});window.customElements.define("buv-verify-button",xce);var kce,Sce,Qce=qe(Ece||(Ece=E(["<style>.buv-c-certificate-input{display:flex;width:100%;padding:40px 30px;background-color:rgba(255,255,255,.1);border:1px solid rgba(0,0,0,.1);box-sizing:border-box}@media only screen and (max-width: 600px){.buv-c-certificate-input{flex-direction:column;grid-row-gap:10px;height:162px;padding:30px;justify-content:space-between}}.buv-c-certificate-input__input{width:100%}</style>"]))),_ce=TAe((function(e){var t=e.showInput;return void 0===t||t?qe(kce||(kce=E(["\n ",'\n <section class="buv-c-certificate-input buv-qa-certificate-input">\n <buv-input class="buv-c-certificate-input__input"></buv-input><buv-verify-button></buv-verify-button> \n </section>\n'])),Qce):null}),{mapStateToProps:function(e){return{showInput:!eAe(e)}}});window.customElements.define("buv-certificate-input",_ce);var Nce,Dce=qe(Sce||(Sce=E(['<style>.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:rgba(0,0,0,0)}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-c-download-link{text-decoration:none;color:currentColor}.buv-c-download-link--icon{background-image:url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20id%3D%22Capa%5f1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%22433.5px%22%20height%3D%22433.5px%22%20fill%3D%22%236e7e8e%22%20viewBox%3D%220%200%20433.5%20433.5%22%20style%3D%22enable-background%3Anew%200%200%20433.5%20433.5%3B%22%20xml%3Aspace%3D%22preserve%22%0A%09%3E%3Cg%3E%3Cg%20id%3D%22file-download%22%3E%3Cpath%20d%3D%22M395.25%2C153h-102V0h-153v153h-102l178.5%2C178.5L395.25%2C153z%20M38.25%2C382.5v51h357v-51H38.25z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");width:17px;height:17px;background-size:17px}.buv-c-download-link.is-disabled{pointer-events:none}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}</style>'])));var Fce,Pce=TAe((function(e){var t=e.downloadLink,n=e.display;if(!t)return null;var r="plaintext"===(void 0===n?"":n),i=so("text.downloadLink"),o=["buv-c-download-link","buv-o-button-link",r?"":"buv-c-download-link--icon"].join(" ");return qe(Nce||(Nce=E(["\n ","\n <a class$='","' href='","' title$='","'>\n <span class$='","'>","</span>\n </a>"])),Dce,o,t,i,r?"buv-o-button-link__label":"buv-u-visually-hidden",i)}),{mapStateToProps:function(e){return{downloadLink:AAe(e)}},ownProps:{display:String}});window.customElements.define("buv-download-link",Pce);var Uce=qe(Fce||(Fce=E(['<style>.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:rgba(0,0,0,0)}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-c-download-pdf-link{padding:0;color:#2ab27b}.buv-c-download-pdf-link__icon{background-image:url(\'data:image/svg+xml,%3Csvg data-bx-workspace="master" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com" version="1.1" fill="%236e7e8e" id="Capa_1" x="0px" y="0px" width="550.801px" height="550.801px" viewBox="0 0 550.801 550.801"%3E%3Cg style="" transform="matrix(0.855886, 0, 0, 0.855886, 39.688637, 39.689045)"%3E%3Cpath d="M160.381,282.225c0-14.832-10.299-23.684-28.474-23.684c-7.414,0-12.437,0.715-15.071,1.432V307.6 c3.114,0.707,6.942,0.949,12.192,0.949C148.419,308.549,160.381,298.74,160.381,282.225z"%3E%3C/path%3E%3Cpath d="M272.875,259.019c-8.145,0-13.397,0.717-16.519,1.435v105.523c3.116,0.729,8.142,0.729,12.69,0.729 c33.017,0.231,54.554-17.946,54.554-56.474C323.842,276.719,304.215,259.019,272.875,259.019z"%3E%3C/path%3E%3Cpath d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M362.359,309.023c0,30.876-11.243,52.165-26.82,65.333 c-16.971,14.117-42.82,20.814-74.396,20.814c-18.9,0-32.297-1.197-41.401-2.389V234.365c13.399-2.149,30.878-3.346,49.304-3.346 c30.612,0,50.478,5.508,66.039,17.226C351.828,260.69,362.359,280.547,362.359,309.023z M80.7,393.499V234.365 c11.241-1.904,27.042-3.346,49.296-3.346c22.491,0,38.527,4.308,49.291,12.928c10.292,8.131,17.215,21.534,17.215,37.328 c0,15.799-5.25,29.198-14.829,38.285c-12.442,11.728-30.865,16.996-52.407,16.996c-4.778,0-9.1-0.243-12.435-0.723v57.67H80.7 V393.499z M453.601,523.353H97.2V419.302h356.4V523.353z M484.898,262.127h-61.989v36.851h57.913v29.674h-57.913v64.848h-36.593 V232.216h98.582V262.127z"%3E%3C/path%3E%3C/g%3E%3C/svg%3E\');width:25px;height:25px;background-size:25px}.buv-c-download-pdf-link__label--loading{display:none}.buv-c-download-pdf-link--loading{pointer-events:none}.buv-c-download-pdf-link--loading.buv-c-download-pdf-link__icon{background-image:url(\'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin:auto;background:transparent;display:block;" width="25px" height="25px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"%3E%3Ccircle cx="50" cy="50" fill="none" stroke="%23999999" stroke-width="7" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"%3E%3CanimateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"%3E%3C/animateTransform%3E%3C/circle%3E%3C/svg%3E\')}.buv-c-download-pdf-link--loading .buv-c-download-pdf-link__label{color:#999}.buv-c-download-pdf-link--loading .buv-c-download-pdf-link__label--static{display:none}.buv-c-download-pdf-link--loading .buv-c-download-pdf-link__label--loading{display:block}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}</style>'])));function Lce(e){return{type:xt,payload:{isGeneratingPDF:e}}}const Mce={onClick:function(){return function(e,t){return Lt(this,void 0,void 0,(function*(){const n=t(),r=function(e){var t;const n=eAe(e);return n?"displayHtml"in n.certificateJson?St.TEXT_HTML:null===(t=n.display)||void 0===t?void 0:t.contentMediaType:null}(n),i=function(e){var t;const n=eAe(e);return n?"displayHtml"in n.certificateJson?"":null===(t=n.display)||void 0===t?void 0:t.contentEncoding:""}(n),o=function(e){var t,n;const r=eAe(e);return r?"displayHtml"in r.certificateJson?r.certificateJson.displayHtml:null!==(n=null===(t=r.display)||void 0===t?void 0:t.content)&&void 0!==n?n:"":""}(n),a=iAe(n),s=oAe(n),u=rAe(n),l=aAe(n),A=sAe(n),c=lAe(n),h=bAe(n),f=IAe(n),d=BAe(n);e(Lce(!0)),yield Hue.certificates.downloadPDF({contentType:r,contentEncoding:i,content:o,recipientName:a,certificateTitle:s,issueDate:u,issuerName:l,issuerLogo:A,recordLink:c,issuerPublicKey:h,issuerProfileUrl:f,issuerProfileDomain:d}),e(Lce(!1))}))}}},Tce=TAe((function({display:e="plaintext",isGeneratingPDF:t=!1,onClick:n=(()=>{}),isVisible:r=!0}={display:"plaintext",isGeneratingPDF:!1,onClick:()=>{},isVisible:!0}){if(!r)return null;const i="plaintext"===e,o=so("text.downloadPDFLink"),a=so("text.downloadPDFLinkIsLoading"),s=["buv-o-button-link","buv-c-download-pdf-link","buv-js-download-pdf-link",i?"":"buv-c-download-pdf-link__icon",t?"buv-c-download-pdf-link--loading":""].join(" ");return qe`
|
|
659
|
+
a.link={},l[v]=K8(u,l[v],a)),t.abrupt("return",l);case 28:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.expand=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s,u,l,A,c,h,f=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(f.length<1)){t.next=2;break}throw new TypeError("Could not expand, too few arguments.");case 2:if(!1===(o=n(o,{keepFreeFloatingNodes:!1})).expansionMap&&(o.expansionMap=void 0),a={},s=[],"expandContext"in o&&(u=U5.clone(o.expandContext),P8(u)&&"@context"in u?a.expandContext=u:a.expandContext={"@context":u},s.push(a.expandContext)),!U8(i)){t.next=12;break}return t.next=8,e.get(i,o);case 8:A=t.sent,l=A.documentUrl,a.input=A.document,A.contextUrl&&(a.remoteContext={"@context":A.contextUrl},s.push(a.remoteContext)),t.next=13;break;case 12:a.input=U5.clone(i);case 13:return"base"in o||(o.base=l||""),t.next=16,R8(a,o);case 16:return c=M8(o),s.forEach((function(e){c=T8({activeCtx:c,localCtx:e,options:o})})),h=S8({activeCtx:c,element:a.input,options:o,expansionMap:o.expansionMap}),t.abrupt("return",(P8(h)&&"@graph"in h&&1===Object.keys(h).length?h=h["@graph"]:null===h&&(h=[]),F8(h)||(h=[h]),h));case 20:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.flatten=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(A.length<1)){t.next=2;break}return t.abrupt("return",new TypeError("Could not flatten, too few arguments."));case 2:return o="function"==typeof o?null:o||null,a=n(a,{base:U8(i)?i:""}),t.next=5,e.expand(i,a);case 5:if(s=t.sent,u=Q8(s),null!==o){t.next=9;break}return t.abrupt("return",u);case 9:return a.graph=!0,a.skipExpansion=!0,t.next=12,e.compact(u,o,a);case 12:return l=t.sent,t.abrupt("return",l);case 14:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.frame=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A,c,h,f,d,p=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(p.length<2)){t.next=2;break}throw new TypeError("Could not frame, too few arguments.");case 2:if(a=n(a,{base:U8(i)?i:"",embed:"@last",explicit:!1,requireAll:!0,omitDefault:!1,pruneBlankNodeIdentifiers:!0,bnodesToClear:[]}),!U8(o)){t.next=7;break}return t.next=5,e.get(o,a);case 5:s=t.sent,o=s.document,s.contextUrl&&((u=o["@context"])?F8(u)?u.push(s.contextUrl):u=[u,s.contextUrl]:u=s.contextUrl,o["@context"]=u);case 7:return l=o&&o["@context"]||{},t.next=10,e.expand(i,a);case 10:return A=t.sent,(c=U5.clone(a)).isFrame=!0,c.keepFreeFloatingNodes=!0,t.next=15,e.expand(o,c);case 15:return h=t.sent,c.merged=!("@graph"in o),f=D8(A,h,c),c.graph=!0,c.skipExpansion=!0,c.link={},c.framing=!0,t.next=21,e.compact(f,l,c);case 21:return d=t.sent,t.abrupt("return",d);case 23:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.link=U5.callbackify(function(){var t=x8(r().mark((function t(n,i,o){var a;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={},t.abrupt("return",(i&&(a["@context"]=i),a["@embed"]="@link",e.frame(n,a,o)));case 2:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),e.normalize=e.canonize=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s,u,l=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(l.length<1)){t.next=2;break}throw new TypeError("Could not canonize, too few arguments.");case 2:if(!("inputFormat"in(o=n(o,{base:U8(i)?i:"",algorithm:"URDNA2015",skipExpansion:!1})))){t.next=7;break}if("application/n-quads"===o.inputFormat||"application/nquads"===o.inputFormat){t.next=5;break}throw new x5("Unknown canonicalization input format.","jsonld.CanonizeError");case 5:return a=H5.parse(i),t.abrupt("return",a3.canonize(a,o));case 7:return delete(s=U5.clone(o)).format,s.produceGeneralizedRdf=!1,t.next=11,e.toRDF(i,s);case 11:return u=t.sent,t.abrupt("return",a3.canonize(u,o));case 13:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.fromRDF=U5.callbackify(function(){var e=x8(r().mark((function e(i,o){var a,s,u,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(l.length<1)){e.next=2;break}throw new TypeError("Could not convert from RDF, too few arguments.");case 2:if(o=n(o,{format:U8(i)?"application/n-quads":void 0}),a=o.format,u=o.rdfParser,!a){e.next=10;break}if(u=u||t[a]){e.next=8;break}throw new x5("Unknown input format.","jsonld.UnknownFormat",{format:a});case 8:e.next=11;break;case 10:u=function(){return i};case 11:return s=u.length>1?new Promise((function(e,t){u(i,(function(n,r){n?t(n):e(r)}))})):Promise.resolve(u(i)),e.next=14,s;case 14:return s=e.sent,Array.isArray(s)||(s=H5.legacyDatasetToQuads(s)),e.abrupt("return",_8(s,o));case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),e.toRDF=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s,u=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(u.length<1)){t.next=2;break}throw new TypeError("Could not convert to RDF, too few arguments.");case 2:if(!(o=n(o,{base:U8(i)?i:"",skipExpansion:!1})).skipExpansion){t.next=6;break}t.t0=i,t.next=9;break;case 6:return t.next=8,e.expand(i,o);case 8:t.t0=t.sent;case 9:if(a=t.t0,s=N8(a,o),!o.format){t.next=17;break}if("application/n-quads"!==o.format&&"application/nquads"!==o.format){t.next=16;break}return t.next=15,H5.serialize(s);case 15:return t.abrupt("return",t.sent);case 16:throw new x5("Unknown output format.","jsonld.UnknownFormat",{format:o.format});case 17:return t.abrupt("return",s);case 18:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.createNodeMap=U5.callbackify(function(){var t=x8(r().mark((function t(i,o){var a,s=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(s.length<1)){t.next=2;break}throw new TypeError("Could not create node map, too few arguments.");case 2:return o=n(o,{base:U8(i)?i:""}),t.next=5,e.expand(i,o);case 5:return a=t.sent,t.abrupt("return",G8(a,o));case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),e.merge=U5.callbackify(function(){var t=x8(r().mark((function t(i,o,a){var s,u,l,A,c,h,f,d,p,g,v,y,m,w,b,I,B,E=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(E.length<1)){t.next=2;break}throw new TypeError("Could not merge, too few arguments.");case 2:if(F8(i)){t.next=4;break}throw new TypeError('Could not merge, "docs" must be an array.');case 4:return o="function"==typeof o?null:o||null,a=n(a,{}),t.next=7,Promise.all(i.map((function(t){var n=Object.assign({},a);return e.expand(t,n)})));case 7:s=t.sent,u=!0,"mergeNodes"in a&&(u=a.mergeNodes),l=a.issuer||new k8("_:b"),A={"@default":{}},c=0;case 12:if(!(c<s.length)){t.next=29;break}if(h=U5.relabelBlankNodes(s[c],{issuer:new k8("_:b"+c+"-")}),j8(h,f=u||0===c?A:{"@default":{}},"@default",l),f===A){t.next=26;break}t.t0=r().keys(f);case 16:if((t.t1=t.t0()).done){t.next=26;break}if(d=t.t1.value,p=f[d],d in A){t.next=22;break}return A[d]=p,t.abrupt("continue",16);case 22:for(v in g=A[d],p)v in g||(g[v]=p[v]);t.next=16;break;case 26:++c,t.next=12;break;case 29:for(y=q8(A),m=[],w=Object.keys(y).sort(),b=0;b<w.length;++b)I=y[w[b]],L8(I)||m.push(I);if(null!==o){t.next=33;break}return t.abrupt("return",m);case 33:return a.graph=!0,a.skipExpansion=!0,t.next=36,e.compact(m,o,a);case 36:return B=t.sent,t.abrupt("return",B);case 38:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()),Object.defineProperty(e,"documentLoader",{get:function(){return e._documentLoader},set:function(t){return e._documentLoader=U5.normalizeDocumentLoader(t)}}),e.documentLoader=function(){var e=x8(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new x5("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.loadDocument=U5.callbackify(x8(r().mark((function t(){var n=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.documentLoader.apply(null,n));case 1:case"end":return t.stop()}}),t)})))),e.get=U5.callbackify(function(){var t=x8(r().mark((function t(n,i){var o,a;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="function"==typeof i.documentLoader?U5.normalizeDocumentLoader(i.documentLoader):e.documentLoader,t.next=3,o(n);case 3:if(a=t.sent,t.prev=4,a.document){t.next=7;break}throw new x5("No remote document found at the given URL.","jsonld.NullRemoteDocument");case 7:U8(a.document)&&(a.document=JSON.parse(a.document)),t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(4),new x5("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:t.t0,remoteDoc:a});case 13:return t.abrupt("return",a);case 14:case"end":return t.stop()}}),t,null,[[4,10]])})));return function(e,n){return t.apply(this,arguments)}}()),e.processContext=U5.callbackify(function(){var e=x8(r().mark((function e(t,i,o){var a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n(o,{base:""}),null!==i){e.next=2;break}return e.abrupt("return",M8(o));case 2:return i=U5.clone(i),P8(i)&&"@context"in i||(i={"@context":i}),e.next=5,R8(i,o);case 5:return a=e.sent,e.abrupt("return",T8({activeCtx:t,localCtx:a,options:o}));case 7:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),e.getContextValue=d4.getContextValue,e.documentLoaders={},e.documentLoaders.node=p8,e.documentLoaders.xhr=B8,e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new x5('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",H5.parse),e.registerRDFParser("application/nquads",H5.parse),e.registerRDFParser("rdfa-api",function(){function e(){s(this,e)}return l(e,[{key:"parse",value:function(e){for(var t={"@default":[]},n=e.getSubjects(),r=0;r<n.length;++r){var i=n[r];if(null!==i){var o=e.getSubjectTriples(i);if(null!==o){var a=o.predicates;for(var s in a)for(var u=a[s].objects,l=0;l<u.length;++l){var A=u[l],c={};0===i.indexOf("_:")?c.subject={type:"blank node",value:i}:c.subject={type:"IRI",value:i},0===s.indexOf("_:")?c.predicate={type:"blank node",value:s}:c.predicate={type:"IRI",value:s};var h=A.value;if(A.type===J5){var f=new("undefined"==typeof XMLSerializer?i3.XMLSerializer:XMLSerializer);h="";for(var d=0;d<A.value.length;d++)A.value[d].nodeType===O5.ELEMENT_NODE?h+=f.serializeToString(A.value[d]):A.value[d].nodeType===O5.TEXT_NODE&&(h+=A.value[d].nodeValue)}c.object={},A.type===z5?0===A.value.indexOf("_:")?c.object.type="blank node":c.object.type="IRI":(c.object.type="literal",A.type===V5?A.language?(c.object.datatype=q5,c.object.language=A.language):c.object.datatype=Y5:c.object.datatype=A.type),c.object.value=h,t["@default"].push(c)}}}}return t}}]),e}().parse),e.url=Z5,e.util=U5,Object.assign(e,U5),e.promises=e,e.RequestQueue=l8,e.JsonLdProcessor=function(e){var t=function(){function e(){s(this,e)}return l(e,[{key:"toString",value:function(){return"[object JsonLdProcessor]"}}]),e}();return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}(e),z8&&void 0===FY.JsonLdProcessor&&Object.defineProperty(FY,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor}),V8?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),e},Y8=function e(){return J8((function(){return e()}))};J8(Y8);var X8=Y8,W8=UY((function(e){_2.gte(cW.version,"8.6.0")?e.exports=b5:e.exports=X8}));W8.jsonld;var Z8=UY((function(e){!function(t){var n={bytesToHex:function(e){return function(e){return e.map((function(e){return 2,(t=e.toString(16)).length>2?t:Array(2-t.length+1).join("0")+t;var t})).join("")}(e)},hexToBytes:function(e){if(e.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map((function(e){return parseInt(e,16)}))}};e.exports?e.exports=n:t.convertHex=n}(FY)})),$8=UY((function(e){!function(t){var n={bytesToString:function(e){return e.map((function(e){return String.fromCharCode(e)})).join("")},stringToBytes:function(e){return e.split("").map((function(e){return e.charCodeAt(0)}))}};n.UTF8={bytesToString:function(e){return decodeURIComponent(escape(n.bytesToString(e)))},stringToBytes:function(e){return n.stringToBytes(unescape(encodeURIComponent(e)))}},e.exports?e.exports=n:t.convertString=n}(FY)})),e9=UY((function(e){!function(t){var n={};e.exports?(n.bytesToHex=Z8.bytesToHex,n.convertString=$8,e.exports=a):(n.bytesToHex=t.convertHex.bytesToHex,n.convertString=t.convertString,t.sha256=a);var r=[];!function(){function e(e){for(var t=Math.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(r[i]=t(Math.pow(n,1/3)),i++),n++}();var i=[],o=function(e,t,n){for(var o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],A=e[5],c=e[6],h=e[7],f=0;f<64;f++){if(f<16)i[f]=0|t[n+f];else{var d=i[f-15],p=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=i[f-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;i[f]=p+i[f-7]+v+i[f-16]}var y=o&a^o&s^a&s,m=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),w=h+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&A^~l&c)+r[f]+i[f];h=c,c=A,A=l,l=u+w|0,u=s,s=a,a=o,o=w+(m+y)|0}e[0]=e[0]+o|0,e[1]=e[1]+a|0,e[2]=e[2]+s|0,e[3]=e[3]+u|0,e[4]=e[4]+l|0,e[5]=e[5]+A|0,e[6]=e[6]+c|0,e[7]=e[7]+h|0};function a(e,t){e.constructor===String&&(e=n.convertString.UTF8.stringToBytes(e));var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t}(e),a=8*e.length;i[a>>5]|=128<<24-a%32,i[15+(a+64>>9<<4)]=a;for(var s=0;s<i.length;s+=16)o(r,i,s);var u=function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t}(r);return t&&t.asBytes?u:t&&t.asString?n.convertString.bytesToString(u):n.bytesToHex(u)}a.x2=function(e,t){return a(a(e,{asBytes:!0}),t)}}(FY)}));function t9(e){e=e.trim();for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t}function n9(e,t){return sY(this,void 0,void 0,r().mark((function n(){var i,o,a,s;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e["@context"],o=e,!function(e){return e===oY.V1_1||e===oY.V1_2}(t)&&(i.find((function(e){return e===Object(e)&&"@vocab"in e}))?i=null:i.push({"@vocab":"http://fallback.org/"})),a="undefined"!=typeof window&&void 0!==window.XMLHttpRequest?W8.documentLoaders.xhr():W8.documentLoaders.node(),W8.documentLoader=function(e,t){return e in bY?t(null,{contextUrl:null,document:bY[e],documentUrl:e}):a(e,t)},s={algorithm:"URDNA2015",format:"application/nquads"},n.abrupt("return",(i&&(s.expandContext=i),new Promise((function(e,t){W8.normalize(o,s,(function(n,r){if(n)console.error(n),t(new NY("computeLocalHash",CY("errors","failedJsonLdNormalization")));else{var i=function(e){var t=/<http:\/\/fallback\.org\/(.*)>/.exec(e);if(t){for(var n=[],r=0;r<t.length;r++)n.push(t[r]);return n}return null}(r);i?t(new NY("computeLocalHash","".concat(CY("errors","foundUnmappedFields"),": ").concat(i.join(", ")))):e(e9(function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(r)))}}))}))));case 7:case"end":return n.stop()}}),n)})))}var r9=UY((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),i9=UY((function(e,t){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=OX.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=OX:(r(OX,t),t.Buffer=i),i.prototype=Object.create(n.prototype),r(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return OX.SlowBuffer(e)}}));i9.Buffer;var o9=QZ.EventEmitter;function a9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u9=OX.Buffer,l9=i3.inspect,A9=l9&&l9.custom||"inspect";function c9(e,t,n){u9.prototype.copy.call(e,t,n)}var h9=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u9.alloc(0);for(var t=u9.allocUnsafe(e>>>0),n=this.head,r=0;n;)c9(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u9.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:A9,value:function(e,t){return l9(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a9(Object(n),!0).forEach((function(t){s9(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a9(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function f9(e,t){p9(e,t),d9(e)}function d9(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function p9(e,t){e.emit("error",t)}var g9=function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ZX(p9,this,e)):ZX(p9,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?n._writableState?n._writableState.errorEmitted?ZX(d9,n):(n._writableState.errorEmitted=!0,ZX(f9,n,e)):ZX(f9,n,e):t?(ZX(d9,n),t(e)):ZX(d9,n)})),this)},v9=function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},y9=function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)},m9={};function w9(e,t,n){n||(n=Error);var r=function(e){var n,r;function i(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);r.prototype.name=n.name,r.prototype.code=e,m9[e]=r}function b9(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}w9("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),w9("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(r," ").concat(b9(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+".".length>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(r," ").concat(b9(t,"type"))}return a+". Received type ".concat(i(n))}),TypeError),w9("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),w9("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),w9("ERR_STREAM_PREMATURE_CLOSE","Premature close"),w9("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),w9("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),w9("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),w9("ERR_STREAM_WRITE_AFTER_END","write after end"),w9("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w9("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),w9("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var I9={codes:m9},B9=I9.codes.ERR_INVALID_OPT_VALUE,E9=function(e,t,n,r){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new B9(r?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384};function C9(e){try{if(!FY.localStorage)return!1}catch(e){return!1}var t=FY.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var x9,k9=V9;function S9(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}V9.WritableState=q9;var Q9,_9=function(e,t){if(C9("noDeprecation"))return e;var n=!1;return function(){if(!n){if(C9("throwDeprecation"))throw new Error(t);C9("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}},N9=OX.Buffer,D9=FY.Uint8Array||function(){},F9=E9,P9=I9.codes,U9=P9.ERR_INVALID_ARG_TYPE,L9=P9.ERR_METHOD_NOT_IMPLEMENTED,M9=P9.ERR_MULTIPLE_CALLBACK,T9=P9.ERR_STREAM_CANNOT_PIPE,R9=P9.ERR_STREAM_DESTROYED,O9=P9.ERR_STREAM_NULL_VALUES,H9=P9.ERR_STREAM_WRITE_AFTER_END,K9=P9.ERR_UNKNOWN_ENCODING,j9=y9;function G9(){}function q9(e,t,n){x9=x9||e7,e=e||{},"boolean"!=typeof n&&(n=t instanceof x9),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=F9(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var r=!1===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new M9;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(ZX(i,r),ZX(Z9,e,t),e._writableState.errorEmitted=!0,j9(e,r)):(i(r),e._writableState.errorEmitted=!0,j9(e,r),Z9(e,t))}(e,n,r,t,i);else{var o=X9(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||Y9(e,n),r?ZX(J9,e,n,o,i):J9(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new S9(this)}function V9(e){var t=this instanceof(x9=x9||e7);if(!t&&!Q9.call(V9,this))return new V9(e);this._writableState=new q9(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o9.call(this)}function z9(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new R9("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function J9(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),Z9(e,t)}function Y9(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var a=0,s=!0;n;)i[a]=n,n.isBuf||(s=!1),n=n.next,a+=1;i.allBuffers=s,z9(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new S9(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,A=n.callback;if(z9(e,t,!1,t.objectMode?1:u.length,u,l,A),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function X9(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function W9(e,t){e._final((function(n){t.pendingcb--,n&&j9(e,n),t.prefinished=!0,e.emit("prefinish"),Z9(e,t)}))}function Z9(e,t){var n=X9(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,ZX(W9,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}r9(V9,o9),q9.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(q9.prototype,"buffer",{get:_9((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(Q9=Function.prototype[Symbol.hasInstance],Object.defineProperty(V9,Symbol.hasInstance,{value:function(e){return!!Q9.call(this,e)||this===V9&&e&&e._writableState instanceof q9}})):Q9=function(e){return e instanceof this},V9.prototype.pipe=function(){j9(this,new T9)},V9.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,a=!i.objectMode&&(r=e,N9.isBuffer(r)||r instanceof D9);return a&&!N9.isBuffer(e)&&(e=function(e){return N9.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=G9),i.ending?function(e,t){var n=new H9;j9(e,n),ZX(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new O9:"string"==typeof n||t.objectMode||(i=new U9("chunk",["string","Buffer"],n)),!i||(j9(e,i),ZX(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=N9.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else z9(e,t,!1,s,r,i,o);return u}(this,i,a,e,t,n)),o},V9.prototype.cork=function(){this._writableState.corked++},V9.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||Y9(this,e))},V9.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new K9(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(V9.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(V9.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),V9.prototype._write=function(e,t,n){n(new L9("_write()"))},V9.prototype._writev=null,V9.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,Z9(e,t),n&&(t.finished?ZX(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(V9.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(V9.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),V9.prototype.destroy=g9,V9.prototype._undestroy=v9,V9.prototype._destroy=function(e,t){t(e)};var $9=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},e7=i7;r9(i7,O7);for(var t7=$9(k9.prototype),n7=0;n7<t7.length;n7++){var r7=t7[n7];i7.prototype[r7]||(i7.prototype[r7]=k9.prototype[r7])}function i7(e){if(!(this instanceof i7))return new i7(e);O7.call(this,e),k9.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",o7)))}function o7(){this._writableState.ended||ZX(a7,this)}function a7(e){e.end()}Object.defineProperty(i7.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(i7.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(i7.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(i7.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});var s7=i9.Buffer,u7=s7.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},l7=A7;function A7(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(s7.isEncoding===u7||!u7(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f7,this.end=d7,t=4;break;case"utf8":this.fillLast=h7,t=4;break;case"base64":this.text=p7,this.end=g7,t=3;break;default:return this.write=v7,void(this.end=y7)}this.lastNeed=0,this.lastTotal=0,this.lastChar=s7.allocUnsafe(t)}function c7(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function h7(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f7(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d7(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p7(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g7(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v7(e){return e.toString(this.encoding)}function y7(e){return e&&e.length?this.write(e):""}A7.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},A7.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},A7.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=c7(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=c7(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=c7(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},A7.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var m7={StringDecoder:l7},w7=I9.codes.ERR_STREAM_PREMATURE_CLOSE;function b7(){}var I7,B7=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),r=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(r||b7);var i=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,a=function(){t.writable||u()},s=t._writableState&&t._writableState.finished,u=function(){o=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,A=function(){i=!1,l=!0,o||r.call(t)},c=function(e){r.call(t,e)},h=function(){var e;return i&&!l?(t._readableState&&t._readableState.ended||(e=new w7),r.call(t,e)):o&&!s?(t._writableState&&t._writableState.ended||(e=new w7),r.call(t,e)):void 0},f=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",h),t.req?f():t.on("request",f)):o&&!t._writableState&&(t.on("end",a),t.on("close",a)),t.on("end",A),t.on("finish",u),!1!==n.error&&t.on("error",c),t.on("close",h),function(){t.removeListener("complete",u),t.removeListener("abort",h),t.removeListener("request",f),t.req&&t.req.removeListener("finish",u),t.removeListener("end",a),t.removeListener("close",a),t.removeListener("finish",u),t.removeListener("end",A),t.removeListener("error",c),t.removeListener("close",h)}};function E7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var C7=Symbol("lastResolve"),x7=Symbol("lastReject"),k7=Symbol("error"),S7=Symbol("ended"),Q7=Symbol("lastPromise"),_7=Symbol("handlePromise"),N7=Symbol("stream");function D7(e,t){return{value:e,done:t}}function F7(e){var t=e[C7];if(null!==t){var n=e[N7].read();null!==n&&(e[Q7]=null,e[C7]=null,e[x7]=null,t(D7(n,!1)))}}function P7(e){ZX(F7,e)}var U7,L7=Object.getPrototypeOf((function(){})),M7=Object.setPrototypeOf((E7(I7={get stream(){return this[N7]},next:function(){var e=this,t=this[k7];if(null!==t)return Promise.reject(t);if(this[S7])return Promise.resolve(D7(void 0,!0));if(this[N7].destroyed)return new Promise((function(t,n){ZX((function(){e[k7]?n(e[k7]):t(D7(void 0,!0))}))}));var n,r=this[Q7];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[S7]?n(D7(void 0,!0)):t[_7](n,r)}),r)}}(r,this));else{var i=this[N7].read();if(null!==i)return Promise.resolve(D7(i,!1));n=new Promise(this[_7])}return this[Q7]=n,n}},Symbol.asyncIterator,(function(){return this})),E7(I7,"return",(function(){var e=this;return new Promise((function(t,n){e[N7].destroy(null,(function(e){e?n(e):t(D7(void 0,!0))}))}))})),I7),L7),T7=function(e){var t,n=Object.create(M7,(E7(t={},N7,{value:e,writable:!0}),E7(t,C7,{value:null,writable:!0}),E7(t,x7,{value:null,writable:!0}),E7(t,k7,{value:null,writable:!0}),E7(t,S7,{value:e._readableState.endEmitted,writable:!0}),E7(t,_7,{value:function(e,t){var r=n[N7].read();r?(n[Q7]=null,n[C7]=null,n[x7]=null,e(D7(r,!1))):(n[C7]=e,n[x7]=t)},writable:!0}),t));return n[Q7]=null,B7(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[x7];return null!==t&&(n[Q7]=null,n[C7]=null,n[x7]=null,t(e)),void(n[k7]=e)}var r=n[C7];null!==r&&(n[Q7]=null,n[C7]=null,n[x7]=null,r(D7(void 0,!0))),n[S7]=!0})),e.on("readable",P7.bind(null,n)),n},R7=function(){throw new Error("Readable.from is not available in the browser")},O7=ree;ree.ReadableState=nee;var H7,K7=function(e,t){return e.listeners(t).length},j7=OX.Buffer,G7=FY.Uint8Array||function(){};H7=i3&&i3.debuglog?i3.debuglog("stream"):function(){};var q7,V7,z7,J7=E9,Y7=I9.codes,X7=Y7.ERR_INVALID_ARG_TYPE,W7=Y7.ERR_STREAM_PUSH_AFTER_EOF,Z7=Y7.ERR_METHOD_NOT_IMPLEMENTED,$7=Y7.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r9(ree,o9);var eee=y9,tee=["error","close","destroy","pause","resume"];function nee(e,t,n){U7=U7||e7,e=e||{},"boolean"!=typeof n&&(n=t instanceof U7),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=J7(this,e,"readableHighWaterMark",n),this.buffer=new h9,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(q7||(q7=m7.StringDecoder),this.decoder=new q7(e.encoding),this.encoding=e.encoding)}function ree(e){if(U7=U7||e7,!(this instanceof ree))return new ree(e);var t=this instanceof U7;this._readableState=new nee(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o9.call(this)}function iee(e,t,n,r,i){H7("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(H7("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?see(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,uee(e)))}}(e,a);else if(i||(o=function(e,t){var n,r;return r=t,j7.isBuffer(r)||r instanceof G7||"string"==typeof t||void 0===t||e.objectMode||(n=new X7("chunk",["string","Buffer","Uint8Array"],t)),n}(a,t)),o)eee(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===j7.prototype||(t=function(e){return j7.from(e)}(t)),r)a.endEmitted?eee(e,new $7):oee(e,a,t,!0);else if(a.ended)eee(e,new W7);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?oee(e,a,t,!1):lee(e,a)):oee(e,a,t,!1)}else r||(a.reading=!1,lee(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function oee(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&see(e)),lee(e,t)}function aee(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function see(e){var t=e._readableState;H7("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(H7("emitReadable",t.flowing),t.emittedReadable=!0,ZX(uee,e))}function uee(e){var t=e._readableState;H7("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,dee(e)}function lee(e,t){t.readingMore||(t.readingMore=!0,ZX(Aee,e,t))}function Aee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(H7("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function cee(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function hee(e){H7("readable nexttick read 0"),e.read(0)}function fee(e,t){H7("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),dee(e),t.flowing&&!t.reading&&e.read(0)}function dee(e){var t=e._readableState;for(H7("flow",t.flowing);t.flowing&&null!==e.read(););}function pee(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function gee(e){var t=e._readableState;H7("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,ZX(vee,t,e))}function vee(e,t){if(H7("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function yee(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Object.defineProperty(ree.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),ree.prototype.destroy=g9,ree.prototype._undestroy=v9,ree.prototype._destroy=function(e,t){t(e)},ree.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=j7.from(e,t),t=""),n=!0),iee(this,e,t,!1,n)},ree.prototype.unshift=function(e){return iee(this,e,null,!0,!1)},ree.prototype.isPaused=function(){return!1===this._readableState.flowing},ree.prototype.setEncoding=function(e){q7||(q7=m7.StringDecoder);var t=new q7(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},ree.prototype.read=function(e){H7("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return H7("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gee(this):see(this),null;if(0===(e=aee(e,t))&&t.ended)return 0===t.length&&gee(this),null;var r,i=t.needReadable;return H7("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&H7("length less than watermark",i=!0),t.ended||t.reading?H7("reading or ended",i=!1):i&&(H7("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=aee(n,t))),null===(r=e>0?pee(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&gee(this)),null!==r&&this.emit("data",r),r},ree.prototype._read=function(e){eee(this,new Z7("_read()"))},ree.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,H7("pipe count=%d opts=%j",r.pipesCount,t);var i=t&&!1===t.end||e===cW.stdout||e===cW.stderr?h:o;function o(){H7("onend"),e.end()}r.endEmitted?ZX(i):n.once("end",i),e.on("unpipe",(function t(i,f){H7("onunpipe"),i===n&&f&&!1===f.hasUnpiped&&(f.hasUnpiped=!0,H7("cleanup"),e.removeListener("close",A),e.removeListener("finish",c),e.removeListener("drain",a),e.removeListener("error",l),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",h),n.removeListener("data",u),s=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||a())}));var a=function(e){return function(){var t=e._readableState;H7("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&K7(e,"data")&&(t.flowing=!0,dee(e))}}(n);e.on("drain",a);var s=!1;function u(t){H7("ondata");var i=e.write(t);H7("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==yee(r.pipes,e))&&!s&&(H7("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function l(t){H7("onerror",t),h(),e.removeListener("error",l),0===K7(e,"error")&&eee(e,t)}function A(){e.removeListener("finish",c),h()}function c(){H7("onfinish"),e.removeListener("close",A),h()}function h(){H7("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",l),e.once("close",A),e.once("finish",c),e.emit("pipe",n),r.flowing||(H7("pipe resume"),n.resume()),e},ree.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=yee(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},ree.prototype.on=function(e,t){var n=o9.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,H7("on readable",r.length,r.reading),r.length?see(this):r.reading||ZX(hee,this))),n},ree.prototype.addListener=ree.prototype.on,ree.prototype.removeListener=function(e,t){var n=o9.prototype.removeListener.call(this,e,t);return"readable"===e&&ZX(cee,this),n},ree.prototype.removeAllListeners=function(e){var t=o9.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||ZX(cee,this),t},ree.prototype.resume=function(){var e=this._readableState;return e.flowing||(H7("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,ZX(fee,e,t))}(this,e)),e.paused=!1,this},ree.prototype.pause=function(){return H7("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(H7("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},ree.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(H7("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){H7("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<tee.length;o++)e.on(tee[o],this.emit.bind(this,tee[o]));return this._read=function(t){H7("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(ree.prototype[Symbol.asyncIterator]=function(){return void 0===V7&&(V7=T7),V7(this)}),Object.defineProperty(ree.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ree.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ree.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),ree._fromList=pee,Object.defineProperty(ree.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(ree.from=function(e,t){return void 0===z7&&(z7=R7),z7(ree,e,t)});var mee=xee,wee=I9.codes,bee=wee.ERR_METHOD_NOT_IMPLEMENTED,Iee=wee.ERR_MULTIPLE_CALLBACK,Bee=wee.ERR_TRANSFORM_ALREADY_TRANSFORMING,Eee=wee.ERR_TRANSFORM_WITH_LENGTH_0;function Cee(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new Iee);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function xee(e){if(!(this instanceof xee))return new xee(e);e7.call(this,e),this._transformState={afterTransform:Cee.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",kee)}function kee(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?See(this,null,null):this._flush((function(t,n){See(e,t,n)}))}function See(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Eee;if(e._transformState.transforming)throw new Bee;return e.push(null)}r9(xee,e7),xee.prototype.push=function(e,t){return this._transformState.needTransform=!1,e7.prototype.push.call(this,e,t)},xee.prototype._transform=function(e,t,n){n(new bee("_transform()"))},xee.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},xee.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},xee.prototype._destroy=function(e,t){e7.prototype._destroy.call(this,e,(function(e){t(e)}))};var Qee,_ee=Nee;function Nee(e){if(!(this instanceof Nee))return new Nee(e);mee.call(this,e)}r9(Nee,mee),Nee.prototype._transform=function(e,t,n){n(null,e)};var Dee=I9.codes,Fee=Dee.ERR_MISSING_ARGS,Pee=Dee.ERR_STREAM_DESTROYED;function Uee(e){if(e)throw e}function Lee(e,t,n,r){r=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(r);var i=!1;e.on("close",(function(){i=!0})),void 0===Qee&&(Qee=B7),Qee(e,{readable:t,writable:n},(function(e){if(e)return r(e);i=!0,r()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void r(t||new Pee("pipe"))}}function Mee(e){e()}function Tee(e,t){return e.pipe(t)}function Ree(e){return e.length?"function"!=typeof e[e.length-1]?Uee:e.pop():Uee}var Oee=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ree(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Fee("streams");var o=t.map((function(e,n){var a=n<t.length-1;return Lee(e,a,n>0,(function(e){r||(r=e),e&&o.forEach(Mee),a||(o.forEach(Mee),i(r))}))}));return t.reduce(Tee)},Hee=UY((function(e,t){(t=e.exports=O7).Stream=t,t.Readable=t,t.Writable=k9,t.Duplex=e7,t.Transform=mee,t.PassThrough=_ee,t.finished=B7,t.pipeline=Oee}));Hee.Stream,Hee.Readable,Hee.Writable,Hee.Duplex,Hee.Transform,Hee.PassThrough,Hee.finished,Hee.pipeline;var Kee=i9.Buffer,jee=Hee.Transform;function Gee(e){jee.call(this),this._block=Kee.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r9(Gee,jee),Gee.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},Gee.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},Gee.prototype.update=function(e,t){if(function(e,t){if(!Kee.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");Kee.isBuffer(e)||(e=Kee.from(e,t));for(var n=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)n[i++]=e[r++];this._update(),this._blockOffset=0}for(;r<e.length;)n[this._blockOffset++]=e[r++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},Gee.prototype._update=function(){throw new Error("_update is not implemented")},Gee.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},Gee.prototype._digest=function(){throw new Error("_digest is not implemented")};var qee=Gee,Vee=i9.Buffer,zee=new Array(16);function Jee(){qee.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Yee(e,t){return e<<t|e>>>32-t}function Xee(e,t,n,r,i,o,a){return Yee(e+(t&n|~t&r)+i+o|0,a)+t|0}function Wee(e,t,n,r,i,o,a){return Yee(e+(t&r|n&~r)+i+o|0,a)+t|0}function Zee(e,t,n,r,i,o,a){return Yee(e+(t^n^r)+i+o|0,a)+t|0}function $ee(e,t,n,r,i,o,a){return Yee(e+(n^(t|~r))+i+o|0,a)+t|0}r9(Jee,qee),Jee.prototype._update=function(){for(var e=zee,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=Xee(n,r,i,o,e[0],3614090360,7),o=Xee(o,n,r,i,e[1],3905402710,12),i=Xee(i,o,n,r,e[2],606105819,17),r=Xee(r,i,o,n,e[3],3250441966,22),n=Xee(n,r,i,o,e[4],4118548399,7),o=Xee(o,n,r,i,e[5],1200080426,12),i=Xee(i,o,n,r,e[6],2821735955,17),r=Xee(r,i,o,n,e[7],4249261313,22),n=Xee(n,r,i,o,e[8],1770035416,7),o=Xee(o,n,r,i,e[9],2336552879,12),i=Xee(i,o,n,r,e[10],4294925233,17),r=Xee(r,i,o,n,e[11],2304563134,22),n=Xee(n,r,i,o,e[12],1804603682,7),o=Xee(o,n,r,i,e[13],4254626195,12),i=Xee(i,o,n,r,e[14],2792965006,17),n=Wee(n,r=Xee(r,i,o,n,e[15],1236535329,22),i,o,e[1],4129170786,5),o=Wee(o,n,r,i,e[6],3225465664,9),i=Wee(i,o,n,r,e[11],643717713,14),r=Wee(r,i,o,n,e[0],3921069994,20),n=Wee(n,r,i,o,e[5],3593408605,5),o=Wee(o,n,r,i,e[10],38016083,9),i=Wee(i,o,n,r,e[15],3634488961,14),r=Wee(r,i,o,n,e[4],3889429448,20),n=Wee(n,r,i,o,e[9],568446438,5),o=Wee(o,n,r,i,e[14],3275163606,9),i=Wee(i,o,n,r,e[3],4107603335,14),r=Wee(r,i,o,n,e[8],1163531501,20),n=Wee(n,r,i,o,e[13],2850285829,5),o=Wee(o,n,r,i,e[2],4243563512,9),i=Wee(i,o,n,r,e[7],1735328473,14),n=Zee(n,r=Wee(r,i,o,n,e[12],2368359562,20),i,o,e[5],4294588738,4),o=Zee(o,n,r,i,e[8],2272392833,11),i=Zee(i,o,n,r,e[11],1839030562,16),r=Zee(r,i,o,n,e[14],4259657740,23),n=Zee(n,r,i,o,e[1],2763975236,4),o=Zee(o,n,r,i,e[4],1272893353,11),i=Zee(i,o,n,r,e[7],4139469664,16),r=Zee(r,i,o,n,e[10],3200236656,23),n=Zee(n,r,i,o,e[13],681279174,4),o=Zee(o,n,r,i,e[0],3936430074,11),i=Zee(i,o,n,r,e[3],3572445317,16),r=Zee(r,i,o,n,e[6],76029189,23),n=Zee(n,r,i,o,e[9],3654602809,4),o=Zee(o,n,r,i,e[12],3873151461,11),i=Zee(i,o,n,r,e[15],530742520,16),n=$ee(n,r=Zee(r,i,o,n,e[2],3299628645,23),i,o,e[0],4096336452,6),o=$ee(o,n,r,i,e[7],1126891415,10),i=$ee(i,o,n,r,e[14],2878612391,15),r=$ee(r,i,o,n,e[5],4237533241,21),n=$ee(n,r,i,o,e[12],1700485571,6),o=$ee(o,n,r,i,e[3],2399980690,10),i=$ee(i,o,n,r,e[10],4293915773,15),r=$ee(r,i,o,n,e[1],2240044497,21),n=$ee(n,r,i,o,e[8],1873313359,6),o=$ee(o,n,r,i,e[15],4264355552,10),i=$ee(i,o,n,r,e[6],2734768916,15),r=$ee(r,i,o,n,e[13],1309151649,21),n=$ee(n,r,i,o,e[4],4149444226,6),o=$ee(o,n,r,i,e[11],3174756917,10),i=$ee(i,o,n,r,e[2],718787259,15),r=$ee(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},Jee.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Vee.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var ete=Jee,tte=OX.Buffer,nte=new Array(16),rte=[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],ite=[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],ote=[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],ate=[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],ste=[0,1518500249,1859775393,2400959708,2840853838],ute=[1352829926,1548603684,1836072691,2053994217,0];function lte(){qee.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function Ate(e,t){return e<<t|e>>>32-t}function cte(e,t,n,r,i,o,a,s){return Ate(e+(t^n^r)+o+a|0,s)+i|0}function hte(e,t,n,r,i,o,a,s){return Ate(e+(t&n|~t&r)+o+a|0,s)+i|0}function fte(e,t,n,r,i,o,a,s){return Ate(e+((t|~n)^r)+o+a|0,s)+i|0}function dte(e,t,n,r,i,o,a,s){return Ate(e+(t&r|n&~r)+o+a|0,s)+i|0}function pte(e,t,n,r,i,o,a,s){return Ate(e+(t^(n|~r))+o+a|0,s)+i|0}r9(lte,qee),lte.prototype._update=function(){for(var e=nte,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,u=0|this._b,l=0|this._c,A=0|this._d,c=0|this._e,h=0;h<80;h+=1){var f,d;h<16?(f=cte(n,r,i,o,a,e[rte[h]],ste[0],ote[h]),d=pte(s,u,l,A,c,e[ite[h]],ute[0],ate[h])):h<32?(f=hte(n,r,i,o,a,e[rte[h]],ste[1],ote[h]),d=dte(s,u,l,A,c,e[ite[h]],ute[1],ate[h])):h<48?(f=fte(n,r,i,o,a,e[rte[h]],ste[2],ote[h]),d=fte(s,u,l,A,c,e[ite[h]],ute[2],ate[h])):h<64?(f=dte(n,r,i,o,a,e[rte[h]],ste[3],ote[h]),d=hte(s,u,l,A,c,e[ite[h]],ute[3],ate[h])):(f=pte(n,r,i,o,a,e[rte[h]],ste[4],ote[h]),d=cte(s,u,l,A,c,e[ite[h]],ute[4],ate[h])),n=a,a=o,o=Ate(i,10),i=r,r=f,s=c,c=A,A=Ate(l,10),l=u,u=d}var p=this._b+i+A|0;this._b=this._c+o+c|0,this._c=this._d+a+s|0,this._d=this._e+n+u|0,this._e=this._a+r+l|0,this._a=p},lte.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=tte.alloc?tte.alloc(20):new tte(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var gte=lte,vte=i9.Buffer;function yte(e,t){this._block=vte.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}yte.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=vte.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var s=o%r,u=Math.min(i-a,r-s),l=0;l<u;l++)n[s+l]=e[a+l];a+=u,(o+=u)%r==0&&this._update(n)}return this._len+=i,this},yte.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},yte.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var mte=yte,wte=i9.Buffer,bte=[1518500249,1859775393,-1894007588,-899497514],Ite=new Array(80);function Bte(){this.init(),this._w=Ite,mte.call(this,64,56)}function Ete(e){return e<<30|e>>>2}function Cte(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r9(Bte,mte),Bte.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Bte.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=n[u-3]^n[u-8]^n[u-14]^n[u-16];for(var l=0;l<80;++l){var A=~~(l/20),c=0|((t=r)<<5|t>>>27)+Cte(A,i,o,a)+s+n[l]+bte[A];s=a,a=o,o=Ete(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Bte.prototype._hash=function(){var e=wte.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var xte=Bte,kte=i9.Buffer,Ste=[1518500249,1859775393,-1894007588,-899497514],Qte=new Array(80);function _te(){this.init(),this._w=Qte,mte.call(this,64,56)}function Nte(e){return e<<5|e>>>27}function Dte(e){return e<<30|e>>>2}function Fte(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r9(_te,mte),_te.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},_te.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)n[u]=e.readInt32BE(4*u);for(;u<80;++u)n[u]=(t=n[u-3]^n[u-8]^n[u-14]^n[u-16])<<1|t>>>31;for(var l=0;l<80;++l){var A=~~(l/20),c=Nte(r)+Fte(A,i,o,a)+s+n[l]+Ste[A]|0;s=a,a=o,o=Dte(i),i=r,r=c}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},_te.prototype._hash=function(){var e=kte.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var Pte=_te,Ute=i9.Buffer,Lte=[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],Mte=new Array(64);function Tte(){this.init(),this._w=Mte,mte.call(this,64,56)}function Rte(e,t,n){return n^e&(t^n)}function Ote(e,t,n){return e&t|n&(e|t)}function Hte(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Kte(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function jte(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Gte(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}r9(Tte,mte),Tte.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Tte.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,u=0|this._g,l=0|this._h,A=0;A<16;++A)t[A]=e.readInt32BE(4*A);for(;A<64;++A)t[A]=Gte(t[A-2])+t[A-7]+jte(t[A-15])+t[A-16]|0;for(var c=0;c<64;++c){var h=l+Kte(a)+Rte(a,s,u)+Lte[c]+t[c]|0,f=Hte(n)+Ote(n,r,i)|0;l=u,u=s,s=a,a=o+h|0,o=i,i=r,r=n,n=h+f|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0},Tte.prototype._hash=function(){var e=Ute.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var qte=Tte,Vte=i9.Buffer,zte=new Array(64);function Jte(){this.init(),this._w=zte,mte.call(this,64,56)}r9(Jte,qte),Jte.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Jte.prototype._hash=function(){var e=Vte.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Yte=Jte,Xte=i9.Buffer,Wte=[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],Zte=new Array(160);function $te(){this.init(),this._w=Zte,mte.call(this,128,112)}function ene(e,t,n){return n^e&(t^n)}function tne(e,t,n){return e&t|n&(e|t)}function nne(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function rne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ine(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function one(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function ane(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function sne(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function une(e,t){return e>>>0<t>>>0?1:0}r9($te,mte),$te.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},$te.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,u=0|this._gh,l=0|this._hh,A=0|this._al,c=0|this._bl,h=0|this._cl,f=0|this._dl,d=0|this._el,p=0|this._fl,g=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var m=t[y-30],w=t[y-30+1],b=ine(m,w),I=one(w,m),B=ane(m=t[y-4],w=t[y-4+1]),E=sne(w,m),C=t[y-14],x=t[y-14+1],k=t[y-32],S=t[y-32+1],Q=I+x|0,_=b+C+une(Q,I)|0;_=(_=_+B+une(Q=Q+E|0,E)|0)+k+une(Q=Q+S|0,S)|0,t[y]=_,t[y+1]=Q}for(var N=0;N<160;N+=2){_=t[N],Q=t[N+1];var D=tne(n,r,i),F=tne(A,c,h),P=nne(n,A),U=nne(A,n),L=rne(a,d),M=rne(d,a),T=Wte[N],R=Wte[N+1],O=ene(a,s,u),H=ene(d,p,g),K=v+M|0,j=l+L+une(K,v)|0;j=(j=(j=j+O+une(K=K+H|0,H)|0)+T+une(K=K+R|0,R)|0)+_+une(K=K+Q|0,Q)|0;var G=U+F|0,q=P+D+une(G,U)|0;l=u,v=g,u=s,g=p,s=a,p=d,a=o+j+une(d=f+K|0,f)|0,o=i,f=h,i=r,h=c,r=n,c=A,n=j+q+une(A=K+G|0,K)|0}this._al=this._al+A|0,this._bl=this._bl+c|0,this._cl=this._cl+h|0,this._dl=this._dl+f|0,this._el=this._el+d|0,this._fl=this._fl+p|0,this._gl=this._gl+g|0,this._hl=this._hl+v|0,this._ah=this._ah+n+une(this._al,A)|0,this._bh=this._bh+r+une(this._bl,c)|0,this._ch=this._ch+i+une(this._cl,h)|0,this._dh=this._dh+o+une(this._dl,f)|0,this._eh=this._eh+a+une(this._el,d)|0,this._fh=this._fh+s+une(this._fl,p)|0,this._gh=this._gh+u+une(this._gl,g)|0,this._hh=this._hh+l+une(this._hl,v)|0},$te.prototype._hash=function(){var e=Xte.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var lne=$te,Ane=i9.Buffer,cne=new Array(160);function hne(){this.init(),this._w=cne,mte.call(this,128,112)}r9(hne,lne),hne.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},hne.prototype._hash=function(){var e=Ane.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var fne=hne,dne=UY((function(e){var t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n};t.sha=xte,t.sha1=Pte,t.sha224=Yte,t.sha256=qte,t.sha384=fne,t.sha512=lne})),pne=i9.Buffer,gne=Q$.Transform,vne=VZ.StringDecoder;function yne(e){gne.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r9(yne,gne),yne.prototype.update=function(e,t,n){"string"==typeof e&&(e=pne.from(e,t));var r=this._update(e);return this.hashMode?this:(n&&(r=this._toString(r,n)),r)},yne.prototype.setAutoPadding=function(){},yne.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},yne.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},yne.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},yne.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},yne.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},yne.prototype._finalOrDigest=function(e){var t=this.__final()||pne.alloc(0);return e&&(t=this._toString(t,e,!0)),t},yne.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new vne(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r};var mne=yne;function wne(e){mne.call(this,"digest"),this._hash=e}r9(wne,mne),wne.prototype._update=function(e){this._hash.update(e)},wne.prototype._final=function(){return this._hash.digest()};var bne=function(e){return"md5"===(e=e.toLowerCase())?new ete:"rmd160"===e||"ripemd160"===e?new gte:new wne(dne(e))},Ine=i9.Buffer,Bne=Ine.alloc(128);function Ene(e,t){mne.call(this,"digest"),"string"==typeof t&&(t=Ine.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=Ine.concat([t,Bne],64));for(var n=this._ipad=Ine.allocUnsafe(64),r=this._opad=Ine.allocUnsafe(64),i=0;i<64;i++)n[i]=54^t[i],r[i]=92^t[i];this._hash=[n]}r9(Ene,mne),Ene.prototype._update=function(e){this._hash.push(e)},Ene.prototype._final=function(){var e=this._alg(Ine.concat(this._hash));return this._alg(Ine.concat([this._opad,e]))};var Cne=Ene,xne=function(e){return(new ete).update(e).digest()},kne=i9.Buffer,Sne=kne.alloc(128);function Qne(e,t){mne.call(this,"digest"),"string"==typeof t&&(t=kne.from(t));var n="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>n?t=("rmd160"===e?new gte:dne(e)).update(t).digest():t.length<n&&(t=kne.concat([t,Sne],n));for(var r=this._ipad=kne.allocUnsafe(n),i=this._opad=kne.allocUnsafe(n),o=0;o<n;o++)r[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new gte:dne(e),this._hash.update(r)}r9(Qne,mne),Qne.prototype._update=function(e){this._hash.update(e)},Qne.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new gte:dne(this._alg)).update(this._opad).update(e).digest()};var _ne=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new Qne("rmd160",t):"md5"===e?new Cne(xne,t):new Qne(e,t)},Nne=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash160=function(e){var t=bne("sha256").update(e).digest();try{return bne("rmd160").update(t).digest()}catch(e){return bne("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return _ne("sha512",e).update(t).digest()}}));PY(Nne),Nne.hash160,Nne.hmacSHA512;var Dne=i9.Buffer,Fne=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var i=e.charAt(r),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=r}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function A(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return Dne.alloc(0);var n=0;if(" "!==e[n]){for(var r=0,i=0;e[n]===s;)r++,n++;for(var o=(e.length-n)*u+1>>>0,l=new Uint8Array(o);e[n];){var A=t[e.charCodeAt(n)];if(255===A)return;for(var c=0,h=o-1;(0!==A||c<i)&&-1!==h;h--,c++)A+=a*l[h]>>>0,l[h]=A%256>>>0,A=A/256>>>0;if(0!==A)throw new Error("Non-zero carry");i=c,n++}if(" "!==e[n]){for(var f=o-i;f!==o&&0===l[f];)f++;var d=Dne.allocUnsafe(r+(o-f));d.fill(0,0,r);for(var p=r;f!==o;)d[p++]=l[f++];return d}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=Dne.from(t)),!Dne.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*l+1>>>0,A=new Uint8Array(u);i!==o;){for(var c=t[i],h=0,f=u-1;(0!==c||h<r)&&-1!==f;f--,h++)c+=256*A[f]>>>0,A[f]=c%a>>>0,c=c/a>>>0;if(0!==c)throw new Error("Non-zero carry");r=h,i++}for(var d=u-r;d!==u&&0===A[d];)d++;for(var p=s.repeat(n);d<u;++d)p+=e.charAt(A[d]);return p},decodeUnsafe:A,decode:function(e){var t=A(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Pne=i9.Buffer,Une=function(e){function t(t){var n=t.slice(0,-4),r=t.slice(-4),i=e(n);if(!(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3]))return n}return{encode:function(t){var n=e(t);return Fne.encode(Pne.concat([t,n],t.length+4))},decode:function(e){var n=t(Fne.decode(e));if(!n)throw new Error("Invalid checksum");return n},decodeUnsafe:function(e){var n=Fne.decodeUnsafe(e);if(n)return t(n)}}}((function(e){var t=bne("sha256").update(e).digest();return bne("sha256").update(t).digest()})),Lne=UY((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==i(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i3.Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==i(e)&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==i(e))return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=u(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=u(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,A=n;A<s;A+=r)u=l(e,A,A+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var c=1;for(u=l(e,A,e.length,t),A=0;A<a;A++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var A=["","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"],c=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var A=u>>>26,c=67108863&u,h=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=h;f++){var d=l-f|0;A+=(a=(i=0|e.words[d])*(o=0|t.words[f])+c)/67108864|0,c=67108863&a}n.words[l]=0|c,u=0|A}return 0!==u?n.words[l]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?A[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=h[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modn(f).toString(e);r=(d=d.idivn(f)).isZero()?p+r:A[l-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(o),A=this.clone();if(u){for(s=0;!A.isZero();s++)a=A.andln(255),A.iushrn(8),l[s]=a;for(;s<o;s++)l[s]=0}else{for(s=0;s<o-i;s++)l[s]=0;for(s=0;!A.isZero();s++)a=A.andln(255),A.iushrn(8),l[o-s-1]=a}return l},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,n){var r,i,o,a=e.words,s=t.words,u=n.words,l=0,A=0|a[0],c=8191&A,h=A>>>13,f=0|a[1],d=8191&f,p=f>>>13,g=0|a[2],v=8191&g,y=g>>>13,m=0|a[3],w=8191&m,b=m>>>13,I=0|a[4],B=8191&I,E=I>>>13,C=0|a[5],x=8191&C,k=C>>>13,S=0|a[6],Q=8191&S,_=S>>>13,N=0|a[7],D=8191&N,F=N>>>13,P=0|a[8],U=8191&P,L=P>>>13,M=0|a[9],T=8191&M,R=M>>>13,O=0|s[0],H=8191&O,K=O>>>13,j=0|s[1],G=8191&j,q=j>>>13,V=0|s[2],z=8191&V,J=V>>>13,Y=0|s[3],X=8191&Y,W=Y>>>13,Z=0|s[4],$=8191&Z,ee=Z>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,Ae=0|s[8],ce=8191&Ae,he=Ae>>>13,fe=0|s[9],de=8191&fe,pe=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(l+(r=Math.imul(c,H))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(h,H)|0))<<13)|0;l=((o=Math.imul(h,K))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(d,H),i=(i=Math.imul(d,K))+Math.imul(p,H)|0,o=Math.imul(p,K);var ve=(l+(r=r+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(h,G)|0))<<13)|0;l=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),i=(i=Math.imul(v,K))+Math.imul(y,H)|0,o=Math.imul(y,K),r=r+Math.imul(d,G)|0,i=(i=i+Math.imul(d,q)|0)+Math.imul(p,G)|0,o=o+Math.imul(p,q)|0;var ye=(l+(r=r+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(h,z)|0))<<13)|0;l=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,H),i=(i=Math.imul(w,K))+Math.imul(b,H)|0,o=Math.imul(b,K),r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,q)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,q)|0,r=r+Math.imul(d,z)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(p,z)|0,o=o+Math.imul(p,J)|0;var me=(l+(r=r+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(h,X)|0))<<13)|0;l=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(E,H)|0,o=Math.imul(E,K),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,q)|0,r=r+Math.imul(v,z)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,J)|0,r=r+Math.imul(d,X)|0,i=(i=i+Math.imul(d,W)|0)+Math.imul(p,X)|0,o=o+Math.imul(p,W)|0;var we=(l+(r=r+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,K))+Math.imul(k,H)|0,o=Math.imul(k,K),r=r+Math.imul(B,G)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,q)|0,r=r+Math.imul(w,z)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,J)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(d,$)|0,i=(i=i+Math.imul(d,ee)|0)+Math.imul(p,$)|0,o=o+Math.imul(p,ee)|0;var be=(l+(r=r+Math.imul(c,ne)|0)|0)+((8191&(i=(i=i+Math.imul(c,re)|0)+Math.imul(h,ne)|0))<<13)|0;l=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(Q,H),i=(i=Math.imul(Q,K))+Math.imul(_,H)|0,o=Math.imul(_,K),r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(B,z)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,W)|0,r=r+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(d,ne)|0,i=(i=i+Math.imul(d,re)|0)+Math.imul(p,ne)|0,o=o+Math.imul(p,re)|0;var Ie=(l+(r=r+Math.imul(c,oe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ae)|0)+Math.imul(h,oe)|0))<<13)|0;l=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,H),i=(i=Math.imul(D,K))+Math.imul(F,H)|0,o=Math.imul(F,K),r=r+Math.imul(Q,G)|0,i=(i=i+Math.imul(Q,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,r=r+Math.imul(x,z)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,J)|0,r=r+Math.imul(B,X)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,W)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(d,oe)|0,i=(i=i+Math.imul(d,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var Be=(l+(r=r+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((o=o+Math.imul(h,le)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(U,H),i=(i=Math.imul(U,K))+Math.imul(L,H)|0,o=Math.imul(L,K),r=r+Math.imul(D,G)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,q)|0,r=r+Math.imul(Q,z)|0,i=(i=i+Math.imul(Q,J)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,J)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,r=r+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(d,ue)|0,i=(i=i+Math.imul(d,le)|0)+Math.imul(p,ue)|0,o=o+Math.imul(p,le)|0;var Ee=(l+(r=r+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,he)|0)+Math.imul(h,ce)|0))<<13)|0;l=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(T,H),i=(i=Math.imul(T,K))+Math.imul(R,H)|0,o=Math.imul(R,K),r=r+Math.imul(U,G)|0,i=(i=i+Math.imul(U,q)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,q)|0,r=r+Math.imul(D,z)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(F,z)|0,o=o+Math.imul(F,J)|0,r=r+Math.imul(Q,X)|0,i=(i=i+Math.imul(Q,W)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,W)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,le)|0,r=r+Math.imul(d,ce)|0,i=(i=i+Math.imul(d,he)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,he)|0;var Ce=(l+(r=r+Math.imul(c,de)|0)|0)+((8191&(i=(i=i+Math.imul(c,pe)|0)+Math.imul(h,de)|0))<<13)|0;l=((o=o+Math.imul(h,pe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(T,G),i=(i=Math.imul(T,q))+Math.imul(R,G)|0,o=Math.imul(R,q),r=r+Math.imul(U,z)|0,i=(i=i+Math.imul(U,J)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(D,X)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,W)|0,r=r+Math.imul(Q,$)|0,i=(i=i+Math.imul(Q,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(k,ne)|0,o=o+Math.imul(k,re)|0,r=r+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,le)|0,r=r+Math.imul(v,ce)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,he)|0;var xe=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;l=((o=o+Math.imul(p,pe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,J))+Math.imul(R,z)|0,o=Math.imul(R,J),r=r+Math.imul(U,X)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,ee)|0,r=r+Math.imul(Q,ne)|0,i=(i=i+Math.imul(Q,re)|0)+Math.imul(_,ne)|0,o=o+Math.imul(_,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,r=r+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,he)|0;var ke=(l+(r=r+Math.imul(v,de)|0)|0)+((8191&(i=(i=i+Math.imul(v,pe)|0)+Math.imul(y,de)|0))<<13)|0;l=((o=o+Math.imul(y,pe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(T,X),i=(i=Math.imul(T,W))+Math.imul(R,X)|0,o=Math.imul(R,W),r=r+Math.imul(U,$)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(D,ne)|0,i=(i=i+Math.imul(D,re)|0)+Math.imul(F,ne)|0,o=o+Math.imul(F,re)|0,r=r+Math.imul(Q,oe)|0,i=(i=i+Math.imul(Q,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,r=r+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,le)|0,r=r+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,he)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,he)|0;var Se=(l+(r=r+Math.imul(w,de)|0)|0)+((8191&(i=(i=i+Math.imul(w,pe)|0)+Math.imul(b,de)|0))<<13)|0;l=((o=o+Math.imul(b,pe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(T,$),i=(i=Math.imul(T,ee))+Math.imul(R,$)|0,o=Math.imul(R,ee),r=r+Math.imul(U,ne)|0,i=(i=i+Math.imul(U,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,r=r+Math.imul(Q,ue)|0,i=(i=i+Math.imul(Q,le)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,le)|0,r=r+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,he)|0;var Qe=(l+(r=r+Math.imul(B,de)|0)|0)+((8191&(i=(i=i+Math.imul(B,pe)|0)+Math.imul(E,de)|0))<<13)|0;l=((o=o+Math.imul(E,pe)|0)+(i>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(T,ne),i=(i=Math.imul(T,re))+Math.imul(R,ne)|0,o=Math.imul(R,re),r=r+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,r=r+Math.imul(Q,ce)|0,i=(i=i+Math.imul(Q,he)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,he)|0;var _e=(l+(r=r+Math.imul(x,de)|0)|0)+((8191&(i=(i=i+Math.imul(x,pe)|0)+Math.imul(k,de)|0))<<13)|0;l=((o=o+Math.imul(k,pe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(T,oe),i=(i=Math.imul(T,ae))+Math.imul(R,oe)|0,o=Math.imul(R,ae),r=r+Math.imul(U,ue)|0,i=(i=i+Math.imul(U,le)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,le)|0,r=r+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,he)|0)+Math.imul(F,ce)|0,o=o+Math.imul(F,he)|0;var Ne=(l+(r=r+Math.imul(Q,de)|0)|0)+((8191&(i=(i=i+Math.imul(Q,pe)|0)+Math.imul(_,de)|0))<<13)|0;l=((o=o+Math.imul(_,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(T,ue),i=(i=Math.imul(T,le))+Math.imul(R,ue)|0,o=Math.imul(R,le),r=r+Math.imul(U,ce)|0,i=(i=i+Math.imul(U,he)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,he)|0;var De=(l+(r=r+Math.imul(D,de)|0)|0)+((8191&(i=(i=i+Math.imul(D,pe)|0)+Math.imul(F,de)|0))<<13)|0;l=((o=o+Math.imul(F,pe)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(T,ce),i=(i=Math.imul(T,he))+Math.imul(R,ce)|0,o=Math.imul(R,he);var Fe=(l+(r=r+Math.imul(U,de)|0)|0)+((8191&(i=(i=i+Math.imul(U,pe)|0)+Math.imul(L,de)|0))<<13)|0;l=((o=o+Math.imul(L,pe)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var Pe=(l+(r=Math.imul(T,de))|0)+((8191&(i=(i=Math.imul(T,pe))+Math.imul(R,de)|0))<<13)|0;return l=((o=Math.imul(R,pe))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=me,u[4]=we,u[5]=be,u[6]=Ie,u[7]=Be,u[8]=Ee,u[9]=Ce,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Qe,u[14]=_e,u[15]=Ne,u[16]=De,u[17]=Fe,u[18]=Pe,0!==l&&(u[19]=l,n.length++),n};function p(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=f),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var A=o-l,c=(0|e.words[A])*(0|t.words[l]),h=67108863&c;s=67108863&(h=h+s|0),i+=(a=(a=a+(c/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):p(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},g.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},g.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),A=0;A<i;A+=s)for(var c=u,h=l,f=0;f<a;f++){var d=n[A+f],p=r[A+f],g=n[A+f+a],v=r[A+f+a],y=c*g-h*v;v=c*v+h*g,g=y,n[A+f]=d+g,r[A+f]=p+v,n[A+f+a]=d-g,r[A+f+a]=p-v,f!==s&&(y=u*c-l*h,h=u*h+l*c,c=y)}},g.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},g.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},g.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},g.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),u=new Array(r),l=new Array(r),A=new Array(r),c=new Array(r),h=n.words;h.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,l,r),this.transform(a,o,s,u,r,i),this.transform(l,o,A,c,r,i);for(var f=0;f<r;f++){var d=s[f]*A[f]-u[f]*c[f];u[f]=s[f]*c[f]+u[f]*A[f],s[f]=d}return this.conjugate(s,u,r),this.transform(s,u,h,o,r,i),this.conjugate(h,o,r),this.normalize13b(h,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var A=0;for(l=this.length-1;l>=0&&(0!==A||l>=i);l--){var c=0|this.words[l];this.words[l]=A<<26-o|c>>>o,A=c&s}return u&&0!==A&&(u.words[u.length++]=A),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!=(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var A=r.clone()._ishlnsubmul(i,1,u);0===A.negative&&(r=A,s&&(s.words[u]=1));for(var c=u-1;c>=0;c--){var h=67108864*(0|r.words[i.length+c])+(0|r.words[i.length+c-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,c);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,c),r.isZero()||(r.negative^=1);s&&(s.words[c]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var A=r.clone(),c=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(A),a.isub(c)),i.iushrn(1),a.iushrn(1);for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(A),u.isub(c)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,A=1;0==(t.words[0]&A)&&l<26;++l,A<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new B(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},r(m,y),m.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(w,y),r(b,y),r(I,y),I.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new w;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return v[e]=t,t},B.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},B.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new o(2*A*A).toRed(this);0!==this.pow(A,l).cmp(u);)A.redIAdd(u);for(var c=this.pow(A,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),d=a;0!==f.cmp(s);){for(var p=f,g=0;0!==p.cmp(s);g++)p=p.redSqr();n(g<d);var v=this.pow(c,new o(1).iushln(d-g-1));h=h.redMul(v),c=v.redSqr(),f=f.redMul(c),d=g}return h},B.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},B.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var l=t.words[r],A=u-1;A>=0;A--){var c=l>>A&1;i!==n[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4==++s||0===r&&0===A)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},r(E,B),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,FY)})),Mne="lib/elliptic.js",Tne=["lib"],Rne={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},One={type:"git",url:"git@github.com:indutny/elliptic"},Hne=["EC","Elliptic","curve","Cryptography"],Kne="Fedor Indutny <fedor@indutny.com>",jne={url:"https://github.com/indutny/elliptic/issues"},Gne="https://github.com/indutny/elliptic",qne={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},Vne={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},zne={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:Mne,files:Tne,scripts:Rne,repository:One,keywords:Hne,author:Kne,license:"MIT",bugs:jne,homepage:Gne,devDependencies:qne,dependencies:Vne},Jne=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.4",description:"EC cryptography",main:Mne,files:Tne,scripts:Rne,repository:One,keywords:Hne,author:Kne,license:"MIT",bugs:jne,homepage:Gne,devDependencies:qne,dependencies:Vne,default:zne}),Yne=Xne;function Xne(e,t){if(!e)throw new Error(t||"Assertion failed")}Xne.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var Wne,Zne=UY((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16));else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),$ne=UY((function(e,t){var n=t;n.assert=Yne,n.toArray=Zne.toArray,n.zero2=Zne.zero2,n.toHex=Zne.toHex,n.encode=Zne.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<r.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,l=t.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),a=0==(1&u)?0:3!=(r=e.andln(7)+i&7)&&5!==r||2!==l?u:-u,n[0].push(a),s=0==(1&l)?0:3!=(r=t.andln(7)+o&7)&&5!==r||2!==u?l:-l,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new Lne(e,"hex","le")}})),ere=function(e){return Wne||(Wne=new tre(null)),Wne.generate(e)};function tre(e){this.rand=e}var nre=tre;if(tre.prototype.generate=function(e){return this._rand(e)},tre.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==("undefined"==typeof self?"undefined":i(self)))self.crypto&&self.crypto.getRandomValues?tre.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?tre.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==("undefined"==typeof window?"undefined":i(window))&&(tre.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var rre=i3;if("function"!=typeof rre.randomBytes)throw new Error("Not supported");tre.prototype._rand=function(e){return rre.randomBytes(e)}}catch(e){}ere.Rand=nre;var ire=$ne.getNAF,ore=$ne.getJSF,are=$ne.assert;function sre(e,t){this.type=e,this.p=new Lne(t.p,16),this.red=t.prime?Lne.red(t.prime):Lne.mont(this.p),this.zero=new Lne(0).toRed(this.red),this.one=new Lne(1).toRed(this.red),this.two=new Lne(2).toRed(this.red),this.n=t.n&&new Lne(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ure=sre;function lre(e,t){this.curve=e,this.type=t,this.precomputed=null}sre.prototype.point=function(){throw new Error("Not implemented")},sre.prototype.validate=function(){throw new Error("Not implemented")},sre.prototype._fixedNafMul=function(e,t){are(e.precomputed);var n=e._getDoubles(),r=ire(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<r.length;o+=n.step){a=0;for(var u=o+n.step-1;u>=o;u--)a=(a<<1)+r[u];s.push(a)}for(var l=this.jpoint(null,null,null),A=this.jpoint(null,null,null),c=i;c>0;c--){for(o=0;o<s.length;o++)(a=s[o])===c?A=A.mixedAdd(n.points[o]):a===-c&&(A=A.mixedAdd(n.points[o].neg()));l=l.add(A)}return l.toP()},sre.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=ire(t,n,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var l=o[s];are(0!==l),a="affine"===e.type?l>0?a.mixedAdd(i[l-1>>1]):a.mixedAdd(i[-l-1>>1].neg()):l>0?a.add(i[l-1>>1]):a.add(i[-l-1>>1].neg())}return"affine"===e.type?a.toP():a},sre.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,l=this._wnafT2,A=this._wnafT3,c=0;for(o=0;o<r;o++){var h=(s=t[o])._getNAFPoints(e);u[o]=h.wnd,l[o]=h.points}for(o=r-1;o>=1;o-=2){var f=o-1,d=o;if(1===u[f]&&1===u[d]){var p=[t[f],null,null,t[d]];0===t[f].y.cmp(t[d].y)?(p[1]=t[f].add(t[d]),p[2]=t[f].toJ().mixedAdd(t[d].neg())):0===t[f].y.cmp(t[d].y.redNeg())?(p[1]=t[f].toJ().mixedAdd(t[d]),p[2]=t[f].add(t[d].neg())):(p[1]=t[f].toJ().mixedAdd(t[d]),p[2]=t[f].toJ().mixedAdd(t[d].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=ore(n[f],n[d]);for(c=Math.max(v[0].length,c),A[f]=new Array(c),A[d]=new Array(c),a=0;a<c;a++){var y=0|v[0][a],m=0|v[1][a];A[f][a]=g[3*(y+1)+(m+1)],A[d][a]=0,l[f]=p}}else A[f]=ire(n[f],u[f],this._bitLength),A[d]=ire(n[d],u[d],this._bitLength),c=Math.max(A[f].length,c),c=Math.max(A[d].length,c)}var w=this.jpoint(null,null,null),b=this._wnafT4;for(o=c;o>=0;o--){for(var I=0;o>=0;){var B=!0;for(a=0;a<r;a++)b[a]=0|A[a][o],0!==b[a]&&(B=!1);if(!B)break;I++,o--}if(o>=0&&I++,w=w.dblp(I),o<0)break;for(a=0;a<r;a++){var E=b[a];0!==E&&(E>0?s=l[a][E-1>>1]:E<0&&(s=l[a][-E-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<r;o++)l[o]=null;return i?w:w.toP()},sre.BasePoint=lre,lre.prototype.eq=function(){throw new Error("Not implemented")},lre.prototype.validate=function(){return this.curve.validate(this)},sre.prototype.decodePoint=function(e,t){e=$ne.toArray(e,t);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?are(e[e.length-1]%2==0):7===e[0]&&are(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},lre.prototype.encodeCompressed=function(e){return this.encode(e,!0)},lre.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},lre.prototype.encode=function(e,t){return $ne.encode(this._encode(t),e)},lre.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},lre.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},lre.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)r=r.dbl();n.push(r)}return{step:e,points:n}},lre.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},lre.prototype._getBeta=function(){return null},lre.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t};var Are=$ne.assert;function cre(e){ure.call(this,"short",e),this.a=new Lne(e.a,16).toRed(this.red),this.b=new Lne(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}r9(cre,ure);var hre=cre;function fre(e,t,n,r){ure.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new Lne(t,16),this.y=new Lne(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function dre(e,t,n,r){ure.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Lne(0)):(this.x=new Lne(t,16),this.y=new Lne(n,16),this.z=new Lne(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function pre(e){ure.call(this,"mont",e),this.a=new Lne(e.a,16).toRed(this.red),this.b=new Lne(e.b,16).toRed(this.red),this.i4=new Lne(4).toRed(this.red).redInvm(),this.two=new Lne(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}cre.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new Lne(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new Lne(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?n=i[0]:(n=i[1],Are(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new Lne(e.a,16),b:new Lne(e.b,16)}})):this._getEndoBasis(n)}}},cre.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Lne.mont(e),n=new Lne(2).toRed(t).redInvm(),r=n.redNeg(),i=new Lne(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},cre.prototype._getEndoBasis=function(e){for(var t,n,r,i,o,a,s,u,l,A=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,h=this.n.clone(),f=new Lne(1),d=new Lne(0),p=new Lne(0),g=new Lne(1),v=0;0!==c.cmpn(0);){var y=h.div(c);u=h.sub(y.mul(c)),l=p.sub(y.mul(f));var m=g.sub(y.mul(d));if(!r&&u.cmp(A)<0)t=s.neg(),n=f,r=u.neg(),i=l;else if(r&&2==++v)break;s=u,h=c,c=u,p=f,f=l,g=d,d=m}o=u.neg(),a=l;var w=r.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},cre.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),l=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(l).neg()}},cre.prototype.pointFromX=function(e,t){(e=new Lne(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},cre.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},cre.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),r[2*o]=s,r[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,r,i,2*o,n),A=0;A<2*o;A++)r[A]=null,i[A]=null;return l},r9(fre,ure.BasePoint),cre.prototype.point=function(e,t,n){return new fre(this,e,t,n)},cre.prototype.pointFromJSON=function(e,t){return fre.fromJSON(this,e,t)},fre.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},fre.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},fre.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var o=t[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},fre.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},fre.prototype.isInfinity=function(){return this.inf},fre.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},fre.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},fre.prototype.getX=function(){return this.x.fromRed()},fre.prototype.getY=function(){return this.y.fromRed()},fre.prototype.mul=function(e){return e=new Lne(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},fre.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},fre.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},fre.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},fre.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},fre.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r9(dre,ure.BasePoint),cre.prototype.jpoint=function(e,t,n){return new dre(this,e,t,n)},dre.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},dre.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},dre.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),A=l.redMul(s),c=r.redMul(l),h=u.redSqr().redIAdd(A).redISub(c).redISub(c),f=u.redMul(c.redISub(h)).redISub(o.redMul(A)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,d)},dre.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),A=n.redMul(u),c=s.redSqr().redIAdd(l).redISub(A).redISub(A),h=s.redMul(A.redISub(c)).redISub(i.redMul(l)),f=this.z.redMul(a);return this.curve.jpoint(c,h,f)},dre.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var A=o.redSqr(),c=l.redSqr(),h=c.redSqr(),f=A.redAdd(A).redIAdd(A).redIAdd(r.redMul(u)),d=o.redMul(c),p=f.redSqr().redISub(d.redAdd(d)),g=d.redISub(p),v=f.redMul(g);v=v.redIAdd(v).redISub(h);var y=l.redMul(s);t+1<e&&(u=u.redMul(h)),o=p,s=y,l=v}return this.curve.jpoint(o,l.redMul(i),s)},dre.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},dre.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),c=this.y.redSqr(),h=c.redSqr(),f=this.x.redAdd(c).redSqr().redISub(A).redISub(h);f=f.redIAdd(f);var d=A.redAdd(A).redIAdd(A),p=d.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=p.redISub(f).redISub(f),t=d.redMul(f.redISub(e)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},dre.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=s.redMul(a.redISub(u)).redISub(l),n=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),c=this.y.redSqr(),h=this.x.redMul(c),f=this.x.redSub(A).redMul(this.x.redAdd(A));f=f.redAdd(f).redIAdd(f);var d=h.redIAdd(h),p=(d=d.redIAdd(d)).redAdd(d);e=f.redSqr().redISub(p),n=this.y.redAdd(this.z).redSqr().redISub(c).redISub(A);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(d.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,n)},dre.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=t.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(a),A=s.redSqr().redISub(l.redAdd(l)),c=l.redISub(A),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(c).redISub(h),d=n.redAdd(n).redMul(r);return this.curve.jpoint(A,f,d)},dre.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),A=t.redMul(l);A=(A=A.redIAdd(A)).redIAdd(A);var c=this.x.redMul(s).redISub(A);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.y.redMul(l.redMul(u.redISub(l)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(c,h,f)},dre.prototype.mul=function(e,t){return e=new Lne(e,t),this.curve._wnafMul(this,e)},dre.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},dre.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},dre.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},dre.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},r9(pre,ure);var gre=pre;function vre(e,t,n){ure.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Lne(t,16),this.z=new Lne(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}pre.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},r9(vre,ure.BasePoint),pre.prototype.decodePoint=function(e,t){return this.point($ne.toArray(e,t),1)},pre.prototype.point=function(e,t){return new vre(this,e,t)},pre.prototype.pointFromJSON=function(e){return vre.fromJSON(this,e)},vre.prototype.precompute=function(){},vre.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},vre.fromJSON=function(e,t){return new vre(e,t[0],t[1]||e.one)},vre.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},vre.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},vre.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},vre.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},vre.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},vre.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},vre.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},vre.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},vre.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},vre.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},vre.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var yre=$ne.assert;function mre(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,ure.call(this,"edwards",e),this.a=new Lne(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Lne(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Lne(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),yre(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}r9(mre,ure);var wre=mre;function bre(e,t,n,r,i){ure.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Lne(t,16),this.y=new Lne(n,16),this.z=r?new Lne(r,16):this.curve.one,this.t=i&&new Lne(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}mre.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},mre.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},mre.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},mre.prototype.pointFromX=function(e,t){(e=new Lne(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=r.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},mre.prototype.pointFromY=function(e,t){(e=new Lne(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},mre.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},r9(bre,ure.BasePoint),mre.prototype.pointFromJSON=function(e){return bre.fromJSON(this,e)},mre.prototype.point=function(e,t,n,r){return new bre(this,e,t,n,r)},bre.fromJSON=function(e,t){return new bre(e,t[0],t[1],t[2])},bre.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},bre.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},bre.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),u=i.redMul(a),l=o.redMul(s),A=i.redMul(s),c=a.redMul(o);return this.curve.point(u,l,c,A)},bre.prototype._projDbl=function(){var e,t,n,r,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var l=(r=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(l.redSub(this.curve.two)),t=l.redMul(r.redSub(u)),n=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),o=l.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=l.redMul(r.redSub(u)),n=l.redMul(o))}else r=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=r.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(r)).redMul(o),t=this.curve._mulC(r).redMul(s.redISub(u)),n=r.redMul(o);return this.curve.point(e,t,n)},bre.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},bre.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),l=o.redMul(a),A=s.redMul(u),c=o.redMul(u),h=a.redMul(s);return this.curve.point(l,A,h,c)},bre.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),l=i.redAdd(s),A=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),c=r.redMul(u).redMul(A);return this.curve.twisted?(t=r.redMul(l).redMul(a.redSub(this.curve._mulA(o))),n=u.redMul(l)):(t=r.redMul(l).redMul(a.redSub(o)),n=this.curve._mulC(u).redMul(l)),this.curve.point(c,t,n)},bre.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},bre.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},bre.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},bre.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},bre.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},bre.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},bre.prototype.getX=function(){return this.normalize(),this.x.fromRed()},bre.prototype.getY=function(){return this.normalize(),this.y.fromRed()},bre.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},bre.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},bre.prototype.toP=bre.prototype.normalize,bre.prototype.mixedAdd=bre.prototype.add;var Ire=UY((function(e,t){var n=t;n.base=ure,n.short=hre,n.mont=gre,n.edwards=wre}));function Bre(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function Ere(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Cre(e){return 1===e.length?"0"+e:e}function xre(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var kre={inherits:r9,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):Bre(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},toHex:function(e){for(var t="",n=0;n<e.length;n++)t+=Cre(e[n].toString(16));return t},htonl:Ere,toHex32:function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=Ere(i)),n+=xre(i.toString(16))}return n},zero2:Cre,zero8:xre,join32:function(e,t,n,r){var i=n-t;Yne(i%4==0);for(var o=new Array(i/4),a=0,s=t;a<o.length;a++,s+=4){var u;u="big"===r?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o},split32:function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var o=e[r];"big"===t?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,n){return e+t+n>>>0},sum32_4:function(e,t,n,r){return e+t+n+r>>>0},sum32_5:function(e,t,n,r,i){return e+t+n+r+i>>>0},sum64:function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o<r?1:0)+n+i;e[t]=a>>>0,e[t+1]=o},sum64_hi:function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},sum64_lo:function(e,t,n,r){return t+r>>>0},sum64_4_hi:function(e,t,n,r,i,o,a,s){var u=0,l=t;return u+=(l=l+r>>>0)<t?1:0,u+=(l=l+o>>>0)<o?1:0,e+n+i+a+(u+=(l=l+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},sum64_5_hi:function(e,t,n,r,i,o,a,s,u,l){var A=0,c=t;return A+=(c=c+r>>>0)<t?1:0,A+=(c=c+o>>>0)<o?1:0,A+=(c=c+s>>>0)<s?1:0,e+n+i+a+u+(A+=(c=c+l>>>0)<l?1:0)>>>0},sum64_5_lo:function(e,t,n,r,i,o,a,s,u,l){return t+r+o+s+l>>>0},rotr64_hi:function(e,t,n){return(t<<32-n|e>>>n)>>>0},rotr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0},shr64_hi:function(e,t,n){return e>>>n},shr64_lo:function(e,t,n){return(e<<32-n|t>>>n)>>>0}};function Sre(){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}var Qre=Sre;Sre.prototype.update=function(e,t){if(e=kre.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=kre.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Sre.prototype.digest=function(e){return this.update(this._pad()),Yne(null===this.pending),this._digest(e)},Sre.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r};var _re={BlockHash:Qre},Nre=kre.rotr32;function Dre(e,t,n){return e&t^~e&n}function Fre(e,t,n){return e&t^e&n^t&n}function Pre(e,t,n){return e^t^n}var Ure=function(e,t,n,r){return 0===e?Dre(t,n,r):1===e||3===e?Pre(t,n,r):2===e?Fre(t,n,r):void 0},Lre=Dre,Mre=Fre,Tre=function(e){return Nre(e,2)^Nre(e,13)^Nre(e,22)},Rre=function(e){return Nre(e,6)^Nre(e,11)^Nre(e,25)},Ore=function(e){return Nre(e,7)^Nre(e,18)^e>>>3},Hre=function(e){return Nre(e,17)^Nre(e,19)^e>>>10},Kre=kre.rotl32,jre=kre.sum32,Gre=kre.sum32_5,qre=Ure,Vre=_re.BlockHash,zre=[1518500249,1859775393,2400959708,3395469782];function Jre(){if(!(this instanceof Jre))return new Jre;Vre.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}kre.inherits(Jre,Vre);var Yre=Jre;Jre.blockSize=512,Jre.outSize=160,Jre.hmacStrength=80,Jre.padLength=64,Jre.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Kre(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),A=Gre(Kre(i,5),qre(l,o,a,s),u,n[r],zre[l]);u=s,s=a,a=Kre(o,30),o=i,i=A}this.h[0]=jre(this.h[0],i),this.h[1]=jre(this.h[1],o),this.h[2]=jre(this.h[2],a),this.h[3]=jre(this.h[3],s),this.h[4]=jre(this.h[4],u)},Jre.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"big"):kre.split32(this.h,"big")};var Xre=kre.sum32,Wre=kre.sum32_4,Zre=kre.sum32_5,$re=Lre,eie=Mre,tie=Tre,nie=Rre,rie=Ore,iie=Hre,oie=_re.BlockHash,aie=[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 sie(){if(!(this instanceof sie))return new sie;oie.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=aie,this.W=new Array(64)}kre.inherits(sie,oie);var uie=sie;function lie(){if(!(this instanceof lie))return new lie;uie.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sie.blockSize=512,sie.outSize=256,sie.hmacStrength=192,sie.padLength=64,sie.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Wre(iie(n[r-2]),n[r-7],rie(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],l=this.h[5],A=this.h[6],c=this.h[7];for(Yne(this.k.length===n.length),r=0;r<n.length;r++){var h=Zre(c,nie(u),$re(u,l,A),this.k[r],n[r]),f=Xre(tie(i),eie(i,o,a));c=A,A=l,l=u,u=Xre(s,h),s=a,a=o,o=i,i=Xre(h,f)}this.h[0]=Xre(this.h[0],i),this.h[1]=Xre(this.h[1],o),this.h[2]=Xre(this.h[2],a),this.h[3]=Xre(this.h[3],s),this.h[4]=Xre(this.h[4],u),this.h[5]=Xre(this.h[5],l),this.h[6]=Xre(this.h[6],A),this.h[7]=Xre(this.h[7],c)},sie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"big"):kre.split32(this.h,"big")},kre.inherits(lie,uie);var Aie=lie;lie.blockSize=512,lie.outSize=224,lie.hmacStrength=192,lie.padLength=64,lie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h.slice(0,7),"big"):kre.split32(this.h.slice(0,7),"big")};var cie=kre.rotr64_hi,hie=kre.rotr64_lo,fie=kre.shr64_hi,die=kre.shr64_lo,pie=kre.sum64,gie=kre.sum64_hi,vie=kre.sum64_lo,yie=kre.sum64_4_hi,mie=kre.sum64_4_lo,wie=kre.sum64_5_hi,bie=kre.sum64_5_lo,Iie=_re.BlockHash,Bie=[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 Eie(){if(!(this instanceof Eie))return new Eie;Iie.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Bie,this.W=new Array(160)}kre.inherits(Eie,Iie);var Cie=Eie;function xie(e,t,n,r,i){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function kie(e,t,n,r,i,o){var a=t&r^~t&o;return a<0&&(a+=4294967296),a}function Sie(e,t,n,r,i){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function Qie(e,t,n,r,i,o){var a=t&r^t&o^r&o;return a<0&&(a+=4294967296),a}function _ie(e,t){var n=cie(e,t,28)^cie(t,e,2)^cie(t,e,7);return n<0&&(n+=4294967296),n}function Nie(e,t){var n=hie(e,t,28)^hie(t,e,2)^hie(t,e,7);return n<0&&(n+=4294967296),n}function Die(e,t){var n=cie(e,t,14)^cie(e,t,18)^cie(t,e,9);return n<0&&(n+=4294967296),n}function Fie(e,t){var n=hie(e,t,14)^hie(e,t,18)^hie(t,e,9);return n<0&&(n+=4294967296),n}function Pie(e,t){var n=cie(e,t,1)^cie(e,t,8)^fie(e,t,7);return n<0&&(n+=4294967296),n}function Uie(e,t){var n=hie(e,t,1)^hie(e,t,8)^die(e,t,7);return n<0&&(n+=4294967296),n}function Lie(e,t){var n=cie(e,t,19)^cie(t,e,29)^fie(e,t,6);return n<0&&(n+=4294967296),n}function Mie(e,t){var n=hie(e,t,19)^hie(t,e,29)^die(e,t,6);return n<0&&(n+=4294967296),n}function Tie(){if(!(this instanceof Tie))return new Tie;Cie.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Eie.blockSize=1024,Eie.outSize=512,Eie.hmacStrength=192,Eie.padLength=128,Eie.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=Lie(n[r-4],n[r-3]),o=Mie(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],u=Pie(n[r-30],n[r-29]),l=Uie(n[r-30],n[r-29]),A=n[r-32],c=n[r-31];n[r]=yie(i,o,a,s,u,l,A,c),n[r+1]=mie(i,o,a,s,u,l,A,c)}},Eie.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],l=this.h[6],A=this.h[7],c=this.h[8],h=this.h[9],f=this.h[10],d=this.h[11],p=this.h[12],g=this.h[13],v=this.h[14],y=this.h[15];Yne(this.k.length===n.length);for(var m=0;m<n.length;m+=2){var w=v,b=y,I=Die(c,h),B=Fie(c,h),E=xie(c,0,f,0,p),C=kie(0,h,0,d,0,g),x=this.k[m],k=this.k[m+1],S=n[m],Q=n[m+1],_=wie(w,b,I,B,E,C,x,k,S,Q),N=bie(w,b,I,B,E,C,x,k,S,Q);w=_ie(r,i),b=Nie(r,i),I=Sie(r,0,o,0,s),B=Qie(0,i,0,a,0,u);var D=gie(w,b,I,B),F=vie(w,b,I,B);v=p,y=g,p=f,g=d,f=c,d=h,c=gie(l,A,_,N),h=vie(A,A,_,N),l=s,A=u,s=o,u=a,o=r,a=i,r=gie(_,N,D,F),i=vie(_,N,D,F)}pie(this.h,0,r,i),pie(this.h,2,o,a),pie(this.h,4,s,u),pie(this.h,6,l,A),pie(this.h,8,c,h),pie(this.h,10,f,d),pie(this.h,12,p,g),pie(this.h,14,v,y)},Eie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"big"):kre.split32(this.h,"big")},kre.inherits(Tie,Cie);var Rie=Tie;Tie.blockSize=1024,Tie.outSize=384,Tie.hmacStrength=192,Tie.padLength=128,Tie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h.slice(0,12),"big"):kre.split32(this.h.slice(0,12),"big")};var Oie={sha1:Yre,sha224:Aie,sha256:uie,sha384:Rie,sha512:Cie},Hie=kre.rotl32,Kie=kre.sum32,jie=kre.sum32_3,Gie=kre.sum32_4,qie=_re.BlockHash;function Vie(){if(!(this instanceof Vie))return new Vie;qie.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}kre.inherits(Vie,qie);var zie=Vie;function Jie(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function Yie(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Xie(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Vie.blockSize=512,Vie.outSize=160,Vie.hmacStrength=192,Vie.padLength=64,Vie.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=n,u=r,l=i,A=o,c=a,h=0;h<80;h++){var f=Kie(Hie(Gie(n,Jie(h,r,i,o),e[Wie[h]+t],Yie(h)),$ie[h]),a);n=a,a=o,o=Hie(i,10),i=r,r=f,f=Kie(Hie(Gie(s,Jie(79-h,u,l,A),e[Zie[h]+t],Xie(h)),eoe[h]),c),s=c,c=A,A=Hie(l,10),l=u,u=f}f=jie(this.h[1],i,A),this.h[1]=jie(this.h[2],o,c),this.h[2]=jie(this.h[3],a,s),this.h[3]=jie(this.h[4],n,u),this.h[4]=jie(this.h[0],r,l),this.h[0]=f},Vie.prototype._digest=function(e){return"hex"===e?kre.toHex32(this.h,"little"):kre.split32(this.h,"little")};var Wie=[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],Zie=[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],$ie=[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],eoe=[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],toe={ripemd160:zie};function noe(e,t,n){if(!(this instanceof noe))return new noe(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(kre.toArray(t,n))}var roe=noe;noe.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),Yne(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},noe.prototype.update=function(e,t){return this.inner.update(e,t),this},noe.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var ioe=UY((function(e,t){var n=t;n.utils=kre,n.common=_re,n.sha=Oie,n.ripemd=toe,n.hmac=roe,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})),ooe={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},aoe=UY((function(e,t){var n,r=t,i=$ne.assert;function o(e){"short"===e.type?this.curve=new Ire.short(e):"edwards"===e.type?this.curve=new Ire.edwards(e):this.curve=new Ire.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:ioe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:ioe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:ioe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:ioe.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:ioe.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ioe.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ioe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=ooe}catch(e){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:ioe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function soe(e){if(!(this instanceof soe))return new soe(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Zne.toArray(e.entropy,e.entropyEnc||"hex"),n=Zne.toArray(e.nonce,e.nonceEnc||"hex"),r=Zne.toArray(e.pers,e.persEnc||"hex");Yne(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var uoe=soe;soe.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},soe.prototype._hmac=function(){return new ioe.hmac(this.hash,this.K)},soe.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},soe.prototype.reseed=function(e,t,n,r){"string"!=typeof t&&(r=n,n=t,t=null),e=Zne.toArray(e,t),n=Zne.toArray(n,r),Yne(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},soe.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=Zne.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(n),this._reseed++,Zne.encode(o,t)};var loe=$ne.assert;function Aoe(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var coe=Aoe;Aoe.fromPublic=function(e,t,n){return t instanceof Aoe?t:new Aoe(e,{pub:t,pubEnc:n})},Aoe.fromPrivate=function(e,t,n){return t instanceof Aoe?t:new Aoe(e,{priv:t,privEnc:n})},Aoe.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Aoe.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Aoe.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Aoe.prototype._importPrivate=function(e,t){this.priv=new Lne(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Aoe.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?loe(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||loe(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Aoe.prototype.derive=function(e){return e.validate()||loe(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Aoe.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},Aoe.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Aoe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var hoe=$ne.assert;function foe(e,t){if(e instanceof foe)return e;this._importDER(e,t)||(hoe(e.r&&e.s,"Signature without r or s"),this.r=new Lne(e.r,16),this.s=new Lne(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var doe=foe;function poe(){this.place=0}function goe(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o<r;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function voe(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function yoe(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}foe.prototype._importDER=function(e,t){e=$ne.toArray(e,t);var n=new poe;if(48!==e[n.place++])return!1;var r=goe(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=goe(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=goe(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new Lne(o),this.s=new Lne(s),this.recoveryParam=null,!0},foe.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=voe(t),n=voe(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];yoe(r,t.length),(r=r.concat(t)).push(2),yoe(r,n.length);var i=r.concat(n),o=[48];return yoe(o,i.length),o=o.concat(i),$ne.encode(o,e)};var moe=$ne.assert;function woe(e){if(!(this instanceof woe))return new woe(e);"string"==typeof e&&(moe(Object.prototype.hasOwnProperty.call(aoe,e),"Unknown curve "+e),e=aoe[e]),e instanceof aoe.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var boe=woe;woe.prototype.keyPair=function(e){return new coe(this,e)},woe.prototype.keyFromPrivate=function(e,t){return coe.fromPrivate(this,e,t)},woe.prototype.keyFromPublic=function(e,t){return coe.fromPublic(this,e,t)},woe.prototype.genKeyPair=function(e){e||(e={});for(var t=new uoe({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ere(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new Lne(2));;){var i=new Lne(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},woe.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},woe.prototype.sign=function(e,t,n,r){"object"==i(n)&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Lne(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),s=e.toArray("be",o),u=new uoe({hash:this.hash,entropy:a,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),l=this.n.sub(new Lne(1)),A=0;;A++){var c=r.k?r.k(A):new Lne(u.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(l)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return r.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new doe({r:d,s:p,recoveryParam:g})}}}}}},woe.prototype.verify=function(e,t,n,r){e=this._truncateToN(new Lne(e,16)),n=this.keyFromPublic(n,r);var i=(t=new doe(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),l)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},woe.prototype.recoverPubKey=function(e,t,n,r){moe((3&n)===n,"The recovery param is more than two bits"),t=new doe(t,r);var i=this.n,o=new Lne(e),a=t.r,s=t.s,u=1&n,l=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var A=t.r.invm(i),c=i.sub(o).mul(A).umod(i),h=s.mul(A).umod(i);return this.g.mulAdd(c,a,h)},woe.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new doe(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var Ioe=$ne.assert,Boe=$ne.parseBytes,Eoe=$ne.cachedProperty;function Coe(e,t){this.eddsa=e,this._secret=Boe(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Boe(t.pub)}Coe.fromPublic=function(e,t){return t instanceof Coe?t:new Coe(e,{pub:t})},Coe.fromSecret=function(e,t){return t instanceof Coe?t:new Coe(e,{secret:t})},Coe.prototype.secret=function(){return this._secret},Eoe(Coe,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Eoe(Coe,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Eoe(Coe,"privBytes",(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r})),Eoe(Coe,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Eoe(Coe,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Eoe(Coe,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Coe.prototype.sign=function(e){return Ioe(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Coe.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Coe.prototype.getSecret=function(e){return Ioe(this._secret,"KeyPair is public only"),$ne.encode(this.secret(),e)},Coe.prototype.getPublic=function(e){return $ne.encode(this.pubBytes(),e)};var xoe=Coe,koe=$ne.assert,Soe=$ne.cachedProperty,Qoe=$ne.parseBytes;function _oe(e,t){this.eddsa=e,"object"!=i(t)&&(t=Qoe(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),koe(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Lne&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Soe(_oe,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Soe(_oe,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Soe(_oe,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Soe(_oe,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),_oe.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},_oe.prototype.toHex=function(){return $ne.encode(this.toBytes(),"hex").toUpperCase()};var Noe=_oe,Doe=$ne.assert,Foe=$ne.parseBytes;function Poe(e){if(Doe("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Poe))return new Poe(e);e=aoe[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=ioe.sha512}var Uoe=Poe;Poe.prototype.sign=function(e,t){e=Foe(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),s=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Poe.prototype.verify=function(e,t,n){e=Foe(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},Poe.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return $ne.intFromLE(e.digest()).umod(this.curve.n)},Poe.prototype.keyFromPublic=function(e){return xoe.fromPublic(this,e)},Poe.prototype.keyFromSecret=function(e){return xoe.fromSecret(this,e)},Poe.prototype.makeSignature=function(e){return e instanceof Noe?e:new Noe(this,e)},Poe.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},Poe.prototype.decodePoint=function(e){var t=(e=$ne.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),r=0!=(128&e[t]),i=$ne.intFromLE(n);return this.curve.pointFromY(i,r)},Poe.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},Poe.prototype.decodeInt=function(e){return $ne.intFromLE(e)},Poe.prototype.isPoint=function(e){return e instanceof this.pointClass};var Loe=LY(Jne),Moe=UY((function(e,t){var n=t;n.version=Loe.version,n.utils=$ne,n.rand=ere,n.curve=Ire,n.curves=aoe,n.ec=boe,n.eddsa=Uoe})),Toe=nX.alloc(1,1),Roe=nX.alloc(1,0),Ooe=new Moe.ec("secp256k1"),Hoe=nX.alloc(32,0),Koe=nX.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),joe=nX.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),Goe=Ooe.curve.n,qoe=Goe.shrn(1),Voe=Ooe.curve.g;function zoe(e){return TX(e)&&32===e.length}function Joe(e){return!!zoe(e)&&e.compare(Koe)<0}function Yoe(e){if(!TX(e))return!1;if(e.length<33)return!1;var t=e[0],n=e.slice(1,33);if(0===n.compare(Hoe))return!1;if(n.compare(joe)>=0)return!1;if((2===t||3===t)&&33===e.length){try{tae(e)}catch(e){return!1}return!0}var r=e.slice(33);return 0!==r.compare(Hoe)&&!(r.compare(joe)>=0)&&4===t&&65===e.length}function Xoe(e){return 4!==e[0]}function Woe(e){return!!zoe(e)&&e.compare(Hoe)>0&&e.compare(Koe)<0}function Zoe(e,t){return void 0===e&&void 0!==t?Xoe(t):void 0===e||e}function $oe(e){return new Lne(e)}function eae(e){return e.toArrayLike(nX,"be",32)}function tae(e){return Ooe.curve.decodePoint(e)}function nae(e,t){return nX.from(e._encode(t))}function rae(e,t,n){if(!zoe(e))throw new TypeError("Expected Hash");if(!Woe(t))throw new TypeError("Expected Private");if(void 0!==n&&!zoe(n))throw new TypeError("Expected Extra Data (32 bytes)");var r,i,o=$oe(t),a=$oe(e);(function(e,t,n,r,i){var o=nX.alloc(32,0),a=nX.alloc(32,1);o=_ne("sha256",o).update(a).update(Roe).update(t).update(e).update(i||"").digest(),a=_ne("sha256",o).update(a).digest(),o=_ne("sha256",o).update(a).update(Toe).update(t).update(e).update(i||"").digest(),a=_ne("sha256",o).update(a).digest();for(var s=a=_ne("sha256",o).update(a).digest();!r(s)||!n(s);)o=_ne("sha256",o).update(a).update(Roe).digest(),a=_ne("sha256",o).update(a).digest(),s=a=_ne("sha256",o).update(a).digest()})(e,t,(function(e){var t=$oe(e),n=Voe.mul(t);return!n.isInfinity()&&(0!==(r=n.x.umod(Goe)).isZero()&&0!==(i=t.invm(Goe).mul(a.add(o.mul(r))).umod(Goe)).isZero())}),Woe,n),i.cmp(qoe)>0&&(i=Goe.sub(i));var s=nX.allocUnsafe(64);return eae(r).copy(s,0),eae(i).copy(s,32),s}var iae={isPoint:Yoe,isPointCompressed:function(e){return!!Yoe(e)&&Xoe(e)},isPrivate:Woe,pointAdd:function(e,t,n){if(!Yoe(e))throw new TypeError("Expected Point");if(!Yoe(t))throw new TypeError("Expected Point");var r=tae(e),i=tae(t),o=r.add(i);return o.isInfinity()?null:nae(o,Zoe(n,e))},pointAddScalar:function(e,t,n){if(!Yoe(e))throw new TypeError("Expected Point");if(!Joe(t))throw new TypeError("Expected Tweak");var r=Zoe(n,e),i=tae(e);if(0===t.compare(Hoe))return nae(i,r);var o=$oe(t),a=Voe.mul(o),s=i.add(a);return s.isInfinity()?null:nae(s,r)},pointCompress:function(e,t){if(!Yoe(e))throw new TypeError("Expected Point");var n=tae(e);if(n.isInfinity())throw new TypeError("Expected Point");return nae(n,Zoe(t,e))},pointFromScalar:function(e,t){if(!Woe(e))throw new TypeError("Expected Private");var n=$oe(e),r=Voe.mul(n);return r.isInfinity()?null:nae(r,Zoe(t))},pointMultiply:function(e,t,n){if(!Yoe(e))throw new TypeError("Expected Point");if(!Joe(t))throw new TypeError("Expected Tweak");var r=Zoe(n,e),i=tae(e),o=$oe(t),a=i.mul(o);return a.isInfinity()?null:nae(a,r)},privateAdd:function(e,t){if(!Woe(e))throw new TypeError("Expected Private");if(!Joe(t))throw new TypeError("Expected Tweak");var n=$oe(e),r=$oe(t),i=eae(n.add(r).umod(Goe));return Woe(i)?i:null},privateSub:function(e,t){if(!Woe(e))throw new TypeError("Expected Private");if(!Joe(t))throw new TypeError("Expected Tweak");var n=$oe(e),r=$oe(t),i=eae(n.sub(r).umod(Goe));return Woe(i)?i:null},sign:function(e,t){return rae(e,t)},signWithEntropy:function(e,t,n){return rae(e,t,n)},verify:function(e,t,n,r){if(!zoe(e))throw new TypeError("Expected Hash");if(!Yoe(t))throw new TypeError("Expected Point");if(!function(e){var t=e.slice(0,32),n=e.slice(32,64);return TX(e)&&64===e.length&&t.compare(Koe)<0&&n.compare(Koe)<0}(n))throw new TypeError("Expected Signature");var i=tae(t),o=$oe(n.slice(0,32)),a=$oe(n.slice(32,64));if(r&&a.cmp(qoe)>0)return!1;if(o.gtn(0)<=0)return!1;if(a.gtn(0)<=0)return!1;var s=$oe(e),u=a.invm(Goe),l=s.mul(u).umod(Goe),A=o.mul(u).umod(Goe),c=Voe.mulAdd(l,i,A);return!c.isInfinity()&&c.x.umod(Goe).eq(o)}},oae={Array:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return null!=e&&e.constructor===Array})),Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==i(e)},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var aae in oae.Null=oae.Nil,oae)oae[aae].toJSON=function(e){return e}.bind(null,aae);var sae=oae;function uae(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function lae(e){return sae.Nil(e)?"":uae(e.constructor)}function Aae(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function cae(e){return sae.Function(e)?e.toJSON?e.toJSON():uae(e):sae.Array(e)?"Array":e&&sae.Object(e)?"Object":void 0!==e?e:""}function hae(e,t,n){var r=function(e){return sae.Function(e)?"":sae.String(e)?JSON.stringify(e):e&&sae.Object(e)?"":e}(t);return"Expected "+cae(e)+", got"+(""!==n?" "+n:"")+(""!==r?" "+r:"")}function fae(e,t,n){n=n||lae(t),this.message=hae(e,t,n),Aae(this,fae),this.__type=e,this.__value=t,this.__valueTypeName=n}function dae(e,t,n,r,i){e?(i=i||lae(r),this.message=function(e,t,n,r,i){var o='" of type ';return"key"===t&&(o='" with key type '),hae('property "'+cae(n)+o+cae(e),r,i)}(e,n,t,r,i)):this.message='Unexpected property "'+t+'"',Aae(this,fae),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=i}fae.prototype=Object.create(Error.prototype),fae.prototype.constructor=fae,dae.prototype=Object.create(Error.prototype),dae.prototype.constructor=fae;var pae=fae,gae=dae,vae=function(e,t){return new fae(e,{},t)},yae=function(e,t,n){return e instanceof dae?(t=t+"."+e.__property,e=new dae(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof fae&&(e=new dae(e.__type,t,n,e.__value,e.__valueTypeName)),Aae(e),e},mae=cae,wae=lae;function bae(e){return TX(e)}function Iae(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function Bae(e,t){var n=e.toJSON();function r(r){if(!e(r))return!1;if(r.length===t)return!0;throw vae(n+"(Length: "+t+")",n+"(Length: "+r.length+")")}return r.toJSON=function(){return n},r}var Eae=Bae.bind(null,sae.Array),Cae=Bae.bind(null,bae),xae=Bae.bind(null,Iae),kae=Bae.bind(null,sae.String),Sae=Math.pow(2,53)-1,Qae={ArrayN:Eae,Buffer:bae,BufferN:Cae,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:Iae,HexN:xae,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-Sae&&e<=Sae&&Math.floor(e)===e},Range:function(e,t,n){function r(r,i){return n(r,i)&&r>e&&r<t}return n=n||sae.Number,r.toJSON=function(){return"".concat(n.toJSON()," between [").concat(e,", ").concat(t,"]")},r},StringN:kae,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=Sae&&Math.floor(e)===e}};for(var _ae in Qae)Qae[_ae].toJSON=function(e){return e}.bind(null,_ae);var Nae=Qae,Dae=mae,Fae=pae,Pae=gae,Uae=yae,Lae=wae,Mae={arrayOf:function(e,t){function n(n,r){return!!sae.Array(n)&&!sae.Nil(n)&&!(void 0!==t.minLength&&n.length<t.minLength)&&!(void 0!==t.maxLength&&n.length>t.maxLength)&&(void 0===t.length||n.length===t.length)&&n.every((function(t,n){try{return Rae(e,t,r)}catch(e){throw Uae(e,n)}}))}return e=Tae(e),t=t||{},n.toJSON=function(){var n="["+Dae(e)+"]";return void 0!==t.length?n+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(n+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),n},n},maybe:function e(t){function n(n,r){return sae.Nil(n)||t(n,r,e)}return t=Tae(t),n.toJSON=function(){return"?"+Dae(t)},n},map:function(e,t){function n(n,r){if(!sae.Object(n))return!1;if(sae.Nil(n))return!1;for(var i in n){try{t&&Rae(t,i,r)}catch(e){throw Uae(e,i,"key")}try{var o=n[i];Rae(e,o,r)}catch(e){throw Uae(e,i)}}return!0}return e=Tae(e),t&&(t=Tae(t)),n.toJSON=t?function(){return"{"+Dae(t)+": "+Dae(e)+"}"}:function(){return"{"+Dae(e)+"}"},n},object:function(e){var t={};for(var n in e)t[n]=Tae(e[n]);function r(e,n){if(!sae.Object(e))return!1;if(sae.Nil(e))return!1;var r;try{for(r in t)Rae(t[r],e[r],n)}catch(e){throw Uae(e,r)}if(n)for(r in e)if(!t[r])throw new Pae(void 0,r);return!0}return r.toJSON=function(){return Dae(t)},r},anyOf:function(){var e=[].slice.call(arguments).map(Tae);function t(t,n){return e.some((function(e){try{return Rae(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(Dae).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(Tae);function t(t,n){return e.every((function(e){try{return Rae(e,t,n)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(Dae).join(" & ")},t},quacksLike:function(e){function t(t){return e===Lae(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(Tae);function t(t,n){return!sae.Nil(t)&&!sae.Nil(t.length)&&(!n||t.length===e.length)&&e.every((function(e,r){try{return Rae(e,t[r],n)}catch(e){throw Uae(e,r)}}))}return t.toJSON=function(){return"("+e.map(Dae).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function Tae(e){if(sae.String(e))return"?"===e[0]?Mae.maybe(e.slice(1)):sae[e]||Mae.quacksLike(e);if(e&&sae.Object(e)){if(sae.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return Mae.arrayOf(e[0])}return Mae.object(e)}return sae.Function(e)?e:Mae.value(e)}function Rae(e,t,n,r){if(sae.Function(e)){if(e(t,n))return!0;throw new Fae(r||e,t)}return Rae(Tae(e),t,n)}for(var Oae in Mae.oneOf=Mae.anyOf,sae)Rae[Oae]=sae[Oae];for(Oae in Mae)Rae[Oae]=Mae[Oae];for(Oae in Nae)Rae[Oae]=Nae[Oae];Rae.compile=Tae,Rae.TfTypeError=Fae,Rae.TfPropertyTypeError=Pae;var Hae=Rae;function Kae(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function jae(e,t,n){var r=new nX(n?34:33);return r.writeUInt8(e,0),t.copy(r,1),n&&(r[33]=1),r}var Gae=function(e,t){return Kae(Une.decode(e),t)},qae=function(e,t,n){return"number"==typeof e?Une.encode(jae(e,t,n)):Une.encode(jae(e.version,e.privateKey,e.compressed))},Vae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Hae.BufferN(32),r=Hae.compile({wif:Hae.UInt8,bip32:{public:Hae.UInt32,private:Hae.UInt32}}),i={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},o=2147483648,a=Math.pow(2,31)-1;function u(e){return Hae.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function A(e){return Hae.UInt32(e)&&e<=a}var c=function(){function e(t,n,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;s(this,e),this.__D=t,this.__Q=n,this.chainCode=i,this.network=o,this.__DEPTH=a,this.__INDEX=u,this.__PARENT_FINGERPRINT=l,Hae(r,o),this.lowR=!1}return l(e,[{key:"depth",get:function(){return this.__DEPTH}},{key:"index",get:function(){return this.__INDEX}},{key:"parentFingerprint",get:function(){return this.__PARENT_FINGERPRINT}},{key:"publicKey",get:function(){return void 0===this.__Q&&(this.__Q=iae.pointFromScalar(this.__D,!0)),this.__Q}},{key:"privateKey",get:function(){return this.__D}},{key:"identifier",get:function(){return Nne.hash160(this.publicKey)}},{key:"fingerprint",get:function(){return this.identifier.slice(0,4)}},{key:"compressed",get:function(){return!0}},{key:"isNeutered",value:function(){return void 0===this.__D}},{key:"neutered",value:function(){return d(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}},{key:"toBase58",value:function(){var e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,n=nX.allocUnsafe(78);return n.writeUInt32BE(t,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),Une.encode(n)}},{key:"toWIF",value:function(){if(!this.privateKey)throw new TypeError("Missing private key");return qae(this.network.wif,this.privateKey,!0)}},{key:"derive",value:function(e){Hae(Hae.UInt32,e);var t=e>=o,n=nX.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");n[0]=0,this.privateKey.copy(n,1),n.writeUInt32BE(e,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(e,33);var r,i=Nne.hmacSHA512(this.chainCode,n),a=i.slice(0,32),s=i.slice(32);if(!iae.isPrivate(a))return this.derive(e+1);if(this.isNeutered()){var u=iae.pointAddScalar(this.publicKey,a,!0);if(null===u)return this.derive(e+1);r=d(u,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{var l=iae.privateAdd(this.privateKey,a);if(null==l)return this.derive(e+1);r=f(l,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return r}},{key:"deriveHardened",value:function(e){return Hae(A,e),this.derive(e+o)}},{key:"derivePath",value:function(e){Hae(u,e);var t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((function(e,t){var n;return"'"===t.slice(-1)?(n=parseInt(t.slice(0,-1),10),e.deriveHardened(n)):(n=parseInt(t,10),e.derive(n))}),this)}},{key:"sign",value:function(e,t){if(!this.privateKey)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return iae.sign(e,this.privateKey);for(var n=iae.sign(e,this.privateKey),r=nX.alloc(32,0),i=0;n[0]>127;)i++,r.writeUIntLE(i,0,6),n=iae.signWithEntropy(e,this.privateKey,r);return n}},{key:"verify",value:function(e,t){return iae.verify(e,this.publicKey,t)}}]),e}();function h(e,t,n){return f(e,t,n)}function f(e,t,r,o,a,s){if(Hae({privateKey:n,chainCode:n},{privateKey:e,chainCode:t}),r=r||i,!iae.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new c(e,void 0,t,r,o,a,s)}function d(e,t,r,o,a,s){if(Hae({publicKey:Hae.BufferN(33),chainCode:n},{publicKey:e,chainCode:t}),r=r||i,!iae.isPoint(e))throw new TypeError("Point is not on the curve");return new c(void 0,e,t,r,o,a,s)}t.fromBase58=function(e,t){var n=Une.decode(e);if(78!==n.length)throw new TypeError("Invalid buffer length");t=t||i;var r=n.readUInt32BE(0);if(r!==t.bip32.private&&r!==t.bip32.public)throw new TypeError("Invalid network version");var o=n[4],a=n.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");var s=n.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");var u,l=n.slice(13,45);if(r===t.bip32.private){if(0!==n.readUInt8(45))throw new TypeError("Invalid private key");u=f(n.slice(46,78),l,t,o,s,a)}else u=d(n.slice(45,78),l,t,o,s,a);return u},t.fromPrivateKey=h,t.fromPublicKey=function(e,t,n){return d(e,t,n)},t.fromSeed=function(e,t){if(Hae(Hae.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||i;var n=Nne.hmacSHA512(nX.from("Bitcoin seed","utf8"),e);return h(n.slice(0,32),n.slice(32),t)}}));PY(Vae),Vae.fromBase58,Vae.fromPrivateKey,Vae.fromPublicKey,Vae.fromSeed;var zae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fromSeed=Vae.fromSeed,t.fromBase58=Vae.fromBase58,t.fromPublicKey=Vae.fromPublicKey,t.fromPrivateKey=Vae.fromPrivateKey}));PY(zae),zae.fromSeed,zae.fromBase58,zae.fromPublicKey,zae.fromPrivateKey;var Jae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}));PY(Jae),Jae.bitcoin,Jae.regtest,Jae.testnet;var Yae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,n){t=t||4,n=void 0===n||n;var r=e.length;if(0===r)return 0;if(r>t)throw new TypeError("Script number overflow");if(n&&0==(127&e[r-1])&&(r<=1||0==(128&e[r-2])))throw new Error("Non-minimally encoded script number");if(5===r){var i=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var a=0,s=0;s<r;++s)a|=e[s]<<8*s;return 128&e[r-1]?-(a&~(128<<8*(r-1))):a},t.encode=function(e){for(var t,n=Math.abs(e),r=(t=n)>2147483647?5:t>8388607?4:t>32767?3:t>127?2:t>0?1:0,i=nX.allocUnsafe(r),o=e<0,a=0;a<r;++a)i.writeUInt8(255&n,a),n>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i}}));PY(Yae),Yae.decode,Yae.encode;var Xae=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Math.pow(2,31)-1;function r(e){return Hae.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return Hae.UInt32(e)&&e<=n},t.BIP32Path=r,r.toJSON=function(){return"BIP32 derivation path"},t.Signer=function(e){return(Hae.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign},t.Satoshi=function(e){return Hae.UInt53(e)&&e<=21e14},t.ECPoint=Hae.quacksLike("Point"),t.Network=Hae.compile({messagePrefix:Hae.oneOf(Hae.Buffer,Hae.String),bip32:{public:Hae.UInt32,private:Hae.UInt32},pubKeyHash:Hae.UInt8,scriptHash:Hae.UInt8,wif:Hae.UInt8}),t.Buffer256bit=Hae.BufferN(32),t.Hash160bit=Hae.BufferN(20),t.Hash256bit=Hae.BufferN(32),t.Number=Hae.Number,t.Array=Hae.Array,t.Boolean=Hae.Boolean,t.String=Hae.String,t.Buffer=Hae.Buffer,t.Hex=Hae.Hex,t.maybe=Hae.maybe,t.tuple=Hae.tuple,t.UInt8=Hae.UInt8,t.UInt32=Hae.UInt32,t.Function=Hae.Function,t.BufferN=Hae.BufferN,t.Null=Hae.Null,t.oneOf=Hae.oneOf}));PY(Xae),Xae.UInt31,Xae.BIP32Path,Xae.Signer,Xae.Satoshi,Xae.ECPoint,Xae.Network,Xae.Buffer256bit,Xae.Hash160bit,Xae.Hash256bit,Xae.Number,Xae.Array,Xae.Boolean,Xae.String,Xae.Buffer,Xae.Hex,Xae.maybe,Xae.tuple,Xae.UInt8,Xae.UInt32,Xae.Function,Xae.BufferN,Xae.Null,Xae.oneOf;var Wae=i9.Buffer,Zae=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var n=e[5+t];return!(0===n||6+t+n!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||n>1&&0===e[t+6]&&!(128&e[t+7]))},$ae=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var n=e[5+t];if(0===n)throw new Error("S length is zero");if(6+t+n!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(n>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},ese=function(e,t){var n=e.length,r=t.length;if(0===n)throw new Error("R length is zero");if(0===r)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(r>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=Wae.allocUnsafe(6+n+r);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+n]=2,i[5+n]=t.length,t.copy(i,6+n),i},tse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=nX.alloc(1,0);function r(e){for(var t=0;0===e[t];)++t;return t===e.length?n:128&(e=e.slice(t))[0]?nX.concat([n,e],1+e.length):e}function i(e){0===e[0]&&(e=e.slice(1));var t=nX.alloc(32,0),n=Math.max(0,32-e.length);return e.copy(t,n),t}t.decode=function(e){var t=e.readUInt8(e.length-1),n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var r=$ae(e.slice(0,-1)),o=i(r.r),a=i(r.s);return{signature:nX.concat([o,a],64),hashType:t}},t.encode=function(e,t){Hae({signature:Xae.BufferN(64),hashType:Xae.UInt8},{signature:e,hashType:t});var n=-129&t;if(n<=0||n>=4)throw new Error("Invalid hashType "+t);var i=nX.allocUnsafe(1);i.writeUInt8(t,0);var o=r(e.slice(0,32)),a=r(e.slice(32,64));return nX.concat([ese(o,a),i])}}));PY(tse),tse.decode,tse.encode;var nse=LY(Object.freeze({__proto__:null,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_SUBSTR:127,OP_LEFT:128,OP_RIGHT: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_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255,default:{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_SUBSTR:127,OP_LEFT:128,OP_RIGHT: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_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}}));function rse(e){return e<nse.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}var ise={encodingLength:rse,encode:function(e,t,n){var r=rse(t);return 1===r?e.writeUInt8(t,n):2===r?(e.writeUInt8(nse.OP_PUSHDATA1,n),e.writeUInt8(t,n+1)):3===r?(e.writeUInt8(nse.OP_PUSHDATA2,n),e.writeUInt16LE(t,n+1)):(e.writeUInt8(nse.OP_PUSHDATA4,n),e.writeUInt32LE(t,n+1)),r},decode:function(e,t){var n,r,i=e.readUInt8(t);if(i<nse.OP_PUSHDATA1)n=i,r=1;else if(i===nse.OP_PUSHDATA1){if(t+2>e.length)return null;n=e.readUInt8(t+1),r=2}else if(i===nse.OP_PUSHDATA2){if(t+3>e.length)return null;n=e.readUInt16LE(t+1),r=3}else{if(t+5>e.length)return null;if(i!==nse.OP_PUSHDATA4)throw new Error("Unexpected opcode");n=e.readUInt32LE(t+1),r=5}return{opcode:i,number:n,size:r}}},ose={};for(var ase in nse)ose[nse[ase]]=ase;var sse=ose,use=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.OPS=nse;var n=t.OPS.OP_RESERVED;function r(e){return Xae.Buffer(e)||function(e){return Xae.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function i(e){return Xae.Array(e)&&e.every(r)}function o(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?n+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function a(e){return TX(e)}function s(e){return TX(e)}function u(e){if(a(e))return e;Hae(Xae.Array,e);var t=e.reduce((function(e,t){return s(t)?1===t.length&&void 0!==o(t)?e+1:e+ise.encodingLength(t.length)+t.length:e+1}),0),n=nX.allocUnsafe(t),r=0;if(e.forEach((function(e){if(s(e)){var t=o(e);if(void 0!==t)return n.writeUInt8(t,r),void(r+=1);r+=ise.encode(n,e.length,r),e.copy(n,r),r+=e.length}else n.writeUInt8(e,r),r+=1})),r!==n.length)throw new Error("Could not decode chunks");return n}function l(e){if(n=e,Xae.Array(n))return e;var n;Hae(Xae.Buffer,e);for(var r=[],i=0;i<e.length;){var a=e[i];if(a>t.OPS.OP_0&&a<=t.OPS.OP_PUSHDATA4){var s=ise.decode(e,i);if(null===s)return null;if((i+=s.size)+s.number>e.length)return null;var u=e.slice(i,i+s.number);i+=s.number;var l=o(u);void 0!==l?r.push(l):r.push(u)}else r.push(a),i+=1}return r}function A(e){var t=-129&e;return t>0&&t<4}t.isPushOnly=i,t.compile=u,t.decompile=l,t.toASM=function(e){return a(e)&&(e=l(e)),e.map((function(e){if(s(e)){var t=o(e);if(void 0===t)return e.toString("hex");e=t}return sse[e]})).join(" ")},t.fromASM=function(e){return Hae(Xae.String,e),u(e.split(" ").map((function(e){return void 0!==t.OPS[e]?t.OPS[e]:(Hae(Xae.Hex,e),nX.from(e,"hex"))})))},t.toStack=function(e){return e=l(e),Hae(i,e),e.map((function(e){return s(e)?e:e===t.OPS.OP_0?nX.allocUnsafe(0):Yae.encode(e-n)}))},t.isCanonicalPubKey=function(e){return iae.isPoint(e)},t.isDefinedHashType=A,t.isCanonicalScriptSignature=function(e){return!!TX(e)&&!!A(e[e.length-1])&&Zae(e.slice(0,-1))},t.number=Yae,t.signature=tse}));PY(use),use.OPS,use.isPushOnly,use.compile,use.decompile,use.toASM,use.fromASM,use.toStack,use.isCanonicalPubKey,use.isDefinedHashType,use.isCanonicalScriptSignature,use.number,use.signature;var lse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=n.call(this);return this[t]=e,e},set:function(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){var t;return function(){return void 0!==t||(t=e()),t}}}));PY(lse),lse.prop,lse.value;var Ase=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),data:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var r={name:"embed",network:e.network||Jae.bitcoin};if(lse.prop(r,"output",(function(){if(e.data)return use.compile([n.OP_RETURN].concat(e.data))})),lse.prop(r,"data",(function(){if(e.output)return use.decompile(e.output).slice(1)})),t.validate&&e.output){var i=use.decompile(e.output);if(i[0]!==n.OP_RETURN)throw new TypeError("Output is invalid");if(!i.slice(1).every(Hae.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}}));PY(Ase),Ase.p2data;var cse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS,r=n.OP_RESERVED;function i(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function o(e){return use.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===n.OP_0)}t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),m:Hae.maybe(Hae.Number),n:Hae.maybe(Hae.Number),output:Hae.maybe(Hae.Buffer),pubkeys:Hae.maybe(Hae.arrayOf(iae.isPoint)),signatures:Hae.maybe(Hae.arrayOf(o)),input:Hae.maybe(Hae.Buffer)},e);var a={network:e.network||Jae.bitcoin},s=[],u=!1;function l(e){u||(u=!0,s=use.decompile(e),a.m=s[0]-r,a.n=s[s.length-2]-r,a.pubkeys=s.slice(1,-2))}if(lse.prop(a,"output",(function(){if(e.m&&a.n&&e.pubkeys)return use.compile([].concat(r+e.m,e.pubkeys,r+a.n,n.OP_CHECKMULTISIG))})),lse.prop(a,"m",(function(){if(a.output)return l(a.output),a.m})),lse.prop(a,"n",(function(){if(a.pubkeys)return a.pubkeys.length})),lse.prop(a,"pubkeys",(function(){if(e.output)return l(e.output),a.pubkeys})),lse.prop(a,"signatures",(function(){if(e.input)return use.decompile(e.input).slice(1)})),lse.prop(a,"input",(function(){if(e.signatures)return use.compile([n.OP_0].concat(e.signatures))})),lse.prop(a,"witness",(function(){if(a.input)return[]})),lse.prop(a,"name",(function(){if(a.m&&a.n)return"p2ms(".concat(a.m," of ").concat(a.n,")")})),t.validate){if(e.output){if(l(e.output),!Hae.Number(s[0]))throw new TypeError("Output is invalid");if(!Hae.Number(s[s.length-2]))throw new TypeError("Output is invalid");if(s[s.length-1]!==n.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(a.m<=0||a.n>16||a.m>a.n||a.n!==s.length-3)throw new TypeError("Output is invalid");if(!a.pubkeys.every((function(e){return iae.isPoint(e)})))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==a.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==a.n)throw new TypeError("n mismatch");if(e.pubkeys&&!i(e.pubkeys,a.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(a.n=e.pubkeys.length,a.n<a.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<a.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>a.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==n.OP_0)throw new TypeError("Input is invalid");if(0===a.signatures.length||!a.signatures.every(o))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!i(e.signatures,a.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(a,e)}}));PY(cse),cse.p2ms;var hse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),pubkey:Hae.maybe(iae.isPoint),signature:Hae.maybe(use.isCanonicalScriptSignature),input:Hae.maybe(Hae.Buffer)},e);var r=lse.value((function(){return use.decompile(e.input)})),i={name:"p2pk",network:e.network||Jae.bitcoin};if(lse.prop(i,"output",(function(){if(e.pubkey)return use.compile([e.pubkey,n.OP_CHECKSIG])})),lse.prop(i,"pubkey",(function(){if(e.output)return e.output.slice(1,-1)})),lse.prop(i,"signature",(function(){if(e.input)return r()[0]})),lse.prop(i,"input",(function(){if(e.signature)return use.compile([e.signature])})),lse.prop(i,"witness",(function(){if(i.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==n.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!iae.isPoint(i.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(i.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(i.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!use.isCanonicalScriptSignature(i.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(i,e)}}));PY(hse),hse.p2pk;var fse=UY((function(e,t){function n(e){try{return bne("rmd160").update(e).digest()}catch(t){return bne("ripemd160").update(e).digest()}}function r(e){return bne("sha256").update(e).digest()}Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=n,t.sha1=function(e){return bne("sha1").update(e).digest()},t.sha256=r,t.hash160=function(e){return n(r(e))},t.hash256=function(e){return r(r(e))}}));PY(fse),fse.ripemd160,fse.sha1,fse.sha256,fse.hash160,fse.hash256;var dse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(20)),output:Hae.maybe(Hae.BufferN(25)),pubkey:Hae.maybe(iae.isPoint),signature:Hae.maybe(use.isCanonicalScriptSignature),input:Hae.maybe(Hae.Buffer)},e);var r=lse.value((function(){var t=Une.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),i=lse.value((function(){return use.decompile(e.input)})),o=e.network||Jae.bitcoin,a={name:"p2pkh",network:o};if(lse.prop(a,"address",(function(){if(a.hash){var e=nX.allocUnsafe(21);return e.writeUInt8(o.pubKeyHash,0),a.hash.copy(e,1),Une.encode(e)}})),lse.prop(a,"hash",(function(){return e.output?e.output.slice(3,23):e.address?r().hash:e.pubkey||a.pubkey?fse.hash160(e.pubkey||a.pubkey):void 0})),lse.prop(a,"output",(function(){if(a.hash)return use.compile([n.OP_DUP,n.OP_HASH160,a.hash,n.OP_EQUALVERIFY,n.OP_CHECKSIG])})),lse.prop(a,"pubkey",(function(){if(e.input)return i()[1]})),lse.prop(a,"signature",(function(){if(e.input)return i()[0]})),lse.prop(a,"input",(function(){if(e.pubkey&&e.signature)return use.compile([e.signature,e.pubkey])})),lse.prop(a,"witness",(function(){if(a.input)return[]})),t.validate){var s=nX.from([]);if(e.address){if(r().version!==o.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==r().hash.length)throw new TypeError("Invalid address");s=r().hash}if(e.hash){if(s.length>0&&!s.equals(e.hash))throw new TypeError("Hash mismatch");s=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==n.OP_DUP||e.output[1]!==n.OP_HASH160||20!==e.output[2]||e.output[23]!==n.OP_EQUALVERIFY||e.output[24]!==n.OP_CHECKSIG)throw new TypeError("Output is invalid");var u=e.output.slice(3,23);if(s.length>0&&!s.equals(u))throw new TypeError("Hash mismatch");s=u}if(e.pubkey){var l=fse.hash160(e.pubkey);if(s.length>0&&!s.equals(l))throw new TypeError("Hash mismatch");s=l}if(e.input){var A=i();if(2!==A.length)throw new TypeError("Input is invalid");if(!use.isCanonicalScriptSignature(A[0]))throw new TypeError("Input has invalid signature");if(!iae.isPoint(A[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(A[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(A[1]))throw new TypeError("Pubkey mismatch");var c=fse.hash160(A[1]);if(s.length>0&&!s.equals(c))throw new TypeError("Hash mismatch")}}return Object.assign(a,e)}}));PY(dse),dse.p2pkh;var pse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(20)),output:Hae.maybe(Hae.BufferN(23)),redeem:Hae.maybe({network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),input:Hae.maybe(Hae.Buffer),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))}),input:Hae.maybe(Hae.Buffer),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var r=e.network;r||(r=e.redeem&&e.redeem.network||Jae.bitcoin);var i={network:r},o=lse.value((function(){var t=Une.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),a=lse.value((function(){return use.decompile(e.input)})),s=lse.value((function(){var t=a();return{network:r,output:t[t.length-1],input:use.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(lse.prop(i,"address",(function(){if(i.hash){var e=nX.allocUnsafe(21);return e.writeUInt8(i.network.scriptHash,0),i.hash.copy(e,1),Une.encode(e)}})),lse.prop(i,"hash",(function(){return e.output?e.output.slice(2,22):e.address?o().hash:i.redeem&&i.redeem.output?fse.hash160(i.redeem.output):void 0})),lse.prop(i,"output",(function(){if(i.hash)return use.compile([n.OP_HASH160,i.hash,n.OP_EQUAL])})),lse.prop(i,"redeem",(function(){if(e.input)return s()})),lse.prop(i,"input",(function(){if(e.redeem&&e.redeem.input&&e.redeem.output)return use.compile([].concat(use.decompile(e.redeem.input),e.redeem.output))})),lse.prop(i,"witness",(function(){return i.redeem&&i.redeem.witness?i.redeem.witness:i.input?[]:void 0})),lse.prop(i,"name",(function(){var e=["p2sh"];return void 0!==i.redeem&&e.push(i.redeem.name),e.join("-")})),t.validate){var u=nX.from([]);if(e.address){if(o().version!==r.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==o().hash.length)throw new TypeError("Invalid address");u=o().hash}if(e.hash){if(u.length>0&&!u.equals(e.hash))throw new TypeError("Hash mismatch");u=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==n.OP_HASH160||20!==e.output[1]||e.output[22]!==n.OP_EQUAL)throw new TypeError("Output is invalid");var l=e.output.slice(2,22);if(u.length>0&&!u.equals(l))throw new TypeError("Hash mismatch");u=l}var A=function(e){if(e.output){var t=use.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");var n=fse.hash160(e.output);if(u.length>0&&!u.equals(n))throw new TypeError("Hash mismatch");u=n}if(e.input){var r=e.input.length>0,i=e.witness&&e.witness.length>0;if(!r&&!i)throw new TypeError("Empty input");if(r&&i)throw new TypeError("Input and witness provided");if(r){var o=use.decompile(e.input);if(!use.isPushOnly(o))throw new TypeError("Non push-only scriptSig")}}};if(e.input){var c=a();if(!c||c.length<1)throw new TypeError("Input too short");if(!TX(s().output))throw new TypeError("Input is invalid");A(s())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==r)throw new TypeError("Network mismatch");if(e.input){var h=s();if(e.redeem.output&&!e.redeem.output.equals(h.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(h.input))throw new TypeError("Redeem.input mismatch")}A(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(i,e)}}));PY(pse),pse.p2sh;for(var gse="qpzry9x8gf2tvdw0s3jn54khce6mua7l",vse={},yse=0;yse<gse.length;yse++){var mse=gse.charAt(yse);if(void 0!==vse[mse])throw new TypeError(mse+" is ambiguous");vse[mse]=yse}function wse(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function bse(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=wse(t)^r>>5}for(t=wse(t),n=0;n<e.length;++n){var i=e.charCodeAt(n);t=wse(t)^31&i}return t}function Ise(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=bse(o);if("string"==typeof s)return s;for(var u=[],l=0;l<a.length;++l){var A=a.charAt(l),c=vse[A];if(void 0===c)return"Unknown character "+A;s=wse(s)^c,l+6>=a.length||u.push(c)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:u}}function Bse(e,t,n,r){for(var i=0,o=0,a=(1<<n)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=t)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}var Ese=function(e){var t=Ise.apply(null,arguments);if("object"==i(t))return t;throw new Error(t)},Cse=function(e,t,n){if(n=n||90,e.length+7+t.length>n)throw new TypeError("Exceeds length limit");var r=bse(e=e.toLowerCase());if("string"==typeof r)throw new Error(r);for(var i=e+"1",o=0;o<t.length;++o){var a=t[o];if(a>>5!=0)throw new Error("Non 5-bit word");r=wse(r)^a,i+=gse.charAt(a)}for(o=0;o<6;++o)r=wse(r);for(r^=1,o=0;o<6;++o)i+=gse.charAt(r>>5*(5-o)&31);return i},xse=function(e){var t=Bse(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},kse=function(e){var t=Bse(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)},Sse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS,r=nX.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(20)),input:Hae.maybe(Hae.BufferN(0)),network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.BufferN(22)),pubkey:Hae.maybe(iae.isPoint),signature:Hae.maybe(use.isCanonicalScriptSignature),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var i=lse.value((function(){var t=Ese(e.address),n=t.words.shift(),r=kse(t.words);return{version:n,prefix:t.prefix,data:nX.from(r)}})),o=e.network||Jae.bitcoin,a={name:"p2wpkh",network:o};if(lse.prop(a,"address",(function(){if(a.hash){var e=xse(a.hash);return e.unshift(0),Cse(o.bech32,e)}})),lse.prop(a,"hash",(function(){return e.output?e.output.slice(2,22):e.address?i().data:e.pubkey||a.pubkey?fse.hash160(e.pubkey||a.pubkey):void 0})),lse.prop(a,"output",(function(){if(a.hash)return use.compile([n.OP_0,a.hash])})),lse.prop(a,"pubkey",(function(){return e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0})),lse.prop(a,"signature",(function(){if(e.witness)return e.witness[0]})),lse.prop(a,"input",(function(){if(a.witness)return r})),lse.prop(a,"witness",(function(){if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){var s=nX.from([]);if(e.address){if(o&&o.bech32!==i().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i().version)throw new TypeError("Invalid address version");if(20!==i().data.length)throw new TypeError("Invalid address data");s=i().data}if(e.hash){if(s.length>0&&!s.equals(e.hash))throw new TypeError("Hash mismatch");s=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==n.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(s.length>0&&!s.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");s=e.output.slice(2)}if(e.pubkey){var u=fse.hash160(e.pubkey);if(s.length>0&&!s.equals(u))throw new TypeError("Hash mismatch");if(s=u,!iae.isPoint(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!use.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!iae.isPoint(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");var l=fse.hash160(e.witness[1]);if(s.length>0&&!s.equals(l))throw new TypeError("Hash mismatch")}}return Object.assign(a,e)}}));PY(Sse),Sse.p2wpkh;var Qse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS,r=nX.alloc(0);function i(e){return!(!TX(e)||65!==e.length||4!==e[0]||!iae.isPoint(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),Hae({network:Hae.maybe(Hae.Object),address:Hae.maybe(Hae.String),hash:Hae.maybe(Hae.BufferN(32)),output:Hae.maybe(Hae.BufferN(34)),redeem:Hae.maybe({input:Hae.maybe(Hae.Buffer),network:Hae.maybe(Hae.Object),output:Hae.maybe(Hae.Buffer),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))}),input:Hae.maybe(Hae.BufferN(0)),witness:Hae.maybe(Hae.arrayOf(Hae.Buffer))},e);var o=lse.value((function(){var t=Ese(e.address),n=t.words.shift(),r=kse(t.words);return{version:n,prefix:t.prefix,data:nX.from(r)}})),a=lse.value((function(){return use.decompile(e.redeem.input)})),s=e.network;s||(s=e.redeem&&e.redeem.network||Jae.bitcoin);var u={network:s};if(lse.prop(u,"address",(function(){if(u.hash){var e=xse(u.hash);return e.unshift(0),Cse(s.bech32,e)}})),lse.prop(u,"hash",(function(){return e.output?e.output.slice(2):e.address?o().data:u.redeem&&u.redeem.output?fse.sha256(u.redeem.output):void 0})),lse.prop(u,"output",(function(){if(u.hash)return use.compile([n.OP_0,u.hash])})),lse.prop(u,"redeem",(function(){if(e.witness)return{output:e.witness[e.witness.length-1],input:r,witness:e.witness.slice(0,-1)}})),lse.prop(u,"input",(function(){if(u.witness)return r})),lse.prop(u,"witness",(function(){if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){var t=use.toStack(a());return u.redeem=Object.assign({witness:t},e.redeem),u.redeem.input=r,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),lse.prop(u,"name",(function(){var e=["p2wsh"];return void 0!==u.redeem&&e.push(u.redeem.name),e.join("-")})),t.validate){var l=nX.from([]);if(e.address){if(o().prefix!==s.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==o().version)throw new TypeError("Invalid address version");if(32!==o().data.length)throw new TypeError("Invalid address data");l=o().data}if(e.hash){if(l.length>0&&!l.equals(e.hash))throw new TypeError("Hash mismatch");l=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==n.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");var A=e.output.slice(2);if(l.length>0&&!l.equals(A))throw new TypeError("Hash mismatch");l=A}if(e.redeem){if(e.redeem.network&&e.redeem.network!==s)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===use.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");var c=fse.sha256(e.redeem.output);if(l.length>0&&!l.equals(c))throw new TypeError("Hash mismatch");l=c}if(e.redeem.input&&!use.isPushOnly(a()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((function(e,n){return e.equals(t[n])}))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&a().some(i)||e.redeem.output&&(use.decompile(e.redeem.output)||[]).some(i))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){var h=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(h))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(i)||(use.decompile(h)||[]).some(i))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(u,e)}}));PY(Qse),Qse.p2wsh;var _se=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.embed=Ase.p2data,t.p2ms=cse.p2ms,t.p2pk=hse.p2pk,t.p2pkh=dse.p2pkh,t.p2sh=pse.p2sh,t.p2wpkh=Sse.p2wpkh,t.p2wsh=Qse.p2wsh}));PY(_se),_se.embed,_se.p2ms,_se.p2pk,_se.p2pkh,_se.p2sh,_se.p2wpkh,_se.p2wsh;var Nse=UY((function(e,t){function n(e){var t=Une.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function r(e){var t=Ese(e),n=kse(t.words.slice(1));return{version:t.words[0],prefix:t.prefix,data:nX.from(n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase58Check=n,t.fromBech32=r,t.toBase58Check=function(e,t){Hae(Xae.tuple(Xae.Hash160bit,Xae.UInt8),arguments);var n=nX.allocUnsafe(21);return n.writeUInt8(t,0),e.copy(n,1),Une.encode(n)},t.toBech32=function(e,t,n){var r=xse(e);return r.unshift(t),Cse(n,r)},t.fromOutputScript=function(e,t){t=t||Jae.bitcoin;try{return _se.p2pkh({output:e,network:t}).address}catch(e){}try{return _se.p2sh({output:e,network:t}).address}catch(e){}try{return _se.p2wpkh({output:e,network:t}).address}catch(e){}try{return _se.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(use.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){var i,o;t=t||Jae.bitcoin;try{i=n(e)}catch(e){}if(i){if(i.version===t.pubKeyHash)return _se.p2pkh({hash:i.hash}).output;if(i.version===t.scriptHash)return _se.p2sh({hash:i.hash}).output}else{try{o=r(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return _se.p2wpkh({hash:o.data}).output;if(32===o.data.length)return _se.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}));PY(Nse),Nse.fromBase58Check,Nse.fromBech32,Nse.toBase58Check,Nse.toBech32,Nse.fromOutputScript,Nse.toOutputScript;var Dse=UY((function(e){var t=65536,n=i9.Buffer,r=FY.crypto||FY.msCrypto;r&&r.getRandomValues?e.exports=function(e,i){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=n.allocUnsafe(e);if(e>0)if(e>t)for(var a=0;a<e;a+=t)r.getRandomValues(o.slice(a,a+t));else r.getRandomValues(o);return"function"==typeof i?ZX((function(){i(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}})),Fse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Hae.maybe(Hae.compile({compressed:Xae.maybe(Xae.Boolean),network:Xae.maybe(Xae.Network)})),r=function(){function e(t,n,r){s(this,e),this.__D=t,this.__Q=n,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||Jae.bitcoin,void 0!==n&&(this.__Q=iae.pointCompress(n,this.compressed))}return l(e,[{key:"privateKey",get:function(){return this.__D}},{key:"publicKey",get:function(){return this.__Q||(this.__Q=iae.pointFromScalar(this.__D,this.compressed)),this.__Q}},{key:"toWIF",value:function(){if(!this.__D)throw new Error("Missing private key");return qae(this.network.wif,this.__D,this.compressed)}},{key:"sign",value:function(e,t){if(!this.__D)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return iae.sign(e,this.__D);for(var n=iae.sign(e,this.__D),r=nX.alloc(32,0),i=0;n[0]>127;)i++,r.writeUIntLE(i,0,6),n=iae.signWithEntropy(e,this.__D,r);return n}},{key:"verify",value:function(e,t){return iae.verify(e,this.publicKey,t)}}]),e}();function i(e,t){if(Hae(Xae.Buffer256bit,e),!iae.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return Hae(n,t),new r(e,void 0,t)}t.fromPrivateKey=i,t.fromPublicKey=function(e,t){return Hae(iae.isPoint,e),Hae(n,t),new r(void 0,e,t)},t.fromWIF=function(e,t){var n=Gae(e),r=n.version;if(Xae.Array(t)){if(!(t=t.filter((function(e){return r===e.wif})).pop()))throw new Error("Unknown network version")}else if(t=t||Jae.bitcoin,r!==t.wif)throw new Error("Invalid network version");return i(n.privateKey,{compressed:n.compressed,network:t})},t.makeRandom=function(e){Hae(n,e),void 0===e&&(e={});var t,r=e.rng||Dse;do{t=r(32),Hae(Xae.Buffer256bit,t)}while(!iae.isPrivate(t));return i(t,e)}}));PY(Fse),Fse.fromPrivateKey,Fse.fromPublicKey,Fse.fromWIF,Fse.makeRandom;var Pse=i9.Buffer;function Use(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function Lse(e){return Use(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var Mse={encode:function e(t,n,r){if(Use(t),n||(n=Pse.allocUnsafe(Lse(t))),!Pse.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");return r||(r=0),t<253?(n.writeUInt8(t,r),e.bytes=1):t<=65535?(n.writeUInt8(253,r),n.writeUInt16LE(t,r+1),e.bytes=3):t<=4294967295?(n.writeUInt8(254,r),n.writeUInt32LE(t,r+1),e.bytes=5):(n.writeUInt8(255,r),n.writeUInt32LE(t>>>0,r+1),n.writeUInt32LE(t/4294967296|0,r+5),e.bytes=9),n},decode:function e(t,n){if(!Pse.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);var r=t.readUInt8(n);if(r<253)return e.bytes=1,r;if(253===r)return e.bytes=3,t.readUInt16LE(n+1);if(254===r)return e.bytes=5,t.readUInt32LE(n+1);e.bytes=9;var i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return Use(o),o},encodingLength:Lse},Tse=UY((function(e,t){function n(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function r(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return n((i*=4294967296)+r,9007199254740991),i+r}function i(e,t,r){return n(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}Object.defineProperty(t,"__esModule",{value:!0}),t.readUInt64LE=r,t.writeUInt64LE=i,t.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},t.cloneBuffer=function(e){var t=nX.allocUnsafe(e.length);return e.copy(t),t},t.BufferWriter=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,Hae(Xae.tuple(Xae.Buffer,Xae.UInt32),[t,n])}return l(e,[{key:"writeUInt8",value:function(e){this.offset=this.buffer.writeUInt8(e,this.offset)}},{key:"writeInt32",value:function(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}},{key:"writeUInt32",value:function(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}},{key:"writeUInt64",value:function(e){this.offset=i(this.buffer,e,this.offset)}},{key:"writeVarInt",value:function(e){Mse.encode(e,this.buffer,this.offset),this.offset+=Mse.encode.bytes}},{key:"writeSlice",value:function(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}},{key:"writeVarSlice",value:function(e){this.writeVarInt(e.length),this.writeSlice(e)}},{key:"writeVector",value:function(e){var t=this;this.writeVarInt(e.length),e.forEach((function(e){return t.writeVarSlice(e)}))}}]),e}(),t.BufferReader=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s(this,e),this.buffer=t,this.offset=n,Hae(Xae.tuple(Xae.Buffer,Xae.UInt32),[t,n])}return l(e,[{key:"readUInt8",value:function(){var e=this.buffer.readUInt8(this.offset);return this.offset++,e}},{key:"readInt32",value:function(){var e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt32",value:function(){var e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}},{key:"readUInt64",value:function(){var e=r(this.buffer,this.offset);return this.offset+=8,e}},{key:"readVarInt",value:function(){var e=Mse.decode(this.buffer,this.offset);return this.offset+=Mse.decode.bytes,e}},{key:"readSlice",value:function(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"readVarSlice",value:function(){return this.readSlice(this.readVarInt())}},{key:"readVector",value:function(){for(var e=this.readVarInt(),t=[],n=0;n<e;n++)t.push(this.readVarSlice());return t}}]),e}()}));PY(Tse),Tse.readUInt64LE,Tse.writeUInt64LE,Tse.reverseBuffer,Tse.cloneBuffer,Tse.BufferWriter,Tse.BufferReader;var Rse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=e.length;return Mse.encodingLength(t)+t}var i=nX.allocUnsafe(0),o=[],a=nX.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),u=nX.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),A=nX.from("ffffffffffffffff","hex"),c={script:i,valueBuffer:A},h=function(){function e(){s(this,e),this.version=1,this.locktime=0,this.ins=[],this.outs=[]}return l(e,[{key:"isCoinbase",value:function(){return 1===this.ins.length&&e.isCoinbaseHash(this.ins[0].hash)}},{key:"addInput",value:function(t,n,r,a){return Hae(Xae.tuple(Xae.Hash256bit,Xae.UInt32,Xae.maybe(Xae.UInt32),Xae.maybe(Xae.Buffer)),arguments),Xae.Null(r)&&(r=e.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:n,script:a||i,sequence:r,witness:o})-1}},{key:"addOutput",value:function(e,t){return Hae(Xae.tuple(Xae.Buffer,Xae.Satoshi),arguments),this.outs.push({script:e,value:t})-1}},{key:"hasWitnesses",value:function(){return this.ins.some((function(e){return 0!==e.witness.length}))}},{key:"weight",value:function(){return 3*this.byteLength(!1)+this.byteLength(!0)}},{key:"virtualSize",value:function(){return Math.ceil(this.weight()/4)}},{key:"byteLength",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e&&this.hasWitnesses();return(t?10:8)+Mse.encodingLength(this.ins.length)+Mse.encodingLength(this.outs.length)+this.ins.reduce((function(e,t){return e+40+r(t.script)}),0)+this.outs.reduce((function(e,t){return e+8+r(t.script)}),0)+(t?this.ins.reduce((function(e,t){return e+function(e){var t=e.length;return Mse.encodingLength(t)+e.reduce((function(e,t){return e+r(t)}),0)}(t.witness)}),0):0)}},{key:"clone",value:function(){var t=new e;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map((function(e){return{hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}})),t.outs=this.outs.map((function(e){return{script:e.script,value:e.value}})),t}},{key:"hashForSignature",value:function(t,r,o){if(Hae(Xae.tuple(Xae.UInt32,Xae.Buffer,Xae.Number),arguments),t>=this.ins.length)return u;var a=use.compile(use.decompile(r).filter((function(e){return e!==n.OPS.OP_CODESEPARATOR}))),s=this.clone();if((31&o)===e.SIGHASH_NONE)s.outs=[],s.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}));else if((31&o)===e.SIGHASH_SINGLE){if(t>=this.outs.length)return u;s.outs.length=t+1;for(var l=0;l<t;l++)s.outs[l]=c;s.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}))}o&e.SIGHASH_ANYONECANPAY?(s.ins=[s.ins[t]],s.ins[0].script=a):(s.ins.forEach((function(e){e.script=i})),s.ins[t].script=a);var A=nX.allocUnsafe(s.byteLength(!1)+4);return A.writeInt32LE(o,A.length-4),s.__toBuffer(A,0,!1),fse.hash256(A)}},{key:"hashForWitnessV0",value:function(t,n,i,o){Hae(Xae.tuple(Xae.UInt32,Xae.Buffer,Xae.Satoshi,Xae.UInt32),arguments);var s,u=nX.from([]),l=a,A=a,c=a;if(o&e.SIGHASH_ANYONECANPAY||(u=nX.allocUnsafe(36*this.ins.length),s=new Tse.BufferWriter(u,0),this.ins.forEach((function(e){s.writeSlice(e.hash),s.writeUInt32(e.index)})),A=fse.hash256(u)),o&e.SIGHASH_ANYONECANPAY||(31&o)===e.SIGHASH_SINGLE||(31&o)===e.SIGHASH_NONE||(u=nX.allocUnsafe(4*this.ins.length),s=new Tse.BufferWriter(u,0),this.ins.forEach((function(e){s.writeUInt32(e.sequence)})),c=fse.hash256(u)),(31&o)!==e.SIGHASH_SINGLE&&(31&o)!==e.SIGHASH_NONE){var h=this.outs.reduce((function(e,t){return e+8+r(t.script)}),0);u=nX.allocUnsafe(h),s=new Tse.BufferWriter(u,0),this.outs.forEach((function(e){s.writeUInt64(e.value),s.writeVarSlice(e.script)})),l=fse.hash256(u)}else if((31&o)===e.SIGHASH_SINGLE&&t<this.outs.length){var f=this.outs[t];u=nX.allocUnsafe(8+r(f.script)),(s=new Tse.BufferWriter(u,0)).writeUInt64(f.value),s.writeVarSlice(f.script),l=fse.hash256(u)}u=nX.allocUnsafe(156+r(n)),s=new Tse.BufferWriter(u,0);var d=this.ins[t];return s.writeUInt32(this.version),s.writeSlice(A),s.writeSlice(c),s.writeSlice(d.hash),s.writeUInt32(d.index),s.writeVarSlice(n),s.writeUInt64(i),s.writeUInt32(d.sequence),s.writeSlice(l),s.writeUInt32(this.locktime),s.writeUInt32(o),fse.hash256(u)}},{key:"getHash",value:function(e){return e&&this.isCoinbase()?nX.alloc(32,0):fse.hash256(this.__toBuffer(void 0,void 0,e))}},{key:"getId",value:function(){return Tse.reverseBuffer(this.getHash(!1)).toString("hex")}},{key:"toBuffer",value:function(e,t){return this.__toBuffer(e,t,!0)}},{key:"toHex",value:function(){return this.toBuffer(void 0,void 0).toString("hex")}},{key:"setInputScript",value:function(e,t){Hae(Xae.tuple(Xae.Number,Xae.Buffer),arguments),this.ins[e].script=t}},{key:"setWitness",value:function(e,t){Hae(Xae.tuple(Xae.Number,[Xae.Buffer]),arguments),this.ins[e].witness=t}},{key:"__toBuffer",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||(t=nX.allocUnsafe(this.byteLength(r)));var i=new Tse.BufferWriter(t,n||0);i.writeInt32(this.version);var o=r&&this.hasWitnesses();return o&&(i.writeUInt8(e.ADVANCED_TRANSACTION_MARKER),i.writeUInt8(e.ADVANCED_TRANSACTION_FLAG)),i.writeVarInt(this.ins.length),this.ins.forEach((function(e){i.writeSlice(e.hash),i.writeUInt32(e.index),i.writeVarSlice(e.script),i.writeUInt32(e.sequence)})),i.writeVarInt(this.outs.length),this.outs.forEach((function(e){void 0!==e.value?i.writeUInt64(e.value):i.writeSlice(e.valueBuffer),i.writeVarSlice(e.script)})),o&&this.ins.forEach((function(e){i.writeVector(e.witness)})),i.writeUInt32(this.locktime),void 0!==n?t.slice(n,i.offset):t}}],[{key:"fromBuffer",value:function(t,n){var r=new Tse.BufferReader(t),i=new e;i.version=r.readInt32();var a=r.readUInt8(),s=r.readUInt8(),u=!1;a===e.ADVANCED_TRANSACTION_MARKER&&s===e.ADVANCED_TRANSACTION_FLAG?u=!0:r.offset-=2;for(var l=r.readVarInt(),A=0;A<l;++A)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:o});for(var c=r.readVarInt(),h=0;h<c;++h)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(u){for(var f=0;f<l;++f)i.ins[f].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),n)return i;if(r.offset!==t.length)throw new Error("Transaction has unexpected data");return i}},{key:"fromHex",value:function(t){return e.fromBuffer(nX.from(t,"hex"),!1)}},{key:"isCoinbaseHash",value:function(e){Hae(Xae.Hash256bit,e);for(var t=0;t<32;++t)if(0!==e[t])return!1;return!0}}]),e}();h.DEFAULT_SEQUENCE=4294967295,h.SIGHASH_ALL=1,h.SIGHASH_NONE=2,h.SIGHASH_SINGLE=3,h.SIGHASH_ANYONECANPAY=128,h.ADVANCED_TRANSACTION_MARKER=0,h.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=h}));PY(Rse),Rse.Transaction;var Ose=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=new TypeError("Cannot compute merkle root for zero transactions"),r=new TypeError("Cannot compute witness commit for non-segwit block"),o=function(){function e(){s(this,e),this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}return l(e,[{key:"getWitnessCommit",value:function(){if(!a(this.transactions))return null;var e=this.transactions[0].outs.filter((function(e){return e.script.slice(0,6).equals(nX.from("6a24aa21a9ed","hex"))})).map((function(e){return e.script.slice(6,38)}));if(0===e.length)return null;var t=e[e.length-1];return t instanceof nX&&32===t.length?t:null}},{key:"hasWitnessCommit",value:function(){return this.witnessCommit instanceof nX&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}},{key:"hasWitness",value:function(){return(e=this.transactions)instanceof Array&&e.some((function(e){return"object"==i(e)&&e.ins instanceof Array&&e.ins.some((function(e){return"object"==i(e)&&e.witness instanceof Array&&e.witness.length>0}))}));var e}},{key:"weight",value:function(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}},{key:"byteLength",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e||!this.transactions?80:80+Mse.encodingLength(this.transactions.length)+this.transactions.reduce((function(e,n){return e+n.byteLength(t)}),0)}},{key:"getHash",value:function(){return fse.hash256(this.toBuffer(!0))}},{key:"getId",value:function(){return Tse.reverseBuffer(this.getHash()).toString("hex")}},{key:"getUTCDate",value:function(){var e=new Date(0);return e.setUTCSeconds(this.timestamp),e}},{key:"toBuffer",value:function(e){var t=nX.allocUnsafe(this.byteLength(e)),n=new Tse.BufferWriter(t);return n.writeInt32(this.version),n.writeSlice(this.prevHash),n.writeSlice(this.merkleRoot),n.writeUInt32(this.timestamp),n.writeUInt32(this.bits),n.writeUInt32(this.nonce),e||!this.transactions||(Mse.encode(this.transactions.length,t,n.offset),n.offset+=Mse.encode.bytes,this.transactions.forEach((function(e){var r=e.byteLength();e.toBuffer(t,n.offset),n.offset+=r}))),t}},{key:"toHex",value:function(e){return this.toBuffer(e).toString("hex")}},{key:"checkTxRoots",value:function(){var e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}},{key:"checkProofOfWork",value:function(){var t=Tse.reverseBuffer(this.getHash()),n=e.calculateTarget(this.bits);return t.compare(n)<=0}},{key:"__checkMerkleRoot",value:function(){if(!this.transactions)throw n;var t=e.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(t)}},{key:"__checkWitnessCommit",value:function(){if(!this.transactions)throw n;if(!this.hasWitnessCommit())throw r;var t=e.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(t)}}],[{key:"fromBuffer",value:function(t){if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");var n=new Tse.BufferReader(t),r=new e;if(r.version=n.readInt32(),r.prevHash=n.readSlice(32),r.merkleRoot=n.readSlice(32),r.timestamp=n.readUInt32(),r.bits=n.readUInt32(),r.nonce=n.readUInt32(),80===t.length)return r;var i=function(){var e=Rse.Transaction.fromBuffer(n.buffer.slice(n.offset),!0);return n.offset+=e.byteLength(),e},o=n.readVarInt();r.transactions=[];for(var a=0;a<o;++a){var s=i();r.transactions.push(s)}var u=r.getWitnessCommit();return u&&(r.witnessCommit=u),r}},{key:"fromHex",value:function(t){return e.fromBuffer(nX.from(t,"hex"))}},{key:"calculateTarget",value:function(e){var t=((4278190080&e)>>24)-3,n=8388607&e,r=nX.alloc(32,0);return r.writeUIntBE(n,29-t,3),r}},{key:"calculateMerkleRoot",value:function(e,t){if(Hae([{getHash:Xae.Function}],e),0===e.length)throw n;if(t&&!a(e))throw r;var i=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var n=e.length,r=e.concat();n>1;){for(var i=0,o=0;o<n;o+=2,++i){var a=r[o],s=o+1===n?a:r[o+1],u=nX.concat([a,s]);r[i]=t(u)}n=i}return r[0]}(e.map((function(e){return e.getHash(t)})),fse.hash256);return t?fse.hash256(nX.concat([i,e[0].ins[0].witness[0]])):i}}]),e}();function a(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=o}));PY(Ose),Ose.Block;var Hse=UY((function(e,t){var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.GlobalTypes||(t.GlobalTypes={}))[n.UNSIGNED_TX=0]="UNSIGNED_TX",n[n.GLOBAL_XPUB=1]="GLOBAL_XPUB",t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(r=t.InputTypes||(t.InputTypes={}))[r.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",r[r.WITNESS_UTXO=1]="WITNESS_UTXO",r[r.PARTIAL_SIG=2]="PARTIAL_SIG",r[r.SIGHASH_TYPE=3]="SIGHASH_TYPE",r[r.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",r[r.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",r[r.BIP32_DERIVATION=6]="BIP32_DERIVATION",r[r.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",r[r.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",r[r.POR_COMMITMENT=9]="POR_COMMITMENT",t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],(i=t.OutputTypes||(t.OutputTypes={}))[i.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",i[i.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",i[i.BIP32_DERIVATION=2]="BIP32_DERIVATION",t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]}));PY(Hse),Hse.GlobalTypes,Hse.GLOBAL_TYPE_NAMES,Hse.InputTypes,Hse.INPUT_TYPE_NAMES,Hse.OutputTypes,Hse.OUTPUT_TYPE_NAMES;var Kse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");var t,n=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:n,path:"m"},i=F(function(e){return k(Array(e).keys())}(e.value.length/4-1));try{for(i.s();!(t=i.n()).done;){var o=t.value,a=e.value.readUInt32LE(4*o+4),s=!!(2147483648&a),u=2147483647&a;r.path+="/"+u.toString(10)+(s?"'":"")}}catch(e){i.e(e)}finally{i.f()}return r},t.encode=function(e){var t=nX.from([Hse.GlobalTypes.GLOBAL_XPUB]),n=nX.concat([t,e.extendedPubkey]),r=e.path.split("/"),i=nX.allocUnsafe(4*r.length);e.masterFingerprint.copy(i,0);var o=4;return r.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),i.writeUInt32LE(n,o),o+=4})),{key:n,value:i}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(e){var t=e.extendedPubkey,n=e.masterFingerprint,r=e.path;return TX(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&TX(n)&&4===n.length&&"string"==typeof r&&!!r.match(/^m(\/\d+'?)+$/)},t.canAddToArray=function(e,t,n){var r=t.extendedPubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.extendedPubkey.equals(t.extendedPubkey)})).length)}}));PY(Kse),Kse.decode,Kse.encode,Kse.expected,Kse.check,Kse.canAddToArray;var jse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function(e){return{key:nX.from([Hse.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}}}));PY(jse),jse.encode;var Gse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:nX.from([Hse.InputTypes.FINAL_SCRIPTSIG]),value:e}},t.expected="Buffer",t.check=function(e){return TX(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}));PY(Gse),Gse.decode,Gse.encode,Gse.expected,Gse.check,Gse.canAdd;var qse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:nX.from([Hse.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},t.expected="Buffer",t.check=function(e){return TX(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}));PY(qse),qse.decode,qse.encode,qse.expected,qse.check,qse.canAdd;var Vse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:nX.from([Hse.InputTypes.NON_WITNESS_UTXO]),value:e}},t.expected="Buffer",t.check=function(e){return TX(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}}));PY(Vse),Vse.decode,Vse.encode,Vse.expected,Vse.check,Vse.canAdd;var zse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(e){var t=nX.from([Hse.InputTypes.PARTIAL_SIG]);return{key:nX.concat([t,e.pubkey]),value:e.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(e){return TX(e.pubkey)&&TX(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!TX(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;var t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;var n=e[3+t+2];return!(n>33||n<1)&&e.length===3+t+2+n+2}(e.signature)},t.canAddToArray=function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)}}));PY(zse),zse.decode,zse.encode,zse.expected,zse.check,zse.canAddToArray;var Jse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(e){return{key:nX.from([Hse.InputTypes.POR_COMMITMENT]),value:nX.from(e,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}));PY(Jse),Jse.decode,Jse.encode,Jse.expected,Jse.check,Jse.canAdd;var Yse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(e){var t=nX.from([Hse.InputTypes.SIGHASH_TYPE]),n=nX.allocUnsafe(4);return n.writeUInt32LE(e,0),{key:t,value:n}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}));PY(Yse),Yse.decode,Yse.encode,Yse.expected,Yse.check,Yse.canAdd;var Xse=UY((function(e,t){function n(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function r(e){return n(e),e<253?1:e<=65535?3:e<=4294967295?5:9}Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function e(t,i,o){if(n(t),i||(i=nX.allocUnsafe(r(t))),!TX(i))throw new TypeError("buffer must be a Buffer instance");return o||(o=0),t<253?(i.writeUInt8(t,o),Object.assign(e,{bytes:1})):t<=65535?(i.writeUInt8(253,o),i.writeUInt16LE(t,o+1),Object.assign(e,{bytes:3})):t<=4294967295?(i.writeUInt8(254,o),i.writeUInt32LE(t,o+1),Object.assign(e,{bytes:5})):(i.writeUInt8(255,o),i.writeUInt32LE(t>>>0,o+1),i.writeUInt32LE(t/4294967296|0,o+5),Object.assign(e,{bytes:9})),i},t.decode=function e(t,r){if(!TX(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=t.readUInt8(r);if(i<253)return Object.assign(e,{bytes:1}),i;if(253===i)return Object.assign(e,{bytes:3}),t.readUInt16LE(r+1);if(254===i)return Object.assign(e,{bytes:5}),t.readUInt32LE(r+1);Object.assign(e,{bytes:9});var o=t.readUInt32LE(r+1),a=4294967296*t.readUInt32LE(r+5)+o;return n(a),a},t.encodingLength=r}));PY(Xse),Xse.encode,Xse.decode,Xse.encodingLength;var Wse=UY((function(e,t){function n(e){var t=e.key.length,n=e.value.length,r=Xse.encodingLength(t),i=Xse.encodingLength(n),o=nX.allocUnsafe(r+t+i+n);return Xse.encode(t,o,0),e.key.copy(o,r),Xse.encode(n,o,r+t),e.value.copy(o,r+t+i),o}function r(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}Object.defineProperty(t,"__esModule",{value:!0}),t.range=function(e){return k(Array(e).keys())},t.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,n=0,r=0;r<e.length/2;r++)n=e[r],e[r]=e[t],e[t]=n,t--;return e},t.keyValsToBuffer=function(e){var t=e.map(n);return t.push(nX.from([0])),nX.concat(t)},t.keyValToBuffer=n,t.readUInt64LE=function(e,t){var n=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return r((i*=4294967296)+n,9007199254740991),i+n},t.writeUInt64LE=function(e,t,n){return r(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}}));PY(Wse),Wse.range,Wse.reverseBuffer,Wse.keyValsToBuffer,Wse.keyValToBuffer,Wse.readUInt64LE,Wse.writeUInt64LE;var Zse=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==Hse.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));var t=Wse.readUInt64LE(e.value,0),n=8,r=Xse.decode(e.value,n);n+=Xse.encodingLength(r);var i=e.value.slice(n);if(i.length!==r)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},t.encode=function(e){var t=e.script,n=e.value,r=Xse.encodingLength(t.length),i=nX.allocUnsafe(8+r+t.length);return Wse.writeUInt64LE(i,n,0),Xse.encode(t.length,i,8),t.copy(i,8+r),{key:nX.from([Hse.InputTypes.WITNESS_UTXO]),value:i}},t.expected="{ script: Buffer; value: number; }",t.check=function(e){return TX(e.script)&&"number"==typeof e.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}}));PY(Zse),Zse.decode,Zse.encode,Zse.expected,Zse.check,Zse.canAdd;var $se=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");var n,r=t.key.slice(1),i={masterFingerprint:t.value.slice(0,4),pubkey:r,path:"m"},o=F(function(e){return k(Array(e).keys())}(t.value.length/4-1));try{for(o.s();!(n=o.n()).done;){var a=n.value,s=t.value.readUInt32LE(4*a+4),u=!!(2147483648&s),l=2147483647&s;i.path+="/"+l.toString(10)+(u?"'":"")}}catch(e){o.e(e)}finally{o.f()}return i},encode:function(t){var n=nX.from([e]),r=nX.concat([n,t.pubkey]),i=t.path.split("/"),o=nX.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);var a=4;return i.slice(1).forEach((function(e){var t="'"===e.slice(-1),n=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(n+=2147483648),o.writeUInt32LE(n,a),a+=4})),{key:r,value:o}},check:function(e){return TX(e.pubkey)&&TX(e.masterFingerprint)&&"string"==typeof e.path&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,n){var r=t.pubkey.toString("hex");return!n.has(r)&&(n.add(r),0===e.filter((function(e){return e.pubkey.equals(t.pubkey)})).length)}}}}));PY($se),$se.makeConverter;var eue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){var n;if(e.includes(t.key[0])&&(33!==(n=t.key.slice(1)).length&&65!==n.length||![2,3,4].includes(n[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return n}}}));PY(eue),eue.makeChecker;var tue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:nX.from([e]),value:t}},check:function(e){return TX(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}));PY(tue),tue.makeConverter;var nue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:nX.from([e]),value:t}},check:function(e){return TX(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}));PY(nue),nue.makeConverter;var rue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={unsignedTx:jse,globalXpub:Kse,checkPubkey:eue.makeChecker([])};t.globals=n;var r={nonWitnessUtxo:Vse,partialSig:zse,sighashType:Yse,finalScriptSig:Gse,finalScriptWitness:qse,porCommitment:Jse,witnessUtxo:Zse,bip32Derivation:$se.makeConverter(Hse.InputTypes.BIP32_DERIVATION),redeemScript:tue.makeConverter(Hse.InputTypes.REDEEM_SCRIPT),witnessScript:nue.makeConverter(Hse.InputTypes.WITNESS_SCRIPT),checkPubkey:eue.makeChecker([Hse.InputTypes.PARTIAL_SIG,Hse.InputTypes.BIP32_DERIVATION])};t.inputs=r;var i={bip32Derivation:$se.makeConverter(Hse.OutputTypes.BIP32_DERIVATION),redeemScript:tue.makeConverter(Hse.OutputTypes.REDEEM_SCRIPT),witnessScript:nue.makeConverter(Hse.OutputTypes.WITNESS_SCRIPT),checkPubkey:eue.makeChecker([Hse.OutputTypes.BIP32_DERIVATION])};t.outputs=i}));PY(rue),rue.globals,rue.inputs,rue.outputs;var iue=UY((function(e,t){function n(e,t,n){if(!t.equals(nX.from([n])))throw new Error("Format Error: Invalid ".concat(e," key: ").concat(t.toString("hex")))}function r(e,t){var r,i=t.globalMapKeyVals,o=t.inputKeyVals,a=t.outputKeyVals,s={unsignedTx:e},u=0,l=F(i);try{for(l.s();!(r=l.n()).done;){var A=r.value;switch(A.key[0]){case Hse.GlobalTypes.UNSIGNED_TX:if(n("global",A.key,Hse.GlobalTypes.UNSIGNED_TX),u>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");u++;break;case Hse.GlobalTypes.GLOBAL_XPUB:void 0===s.globalXpub&&(s.globalXpub=[]),s.globalXpub.push(rue.globals.globalXpub.decode(A));break;default:s.unknownKeyVals||(s.unknownKeyVals=[]),s.unknownKeyVals.push(A)}}}catch(e){l.e(e)}finally{l.f()}var c,h=o.length,f=a.length,d=[],p=[],g=F(Wse.range(h));try{for(g.s();!(c=g.n()).done;){var v,y=c.value,m={},w=F(o[y]);try{for(w.s();!(v=w.n()).done;){var b=v.value;switch(rue.inputs.checkPubkey(b),b.key[0]){case Hse.InputTypes.NON_WITNESS_UTXO:if(n("input",b.key,Hse.InputTypes.NON_WITNESS_UTXO),void 0!==m.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");m.nonWitnessUtxo=rue.inputs.nonWitnessUtxo.decode(b);break;case Hse.InputTypes.WITNESS_UTXO:if(n("input",b.key,Hse.InputTypes.WITNESS_UTXO),void 0!==m.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");m.witnessUtxo=rue.inputs.witnessUtxo.decode(b);break;case Hse.InputTypes.PARTIAL_SIG:void 0===m.partialSig&&(m.partialSig=[]),m.partialSig.push(rue.inputs.partialSig.decode(b));break;case Hse.InputTypes.SIGHASH_TYPE:if(n("input",b.key,Hse.InputTypes.SIGHASH_TYPE),void 0!==m.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");m.sighashType=rue.inputs.sighashType.decode(b);break;case Hse.InputTypes.REDEEM_SCRIPT:if(n("input",b.key,Hse.InputTypes.REDEEM_SCRIPT),void 0!==m.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");m.redeemScript=rue.inputs.redeemScript.decode(b);break;case Hse.InputTypes.WITNESS_SCRIPT:if(n("input",b.key,Hse.InputTypes.WITNESS_SCRIPT),void 0!==m.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");m.witnessScript=rue.inputs.witnessScript.decode(b);break;case Hse.InputTypes.BIP32_DERIVATION:void 0===m.bip32Derivation&&(m.bip32Derivation=[]),m.bip32Derivation.push(rue.inputs.bip32Derivation.decode(b));break;case Hse.InputTypes.FINAL_SCRIPTSIG:n("input",b.key,Hse.InputTypes.FINAL_SCRIPTSIG),m.finalScriptSig=rue.inputs.finalScriptSig.decode(b);break;case Hse.InputTypes.FINAL_SCRIPTWITNESS:n("input",b.key,Hse.InputTypes.FINAL_SCRIPTWITNESS),m.finalScriptWitness=rue.inputs.finalScriptWitness.decode(b);break;case Hse.InputTypes.POR_COMMITMENT:n("input",b.key,Hse.InputTypes.POR_COMMITMENT),m.porCommitment=rue.inputs.porCommitment.decode(b);break;default:m.unknownKeyVals||(m.unknownKeyVals=[]),m.unknownKeyVals.push(b)}}}catch(e){w.e(e)}finally{w.f()}d.push(m)}}catch(e){g.e(e)}finally{g.f()}var I,B=F(Wse.range(f));try{for(B.s();!(I=B.n()).done;){var E,C=I.value,x={},k=F(a[C]);try{for(k.s();!(E=k.n()).done;){var S=E.value;switch(rue.outputs.checkPubkey(S),S.key[0]){case Hse.OutputTypes.REDEEM_SCRIPT:if(n("output",S.key,Hse.OutputTypes.REDEEM_SCRIPT),void 0!==x.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");x.redeemScript=rue.outputs.redeemScript.decode(S);break;case Hse.OutputTypes.WITNESS_SCRIPT:if(n("output",S.key,Hse.OutputTypes.WITNESS_SCRIPT),void 0!==x.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");x.witnessScript=rue.outputs.witnessScript.decode(S);break;case Hse.OutputTypes.BIP32_DERIVATION:void 0===x.bip32Derivation&&(x.bip32Derivation=[]),x.bip32Derivation.push(rue.outputs.bip32Derivation.decode(S));break;default:x.unknownKeyVals||(x.unknownKeyVals=[]),x.unknownKeyVals.push(S)}}}catch(e){k.e(e)}finally{k.f()}p.push(x)}}catch(e){B.e(e)}finally{B.f()}return{globalMap:s,inputs:d,outputs:p}}Object.defineProperty(t,"__esModule",{value:!0}),t.psbtFromBuffer=function(e,t){var n=0;function i(){var t=Xse.decode(e,n);n+=Xse.encodingLength(t);var r=e.slice(n,n+t);return n+=t,r}function o(){return{key:i(),value:i()}}function a(){if(n>=e.length)throw new Error("Format Error: Unexpected End of PSBT");var t=0===e.readUInt8(n);return t&&n++,t}if(1886610036!==function(){var t=e.readUInt32BE(n);return n+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){var t=e.readUInt8(n);return n+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");for(var s=[],u={};!a();){var l=o(),A=l.key.toString("hex");if(u[A])throw new Error("Format Error: Keys must be unique for global keymap: key "+A);u[A]=1,s.push(l)}var c=s.filter((function(e){return e.key[0]===Hse.GlobalTypes.UNSIGNED_TX}));if(1!==c.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");var h,f=t(c[0].value),d=f.getInputOutputCounts(),p=d.inputCount,g=d.outputCount,v=[],y=[],m=F(Wse.range(p));try{for(m.s();!(h=m.n()).done;){for(var w=h.value,b={},I=[];!a();){var B=o(),E=B.key.toString("hex");if(b[E])throw new Error("Format Error: Keys must be unique for each input: input index "+w+" key "+E);b[E]=1,I.push(B)}v.push(I)}}catch(e){m.e(e)}finally{m.f()}var C,x=F(Wse.range(g));try{for(x.s();!(C=x.n()).done;){for(var k=C.value,S={},Q=[];!a();){var _=o(),N=_.key.toString("hex");if(S[N])throw new Error("Format Error: Keys must be unique for each output: output index "+k+" key "+N);S[N]=1,Q.push(_)}y.push(Q)}}catch(e){x.e(e)}finally{x.f()}return r(f,{globalMapKeyVals:s,inputKeyVals:v,outputKeyVals:y})},t.checkKeyBuffer=n,t.psbtFromKeyVals=r}));PY(iue),iue.psbtFromBuffer,iue.checkKeyBuffer,iue.psbtFromKeyVals;var oue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.psbtToBuffer=function(e){var t=i({globalMap:e.globalMap,inputs:e.inputs,outputs:e.outputs}),n=t.globalKeyVals,r=t.inputKeyVals,o=t.outputKeyVals,a=Wse.keyValsToBuffer(n),s=function(e){return 0===e.length?[nX.from([0])]:e.map(Wse.keyValsToBuffer)},u=s(r),l=s(o),A=nX.allocUnsafe(5);return A.writeUIntBE(482972169471,0,5),nX.concat([A,a].concat(u,l))};var n=function(e,t){return e.key.compare(t.key)};function r(e,t){var r=new Set,i=Object.entries(e).reduce((function(e,n){var i=C(n,2),o=i[0],a=i[1];if("unknownKeyVals"===o)return e;var s=t[o];if(void 0===s)return e;var u=(Array.isArray(a)?a:[a]).map(s.encode);return u.map((function(e){return e.key.toString("hex")})).forEach((function(e){if(r.has(e))throw new Error("Serialize Error: Duplicate key: "+e);r.add(e)})),e.concat(u)}),[]),o=e.unknownKeyVals?e.unknownKeyVals.filter((function(e){return!r.has(e.key.toString("hex"))})):[];return i.concat(o).sort(n)}function i(e){var t=e.globalMap,n=e.inputs,i=e.outputs;return{globalKeyVals:r(t,rue.globals),inputKeyVals:n.map((function(e){return r(e,rue.inputs)})),outputKeyVals:i.map((function(e){return r(e,rue.outputs)}))}}t.psbtToKeyVals=i}));PY(oue),oue.psbtToBuffer,oue.psbtToKeyVals;var aue=UY((function(e,t){function n(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),n(iue),n(oue)}));PY(aue);var sue=UY((function(e,t){function n(e,t,n){return function(r){if(!e.has(r)){var i=n.filter((function(e){return e.key.toString("hex")===r}))[0];t.push(i),e.add(r)}}}function r(e){return e.globalMap.unsignedTx}function i(e){var t=new Set;return e.forEach((function(e){var n=e.key.toString("hex");if(t.has(n))throw new Error("Combine: KeyValue Map keys should be unique");t.add(n)})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.combine=function(e){var t=e[0],o=aue.psbtToKeyVals(t),a=e.slice(1);if(0===a.length)throw new Error("Combine: Nothing to combine");var s=r(t);if(void 0===s)throw new Error("Combine: Self missing transaction");var u,l=i(o.globalKeyVals),A=o.inputKeyVals.map(i),c=o.outputKeyVals.map(i),h=F(a);try{var f=function(){var e=u.value,t=r(e);if(void 0===t||!t.toBuffer().equals(s.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");var a=aue.psbtToKeyVals(e);i(a.globalKeyVals).forEach(n(l,o.globalKeyVals,a.globalKeyVals)),a.inputKeyVals.map(i).forEach((function(e,t){return e.forEach(n(A[t],o.inputKeyVals[t],a.inputKeyVals[t]))})),a.outputKeyVals.map(i).forEach((function(e,t){return e.forEach(n(c[t],o.outputKeyVals[t],a.outputKeyVals[t]))}))};for(h.s();!(u=h.n()).done;)f()}catch(e){h.e(e)}finally{h.f()}return aue.psbtFromKeyVals(s,{globalMapKeyVals:o.globalKeyVals,inputKeyVals:o.inputKeyVals,outputKeyVals:o.outputKeyVals})}}));PY(sue),sue.combine;var uue=UY((function(e,t){function n(e,t){var n=e[t];if(void 0===n)throw new Error("No input #".concat(t));return n}function r(e,t,n,r){throw new Error("Data for ".concat(e," key ").concat(t," is incorrect: Expected ").concat(n," and got ").concat(JSON.stringify(r)))}function i(e){return function(t,n){for(var i=function(){var i=a[o],s=t[i],u=rue[e+"s"][i]||{},l=u.canAdd,A=u.canAddToArray,c=u.check,h=u.expected;if(c)if(!!A){if(!Array.isArray(s)||n[i]&&!Array.isArray(n[i]))throw new Error("Key type ".concat(i," must be an array"));s.every(c)||r(e,i,h,s);var f=n[i]||[],d=new Set;if(!s.every((function(e){return A(f,e,d)})))throw new Error("Can not add duplicate data to array");n[i]=f.concat(s)}else{if(c(s)||r(e,i,h,s),!l(n,s))throw new Error("Can not add duplicate data to ".concat(e));n[i]=s}},o=0,a=Object.keys(t);o<a.length;o++)i()}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkForInput=n,t.checkForOutput=function(e,t){var n=e[t];if(void 0===n)throw new Error("No output #".concat(t));return n},t.checkHasKey=function(e,t,n){if(e.key[0]<n)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((function(t){return t.key.equals(e.key)})).length)throw new Error("Duplicate Key: ".concat(e.key.toString("hex")))},t.getEnumLength=function(e){var t=0;return Object.keys(e).forEach((function(e){Number(isNaN(Number(e)))&&t++})),t},t.inputCheckUncleanFinalized=function(e,t){var n=!1;if(t.nonWitnessUtxo||t.witnessUtxo){var r=!!t.redeemScript,i=!!t.witnessScript,o=!r||!!t.finalScriptSig,a=!i||!!t.finalScriptWitness,s=!!t.finalScriptSig||!!t.finalScriptWitness;n=o&&a&&s}if(!1===n)throw new Error("Input #".concat(e," has too much or too little data to clean"))},t.updateGlobal=i("global"),t.updateInput=i("input"),t.updateOutput=i("output"),t.addInputAttributes=function(e,r){var i=n(e,e.length-1);t.updateInput(r,i)},t.addOutputAttributes=function(e,r){var i=n(e,e.length-1);t.updateOutput(r,i)},t.defaultVersionSetter=function(e,t){if(!TX(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},t.defaultLocktimeSetter=function(e,t){if(!TX(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}));PY(uue),uue.checkForInput,uue.checkForOutput,uue.checkHasKey,uue.getEnumLength,uue.inputCheckUncleanFinalized,uue.updateGlobal,uue.updateInput,uue.updateOutput,uue.addInputAttributes,uue.addOutputAttributes,uue.defaultVersionSetter,uue.defaultLocktimeSetter;var lue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Psbt=function(){function e(t){s(this,e),this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:t}}return l(e,[{key:"toBase64",value:function(){return this.toBuffer().toString("base64")}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}},{key:"toBuffer",value:function(){return aue.psbtToBuffer(this)}},{key:"updateGlobal",value:function(e){return uue.updateGlobal(e,this.globalMap),this}},{key:"updateInput",value:function(e,t){var n=uue.checkForInput(this.inputs,e);return uue.updateInput(t,n),this}},{key:"updateOutput",value:function(e,t){var n=uue.checkForOutput(this.outputs,e);return uue.updateOutput(t,n),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return uue.checkHasKey(e,this.globalMap.unknownKeyVals,uue.getEnumLength(Hse.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){var n=uue.checkForInput(this.inputs,e);return uue.checkHasKey(t,n.unknownKeyVals,uue.getEnumLength(Hse.InputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){var n=uue.checkForOutput(this.outputs,e);return uue.checkHasKey(t,n.unknownKeyVals,uue.getEnumLength(Hse.OutputTypes)),n.unknownKeyVals||(n.unknownKeyVals=[]),n.unknownKeyVals.push(t),this}},{key:"addInput",value:function(e){var t=this;this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),uue.addInputAttributes(this.inputs,e),this}},{key:"addOutput",value:function(e){var t=this;this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});var n=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(n))throw new Error("unknownKeyVals must be an Array");return n.forEach((function(e){return t.addUnknownKeyValToInput(r,e)})),uue.addOutputAttributes(this.outputs,e),this}},{key:"clearFinalizedInput",value:function(e){var t=uue.checkForInput(this.inputs,e);uue.inputCheckUncleanFinalized(e,t);for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(i)||delete t[i]}return this}},{key:"combine",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=sue.combine([this].concat(t));return Object.assign(this,r),this}},{key:"getTransaction",value:function(){return this.globalMap.unsignedTx.toBuffer()}}],[{key:"fromBase64",value:function(e,t){var n=nX.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e,t){var n=nX.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(e,t){var n=aue.psbtFromBuffer(e,t),r=new this(n.globalMap.unsignedTx);return Object.assign(r,n),r}}]),e}()}));PY(lue),lue.Psbt;var Aue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={network:Jae.bitcoin,maximumFeeRate:5e3},r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new lue.Psbt(new o);s(this,e),this.data=r,this.opts=Object.assign({},n,t),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);var i=function(e,t,n,r){return Object.defineProperty(e,t,{enumerable:n,writable:r})};i(this,"__CACHE",!1,!0),i(this,"opts",!1,!0)}return l(e,[{key:"inputCount",get:function(){return this.data.inputs.length}},{key:"version",get:function(){return this.__CACHE.__TX.version},set:function(e){this.setVersion(e)}},{key:"locktime",get:function(){return this.__CACHE.__TX.locktime},set:function(e){this.setLocktime(e)}},{key:"txInputs",get:function(){return this.__CACHE.__TX.ins.map((function(e){return{hash:Tse.cloneBuffer(e.hash),index:e.index,sequence:e.sequence}}))}},{key:"txOutputs",get:function(){var e=this;return this.__CACHE.__TX.outs.map((function(t){var n;try{n=Nse.fromOutputScript(t.script,e.opts.network)}catch(t){}return{script:Tse.cloneBuffer(t.script),value:t.value,address:n}}))}},{key:"combine",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.data).combine.apply(e,k(n.map((function(e){return e.data})))),this}},{key:"clone",value:function(){var t=e.fromBuffer(this.data.toBuffer());return t.opts=JSON.parse(JSON.stringify(this.opts)),t}},{key:"setMaximumFeeRate",value:function(e){m(e),this.opts.maximumFeeRate=e}},{key:"setVersion",value:function(e){m(e),w(this.data.inputs,"setVersion");var t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}},{key:"setLocktime",value:function(e){m(e),w(this.data.inputs,"setLocktime");var t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}},{key:"setInputSequence",value:function(e,t){m(t),w(this.data.inputs,"setInputSequence");var n=this.__CACHE;if(n.__TX.ins.length<=e)throw new Error("Input index too high");return n.__TX.ins[e].sequence=t,n.__EXTRACTED_TX=void 0,this}},{key:"addInputs",value:function(e){var t=this;return e.forEach((function(e){return t.addInput(e)})),this}},{key:"addInput",value:function(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");w(this.data.inputs,"addInput"),e.witnessScript&&K(e.witnessScript);var t=this.__CACHE;this.data.addInput(e),B(t,t.__TX.ins[t.__TX.ins.length-1]);var n=this.data.inputs.length-1,r=this.data.inputs[n];return r.nonWitnessUtxo&&L(this.__CACHE,r,n),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}},{key:"addOutputs",value:function(e){var t=this;return e.forEach((function(e){return t.addOutput(e)})),this}},{key:"addOutput",value:function(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");w(this.data.inputs,"addOutput");var t=e,n=t.address;if("string"==typeof n){var r=this.opts.network,i=Nse.toOutputScript(n,r);e=Object.assign(e,{script:i})}var o=this.__CACHE;return this.data.addOutput(e),o.__FEE=void 0,o.__FEE_RATE=void 0,o.__EXTRACTED_TX=void 0,this}},{key:"extractTransaction",value:function(e){if(!this.data.inputs.every(A))throw new Error("Not finalized");var t=this.__CACHE;if(e||function(e,t,n){var r=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=r*i;if(r>=n.maximumFeeRate)throw new Error("Warning: You are paying around ".concat((o/1e8).toFixed(8)," in fees, which is ").concat(r," satoshi per byte for a transaction with a VSize of ").concat(i," bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction."))}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;var n=t.__TX.clone();return M(this.data.inputs,n,t,!0),n}},{key:"getFeeRate",value:function(){return Q("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}},{key:"getFee",value:function(){return Q("__FEE","fee",this.data.inputs,this.__CACHE)}},{key:"finalizeAllInputs",value:function(){var e=this;return uue.checkForInput(this.data.inputs,0),q(this.data.inputs.length).forEach((function(t){return e.finalizeInput(t)})),this}},{key:"finalizeInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_,n=uue.checkForInput(this.data.inputs,e),r=function(e,t,n){var r=n.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){var o=T(n,t,e),a=r.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||p(i.script))&&(i.isSegwit=!0),i}(e,n,this.__CACHE),i=r.script,o=r.isP2SH,a=r.isP2WSH,s=r.isSegwit;if(!i)throw new Error("No script found for input #".concat(e));b(n);var u=t(e,n,i,s,o,a),l=u.finalScriptSig,A=u.finalScriptWitness;if(l&&this.data.updateInput(e,{finalScriptSig:l}),A&&this.data.updateInput(e,{finalScriptWitness:A}),!l&&!A)throw new Error("Unknown error finalizing input #".concat(e));return this.data.clearFinalizedInput(e),this}},{key:"getInputType",value:function(e){var t=uue.checkForInput(this.data.inputs,e),n=H(R(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(!e)return;var t=use.decompile(e);if(!t)return;var n,r=t[t.length-1];if(!TX(r)||O(r)||(n=r,use.isCanonicalScriptSignature(n)))return;return use.decompile(r)?r:void 0}(t.finalScriptSig),t.witnessScript||function(e){if(!e)return;var t=U(e),n=t[t.length-1];if(O(n))return;return use.decompile(n)?n:void 0}(t.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+G(n.meaningfulScript)}},{key:"inputHasPubkey",value:function(e,t){return function(e,t,n,r){return j(e,H(R(n,t,r),n,"input",t.redeemScript,t.witnessScript).meaningfulScript)}(t,uue.checkForInput(this.data.inputs,e),e,this.__CACHE)}},{key:"inputHasHDKey",value:function(e,t){var n=uue.checkForInput(this.data.inputs,e),r=y(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"outputHasPubkey",value:function(e,t){return function(e,t,n,r){return j(e,H(r.__TX.outs[n].script,n,"output",t.redeemScript,t.witnessScript).meaningfulScript)}(t,uue.checkForOutput(this.data.outputs,e),e,this.__CACHE)}},{key:"outputHasHDKey",value:function(e,t){var n=uue.checkForOutput(this.data.outputs,e),r=y(t);return!!n.bip32Derivation&&n.bip32Derivation.some(r)}},{key:"validateSignaturesOfAllInputs",value:function(){var e=this;return uue.checkForInput(this.data.inputs,0),q(this.data.inputs.length).map((function(t){return e.validateSignaturesOfInput(t)})).reduce((function(e,t){return!0===t&&e}),!0)}},{key:"validateSignaturesOfInput",value:function(e,t){var n=this.data.inputs[e],r=(n||{}).partialSig;if(!n||!r||r.length<1)throw new Error("No signatures to validate");var i=t?r.filter((function(e){return e.pubkey.equals(t)})):r;if(i.length<1)throw new Error("No signatures for this pubkey");var o,a,s,u,l=[],A=F(i);try{for(A.s();!(u=A.n()).done;){var c=u.value,h=use.signature.decode(c.signature),f=s!==h.hashType?D(e,Object.assign({},n,{sighashType:h.hashType}),this.__CACHE,!0):{hash:o,script:a},d=f.hash,p=f.script;s=h.hashType,o=d,a=p,I(c.pubkey,p,"verify");var g=Fse.fromPublicKey(c.pubkey);l.push(g.verify(d,h.signature))}}catch(e){A.e(e)}finally{A.f()}return l.every((function(e){return!0===e}))}},{key:"signAllInputsHD",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");var n,r=[],i=F(q(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInputHD(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsHDAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey||!e.fingerprint)return i(new Error("Need HDSigner to sign input"));var o,a=[],s=[],u=F(q(t.data.inputs.length));try{for(u.s();!(o=u.n()).done;){var l=o.value;s.push(t.signInputHDAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInputHD",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return P(e,this.data.inputs,t).forEach((function(t){return n.signInput(e,t,r)})),this}},{key:"signInputHDAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];return new Promise((function(i,o){if(!t||!t.publicKey||!t.fingerprint)return o(new Error("Need HDSigner to sign input"));var a=P(e,n.data.inputs,t).map((function(t){return n.signInputAsync(e,t,r)}));return Promise.all(a).then((function(){i()})).catch(o)}))}},{key:"signAllInputs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];if(!e||!e.publicKey)throw new Error("Need Signer to sign input");var n,r=[],i=F(q(this.data.inputs.length));try{for(i.s();!(n=i.n()).done;){var o=n.value;try{this.signInput(o,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i.e(e)}finally{i.f()}if(r.every((function(e){return!1===e})))throw new Error("No inputs were signed");return this}},{key:"signAllInputsAsync",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[Rse.Transaction.SIGHASH_ALL];return new Promise((function(r,i){if(!e||!e.publicKey)return i(new Error("Need Signer to sign input"));var o,a=[],s=[],u=F(t.data.inputs.entries());try{for(u.s();!(o=u.n()).done;){var l=C(o.value,1)[0];s.push(t.signInputAsync(l,e,n).then((function(){a.push(!0)}),(function(){a.push(!1)})))}}catch(e){u.e(e)}finally{u.f()}return Promise.all(s).then((function(){if(a.every((function(e){return!1===e})))return i(new Error("No inputs were signed"));r()}))}))}},{key:"signInput",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var r=N(this.data.inputs,e,t.publicKey,this.__CACHE,n),i=r.hash,o=r.sighashType,a=[{pubkey:t.publicKey,signature:use.signature.encode(t.sign(i),o)}];return this.data.updateInput(e,{partialSig:a}),this}},{key:"signInputAsync",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Rse.Transaction.SIGHASH_ALL];return Promise.resolve().then((function(){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var i=N(n.data.inputs,e,t.publicKey,n.__CACHE,r),o=i.hash,a=i.sighashType;return Promise.resolve(t.sign(o)).then((function(r){var i=[{pubkey:t.publicKey,signature:use.signature.encode(r,a)}];n.data.updateInput(e,{partialSig:i})}))}))}},{key:"toBuffer",value:function(){return a(this.__CACHE),this.data.toBuffer()}},{key:"toHex",value:function(){return a(this.__CACHE),this.data.toHex()}},{key:"toBase64",value:function(){return a(this.__CACHE),this.data.toBase64()}},{key:"updateGlobal",value:function(e){return this.data.updateGlobal(e),this}},{key:"updateInput",value:function(e,t){return t.witnessScript&&K(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&L(this.__CACHE,this.data.inputs[e],e),this}},{key:"updateOutput",value:function(e,t){return this.data.updateOutput(e,t),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return this.data.addUnknownKeyValToGlobal(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){return this.data.addUnknownKeyValToInput(e,t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}},{key:"clearFinalizedInput",value:function(e){return this.data.clearFinalizedInput(e),this}}],[{key:"fromBase64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nX.from(e,"base64");return this.fromBuffer(n,t)}},{key:"fromHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nX.from(e,"hex");return this.fromBuffer(n,t)}},{key:"fromBuffer",value:function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=lue.Psbt.fromBuffer(t,i),s=new e(o,a);return n=s.__CACHE.__TX,r=s.__CACHE,n.ins.forEach((function(e){B(r,e)})),s}}]),e}();t.Psbt=r;var i=function(e){return new o(e)},o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nX.from([2,0,0,0,0,0,0,0,0,0]);s(this,e),this.tx=Rse.Transaction.fromBuffer(t),function(e){if(!e.ins.every((function(e){return e.script&&0===e.script.length&&e.witness&&0===e.witness.length})))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}return l(e,[{key:"getInputOutputCounts",value:function(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}},{key:"addInput",value:function(e){if(void 0===e.hash||void 0===e.index||!TX(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");var t="string"==typeof e.hash?Tse.reverseBuffer(nX.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}},{key:"addOutput",value:function(e){if(void 0===e.script||void 0===e.value||!TX(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}},{key:"toBuffer",value:function(){return this.tx.toBuffer()}}]),e}();function a(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function u(e,t,n){if(!t)return!1;var r;if(r=n?n.map((function(e){var n=Fse.fromPublicKey(e,{compressed:!0}).publicKey;return t.find((function(e){return e.pubkey.equals(n)}))})).filter((function(e){return!!e})):t,r.length>e)throw new Error("Too many signatures");return r.length===e}function A(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function c(e){return function(t){try{return e({output:t}),!0}catch(e){return!1}}}var h=c(_se.p2ms),f=c(_se.p2pk),d=c(_se.p2pkh),p=c(_se.p2wpkh),g=c(_se.p2wsh),v=c(_se.p2sh);function y(e){return function(t){return!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}}function m(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function w(e,t){e.forEach((function(e){var n=!1,r=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;r=function(e){var t=e.finalScriptSig&&use.decompile(e.finalScriptSig)||[],n=e.finalScriptWitness&&use.decompile(e.finalScriptWitness)||[];return t.concat(n).filter((function(e){return TX(e)&&use.isCanonicalScriptSignature(e)})).map((function(e){return{signature:e}}))}(e)}else r=e.partialSig;if(r.forEach((function(e){var r=use.signature.decode(e.signature).hashType,i=[];switch(r&Rse.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&r){case Rse.Transaction.SIGHASH_ALL:break;case Rse.Transaction.SIGHASH_SINGLE:case Rse.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(n=!0)})),n)throw new Error("Can not modify transaction, signatures exist.")}))}function b(e){if(e.sighashType&&e.partialSig){var t=e.partialSig,n=e.sighashType;t.forEach((function(e){var t=use.signature.decode(e.signature).hashType;if(n!==t)throw new Error("Signature sighash does not match input sighash type")}))}}function I(e,t,n){if(!j(e,t))throw new Error("Can not ".concat(n," for this input with the key ").concat(e.toString("hex")))}function B(e,t){var n=Tse.reverseBuffer(nX.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[n]=1}function E(e,t){return function(n,r,i,o){var a=e({redeem:{output:i}}).output;if(!r.equals(a))throw new Error("".concat(t," for ").concat(o," #").concat(n," doesn't match the scriptPubKey in the prevout"))}}var x=E(_se.p2sh,"Redeem script"),S=E(_se.p2wsh,"Witness script");function Q(e,t,n,r){if(!n.every(A))throw new Error("PSBT must be finalized to calculate ".concat(t));if("__FEE_RATE"===e&&r.__FEE_RATE)return r.__FEE_RATE;if("__FEE"===e&&r.__FEE)return r.__FEE;var i,o=!0;return r.__EXTRACTED_TX?(i=r.__EXTRACTED_TX,o=!1):i=r.__TX.clone(),M(n,i,r,o),"__FEE_RATE"===e?r.__FEE_RATE:"__FEE"===e?r.__FEE:void 0}function _(e,t,n,r,i,o){var a=G(n);if(!function(e,t,n){switch(n){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return u(1,e.partialSig);case"multisig":var r=_se.p2ms({output:t});return u(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,n,a))throw new Error("Can not finalize input #".concat(e));return function(e,t,n,r,i,o){var a,s,u=function(e,t,n){var r;switch(t){case"multisig":var i=function(e,t){return _se.p2ms({output:e}).pubkeys.map((function(e){return(t.filter((function(t){return t.pubkey.equals(e)}))[0]||{}).signature})).filter((function(e){return!!e}))}(e,n);r=_se.p2ms({output:e,signatures:i});break;case"pubkey":r=_se.p2pk({output:e,signature:n[0].signature});break;case"pubkeyhash":r=_se.p2pkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature});break;case"witnesspubkeyhash":r=_se.p2wpkh({output:e,pubkey:n[0].pubkey,signature:n[0].signature})}return r}(e,t,n),l=o?_se.p2wsh({redeem:u}):null,A=i?_se.p2sh({redeem:l||u}):null;return r?(s=function(e){var t,n=nX.allocUnsafe(0);function r(e){var t=n.length,r=Xse.encodingLength(e);n=nX.concat([n,nX.allocUnsafe(r)]),Xse.encode(e,n,t)}function i(e){r(e.length),function(e){n=nX.concat([n,nX.from(e)])}(e)}return r((t=e).length),t.forEach(i),n}(l?l.witness:u.witness),A&&(a=A.input)):a=A?A.input:u.input,{finalScriptSig:a,finalScriptWitness:s}}(n,a,t.partialSig,r,i,o)}function N(e,t,n,r,i){var o=D(t,uue.checkForInput(e,t),r,!1,i),a=o.hash,s=o.sighashType;return I(n,o.script,"sign"),{hash:a,sighashType:s}}function D(e,t,n,r,i){var o,a,s=n.__TX,u=t.sighashType||Rse.Transaction.SIGHASH_ALL;if(i&&i.indexOf(u)<0){var l=function(e){var t=e&Rse.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case Rse.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case Rse.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case Rse.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(u);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ".concat(l))}if(t.nonWitnessUtxo){var A=T(n,t,e),c=s.ins[e].hash,h=A.getHash();if(!c.equals(h))throw new Error("Non-witness UTXO hash for input #".concat(e," doesn't match the hash specified in the prevout"));var f=s.ins[e].index;a=A.outs[f]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");a=t.witnessUtxo}var d=H(a.script,e,"input",t.redeemScript,t.witnessScript),g=d.meaningfulScript,v=d.type;if(["p2sh-p2wsh","p2wsh"].indexOf(v)>=0)o=s.hashForWitnessV0(e,g,a.value,u);else if(p(g)){var y=_se.p2pkh({hash:g.slice(2)}).output;o=s.hashForWitnessV0(e,y,a.value,u)}else{if(void 0===t.nonWitnessUtxo&&!1===n.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Input #".concat(e," has witnessUtxo but non-segwit script: ").concat(g.toString("hex")));r||!1===n.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),o=s.hashForSignature(e,g,u)}return{script:g,sighashType:u,hash:o}}function P(e,t,n){var r=uue.checkForInput(t,e);if(!r.bip32Derivation||0===r.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");var i=r.bip32Derivation.map((function(e){return e.masterFingerprint.equals(n.fingerprint)?e:void 0})).filter((function(e){return!!e}));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map((function(e){var t=n.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}))}function U(e){var t=0;function n(){var n=Xse.decode(e,t);return t+=Xse.decode.bytes,n}function r(){return function(n){return t+=n,e.slice(t-n,t)}(n())}return function(){for(var e=n(),t=[],i=0;i<e;i++)t.push(r());return t}()}function L(e,t,n){e.__NON_WITNESS_UTXO_BUF_CACHE[n]=t.nonWitnessUtxo;var r=Rse.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[n]=r;var i=e,o=n;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get:function(){var e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;var n=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=n,n},set:function(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function M(e,t,n,r){var i=0;e.forEach((function(e,o){if(r&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),r&&e.finalScriptWitness&&(t.ins[o].witness=U(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){var a=T(n,e,o),s=t.ins[o].index,u=a.outs[s];i+=u.value}}));var o=t.outs.reduce((function(e,t){return e+t.value}),0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");var s=t.virtualSize();n.__FEE=a,n.__EXTRACTED_TX=t,n.__FEE_RATE=Math.floor(a/s)}function T(e,t,n){var r=e.__NON_WITNESS_UTXO_TX_CACHE;return r[n]||L(e,t,n),r[n]}function R(e,t,n){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo)return T(n,t,e).outs[n.__TX.ins[e].index].script;throw new Error("Can't find pubkey in input without Utxo data")}function O(e){return 33===e.length&&use.isCanonicalPubKey(e)}function H(e,t,n,r,i){var o,a=v(e),s=a&&r&&g(r),u=g(e);if(a&&void 0===r)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((u||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");return s?(o=i,x(t,e,r,n),S(t,r,i,n),K(o)):u?(o=i,S(t,e,i,n),K(o)):a?(o=r,x(t,e,r,n)):o=e,{meaningfulScript:o,type:s?"p2sh-p2wsh":a?"p2sh":u?"p2wsh":"raw"}}function K(e){if(p(e)||v(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function j(e,t){var n=fse.hash160(e),r=use.decompile(t);if(null===r)throw new Error("Unknown script error");return r.some((function(t){return"number"!=typeof t&&(t.equals(e)||t.equals(n))}))}function G(e){return p(e)?"witnesspubkeyhash":d(e)?"pubkeyhash":h(e)?"multisig":f(e)?"pubkey":"nonstandard"}function q(e){return k(Array(e).keys())}}));PY(Aue),Aue.Psbt;var cue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){return e===n.OPS.OP_0||use.isCanonicalScriptSignature(e)}function i(e,t){var i=use.decompile(e);return!(i.length<2)&&i[0]===n.OPS.OP_0&&(t?i.slice(1).every(r):i.slice(1).every(use.isCanonicalScriptSignature))}t.check=i,i.toJSON=function(){return"multisig input"}}));PY(cue),cue.check;var hue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use,r=n.OPS.OP_RESERVED;function i(e,t){var i=use.decompile(e);if(i.length<4)return!1;if(i[i.length-1]!==n.OPS.OP_CHECKMULTISIG)return!1;if(!Xae.Number(i[0]))return!1;if(!Xae.Number(i[i.length-2]))return!1;var o=i[0]-r,a=i[i.length-2]-r;return!(o<=0)&&(!(a>16)&&(!(o>a)&&(a===i.length-3&&(!!t||i.slice(1,-2).every(use.isCanonicalPubKey)))))}t.check=i,i.toJSON=function(){return"multi-sig output"}}));PY(hue),hue.check;var fue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=cue,t.output=hue}));PY(fue),fue.input,fue.output;var due=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use.OPS;function r(e){var t=use.compile(e);return t.length>1&&t[0]===n.OP_RETURN}t.check=r,r.toJSON=function(){return"null data output"};var i={check:r};t.output=i}));PY(due),due.check,due.output;var pue=UY((function(e,t){function n(e){var t=use.decompile(e);return 1===t.length&&use.isCanonicalScriptSignature(t[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"pubKey input"}}));PY(pue),pue.check;var gue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.decompile(e);return 2===t.length&&use.isCanonicalPubKey(t[0])&&t[1]===n.OPS.OP_CHECKSIG}t.check=r,r.toJSON=function(){return"pubKey output"}}));PY(gue),gue.check;var vue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=pue,t.output=gue}));PY(vue),vue.input,vue.output;var yue=UY((function(e,t){function n(e){var t=use.decompile(e);return 2===t.length&&use.isCanonicalScriptSignature(t[0])&&use.isCanonicalPubKey(t[1])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"pubKeyHash input"}}));PY(yue),yue.check;var mue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 25===t.length&&t[0]===n.OPS.OP_DUP&&t[1]===n.OPS.OP_HASH160&&20===t[2]&&t[23]===n.OPS.OP_EQUALVERIFY&&t[24]===n.OPS.OP_CHECKSIG}t.check=r,r.toJSON=function(){return"pubKeyHash output"}}));PY(mue),mue.check;var wue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=yue,t.output=mue}));PY(wue),wue.input,wue.output;var bue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 22===t.length&&t[0]===n.OPS.OP_0&&20===t[1]}t.check=r,r.toJSON=function(){return"Witness pubKeyHash output"}}));PY(bue),bue.check;var Iue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 34===t.length&&t[0]===n.OPS.OP_0&&32===t[1]}t.check=r,r.toJSON=function(){return"Witness scriptHash output"}}));PY(Iue),Iue.check;var Bue=UY((function(e,t){function n(e,t){var n=use.decompile(e);if(n.length<1)return!1;var r=n[n.length-1];if(!TX(r))return!1;var i=use.decompile(use.compile(n.slice(0,-1))),o=use.decompile(r);return!!o&&!!use.isPushOnly(i)&&(1===n.length?Iue.check(o)||bue.check(o):!(!wue.input.check(i)||!wue.output.check(o))||!(!fue.input.check(i,t)||!fue.output.check(o))||!(!vue.input.check(i)||!vue.output.check(o)))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"scriptHash input"}}));PY(Bue),Bue.check;var Eue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use;function r(e){var t=use.compile(e);return 23===t.length&&t[0]===n.OPS.OP_HASH160&&20===t[1]&&t[22]===n.OPS.OP_EQUAL}t.check=r,r.toJSON=function(){return"scriptHash output"}}));PY(Eue),Eue.check;var Cue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=Bue,t.output=Eue}));PY(Cue),Cue.input,Cue.output;var xue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use,r=nX.from("aa21a9ed","hex");function i(e){var t=use.compile(e);return t.length>37&&t[0]===n.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(r)}t.check=i,i.toJSON=function(){return"Witness commitment output"},t.encode=function(e){Hae(Xae.Hash256bit,e);var t=nX.allocUnsafe(36);return r.copy(t,0),e.copy(t,4),use.compile([n.OPS.OP_RETURN,t])},t.decode=function(e){return Hae(i,e),use.decompile(e)[1].slice(4,36)}}));PY(xue),xue.check,xue.encode,xue.decode;var kue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.output=xue}));PY(kue),kue.output;var Sue=UY((function(e,t){function n(e){var t,n=use.decompile(e);return 2===n.length&&use.isCanonicalScriptSignature(n[0])&&(t=n[1],use.isCanonicalPubKey(t)&&33===t.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"witnessPubKeyHash input"}}));PY(Sue),Sue.check;var Que=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=Sue,t.output=bue}));PY(Que),Que.input,Que.output;var _ue=UY((function(e,t){function n(e,t){if(Hae(Hae.Array,e),e.length<1)return!1;var n=e[e.length-1];if(!TX(n))return!1;var r=use.decompile(n);if(!r||0===r.length)return!1;var i=use.compile(e.slice(0,-1));return!(!wue.input.check(i)||!wue.output.check(r))||!(!fue.input.check(i,t)||!fue.output.check(r))||!(!vue.input.check(i)||!vue.output.check(r))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=n,n.toJSON=function(){return"witnessScriptHash input"}}));PY(_ue),_ue.check;var Nue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=_ue,t.output=Iue}));PY(Nue),Nue.input,Nue.output;var Due=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=n,t.output=function(e){if(Que.output.check(e))return n.P2WPKH;if(Nue.output.check(e))return n.P2WSH;if(wue.output.check(e))return n.P2PKH;if(Cue.output.check(e))return n.P2SH;var t=use.decompile(e);if(!t)throw new TypeError("Invalid script");return fue.output.check(t)?n.P2MS:vue.output.check(t)?n.P2PK:kue.output.check(t)?n.WITNESS_COMMITMENT:due.output.check(t)?n.NULLDATA:n.NONSTANDARD},t.input=function(e,t){var r=use.decompile(e);if(!r)throw new TypeError("Invalid script");return wue.input.check(r)?n.P2PKH:Cue.input.check(r,t)?n.P2SH:fue.input.check(r,t)?n.P2MS:vue.input.check(r)?n.P2PK:n.NONSTANDARD},t.witness=function(e,t){var r=use.decompile(e);if(!r)throw new TypeError("Invalid script");return Que.input.check(r)?n.P2WPKH:Nue.input.check(r,t)?n.P2WSH:n.NONSTANDARD}}));PY(Due),Due.types,Due.output,Due.input,Due.witness;var Fue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=use,r=Due.types,o=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function a(e,t,n){try{Hae(e,t)}catch(e){throw new Error(n)}}var u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jae.bitcoin,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2500;s(this,e),this.network=t,this.maximumFeeRate=n,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new Rse.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}return l(e,[{key:"setLowR",value:function(e){return Hae(Hae.maybe(Hae.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}},{key:"setLockTime",value:function(e){if(Hae(Xae.UInt32,e),this.__INPUTS.some((function(e){return!!e.signatures&&e.signatures.some((function(e){return void 0!==e}))})))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}},{key:"setVersion",value:function(e){Hae(Xae.UInt32,e),this.__TX.version=e}},{key:"addInput",value:function(e,t,n,r){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");var i,o;if("string"==typeof(o=e)||o instanceof String)e=Tse.reverseBuffer(nX.from(e,"hex"));else if(function(e){return e instanceof Rse.Transaction}(e)){var a=e.outs[t];r=a.script,i=a.value,e=e.getHash(!1)}return this.__addInputUnsafe(e,t,{sequence:n,prevOutScript:r,value:i})}},{key:"addOutput",value:function(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=Nse.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}},{key:"build",value:function(){return this.__build(!1)}},{key:"buildIncomplete",value:function(){return this.__build(!0)}},{key:"sign",value:function(e,t,n,s,u,l){!function(e){var t,n=e.input,r=e.ourPubKey,i=e.keyPair,o=e.signatureHash,a=e.hashType,s=e.useLowR,u=!1,l=F(n.pubkeys.entries());try{for(l.s();!(t=l.n()).done;){var A=C(t.value,2),c=A[0],h=A[1];if(r.equals(h)){if(n.signatures[c])throw new Error("Signature already exists");if(33!==r.length&&n.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");var f=i.sign(o,s);n.signatures[c]=use.signature.encode(f,a),u=!0}}}catch(e){l.e(e)}finally{l.f()}if(!u)throw new Error("Key pair cannot sign for this input")}(function(e,t,n,s,u,l,A,h,d,p,g){var v;if("number"==typeof u)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),v=u;else{if("object"!=i(u))throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!o.has(t.prevOutScriptType))throw new TypeError('Unknown prevOutScriptType "'.concat(t.prevOutScriptType,'"'));a(Hae.Number,t.vin,"sign must include vin parameter as Number (input index)"),a(Xae.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),a(Hae.maybe(Hae.Number),t.hashType,"sign hashType parameter must be a number");var n=(e[t.vin]||[]).prevOutType,r=t.prevOutScriptType;switch(r){case"p2pkh":if(n&&"pubkeyhash"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2pkh: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2pk":if(n&&"pubkey"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2pk: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2wpkh":if(n&&"witnesspubkeyhash"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2wpkh: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessValue"));break;case"p2ms":if(n&&"multisig"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2ms: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2sh-p2wpkh":if(n&&"scripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type p2sh-p2wpkh: ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.Buffer,t.redeemScript,"".concat(r," requires redeemScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessValue"));break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(n&&"scripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type ").concat(r,": ").concat(n));a(Hae.value(void 0),t.witnessScript,"".concat(r," requires NO witnessScript")),a(Hae.Buffer,t.redeemScript,"".concat(r," requires redeemScript")),a(Hae.value(void 0),t.witnessValue,"".concat(r," requires NO witnessValue"));break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(n&&"witnessscripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type ").concat(r,": ").concat(n));a(Hae.Buffer,t.witnessScript,"".concat(r," requires witnessScript")),a(Hae.value(void 0),t.redeemScript,"".concat(r," requires NO redeemScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessValue"));break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(n&&"scripthash"!==n)throw new TypeError("input #".concat(t.vin," is not of type ").concat(r,": ").concat(n));a(Hae.Buffer,t.witnessScript,"".concat(r," requires witnessScript")),a(Hae.Buffer,t.redeemScript,"".concat(r," requires witnessScript")),a(Xae.Satoshi,t.witnessValue,"".concat(r," requires witnessScript"))}}(t,u),v=u.vin,l=u.keyPair,A=u.redeemScript,h=u.hashType,d=u.witnessValue,p=u.witnessScript}if(void 0===l)throw new Error("sign requires keypair");if(l.network&&l.network!==e)throw new TypeError("Inconsistent network");if(!t[v])throw new Error("No input at index: "+v);if(n(h=h||Rse.Transaction.SIGHASH_ALL))throw new Error("Transaction needs outputs");var y=t[v];if(void 0!==y.redeemScript&&A&&!y.redeemScript.equals(A))throw new Error("Inconsistent redeemScript");var m=l.publicKey||l.getPublicKey&&l.getPublicKey();if(!f(y)){if(void 0!==d){if(void 0!==y.value&&y.value!==d)throw new Error("Input did not match witnessValue");Hae(Xae.Satoshi,d),y.value=d}if(!f(y)){var w=function(e,t,n,i){if(n&&i){var o=_se.p2wsh({redeem:{output:i}}),a=_se.p2wsh({output:n}),s=_se.p2sh({redeem:{output:n}}),u=_se.p2sh({redeem:o});if(!o.hash.equals(a.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!s.hash.equals(u.hash))throw new Error("Redeem script inconsistent with prevOutScript");var l=c(o.redeem.output,t);if(!l.pubkeys)throw new Error(l.type+" not supported as witnessScript ("+use.toASM(i)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(l.signatures=e.signatures);var A=i;if(l.type===r.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:n,redeemScriptType:r.P2WSH,witnessScript:i,witnessScriptType:l.type,prevOutType:r.P2SH,prevOutScript:s.output,hasWitness:!0,signScript:A,signType:l.type,pubkeys:l.pubkeys,signatures:l.signatures,maxSignatures:l.maxSignatures}}if(n){var h=_se.p2sh({redeem:{output:n}});if(e.prevOutScript){var f;try{f=_se.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!h.hash.equals(f.hash))throw new Error("Redeem script inconsistent with prevOutScript")}var d=c(h.redeem.output,t);if(!d.pubkeys)throw new Error(d.type+" not supported as redeemScript ("+use.toASM(n)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(d.signatures=e.signatures);var p=n;return d.type===r.P2WPKH&&(p=_se.p2pkh({pubkey:d.pubkeys[0]}).output),{redeemScript:n,redeemScriptType:d.type,prevOutType:r.P2SH,prevOutScript:h.output,hasWitness:d.type===r.P2WPKH,signScript:p,signType:d.type,pubkeys:d.pubkeys,signatures:d.signatures,maxSignatures:d.maxSignatures}}if(i){var g=_se.p2wsh({redeem:{output:i}});if(e.prevOutScript){var v=_se.p2wsh({output:e.prevOutScript});if(!g.hash.equals(v.hash))throw new Error("Witness script inconsistent with prevOutScript")}var y=c(g.redeem.output,t);if(!y.pubkeys)throw new Error(y.type+" not supported as witnessScript ("+use.toASM(i)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(y.signatures=e.signatures);var m=i;if(y.type===r.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:i,witnessScriptType:y.type,prevOutType:r.P2WSH,prevOutScript:g.output,hasWitness:!0,signScript:m,signType:y.type,pubkeys:y.pubkeys,signatures:y.signatures,maxSignatures:y.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===r.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===r.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");var w=c(e.prevOutScript,t);if(!w.pubkeys)throw new Error(w.type+" not supported ("+use.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some((function(e){return void 0!==e}))&&(w.signatures=e.signatures);var b=e.prevOutScript;return w.type===r.P2WPKH&&(b=_se.p2pkh({pubkey:w.pubkeys[0]}).output),{prevOutType:w.type,prevOutScript:e.prevOutScript,hasWitness:w.type===r.P2WPKH,signScript:b,signType:w.type,pubkeys:w.pubkeys,signatures:w.signatures,maxSignatures:w.maxSignatures}}var I=_se.p2pkh({pubkey:t}).output;return{prevOutType:r.P2PKH,prevOutScript:I,hasWitness:!1,signScript:I,signType:r.P2PKH,pubkeys:[t],signatures:[void 0]}}(y,m,A,p);Object.assign(y,w)}if(!f(y))throw Error(y.prevOutType+" not supported")}return{input:y,ourPubKey:m,keyPair:l,signatureHash:y.hasWitness?s.hashForWitnessV0(v,y.signScript,y.value,h):s.hashForSignature(v,y.signScript,h),hashType:h,useLowR:!!g}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,n,s,u,l,this.__USE_LOW_R))}},{key:"__addInputUnsafe",value:function(e,t,n){if(Rse.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");var r=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[r])throw new Error("Duplicate TxOut: "+r);var i={};if(void 0!==n.script&&(i=A(n.script,n.witness||[])),void 0!==n.value&&(i.value=n.value),!i.prevOutScript&&n.prevOutScript){var o;if(!i.pubkeys&&!i.signatures){var a=c(n.prevOutScript);a.pubkeys&&(i.pubkeys=a.pubkeys,i.signatures=a.signatures),o=a.type}i.prevOutScript=n.prevOutScript,i.prevOutType=o||Due.output(n.prevOutScript)}var s=this.__TX.addInput(e,t,n.sequence,n.scriptSig);return this.__INPUTS[s]=i,this.__PREV_TX_SET[r]=!0,s}},{key:"__build",value:function(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}var t=this.__TX.clone();if(this.__INPUTS.forEach((function(n,i){if(!n.prevOutType&&!e)throw new Error("Transaction is not complete");var o=h(n.prevOutType,n,e);if(o)t.setInputScript(i,o.input),t.setWitness(i,o.witness);else{if(!e&&n.prevOutType===r.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}})),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}},{key:"__canModifyInputs",value:function(){return this.__INPUTS.every((function(e){return!e.signatures||e.signatures.every((function(e){return!e||0!=(d(e)&Rse.Transaction.SIGHASH_ANYONECANPAY)}))}))}},{key:"__needsOutputs",value:function(e){return e===Rse.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some((function(e){return!!e.signatures&&e.signatures.some((function(e){return!!e&&!(d(e)&Rse.Transaction.SIGHASH_NONE)}))}))}},{key:"__canModifyOutputs",value:function(){var e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every((function(n){return void 0===n.signatures||n.signatures.every((function(n){if(!n)return!0;var r=31&d(n);return r===Rse.Transaction.SIGHASH_NONE||r===Rse.Transaction.SIGHASH_SINGLE&&e<=t}))}))}},{key:"__overMaximumFees",value:function(e){return(this.__INPUTS.reduce((function(e,t){return e+(t.value>>>0)}),0)-this.__TX.outs.reduce((function(e,t){return e+t.value}),0))/e>this.maximumFeeRate}}],[{key:"fromTransaction",value:function(t,n){var i=new e(n);return i.setVersion(t.version),i.setLockTime(t.locktime),t.outs.forEach((function(e){i.addOutput(e.script,e.value)})),t.ins.forEach((function(e){i.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})})),i.__INPUTS.forEach((function(e,n){!function(e,t,n){if(e.redeemScriptType===r.P2MS&&e.redeemScript&&e.pubkeys.length!==e.signatures.length){var i=e.signatures.concat();e.signatures=e.pubkeys.map((function(r){var o,a=Fse.fromPublicKey(r);return i.some((function(r,s){if(!r)return!1;var u=use.signature.decode(r),l=t.hashForSignature(n,e.redeemScript,u.hashType);return!!a.verify(l,u.signature)&&(i[s]=void 0,o=r,!0)})),o}))}}(e,t,n)})),i}}]),e}();function A(e,t,n,i){if(0===e.length&&0===t.length)return{};if(!n){var o=Due.input(e,!0),a=Due.witness(t,!0);o===r.NONSTANDARD&&(o=void 0),a===r.NONSTANDARD&&(a=void 0),n=o||a}switch(n){case r.P2WPKH:var s=_se.p2wpkh({witness:t}),u=s.output,l=s.pubkey,c=s.signature;return{prevOutScript:u,prevOutType:r.P2WPKH,pubkeys:[l],signatures:[c]};case r.P2PKH:var h=_se.p2pkh({input:e}),f=h.output,d=h.pubkey,p=h.signature;return{prevOutScript:f,prevOutType:r.P2PKH,pubkeys:[d],signatures:[p]};case r.P2PK:var g=_se.p2pk({input:e}).signature;return{prevOutType:r.P2PK,pubkeys:[void 0],signatures:[g]};case r.P2MS:var v=_se.p2ms({input:e,output:i},{allowIncomplete:!0}),y=v.m,m=v.pubkeys,w=v.signatures;return{prevOutType:r.P2MS,pubkeys:m,signatures:w,maxSignatures:y}}if(n===r.P2SH){var b=_se.p2sh({input:e,witness:t}),I=b.output,B=b.redeem,E=Due.output(B.output),C=A(B.input,B.witness,E,B.output);return C.prevOutType?{prevOutScript:I,prevOutType:r.P2SH,redeemScript:B.output,redeemScriptType:C.prevOutType,witnessScript:C.witnessScript,witnessScriptType:C.witnessScriptType,pubkeys:C.pubkeys,signatures:C.signatures}:{}}if(n===r.P2WSH){var x,k=_se.p2wsh({input:e,witness:t}),S=k.output,Q=k.redeem,_=Due.output(Q.output);return(x=_===r.P2WPKH?A(Q.input,Q.witness,_):A(use.compile(Q.witness),[],_,Q.output)).prevOutType?{prevOutScript:S,prevOutType:r.P2WSH,witnessScript:Q.output,witnessScriptType:x.prevOutType,pubkeys:x.pubkeys,signatures:x.signatures}:{}}return{prevOutType:r.NONSTANDARD,prevOutScript:e}}function c(e,t){Hae(Xae.Buffer,e);var n=Due.output(e);switch(n){case r.P2PKH:if(!t)return{type:n};var i=_se.p2pkh({output:e}).hash,o=fse.hash160(t);return i.equals(o)?{type:n,pubkeys:[t],signatures:[void 0]}:{type:n};case r.P2WPKH:if(!t)return{type:n};var a=_se.p2wpkh({output:e}).hash,s=fse.hash160(t);return a.equals(s)?{type:n,pubkeys:[t],signatures:[void 0]}:{type:n};case r.P2PK:return{type:n,pubkeys:[_se.p2pk({output:e}).pubkey],signatures:[void 0]};case r.P2MS:var u=_se.p2ms({output:e});return{type:n,pubkeys:u.pubkeys,signatures:u.pubkeys.map((function(){})),maxSignatures:u.m}}return{type:n}}function h(e,t,i){var o=t.pubkeys||[],a=t.signatures||[];switch(e){case r.P2PKH:if(0===o.length)break;if(0===a.length)break;return _se.p2pkh({pubkey:o[0],signature:a[0]});case r.P2WPKH:if(0===o.length)break;if(0===a.length)break;return _se.p2wpkh({pubkey:o[0],signature:a[0]});case r.P2PK:if(0===o.length)break;if(0===a.length)break;return _se.p2pk({signature:a[0]});case r.P2MS:var s=t.maxSignatures;a=i?a.map((function(e){return e||n.OPS.OP_0})):a.filter((function(e){return e}));var u=!i||s===a.length;return _se.p2ms({m:s,pubkeys:o,signatures:a},{allowIncomplete:i,validate:u});case r.P2SH:var l=h(t.redeemScriptType,t,i);if(!l)return;return _se.p2sh({redeem:{output:l.output||t.redeemScript,input:l.input,witness:l.witness}});case r.P2WSH:var A=h(t.witnessScriptType,t,i);if(!A)return;return _se.p2wsh({redeem:{output:t.witnessScript,input:A.input,witness:A.witness}})}}function f(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function d(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=u}));PY(Fue),Fue.TransactionBuilder;var Pue=UY((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bip32=zae,t.address=Nse,t.crypto=fse,t.ECPair=Fse,t.networks=Jae,t.payments=_se,t.script=use,t.Block=Ose.Block,t.Psbt=Aue.Psbt;var n=use;t.opcodes=n.OPS,t.Transaction=Rse.Transaction,t.TransactionBuilder=Fue.TransactionBuilder}));function Uue(e,t,n){var r="",i=function(e,t){var n=null;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&r.toLowerCase()===t.toLowerCase()&&(n=r);return e[n]}(e,t),o=C2(n);if(i?(i.created&&o<=i.created&&(r="invalidIssuingAddressCreationTime"),i.revoked&&o>=i.revoked&&(r="invalidIssuingAddressRevoked"),i.expires&&o>=i.expires&&(r="invalidIssuingAddressExpired")):r="invalidIssuingAddressUnknown",r)throw new NY("checkAuthenticity",CY("errors",r))}PY(Pue),Pue.bitcoin,Pue.bip32,Pue.address,Pue.crypto,Pue.ECPair,Pue.networks,Pue.payments,Pue.script,Pue.Block,Pue.Psbt,Pue.opcodes,Pue.Transaction,Pue.TransactionBuilder;var Lue=j$("Verifier"),Mue=function(){function e(t){var n=t.certificateJson,r=t.chain,i=t.expires,o=t.id,a=t.issuer,u=t.receipt,l=t.revocationKey,A=t.transactionId,c=t.version,h=t.explorerAPIs;s(this,e),this.chain=r,this.expires=i,this.id=o,this.issuer=a,this.receipt=u,this.revocationKey=l,this.version=c,this.transactionId=A,this.explorerAPIs=h;var f=n.document;f||(f=this._retrieveDocumentBeforeIssuance(n)),this.documentToVerify=Object.assign({},f),this._stepsStatuses=[]}return l(e,[{key:"verify",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return sY(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._stepCallback=e,this.version!==lY.V1_1){t.next=2;break}throw new NY("","Verification of 1.1 certificates is not supported by this component. See the python cert-verifier for legacy verification");case 2:if(!k2.chains.isMockChain(this.chain)){t.next=7;break}return t.next=5,this._verifyV2Mock();case 5:t.next=9;break;case 7:return t.next=9,this._verifyMain();case 9:return n=this._stepsStatuses.find((function(e){return"failure"===e.status})),t.abrupt("return",n?this._failed(n):this._succeed());case 11:case"end":return t.stop()}}),t,this)})))}},{key:"_getRevocationListUrl",value:function(e){var t;return(null===(t=this.issuer)||void 0===t?void 0:t.revocationList)?this.issuer.revocationList:e.revocationList}},{key:"_doAction",value:function(e,t){return sY(this,void 0,void 0,r().mark((function n(){var i,o;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this._isFailing()){n.next=2;break}return n.abrupt("return");case 2:return e&&(i=k2.i18n.getText("subSteps","".concat(e,"LabelPending")),Lue(i),this._updateStatusCallback(e,i,"starting")),n.prev=3,n.next=6,t();case 6:return o=n.sent,n.abrupt("return",(e&&(this._updateStatusCallback(e,i,"success"),this._stepsStatuses.push({step:e,label:i,status:"success"})),o));case 10:n.prev=10,n.t0=n.catch(3),e&&(this._updateStatusCallback(e,i,"failure",n.t0.message),this._stepsStatuses.push({code:e,label:i,status:"failure",errorMessage:n.t0.message}));case 13:case"end":return n.stop()}}),n,this,[[3,10]])})))}},{key:"_stepCallback",value:function(e){}},{key:"_verifyMain",value:function(){return sY(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTransactionId();case 2:return e.next=4,this.computeLocalHash();case 4:return e.next=6,this.fetchRemoteHash();case 6:return e.next=8,this.getIssuerProfile();case 8:return e.next=10,this.parseIssuerKeys();case 10:return e.next=12,this.compareHashes();case 12:return e.next=14,this.checkMerkleRoot();case 14:return e.next=16,this.checkReceipt();case 16:return e.next=18,this.checkRevokedStatus();case 18:return e.next=20,this.checkAuthenticity();case 20:return e.next=22,this.checkExpiresDate();case 22:case"end":return e.stop()}}),e,this)})))}},{key:"_verifyV2Mock",value:function(){return sY(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.computeLocalHash();case 2:return e.next=4,this.compareHashes();case 4:return e.next=6,this.checkReceipt();case 6:return e.next=8,this.checkExpiresDate();case 8:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionId",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("getTransactionId",(function(){return function(e){if("string"==typeof e&&e.length>0)return e;throw new NY("getTransactionId",CY("errors","isTransactionIdValid"))}(t.transactionId)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"computeLocalHash",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("computeLocalHash",(function(){return sY(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n9(this.documentToVerify,this.version);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 2:this.localHash=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"fetchRemoteHash",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("fetchRemoteHash",(function(){return sY(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k2.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 2:this.txData=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getIssuerProfile",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("getIssuerProfile",(function(){return sY(t,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k2.verifier.getIssuerProfile(this.issuer);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 2:this.issuer=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"parseIssuerKeys",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("parseIssuerKeys",(function(){return k2.verifier.parseIssuerKeys(t.issuer)}));case 2:this.issuerPublicKeyList=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"compareHashes",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("compareHashes",(function(){!function(e,t){if(e!==t)throw new NY("compareHashes",CY("errors","ensureHashesEqual"))}(t.localHash,t.receipt.targetHash)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkMerkleRoot",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkMerkleRoot",(function(){return function(e,t){if(e!==t)throw new NY("checkMerkleRoot",CY("errors","ensureMerkleRootEqual"));return!0}(t.receipt.merkleRoot,t.txData.remoteHash)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkReceipt",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkReceipt",(function(){return function(e){var t=e.targetHash,n=e.merkleRoot;try{var r=e.proof||e.path;if(r)for(var i in r){var o=r[i],a=void 0;if(void 0!==o.left)a=t9("".concat(o.left).concat(t)),t=e9(a);else{if(void 0===o.right)throw new NY("checkReceipt","Trigger catch error.");a=t9("".concat(t).concat(o.right)),t=e9(a)}}}catch(e){throw new NY("checkReceipt",CY("errors","ensureValidReceipt"))}if(t!==n)throw new NY("checkReceipt",CY("errors","invalidMerkleReceipt"))}(t.receipt)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkRevokedStatus",value:function(){var e;return sY(this,void 0,void 0,r().mark((function t(){var n,i,o=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.version!==lY.V1_2){t.next=4;break}i=(null===(e=this.txData)||void 0===e?void 0:e.revokedAddresses)||[],n=[k2.verifier.parseRevocationKey(this.issuer),this.revocationKey],t.next=8;break;case 4:return t.next=6,this._doAction(null,(function(){return sY(o,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k2.verifier.getRevokedAssertions(this._getRevocationListUrl(this.issuer),this.id);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}));case 6:i=t.sent,n=this.id;case 8:return t.next=10,this._doAction("checkRevokedStatus",(function(){return function(e,t){if(e&&t){Array.isArray(t)||(t=[t]);var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.filter((function(e){return-1!==t.indexOf(e)})).filter((function(e,t,n){return n.indexOf(e)===t}))}(t=t.filter((function(e){return null!=e})),e.map((function(e){return e.id})));if(n.length>0){var r=e.findIndex((function(e){return e.id===n[0]}));if(r>-1)throw new NY("checkRevokedStatus",k2.certificates.generateRevocationReason(e[r].revocationReason))}}}(i,n)}));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"checkAuthenticity",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkAuthenticity",(function(){return Uue(t.issuerPublicKeyList,t.txData.issuingAddress,t.txData.time)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"checkExpiresDate",value:function(){return sY(this,void 0,void 0,r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._doAction("checkExpiresDate",(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){var t=C2(e);if(new Date>=t)throw new NY("checkExpiresDate",CY("errors","ensureNotExpired"))}}(t.expires)}));case 2:case"end":return e.stop()}}),e,this)})))}},{key:"_failed",value:function(e){var t=e.errorMessage;return Lue("failure:".concat(t)),this._setFinalStep({status:"failure",message:t})}},{key:"_isFailing",value:function(){return this._stepsStatuses.some((function(e){return"failure"===e.status}))}},{key:"_retrieveDocumentBeforeIssuance",value:function(e){var t=Object.assign({},e);return delete t.signature,t}},{key:"_succeed",value:function(){var e=k2.chains.isMockChain(this.chain)?k2.i18n.getText("success","mocknet"):k2.i18n.getText("success","blockchain");return Lue(e),this._setFinalStep({status:"success",message:e})}},{key:"_setFinalStep",value:function(e){return{code:"final",status:e.status,message:e.message}}},{key:"_updateStatusCallback",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(null!=e){var i={code:e,label:t,status:n};r&&(i.errorMessage=r),this._stepCallback(i)}}}]),e}(),Tue=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,e),this.explorerAPIs=[],this._setOptions(n),"object"!=i(t))try{t=JSON.parse(t)}catch(t){throw new Error(k2.i18n.getText("errors","certificateNotValid"))}this.certificateJson=TY(t)}return l(e,[{key:"init",value:function(){return sY(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.parseJson(this.certificateJson);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"parseJson",value:function(e){return sY(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Q2(e);case 2:if((n=t.sent).isFormatValid){t.next=5;break}throw new Error(n.error);case 5:this._setProperties(n);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"verify",value:function(e){return sY(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Mue({certificateJson:this.certificateJson,chain:this.chain,expires:this.expires,id:this.id,issuer:this.issuer,receipt:this.receipt,revocationKey:this.revocationKey,transactionId:this.transactionId,version:this.version,explorerAPIs:TY(this.explorerAPIs)}),t.next=3,n.verify(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"_setOptions",value:function(e){this.options=Object.assign({},IY,e),this.locale=k2.i18n.ensureIsSupported("auto"===this.options.locale?k2.i18n.detectLocale():this.options.locale),this.explorerAPIs=this.options.explorerAPIs||[],EY.locale=this.locale}},{key:"_setProperties",value:function(e){var t=e.certificateImage,n=e.chain,r=e.description,i=e.expires,o=e.id,a=e.isFormatValid,s=e.issuedOn,u=e.issuer,l=e.metadataJson,A=e.name,c=e.publicKey,h=e.receipt,f=e.recipientFullName,d=e.recordLink,p=e.revocationKey,g=e.sealImage,v=e.signature,y=e.signatureImage,m=e.subtitle,w=e.version;this.isFormatValid=a,this.certificateImage=t,this.chain=n,this.description=r,this.expires=i,this.id=o,this.issuedOn=s,this.issuer=u,this.metadataJson=l,this.name=A,this.publicKey=c,this.receipt=h,this.recipientFullName=f,this.recordLink=d,this.revocationKey=p,this.sealImage=g,this.signature=v,this.signatureImage=y,this.subtitle=m,this.verificationSteps=k2.certificates.getVerificationMap(n),this.version=w,this._setTransactionDetails()}},{key:"_setTransactionDetails",value:function(){this.transactionId=k2.certificates.getTransactionId(this.receipt),this.rawTransactionLink=k2.certificates.getTransactionLink(this.transactionId,this.chain,!0),this.transactionLink=k2.certificates.getTransactionLink(this.transactionId,this.chain)}}]),e}();var Rue=Object.freeze({__proto__:null,displayHtmlHasNoWidthConstraint:Nt,download:function(e){return e+Dt},downloadPDF:function(e){return Lt(this,void 0,void 0,(function*(){yield Bo(e)}))},initializeVerificationSteps:function(e){const t=JSON.parse(JSON.stringify(e.verificationSteps));return t.map(((e,n)=>Object.assign(Object.assign({},e),{isLast:n===t.length-1,status:Vx.DEFAULT})))},retrieve:function(e){return XJ(e)||WJ(e)?fetch(e+Dt).then((function(e){return e.text()})).then((function(e){try{return{certificateDefinition:JSON.parse(e)}}catch(e){return console.log(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcertsUrl"}}})).catch(ZJ):(console.error("Invalid url to retrieve:",e),null)},read:function(e){return eY.apply(this,arguments)},parse:function(e,t={}){return Lt(this,void 0,void 0,(function*(){t.locale||(t.locale="auto");try{let n;return n=1===nk(e["@context"]).versionNumber?new Tue(e,t):new YJ(e,t),yield n.init(),{certificateDefinition:n}}catch(e){return console.error(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcerts"}}}))},isPathToCertificateValidURI:function(e){return XJ(e)||WJ(e)}});var Oue=Object.freeze({__proto__:null,dispatch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if(e&&"string"==typeof e&&t&&"object"===i(t)){var o=new CustomEvent(e,{detail:n({certificateDefinition:t},r)});window.dispatchEvent(o)}}}),Hue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!window.Proxy){var t=kt();return new t(e,Qt)}return new Proxy(e,Qt)}({certificates:Rue,events:Oue});function Kue(e,t){return e(t={exports:{}},t.exports),t.exports}function jue(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Gue=/javascript\s*\:/gim;var que={whiteList:jue(),getDefaultWhiteList:jue,onAttr:function(e,t,n){},onIgnoreAttr:function(e,t,n){},safeAttrValue:function(e,t){return Gue.test(t)?"":t}},Vue=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},zue=function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")};var Jue=function(e,t){";"!==(e=zue(e))[e.length-1]&&(e+=";");var n=e.length,r=!1,i=0,o=0,a="";function s(){if(!r){var n=Vue(e.slice(i,o)),s=n.indexOf(":");if(-1!==s){var u=Vue(n.slice(0,s)),l=Vue(n.slice(s+1));if(u){var A=t(i,a.length,u,l,n);A&&(a+=A+"; ")}}}i=o+1}for(;o<n;o++){var u=e[o];if("/"===u&&"*"===e[o+1]){var l=e.indexOf("*/",o+2);if(-1===l)break;i=(o=l+1)+1,r=!1}else"("===u?r=!0:")"===u?r=!1:";"===u?r||s():"\n"===u&&s()}return Vue(a)};function Yue(e){return null==e}function Xue(e){e=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{}),e.whiteList=e.whiteList||que.whiteList,e.onAttr=e.onAttr||que.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||que.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||que.safeAttrValue,this.options=e}Xue.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,n=t.whiteList,r=t.onAttr,i=t.onIgnoreAttr,o=t.safeAttrValue,a=Jue(e,(function(e,t,a,s,u){var l=n[a],A=!1;if(!0===l?A=l:"function"==typeof l?A=l(s):l instanceof RegExp&&(A=l.test(s)),!0!==A&&(A=!1),s=o(a,s)){var c,h={position:t,sourcePosition:e,source:u,isWhite:A};return A?Yue(c=r(a,s,h))?a+":"+s:c:Yue(c=i(a,s,h))?void 0:c}}));return a};var Wue=Xue,Zue=Kue((function(e,t){for(var n in t=e.exports=function(e,t){return new Wue(t).process(e)},t.FilterCSS=Wue,que)t[n]=que[n];"undefined"!=typeof window&&(window.filterCSS=e.exports)}));Zue.cssfilter,Zue.FilterCSS;var $ue=function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},ele=function(e,t,n){var r,i;if(Array.prototype.forEach)return e.forEach(t,n);for(r=0,i=e.length;r<i;r++)t.call(n,e[r],r,e)},tle=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},nle=function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},rle=Zue.FilterCSS,ile=Zue.getDefaultWhiteList;function ole(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var ale=new rle;function sle(e){return e.replace(ule,"<").replace(lle,">")}var ule=/</g,lle=/>/g,Ale=/"/g,cle=/"/g,hle=/&#([a-zA-Z0-9]*);?/gim,fle=/:?/gim,dle=/&newline;?/gim,ple=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,gle=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,vle=/u\s*r\s*l\s*\(.*/gi;function yle(e){return e.replace(Ale,""")}function mle(e){return e.replace(cle,'"')}function wle(e){return e.replace(hle,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function ble(e){return e.replace(fle,":").replace(dle," ")}function Ile(e){for(var t="",n=0,r=e.length;n<r;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return tle(t)}function Ble(e){return e=Ile(e=ble(e=wle(e=mle(e))))}function Ele(e){return e=sle(e=yle(e))}var Cle=function(e,t,n,r){if(n=Ble(n),"href"===t||"src"===t){if("#"===(n=tle(n)))return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===t){if(ple.lastIndex=0,ple.test(n))return""}else if("style"===t){if(gle.lastIndex=0,gle.test(n))return"";if(vle.lastIndex=0,vle.test(n)&&(ple.lastIndex=0,ple.test(n)))return"";!1!==r&&(n=(r=r||ale).process(n))}return n=Ele(n)},xle=function(e,t){"function"!=typeof t&&(t=function(){});var n=!Array.isArray(e),r=[],i=!1;return{onIgnoreTag:function(o,a,s){if(function(t){return!!n||-1!==$ue(e,t)}(o)){if(s.isClosing){var u="[/removed]",l=s.position+u.length;return r.push([!1!==i?i:s.position,l]),i=!1,u}return i||(i=s.position),"[removed]"}return t(o,a,s)},remove:function(e){var t="",n=0;return ele(r,(function(r){t+=e.slice(n,r[0]),n=r[1]})),t+=e.slice(n)}}},kle=function(e){for(var t="",n=0;n<e.length;){var r=e.indexOf("\x3c!--",n);if(-1===r){t+=e.slice(n);break}t+=e.slice(n,r);var i=e.indexOf("--\x3e",r);if(-1===i)break;n=i+3}return t},Sle=function(e){var t=e.split("");return t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})),t.join("")},Qle={whiteList:{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},getDefaultWhiteList:ole,onTag:function(e,t,n){},onIgnoreTag:function(e,t,n){},onTagAttr:function(e,t,n){},onIgnoreTagAttr:function(e,t,n){},safeAttrValue:Cle,escapeHtml:sle,escapeQuote:yle,unescapeQuote:mle,escapeHtmlEntities:wle,escapeDangerHtml5Entities:ble,clearNonPrintableCharacter:Ile,friendlyAttrValue:Ble,escapeAttrValue:Ele,onIgnoreTagStripAll:function(){return""},StripTagBody:xle,stripCommentTag:kle,stripBlankChar:Sle,cssFilter:ale,getDefaultCSSWhiteList:ile};function _le(e){var t=nle(e);if(-1===t)var n=e.slice(1,-1);else n=e.slice(1,t+1);return"/"===(n=tle(n).toLowerCase()).slice(0,1)&&(n=n.slice(1)),"/"===n.slice(-1)&&(n=n.slice(0,-1)),n}function Nle(e){return"</"===e.slice(0,2)}var Dle=/[^a-zA-Z0-9_:\.\-]/gim;function Fle(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"="===n?t:-1}}function Ple(e,t){for(;t>0;t--){var n=e[t];if(" "!==n)return"="===n?t:-1}}function Ule(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}var Lle=function(e,t,n){var r="",i=0,o=!1,a=!1,s=0,u=e.length,l="",A="";e:for(s=0;s<u;s++){var c=e.charAt(s);if(!1===o){if("<"===c){o=s;continue}}else if(!1===a){if("<"===c){r+=n(e.slice(i,s)),o=s,i=s;continue}if(">"===c){r+=n(e.slice(i,o)),l=_le(A=e.slice(o,s+1)),r+=t(o,r.length,l,A,Nle(A)),i=s+1,o=!1;continue}if('"'===c||"'"===c)for(var h=1,f=e.charAt(s-h);""===f.trim()||"="===f;){if("="===f){a=c;continue e}f=e.charAt(s-++h)}}else if(c===a){a=!1;continue}}return i<e.length&&(r+=n(e.substr(i))),r},Mle=function(e,t){var n=0,r=[],i=!1,o=e.length;function a(e,n){if(!((e=(e=tle(e)).replace(Dle,"").toLowerCase()).length<1)){var i=t(e,n||"");i&&r.push(i)}}for(var s=0;s<o;s++){var u,l=e.charAt(s);if(!1!==i||"="!==l)if(!1===i||s!==n||'"'!==l&&"'"!==l||"="!==e.charAt(s-1))if(/\s|\n|\t/.test(l)){if(e=e.replace(/\s|\n|\t/g," "),!1===i){if(-1===(u=Fle(e,s))){a(tle(e.slice(n,s))),i=!1,n=s+1;continue}s=u-1;continue}if(-1===(u=Ple(e,s-1))){a(i,Ule(tle(e.slice(n,s)))),i=!1,n=s+1;continue}}else;else{if(-1===(u=e.indexOf(l,s+1)))break;a(i,tle(e.slice(n+1,u))),i=!1,n=(s=u)+1}else i=e.slice(n,s),n=s+1}return n<e.length&&(!1===i?a(e.slice(n)):a(i,Ule(tle(e.slice(n))))),tle(r.join(" "))},Tle={parseTag:Lle,parseAttr:Mle},Rle=Zue.FilterCSS,Ole=Tle.parseTag,Hle=Tle.parseAttr;function Kle(e){return null==e}function jle(e){e=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=Qle.onIgnoreTagStripAll),e.whiteList=e.whiteList||Qle.whiteList,e.onTag=e.onTag||Qle.onTag,e.onTagAttr=e.onTagAttr||Qle.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||Qle.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||Qle.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||Qle.safeAttrValue,e.escapeHtml=e.escapeHtml||Qle.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Rle(e.css))}jle.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,n=t.whiteList,r=t.onTag,i=t.onIgnoreTag,o=t.onTagAttr,a=t.onIgnoreTagAttr,s=t.safeAttrValue,u=t.escapeHtml,l=this.cssFilter;t.stripBlankChar&&(e=Qle.stripBlankChar(e)),t.allowCommentTag||(e=Qle.stripCommentTag(e));var A=!1;if(t.stripIgnoreTagBody){A=Qle.StripTagBody(t.stripIgnoreTagBody,i);i=A.onIgnoreTag}var c=Ole(e,(function(e,t,A,c,h){var f,d={sourcePosition:e,position:t,isClosing:h,isWhite:n.hasOwnProperty(A)};if(!Kle(f=r(A,c,d)))return f;if(d.isWhite){if(d.isClosing)return"</"+A+">";var p=function(e){var t=nle(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=tle(e.slice(t+1,-1)))[e.length-1];return n&&(e=tle(e.slice(0,-1))),{html:e,closing:n}}(c),g=n[A],v=Hle(p.html,(function(e,t){var n,r=-1!==$ue(g,e);return Kle(n=o(A,e,t,r))?r?(t=s(A,e,t,l))?e+'="'+t+'"':e:Kle(n=a(A,e,t,r))?void 0:n:n}));c="<"+A;return v&&(c+=" "+v),p.closing&&(c+=" /"),c+=">"}return Kle(f=i(A,c,d))?u(c):f}),u);return A&&(c=A.remove(c)),c};var Gle=jle,qle=Kue((function(e,t){function n(e,t){return new Gle(t).process(e)}for(var r in(t=e.exports=n).filterXSS=n,t.FilterXSS=Gle,Qle)t[r]=Qle[r];for(var r in Tle)t[r]=Tle[r];"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}));qle.xss,qle.filterXSS,qle.FilterXSS;var Vle=n(n({},Zue.getDefaultWhiteList()),{},{bottom:!0,left:!0,float:!0,overflow:!0,position:!0,right:!0,top:!0,transform:!0,opacity:!0,"transform-origin":!0,"flex-direction":!0,"flex-wrap":!0,"justify-content":!0,"align-items":!0,"white-space":!0,"line-height":!0,"grid-template-columns":!0,"grid-template-rows":!0,"grid-column":!0,"grid-row":!0,"grid-area":!0,"align-self":!0,"justify-self":!0,span:!0});var zle=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Jle=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Yle=/u\s*r\s*l\s*\(.*/gi,Xle={whiteList:function(){var e=qle.getDefaultWhiteList();return Object.keys(e).forEach((function(t){e[t].push("style"),e[t].push("class"),e[t].push("download")})),e}(),css:!1,stripIgnoreTagBody:!0,onTagAttr:function(e,t,n,r){if("style"===t)return"".concat(t,'="').concat(Zue(n,{whiteList:Vle}).replace(/; /g,";"),'"');if("img"===e&&"src"===t&&function(e){return!!e.match(/^data:.+;base64,/)}(n)){var i=function(e){return e.split("base64,")[1]}(n);try{return atob(i),"".concat(t,'="').concat(n,'"')}catch(e){return t}}},safeAttrValue:function(e,t,n,r){if(n=qle.friendlyAttrValue(n),"href"===t||"src"===t){if("#"===(n=function(e){if(String.prototype.trim)return e.trim();return e.replace(/(^\s*)|(\s*$)/g,"")}(n)))return"#";if(!function(e){return["http://","https://","mailto:","tel:","data:","#","/"].some((function(t){return e.substr(0,t.length)===t}))}(n))return""}else if("background"===t){if(zle.lastIndex=0,zle.test(n))return""}else if("style"===t){if(Jle.lastIndex=0,Jle.test(n))return"";if(Yle.lastIndex=0,Yle.test(n)&&(zle.lastIndex=0,zle.test(n)))return"";!1!==r&&(n=(r=r||qle.getDefaultCSSWhiteList()).process(n))}return n=qle.escapeAttrValue(n)}},Wle=new qle.FilterXSS(Xle);function Zle(e){return Wle.process(e)}function $le(e){const t=so("date","pattern");"Z"===e.slice(-1)?e=e.slice(0,e.length-1):e.includes("+")&&(e=e.split("+")[0]);const n=new Date(e);let r=function(e,t){const n=so("date","months");return e.replace("MM",n[t])}(t,n.getMonth());return r=function(e,t){return e.replace("DD",t)}(r,n.getDate().toString(10)),r=function(e,t){return e.replace("YYYY",t)}(r,n.getFullYear().toString(10)),r}function eAe(e){return e.certificateDefinition}function tAe(e){const t=eAe(e);return t?t.signers:[]}function nAe(e){const t=eAe(e);return t?t.issuedOn:""}function rAe(e){return eAe(e)?$le(nAe(e)):""}function iAe(e){const t=eAe(e);return t?t.recipientFullName:""}function oAe(e){const t=eAe(e);return t?t.name:""}function aAe(e){const t=eAe(e);return t?t.issuer.name:""}function sAe(e){const t=eAe(e);return t?t.issuer.image:""}function uAe(e){const t=eAe(e);if(!t)return"";const{displayHtml:n}=t.certificateJson;if(n)return Zle(n);const r=t.display;if(r)switch(r.contentMediaType){case St.TEXT_HTML:return Zle(r.content);case St.IMAGE_PNG:case St.IMAGE_JPEG:case St.IMAGE_GIF:case St.IMAGE_BMP:return`<img src="data:${r.contentMediaType};${r.contentEncoding},${r.content}"/>`;case St.APPLICATION_PDF:return`<embed width="100%" height="100%" type="application/pdf" src="data:${r.contentMediaType};${r.contentEncoding},${r.content}"/>`;default:return""}return""}function lAe(e){const t=eAe(e);return t&&XJ(t.recordLink)?t.recordLink:""}function AAe(e){const t=lAe(e);return t?Hue.certificates.download(t):""}function cAe(e){const t=eAe(e);if(t)try{return JSON.parse(t.metadataJson)}catch(e){return null}return null}function hAe(e){var t;const n=tAe(e);return 0===n.length?null!==(t=CAe(e,"transactionLink"))&&void 0!==t?t:[]:n.map((e=>e.transactionLink))}function fAe(e){var t;const n=tAe(e);return 0===n.length?null!==(t=CAe(e,"transactionId"))&&void 0!==t?t:[]:n.map((e=>e.transactionId))}function dAe(e){const t=tAe(e);if(0===t.length){const t=CAe(e,"chain");return t?t.map((e=>null==e?void 0:e.name)):[]}return t.map((e=>{var t;return null===(t=e.chain)||void 0===t?void 0:t.name}))}function pAe(e){return dAe(e).some((e=>"Mocknet"===e||(null==e?void 0:e.includes("Testnet"))))}function gAe(e,t){const n=dAe(e)[t];return!!n&&("Mocknet"===n||n.includes("Testnet"))}function vAe(e){return e.verifiedSteps||[]}function yAe(e,t){return vAe(e).find((e=>e.code===t))}function mAe(e){return vAe(e).some((e=>e.status===Vx.FAILURE))}function wAe(e){return e.finalStep}function bAe(e){return tAe(e).map((e=>e.issuerPublicKey))}function IAe(e){return tAe(e).map((e=>e.issuerProfileUrl))}function BAe(e){return tAe(e).map((e=>e.issuerProfileDomain))}function EAe(e){return tAe(e).map((e=>e.signatureSuiteType))}function CAe(e,t){const n=eAe(e);return n?[n[t]]:null}function xAe(e){const t=eAe(e);return t?t.certificateImage:""}function kAe(e){const t=eAe(e);return t?t.subtitle:""}function SAe(e){const t=eAe(e);return t?t.description:""}function QAe(e){const t=eAe(e);return t?t.signatureImage:""}function _Ae(e){const t=eAe(e);return t?t.sealImage:""}function NAe(e){return e.isGeneratingPDF}function DAe(e,t){switch(t.type){case mt:return function(e,t){var r=t.payload.resetSteps;return n(n({},e),{},{verifiedSteps:r})}(e,t);case dt:return function(e,t){return n(n({},e),t.payload.options)}(e,t);case pt:return function(e,t){return n(n(n({},e),t.payload),t.payload.certificateDefinition&&{verifiedSteps:Hue.certificates.initializeVerificationSteps(t.payload.certificateDefinition)})}(e,t);case gt:return function(e,t){return n(n({},e),{},{certificateDefinition:t.payload.definition})}(e,t);case vt:return function(e,t){return n(n({},e),{},{input:n(n({},e.input),{},{certificateUrl:t.payload.url})})}(e,t);case bt:return function(e,t){var n=t.payload,r=n.parentStepCode,i=n.status;return yAe(e,r).status=i,e}(e,t);case yt:return function(e,t){return n(n({},e),{},{input:n(n({},e.input),{},{isValid:t.payload.isValid})})}(e,t);case Et:return function(e,t){var r=t.payload.errorMessage;return n(n({},e),{},{errorMessage:r})}(e,t);case Ct:return function(e,t){return n(n({},e),{},{showVerificationModal:t.payload.showVerificationModal})}(e,t);case wt:return function(e,t){const{parentStep:n}=t.payload;return function(e,t){var n;let r=e.subSteps.findIndex((e=>e.code===t.code));r>-1?e.subSteps[r]=t:(null===(n=e.suites)||void 0===n?void 0:n.length)&&e.suites.forEach((e=>{r=e.subSteps.findIndex((e=>e.code===t.code)),r>-1&&(e.subSteps[r]=t)}))}(yAe(e,n),t.payload),e}(e,t);case It:return function(e,t){return n(n({},e),{},{verificationStatus:t.payload.status})}(e,t);case Bt:return function(e,t){return n(n({},e),{},{finalStep:t.payload.finalStep})}(e,t);case xt:return function(e,t){return Object.assign(Object.assign({},e),{isGeneratingPDF:t.payload.isGeneratingPDF})}(e,t);default:return e}}var FAe="full",PAe="bright",UAe="dark";function LAe(e={}){return Object.assign({input:{},verifiedSteps:[],finalStep:null,verificationStatus:Vx.DEFAULT,showVerificationModal:!1,displayMode:"card",disableDownloadPdf:!1,theme:PAe},e)}const MAe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:LAe(),t=[At];return ot(DAe,e,ut.apply(void 0,t))}();function TAe(e,{mapDispatchToProps:t={},mapStateToProps:n=(()=>({})),ownProps:r={}}){return class extends(function(e){return function(t){return function(t){c(r,t);var n=b(r);function r(){return s(this,r),n.apply(this,arguments)}return l(r,[{key:"connectedCallback",value:function(){var t=this;this.__storeUnsubscribe=e.subscribe((function(){return t._stateChanged(e.getState())})),this._stateChanged(e.getState()),B(h(r.prototype),"connectedCallback",this)&&B(h(r.prototype),"connectedCallback",this).call(this)}},{key:"disconnectedCallback",value:function(){this.__storeUnsubscribe(),B(h(r.prototype),"disconnectedCallback",this)&&B(h(r.prototype),"disconnectedCallback",this).call(this)}},{key:"_stateChanged",value:function(e){throw new Error("_stateChanged() not implemented")}}]),r}(t)}}(MAe)(Xe)){mapDispatchToProps(){return function(e,t){if("function"==typeof e)return at(e,t);if("object"!==i(e)||null===e)throw new Error(et(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=at(o,t))}return n}(t,MAe.dispatch)}mapStateToProps(e){return n(MAe.getState(),e)}static get properties(){return r}_render(t){const n=Object.assign(Object.assign(Object.assign({},this.mapDispatchToProps()),this.mapStateToProps(t)),t);return qe`${e(n)}`}_stateChanged(e){this._requestRender()}}}function RAe(e){return{type:Et,payload:{errorMessage:e}}}function OAe(e){return function(t){t({type:yt,payload:{isValid:e}}),t(RAe(e?null:"errors.invalidUrl"))}}function HAe(e){return e.status===Vx.SUCCESS}function KAe(e){return e.status===Vx.FAILURE}function jAe(e){return function(t,n){if(null==e)return;const r=yAe(n(),e);let i=r.status;i===Vx.DEFAULT&&function(e){var t,n;let r=!0;return(null===(t=e.suites)||void 0===t?void 0:t.length)&&(r=null===(n=e.suites)||void 0===n?void 0:n.flatMap((e=>e.subSteps)).some(HAe)),r||e.subSteps.some(HAe)}(r)&&(i=Vx.STARTING),i!==Vx.DEFAULT&&function(e){var t,n;let r=!0;return(null===(t=e.suites)||void 0===t?void 0:t.length)&&(r=null===(n=e.suites)||void 0===n?void 0:n.flatMap((e=>e.subSteps)).every(HAe)),r&&e.subSteps.every(HAe)}(r)&&(i=Vx.SUCCESS),function(e){var t,n;let r=!1;return(null===(t=e.suites)||void 0===t?void 0:t.length)&&(r=null===(n=e.suites)||void 0===n?void 0:n.flatMap((e=>e.subSteps)).some(KAe)),r||e.subSteps.some(KAe)}(r)&&(i=Vx.FAILURE),t({type:bt,payload:{parentStepCode:e,status:i}})}}const GAe=new(function(){function e(){s(this,e),this.queue=[],this.dispatchCb=null,this.isExecuting=!1,this.intervalId=null,this.dispatchNext=this.dispatchNext.bind(this)}return l(e,[{key:"registerCb",value:function(e){this.dispatchCb=e}},{key:"push",value:function(e){this.queue.push(e)}},{key:"dispatchNext",value:function(){var e=this.queue.shift();e?this.dispatchCb(e):this.intervalId&&(this.isExecuting=!1,clearInterval(this.intervalId))}},{key:"execute",value:function(){!this.isExecuting&&this.queue.length&&(this.isExecuting=!0,this.intervalId=setInterval(this.dispatchNext,200))}}]),e}());function qAe(e){return function(t,n){const r=function(e){return function(t){e({type:wt,payload:t}),e(jAe(t.parentStep))}}(t);GAe.dispatchCb||GAe.registerCb(r),GAe.push(e),GAe.execute()}}function VAe(){return function(e,t){var n=eAe(t()),r=[];n&&(r=Hue.certificates.initializeVerificationSteps(n)),e({type:mt,payload:{resetSteps:r}})}}function zAe(e){return{type:It,payload:{status:e}}}function JAe(e){return e.disableVerify}function YAe(e){return e.allowDownload}function XAe(e){return e.disableDownloadPdf}function WAe(e){return e.allowSocialShare}function ZAe(e){return e.showMetadata}function $Ae(e){return e.displayMode}function ece(e){return e.theme}function tce(e){return e.locale}function nce(e){return e.explorerAPIs}function rce(e){return e.clickableUrls}function ice(e){return e.didResolverUrl}function oce(e){return"string"==typeof e&&(e={label:e}),{type:Bt,payload:{finalStep:e}}}function ace(){return function(e,t){return Lt(this,void 0,void 0,(function*(){const n=t();if(JAe(n))return void console.warn("Verification is disabled");e({type:"VERIFY_CERTIFICATE"}),e(zAe(Vx.STARTING)),e(VAe());const r=eAe(n);if(r){Hue.events.dispatch("certificate-verify",r);const t=yield r.verify((t=>{e(qAe(t))}));e(oce(t.message)),e(zAe(t.status))}}))}}function sce(e){return{type:Ct,payload:{showVerificationModal:e}}}function uce(e){return function(t,n){return Lt(this,void 0,void 0,(function*(){const r=n(),i={locale:tce(r),explorerAPIs:nce(r),didResolverUrl:ice(r)},{certificateDefinition:o,errorMessage:a}=yield Hue.certificates.parse(e,i);t(RAe(a)),t({type:pt,payload:{certificateDefinition:o}}),Hue.events.dispatch("certificate-load",o),null!=o&&(yield t((function(e,t){return Lt(this,void 0,void 0,(function*(){(function(e){return e.disableAutoVerify})(t())||(e({type:ft}),e(sce(!0))),yield e(ace())}))})))}))}}function lce(e){return function(){var t=a(r().mark((function t(n){var i,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Hue.certificates.isPathToCertificateValidURI(e),n(OAe(i)),i){t.next=4;break}return t.abrupt("return",null);case 4:return n({type:vt,payload:{url:e}}),t.next=7,Hue.certificates.retrieve(e);case 7:if(!(o=t.sent).certificateDefinition){t.next=13;break}return t.next=11,n(uce(o.certificateDefinition));case 11:t.next=14;break;case 13:n(RAe(o.errorMessage));case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}var Ace=/(-\w)/g,cce=function(e){return e[1].toUpperCase()};var hce,fce={src:String,"disable-auto-verify":Boolean,"disable-verify":Boolean,"allow-download":Boolean,"disable-download-pdf":Boolean,"allow-social-share":Boolean,"display-mode":String,"show-metadata":Boolean,"clickable-urls":Boolean,theme:0,locale:String,explorerAPIs:{},"did-resolver-url":String},dce=Object.keys(fce).map((function(e){return e.replace(Ace,cce)})).reduce((function(e,t){return e[t]=fce[t],e}),{});function pce(e){var t,n=Object.keys(oo).map((function(e){return e.toLowerCase()}));if(!(t=n.indexOf(e.toLowerCase())>-1)){var r=e.substr(0,2).toLowerCase(),i=n.map((function(e){return e.split("-")[0]})).indexOf(r);(t=i>-1)&&(e=n[i])}return t||(e=ro),function(e){var t=e.split("-");return t.length>1?"".concat(t[0].toLowerCase(),"-").concat(t[1].toUpperCase()):t[0].toLowerCase()}(e)}function gce(e){"auto"!==e&&e||(e=navigator.language||navigator.userLanguage||navigator.browserLanguage||ro),io.locale=pce(e)}var vce,yce=qe(hce||(hce=E(['<style>.buv-c-input{font-size:15px;color:#031532;border-radius:2px 0 0 2px;padding:12px 15px;background-color:#f3f4f5;border:solid 1px rgba(3,21,50,.13);box-sizing:border-box;width:100%}.buv-c-input.is-invalid{border:2px solid red}.buv-c-input::-moz-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-c-input::-webkit-input-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-c-input:-moz-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-c-input:-ms-input-placeholder{font-family:"Open Sans",-apple-system,BlinkMacSystemFont,sans-serif;color:rgba(3,21,50,.3);letter-spacing:-0.25px}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}</style>'])));function mce(e){return void 0===e.input.isValid||e.input.isValid}var wce,bce=TAe((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onInput,n=void 0===t?function(){}:t,r=e.isValid,i=void 0===r||r,o="buv-c-input ".concat(i?"":"is-invalid");return qe(vce||(vce=E(["\n ","\n <label \n for='certificate-json-url'\n class='buv-u-visually-hidden'>","</label>\n <input \n type='text'\n id='certificate-json-url'\n placeholder='","'\n class$='","'\n on-input='","'\n />\n "])),yce,so("text.urlInput"),so("text.urlInputPlaceholder"),o,(function(e){n(e.target.value)}))}),{mapDispatchToProps:{onInput:lce},mapStateToProps:function(e){return{isValid:mce(e)}}});window.customElements.define("buv-input",bce);var Ice,Bce=qe(wce||(wce=E(["<style>.buv-c-verify-button{background-color:#2ab27b;border-radius:0 2px 2px 0;color:#fff;cursor:pointer;display:block;font-size:15px;font-weight:400;padding:12px 38px;border:1px solid #2ab27b;width:100%}.buv-c-verify-button__label{cursor:pointer}.buv-c-verify-button--hollow{background:#fff;color:#2ab27b;font-weight:100;text-transform:uppercase;padding:12px 30px;font-size:13px}.buv-c-verify-button--link{background:none;color:#031532;border:0;text-decoration:underline;padding:0;margin-top:5px;font-size:13px}.buv-c-verify-button.is-disabled{pointer-events:none}</style>"])));var Ece,Cce={onClick:function(){return function(e){e({type:"START_VERIFICATION_PROCESS"}),e(sce(!0)),e(ace())}}},xce=TAe((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isHollow,n=void 0!==t&&t,r=e.isDisabled,i=void 0!==r&&r,o=e.onClick,a=void 0===o?function(){}:o,s=e.type,u=void 0===s?"":s,l=["buv-c-verify-button",n?"buv-c-verify-button--hollow":"",i?"is-disabled":"","link"===u?"buv-c-verify-button--link":""].join(" ");return qe(Ice||(Ice=E(["\n ","\n <button class$='","' on-click='","' disabled?='","'>\n <label class='buv-c-verify-button__label'><slot>","</slot></label>\n </button>\n "])),Bce,l,a,i,so("text.verify"))}),{mapDispatchToProps:Cce,mapStateToProps:function(e){return{isDisabled:JAe(e)||!eAe(e)}},ownProps:{isHollow:Boolean,type:String}});window.customElements.define("buv-verify-button",xce);var kce,Sce,Qce=qe(Ece||(Ece=E(["<style>.buv-c-certificate-input{display:flex;width:100%;padding:40px 30px;background-color:rgba(255,255,255,.1);border:1px solid rgba(0,0,0,.1);box-sizing:border-box}@media only screen and (max-width: 600px){.buv-c-certificate-input{flex-direction:column;grid-row-gap:10px;height:162px;padding:30px;justify-content:space-between}}.buv-c-certificate-input__input{width:100%}</style>"]))),_ce=TAe((function(e){var t=e.showInput;return void 0===t||t?qe(kce||(kce=E(["\n ",'\n <section class="buv-c-certificate-input buv-qa-certificate-input">\n <buv-input class="buv-c-certificate-input__input"></buv-input><buv-verify-button></buv-verify-button> \n </section>\n'])),Qce):null}),{mapStateToProps:function(e){return{showInput:!eAe(e)}}});window.customElements.define("buv-certificate-input",_ce);var Nce,Dce=qe(Sce||(Sce=E(['<style>.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:rgba(0,0,0,0)}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-c-download-link{text-decoration:none;color:currentColor}.buv-c-download-link--icon{background-image:url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20id%3D%22Capa%5f1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%22433.5px%22%20height%3D%22433.5px%22%20fill%3D%22%236e7e8e%22%20viewBox%3D%220%200%20433.5%20433.5%22%20style%3D%22enable-background%3Anew%200%200%20433.5%20433.5%3B%22%20xml%3Aspace%3D%22preserve%22%0A%09%3E%3Cg%3E%3Cg%20id%3D%22file-download%22%3E%3Cpath%20d%3D%22M395.25%2C153h-102V0h-153v153h-102l178.5%2C178.5L395.25%2C153z%20M38.25%2C382.5v51h357v-51H38.25z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");width:17px;height:17px;background-size:17px}.buv-c-download-link.is-disabled{pointer-events:none}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}</style>'])));var Fce,Pce=TAe((function(e){var t=e.downloadLink,n=e.display;if(!t)return null;var r="plaintext"===(void 0===n?"":n),i=so("text.downloadLink"),o=["buv-c-download-link","buv-o-button-link",r?"":"buv-c-download-link--icon"].join(" ");return qe(Nce||(Nce=E(["\n ","\n <a class$='","' href='","' title$='","'>\n <span class$='","'>","</span>\n </a>"])),Dce,o,t,i,r?"buv-o-button-link__label":"buv-u-visually-hidden",i)}),{mapStateToProps:function(e){return{downloadLink:AAe(e)}},ownProps:{display:String}});window.customElements.define("buv-download-link",Pce);var Uce=qe(Fce||(Fce=E(['<style>.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:rgba(0,0,0,0)}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-c-download-pdf-link{padding:0;color:#2ab27b}.buv-c-download-pdf-link__icon{background-image:url(\'data:image/svg+xml,%3Csvg data-bx-workspace="master" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com" version="1.1" fill="%236e7e8e" id="Capa_1" x="0px" y="0px" width="550.801px" height="550.801px" viewBox="0 0 550.801 550.801"%3E%3Cg style="" transform="matrix(0.855886, 0, 0, 0.855886, 39.688637, 39.689045)"%3E%3Cpath d="M160.381,282.225c0-14.832-10.299-23.684-28.474-23.684c-7.414,0-12.437,0.715-15.071,1.432V307.6 c3.114,0.707,6.942,0.949,12.192,0.949C148.419,308.549,160.381,298.74,160.381,282.225z"%3E%3C/path%3E%3Cpath d="M272.875,259.019c-8.145,0-13.397,0.717-16.519,1.435v105.523c3.116,0.729,8.142,0.729,12.69,0.729 c33.017,0.231,54.554-17.946,54.554-56.474C323.842,276.719,304.215,259.019,272.875,259.019z"%3E%3C/path%3E%3Cpath d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M362.359,309.023c0,30.876-11.243,52.165-26.82,65.333 c-16.971,14.117-42.82,20.814-74.396,20.814c-18.9,0-32.297-1.197-41.401-2.389V234.365c13.399-2.149,30.878-3.346,49.304-3.346 c30.612,0,50.478,5.508,66.039,17.226C351.828,260.69,362.359,280.547,362.359,309.023z M80.7,393.499V234.365 c11.241-1.904,27.042-3.346,49.296-3.346c22.491,0,38.527,4.308,49.291,12.928c10.292,8.131,17.215,21.534,17.215,37.328 c0,15.799-5.25,29.198-14.829,38.285c-12.442,11.728-30.865,16.996-52.407,16.996c-4.778,0-9.1-0.243-12.435-0.723v57.67H80.7 V393.499z M453.601,523.353H97.2V419.302h356.4V523.353z M484.898,262.127h-61.989v36.851h57.913v29.674h-57.913v64.848h-36.593 V232.216h98.582V262.127z"%3E%3C/path%3E%3C/g%3E%3C/svg%3E\');width:25px;height:25px;background-size:25px}.buv-c-download-pdf-link__label--loading{display:none}.buv-c-download-pdf-link--loading{pointer-events:none}.buv-c-download-pdf-link--loading.buv-c-download-pdf-link__icon{background-image:url(\'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin:auto;background:transparent;display:block;" width="25px" height="25px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"%3E%3Ccircle cx="50" cy="50" fill="none" stroke="%23999999" stroke-width="7" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"%3E%3CanimateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"%3E%3C/animateTransform%3E%3C/circle%3E%3C/svg%3E\')}.buv-c-download-pdf-link--loading .buv-c-download-pdf-link__label{color:#999}.buv-c-download-pdf-link--loading .buv-c-download-pdf-link__label--static{display:none}.buv-c-download-pdf-link--loading .buv-c-download-pdf-link__label--loading{display:block}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}</style>'])));function Lce(e){return{type:xt,payload:{isGeneratingPDF:e}}}const Mce={onClick:function(){return function(e,t){return Lt(this,void 0,void 0,(function*(){const n=t(),r=function(e){var t;const n=eAe(e);return n?"displayHtml"in n.certificateJson?St.TEXT_HTML:null===(t=n.display)||void 0===t?void 0:t.contentMediaType:null}(n),i=function(e){var t;const n=eAe(e);return n?"displayHtml"in n.certificateJson?"":null===(t=n.display)||void 0===t?void 0:t.contentEncoding:""}(n),o=function(e){var t,n;const r=eAe(e);return r?"displayHtml"in r.certificateJson?r.certificateJson.displayHtml:null!==(n=null===(t=r.display)||void 0===t?void 0:t.content)&&void 0!==n?n:"":""}(n),a=iAe(n),s=oAe(n),u=rAe(n),l=aAe(n),A=sAe(n),c=lAe(n),h=bAe(n),f=IAe(n),d=BAe(n);e(Lce(!0)),yield Hue.certificates.downloadPDF({contentType:r,contentEncoding:i,content:o,recipientName:a,certificateTitle:s,issueDate:u,issuerName:l,issuerLogo:A,recordLink:c,issuerPublicKey:h,issuerProfileUrl:f,issuerProfileDomain:d}),e(Lce(!1))}))}}},Tce=TAe((function({display:e="plaintext",isGeneratingPDF:t=!1,onClick:n=(()=>{}),isVisible:r=!0}={display:"plaintext",isGeneratingPDF:!1,onClick:()=>{},isVisible:!0}){if(!r)return null;const i="plaintext"===e,o=so("text.downloadPDFLink"),a=so("text.downloadPDFLinkIsLoading"),s=["buv-o-button-link","buv-c-download-pdf-link","buv-js-download-pdf-link",i?"":"buv-c-download-pdf-link__icon",t?"buv-c-download-pdf-link--loading":""].join(" ");return qe`
|
|
660
660
|
${Uce}
|
|
661
661
|
<button onclick='${n}'
|
|
662
662
|
class$='${s}'
|