@smartledger/bsv 8.0.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +38 -38
- package/bsv-gdaf.min.js +2 -2
- package/bsv-ltp.min.js +1 -1
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +2 -2
- package/bsv.min.js +2 -2
- package/docs/AUDIT_SCOPE.md +9 -9
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/lib/script/interpreter.js +20 -1
- package/package.json +1 -1
- package/test/script/genesis_limits.js +37 -6
- package/version.js +1 -1
package/bsv.min.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
`)>=0&&i++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(t===""?"":t+`
|
|
9
9
|
`)+" "+e.join(`,
|
|
10
10
|
`)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}Fe.types=C1();function F1(e){return Array.isArray(e)}Fe.isArray=F1;function c0(e){return typeof e=="boolean"}Fe.isBoolean=c0;function Id(e){return e===null}Fe.isNull=Id;function fU(e){return e==null}Fe.isNullOrUndefined=fU;function U1(e){return typeof e=="number"}Fe.isNumber=U1;function Od(e){return typeof e=="string"}Fe.isString=Od;function lU(e){return typeof e=="symbol"}Fe.isSymbol=lU;function ls(e){return e===void 0}Fe.isUndefined=ls;function _f(e){return Cu(e)&&f0(e)==="[object RegExp]"}Fe.isRegExp=_f;Fe.types.isRegExp=_f;function Cu(e){return typeof e=="object"&&e!==null}Fe.isObject=Cu;function xd(e){return Cu(e)&&f0(e)==="[object Date]"}Fe.isDate=xd;Fe.types.isDate=xd;function Sf(e){return Cu(e)&&(f0(e)==="[object Error]"||e instanceof Error)}Fe.isError=Sf;Fe.types.isNativeError=Sf;function wd(e){return typeof e=="function"}Fe.isFunction=wd;function hU(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}Fe.isPrimitive=hU;Fe.isBuffer=M1();function f0(e){return Object.prototype.toString.call(e)}function s0(e){return e<10?"0"+e.toString(10):e.toString(10)}var dU=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pU(){var e=new Date,t=[s0(e.getHours()),s0(e.getMinutes()),s0(e.getSeconds())].join(":");return[e.getDate(),dU[e.getMonth()],t].join(" ")}Fe.log=function(){console.log("%s - %s",pU(),Fe.format.apply(Fe,arguments))};Fe.inherits=dt();Fe._extend=function(e,t){if(!t||!Cu(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};function H1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var fs=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Fe.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(fs&&t[fs]){var r=t[fs];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,fs,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var i,n,o=new Promise(function(u,c){i=u,n=c}),a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);a.push(function(u,c){u?n(u):i(c)});try{t.apply(this,a)}catch(u){n(u)}return o}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),fs&&Object.defineProperty(r,fs,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,D1(t))};Fe.promisify.custom=fs;function gU(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function mU(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var r=[],i=0;i<arguments.length;i++)r.push(arguments[i]);var n=r.pop();if(typeof n!="function")throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return n.apply(o,arguments)};e.apply(this,r).then(function(s){_.default.nextTick(a.bind(null,null,s))},function(s){_.default.nextTick(gU.bind(null,s,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,D1(e)),t}Fe.callbackify=mU});var W1=R((qQ,G1)=>{"use strict";p();function j1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function z1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j1(Object(r),!0).forEach(function(i){vU(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j1(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function vU(e,t,r){return t=V1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K1(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,V1(i.key),i)}}function bU(e,t,r){return t&&K1(e.prototype,t),r&&K1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function V1(e){var t=_U(e,"string");return typeof t=="symbol"?t:String(t)}function _U(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SU=Lt(),Ad=SU.Buffer,wU=Ki(),l0=wU.inspect,EU=l0&&l0.custom||"inspect";function xU(e,t,r){Ad.prototype.copy.call(e,t,r)}G1.exports=(function(){function e(){yU(this,e),this.head=null,this.tail=null,this.length=0}return bU(e,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Ad.alloc(0);for(var i=Ad.allocUnsafe(r>>>0),n=this.head,o=0;n;)xU(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=Ad.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,s),r-=s,r===0){s===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++o}return this.length-=o,i}},{key:EU,value:function(r,i){return l0(this,z1(z1({},i),{},{depth:0,customInspect:!1}))}}]),e})()});var d0=R((UQ,Y1)=>{"use strict";p();function IU(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,_.default.nextTick(h0,this,e)):_.default.nextTick(h0,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?_.default.nextTick(Td,r):(r._writableState.errorEmitted=!0,_.default.nextTick(Z1,r,o)):_.default.nextTick(Z1,r,o):t?(_.default.nextTick(Td,r),t(o)):_.default.nextTick(Td,r)}),this)}function Z1(e,t){h0(e,t),Td(e)}function Td(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function OU(){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)}function h0(e,t){e.emit("error",t)}function AU(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}Y1.exports={destroy:IU,undestroy:OU,errorOrDestroy:AU}});var hs=R((jQ,J1)=>{"use strict";p();function TU(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var X1={};function Vi(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){TU(a,o);function a(s,u,c){return o.call(this,i(s,u,c))||this}return a})(r);n.prototype.name=r.name,n.prototype.code=e,X1[e]=n}function $1(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function PU(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function RU(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function kU(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Vi("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Vi("ERR_INVALID_ARG_TYPE",function(e,t,r){var i;typeof t=="string"&&PU(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(RU(e," argument"))n="The ".concat(e," ").concat(i," ").concat($1(t,"type"));else{var o=kU(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat($1(t,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);Vi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Vi("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Vi("ERR_STREAM_PREMATURE_CLOSE","Premature close");Vi("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Vi("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Vi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Vi("ERR_STREAM_WRITE_AFTER_END","write after end");Vi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Vi("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Vi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");J1.exports.codes=X1});var p0=R((KQ,Q1)=>{"use strict";p();var BU=hs().codes.ERR_INVALID_OPT_VALUE;function NU(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function CU(e,t,r,i){var n=NU(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new BU(o,n)}return Math.floor(n)}return e.objectMode?16:16*1024}Q1.exports={getHighWaterMark:CU}});var m0=R((GQ,eI)=>{p();eI.exports=LU;function LU(e,t){if(g0("noDeprecation"))return e;var r=!1;function i(){if(!r){if(g0("throwDeprecation"))throw new Error(t);g0("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return i}function g0(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}});var b0=R((ZQ,aI)=>{"use strict";p();aI.exports=Mt;function rI(e){var t=this;this.next=null,this.entry=null,this.finish=function(){uH(t,e)}}var Lu;Mt.WritableState=Ef;var MU={deprecate:m0()},iI=Bv(),Rd=Lt().Buffer,DU=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function qU(e){return Rd.from(e)}function FU(e){return Rd.isBuffer(e)||e instanceof DU}var y0=d0(),UU=p0(),HU=UU.getHighWaterMark,ha=hs().codes,jU=ha.ERR_INVALID_ARG_TYPE,zU=ha.ERR_METHOD_NOT_IMPLEMENTED,KU=ha.ERR_MULTIPLE_CALLBACK,VU=ha.ERR_STREAM_CANNOT_PIPE,GU=ha.ERR_STREAM_DESTROYED,WU=ha.ERR_STREAM_NULL_VALUES,ZU=ha.ERR_STREAM_WRITE_AFTER_END,YU=ha.ERR_UNKNOWN_ENCODING,Mu=y0.errorOrDestroy;dt()(Mt,iI);function $U(){}function Ef(e,t,r){Lu=Lu||ds(),e=e||{},typeof r!="boolean"&&(r=t instanceof Lu),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=HU(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){iH(t,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new rI(this)}Ef.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Ef.prototype,"buffer",{get:MU.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Pd;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Pd=Function.prototype[Symbol.hasInstance],Object.defineProperty(Mt,Symbol.hasInstance,{value:function(t){return Pd.call(this,t)?!0:this!==Mt?!1:t&&t._writableState instanceof Ef}})):Pd=function(t){return t instanceof this};function Mt(e){Lu=Lu||ds();var t=this instanceof Lu;if(!t&&!Pd.call(Mt,this))return new Mt(e);this._writableState=new Ef(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),iI.call(this)}Mt.prototype.pipe=function(){Mu(this,new VU)};function XU(e,t){var r=new ZU;Mu(e,r),_.default.nextTick(t,r)}function JU(e,t,r,i){var n;return r===null?n=new WU:typeof r!="string"&&!t.objectMode&&(n=new jU("chunk",["string","Buffer"],r)),n?(Mu(e,n),_.default.nextTick(i,n),!1):!0}Mt.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&FU(e);return o&&!Rd.isBuffer(e)&&(e=qU(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=$U),i.ending?XU(this,r):(o||JU(this,i,e,r))&&(i.pendingcb++,n=eH(this,i,o,e,t,r)),n};Mt.prototype.cork=function(){this._writableState.corked++};Mt.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&nI(this,e))};Mt.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new YU(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(Mt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function QU(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Rd.from(t,r)),t}Object.defineProperty(Mt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function eH(e,t,r,i,n,o){if(!r){var a=QU(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v0(e,t,!1,s,i,n,o);return u}function v0(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new GU("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function tH(e,t,r,i,n){--t.pendingcb,r?(_.default.nextTick(n,i),_.default.nextTick(wf,e,t),e._writableState.errorEmitted=!0,Mu(e,i)):(n(i),e._writableState.errorEmitted=!0,Mu(e,i),wf(e,t))}function rH(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function iH(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new KU;if(rH(r),t)tH(e,r,i,t,n);else{var o=oI(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&nI(e,r),i?_.default.nextTick(tI,e,r,o,n):tI(e,r,o,n)}}function tI(e,t,r,i){r||nH(e,t),t.pendingcb--,i(),wf(e,t)}function nH(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function nI(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,v0(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new rI(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback,d=t.objectMode?1:u.length;if(v0(e,t,!1,d,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Mt.prototype._write=function(e,t,r){r(new zU("_write()"))};Mt.prototype._writev=null;Mt.prototype.end=function(e,t,r){var i=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||sH(this,i,r),this};Object.defineProperty(Mt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function oI(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function oH(e,t){e._final(function(r){t.pendingcb--,r&&Mu(e,r),t.prefinished=!0,e.emit("prefinish"),wf(e,t)})}function aH(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,_.default.nextTick(oH,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function wf(e,t){var r=oI(t);if(r&&(aH(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}function sH(e,t,r){t.ending=!0,wf(e,t),r&&(t.finished?_.default.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function uH(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(Mt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});Mt.prototype.destroy=y0.destroy;Mt.prototype._undestroy=y0.undestroy;Mt.prototype._destroy=function(e,t){t(e)}});var ds=R(($Q,uI)=>{"use strict";p();var cH=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};uI.exports=jn;var sI=w0(),S0=b0();dt()(jn,sI);for(_0=cH(S0.prototype),kd=0;kd<_0.length;kd++)Bd=_0[kd],jn.prototype[Bd]||(jn.prototype[Bd]=S0.prototype[Bd]);var _0,Bd,kd;function jn(e){if(!(this instanceof jn))return new jn(e);sI.call(this,e),S0.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",fH)))}Object.defineProperty(jn.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(jn.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(jn.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fH(){this._writableState.ended||_.default.nextTick(lH,this)}function lH(e){e.end()}Object.defineProperty(jn.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var lI=R((E0,fI)=>{p();var Nd=Lt(),To=Nd.Buffer;function cI(e,t){for(var r in e)t[r]=e[r]}To.from&&To.alloc&&To.allocUnsafe&&To.allocUnsafeSlow?fI.exports=Nd:(cI(Nd,E0),E0.Buffer=Du);function Du(e,t,r){return To(e,t,r)}cI(To,Du);Du.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return To(e,t,r)};Du.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=To(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Du.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return To(e)};Du.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Nd.SlowBuffer(e)}});var qu=R(dI=>{"use strict";p();var I0=lI().Buffer,hI=I0.isEncoding||function(e){switch(e=""+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}};function hH(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}}function dH(e){var t=hH(e);if(typeof t!="string"&&(I0.isEncoding===hI||!hI(e)))throw new Error("Unknown encoding: "+e);return t||e}dI.StringDecoder=xf;function xf(e){this.encoding=dH(e);var t;switch(this.encoding){case"utf16le":this.text=bH,this.end=_H,t=4;break;case"utf8":this.fillLast=mH,t=4;break;case"base64":this.text=SH,this.end=wH,t=3;break;default:this.write=EH,this.end=xH;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=I0.allocUnsafe(t)}xf.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};xf.prototype.end=yH;xf.prototype.text=vH;xf.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};function x0(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pH(e,t,r){var i=t.length-1;if(i<r)return 0;var n=x0(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=x0(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=x0(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function gH(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function mH(e){var t=this.lastTotal-this.lastNeed,r=gH(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function vH(e,t){var r=pH(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function yH(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function bH(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function _H(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function SH(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?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-r))}function wH(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function EH(e){return e.toString(this.encoding)}function xH(e){return e&&e.length?this.write(e):""}});var Cd=R((tee,mI)=>{"use strict";p();var pI=hs().codes.ERR_STREAM_PREMATURE_CLOSE;function IH(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}function OH(){}function AH(e){return e.setHeader&&typeof e.abort=="function"}function gI(e,t,r){if(typeof t=="function")return gI(e,null,t);t||(t={}),r=IH(r||OH);var i=t.readable||t.readable!==!1&&e.readable,n=t.writable||t.writable!==!1&&e.writable,o=function(){e.writable||s()},a=e._writableState&&e._writableState.finished,s=function(){n=!1,a=!0,i||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){i=!1,u=!0,n||r.call(e)},f=function(w){r.call(e,w)},d=function(){var w;if(i&&!u)return(!e._readableState||!e._readableState.ended)&&(w=new pI),r.call(e,w);if(n&&!a)return(!e._writableState||!e._writableState.ended)&&(w=new pI),r.call(e,w)},m=function(){e.req.on("finish",s)};return AH(e)?(e.on("complete",s),e.on("abort",d),e.req?m():e.on("request",m)):n&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",f),e.on("close",d),function(){e.removeListener("complete",s),e.removeListener("abort",d),e.removeListener("request",m),e.req&&e.req.removeListener("finish",s),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",f),e.removeListener("close",d)}}mI.exports=gI});var yI=R((iee,vI)=>{"use strict";p();var Ld;function da(e,t,r){return t=TH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TH(e){var t=PH(e,"string");return typeof t=="symbol"?t:String(t)}function PH(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var RH=Cd(),pa=Symbol("lastResolve"),ps=Symbol("lastReject"),If=Symbol("error"),Md=Symbol("ended"),gs=Symbol("lastPromise"),O0=Symbol("handlePromise"),ms=Symbol("stream");function ga(e,t){return{value:e,done:t}}function kH(e){var t=e[pa];if(t!==null){var r=e[ms].read();r!==null&&(e[gs]=null,e[pa]=null,e[ps]=null,t(ga(r,!1)))}}function BH(e){_.default.nextTick(kH,e)}function NH(e,t){return function(r,i){e.then(function(){if(t[Md]){r(ga(void 0,!0));return}t[O0](r,i)},i)}}var CH=Object.getPrototypeOf(function(){}),LH=Object.setPrototypeOf((Ld={get stream(){return this[ms]},next:function(){var t=this,r=this[If];if(r!==null)return Promise.reject(r);if(this[Md])return Promise.resolve(ga(void 0,!0));if(this[ms].destroyed)return new Promise(function(a,s){_.default.nextTick(function(){t[If]?s(t[If]):a(ga(void 0,!0))})});var i=this[gs],n;if(i)n=new Promise(NH(i,this));else{var o=this[ms].read();if(o!==null)return Promise.resolve(ga(o,!1));n=new Promise(this[O0])}return this[gs]=n,n}},da(Ld,Symbol.asyncIterator,function(){return this}),da(Ld,"return",function(){var t=this;return new Promise(function(r,i){t[ms].destroy(null,function(n){if(n){i(n);return}r(ga(void 0,!0))})})}),Ld),CH),MH=function(t){var r,i=Object.create(LH,(r={},da(r,ms,{value:t,writable:!0}),da(r,pa,{value:null,writable:!0}),da(r,ps,{value:null,writable:!0}),da(r,If,{value:null,writable:!0}),da(r,Md,{value:t._readableState.endEmitted,writable:!0}),da(r,O0,{value:function(o,a){var s=i[ms].read();s?(i[gs]=null,i[pa]=null,i[ps]=null,o(ga(s,!1))):(i[pa]=o,i[ps]=a)},writable:!0}),r));return i[gs]=null,RH(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[ps];o!==null&&(i[gs]=null,i[pa]=null,i[ps]=null,o(n)),i[If]=n;return}var a=i[pa];a!==null&&(i[gs]=null,i[pa]=null,i[ps]=null,a(ga(void 0,!0))),i[Md]=!0}),t.on("readable",BH.bind(null,i)),i};vI.exports=MH});var _I=R((oee,bI)=>{p();bI.exports=function(){throw new Error("Readable.from is not available in the browser")}});var w0=R((uee,RI)=>{"use strict";p();RI.exports=Qe;var Fu;Qe.ReadableState=xI;var see=Iu().EventEmitter,EI=function(t,r){return t.listeners(r).length},Af=Bv(),Dd=Lt().Buffer,DH=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function qH(e){return Dd.from(e)}function FH(e){return Dd.isBuffer(e)||e instanceof DH}var A0=Ki(),Le;A0&&A0.debuglog?Le=A0.debuglog("stream"):Le=function(){};var UH=W1(),C0=d0(),HH=p0(),jH=HH.getHighWaterMark,qd=hs().codes,zH=qd.ERR_INVALID_ARG_TYPE,KH=qd.ERR_STREAM_PUSH_AFTER_EOF,VH=qd.ERR_METHOD_NOT_IMPLEMENTED,GH=qd.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Uu,T0,P0;dt()(Qe,Af);var Of=C0.errorOrDestroy,R0=["error","close","destroy","pause","resume"];function WH(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function xI(e,t,r){Fu=Fu||ds(),e=e||{},typeof r!="boolean"&&(r=t instanceof Fu),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=jH(this,e,"readableHighWaterMark",r),this.buffer=new UH,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=e.emitClose!==!1,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&&(Uu||(Uu=qu().StringDecoder),this.decoder=new Uu(e.encoding),this.encoding=e.encoding)}function Qe(e){if(Fu=Fu||ds(),!(this instanceof Qe))return new Qe(e);var t=this instanceof Fu;this._readableState=new xI(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Af.call(this)}Object.defineProperty(Qe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Qe.prototype.destroy=C0.destroy;Qe.prototype._undestroy=C0.undestroy;Qe.prototype._destroy=function(e,t){t(e)};Qe.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Dd.from(e,t),t=""),i=!0),II(this,e,t,!1,i)};Qe.prototype.unshift=function(e){return II(this,e,null,!0,!1)};function II(e,t,r,i,n){Le("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,$H(e,o);else{var a;if(n||(a=ZH(o,t)),a)Of(e,a);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Dd.prototype&&(t=qH(t)),i)o.endEmitted?Of(e,new GH):k0(e,o,t,!0);else if(o.ended)Of(e,new KH);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?k0(e,o,t,!1):N0(e,o)):k0(e,o,t,!1)}else i||(o.reading=!1,N0(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function k0(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Fd(e)),N0(e,t)}function ZH(e,t){var r;return!FH(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new zH("chunk",["string","Buffer","Uint8Array"],t)),r}Qe.prototype.isPaused=function(){return this._readableState.flowing===!1};Qe.prototype.setEncoding=function(e){Uu||(Uu=qu().StringDecoder);var t=new Uu(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var SI=1073741824;function YH(e){return e>=SI?e=SI:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function wI(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=YH(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Qe.prototype.read=function(e){Le("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return Le("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?B0(this):Fd(this),null;if(e=wI(e,t),e===0&&t.ended)return t.length===0&&B0(this),null;var i=t.needReadable;Le("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,Le("length less than watermark",i)),t.ended||t.reading?(i=!1,Le("reading or ended",i)):i&&(Le("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=wI(r,t)));var n;return e>0?n=TI(e,t):n=null,n===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B0(this)),n!==null&&this.emit("data",n),n};function $H(e,t){if(Le("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Fd(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,OI(e)))}}function Fd(e){var t=e._readableState;Le("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(Le("emitReadable",t.flowing),t.emittedReadable=!0,_.default.nextTick(OI,e))}function OI(e){var t=e._readableState;Le("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,L0(e)}function N0(e,t){t.readingMore||(t.readingMore=!0,_.default.nextTick(XH,e,t))}function XH(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(Le("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Qe.prototype._read=function(e){Of(this,new VH("_read()"))};Qe.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,Le("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==_.default.stdout&&e!==_.default.stderr,o=n?s:T;i.endEmitted?_.default.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(B,C){Le("onunpipe"),B===r&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,f())}function s(){Le("onend"),e.end()}var u=JH(r);e.on("drain",u);var c=!1;function f(){Le("cleanup"),e.removeListener("close",y),e.removeListener("finish",w),e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",T),r.removeListener("data",d),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",d);function d(B){Le("ondata");var C=e.write(B);Le("dest.write",C),C===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&PI(i.pipes,e)!==-1)&&!c&&(Le("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function m(B){Le("onerror",B),T(),e.removeListener("error",m),EI(e,"error")===0&&Of(e,B)}WH(e,"error",m);function y(){e.removeListener("finish",w),T()}e.once("close",y);function w(){Le("onfinish"),e.removeListener("close",y),T()}e.once("finish",w);function T(){Le("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(Le("pipe resume"),r.resume()),e};function JH(e){return function(){var r=e._readableState;Le("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&EI(e,"data")&&(r.flowing=!0,L0(e))}}Qe.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=PI(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Qe.prototype.on=function(e,t){var r=Af.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,Le("on readable",i.length,i.reading),i.length?Fd(this):i.reading||_.default.nextTick(QH,this)),r};Qe.prototype.addListener=Qe.prototype.on;Qe.prototype.removeListener=function(e,t){var r=Af.prototype.removeListener.call(this,e,t);return e==="readable"&&_.default.nextTick(AI,this),r};Qe.prototype.removeAllListeners=function(e){var t=Af.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&_.default.nextTick(AI,this),t};function AI(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 QH(e){Le("readable nexttick read 0"),e.read(0)}Qe.prototype.resume=function(){var e=this._readableState;return e.flowing||(Le("resume"),e.flowing=!e.readableListening,e8(this,e)),e.paused=!1,this};function e8(e,t){t.resumeScheduled||(t.resumeScheduled=!0,_.default.nextTick(t8,e,t))}function t8(e,t){Le("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L0(e),t.flowing&&!t.reading&&e.read(0)}Qe.prototype.pause=function(){return Le("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Le("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function L0(e){var t=e._readableState;for(Le("flow",t.flowing);t.flowing&&e.read()!==null;);}Qe.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(Le("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(Le("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(s){return function(){return e[s].apply(e,arguments)}})(n));for(var o=0;o<R0.length;o++)e.on(R0[o],this.emit.bind(this,R0[o]));return this._read=function(a){Le("wrapped _read",a),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(Qe.prototype[Symbol.asyncIterator]=function(){return T0===void 0&&(T0=yI()),T0(this)});Object.defineProperty(Qe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Qe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Qe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Qe._fromList=TI;Object.defineProperty(Qe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function TI(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function B0(e){var t=e._readableState;Le("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,_.default.nextTick(r8,t,e))}function r8(e,t){if(Le("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Qe.from=function(e,t){return P0===void 0&&(P0=_I()),P0(Qe,e,t)});function PI(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var M0=R((fee,BI)=>{"use strict";p();BI.exports=Po;var Ud=hs().codes,i8=Ud.ERR_METHOD_NOT_IMPLEMENTED,n8=Ud.ERR_MULTIPLE_CALLBACK,o8=Ud.ERR_TRANSFORM_ALREADY_TRANSFORMING,a8=Ud.ERR_TRANSFORM_WITH_LENGTH_0,Hd=ds();dt()(Po,Hd);function s8(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new n8);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Po(e){if(!(this instanceof Po))return new Po(e);Hd.call(this,e),this._transformState={afterTransform:s8.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",u8)}function u8(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){kI(e,t,r)}):kI(this,null,null)}Po.prototype.push=function(e,t){return this._transformState.needTransform=!1,Hd.prototype.push.call(this,e,t)};Po.prototype._transform=function(e,t,r){r(new i8("_transform()"))};Po.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Po.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Po.prototype._destroy=function(e,t){Hd.prototype._destroy.call(this,e,function(r){t(r)})};function kI(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new a8;if(e._transformState.transforming)throw new o8;return e.push(null)}});var LI=R((hee,CI)=>{"use strict";p();CI.exports=Tf;var NI=M0();dt()(Tf,NI);function Tf(e){if(!(this instanceof Tf))return new Tf(e);NI.call(this,e)}Tf.prototype._transform=function(e,t,r){r(null,e)}});var UI=R((pee,FI)=>{"use strict";p();var D0;function c8(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var qI=hs().codes,f8=qI.ERR_MISSING_ARGS,l8=qI.ERR_STREAM_DESTROYED;function MI(e){if(e)throw e}function h8(e){return e.setHeader&&typeof e.abort=="function"}function d8(e,t,r,i){i=c8(i);var n=!1;e.on("close",function(){n=!0}),D0===void 0&&(D0=Cd()),D0(e,{readable:t,writable:r},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,h8(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(a||new l8("pipe"))}}}function DI(e){e()}function p8(e,t){return e.pipe(t)}function g8(e){return!e.length||typeof e[e.length-1]!="function"?MI:e.pop()}function m8(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=g8(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new f8("streams");var n,o=t.map(function(a,s){var u=s<t.length-1,c=s>0;return d8(a,u,c,function(f){n||(n=f),f&&o.forEach(DI),!u&&(o.forEach(DI),i(n))})});return t.reduce(p8)}FI.exports=m8});var jd=R((mee,HI)=>{p();HI.exports=Gi;var q0=Iu().EventEmitter,v8=dt();v8(Gi,q0);Gi.Readable=w0();Gi.Writable=b0();Gi.Duplex=ds();Gi.Transform=M0();Gi.PassThrough=LI();Gi.finished=Cd();Gi.pipeline=UI();Gi.Stream=Gi;function Gi(){q0.call(this)}Gi.prototype.pipe=function(e,t){var r=this;function i(f){e.writable&&e.write(f)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}e.on("drain",n),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function u(f){if(c(),q0.listenerCount(this,"error")===0)throw f}r.on("error",u),e.on("error",u);function c(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}});var KI=R((yee,zI)=>{"use strict";p();var zn=jr().Buffer,jI=jd().Transform,y8=dt();function ma(e){jI.call(this),this._block=zn.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}y8(ma,jI);ma.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)};ma.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};var b8=typeof Uint8Array<"u",_8=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(zn.prototype instanceof Uint8Array||zn.TYPED_ARRAY_SUPPORT);function S8(e,t){if(e instanceof zn)return e;if(typeof e=="string")return zn.from(e,t);if(_8&&ArrayBuffer.isView(e)){if(e.byteLength===0)return zn.alloc(0);var r=zn.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}if(b8&&e instanceof Uint8Array||zn.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return zn.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}ma.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");e=S8(e,t);for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,a=e.length*8;a>0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this};ma.prototype._update=function(){throw new Error("_update is not implemented")};ma.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};ma.prototype._digest=function(){throw new Error("_digest is not implemented")};zI.exports=ma});var F0=R((_ee,GI)=>{"use strict";p();var w8=dt(),VI=KI(),E8=jr().Buffer,x8=new Array(16);function zd(){VI.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}w8(zd,VI);zd.prototype._update=function(){for(var e=x8,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,i=this._b,n=this._c,o=this._d;r=$r(r,i,n,o,e[0],3614090360,7),o=$r(o,r,i,n,e[1],3905402710,12),n=$r(n,o,r,i,e[2],606105819,17),i=$r(i,n,o,r,e[3],3250441966,22),r=$r(r,i,n,o,e[4],4118548399,7),o=$r(o,r,i,n,e[5],1200080426,12),n=$r(n,o,r,i,e[6],2821735955,17),i=$r(i,n,o,r,e[7],4249261313,22),r=$r(r,i,n,o,e[8],1770035416,7),o=$r(o,r,i,n,e[9],2336552879,12),n=$r(n,o,r,i,e[10],4294925233,17),i=$r(i,n,o,r,e[11],2304563134,22),r=$r(r,i,n,o,e[12],1804603682,7),o=$r(o,r,i,n,e[13],4254626195,12),n=$r(n,o,r,i,e[14],2792965006,17),i=$r(i,n,o,r,e[15],1236535329,22),r=Xr(r,i,n,o,e[1],4129170786,5),o=Xr(o,r,i,n,e[6],3225465664,9),n=Xr(n,o,r,i,e[11],643717713,14),i=Xr(i,n,o,r,e[0],3921069994,20),r=Xr(r,i,n,o,e[5],3593408605,5),o=Xr(o,r,i,n,e[10],38016083,9),n=Xr(n,o,r,i,e[15],3634488961,14),i=Xr(i,n,o,r,e[4],3889429448,20),r=Xr(r,i,n,o,e[9],568446438,5),o=Xr(o,r,i,n,e[14],3275163606,9),n=Xr(n,o,r,i,e[3],4107603335,14),i=Xr(i,n,o,r,e[8],1163531501,20),r=Xr(r,i,n,o,e[13],2850285829,5),o=Xr(o,r,i,n,e[2],4243563512,9),n=Xr(n,o,r,i,e[7],1735328473,14),i=Xr(i,n,o,r,e[12],2368359562,20),r=Jr(r,i,n,o,e[5],4294588738,4),o=Jr(o,r,i,n,e[8],2272392833,11),n=Jr(n,o,r,i,e[11],1839030562,16),i=Jr(i,n,o,r,e[14],4259657740,23),r=Jr(r,i,n,o,e[1],2763975236,4),o=Jr(o,r,i,n,e[4],1272893353,11),n=Jr(n,o,r,i,e[7],4139469664,16),i=Jr(i,n,o,r,e[10],3200236656,23),r=Jr(r,i,n,o,e[13],681279174,4),o=Jr(o,r,i,n,e[0],3936430074,11),n=Jr(n,o,r,i,e[3],3572445317,16),i=Jr(i,n,o,r,e[6],76029189,23),r=Jr(r,i,n,o,e[9],3654602809,4),o=Jr(o,r,i,n,e[12],3873151461,11),n=Jr(n,o,r,i,e[15],530742520,16),i=Jr(i,n,o,r,e[2],3299628645,23),r=Qr(r,i,n,o,e[0],4096336452,6),o=Qr(o,r,i,n,e[7],1126891415,10),n=Qr(n,o,r,i,e[14],2878612391,15),i=Qr(i,n,o,r,e[5],4237533241,21),r=Qr(r,i,n,o,e[12],1700485571,6),o=Qr(o,r,i,n,e[3],2399980690,10),n=Qr(n,o,r,i,e[10],4293915773,15),i=Qr(i,n,o,r,e[1],2240044497,21),r=Qr(r,i,n,o,e[8],1873313359,6),o=Qr(o,r,i,n,e[15],4264355552,10),n=Qr(n,o,r,i,e[6],2734768916,15),i=Qr(i,n,o,r,e[13],1309151649,21),r=Qr(r,i,n,o,e[4],4149444226,6),o=Qr(o,r,i,n,e[11],3174756917,10),n=Qr(n,o,r,i,e[2],718787259,15),i=Qr(i,n,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0};zd.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=E8.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function Kd(e,t){return e<<t|e>>>32-t}function $r(e,t,r,i,n,o,a){return Kd(e+(t&r|~t&i)+n+o|0,a)+t|0}function Xr(e,t,r,i,n,o,a){return Kd(e+(t&i|r&~i)+n+o|0,a)+t|0}function Jr(e,t,r,i,n,o,a){return Kd(e+(t^r^i)+n+o|0,a)+t|0}function Qr(e,t,r,i,n,o,a){return Kd(e+(r^(t|~i))+n+o|0,a)+t|0}GI.exports=zd});var ZI=R((wee,WI)=>{p();var I8={}.toString;WI.exports=Array.isArray||function(e){return I8.call(e)=="[object Array]"}});var $I=R((xee,YI)=>{"use strict";p();var O8=ss(),A8=fa(),T8=A8("TypedArray.prototype.buffer",!0),P8=i0();YI.exports=T8||function(t){if(!P8(t))throw new O8("Not a Typed Array");return t.buffer}});var Vd=R((Oee,JI)=>{"use strict";p();var dn=jr().Buffer,R8=ZI(),k8=$I(),B8=ArrayBuffer.isView||function(t){try{return k8(t),!0}catch{return!1}},N8=typeof Uint8Array<"u",XI=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",C8=XI&&(dn.prototype instanceof Uint8Array||dn.TYPED_ARRAY_SUPPORT);JI.exports=function(t,r){if(dn.isBuffer(t))return t.constructor&&!("isBuffer"in t)?dn.from(t):t;if(typeof t=="string")return dn.from(t,r);if(XI&&B8(t)){if(t.byteLength===0)return dn.alloc(0);if(C8){var i=dn.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}var n=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=dn.from(n);if(o.length===t.byteLength)return o}if(N8&&t instanceof Uint8Array)return dn.from(t);var a=R8(t);if(a)for(var s=0;s<t.length;s+=1){var u=t[s];if(typeof u!="number"||u<0||u>255||~~u!==u)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||dn.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return dn.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var rO=R((Tee,tO)=>{"use strict";p();var L8=jr().Buffer,M8=Vd(),eO=typeof Uint8Array<"u",D8=eO&&typeof ArrayBuffer<"u",QI=D8&&ArrayBuffer.isView;tO.exports=function(e,t){if(typeof e=="string"||L8.isBuffer(e)||eO&&e instanceof Uint8Array||QI&&QI(e))return M8(e,t);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')}});var Pf=R((Ree,U0)=>{"use strict";p();typeof _.default>"u"||!_.default.version||_.default.version.indexOf("v0.")===0||_.default.version.indexOf("v1.")===0&&_.default.version.indexOf("v1.8.")!==0?U0.exports={nextTick:q8}:U0.exports=_.default;function q8(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,a;switch(n){case 0:case 1:return _.default.nextTick(e);case 2:return _.default.nextTick(function(){e.call(null,t)});case 3:return _.default.nextTick(function(){e.call(null,t,r)});case 4:return _.default.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),a=0;a<o.length;)o[a++]=arguments[a];return _.default.nextTick(function(){e.apply(null,o)})}}});var nO=R((Bee,iO)=>{p();var F8={}.toString;iO.exports=Array.isArray||function(e){return F8.call(e)=="[object Array]"}});var H0=R((Cee,oO)=>{p();oO.exports=Iu().EventEmitter});var Wd=R((j0,sO)=>{p();var Gd=Lt(),Ro=Gd.Buffer;function aO(e,t){for(var r in e)t[r]=e[r]}Ro.from&&Ro.alloc&&Ro.allocUnsafe&&Ro.allocUnsafeSlow?sO.exports=Gd:(aO(Gd,j0),j0.Buffer=Hu);function Hu(e,t,r){return Ro(e,t,r)}aO(Ro,Hu);Hu.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Ro(e,t,r)};Hu.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=Ro(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Hu.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ro(e)};Hu.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Gd.SlowBuffer(e)}});var ju=R(ei=>{p();function U8(e){return Array.isArray?Array.isArray(e):Zd(e)==="[object Array]"}ei.isArray=U8;function H8(e){return typeof e=="boolean"}ei.isBoolean=H8;function j8(e){return e===null}ei.isNull=j8;function z8(e){return e==null}ei.isNullOrUndefined=z8;function K8(e){return typeof e=="number"}ei.isNumber=K8;function V8(e){return typeof e=="string"}ei.isString=V8;function G8(e){return typeof e=="symbol"}ei.isSymbol=G8;function W8(e){return e===void 0}ei.isUndefined=W8;function Z8(e){return Zd(e)==="[object RegExp]"}ei.isRegExp=Z8;function Y8(e){return typeof e=="object"&&e!==null}ei.isObject=Y8;function $8(e){return Zd(e)==="[object Date]"}ei.isDate=$8;function X8(e){return Zd(e)==="[object Error]"||e instanceof Error}ei.isError=X8;function J8(e){return typeof e=="function"}ei.isFunction=J8;function Q8(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}ei.isPrimitive=Q8;ei.isBuffer=Lt().Buffer.isBuffer;function Zd(e){return Object.prototype.toString.call(e)}});var cO=R((Fee,z0)=>{"use strict";p();function e4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var uO=Wd().Buffer,Rf=Ki();function t4(e,t,r){e.copy(t,r)}z0.exports=(function(){function e(){e4(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return uO.alloc(0);for(var i=uO.allocUnsafe(r>>>0),n=this.head,o=0;n;)t4(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();Rf&&Rf.inspect&&Rf.inspect.custom&&(z0.exports.prototype[Rf.inspect.custom]=function(){var e=Rf.inspect({length:this.length});return this.constructor.name+" "+e})});var K0=R((Hee,fO)=>{"use strict";p();var Yd=Pf();function r4(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Yd.nextTick($d,this,e)):Yd.nextTick($d,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Yd.nextTick($d,r,o)):Yd.nextTick($d,r,o):t&&t(o)}),this)}function i4(){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)}function $d(e,t){e.emit("error",t)}fO.exports={destroy:r4,undestroy:i4}});var G0=R((zee,yO)=>{"use strict";p();var vs=Pf();yO.exports=dr;function hO(e){var t=this;this.next=null,this.entry=null,this.finish=function(){S4(t,e)}}var n4=!_.default.browser&&["v0.10","v0.9."].indexOf(_.default.version.slice(0,5))>-1?setImmediate:vs.nextTick,zu;dr.WritableState=Bf;var dO=Object.create(ju());dO.inherits=dt();var o4={deprecate:m0()},pO=H0(),Jd=Wd().Buffer,a4=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s4(e){return Jd.from(e)}function u4(e){return Jd.isBuffer(e)||e instanceof a4}var gO=K0();dO.inherits(dr,pO);function c4(){}function Bf(e,t){zu=zu||ys(),e=e||{};var r=t instanceof zu;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){m4(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new hO(this)}Bf.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Bf.prototype,"buffer",{get:o4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Xd;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Xd=Function.prototype[Symbol.hasInstance],Object.defineProperty(dr,Symbol.hasInstance,{value:function(e){return Xd.call(this,e)?!0:this!==dr?!1:e&&e._writableState instanceof Bf}})):Xd=function(e){return e instanceof this};function dr(e){if(zu=zu||ys(),!Xd.call(dr,this)&&!(this instanceof zu))return new dr(e);this._writableState=new Bf(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),pO.call(this)}dr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function f4(e,t){var r=new Error("write after end");e.emit("error",r),vs.nextTick(t,r)}function l4(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),vs.nextTick(i,o),n=!1),n}dr.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&u4(e);return o&&!Jd.isBuffer(e)&&(e=s4(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=c4),i.ended?f4(this,r):(o||l4(this,i,e,r))&&(i.pendingcb++,n=d4(this,i,o,e,t,r)),n};dr.prototype.cork=function(){var e=this._writableState;e.corked++};dr.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&mO(this,e))};dr.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function h4(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Jd.from(t,r)),t}Object.defineProperty(dr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function d4(e,t,r,i,n,o){if(!r){var a=h4(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else V0(e,t,!1,s,i,n,o);return u}function V0(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function p4(e,t,r,i,n){--t.pendingcb,r?(vs.nextTick(n,i),vs.nextTick(kf,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),kf(e,t))}function g4(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function m4(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(g4(r),t)p4(e,r,i,t,n);else{var o=vO(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&mO(e,r),i?n4(lO,e,r,o,n):lO(e,r,o,n)}}function lO(e,t,r,i){r||v4(e,t),t.pendingcb--,i(),kf(e,t)}function v4(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function mO(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,V0(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new hO(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback,d=t.objectMode?1:u.length;if(V0(e,t,!1,d,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}dr.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};dr.prototype._writev=null;dr.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||_4(this,i,r)};function vO(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function y4(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),kf(e,t)})}function b4(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,vs.nextTick(y4,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function kf(e,t){var r=vO(t);return r&&(b4(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function _4(e,t,r){t.ending=!0,kf(e,t),r&&(t.finished?vs.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function S4(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(dr.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});dr.prototype.destroy=gO.destroy;dr.prototype._undestroy=gO.undestroy;dr.prototype._destroy=function(e,t){this.end(),t(e)}});var ys=R((Vee,wO)=>{"use strict";p();var bO=Pf(),w4=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};wO.exports=ko;var _O=Object.create(ju());_O.inherits=dt();var SO=Y0(),Z0=G0();_O.inherits(ko,SO);for(W0=w4(Z0.prototype),Qd=0;Qd<W0.length;Qd++)ep=W0[Qd],ko.prototype[ep]||(ko.prototype[ep]=Z0.prototype[ep]);var W0,ep,Qd;function ko(e){if(!(this instanceof ko))return new ko(e);SO.call(this,e),Z0.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",E4)}Object.defineProperty(ko.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function E4(){this.allowHalfOpen||this._writableState.ended||bO.nextTick(x4,this)}function x4(e){e.end()}Object.defineProperty(ko.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});ko.prototype._destroy=function(e,t){this.push(null),this.end(),bO.nextTick(t,e)}});var Y0=R((Zee,CO)=>{"use strict";p();var Vu=Pf();CO.exports=St;var I4=nO(),Nf;St.ReadableState=PO;var Wee=Iu().EventEmitter,OO=function(e,t){return e.listeners(t).length},ey=H0(),Cf=Wd().Buffer,O4=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function A4(e){return Cf.from(e)}function T4(e){return Cf.isBuffer(e)||e instanceof O4}var AO=Object.create(ju());AO.inherits=dt();var $0=Ki(),nt=void 0;$0&&$0.debuglog?nt=$0.debuglog("stream"):nt=function(){};var P4=cO(),TO=K0(),Ku;AO.inherits(St,ey);var X0=["error","close","destroy","pause","resume"];function R4(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):I4(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function PO(e,t){Nf=Nf||ys(),e=e||{};var r=t instanceof Nf;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new P4,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Ku||(Ku=qu().StringDecoder),this.decoder=new Ku(e.encoding),this.encoding=e.encoding)}function St(e){if(Nf=Nf||ys(),!(this instanceof St))return new St(e);this._readableState=new PO(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),ey.call(this)}Object.defineProperty(St.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});St.prototype.destroy=TO.destroy;St.prototype._undestroy=TO.undestroy;St.prototype._destroy=function(e,t){this.push(null),t(e)};St.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Cf.from(e,t),t=""),i=!0),RO(this,e,t,!1,i)};St.prototype.unshift=function(e){return RO(this,e,null,!0,!1)};function RO(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,C4(e,o);else{var a;n||(a=k4(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Cf.prototype&&(t=A4(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):J0(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?J0(e,o,t,!1):kO(e,o)):J0(e,o,t,!1))):i||(o.reading=!1)}return B4(o)}function J0(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&tp(e)),kO(e,t)}function k4(e,t){var r;return!T4(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function B4(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}St.prototype.isPaused=function(){return this._readableState.flowing===!1};St.prototype.setEncoding=function(e){return Ku||(Ku=qu().StringDecoder),this._readableState.decoder=new Ku(e),this._readableState.encoding=e,this};var EO=8388608;function N4(e){return e>=EO?e=EO:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function xO(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=N4(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}St.prototype.read=function(e){nt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Q0(this):tp(this),null;if(e=xO(e,t),e===0&&t.ended)return t.length===0&&Q0(this),null;var i=t.needReadable;nt("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,nt("length less than watermark",i)),t.ended||t.reading?(i=!1,nt("reading or ended",i)):i&&(nt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=xO(r,t)));var n;return e>0?n=BO(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Q0(this)),n!==null&&this.emit("data",n),n};function C4(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,tp(e)}}function tp(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Vu.nextTick(IO,e):IO(e))}function IO(e){nt("emit readable"),e.emit("readable"),ty(e)}function kO(e,t){t.readingMore||(t.readingMore=!0,Vu.nextTick(L4,e,t))}function L4(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(nt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}St.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};St.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,nt("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==_.default.stdout&&e!==_.default.stderr,o=n?s:B;i.endEmitted?Vu.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(C,q){nt("onunpipe"),C===r&&q&&q.hasUnpiped===!1&&(q.hasUnpiped=!0,f())}function s(){nt("onend"),e.end()}var u=M4(r);e.on("drain",u);var c=!1;function f(){nt("cleanup"),e.removeListener("close",w),e.removeListener("finish",T),e.removeListener("drain",u),e.removeListener("error",y),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",B),r.removeListener("data",m),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}var d=!1;r.on("data",m);function m(C){nt("ondata"),d=!1;var q=e.write(C);q===!1&&!d&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&NO(i.pipes,e)!==-1)&&!c&&(nt("false write response, pause",i.awaitDrain),i.awaitDrain++,d=!0),r.pause())}function y(C){nt("onerror",C),B(),e.removeListener("error",y),OO(e,"error")===0&&e.emit("error",C)}R4(e,"error",y);function w(){e.removeListener("finish",T),B()}e.once("close",w);function T(){nt("onfinish"),e.removeListener("close",w),B()}e.once("finish",T);function B(){nt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(nt("pipe resume"),r.resume()),e};function M4(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&OO(e,"data")&&(t.flowing=!0,ty(e))}}St.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=NO(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};St.prototype.on=function(e,t){var r=ey.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&tp(this):Vu.nextTick(D4,this))}return r};St.prototype.addListener=St.prototype.on;function D4(e){nt("readable nexttick read 0"),e.read(0)}St.prototype.resume=function(){var e=this._readableState;return e.flowing||(nt("resume"),e.flowing=!0,q4(this,e)),this};function q4(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Vu.nextTick(F4,e,t))}function F4(e,t){t.reading||(nt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),ty(e),t.flowing&&!t.reading&&e.read(0)}St.prototype.pause=function(){return nt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(nt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function ty(e){var t=e._readableState;for(nt("flow",t.flowing);t.flowing&&e.read()!==null;);}St.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(nt("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(nt("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(a){return function(){return e[a].apply(e,arguments)}})(n));for(var o=0;o<X0.length;o++)e.on(X0[o],this.emit.bind(this,X0[o]));return this._read=function(a){nt("wrapped _read",a),i&&(i=!1,e.resume())},this};Object.defineProperty(St.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});St._fromList=BO;function BO(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=U4(e,t.buffer,t.decoder),r}function U4(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?H4(e,t):j4(e,t),i}function H4(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),e-=a,e===0){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function j4(e,t){var r=Cf.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++n}return t.length-=n,r}function Q0(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Vu.nextTick(z4,t,e))}function z4(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function NO(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var ry=R(($ee,DO)=>{"use strict";p();DO.exports=Bo;var rp=ys(),MO=Object.create(ju());MO.inherits=dt();MO.inherits(Bo,rp);function K4(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Bo(e){if(!(this instanceof Bo))return new Bo(e);rp.call(this,e),this._transformState={afterTransform:K4.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",V4)}function V4(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){LO(e,t,r)}):LO(this,null,null)}Bo.prototype.push=function(e,t){return this._transformState.needTransform=!1,rp.prototype.push.call(this,e,t)};Bo.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};Bo.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Bo.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Bo.prototype._destroy=function(e,t){var r=this;rp.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function LO(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var HO=R((Jee,UO)=>{"use strict";p();UO.exports=Lf;var qO=ry(),FO=Object.create(ju());FO.inherits=dt();FO.inherits(Lf,qO);function Lf(e){if(!(this instanceof Lf))return new Lf(e);qO.call(this,e)}Lf.prototype._transform=function(e,t,r){r(null,e)}});var zO=R((Kn,jO)=>{p();Kn=jO.exports=Y0();Kn.Stream=Kn;Kn.Readable=Kn;Kn.Writable=G0();Kn.Duplex=ys();Kn.Transform=ry();Kn.PassThrough=HO()});var GO=R((tte,VO)=>{"use strict";p();var G4=jr().Buffer,W4=rO(),KO=zO().Transform,Z4=dt();function va(e){KO.call(this),this._block=G4.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Z4(va,KO);va.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(n){i=n}r(i)};va.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};va.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");for(var r=W4(e,t),i=this._block,n=0;this._blockOffset+r.length-n>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)i[o]=r[n],o+=1,n+=1;this._update(),this._blockOffset=0}for(;n<r.length;)i[this._blockOffset]=r[n],this._blockOffset+=1,n+=1;for(var a=0,s=r.length*8;s>0;++a)this._length[a]+=s,s=this._length[a]/4294967296|0,s>0&&(this._length[a]-=4294967296*s);return this};va.prototype._update=function(){throw new Error("_update is not implemented")};va.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};va.prototype._digest=function(){throw new Error("_digest is not implemented")};VO.exports=va});var ny=R((ite,QO)=>{"use strict";p();var iy=Lt().Buffer,Y4=dt(),JO=GO(),$4=new Array(16),Mf=[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],Df=[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],qf=[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],Ff=[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],Uf=[0,1518500249,1859775393,2400959708,2840853838],Hf=[1352829926,1548603684,1836072691,2053994217,0];function bs(e,t){return e<<t|e>>>32-t}function WO(e,t,r,i,n,o,a,s){return bs(e+(t^r^i)+o+a|0,s)+n|0}function ZO(e,t,r,i,n,o,a,s){return bs(e+(t&r|~t&i)+o+a|0,s)+n|0}function YO(e,t,r,i,n,o,a,s){return bs(e+((t|~r)^i)+o+a|0,s)+n|0}function $O(e,t,r,i,n,o,a,s){return bs(e+(t&i|r&~i)+o+a|0,s)+n|0}function XO(e,t,r,i,n,o,a,s){return bs(e+(t^(r|~i))+o+a|0,s)+n|0}function ip(){JO.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}Y4(ip,JO);ip.prototype._update=function(){for(var e=$4,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=this._a|0,u=this._b|0,c=this._c|0,f=this._d|0,d=this._e|0,m=0;m<80;m+=1){var y,w;m<16?(y=WO(r,i,n,o,a,e[Mf[m]],Uf[0],qf[m]),w=XO(s,u,c,f,d,e[Df[m]],Hf[0],Ff[m])):m<32?(y=ZO(r,i,n,o,a,e[Mf[m]],Uf[1],qf[m]),w=$O(s,u,c,f,d,e[Df[m]],Hf[1],Ff[m])):m<48?(y=YO(r,i,n,o,a,e[Mf[m]],Uf[2],qf[m]),w=YO(s,u,c,f,d,e[Df[m]],Hf[2],Ff[m])):m<64?(y=$O(r,i,n,o,a,e[Mf[m]],Uf[3],qf[m]),w=ZO(s,u,c,f,d,e[Df[m]],Hf[3],Ff[m])):(y=XO(r,i,n,o,a,e[Mf[m]],Uf[4],qf[m]),w=WO(s,u,c,f,d,e[Df[m]],Hf[4],Ff[m])),r=a,a=o,o=bs(n,10),n=i,i=y,s=d,d=f,f=bs(c,10),c=u,u=w}var T=this._b+n+f|0;this._b=this._c+o+d|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=T};ip.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,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=iy.alloc?iy.alloc(20):new iy(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};QO.exports=ip});var _s=R((ote,eA)=>{"use strict";p();var X4=jr().Buffer,J4=Vd();function np(e,t){this._block=X4.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}np.prototype.update=function(e,t){e=J4(e,t||"utf8");for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,a=0;a<n;){for(var s=o%i,u=Math.min(n-a,i-s),c=0;c<u;c++)r[s+c]=e[a+c];o+=u,a+=u,o%i===0&&this._update(r)}return this._len+=n,this};np.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 r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o};np.prototype._update=function(){throw new Error("_update must be implemented by subclass")};eA.exports=np});var iA=R((ste,rA)=>{"use strict";p();var Q4=dt(),tA=_s(),e5=jr().Buffer,t5=[1518500249,1859775393,-1894007588,-899497514],r5=new Array(80);function jf(){this.init(),this._w=r5,tA.call(this,64,56)}Q4(jf,tA);jf.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function i5(e){return e<<5|e>>>27}function n5(e){return e<<30|e>>>2}function o5(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}jf.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var u=0;u<80;++u){var c=~~(u/20),f=i5(r)+o5(c,i,n,o)+a+t[u]+t5[c]|0;a=o,o=n,n=n5(i),i=r,r=f}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};jf.prototype._hash=function(){var e=e5.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};rA.exports=jf});var aA=R((cte,oA)=>{"use strict";p();var a5=dt(),nA=_s(),s5=jr().Buffer,u5=[1518500249,1859775393,-1894007588,-899497514],c5=new Array(80);function zf(){this.init(),this._w=c5,nA.call(this,64,56)}a5(zf,nA);zf.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function f5(e){return e<<1|e>>>31}function l5(e){return e<<5|e>>>27}function h5(e){return e<<30|e>>>2}function d5(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}zf.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=f5(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var u=0;u<80;++u){var c=~~(u/20),f=l5(r)+d5(c,i,n,o)+a+t[u]+u5[c]|0;a=o,o=n,n=h5(i),i=r,r=f}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};zf.prototype._hash=function(){var e=s5.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};oA.exports=zf});var oy=R((lte,uA)=>{"use strict";p();var p5=dt(),sA=_s(),g5=jr().Buffer,m5=[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],v5=new Array(64);function Kf(){this.init(),this._w=v5,sA.call(this,64,56)}p5(Kf,sA);Kf.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};function y5(e,t,r){return r^e&(t^r)}function b5(e,t,r){return e&t|r&(e|t)}function _5(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function S5(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function w5(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function E5(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Kf.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,a=this._e|0,s=this._f|0,u=this._g|0,c=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=E5(t[f-2])+t[f-7]+w5(t[f-15])+t[f-16]|0;for(var d=0;d<64;++d){var m=c+S5(a)+y5(a,s,u)+m5[d]+t[d]|0,y=_5(r)+b5(r,i,n)|0;c=u,u=s,s=a,a=o+m|0,o=n,n=i,i=r,r=m+y|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+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=c+this._h|0};Kf.prototype._hash=function(){var e=g5.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};uA.exports=Kf});var fA=R((dte,cA)=>{"use strict";p();var x5=dt(),I5=oy(),O5=_s(),A5=jr().Buffer,T5=new Array(64);function op(){this.init(),this._w=T5,O5.call(this,64,56)}x5(op,I5);op.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};op.prototype._hash=function(){var e=A5.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};cA.exports=op});var ay=R((gte,vA)=>{"use strict";p();var P5=dt(),mA=_s(),R5=jr().Buffer,lA=[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],k5=new Array(160);function Vf(){this.init(),this._w=k5,mA.call(this,128,112)}P5(Vf,mA);Vf.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};function hA(e,t,r){return r^e&(t^r)}function dA(e,t,r){return e&t|r&(e|t)}function pA(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function gA(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function B5(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function N5(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function C5(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function L5(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Lr(e,t){return e>>>0<t>>>0?1:0}Vf.prototype._update=function(e){for(var t=this._w,r=this._ah|0,i=this._bh|0,n=this._ch|0,o=this._dh|0,a=this._eh|0,s=this._fh|0,u=this._gh|0,c=this._hh|0,f=this._al|0,d=this._bl|0,m=this._cl|0,y=this._dl|0,w=this._el|0,T=this._fl|0,B=this._gl|0,C=this._hl|0,q=0;q<32;q+=2)t[q]=e.readInt32BE(q*4),t[q+1]=e.readInt32BE(q*4+4);for(;q<160;q+=2){var F=t[q-30],P=t[q-30+1],k=B5(F,P),M=N5(P,F);F=t[q-4],P=t[q-4+1];var K=C5(F,P),z=L5(P,F),V=t[q-14],x=t[q-14+1],h=t[q-32],v=t[q-32+1],b=M+x|0,S=k+V+Lr(b,M)|0;b=b+z|0,S=S+K+Lr(b,z)|0,b=b+v|0,S=S+h+Lr(b,v)|0,t[q]=S,t[q+1]=b}for(var E=0;E<160;E+=2){S=t[E],b=t[E+1];var A=dA(r,i,n),N=dA(f,d,m),I=pA(r,f),g=pA(f,r),O=gA(a,w),ee=gA(w,a),X=lA[E],ne=lA[E+1],oe=hA(a,s,u),ue=hA(w,T,B),ge=C+ee|0,Ie=c+O+Lr(ge,C)|0;ge=ge+ue|0,Ie=Ie+oe+Lr(ge,ue)|0,ge=ge+ne|0,Ie=Ie+X+Lr(ge,ne)|0,ge=ge+b|0,Ie=Ie+S+Lr(ge,b)|0;var _e=g+N|0,L=I+A+Lr(_e,g)|0;c=u,C=B,u=s,B=T,s=a,T=w,w=y+ge|0,a=o+Ie+Lr(w,y)|0,o=n,y=m,n=i,m=d,i=r,d=f,f=ge+_e|0,r=Ie+L+Lr(f,ge)|0}this._al=this._al+f|0,this._bl=this._bl+d|0,this._cl=this._cl+m|0,this._dl=this._dl+y|0,this._el=this._el+w|0,this._fl=this._fl+T|0,this._gl=this._gl+B|0,this._hl=this._hl+C|0,this._ah=this._ah+r+Lr(this._al,f)|0,this._bh=this._bh+i+Lr(this._bl,d)|0,this._ch=this._ch+n+Lr(this._cl,m)|0,this._dh=this._dh+o+Lr(this._dl,y)|0,this._eh=this._eh+a+Lr(this._el,w)|0,this._fh=this._fh+s+Lr(this._fl,T)|0,this._gh=this._gh+u+Lr(this._gl,B)|0,this._hh=this._hh+c+Lr(this._hl,C)|0};Vf.prototype._hash=function(){var e=R5.allocUnsafe(64);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+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};vA.exports=Vf});var bA=R((vte,yA)=>{"use strict";p();var M5=dt(),D5=ay(),q5=_s(),F5=jr().Buffer,U5=new Array(160);function ap(){this.init(),this._w=U5,q5.call(this,128,112)}M5(ap,D5);ap.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};ap.prototype._hash=function(){var e=F5.allocUnsafe(48);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+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};yA.exports=ap});var sy=R((bte,No)=>{"use strict";p();No.exports=function(t){var r=t.toLowerCase(),i=No.exports[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i};No.exports.sha=iA();No.exports.sha1=aA();No.exports.sha224=fA();No.exports.sha256=oy();No.exports.sha384=bA();No.exports.sha512=ay()});var sp=R((Ste,SA)=>{"use strict";p();var H5=jr().Buffer,_A=jd().Transform,j5=qu().StringDecoder,z5=dt(),K5=Vd();function pn(e){_A.call(this),this.hashMode=typeof e=="string",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}z5(pn,_A);pn.prototype.update=function(e,t,r){var i=K5(e,t),n=this._update(i);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};pn.prototype.setAutoPadding=function(){};pn.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};pn.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};pn.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};pn.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(n){i=n}finally{r(i)}};pn.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};pn.prototype._finalOrDigest=function(e){var t=this.__final()||H5.alloc(0);return e&&(t=this._toString(t,e,!0)),t};pn.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new j5(t),this._encoding=t),this._encoding!==t)throw new Error("can\u2019t switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i};SA.exports=pn});var xA=R((Ete,EA)=>{"use strict";p();var V5=dt(),G5=F0(),W5=ny(),Z5=sy(),wA=sp();function up(e){wA.call(this,"digest"),this._hash=e}V5(up,wA);up.prototype._update=function(e){this._hash.update(e)};up.prototype._final=function(){return this._hash.digest()};EA.exports=function(t){return t=t.toLowerCase(),t==="md5"?new G5:t==="rmd160"||t==="ripemd160"?new W5:new up(Z5(t))}});var AA=R((Ite,OA)=>{"use strict";p();var Y5=dt(),Ss=jr().Buffer,IA=sp(),$5=Ss.alloc(128),Gu=64;function cp(e,t){IA.call(this,"digest"),typeof t=="string"&&(t=Ss.from(t)),this._alg=e,this._key=t,t.length>Gu?t=e(t):t.length<Gu&&(t=Ss.concat([t,$5],Gu));for(var r=this._ipad=Ss.allocUnsafe(Gu),i=this._opad=Ss.allocUnsafe(Gu),n=0;n<Gu;n++)r[n]=t[n]^54,i[n]=t[n]^92;this._hash=[r]}Y5(cp,IA);cp.prototype._update=function(e){this._hash.push(e)};cp.prototype._final=function(){var e=this._alg(Ss.concat(this._hash));return this._alg(Ss.concat([this._opad,e]))};OA.exports=cp});var PA=R((Ate,TA)=>{p();var X5=F0();TA.exports=function(e){return new X5().update(e).digest()}});var BA=R((Pte,kA)=>{"use strict";p();var J5=dt(),Q5=AA(),RA=sp(),Gf=jr().Buffer,ej=PA(),uy=ny(),cy=sy(),tj=Gf.alloc(128);function Wf(e,t){RA.call(this,"digest"),typeof t=="string"&&(t=Gf.from(t));var r=e==="sha512"||e==="sha384"?128:64;if(this._alg=e,this._key=t,t.length>r){var i=e==="rmd160"?new uy:cy(e);t=i.update(t).digest()}else t.length<r&&(t=Gf.concat([t,tj],r));for(var n=this._ipad=Gf.allocUnsafe(r),o=this._opad=Gf.allocUnsafe(r),a=0;a<r;a++)n[a]=t[a]^54,o[a]=t[a]^92;this._hash=e==="rmd160"?new uy:cy(e),this._hash.update(n)}J5(Wf,RA);Wf.prototype._update=function(e){this._hash.update(e)};Wf.prototype._final=function(){var e=this._hash.digest(),t=this._alg==="rmd160"?new uy:cy(this._alg);return t.update(this._opad).update(e).digest()};kA.exports=function(t,r){return t=t.toLowerCase(),t==="rmd160"||t==="ripemd160"?new Wf("rmd160",r):t==="md5"?new Q5(ej,r):new Wf(t,r)}});var NA=R((kte,ly)=>{"use strict";p();var fy=65536,rj=4294967295;function ij(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
11
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var nj=jr().Buffer,fp=globalThis.crypto||globalThis.msCrypto;fp&&fp.getRandomValues?ly.exports=oj:ly.exports=ij;function oj(e,t){if(e>rj)throw new RangeError("requested too many random bytes");var r=nj.allocUnsafe(e);if(e>0)if(e>fy)for(var i=0;i<e;i+=fy)fp.getRandomValues(r.slice(i,i+fy));else fp.getRandomValues(r);return typeof t=="function"?_.default.nextTick(function(){t(null,r)}):r}});var Dt=R(lp=>{"use strict";p();lp.createHash=xA();lp.createHmac=BA();lp.randomBytes=NA()});var Ri=R((Lte,LA)=>{"use strict";p();var CA=65536;function ws(){}ws.getRandomBuffer=function(e){var t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function")return ws._fromGetRandomValues(t,e);try{var r=Dt();if(r&&typeof r.randomBytes=="function")return r.randomBytes(e)}catch{}throw new Error("bsv: no CSPRNG available in this environment (needs globalThis.crypto.getRandomValues or node crypto)")};ws._fromGetRandomValues=function(e,t){for(var r=l.Buffer.alloc(t),i=0;i<t;i+=CA){var n=new Uint8Array(Math.min(CA,t-i));e.getRandomValues(n),l.Buffer.from(n).copy(r,i)}return r};ws.getRandomBufferNode=function(e){var t=Dt();return t.randomBytes(e)};ws.getRandomBufferBrowser=function(e){var t=typeof globalThis<"u"?globalThis:{},r=null;if(t.crypto&&typeof t.crypto.getRandomValues=="function"?r=t.crypto:t.msCrypto&&typeof t.msCrypto.getRandomValues=="function"&&(r=t.msCrypto),!r)throw new Error("window.crypto.getRandomValues not available");return ws._fromGetRandomValues(r,e)};LA.exports=ws});var Ve=R((Dte,MA)=>{"use strict";p();var aj=Ri(),bt={};bt.isArray=e=>Array.isArray(e);bt.isNumber=e=>typeof e=="number";bt.isObject=e=>e&&typeof e=="object";bt.isString=e=>typeof e=="string";bt.isUndefined=e=>typeof e>"u";bt.isFunction=e=>typeof e=="function";bt.isNull=e=>e===null;bt.isDate=e=>e instanceof Date;bt.extend=(e,t)=>Object.assign(e,t);bt.noop=()=>{};bt.every=(e,t)=>e.every(t||(r=>r));bt.map=(e,t)=>Array.from(e).map(t||(r=>r));bt.includes=(e,t)=>e.includes(t);bt.each=(e,t)=>e.forEach(t);bt.clone=e=>Object.assign({},e);bt.pick=(e,t)=>{let r={};return t.forEach(i=>{typeof e[i]<"u"&&(r[i]=e[i])}),r};bt.values=e=>Object.values(e);bt.filter=(e,t)=>e.filter(t);bt.reduce=(e,t,r)=>e.reduce(t,r);bt.without=(e,t)=>e.filter(r=>r!==t);bt.shuffle=e=>{let t=e.slice(0);for(let r=t.length-1;r>0;r--){let n=aj.getRandomBuffer(4).readUInt32BE(0)/4294967296,o=Math.floor(n*(r+1));[t[r],t[o]]=[t[o],t[r]]}return t};bt.difference=(e,t)=>e.filter(r=>!t.includes(r));bt.findIndex=(e,t)=>e.findIndex(t);bt.some=(e,t)=>e.some(t);bt.range=e=>[...Array(e).keys()];MA.exports=bt});var Zu=R((Fte,FA)=>{"use strict";p();var hy=Ve(),DA=Lt(),Wu="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),qA={};for(Zf=0;Zf<Wu.length;Zf++)qA[Wu[Zf]]=Zf;var Zf;function sj(e){if(e.length===0)return"";var t=[0],r,i,n;for(r=0;r<e.length;r++){for(i=0,n=e[r];i<t.length;i++)n+=t[i]<<8,t[i]=n%58,n=n/58|0;for(;n>0;)t.push(n%58),n=n/58|0}var o="";for(r=0;e[r]===0&&r<e.length-1;r++)o+=Wu[0];for(r=t.length-1;r>=0;r--)o+=Wu[t[r]];return o}function uj(e){if(e.length===0)return l.Buffer.alloc(0);var t=[0],r,i,n;for(r=0;r<e.length;r++){var o=qA[e[r]];if(o===void 0)throw new Error("Non-base58 character");for(i=0,n=o;i<t.length;i++)n+=t[i]*58,t[i]=n&255,n>>=8;for(;n>0;)t.push(n&255),n>>=8}for(r=0;e[r]===Wu[0]&&r<e.length-1;r++)t.push(0);return l.Buffer.from(t.reverse())}var Mr=function e(t){if(!(this instanceof e))return new e(t);if(l.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};Mr.validCharacters=function(t){return DA.Buffer.isBuffer(t)&&(t=t.toString()),hy.every(hy.map(t,function(r){return hy.includes(Wu,r)}))};Mr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Mr.encode=function(e){if(!DA.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return sj(e)};Mr.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return uj(e)};Mr.prototype.fromBuffer=function(e){return this.buf=e,this};Mr.fromBuffer=function(e){return new Mr().fromBuffer(e)};Mr.fromHex=function(e){return Mr.fromBuffer(l.Buffer.from(e,"hex"))};Mr.prototype.fromString=function(e){var t=Mr.decode(e);return this.buf=t,this};Mr.fromString=function(e){return new Mr().fromString(e)};Mr.prototype.toBuffer=function(){return this.buf};Mr.prototype.toHex=function(){return this.toBuffer().toString("hex")};Mr.prototype.toString=function(){return Mr.encode(this.buf)};FA.exports=Mr});var hp=R((UA,dy)=>{p();(function(e,t){"use strict";function r(x,h){if(!x)throw new Error(h||"Assertion failed")}function i(x,h){x.super_=h;var v=function(){};v.prototype=h.prototype,x.prototype=new v,x.prototype.constructor=x}function n(x,h,v){if(n.isBN(x))return x;this.negative=0,this.words=null,this.length=0,this.red=null,x!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(x||0,h||10,v||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Lt().Buffer}catch{}n.isBN=function(h){return h instanceof n?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===n.wordSize&&Array.isArray(h.words)},n.max=function(h,v){return h.cmp(v)>0?h:v},n.min=function(h,v){return h.cmp(v)<0?h:v},n.prototype._init=function(h,v,b){if(typeof h=="number")return this._initNumber(h,v,b);if(typeof h=="object")return this._initArray(h,v,b);v==="hex"&&(v=16),r(v===(v|0)&&v>=2&&v<=36),h=h.toString().replace(/\s+/g,"");var S=0;h[0]==="-"&&(S++,this.negative=1),S<h.length&&(v===16?this._parseHex(h,S,b):(this._parseBase(h,v,S),b==="le"&&this._initArray(this.toArray(),v,b)))},n.prototype._initNumber=function(h,v,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),v,b)},n.prototype._initArray=function(h,v,b){if(r(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E,A,N=0;if(b==="be")for(S=h.length-1,E=0;S>=0;S-=3)A=h[S]|h[S-1]<<8|h[S-2]<<16,this.words[E]|=A<<N&67108863,this.words[E+1]=A>>>26-N&67108863,N+=24,N>=26&&(N-=26,E++);else if(b==="le")for(S=0,E=0;S<h.length;S+=3)A=h[S]|h[S+1]<<8|h[S+2]<<16,this.words[E]|=A<<N&67108863,this.words[E+1]=A>>>26-N&67108863,N+=24,N>=26&&(N-=26,E++);return this.strip()};function a(x,h){var v=x.charCodeAt(h);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function s(x,h,v){var b=a(x,v);return v-1>=h&&(b|=a(x,v-1)<<4),b}n.prototype._parseHex=function(h,v,b){this.length=Math.ceil((h.length-v)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E=0,A=0,N;if(b==="be")for(S=h.length-1;S>=v;S-=2)N=s(h,v,S)<<E,this.words[A]|=N&67108863,E>=18?(E-=18,A+=1,this.words[A]|=N>>>26):E+=8;else{var I=h.length-v;for(S=I%2===0?v+1:v;S<h.length;S+=2)N=s(h,v,S)<<E,this.words[A]|=N&67108863,E>=18?(E-=18,A+=1,this.words[A]|=N>>>26):E+=8}this.strip()};function u(x,h,v,b){for(var S=0,E=Math.min(x.length,v),A=h;A<E;A++){var N=x.charCodeAt(A)-48;S*=b,N>=49?S+=N-49+10:N>=17?S+=N-17+10:S+=N}return S}n.prototype._parseBase=function(h,v,b){this.words=[0],this.length=1;for(var S=0,E=1;E<=67108863;E*=v)S++;S--,E=E/v|0;for(var A=h.length-b,N=A%S,I=Math.min(A,A-N)+b,g=0,O=b;O<I;O+=S)g=u(h,O,O+S,v),this.imuln(E),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(N!==0){var ee=1;for(g=u(h,O,h.length,v),O=0;O<N;O++)ee*=v;this.imuln(ee),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},n.prototype.copy=function(h){h.words=new Array(this.length);for(var v=0;v<this.length;v++)h.words[v]=this.words[v];h.length=this.length,h.negative=this.negative,h.red=this.red},n.prototype.clone=function(){var h=new n(null);return this.copy(h),h},n.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(h,v){h=h||10,v=v|0||1;var b;if(h===16||h==="hex"){b="";for(var S=0,E=0,A=0;A<this.length;A++){var N=this.words[A],I=((N<<S|E)&16777215).toString(16);E=N>>>24-S&16777215,S+=2,S>=26&&(S-=26,A--),E!==0||A!==this.length-1?b=c[6-I.length]+I+b:b=I+b}for(E!==0&&(b=E.toString(16)+b);b.length%v!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var g=f[h],O=d[h];b="";var ee=this.clone();for(ee.negative=0;!ee.isZero();){var X=ee.modn(O).toString(h);ee=ee.idivn(O),ee.isZero()?b=X+b:b=c[g-X.length]+X+b}for(this.isZero()&&(b="0"+b);b.length%v!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(h,v){return r(typeof o<"u"),this.toArrayLike(o,h,v)},n.prototype.toArray=function(h,v){return this.toArrayLike(Array,h,v)},n.prototype.toArrayLike=function(h,v,b){var S=this.byteLength(),E=b||Math.max(1,S);r(S<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0"),this.strip();var A=v==="le",N=new h(E),I,g,O=this.clone();if(A){for(g=0;!O.isZero();g++)I=O.andln(255),O.iushrn(8),N[g]=I;for(;g<E;g++)N[g]=0}else{for(g=0;g<E-S;g++)N[g]=0;for(g=0;!O.isZero();g++)I=O.andln(255),O.iushrn(8),N[E-g-1]=I}return N},Math.clz32?n.prototype._countBits=function(h){return 32-Math.clz32(h)}:n.prototype._countBits=function(h){var v=h,b=0;return v>=4096&&(b+=13,v>>>=13),v>=64&&(b+=7,v>>>=7),v>=8&&(b+=4,v>>>=4),v>=2&&(b+=2,v>>>=2),b+v},n.prototype._zeroBits=function(h){if(h===0)return 26;var v=h,b=0;return(v&8191)===0&&(b+=13,v>>>=13),(v&127)===0&&(b+=7,v>>>=7),(v&15)===0&&(b+=4,v>>>=4),(v&3)===0&&(b+=2,v>>>=2),(v&1)===0&&b++,b},n.prototype.bitLength=function(){var h=this.words[this.length-1],v=this._countBits(h);return(this.length-1)*26+v};function m(x){for(var h=new Array(x.bitLength()),v=0;v<h.length;v++){var b=v/26|0,S=v%26;h[v]=(x.words[b]&1<<S)>>>S}return h}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,v=0;v<this.length;v++){var b=this._zeroBits(this.words[v]);if(h+=b,b!==26)break}return h},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},n.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]|h.words[v];return this.strip()},n.prototype.ior=function(h){return r((this.negative|h.negative)===0),this.iuor(h)},n.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},n.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},n.prototype.iuand=function(h){var v;this.length>h.length?v=h:v=this;for(var b=0;b<v.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=v.length,this.strip()},n.prototype.iand=function(h){return r((this.negative|h.negative)===0),this.iuand(h)},n.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},n.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},n.prototype.iuxor=function(h){var v,b;this.length>h.length?(v=this,b=h):(v=h,b=this);for(var S=0;S<b.length;S++)this.words[S]=v.words[S]^b.words[S];if(this!==v)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=v.length,this.strip()},n.prototype.ixor=function(h){return r((this.negative|h.negative)===0),this.iuxor(h)},n.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},n.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},n.prototype.inotn=function(h){r(typeof h=="number"&&h>=0);var v=Math.ceil(h/26)|0,b=h%26;this._expand(v),b>0&&v--;for(var S=0;S<v;S++)this.words[S]=~this.words[S]&67108863;for(b>0&&(this.words[S]=~this.words[S]&67108863>>26-b,S++);S<this.length;S++)this.words[S]=0;return this.strip()},n.prototype.notn=function(h){return this.clone().inotn(h)},n.prototype.setn=function(h,v){r(typeof h=="number"&&h>=0);var b=h/26|0,S=h%26;return this._expand(b+1),v?this.words[b]=this.words[b]|1<<S:this.words[b]=this.words[b]&~(1<<S),this.strip()},n.prototype.iadd=function(h){var v;if(this.negative!==0&&h.negative===0)return this.negative=0,v=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,v=this.isub(h),h.negative=1,v._normSign();var b,S;this.length>h.length?(b=this,S=h):(b=h,S=this);for(var E=0,A=0;A<S.length;A++)v=(b.words[A]|0)+(S.words[A]|0)+E,this.words[A]=v&67108863,E=v>>>26;for(;E!==0&&A<b.length;A++)v=(b.words[A]|0)+E,this.words[A]=v&67108863,E=v>>>26;if(this.length=b.length,E!==0)this.words[this.length]=E,this.length++;else if(b!==this)for(;A<b.length;A++)this.words[A]=b.words[A];return this},n.prototype.add=function(h){var v;return h.negative!==0&&this.negative===0?(h.negative=0,v=this.sub(h),h.negative^=1,v):h.negative===0&&this.negative!==0?(this.negative=0,v=h.sub(this),this.negative=1,v):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},n.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var v=this.iadd(h);return h.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,E;b>0?(S=this,E=h):(S=h,E=this);for(var A=0,N=0;N<E.length;N++)v=(S.words[N]|0)-(E.words[N]|0)+A,A=v>>26,this.words[N]=v&67108863;for(;A!==0&&N<S.length;N++)v=(S.words[N]|0)+A,A=v>>26,this.words[N]=v&67108863;if(A===0&&N<S.length&&S!==this)for(;N<S.length;N++)this.words[N]=S.words[N];return this.length=Math.max(this.length,N),S!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(h){return this.clone().isub(h)};function y(x,h,v){v.negative=h.negative^x.negative;var b=x.length+h.length|0;v.length=b,b=b-1|0;var S=x.words[0]|0,E=h.words[0]|0,A=S*E,N=A&67108863,I=A/67108864|0;v.words[0]=N;for(var g=1;g<b;g++){for(var O=I>>>26,ee=I&67108863,X=Math.min(g,h.length-1),ne=Math.max(0,g-x.length+1);ne<=X;ne++){var oe=g-ne|0;S=x.words[oe]|0,E=h.words[ne]|0,A=S*E+ee,O+=A/67108864|0,ee=A&67108863}v.words[g]=ee|0,I=O|0}return I!==0?v.words[g]=I|0:v.length--,v.strip()}var w=function(h,v,b){var S=h.words,E=v.words,A=b.words,N=0,I,g,O,ee=S[0]|0,X=ee&8191,ne=ee>>>13,oe=S[1]|0,ue=oe&8191,ge=oe>>>13,Ie=S[2]|0,_e=Ie&8191,L=Ie>>>13,G=S[3]|0,Q=G&8191,re=G>>>13,de=S[4]|0,ce=de&8191,fe=de>>>13,Se=S[5]|0,pe=Se&8191,me=Se>>>13,xt=S[6]|0,$e=xt&8191,le=xt>>>13,Te=S[7]|0,Re=Te&8191,Me=Te>>>13,xo=S[8]|0,It=xo&8191,yt=xo>>>13,Hh=S[9]|0,Ct=Hh&8191,Gt=Hh>>>13,mw=E[0]|0,Wt=mw&8191,Zt=mw>>>13,vw=E[1]|0,Yt=vw&8191,$t=vw>>>13,yw=E[2]|0,Xt=yw&8191,Jt=yw>>>13,bw=E[3]|0,Qt=bw&8191,er=bw>>>13,_w=E[4]|0,tr=_w&8191,rr=_w>>>13,Sw=E[5]|0,ir=Sw&8191,nr=Sw>>>13,ww=E[6]|0,or=ww&8191,ar=ww>>>13,Ew=E[7]|0,sr=Ew&8191,ur=Ew>>>13,xw=E[8]|0,cr=xw&8191,fr=xw>>>13,Iw=E[9]|0,lr=Iw&8191,hr=Iw>>>13;b.negative=h.negative^v.negative,b.length=19,I=Math.imul(X,Wt),g=Math.imul(X,Zt),g=g+Math.imul(ne,Wt)|0,O=Math.imul(ne,Zt);var Jm=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(Jm>>>26)|0,Jm&=67108863,I=Math.imul(ue,Wt),g=Math.imul(ue,Zt),g=g+Math.imul(ge,Wt)|0,O=Math.imul(ge,Zt),I=I+Math.imul(X,Yt)|0,g=g+Math.imul(X,$t)|0,g=g+Math.imul(ne,Yt)|0,O=O+Math.imul(ne,$t)|0;var Qm=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(Qm>>>26)|0,Qm&=67108863,I=Math.imul(_e,Wt),g=Math.imul(_e,Zt),g=g+Math.imul(L,Wt)|0,O=Math.imul(L,Zt),I=I+Math.imul(ue,Yt)|0,g=g+Math.imul(ue,$t)|0,g=g+Math.imul(ge,Yt)|0,O=O+Math.imul(ge,$t)|0,I=I+Math.imul(X,Xt)|0,g=g+Math.imul(X,Jt)|0,g=g+Math.imul(ne,Xt)|0,O=O+Math.imul(ne,Jt)|0;var ev=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(ev>>>26)|0,ev&=67108863,I=Math.imul(Q,Wt),g=Math.imul(Q,Zt),g=g+Math.imul(re,Wt)|0,O=Math.imul(re,Zt),I=I+Math.imul(_e,Yt)|0,g=g+Math.imul(_e,$t)|0,g=g+Math.imul(L,Yt)|0,O=O+Math.imul(L,$t)|0,I=I+Math.imul(ue,Xt)|0,g=g+Math.imul(ue,Jt)|0,g=g+Math.imul(ge,Xt)|0,O=O+Math.imul(ge,Jt)|0,I=I+Math.imul(X,Qt)|0,g=g+Math.imul(X,er)|0,g=g+Math.imul(ne,Qt)|0,O=O+Math.imul(ne,er)|0;var tv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(tv>>>26)|0,tv&=67108863,I=Math.imul(ce,Wt),g=Math.imul(ce,Zt),g=g+Math.imul(fe,Wt)|0,O=Math.imul(fe,Zt),I=I+Math.imul(Q,Yt)|0,g=g+Math.imul(Q,$t)|0,g=g+Math.imul(re,Yt)|0,O=O+Math.imul(re,$t)|0,I=I+Math.imul(_e,Xt)|0,g=g+Math.imul(_e,Jt)|0,g=g+Math.imul(L,Xt)|0,O=O+Math.imul(L,Jt)|0,I=I+Math.imul(ue,Qt)|0,g=g+Math.imul(ue,er)|0,g=g+Math.imul(ge,Qt)|0,O=O+Math.imul(ge,er)|0,I=I+Math.imul(X,tr)|0,g=g+Math.imul(X,rr)|0,g=g+Math.imul(ne,tr)|0,O=O+Math.imul(ne,rr)|0;var rv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(rv>>>26)|0,rv&=67108863,I=Math.imul(pe,Wt),g=Math.imul(pe,Zt),g=g+Math.imul(me,Wt)|0,O=Math.imul(me,Zt),I=I+Math.imul(ce,Yt)|0,g=g+Math.imul(ce,$t)|0,g=g+Math.imul(fe,Yt)|0,O=O+Math.imul(fe,$t)|0,I=I+Math.imul(Q,Xt)|0,g=g+Math.imul(Q,Jt)|0,g=g+Math.imul(re,Xt)|0,O=O+Math.imul(re,Jt)|0,I=I+Math.imul(_e,Qt)|0,g=g+Math.imul(_e,er)|0,g=g+Math.imul(L,Qt)|0,O=O+Math.imul(L,er)|0,I=I+Math.imul(ue,tr)|0,g=g+Math.imul(ue,rr)|0,g=g+Math.imul(ge,tr)|0,O=O+Math.imul(ge,rr)|0,I=I+Math.imul(X,ir)|0,g=g+Math.imul(X,nr)|0,g=g+Math.imul(ne,ir)|0,O=O+Math.imul(ne,nr)|0;var iv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(iv>>>26)|0,iv&=67108863,I=Math.imul($e,Wt),g=Math.imul($e,Zt),g=g+Math.imul(le,Wt)|0,O=Math.imul(le,Zt),I=I+Math.imul(pe,Yt)|0,g=g+Math.imul(pe,$t)|0,g=g+Math.imul(me,Yt)|0,O=O+Math.imul(me,$t)|0,I=I+Math.imul(ce,Xt)|0,g=g+Math.imul(ce,Jt)|0,g=g+Math.imul(fe,Xt)|0,O=O+Math.imul(fe,Jt)|0,I=I+Math.imul(Q,Qt)|0,g=g+Math.imul(Q,er)|0,g=g+Math.imul(re,Qt)|0,O=O+Math.imul(re,er)|0,I=I+Math.imul(_e,tr)|0,g=g+Math.imul(_e,rr)|0,g=g+Math.imul(L,tr)|0,O=O+Math.imul(L,rr)|0,I=I+Math.imul(ue,ir)|0,g=g+Math.imul(ue,nr)|0,g=g+Math.imul(ge,ir)|0,O=O+Math.imul(ge,nr)|0,I=I+Math.imul(X,or)|0,g=g+Math.imul(X,ar)|0,g=g+Math.imul(ne,or)|0,O=O+Math.imul(ne,ar)|0;var nv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(nv>>>26)|0,nv&=67108863,I=Math.imul(Re,Wt),g=Math.imul(Re,Zt),g=g+Math.imul(Me,Wt)|0,O=Math.imul(Me,Zt),I=I+Math.imul($e,Yt)|0,g=g+Math.imul($e,$t)|0,g=g+Math.imul(le,Yt)|0,O=O+Math.imul(le,$t)|0,I=I+Math.imul(pe,Xt)|0,g=g+Math.imul(pe,Jt)|0,g=g+Math.imul(me,Xt)|0,O=O+Math.imul(me,Jt)|0,I=I+Math.imul(ce,Qt)|0,g=g+Math.imul(ce,er)|0,g=g+Math.imul(fe,Qt)|0,O=O+Math.imul(fe,er)|0,I=I+Math.imul(Q,tr)|0,g=g+Math.imul(Q,rr)|0,g=g+Math.imul(re,tr)|0,O=O+Math.imul(re,rr)|0,I=I+Math.imul(_e,ir)|0,g=g+Math.imul(_e,nr)|0,g=g+Math.imul(L,ir)|0,O=O+Math.imul(L,nr)|0,I=I+Math.imul(ue,or)|0,g=g+Math.imul(ue,ar)|0,g=g+Math.imul(ge,or)|0,O=O+Math.imul(ge,ar)|0,I=I+Math.imul(X,sr)|0,g=g+Math.imul(X,ur)|0,g=g+Math.imul(ne,sr)|0,O=O+Math.imul(ne,ur)|0;var ov=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(ov>>>26)|0,ov&=67108863,I=Math.imul(It,Wt),g=Math.imul(It,Zt),g=g+Math.imul(yt,Wt)|0,O=Math.imul(yt,Zt),I=I+Math.imul(Re,Yt)|0,g=g+Math.imul(Re,$t)|0,g=g+Math.imul(Me,Yt)|0,O=O+Math.imul(Me,$t)|0,I=I+Math.imul($e,Xt)|0,g=g+Math.imul($e,Jt)|0,g=g+Math.imul(le,Xt)|0,O=O+Math.imul(le,Jt)|0,I=I+Math.imul(pe,Qt)|0,g=g+Math.imul(pe,er)|0,g=g+Math.imul(me,Qt)|0,O=O+Math.imul(me,er)|0,I=I+Math.imul(ce,tr)|0,g=g+Math.imul(ce,rr)|0,g=g+Math.imul(fe,tr)|0,O=O+Math.imul(fe,rr)|0,I=I+Math.imul(Q,ir)|0,g=g+Math.imul(Q,nr)|0,g=g+Math.imul(re,ir)|0,O=O+Math.imul(re,nr)|0,I=I+Math.imul(_e,or)|0,g=g+Math.imul(_e,ar)|0,g=g+Math.imul(L,or)|0,O=O+Math.imul(L,ar)|0,I=I+Math.imul(ue,sr)|0,g=g+Math.imul(ue,ur)|0,g=g+Math.imul(ge,sr)|0,O=O+Math.imul(ge,ur)|0,I=I+Math.imul(X,cr)|0,g=g+Math.imul(X,fr)|0,g=g+Math.imul(ne,cr)|0,O=O+Math.imul(ne,fr)|0;var av=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(av>>>26)|0,av&=67108863,I=Math.imul(Ct,Wt),g=Math.imul(Ct,Zt),g=g+Math.imul(Gt,Wt)|0,O=Math.imul(Gt,Zt),I=I+Math.imul(It,Yt)|0,g=g+Math.imul(It,$t)|0,g=g+Math.imul(yt,Yt)|0,O=O+Math.imul(yt,$t)|0,I=I+Math.imul(Re,Xt)|0,g=g+Math.imul(Re,Jt)|0,g=g+Math.imul(Me,Xt)|0,O=O+Math.imul(Me,Jt)|0,I=I+Math.imul($e,Qt)|0,g=g+Math.imul($e,er)|0,g=g+Math.imul(le,Qt)|0,O=O+Math.imul(le,er)|0,I=I+Math.imul(pe,tr)|0,g=g+Math.imul(pe,rr)|0,g=g+Math.imul(me,tr)|0,O=O+Math.imul(me,rr)|0,I=I+Math.imul(ce,ir)|0,g=g+Math.imul(ce,nr)|0,g=g+Math.imul(fe,ir)|0,O=O+Math.imul(fe,nr)|0,I=I+Math.imul(Q,or)|0,g=g+Math.imul(Q,ar)|0,g=g+Math.imul(re,or)|0,O=O+Math.imul(re,ar)|0,I=I+Math.imul(_e,sr)|0,g=g+Math.imul(_e,ur)|0,g=g+Math.imul(L,sr)|0,O=O+Math.imul(L,ur)|0,I=I+Math.imul(ue,cr)|0,g=g+Math.imul(ue,fr)|0,g=g+Math.imul(ge,cr)|0,O=O+Math.imul(ge,fr)|0,I=I+Math.imul(X,lr)|0,g=g+Math.imul(X,hr)|0,g=g+Math.imul(ne,lr)|0,O=O+Math.imul(ne,hr)|0;var sv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(sv>>>26)|0,sv&=67108863,I=Math.imul(Ct,Yt),g=Math.imul(Ct,$t),g=g+Math.imul(Gt,Yt)|0,O=Math.imul(Gt,$t),I=I+Math.imul(It,Xt)|0,g=g+Math.imul(It,Jt)|0,g=g+Math.imul(yt,Xt)|0,O=O+Math.imul(yt,Jt)|0,I=I+Math.imul(Re,Qt)|0,g=g+Math.imul(Re,er)|0,g=g+Math.imul(Me,Qt)|0,O=O+Math.imul(Me,er)|0,I=I+Math.imul($e,tr)|0,g=g+Math.imul($e,rr)|0,g=g+Math.imul(le,tr)|0,O=O+Math.imul(le,rr)|0,I=I+Math.imul(pe,ir)|0,g=g+Math.imul(pe,nr)|0,g=g+Math.imul(me,ir)|0,O=O+Math.imul(me,nr)|0,I=I+Math.imul(ce,or)|0,g=g+Math.imul(ce,ar)|0,g=g+Math.imul(fe,or)|0,O=O+Math.imul(fe,ar)|0,I=I+Math.imul(Q,sr)|0,g=g+Math.imul(Q,ur)|0,g=g+Math.imul(re,sr)|0,O=O+Math.imul(re,ur)|0,I=I+Math.imul(_e,cr)|0,g=g+Math.imul(_e,fr)|0,g=g+Math.imul(L,cr)|0,O=O+Math.imul(L,fr)|0,I=I+Math.imul(ue,lr)|0,g=g+Math.imul(ue,hr)|0,g=g+Math.imul(ge,lr)|0,O=O+Math.imul(ge,hr)|0;var uv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(uv>>>26)|0,uv&=67108863,I=Math.imul(Ct,Xt),g=Math.imul(Ct,Jt),g=g+Math.imul(Gt,Xt)|0,O=Math.imul(Gt,Jt),I=I+Math.imul(It,Qt)|0,g=g+Math.imul(It,er)|0,g=g+Math.imul(yt,Qt)|0,O=O+Math.imul(yt,er)|0,I=I+Math.imul(Re,tr)|0,g=g+Math.imul(Re,rr)|0,g=g+Math.imul(Me,tr)|0,O=O+Math.imul(Me,rr)|0,I=I+Math.imul($e,ir)|0,g=g+Math.imul($e,nr)|0,g=g+Math.imul(le,ir)|0,O=O+Math.imul(le,nr)|0,I=I+Math.imul(pe,or)|0,g=g+Math.imul(pe,ar)|0,g=g+Math.imul(me,or)|0,O=O+Math.imul(me,ar)|0,I=I+Math.imul(ce,sr)|0,g=g+Math.imul(ce,ur)|0,g=g+Math.imul(fe,sr)|0,O=O+Math.imul(fe,ur)|0,I=I+Math.imul(Q,cr)|0,g=g+Math.imul(Q,fr)|0,g=g+Math.imul(re,cr)|0,O=O+Math.imul(re,fr)|0,I=I+Math.imul(_e,lr)|0,g=g+Math.imul(_e,hr)|0,g=g+Math.imul(L,lr)|0,O=O+Math.imul(L,hr)|0;var cv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(cv>>>26)|0,cv&=67108863,I=Math.imul(Ct,Qt),g=Math.imul(Ct,er),g=g+Math.imul(Gt,Qt)|0,O=Math.imul(Gt,er),I=I+Math.imul(It,tr)|0,g=g+Math.imul(It,rr)|0,g=g+Math.imul(yt,tr)|0,O=O+Math.imul(yt,rr)|0,I=I+Math.imul(Re,ir)|0,g=g+Math.imul(Re,nr)|0,g=g+Math.imul(Me,ir)|0,O=O+Math.imul(Me,nr)|0,I=I+Math.imul($e,or)|0,g=g+Math.imul($e,ar)|0,g=g+Math.imul(le,or)|0,O=O+Math.imul(le,ar)|0,I=I+Math.imul(pe,sr)|0,g=g+Math.imul(pe,ur)|0,g=g+Math.imul(me,sr)|0,O=O+Math.imul(me,ur)|0,I=I+Math.imul(ce,cr)|0,g=g+Math.imul(ce,fr)|0,g=g+Math.imul(fe,cr)|0,O=O+Math.imul(fe,fr)|0,I=I+Math.imul(Q,lr)|0,g=g+Math.imul(Q,hr)|0,g=g+Math.imul(re,lr)|0,O=O+Math.imul(re,hr)|0;var fv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(fv>>>26)|0,fv&=67108863,I=Math.imul(Ct,tr),g=Math.imul(Ct,rr),g=g+Math.imul(Gt,tr)|0,O=Math.imul(Gt,rr),I=I+Math.imul(It,ir)|0,g=g+Math.imul(It,nr)|0,g=g+Math.imul(yt,ir)|0,O=O+Math.imul(yt,nr)|0,I=I+Math.imul(Re,or)|0,g=g+Math.imul(Re,ar)|0,g=g+Math.imul(Me,or)|0,O=O+Math.imul(Me,ar)|0,I=I+Math.imul($e,sr)|0,g=g+Math.imul($e,ur)|0,g=g+Math.imul(le,sr)|0,O=O+Math.imul(le,ur)|0,I=I+Math.imul(pe,cr)|0,g=g+Math.imul(pe,fr)|0,g=g+Math.imul(me,cr)|0,O=O+Math.imul(me,fr)|0,I=I+Math.imul(ce,lr)|0,g=g+Math.imul(ce,hr)|0,g=g+Math.imul(fe,lr)|0,O=O+Math.imul(fe,hr)|0;var lv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(lv>>>26)|0,lv&=67108863,I=Math.imul(Ct,ir),g=Math.imul(Ct,nr),g=g+Math.imul(Gt,ir)|0,O=Math.imul(Gt,nr),I=I+Math.imul(It,or)|0,g=g+Math.imul(It,ar)|0,g=g+Math.imul(yt,or)|0,O=O+Math.imul(yt,ar)|0,I=I+Math.imul(Re,sr)|0,g=g+Math.imul(Re,ur)|0,g=g+Math.imul(Me,sr)|0,O=O+Math.imul(Me,ur)|0,I=I+Math.imul($e,cr)|0,g=g+Math.imul($e,fr)|0,g=g+Math.imul(le,cr)|0,O=O+Math.imul(le,fr)|0,I=I+Math.imul(pe,lr)|0,g=g+Math.imul(pe,hr)|0,g=g+Math.imul(me,lr)|0,O=O+Math.imul(me,hr)|0;var hv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(hv>>>26)|0,hv&=67108863,I=Math.imul(Ct,or),g=Math.imul(Ct,ar),g=g+Math.imul(Gt,or)|0,O=Math.imul(Gt,ar),I=I+Math.imul(It,sr)|0,g=g+Math.imul(It,ur)|0,g=g+Math.imul(yt,sr)|0,O=O+Math.imul(yt,ur)|0,I=I+Math.imul(Re,cr)|0,g=g+Math.imul(Re,fr)|0,g=g+Math.imul(Me,cr)|0,O=O+Math.imul(Me,fr)|0,I=I+Math.imul($e,lr)|0,g=g+Math.imul($e,hr)|0,g=g+Math.imul(le,lr)|0,O=O+Math.imul(le,hr)|0;var dv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(dv>>>26)|0,dv&=67108863,I=Math.imul(Ct,sr),g=Math.imul(Ct,ur),g=g+Math.imul(Gt,sr)|0,O=Math.imul(Gt,ur),I=I+Math.imul(It,cr)|0,g=g+Math.imul(It,fr)|0,g=g+Math.imul(yt,cr)|0,O=O+Math.imul(yt,fr)|0,I=I+Math.imul(Re,lr)|0,g=g+Math.imul(Re,hr)|0,g=g+Math.imul(Me,lr)|0,O=O+Math.imul(Me,hr)|0;var pv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(pv>>>26)|0,pv&=67108863,I=Math.imul(Ct,cr),g=Math.imul(Ct,fr),g=g+Math.imul(Gt,cr)|0,O=Math.imul(Gt,fr),I=I+Math.imul(It,lr)|0,g=g+Math.imul(It,hr)|0,g=g+Math.imul(yt,lr)|0,O=O+Math.imul(yt,hr)|0;var gv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(gv>>>26)|0,gv&=67108863,I=Math.imul(Ct,lr),g=Math.imul(Ct,hr),g=g+Math.imul(Gt,lr)|0,O=Math.imul(Gt,hr);var mv=(N+I|0)+((g&8191)<<13)|0;return N=(O+(g>>>13)|0)+(mv>>>26)|0,mv&=67108863,A[0]=Jm,A[1]=Qm,A[2]=ev,A[3]=tv,A[4]=rv,A[5]=iv,A[6]=nv,A[7]=ov,A[8]=av,A[9]=sv,A[10]=uv,A[11]=cv,A[12]=fv,A[13]=lv,A[14]=hv,A[15]=dv,A[16]=pv,A[17]=gv,A[18]=mv,N!==0&&(A[19]=N,b.length++),b};Math.imul||(w=y);function T(x,h,v){v.negative=h.negative^x.negative,v.length=x.length+h.length;for(var b=0,S=0,E=0;E<v.length-1;E++){var A=S;S=0;for(var N=b&67108863,I=Math.min(E,h.length-1),g=Math.max(0,E-x.length+1);g<=I;g++){var O=E-g,ee=x.words[O]|0,X=h.words[g]|0,ne=ee*X,oe=ne&67108863;A=A+(ne/67108864|0)|0,oe=oe+N|0,N=oe&67108863,A=A+(oe>>>26)|0,S+=A>>>26,A&=67108863}v.words[E]=N,b=A,A=S}return b!==0?v.words[E]=b:v.length--,v.strip()}function B(x,h,v){var b=new C;return b.mulp(x,h,v)}n.prototype.mulTo=function(h,v){var b,S=this.length+h.length;return this.length===10&&h.length===10?b=w(this,h,v):S<63?b=y(this,h,v):S<1024?b=T(this,h,v):b=B(this,h,v),b};function C(x,h){this.x=x,this.y=h}C.prototype.makeRBT=function(h){for(var v=new Array(h),b=n.prototype._countBits(h)-1,S=0;S<h;S++)v[S]=this.revBin(S,b,h);return v},C.prototype.revBin=function(h,v,b){if(h===0||h===b-1)return h;for(var S=0,E=0;E<v;E++)S|=(h&1)<<v-E-1,h>>=1;return S},C.prototype.permute=function(h,v,b,S,E,A){for(var N=0;N<A;N++)S[N]=v[h[N]],E[N]=b[h[N]]},C.prototype.transform=function(h,v,b,S,E,A){this.permute(A,h,v,b,S,E);for(var N=1;N<E;N<<=1)for(var I=N<<1,g=Math.cos(2*Math.PI/I),O=Math.sin(2*Math.PI/I),ee=0;ee<E;ee+=I)for(var X=g,ne=O,oe=0;oe<N;oe++){var ue=b[ee+oe],ge=S[ee+oe],Ie=b[ee+oe+N],_e=S[ee+oe+N],L=X*Ie-ne*_e;_e=X*_e+ne*Ie,Ie=L,b[ee+oe]=ue+Ie,S[ee+oe]=ge+_e,b[ee+oe+N]=ue-Ie,S[ee+oe+N]=ge-_e,oe!==I&&(L=g*X-O*ne,ne=g*ne+O*X,X=L)}},C.prototype.guessLen13b=function(h,v){var b=Math.max(v,h)|1,S=b&1,E=0;for(b=b/2|0;b;b=b>>>1)E++;return 1<<E+1+S},C.prototype.conjugate=function(h,v,b){if(!(b<=1))for(var S=0;S<b/2;S++){var E=h[S];h[S]=h[b-S-1],h[b-S-1]=E,E=v[S],v[S]=-v[b-S-1],v[b-S-1]=-E}},C.prototype.normalize13b=function(h,v){for(var b=0,S=0;S<v/2;S++){var E=Math.round(h[2*S+1]/v)*8192+Math.round(h[2*S]/v)+b;h[S]=E&67108863,E<67108864?b=0:b=E/67108864|0}return h},C.prototype.convert13b=function(h,v,b,S){for(var E=0,A=0;A<v;A++)E=E+(h[A]|0),b[2*A]=E&8191,E=E>>>13,b[2*A+1]=E&8191,E=E>>>13;for(A=2*v;A<S;++A)b[A]=0;r(E===0),r((E&-8192)===0)},C.prototype.stub=function(h){for(var v=new Array(h),b=0;b<h;b++)v[b]=0;return v},C.prototype.mulp=function(h,v,b){var S=2*this.guessLen13b(h.length,v.length),E=this.makeRBT(S),A=this.stub(S),N=new Array(S),I=new Array(S),g=new Array(S),O=new Array(S),ee=new Array(S),X=new Array(S),ne=b.words;ne.length=S,this.convert13b(h.words,h.length,N,S),this.convert13b(v.words,v.length,O,S),this.transform(N,A,I,g,S,E),this.transform(O,A,ee,X,S,E);for(var oe=0;oe<S;oe++){var ue=I[oe]*ee[oe]-g[oe]*X[oe];g[oe]=I[oe]*X[oe]+g[oe]*ee[oe],I[oe]=ue}return this.conjugate(I,g,S),this.transform(I,g,ne,A,S,E),this.conjugate(ne,A,S),this.normalize13b(ne,S),b.negative=h.negative^v.negative,b.length=h.length+v.length,b.strip()},n.prototype.mul=function(h){var v=new n(null);return v.words=new Array(this.length+h.length),this.mulTo(h,v)},n.prototype.mulf=function(h){var v=new n(null);return v.words=new Array(this.length+h.length),B(this,h,v)},n.prototype.imul=function(h){return this.clone().mulTo(h,this)},n.prototype.imuln=function(h){r(typeof h=="number"),r(h<67108864);for(var v=0,b=0;b<this.length;b++){var S=(this.words[b]|0)*h,E=(S&67108863)+(v&67108863);v>>=26,v+=S/67108864|0,v+=E>>>26,this.words[b]=E&67108863}return v!==0&&(this.words[b]=v,this.length++),h===0&&(this.length=1,this._normSign()),this},n.prototype.muln=function(h){return this.clone().imuln(h)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(h){var v=m(h);if(v.length===0)return new n(1);for(var b=this,S=0;S<v.length&&v[S]===0;S++,b=b.sqr());if(++S<v.length)for(var E=b.sqr();S<v.length;S++,E=E.sqr())v[S]!==0&&(b=b.mul(E));return b},n.prototype.iushln=function(h){r(typeof h=="number"&&h>=0);var v=h%26,b=(h-v)/26,S=67108863>>>26-v<<26-v,E;if(v!==0){var A=0;for(E=0;E<this.length;E++){var N=this.words[E]&S,I=(this.words[E]|0)-N<<v;this.words[E]=I|A,A=N>>>26-v}A&&(this.words[E]=A,this.length++)}if(b!==0){for(E=this.length-1;E>=0;E--)this.words[E+b]=this.words[E];for(E=0;E<b;E++)this.words[E]=0;this.length+=b}return this.strip()},n.prototype.ishln=function(h){return r(this.negative===0),this.iushln(h)},n.prototype.iushrn=function(h,v,b){r(typeof h=="number"&&h>=0);var S;v?S=(v-v%26)/26:S=0;var E=h%26,A=Math.min((h-E)/26,this.length),N=67108863^67108863>>>E<<E,I=b;if(S-=A,S=Math.max(0,S),I){for(var g=0;g<A;g++)I.words[g]=this.words[g];I.length=A}if(A!==0)if(this.length>A)for(this.length-=A,g=0;g<this.length;g++)this.words[g]=this.words[g+A];else this.words[0]=0,this.length=1;var O=0;for(g=this.length-1;g>=0&&(O!==0||g>=S);g--){var ee=this.words[g]|0;this.words[g]=O<<26-E|ee>>>E,O=ee&N}return I&&O!==0&&(I.words[I.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(h,v,b){return r(this.negative===0),this.iushrn(h,v,b)},n.prototype.shln=function(h){return this.clone().ishln(h)},n.prototype.ushln=function(h){return this.clone().iushln(h)},n.prototype.shrn=function(h){return this.clone().ishrn(h)},n.prototype.ushrn=function(h){return this.clone().iushrn(h)},n.prototype.testn=function(h){r(typeof h=="number"&&h>=0);var v=h%26,b=(h-v)/26,S=1<<v;if(this.length<=b)return!1;var E=this.words[b];return!!(E&S)},n.prototype.imaskn=function(h){r(typeof h=="number"&&h>=0);var v=h%26,b=(h-v)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(v!==0&&b++,this.length=Math.min(b,this.length),v!==0){var S=67108863^67108863>>>v<<v;this.words[this.length-1]&=S}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(h){return this.clone().imaskn(h)},n.prototype.iaddn=function(h){return r(typeof h=="number"),r(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},n.prototype._iaddn=function(h){this.words[0]+=h;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},n.prototype.isubn=function(h){if(r(typeof h=="number"),r(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this.strip()},n.prototype.addn=function(h){return this.clone().iaddn(h)},n.prototype.subn=function(h){return this.clone().isubn(h)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(h,v,b){var S=h.length+b,E;this._expand(S);var A,N=0;for(E=0;E<h.length;E++){A=(this.words[E+b]|0)+N;var I=(h.words[E]|0)*v;A-=I&67108863,N=(A>>26)-(I/67108864|0),this.words[E+b]=A&67108863}for(;E<this.length-b;E++)A=(this.words[E+b]|0)+N,N=A>>26,this.words[E+b]=A&67108863;if(N===0)return this.strip();for(r(N===-1),N=0,E=0;E<this.length;E++)A=-(this.words[E]|0)+N,N=A>>26,this.words[E]=A&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(h,v){var b=this.length-h.length,S=this.clone(),E=h,A=E.words[E.length-1]|0,N=this._countBits(A);b=26-N,b!==0&&(E=E.ushln(b),S.iushln(b),A=E.words[E.length-1]|0);var I=S.length-E.length,g;if(v!=="mod"){g=new n(null),g.length=I+1,g.words=new Array(g.length);for(var O=0;O<g.length;O++)g.words[O]=0}var ee=S.clone()._ishlnsubmul(E,1,I);ee.negative===0&&(S=ee,g&&(g.words[I]=1));for(var X=I-1;X>=0;X--){var ne=(S.words[E.length+X]|0)*67108864+(S.words[E.length+X-1]|0);for(ne=Math.min(ne/A|0,67108863),S._ishlnsubmul(E,ne,X);S.negative!==0;)ne--,S.negative=0,S._ishlnsubmul(E,1,X),S.isZero()||(S.negative^=1);g&&(g.words[X]=ne)}return g&&g.strip(),S.strip(),v!=="div"&&b!==0&&S.iushrn(b),{div:g||null,mod:S}},n.prototype.divmod=function(h,v,b){if(r(!h.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var S,E,A;return this.negative!==0&&h.negative===0?(A=this.neg().divmod(h,v),v!=="mod"&&(S=A.div.neg()),v!=="div"&&(E=A.mod.neg(),b&&E.negative!==0&&E.iadd(h)),{div:S,mod:E}):this.negative===0&&h.negative!==0?(A=this.divmod(h.neg(),v),v!=="mod"&&(S=A.div.neg()),{div:S,mod:A.mod}):(this.negative&h.negative)!==0?(A=this.neg().divmod(h.neg(),v),v!=="div"&&(E=A.mod.neg(),b&&E.negative!==0&&E.isub(h)),{div:A.div,mod:E}):h.length>this.length||this.cmp(h)<0?{div:new n(0),mod:this}:h.length===1?v==="div"?{div:this.divn(h.words[0]),mod:null}:v==="mod"?{div:null,mod:new n(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new n(this.modn(h.words[0]))}:this._wordDiv(h,v)},n.prototype.div=function(h){return this.divmod(h,"div",!1).div},n.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},n.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},n.prototype.divRound=function(h){var v=this.divmod(h);if(v.mod.isZero())return v.div;var b=v.mod.abs(),S=h.abs().iushrn(1),E=h.words[0]&1,A=b.cmp(S);if(A<0||E===1&&A===0)return v.div;var N=new n(1);return N.negative=this.negative^h.negative,v.div.iadd(N)},n.prototype.modn=function(h){r(h<=67108863);for(var v=(1<<26)%h,b=0,S=this.length-1;S>=0;S--)b=(v*b+(this.words[S]|0))%h;return b},n.prototype.idivn=function(h){r(h<=67108863);for(var v=0,b=this.length-1;b>=0;b--){var S=(this.words[b]|0)+v*67108864;this.words[b]=S/h|0,v=S%h}return this.strip()},n.prototype.divn=function(h){return this.clone().idivn(h)},n.prototype.egcd=function(h){r(h.negative===0),r(!h.isZero());var v=this,b=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var S=new n(1),E=new n(0),A=new n(0),N=new n(1),I=0;v.isEven()&&b.isEven();)v.iushrn(1),b.iushrn(1),++I;for(var g=b.clone(),O=v.clone();!v.isZero();){for(var ee=0,X=1;(v.words[0]&X)===0&&ee<26;++ee,X<<=1);if(ee>0)for(v.iushrn(ee);ee-- >0;)(S.isOdd()||E.isOdd())&&(S.iadd(g),E.isub(O)),S.iushrn(1),E.iushrn(1);for(var ne=0,oe=1;(b.words[0]&oe)===0&&ne<26;++ne,oe<<=1);if(ne>0)for(b.iushrn(ne);ne-- >0;)(A.isOdd()||N.isOdd())&&(A.iadd(g),N.isub(O)),A.iushrn(1),N.iushrn(1);v.cmp(b)>=0?(v.isub(b),S.isub(A),E.isub(N)):(b.isub(v),A.isub(S),N.isub(E))}return{a:A,b:N,gcd:b.iushln(I)}},n.prototype._invmp=function(h){r(h.negative===0),r(!h.isZero());var v=this,b=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var S=new n(1),E=new n(0),A=b.clone();v.cmpn(1)>0&&b.cmpn(1)>0;){for(var N=0,I=1;(v.words[0]&I)===0&&N<26;++N,I<<=1);if(N>0)for(v.iushrn(N);N-- >0;)S.isOdd()&&S.iadd(A),S.iushrn(1);for(var g=0,O=1;(b.words[0]&O)===0&&g<26;++g,O<<=1);if(g>0)for(b.iushrn(g);g-- >0;)E.isOdd()&&E.iadd(A),E.iushrn(1);v.cmp(b)>=0?(v.isub(b),S.isub(E)):(b.isub(v),E.isub(S))}var ee;return v.cmpn(1)===0?ee=S:ee=E,ee.cmpn(0)<0&&ee.iadd(h),ee},n.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var v=this.clone(),b=h.clone();v.negative=0,b.negative=0;for(var S=0;v.isEven()&&b.isEven();S++)v.iushrn(1),b.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;b.isEven();)b.iushrn(1);var E=v.cmp(b);if(E<0){var A=v;v=b,b=A}else if(E===0||b.cmpn(1)===0)break;v.isub(b)}while(!0);return b.iushln(S)},n.prototype.invm=function(h){return this.egcd(h).a.umod(h)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(h){return this.words[0]&h},n.prototype.bincn=function(h){r(typeof h=="number");var v=h%26,b=(h-v)/26,S=1<<v;if(this.length<=b)return this._expand(b+1),this.words[b]|=S,this;for(var E=S,A=b;E!==0&&A<this.length;A++){var N=this.words[A]|0;N+=E,E=N>>>26,N&=67108863,this.words[A]=N}return E!==0&&(this.words[A]=E,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(h){var v=h<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var b;if(this.length>1)b=1;else{v&&(h=-h),r(h<=67108863,"Number is too big");var S=this.words[0]|0;b=S===h?0:S<h?-1:1}return this.negative!==0?-b|0:b},n.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var v=this.ucmp(h);return this.negative!==0?-v|0:v},n.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var v=0,b=this.length-1;b>=0;b--){var S=this.words[b]|0,E=h.words[b]|0;if(S!==E){S<E?v=-1:S>E&&(v=1);break}}return v},n.prototype.gtn=function(h){return this.cmpn(h)===1},n.prototype.gt=function(h){return this.cmp(h)===1},n.prototype.gten=function(h){return this.cmpn(h)>=0},n.prototype.gte=function(h){return this.cmp(h)>=0},n.prototype.ltn=function(h){return this.cmpn(h)===-1},n.prototype.lt=function(h){return this.cmp(h)===-1},n.prototype.lten=function(h){return this.cmpn(h)<=0},n.prototype.lte=function(h){return this.cmp(h)<=0},n.prototype.eqn=function(h){return this.cmpn(h)===0},n.prototype.eq=function(h){return this.cmp(h)===0},n.red=function(h){return new z(h)},n.prototype.toRed=function(h){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(h){return this.red=h,this},n.prototype.forceRed=function(h){return r(!this.red,"Already a number in reduction context"),this._forceRed(h)},n.prototype.redAdd=function(h){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},n.prototype.redIAdd=function(h){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},n.prototype.redSub=function(h){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},n.prototype.redISub=function(h){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},n.prototype.redShl=function(h){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},n.prototype.redMul=function(h){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},n.prototype.redIMul=function(h){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(h){return r(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var q={k256:null,p224:null,p192:null,p25519:null};function F(x,h){this.name=x,this.p=new n(h,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var h=new n(null);return h.words=new Array(Math.ceil(this.n/13)),h},F.prototype.ireduce=function(h){var v=h,b;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),b=v.bitLength();while(b>this.n);var S=b<this.n?-1:v.ucmp(this.p);return S===0?(v.words[0]=0,v.length=1):S>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},F.prototype.split=function(h,v){h.iushrn(this.n,0,v)},F.prototype.imulK=function(h){return h.imul(this.k)};function P(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(P,F),P.prototype.split=function(h,v){for(var b=4194303,S=Math.min(h.length,9),E=0;E<S;E++)v.words[E]=h.words[E];if(v.length=S,h.length<=9){h.words[0]=0,h.length=1;return}var A=h.words[9];for(v.words[v.length++]=A&b,E=10;E<h.length;E++){var N=h.words[E]|0;h.words[E-10]=(N&b)<<4|A>>>22,A=N}A>>>=22,h.words[E-10]=A,A===0&&h.length>10?h.length-=10:h.length-=9},P.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var v=0,b=0;b<h.length;b++){var S=h.words[b]|0;v+=S*977,h.words[b]=v&67108863,v=S*64+(v/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function k(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(k,F);function M(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(M,F);function K(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(K,F),K.prototype.imulK=function(h){for(var v=0,b=0;b<h.length;b++){var S=(h.words[b]|0)*19+v,E=S&67108863;S>>>=26,h.words[b]=E,v=S}return v!==0&&(h.words[h.length++]=v),h},n._prime=function(h){if(q[h])return q[h];var v;if(h==="k256")v=new P;else if(h==="p224")v=new k;else if(h==="p192")v=new M;else if(h==="p25519")v=new K;else throw new Error("Unknown prime "+h);return q[h]=v,v};function z(x){if(typeof x=="string"){var h=n._prime(x);this.m=h.p,this.prime=h}else r(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}z.prototype._verify1=function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,v){r((h.negative|v.negative)===0,"red works only with positives"),r(h.red&&h.red===v.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,v){this._verify2(h,v);var b=h.add(v);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,v){this._verify2(h,v);var b=h.iadd(v);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,v){this._verify2(h,v);var b=h.sub(v);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,v){this._verify2(h,v);var b=h.isub(v);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,v){return this._verify1(h),this.imod(h.ushln(v))},z.prototype.imul=function(h,v){return this._verify2(h,v),this.imod(h.imul(v))},z.prototype.mul=function(h,v){return this._verify2(h,v),this.imod(h.mul(v))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var v=this.m.andln(3);if(r(v%2===1),v===3){var b=this.m.add(new n(1)).iushrn(2);return this.pow(h,b)}for(var S=this.m.subn(1),E=0;!S.isZero()&&S.andln(1)===0;)E++,S.iushrn(1);r(!S.isZero());var A=new n(1).toRed(this),N=A.redNeg(),I=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new n(2*g*g).toRed(this);this.pow(g,I).cmp(N)!==0;)g.redIAdd(N);for(var O=this.pow(g,S),ee=this.pow(h,S.addn(1).iushrn(1)),X=this.pow(h,S),ne=E;X.cmp(A)!==0;){for(var oe=X,ue=0;oe.cmp(A)!==0;ue++)oe=oe.redSqr();r(ue<ne);var ge=this.pow(O,new n(1).iushln(ne-ue-1));ee=ee.redMul(ge),O=ge.redSqr(),X=X.redMul(O),ne=ue}return ee},z.prototype.invm=function(h){var v=h._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},z.prototype.pow=function(h,v){if(v.isZero())return new n(1).toRed(this);if(v.cmpn(1)===0)return h.clone();var b=4,S=new Array(1<<b);S[0]=new n(1).toRed(this),S[1]=h;for(var E=2;E<S.length;E++)S[E]=this.mul(S[E-1],h);var A=S[0],N=0,I=0,g=v.bitLength()%26;for(g===0&&(g=26),E=v.length-1;E>=0;E--){for(var O=v.words[E],ee=g-1;ee>=0;ee--){var X=O>>ee&1;if(A!==S[0]&&(A=this.sqr(A)),X===0&&N===0){I=0;continue}N<<=1,N|=X,I++,!(I!==b&&(E!==0||ee!==0))&&(A=this.mul(A,S[N]),I=0,N=0)}g=26}return A},z.prototype.convertTo=function(h){var v=h.umod(this.m);return v===h?v.clone():v},z.prototype.convertFrom=function(h){var v=h.clone();return v.red=null,v},n.mont=function(h){return new V(h)};function V(x){z.call(this,x),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var v=this.imod(h.mul(this.rinv));return v.red=null,v},V.prototype.imul=function(h,v){if(h.isZero()||v.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(v),S=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=b.isub(S).iushrn(this.shift),A=E;return E.cmp(this.m)>=0?A=E.isub(this.m):E.cmpn(0)<0&&(A=E.iadd(this.m)),A._forceRed(this)},V.prototype.mul=function(h,v){if(h.isZero()||v.isZero())return new n(0)._forceRed(this);var b=h.mul(v),S=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=b.isub(S).iushrn(this.shift),A=E;return E.cmp(this.m)>=0?A=E.isub(this.m):E.cmpn(0)<0&&(A=E.iadd(this.m)),A._forceRed(this)},V.prototype.invm=function(h){var v=this.imod(h._invmp(this.m).mul(this.r2));return v._forceRed(this)}})(typeof dy>"u"||dy,UA)});var py=R((jte,HA)=>{"use strict";p();HA.exports="8.0.1"});var zA=R((Kte,jA)=>{"use strict";p();var cj="https://docs.moneybutton.com/";jA.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+cj+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]});var ti=R((Gte,my)=>{"use strict";p();var gy=Ve();function fj(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}var KA=function(e,t){var r=function(){if(gy.isString(t.message))this.message=fj(t.message,arguments);else if(gy.isFunction(t.message))this.message=t.message.apply(null,arguments);else throw new Error("Invalid error definition for "+t.name);this.stack=this.message+`
|
|
11
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var nj=jr().Buffer,fp=globalThis.crypto||globalThis.msCrypto;fp&&fp.getRandomValues?ly.exports=oj:ly.exports=ij;function oj(e,t){if(e>rj)throw new RangeError("requested too many random bytes");var r=nj.allocUnsafe(e);if(e>0)if(e>fy)for(var i=0;i<e;i+=fy)fp.getRandomValues(r.slice(i,i+fy));else fp.getRandomValues(r);return typeof t=="function"?_.default.nextTick(function(){t(null,r)}):r}});var Dt=R(lp=>{"use strict";p();lp.createHash=xA();lp.createHmac=BA();lp.randomBytes=NA()});var Ri=R((Lte,LA)=>{"use strict";p();var CA=65536;function ws(){}ws.getRandomBuffer=function(e){var t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function")return ws._fromGetRandomValues(t,e);try{var r=Dt();if(r&&typeof r.randomBytes=="function")return r.randomBytes(e)}catch{}throw new Error("bsv: no CSPRNG available in this environment (needs globalThis.crypto.getRandomValues or node crypto)")};ws._fromGetRandomValues=function(e,t){for(var r=l.Buffer.alloc(t),i=0;i<t;i+=CA){var n=new Uint8Array(Math.min(CA,t-i));e.getRandomValues(n),l.Buffer.from(n).copy(r,i)}return r};ws.getRandomBufferNode=function(e){var t=Dt();return t.randomBytes(e)};ws.getRandomBufferBrowser=function(e){var t=typeof globalThis<"u"?globalThis:{},r=null;if(t.crypto&&typeof t.crypto.getRandomValues=="function"?r=t.crypto:t.msCrypto&&typeof t.msCrypto.getRandomValues=="function"&&(r=t.msCrypto),!r)throw new Error("window.crypto.getRandomValues not available");return ws._fromGetRandomValues(r,e)};LA.exports=ws});var Ve=R((Dte,MA)=>{"use strict";p();var aj=Ri(),bt={};bt.isArray=e=>Array.isArray(e);bt.isNumber=e=>typeof e=="number";bt.isObject=e=>e&&typeof e=="object";bt.isString=e=>typeof e=="string";bt.isUndefined=e=>typeof e>"u";bt.isFunction=e=>typeof e=="function";bt.isNull=e=>e===null;bt.isDate=e=>e instanceof Date;bt.extend=(e,t)=>Object.assign(e,t);bt.noop=()=>{};bt.every=(e,t)=>e.every(t||(r=>r));bt.map=(e,t)=>Array.from(e).map(t||(r=>r));bt.includes=(e,t)=>e.includes(t);bt.each=(e,t)=>e.forEach(t);bt.clone=e=>Object.assign({},e);bt.pick=(e,t)=>{let r={};return t.forEach(i=>{typeof e[i]<"u"&&(r[i]=e[i])}),r};bt.values=e=>Object.values(e);bt.filter=(e,t)=>e.filter(t);bt.reduce=(e,t,r)=>e.reduce(t,r);bt.without=(e,t)=>e.filter(r=>r!==t);bt.shuffle=e=>{let t=e.slice(0);for(let r=t.length-1;r>0;r--){let n=aj.getRandomBuffer(4).readUInt32BE(0)/4294967296,o=Math.floor(n*(r+1));[t[r],t[o]]=[t[o],t[r]]}return t};bt.difference=(e,t)=>e.filter(r=>!t.includes(r));bt.findIndex=(e,t)=>e.findIndex(t);bt.some=(e,t)=>e.some(t);bt.range=e=>[...Array(e).keys()];MA.exports=bt});var Zu=R((Fte,FA)=>{"use strict";p();var hy=Ve(),DA=Lt(),Wu="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),qA={};for(Zf=0;Zf<Wu.length;Zf++)qA[Wu[Zf]]=Zf;var Zf;function sj(e){if(e.length===0)return"";var t=[0],r,i,n;for(r=0;r<e.length;r++){for(i=0,n=e[r];i<t.length;i++)n+=t[i]<<8,t[i]=n%58,n=n/58|0;for(;n>0;)t.push(n%58),n=n/58|0}var o="";for(r=0;e[r]===0&&r<e.length-1;r++)o+=Wu[0];for(r=t.length-1;r>=0;r--)o+=Wu[t[r]];return o}function uj(e){if(e.length===0)return l.Buffer.alloc(0);var t=[0],r,i,n;for(r=0;r<e.length;r++){var o=qA[e[r]];if(o===void 0)throw new Error("Non-base58 character");for(i=0,n=o;i<t.length;i++)n+=t[i]*58,t[i]=n&255,n>>=8;for(;n>0;)t.push(n&255),n>>=8}for(r=0;e[r]===Wu[0]&&r<e.length-1;r++)t.push(0);return l.Buffer.from(t.reverse())}var Mr=function e(t){if(!(this instanceof e))return new e(t);if(l.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};Mr.validCharacters=function(t){return DA.Buffer.isBuffer(t)&&(t=t.toString()),hy.every(hy.map(t,function(r){return hy.includes(Wu,r)}))};Mr.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};Mr.encode=function(e){if(!DA.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return sj(e)};Mr.decode=function(e){if(typeof e!="string")throw new Error("Input should be a string");return uj(e)};Mr.prototype.fromBuffer=function(e){return this.buf=e,this};Mr.fromBuffer=function(e){return new Mr().fromBuffer(e)};Mr.fromHex=function(e){return Mr.fromBuffer(l.Buffer.from(e,"hex"))};Mr.prototype.fromString=function(e){var t=Mr.decode(e);return this.buf=t,this};Mr.fromString=function(e){return new Mr().fromString(e)};Mr.prototype.toBuffer=function(){return this.buf};Mr.prototype.toHex=function(){return this.toBuffer().toString("hex")};Mr.prototype.toString=function(){return Mr.encode(this.buf)};FA.exports=Mr});var hp=R((UA,dy)=>{p();(function(e,t){"use strict";function r(x,h){if(!x)throw new Error(h||"Assertion failed")}function i(x,h){x.super_=h;var v=function(){};v.prototype=h.prototype,x.prototype=new v,x.prototype.constructor=x}function n(x,h,v){if(n.isBN(x))return x;this.negative=0,this.words=null,this.length=0,this.red=null,x!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(x||0,h||10,v||"be"))}typeof e=="object"?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Lt().Buffer}catch{}n.isBN=function(h){return h instanceof n?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===n.wordSize&&Array.isArray(h.words)},n.max=function(h,v){return h.cmp(v)>0?h:v},n.min=function(h,v){return h.cmp(v)<0?h:v},n.prototype._init=function(h,v,b){if(typeof h=="number")return this._initNumber(h,v,b);if(typeof h=="object")return this._initArray(h,v,b);v==="hex"&&(v=16),r(v===(v|0)&&v>=2&&v<=36),h=h.toString().replace(/\s+/g,"");var S=0;h[0]==="-"&&(S++,this.negative=1),S<h.length&&(v===16?this._parseHex(h,S,b):(this._parseBase(h,v,S),b==="le"&&this._initArray(this.toArray(),v,b)))},n.prototype._initNumber=function(h,v,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),v,b)},n.prototype._initArray=function(h,v,b){if(r(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E,A,N=0;if(b==="be")for(S=h.length-1,E=0;S>=0;S-=3)A=h[S]|h[S-1]<<8|h[S-2]<<16,this.words[E]|=A<<N&67108863,this.words[E+1]=A>>>26-N&67108863,N+=24,N>=26&&(N-=26,E++);else if(b==="le")for(S=0,E=0;S<h.length;S+=3)A=h[S]|h[S+1]<<8|h[S+2]<<16,this.words[E]|=A<<N&67108863,this.words[E+1]=A>>>26-N&67108863,N+=24,N>=26&&(N-=26,E++);return this.strip()};function a(x,h){var v=x.charCodeAt(h);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function s(x,h,v){var b=a(x,v);return v-1>=h&&(b|=a(x,v-1)<<4),b}n.prototype._parseHex=function(h,v,b){this.length=Math.ceil((h.length-v)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E=0,A=0,N;if(b==="be")for(S=h.length-1;S>=v;S-=2)N=s(h,v,S)<<E,this.words[A]|=N&67108863,E>=18?(E-=18,A+=1,this.words[A]|=N>>>26):E+=8;else{var I=h.length-v;for(S=I%2===0?v+1:v;S<h.length;S+=2)N=s(h,v,S)<<E,this.words[A]|=N&67108863,E>=18?(E-=18,A+=1,this.words[A]|=N>>>26):E+=8}this.strip()};function u(x,h,v,b){for(var S=0,E=Math.min(x.length,v),A=h;A<E;A++){var N=x.charCodeAt(A)-48;S*=b,N>=49?S+=N-49+10:N>=17?S+=N-17+10:S+=N}return S}n.prototype._parseBase=function(h,v,b){this.words=[0],this.length=1;for(var S=0,E=1;E<=67108863;E*=v)S++;S--,E=E/v|0;for(var A=h.length-b,N=A%S,I=Math.min(A,A-N)+b,g=0,O=b;O<I;O+=S)g=u(h,O,O+S,v),this.imuln(E),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(N!==0){var ee=1;for(g=u(h,O,h.length,v),O=0;O<N;O++)ee*=v;this.imuln(ee),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},n.prototype.copy=function(h){h.words=new Array(this.length);for(var v=0;v<this.length;v++)h.words[v]=this.words[v];h.length=this.length,h.negative=this.negative,h.red=this.red},n.prototype.clone=function(){var h=new n(null);return this.copy(h),h},n.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(h,v){h=h||10,v=v|0||1;var b;if(h===16||h==="hex"){b="";for(var S=0,E=0,A=0;A<this.length;A++){var N=this.words[A],I=((N<<S|E)&16777215).toString(16);E=N>>>24-S&16777215,S+=2,S>=26&&(S-=26,A--),E!==0||A!==this.length-1?b=c[6-I.length]+I+b:b=I+b}for(E!==0&&(b=E.toString(16)+b);b.length%v!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var g=f[h],O=d[h];b="";var ee=this.clone();for(ee.negative=0;!ee.isZero();){var X=ee.modn(O).toString(h);ee=ee.idivn(O),ee.isZero()?b=X+b:b=c[g-X.length]+X+b}for(this.isZero()&&(b="0"+b);b.length%v!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(h,v){return r(typeof o<"u"),this.toArrayLike(o,h,v)},n.prototype.toArray=function(h,v){return this.toArrayLike(Array,h,v)},n.prototype.toArrayLike=function(h,v,b){var S=this.byteLength(),E=b||Math.max(1,S);r(S<=E,"byte array longer than desired length"),r(E>0,"Requested array length <= 0"),this.strip();var A=v==="le",N=new h(E),I,g,O=this.clone();if(A){for(g=0;!O.isZero();g++)I=O.andln(255),O.iushrn(8),N[g]=I;for(;g<E;g++)N[g]=0}else{for(g=0;g<E-S;g++)N[g]=0;for(g=0;!O.isZero();g++)I=O.andln(255),O.iushrn(8),N[E-g-1]=I}return N},Math.clz32?n.prototype._countBits=function(h){return 32-Math.clz32(h)}:n.prototype._countBits=function(h){var v=h,b=0;return v>=4096&&(b+=13,v>>>=13),v>=64&&(b+=7,v>>>=7),v>=8&&(b+=4,v>>>=4),v>=2&&(b+=2,v>>>=2),b+v},n.prototype._zeroBits=function(h){if(h===0)return 26;var v=h,b=0;return(v&8191)===0&&(b+=13,v>>>=13),(v&127)===0&&(b+=7,v>>>=7),(v&15)===0&&(b+=4,v>>>=4),(v&3)===0&&(b+=2,v>>>=2),(v&1)===0&&b++,b},n.prototype.bitLength=function(){var h=this.words[this.length-1],v=this._countBits(h);return(this.length-1)*26+v};function m(x){for(var h=new Array(x.bitLength()),v=0;v<h.length;v++){var b=v/26|0,S=v%26;h[v]=(x.words[b]&1<<S)>>>S}return h}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,v=0;v<this.length;v++){var b=this._zeroBits(this.words[v]);if(h+=b,b!==26)break}return h},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},n.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]|h.words[v];return this.strip()},n.prototype.ior=function(h){return r((this.negative|h.negative)===0),this.iuor(h)},n.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},n.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},n.prototype.iuand=function(h){var v;this.length>h.length?v=h:v=this;for(var b=0;b<v.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=v.length,this.strip()},n.prototype.iand=function(h){return r((this.negative|h.negative)===0),this.iuand(h)},n.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},n.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},n.prototype.iuxor=function(h){var v,b;this.length>h.length?(v=this,b=h):(v=h,b=this);for(var S=0;S<b.length;S++)this.words[S]=v.words[S]^b.words[S];if(this!==v)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=v.length,this.strip()},n.prototype.ixor=function(h){return r((this.negative|h.negative)===0),this.iuxor(h)},n.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},n.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},n.prototype.inotn=function(h){r(typeof h=="number"&&h>=0);var v=Math.ceil(h/26)|0,b=h%26;this._expand(v),b>0&&v--;for(var S=0;S<v;S++)this.words[S]=~this.words[S]&67108863;for(b>0&&(this.words[S]=~this.words[S]&67108863>>26-b,S++);S<this.length;S++)this.words[S]=0;return this.strip()},n.prototype.notn=function(h){return this.clone().inotn(h)},n.prototype.setn=function(h,v){r(typeof h=="number"&&h>=0);var b=h/26|0,S=h%26;return this._expand(b+1),v?this.words[b]=this.words[b]|1<<S:this.words[b]=this.words[b]&~(1<<S),this.strip()},n.prototype.iadd=function(h){var v;if(this.negative!==0&&h.negative===0)return this.negative=0,v=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,v=this.isub(h),h.negative=1,v._normSign();var b,S;this.length>h.length?(b=this,S=h):(b=h,S=this);for(var E=0,A=0;A<S.length;A++)v=(b.words[A]|0)+(S.words[A]|0)+E,this.words[A]=v&67108863,E=v>>>26;for(;E!==0&&A<b.length;A++)v=(b.words[A]|0)+E,this.words[A]=v&67108863,E=v>>>26;if(this.length=b.length,E!==0)this.words[this.length]=E,this.length++;else if(b!==this)for(;A<b.length;A++)this.words[A]=b.words[A];return this},n.prototype.add=function(h){var v;return h.negative!==0&&this.negative===0?(h.negative=0,v=this.sub(h),h.negative^=1,v):h.negative===0&&this.negative!==0?(this.negative=0,v=h.sub(this),this.negative=1,v):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},n.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var v=this.iadd(h);return h.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,E;b>0?(S=this,E=h):(S=h,E=this);for(var A=0,N=0;N<E.length;N++)v=(S.words[N]|0)-(E.words[N]|0)+A,A=v>>26,this.words[N]=v&67108863;for(;A!==0&&N<S.length;N++)v=(S.words[N]|0)+A,A=v>>26,this.words[N]=v&67108863;if(A===0&&N<S.length&&S!==this)for(;N<S.length;N++)this.words[N]=S.words[N];return this.length=Math.max(this.length,N),S!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(h){return this.clone().isub(h)};function y(x,h,v){v.negative=h.negative^x.negative;var b=x.length+h.length|0;v.length=b,b=b-1|0;var S=x.words[0]|0,E=h.words[0]|0,A=S*E,N=A&67108863,I=A/67108864|0;v.words[0]=N;for(var g=1;g<b;g++){for(var O=I>>>26,ee=I&67108863,X=Math.min(g,h.length-1),ne=Math.max(0,g-x.length+1);ne<=X;ne++){var oe=g-ne|0;S=x.words[oe]|0,E=h.words[ne]|0,A=S*E+ee,O+=A/67108864|0,ee=A&67108863}v.words[g]=ee|0,I=O|0}return I!==0?v.words[g]=I|0:v.length--,v.strip()}var w=function(h,v,b){var S=h.words,E=v.words,A=b.words,N=0,I,g,O,ee=S[0]|0,X=ee&8191,ne=ee>>>13,oe=S[1]|0,ue=oe&8191,ge=oe>>>13,Ie=S[2]|0,_e=Ie&8191,L=Ie>>>13,G=S[3]|0,Q=G&8191,re=G>>>13,de=S[4]|0,ce=de&8191,fe=de>>>13,Se=S[5]|0,pe=Se&8191,me=Se>>>13,xt=S[6]|0,$e=xt&8191,le=xt>>>13,Te=S[7]|0,Re=Te&8191,Me=Te>>>13,xo=S[8]|0,It=xo&8191,yt=xo>>>13,Hh=S[9]|0,Ct=Hh&8191,Gt=Hh>>>13,mw=E[0]|0,Wt=mw&8191,Zt=mw>>>13,vw=E[1]|0,Yt=vw&8191,$t=vw>>>13,yw=E[2]|0,Xt=yw&8191,Jt=yw>>>13,bw=E[3]|0,Qt=bw&8191,er=bw>>>13,_w=E[4]|0,tr=_w&8191,rr=_w>>>13,Sw=E[5]|0,ir=Sw&8191,nr=Sw>>>13,ww=E[6]|0,or=ww&8191,ar=ww>>>13,Ew=E[7]|0,sr=Ew&8191,ur=Ew>>>13,xw=E[8]|0,cr=xw&8191,fr=xw>>>13,Iw=E[9]|0,lr=Iw&8191,hr=Iw>>>13;b.negative=h.negative^v.negative,b.length=19,I=Math.imul(X,Wt),g=Math.imul(X,Zt),g=g+Math.imul(ne,Wt)|0,O=Math.imul(ne,Zt);var Jm=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(Jm>>>26)|0,Jm&=67108863,I=Math.imul(ue,Wt),g=Math.imul(ue,Zt),g=g+Math.imul(ge,Wt)|0,O=Math.imul(ge,Zt),I=I+Math.imul(X,Yt)|0,g=g+Math.imul(X,$t)|0,g=g+Math.imul(ne,Yt)|0,O=O+Math.imul(ne,$t)|0;var Qm=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(Qm>>>26)|0,Qm&=67108863,I=Math.imul(_e,Wt),g=Math.imul(_e,Zt),g=g+Math.imul(L,Wt)|0,O=Math.imul(L,Zt),I=I+Math.imul(ue,Yt)|0,g=g+Math.imul(ue,$t)|0,g=g+Math.imul(ge,Yt)|0,O=O+Math.imul(ge,$t)|0,I=I+Math.imul(X,Xt)|0,g=g+Math.imul(X,Jt)|0,g=g+Math.imul(ne,Xt)|0,O=O+Math.imul(ne,Jt)|0;var ev=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(ev>>>26)|0,ev&=67108863,I=Math.imul(Q,Wt),g=Math.imul(Q,Zt),g=g+Math.imul(re,Wt)|0,O=Math.imul(re,Zt),I=I+Math.imul(_e,Yt)|0,g=g+Math.imul(_e,$t)|0,g=g+Math.imul(L,Yt)|0,O=O+Math.imul(L,$t)|0,I=I+Math.imul(ue,Xt)|0,g=g+Math.imul(ue,Jt)|0,g=g+Math.imul(ge,Xt)|0,O=O+Math.imul(ge,Jt)|0,I=I+Math.imul(X,Qt)|0,g=g+Math.imul(X,er)|0,g=g+Math.imul(ne,Qt)|0,O=O+Math.imul(ne,er)|0;var tv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(tv>>>26)|0,tv&=67108863,I=Math.imul(ce,Wt),g=Math.imul(ce,Zt),g=g+Math.imul(fe,Wt)|0,O=Math.imul(fe,Zt),I=I+Math.imul(Q,Yt)|0,g=g+Math.imul(Q,$t)|0,g=g+Math.imul(re,Yt)|0,O=O+Math.imul(re,$t)|0,I=I+Math.imul(_e,Xt)|0,g=g+Math.imul(_e,Jt)|0,g=g+Math.imul(L,Xt)|0,O=O+Math.imul(L,Jt)|0,I=I+Math.imul(ue,Qt)|0,g=g+Math.imul(ue,er)|0,g=g+Math.imul(ge,Qt)|0,O=O+Math.imul(ge,er)|0,I=I+Math.imul(X,tr)|0,g=g+Math.imul(X,rr)|0,g=g+Math.imul(ne,tr)|0,O=O+Math.imul(ne,rr)|0;var rv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(rv>>>26)|0,rv&=67108863,I=Math.imul(pe,Wt),g=Math.imul(pe,Zt),g=g+Math.imul(me,Wt)|0,O=Math.imul(me,Zt),I=I+Math.imul(ce,Yt)|0,g=g+Math.imul(ce,$t)|0,g=g+Math.imul(fe,Yt)|0,O=O+Math.imul(fe,$t)|0,I=I+Math.imul(Q,Xt)|0,g=g+Math.imul(Q,Jt)|0,g=g+Math.imul(re,Xt)|0,O=O+Math.imul(re,Jt)|0,I=I+Math.imul(_e,Qt)|0,g=g+Math.imul(_e,er)|0,g=g+Math.imul(L,Qt)|0,O=O+Math.imul(L,er)|0,I=I+Math.imul(ue,tr)|0,g=g+Math.imul(ue,rr)|0,g=g+Math.imul(ge,tr)|0,O=O+Math.imul(ge,rr)|0,I=I+Math.imul(X,ir)|0,g=g+Math.imul(X,nr)|0,g=g+Math.imul(ne,ir)|0,O=O+Math.imul(ne,nr)|0;var iv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(iv>>>26)|0,iv&=67108863,I=Math.imul($e,Wt),g=Math.imul($e,Zt),g=g+Math.imul(le,Wt)|0,O=Math.imul(le,Zt),I=I+Math.imul(pe,Yt)|0,g=g+Math.imul(pe,$t)|0,g=g+Math.imul(me,Yt)|0,O=O+Math.imul(me,$t)|0,I=I+Math.imul(ce,Xt)|0,g=g+Math.imul(ce,Jt)|0,g=g+Math.imul(fe,Xt)|0,O=O+Math.imul(fe,Jt)|0,I=I+Math.imul(Q,Qt)|0,g=g+Math.imul(Q,er)|0,g=g+Math.imul(re,Qt)|0,O=O+Math.imul(re,er)|0,I=I+Math.imul(_e,tr)|0,g=g+Math.imul(_e,rr)|0,g=g+Math.imul(L,tr)|0,O=O+Math.imul(L,rr)|0,I=I+Math.imul(ue,ir)|0,g=g+Math.imul(ue,nr)|0,g=g+Math.imul(ge,ir)|0,O=O+Math.imul(ge,nr)|0,I=I+Math.imul(X,or)|0,g=g+Math.imul(X,ar)|0,g=g+Math.imul(ne,or)|0,O=O+Math.imul(ne,ar)|0;var nv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(nv>>>26)|0,nv&=67108863,I=Math.imul(Re,Wt),g=Math.imul(Re,Zt),g=g+Math.imul(Me,Wt)|0,O=Math.imul(Me,Zt),I=I+Math.imul($e,Yt)|0,g=g+Math.imul($e,$t)|0,g=g+Math.imul(le,Yt)|0,O=O+Math.imul(le,$t)|0,I=I+Math.imul(pe,Xt)|0,g=g+Math.imul(pe,Jt)|0,g=g+Math.imul(me,Xt)|0,O=O+Math.imul(me,Jt)|0,I=I+Math.imul(ce,Qt)|0,g=g+Math.imul(ce,er)|0,g=g+Math.imul(fe,Qt)|0,O=O+Math.imul(fe,er)|0,I=I+Math.imul(Q,tr)|0,g=g+Math.imul(Q,rr)|0,g=g+Math.imul(re,tr)|0,O=O+Math.imul(re,rr)|0,I=I+Math.imul(_e,ir)|0,g=g+Math.imul(_e,nr)|0,g=g+Math.imul(L,ir)|0,O=O+Math.imul(L,nr)|0,I=I+Math.imul(ue,or)|0,g=g+Math.imul(ue,ar)|0,g=g+Math.imul(ge,or)|0,O=O+Math.imul(ge,ar)|0,I=I+Math.imul(X,sr)|0,g=g+Math.imul(X,ur)|0,g=g+Math.imul(ne,sr)|0,O=O+Math.imul(ne,ur)|0;var ov=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(ov>>>26)|0,ov&=67108863,I=Math.imul(It,Wt),g=Math.imul(It,Zt),g=g+Math.imul(yt,Wt)|0,O=Math.imul(yt,Zt),I=I+Math.imul(Re,Yt)|0,g=g+Math.imul(Re,$t)|0,g=g+Math.imul(Me,Yt)|0,O=O+Math.imul(Me,$t)|0,I=I+Math.imul($e,Xt)|0,g=g+Math.imul($e,Jt)|0,g=g+Math.imul(le,Xt)|0,O=O+Math.imul(le,Jt)|0,I=I+Math.imul(pe,Qt)|0,g=g+Math.imul(pe,er)|0,g=g+Math.imul(me,Qt)|0,O=O+Math.imul(me,er)|0,I=I+Math.imul(ce,tr)|0,g=g+Math.imul(ce,rr)|0,g=g+Math.imul(fe,tr)|0,O=O+Math.imul(fe,rr)|0,I=I+Math.imul(Q,ir)|0,g=g+Math.imul(Q,nr)|0,g=g+Math.imul(re,ir)|0,O=O+Math.imul(re,nr)|0,I=I+Math.imul(_e,or)|0,g=g+Math.imul(_e,ar)|0,g=g+Math.imul(L,or)|0,O=O+Math.imul(L,ar)|0,I=I+Math.imul(ue,sr)|0,g=g+Math.imul(ue,ur)|0,g=g+Math.imul(ge,sr)|0,O=O+Math.imul(ge,ur)|0,I=I+Math.imul(X,cr)|0,g=g+Math.imul(X,fr)|0,g=g+Math.imul(ne,cr)|0,O=O+Math.imul(ne,fr)|0;var av=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(av>>>26)|0,av&=67108863,I=Math.imul(Ct,Wt),g=Math.imul(Ct,Zt),g=g+Math.imul(Gt,Wt)|0,O=Math.imul(Gt,Zt),I=I+Math.imul(It,Yt)|0,g=g+Math.imul(It,$t)|0,g=g+Math.imul(yt,Yt)|0,O=O+Math.imul(yt,$t)|0,I=I+Math.imul(Re,Xt)|0,g=g+Math.imul(Re,Jt)|0,g=g+Math.imul(Me,Xt)|0,O=O+Math.imul(Me,Jt)|0,I=I+Math.imul($e,Qt)|0,g=g+Math.imul($e,er)|0,g=g+Math.imul(le,Qt)|0,O=O+Math.imul(le,er)|0,I=I+Math.imul(pe,tr)|0,g=g+Math.imul(pe,rr)|0,g=g+Math.imul(me,tr)|0,O=O+Math.imul(me,rr)|0,I=I+Math.imul(ce,ir)|0,g=g+Math.imul(ce,nr)|0,g=g+Math.imul(fe,ir)|0,O=O+Math.imul(fe,nr)|0,I=I+Math.imul(Q,or)|0,g=g+Math.imul(Q,ar)|0,g=g+Math.imul(re,or)|0,O=O+Math.imul(re,ar)|0,I=I+Math.imul(_e,sr)|0,g=g+Math.imul(_e,ur)|0,g=g+Math.imul(L,sr)|0,O=O+Math.imul(L,ur)|0,I=I+Math.imul(ue,cr)|0,g=g+Math.imul(ue,fr)|0,g=g+Math.imul(ge,cr)|0,O=O+Math.imul(ge,fr)|0,I=I+Math.imul(X,lr)|0,g=g+Math.imul(X,hr)|0,g=g+Math.imul(ne,lr)|0,O=O+Math.imul(ne,hr)|0;var sv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(sv>>>26)|0,sv&=67108863,I=Math.imul(Ct,Yt),g=Math.imul(Ct,$t),g=g+Math.imul(Gt,Yt)|0,O=Math.imul(Gt,$t),I=I+Math.imul(It,Xt)|0,g=g+Math.imul(It,Jt)|0,g=g+Math.imul(yt,Xt)|0,O=O+Math.imul(yt,Jt)|0,I=I+Math.imul(Re,Qt)|0,g=g+Math.imul(Re,er)|0,g=g+Math.imul(Me,Qt)|0,O=O+Math.imul(Me,er)|0,I=I+Math.imul($e,tr)|0,g=g+Math.imul($e,rr)|0,g=g+Math.imul(le,tr)|0,O=O+Math.imul(le,rr)|0,I=I+Math.imul(pe,ir)|0,g=g+Math.imul(pe,nr)|0,g=g+Math.imul(me,ir)|0,O=O+Math.imul(me,nr)|0,I=I+Math.imul(ce,or)|0,g=g+Math.imul(ce,ar)|0,g=g+Math.imul(fe,or)|0,O=O+Math.imul(fe,ar)|0,I=I+Math.imul(Q,sr)|0,g=g+Math.imul(Q,ur)|0,g=g+Math.imul(re,sr)|0,O=O+Math.imul(re,ur)|0,I=I+Math.imul(_e,cr)|0,g=g+Math.imul(_e,fr)|0,g=g+Math.imul(L,cr)|0,O=O+Math.imul(L,fr)|0,I=I+Math.imul(ue,lr)|0,g=g+Math.imul(ue,hr)|0,g=g+Math.imul(ge,lr)|0,O=O+Math.imul(ge,hr)|0;var uv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(uv>>>26)|0,uv&=67108863,I=Math.imul(Ct,Xt),g=Math.imul(Ct,Jt),g=g+Math.imul(Gt,Xt)|0,O=Math.imul(Gt,Jt),I=I+Math.imul(It,Qt)|0,g=g+Math.imul(It,er)|0,g=g+Math.imul(yt,Qt)|0,O=O+Math.imul(yt,er)|0,I=I+Math.imul(Re,tr)|0,g=g+Math.imul(Re,rr)|0,g=g+Math.imul(Me,tr)|0,O=O+Math.imul(Me,rr)|0,I=I+Math.imul($e,ir)|0,g=g+Math.imul($e,nr)|0,g=g+Math.imul(le,ir)|0,O=O+Math.imul(le,nr)|0,I=I+Math.imul(pe,or)|0,g=g+Math.imul(pe,ar)|0,g=g+Math.imul(me,or)|0,O=O+Math.imul(me,ar)|0,I=I+Math.imul(ce,sr)|0,g=g+Math.imul(ce,ur)|0,g=g+Math.imul(fe,sr)|0,O=O+Math.imul(fe,ur)|0,I=I+Math.imul(Q,cr)|0,g=g+Math.imul(Q,fr)|0,g=g+Math.imul(re,cr)|0,O=O+Math.imul(re,fr)|0,I=I+Math.imul(_e,lr)|0,g=g+Math.imul(_e,hr)|0,g=g+Math.imul(L,lr)|0,O=O+Math.imul(L,hr)|0;var cv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(cv>>>26)|0,cv&=67108863,I=Math.imul(Ct,Qt),g=Math.imul(Ct,er),g=g+Math.imul(Gt,Qt)|0,O=Math.imul(Gt,er),I=I+Math.imul(It,tr)|0,g=g+Math.imul(It,rr)|0,g=g+Math.imul(yt,tr)|0,O=O+Math.imul(yt,rr)|0,I=I+Math.imul(Re,ir)|0,g=g+Math.imul(Re,nr)|0,g=g+Math.imul(Me,ir)|0,O=O+Math.imul(Me,nr)|0,I=I+Math.imul($e,or)|0,g=g+Math.imul($e,ar)|0,g=g+Math.imul(le,or)|0,O=O+Math.imul(le,ar)|0,I=I+Math.imul(pe,sr)|0,g=g+Math.imul(pe,ur)|0,g=g+Math.imul(me,sr)|0,O=O+Math.imul(me,ur)|0,I=I+Math.imul(ce,cr)|0,g=g+Math.imul(ce,fr)|0,g=g+Math.imul(fe,cr)|0,O=O+Math.imul(fe,fr)|0,I=I+Math.imul(Q,lr)|0,g=g+Math.imul(Q,hr)|0,g=g+Math.imul(re,lr)|0,O=O+Math.imul(re,hr)|0;var fv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(fv>>>26)|0,fv&=67108863,I=Math.imul(Ct,tr),g=Math.imul(Ct,rr),g=g+Math.imul(Gt,tr)|0,O=Math.imul(Gt,rr),I=I+Math.imul(It,ir)|0,g=g+Math.imul(It,nr)|0,g=g+Math.imul(yt,ir)|0,O=O+Math.imul(yt,nr)|0,I=I+Math.imul(Re,or)|0,g=g+Math.imul(Re,ar)|0,g=g+Math.imul(Me,or)|0,O=O+Math.imul(Me,ar)|0,I=I+Math.imul($e,sr)|0,g=g+Math.imul($e,ur)|0,g=g+Math.imul(le,sr)|0,O=O+Math.imul(le,ur)|0,I=I+Math.imul(pe,cr)|0,g=g+Math.imul(pe,fr)|0,g=g+Math.imul(me,cr)|0,O=O+Math.imul(me,fr)|0,I=I+Math.imul(ce,lr)|0,g=g+Math.imul(ce,hr)|0,g=g+Math.imul(fe,lr)|0,O=O+Math.imul(fe,hr)|0;var lv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(lv>>>26)|0,lv&=67108863,I=Math.imul(Ct,ir),g=Math.imul(Ct,nr),g=g+Math.imul(Gt,ir)|0,O=Math.imul(Gt,nr),I=I+Math.imul(It,or)|0,g=g+Math.imul(It,ar)|0,g=g+Math.imul(yt,or)|0,O=O+Math.imul(yt,ar)|0,I=I+Math.imul(Re,sr)|0,g=g+Math.imul(Re,ur)|0,g=g+Math.imul(Me,sr)|0,O=O+Math.imul(Me,ur)|0,I=I+Math.imul($e,cr)|0,g=g+Math.imul($e,fr)|0,g=g+Math.imul(le,cr)|0,O=O+Math.imul(le,fr)|0,I=I+Math.imul(pe,lr)|0,g=g+Math.imul(pe,hr)|0,g=g+Math.imul(me,lr)|0,O=O+Math.imul(me,hr)|0;var hv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(hv>>>26)|0,hv&=67108863,I=Math.imul(Ct,or),g=Math.imul(Ct,ar),g=g+Math.imul(Gt,or)|0,O=Math.imul(Gt,ar),I=I+Math.imul(It,sr)|0,g=g+Math.imul(It,ur)|0,g=g+Math.imul(yt,sr)|0,O=O+Math.imul(yt,ur)|0,I=I+Math.imul(Re,cr)|0,g=g+Math.imul(Re,fr)|0,g=g+Math.imul(Me,cr)|0,O=O+Math.imul(Me,fr)|0,I=I+Math.imul($e,lr)|0,g=g+Math.imul($e,hr)|0,g=g+Math.imul(le,lr)|0,O=O+Math.imul(le,hr)|0;var dv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(dv>>>26)|0,dv&=67108863,I=Math.imul(Ct,sr),g=Math.imul(Ct,ur),g=g+Math.imul(Gt,sr)|0,O=Math.imul(Gt,ur),I=I+Math.imul(It,cr)|0,g=g+Math.imul(It,fr)|0,g=g+Math.imul(yt,cr)|0,O=O+Math.imul(yt,fr)|0,I=I+Math.imul(Re,lr)|0,g=g+Math.imul(Re,hr)|0,g=g+Math.imul(Me,lr)|0,O=O+Math.imul(Me,hr)|0;var pv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(pv>>>26)|0,pv&=67108863,I=Math.imul(Ct,cr),g=Math.imul(Ct,fr),g=g+Math.imul(Gt,cr)|0,O=Math.imul(Gt,fr),I=I+Math.imul(It,lr)|0,g=g+Math.imul(It,hr)|0,g=g+Math.imul(yt,lr)|0,O=O+Math.imul(yt,hr)|0;var gv=(N+I|0)+((g&8191)<<13)|0;N=(O+(g>>>13)|0)+(gv>>>26)|0,gv&=67108863,I=Math.imul(Ct,lr),g=Math.imul(Ct,hr),g=g+Math.imul(Gt,lr)|0,O=Math.imul(Gt,hr);var mv=(N+I|0)+((g&8191)<<13)|0;return N=(O+(g>>>13)|0)+(mv>>>26)|0,mv&=67108863,A[0]=Jm,A[1]=Qm,A[2]=ev,A[3]=tv,A[4]=rv,A[5]=iv,A[6]=nv,A[7]=ov,A[8]=av,A[9]=sv,A[10]=uv,A[11]=cv,A[12]=fv,A[13]=lv,A[14]=hv,A[15]=dv,A[16]=pv,A[17]=gv,A[18]=mv,N!==0&&(A[19]=N,b.length++),b};Math.imul||(w=y);function T(x,h,v){v.negative=h.negative^x.negative,v.length=x.length+h.length;for(var b=0,S=0,E=0;E<v.length-1;E++){var A=S;S=0;for(var N=b&67108863,I=Math.min(E,h.length-1),g=Math.max(0,E-x.length+1);g<=I;g++){var O=E-g,ee=x.words[O]|0,X=h.words[g]|0,ne=ee*X,oe=ne&67108863;A=A+(ne/67108864|0)|0,oe=oe+N|0,N=oe&67108863,A=A+(oe>>>26)|0,S+=A>>>26,A&=67108863}v.words[E]=N,b=A,A=S}return b!==0?v.words[E]=b:v.length--,v.strip()}function B(x,h,v){var b=new C;return b.mulp(x,h,v)}n.prototype.mulTo=function(h,v){var b,S=this.length+h.length;return this.length===10&&h.length===10?b=w(this,h,v):S<63?b=y(this,h,v):S<1024?b=T(this,h,v):b=B(this,h,v),b};function C(x,h){this.x=x,this.y=h}C.prototype.makeRBT=function(h){for(var v=new Array(h),b=n.prototype._countBits(h)-1,S=0;S<h;S++)v[S]=this.revBin(S,b,h);return v},C.prototype.revBin=function(h,v,b){if(h===0||h===b-1)return h;for(var S=0,E=0;E<v;E++)S|=(h&1)<<v-E-1,h>>=1;return S},C.prototype.permute=function(h,v,b,S,E,A){for(var N=0;N<A;N++)S[N]=v[h[N]],E[N]=b[h[N]]},C.prototype.transform=function(h,v,b,S,E,A){this.permute(A,h,v,b,S,E);for(var N=1;N<E;N<<=1)for(var I=N<<1,g=Math.cos(2*Math.PI/I),O=Math.sin(2*Math.PI/I),ee=0;ee<E;ee+=I)for(var X=g,ne=O,oe=0;oe<N;oe++){var ue=b[ee+oe],ge=S[ee+oe],Ie=b[ee+oe+N],_e=S[ee+oe+N],L=X*Ie-ne*_e;_e=X*_e+ne*Ie,Ie=L,b[ee+oe]=ue+Ie,S[ee+oe]=ge+_e,b[ee+oe+N]=ue-Ie,S[ee+oe+N]=ge-_e,oe!==I&&(L=g*X-O*ne,ne=g*ne+O*X,X=L)}},C.prototype.guessLen13b=function(h,v){var b=Math.max(v,h)|1,S=b&1,E=0;for(b=b/2|0;b;b=b>>>1)E++;return 1<<E+1+S},C.prototype.conjugate=function(h,v,b){if(!(b<=1))for(var S=0;S<b/2;S++){var E=h[S];h[S]=h[b-S-1],h[b-S-1]=E,E=v[S],v[S]=-v[b-S-1],v[b-S-1]=-E}},C.prototype.normalize13b=function(h,v){for(var b=0,S=0;S<v/2;S++){var E=Math.round(h[2*S+1]/v)*8192+Math.round(h[2*S]/v)+b;h[S]=E&67108863,E<67108864?b=0:b=E/67108864|0}return h},C.prototype.convert13b=function(h,v,b,S){for(var E=0,A=0;A<v;A++)E=E+(h[A]|0),b[2*A]=E&8191,E=E>>>13,b[2*A+1]=E&8191,E=E>>>13;for(A=2*v;A<S;++A)b[A]=0;r(E===0),r((E&-8192)===0)},C.prototype.stub=function(h){for(var v=new Array(h),b=0;b<h;b++)v[b]=0;return v},C.prototype.mulp=function(h,v,b){var S=2*this.guessLen13b(h.length,v.length),E=this.makeRBT(S),A=this.stub(S),N=new Array(S),I=new Array(S),g=new Array(S),O=new Array(S),ee=new Array(S),X=new Array(S),ne=b.words;ne.length=S,this.convert13b(h.words,h.length,N,S),this.convert13b(v.words,v.length,O,S),this.transform(N,A,I,g,S,E),this.transform(O,A,ee,X,S,E);for(var oe=0;oe<S;oe++){var ue=I[oe]*ee[oe]-g[oe]*X[oe];g[oe]=I[oe]*X[oe]+g[oe]*ee[oe],I[oe]=ue}return this.conjugate(I,g,S),this.transform(I,g,ne,A,S,E),this.conjugate(ne,A,S),this.normalize13b(ne,S),b.negative=h.negative^v.negative,b.length=h.length+v.length,b.strip()},n.prototype.mul=function(h){var v=new n(null);return v.words=new Array(this.length+h.length),this.mulTo(h,v)},n.prototype.mulf=function(h){var v=new n(null);return v.words=new Array(this.length+h.length),B(this,h,v)},n.prototype.imul=function(h){return this.clone().mulTo(h,this)},n.prototype.imuln=function(h){r(typeof h=="number"),r(h<67108864);for(var v=0,b=0;b<this.length;b++){var S=(this.words[b]|0)*h,E=(S&67108863)+(v&67108863);v>>=26,v+=S/67108864|0,v+=E>>>26,this.words[b]=E&67108863}return v!==0&&(this.words[b]=v,this.length++),h===0&&(this.length=1,this._normSign()),this},n.prototype.muln=function(h){return this.clone().imuln(h)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(h){var v=m(h);if(v.length===0)return new n(1);for(var b=this,S=0;S<v.length&&v[S]===0;S++,b=b.sqr());if(++S<v.length)for(var E=b.sqr();S<v.length;S++,E=E.sqr())v[S]!==0&&(b=b.mul(E));return b},n.prototype.iushln=function(h){r(typeof h=="number"&&h>=0);var v=h%26,b=(h-v)/26,S=67108863>>>26-v<<26-v,E;if(v!==0){var A=0;for(E=0;E<this.length;E++){var N=this.words[E]&S,I=(this.words[E]|0)-N<<v;this.words[E]=I|A,A=N>>>26-v}A&&(this.words[E]=A,this.length++)}if(b!==0){for(E=this.length-1;E>=0;E--)this.words[E+b]=this.words[E];for(E=0;E<b;E++)this.words[E]=0;this.length+=b}return this.strip()},n.prototype.ishln=function(h){return r(this.negative===0),this.iushln(h)},n.prototype.iushrn=function(h,v,b){r(typeof h=="number"&&h>=0);var S;v?S=(v-v%26)/26:S=0;var E=h%26,A=Math.min((h-E)/26,this.length),N=67108863^67108863>>>E<<E,I=b;if(S-=A,S=Math.max(0,S),I){for(var g=0;g<A;g++)I.words[g]=this.words[g];I.length=A}if(A!==0)if(this.length>A)for(this.length-=A,g=0;g<this.length;g++)this.words[g]=this.words[g+A];else this.words[0]=0,this.length=1;var O=0;for(g=this.length-1;g>=0&&(O!==0||g>=S);g--){var ee=this.words[g]|0;this.words[g]=O<<26-E|ee>>>E,O=ee&N}return I&&O!==0&&(I.words[I.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(h,v,b){return r(this.negative===0),this.iushrn(h,v,b)},n.prototype.shln=function(h){return this.clone().ishln(h)},n.prototype.ushln=function(h){return this.clone().iushln(h)},n.prototype.shrn=function(h){return this.clone().ishrn(h)},n.prototype.ushrn=function(h){return this.clone().iushrn(h)},n.prototype.testn=function(h){r(typeof h=="number"&&h>=0);var v=h%26,b=(h-v)/26,S=1<<v;if(this.length<=b)return!1;var E=this.words[b];return!!(E&S)},n.prototype.imaskn=function(h){r(typeof h=="number"&&h>=0);var v=h%26,b=(h-v)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(v!==0&&b++,this.length=Math.min(b,this.length),v!==0){var S=67108863^67108863>>>v<<v;this.words[this.length-1]&=S}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(h){return this.clone().imaskn(h)},n.prototype.iaddn=function(h){return r(typeof h=="number"),r(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},n.prototype._iaddn=function(h){this.words[0]+=h;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},n.prototype.isubn=function(h){if(r(typeof h=="number"),r(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this.strip()},n.prototype.addn=function(h){return this.clone().iaddn(h)},n.prototype.subn=function(h){return this.clone().isubn(h)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(h,v,b){var S=h.length+b,E;this._expand(S);var A,N=0;for(E=0;E<h.length;E++){A=(this.words[E+b]|0)+N;var I=(h.words[E]|0)*v;A-=I&67108863,N=(A>>26)-(I/67108864|0),this.words[E+b]=A&67108863}for(;E<this.length-b;E++)A=(this.words[E+b]|0)+N,N=A>>26,this.words[E+b]=A&67108863;if(N===0)return this.strip();for(r(N===-1),N=0,E=0;E<this.length;E++)A=-(this.words[E]|0)+N,N=A>>26,this.words[E]=A&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(h,v){var b=this.length-h.length,S=this.clone(),E=h,A=E.words[E.length-1]|0,N=this._countBits(A);b=26-N,b!==0&&(E=E.ushln(b),S.iushln(b),A=E.words[E.length-1]|0);var I=S.length-E.length,g;if(v!=="mod"){g=new n(null),g.length=I+1,g.words=new Array(g.length);for(var O=0;O<g.length;O++)g.words[O]=0}var ee=S.clone()._ishlnsubmul(E,1,I);ee.negative===0&&(S=ee,g&&(g.words[I]=1));for(var X=I-1;X>=0;X--){var ne=(S.words[E.length+X]|0)*67108864+(S.words[E.length+X-1]|0);for(ne=Math.min(ne/A|0,67108863),S._ishlnsubmul(E,ne,X);S.negative!==0;)ne--,S.negative=0,S._ishlnsubmul(E,1,X),S.isZero()||(S.negative^=1);g&&(g.words[X]=ne)}return g&&g.strip(),S.strip(),v!=="div"&&b!==0&&S.iushrn(b),{div:g||null,mod:S}},n.prototype.divmod=function(h,v,b){if(r(!h.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var S,E,A;return this.negative!==0&&h.negative===0?(A=this.neg().divmod(h,v),v!=="mod"&&(S=A.div.neg()),v!=="div"&&(E=A.mod.neg(),b&&E.negative!==0&&E.iadd(h)),{div:S,mod:E}):this.negative===0&&h.negative!==0?(A=this.divmod(h.neg(),v),v!=="mod"&&(S=A.div.neg()),{div:S,mod:A.mod}):(this.negative&h.negative)!==0?(A=this.neg().divmod(h.neg(),v),v!=="div"&&(E=A.mod.neg(),b&&E.negative!==0&&E.isub(h)),{div:A.div,mod:E}):h.length>this.length||this.cmp(h)<0?{div:new n(0),mod:this}:h.length===1?v==="div"?{div:this.divn(h.words[0]),mod:null}:v==="mod"?{div:null,mod:new n(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new n(this.modn(h.words[0]))}:this._wordDiv(h,v)},n.prototype.div=function(h){return this.divmod(h,"div",!1).div},n.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},n.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},n.prototype.divRound=function(h){var v=this.divmod(h);if(v.mod.isZero())return v.div;var b=v.mod.abs(),S=h.abs().iushrn(1),E=h.words[0]&1,A=b.cmp(S);if(A<0||E===1&&A===0)return v.div;var N=new n(1);return N.negative=this.negative^h.negative,v.div.iadd(N)},n.prototype.modn=function(h){r(h<=67108863);for(var v=(1<<26)%h,b=0,S=this.length-1;S>=0;S--)b=(v*b+(this.words[S]|0))%h;return b},n.prototype.idivn=function(h){r(h<=67108863);for(var v=0,b=this.length-1;b>=0;b--){var S=(this.words[b]|0)+v*67108864;this.words[b]=S/h|0,v=S%h}return this.strip()},n.prototype.divn=function(h){return this.clone().idivn(h)},n.prototype.egcd=function(h){r(h.negative===0),r(!h.isZero());var v=this,b=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var S=new n(1),E=new n(0),A=new n(0),N=new n(1),I=0;v.isEven()&&b.isEven();)v.iushrn(1),b.iushrn(1),++I;for(var g=b.clone(),O=v.clone();!v.isZero();){for(var ee=0,X=1;(v.words[0]&X)===0&&ee<26;++ee,X<<=1);if(ee>0)for(v.iushrn(ee);ee-- >0;)(S.isOdd()||E.isOdd())&&(S.iadd(g),E.isub(O)),S.iushrn(1),E.iushrn(1);for(var ne=0,oe=1;(b.words[0]&oe)===0&&ne<26;++ne,oe<<=1);if(ne>0)for(b.iushrn(ne);ne-- >0;)(A.isOdd()||N.isOdd())&&(A.iadd(g),N.isub(O)),A.iushrn(1),N.iushrn(1);v.cmp(b)>=0?(v.isub(b),S.isub(A),E.isub(N)):(b.isub(v),A.isub(S),N.isub(E))}return{a:A,b:N,gcd:b.iushln(I)}},n.prototype._invmp=function(h){r(h.negative===0),r(!h.isZero());var v=this,b=h.clone();v.negative!==0?v=v.umod(h):v=v.clone();for(var S=new n(1),E=new n(0),A=b.clone();v.cmpn(1)>0&&b.cmpn(1)>0;){for(var N=0,I=1;(v.words[0]&I)===0&&N<26;++N,I<<=1);if(N>0)for(v.iushrn(N);N-- >0;)S.isOdd()&&S.iadd(A),S.iushrn(1);for(var g=0,O=1;(b.words[0]&O)===0&&g<26;++g,O<<=1);if(g>0)for(b.iushrn(g);g-- >0;)E.isOdd()&&E.iadd(A),E.iushrn(1);v.cmp(b)>=0?(v.isub(b),S.isub(E)):(b.isub(v),E.isub(S))}var ee;return v.cmpn(1)===0?ee=S:ee=E,ee.cmpn(0)<0&&ee.iadd(h),ee},n.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var v=this.clone(),b=h.clone();v.negative=0,b.negative=0;for(var S=0;v.isEven()&&b.isEven();S++)v.iushrn(1),b.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;b.isEven();)b.iushrn(1);var E=v.cmp(b);if(E<0){var A=v;v=b,b=A}else if(E===0||b.cmpn(1)===0)break;v.isub(b)}while(!0);return b.iushln(S)},n.prototype.invm=function(h){return this.egcd(h).a.umod(h)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(h){return this.words[0]&h},n.prototype.bincn=function(h){r(typeof h=="number");var v=h%26,b=(h-v)/26,S=1<<v;if(this.length<=b)return this._expand(b+1),this.words[b]|=S,this;for(var E=S,A=b;E!==0&&A<this.length;A++){var N=this.words[A]|0;N+=E,E=N>>>26,N&=67108863,this.words[A]=N}return E!==0&&(this.words[A]=E,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(h){var v=h<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var b;if(this.length>1)b=1;else{v&&(h=-h),r(h<=67108863,"Number is too big");var S=this.words[0]|0;b=S===h?0:S<h?-1:1}return this.negative!==0?-b|0:b},n.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var v=this.ucmp(h);return this.negative!==0?-v|0:v},n.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var v=0,b=this.length-1;b>=0;b--){var S=this.words[b]|0,E=h.words[b]|0;if(S!==E){S<E?v=-1:S>E&&(v=1);break}}return v},n.prototype.gtn=function(h){return this.cmpn(h)===1},n.prototype.gt=function(h){return this.cmp(h)===1},n.prototype.gten=function(h){return this.cmpn(h)>=0},n.prototype.gte=function(h){return this.cmp(h)>=0},n.prototype.ltn=function(h){return this.cmpn(h)===-1},n.prototype.lt=function(h){return this.cmp(h)===-1},n.prototype.lten=function(h){return this.cmpn(h)<=0},n.prototype.lte=function(h){return this.cmp(h)<=0},n.prototype.eqn=function(h){return this.cmpn(h)===0},n.prototype.eq=function(h){return this.cmp(h)===0},n.red=function(h){return new z(h)},n.prototype.toRed=function(h){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(h){return this.red=h,this},n.prototype.forceRed=function(h){return r(!this.red,"Already a number in reduction context"),this._forceRed(h)},n.prototype.redAdd=function(h){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},n.prototype.redIAdd=function(h){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},n.prototype.redSub=function(h){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},n.prototype.redISub=function(h){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},n.prototype.redShl=function(h){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},n.prototype.redMul=function(h){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},n.prototype.redIMul=function(h){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(h){return r(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var q={k256:null,p224:null,p192:null,p25519:null};function F(x,h){this.name=x,this.p=new n(h,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var h=new n(null);return h.words=new Array(Math.ceil(this.n/13)),h},F.prototype.ireduce=function(h){var v=h,b;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),b=v.bitLength();while(b>this.n);var S=b<this.n?-1:v.ucmp(this.p);return S===0?(v.words[0]=0,v.length=1):S>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},F.prototype.split=function(h,v){h.iushrn(this.n,0,v)},F.prototype.imulK=function(h){return h.imul(this.k)};function P(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(P,F),P.prototype.split=function(h,v){for(var b=4194303,S=Math.min(h.length,9),E=0;E<S;E++)v.words[E]=h.words[E];if(v.length=S,h.length<=9){h.words[0]=0,h.length=1;return}var A=h.words[9];for(v.words[v.length++]=A&b,E=10;E<h.length;E++){var N=h.words[E]|0;h.words[E-10]=(N&b)<<4|A>>>22,A=N}A>>>=22,h.words[E-10]=A,A===0&&h.length>10?h.length-=10:h.length-=9},P.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var v=0,b=0;b<h.length;b++){var S=h.words[b]|0;v+=S*977,h.words[b]=v&67108863,v=S*64+(v/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function k(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(k,F);function M(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(M,F);function K(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(K,F),K.prototype.imulK=function(h){for(var v=0,b=0;b<h.length;b++){var S=(h.words[b]|0)*19+v,E=S&67108863;S>>>=26,h.words[b]=E,v=S}return v!==0&&(h.words[h.length++]=v),h},n._prime=function(h){if(q[h])return q[h];var v;if(h==="k256")v=new P;else if(h==="p224")v=new k;else if(h==="p192")v=new M;else if(h==="p25519")v=new K;else throw new Error("Unknown prime "+h);return q[h]=v,v};function z(x){if(typeof x=="string"){var h=n._prime(x);this.m=h.p,this.prime=h}else r(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}z.prototype._verify1=function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,v){r((h.negative|v.negative)===0,"red works only with positives"),r(h.red&&h.red===v.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,v){this._verify2(h,v);var b=h.add(v);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,v){this._verify2(h,v);var b=h.iadd(v);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,v){this._verify2(h,v);var b=h.sub(v);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,v){this._verify2(h,v);var b=h.isub(v);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,v){return this._verify1(h),this.imod(h.ushln(v))},z.prototype.imul=function(h,v){return this._verify2(h,v),this.imod(h.imul(v))},z.prototype.mul=function(h,v){return this._verify2(h,v),this.imod(h.mul(v))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var v=this.m.andln(3);if(r(v%2===1),v===3){var b=this.m.add(new n(1)).iushrn(2);return this.pow(h,b)}for(var S=this.m.subn(1),E=0;!S.isZero()&&S.andln(1)===0;)E++,S.iushrn(1);r(!S.isZero());var A=new n(1).toRed(this),N=A.redNeg(),I=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new n(2*g*g).toRed(this);this.pow(g,I).cmp(N)!==0;)g.redIAdd(N);for(var O=this.pow(g,S),ee=this.pow(h,S.addn(1).iushrn(1)),X=this.pow(h,S),ne=E;X.cmp(A)!==0;){for(var oe=X,ue=0;oe.cmp(A)!==0;ue++)oe=oe.redSqr();r(ue<ne);var ge=this.pow(O,new n(1).iushln(ne-ue-1));ee=ee.redMul(ge),O=ge.redSqr(),X=X.redMul(O),ne=ue}return ee},z.prototype.invm=function(h){var v=h._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},z.prototype.pow=function(h,v){if(v.isZero())return new n(1).toRed(this);if(v.cmpn(1)===0)return h.clone();var b=4,S=new Array(1<<b);S[0]=new n(1).toRed(this),S[1]=h;for(var E=2;E<S.length;E++)S[E]=this.mul(S[E-1],h);var A=S[0],N=0,I=0,g=v.bitLength()%26;for(g===0&&(g=26),E=v.length-1;E>=0;E--){for(var O=v.words[E],ee=g-1;ee>=0;ee--){var X=O>>ee&1;if(A!==S[0]&&(A=this.sqr(A)),X===0&&N===0){I=0;continue}N<<=1,N|=X,I++,!(I!==b&&(E!==0||ee!==0))&&(A=this.mul(A,S[N]),I=0,N=0)}g=26}return A},z.prototype.convertTo=function(h){var v=h.umod(this.m);return v===h?v.clone():v},z.prototype.convertFrom=function(h){var v=h.clone();return v.red=null,v},n.mont=function(h){return new V(h)};function V(x){z.call(this,x),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var v=this.imod(h.mul(this.rinv));return v.red=null,v},V.prototype.imul=function(h,v){if(h.isZero()||v.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(v),S=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=b.isub(S).iushrn(this.shift),A=E;return E.cmp(this.m)>=0?A=E.isub(this.m):E.cmpn(0)<0&&(A=E.iadd(this.m)),A._forceRed(this)},V.prototype.mul=function(h,v){if(h.isZero()||v.isZero())return new n(0)._forceRed(this);var b=h.mul(v),S=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=b.isub(S).iushrn(this.shift),A=E;return E.cmp(this.m)>=0?A=E.isub(this.m):E.cmpn(0)<0&&(A=E.iadd(this.m)),A._forceRed(this)},V.prototype.invm=function(h){var v=this.imod(h._invmp(this.m).mul(this.r2));return v._forceRed(this)}})(typeof dy>"u"||dy,UA)});var py=R((jte,HA)=>{"use strict";p();HA.exports="8.1.0"});var zA=R((Kte,jA)=>{"use strict";p();var cj="https://docs.moneybutton.com/";jA.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+cj+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]});var ti=R((Gte,my)=>{"use strict";p();var gy=Ve();function fj(e,t){return e.replace("{0}",t[0]).replace("{1}",t[1]).replace("{2}",t[2])}var KA=function(e,t){var r=function(){if(gy.isString(t.message))this.message=fj(t.message,arguments);else if(gy.isFunction(t.message))this.message=t.message.apply(null,arguments);else throw new Error("Invalid error definition for "+t.name);this.stack=this.message+`
|
|
12
12
|
`+new Error().stack};return r.prototype=Object.create(e.prototype),r.prototype.name=e.prototype.name+t.name,e[t.name]=r,t.errors&&VA(r,t.errors),r},VA=function(e,t){gy.each(t,function(r){KA(e,r)})},lj=function(e,t){return VA(e,t),e},Yu={};Yu.Error=function(){this.message="Internal error",this.stack=this.message+`
|
|
13
13
|
`+new Error().stack};Yu.Error.prototype=Object.create(Error.prototype);Yu.Error.prototype.name="bsv.Error";var hj=zA();lj(Yu.Error,hj);my.exports=Yu.Error;my.exports.extend=function(e){return KA(Yu.Error,e)}});var Oe=R((Zte,GA)=>{"use strict";p();var Yf=ti(),dj=Ve();GA.exports={checkState:function(e,t){if(!e)throw new Yf.InvalidState(t)},checkArgument:function(e,t,r,i){if(!e)throw new Yf.InvalidArgument(t,r,i)},checkArgumentType:function(e,t,r){if(r=r||"(unknown name)",dj.isString(t)){if(t==="Buffer"){var i=Lt();if(!i.Buffer.isBuffer(e))throw new Yf.InvalidArgumentType(e,t,r)}else if(typeof e!==t)throw new Yf.InvalidArgumentType(e,t,r)}else if(!(e instanceof t))throw new Yf.InvalidArgumentType(e,t.name,r)}}});var Ge=R(($te,$A)=>{"use strict";p();var tt=hp(),ZA=Oe(),YA=Ve(),dp=function(e){for(var t=l.Buffer.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};tt.Zero=new tt(0);tt.One=new tt(1);tt.Minus1=new tt(-1);tt.fromNumber=function(e){return ZA.checkArgument(YA.isNumber(e)),new tt(e)};tt.fromString=function(e,t){return ZA.checkArgument(YA.isString(e)),new tt(e,t)};tt.fromBuffer=function(e,t){typeof t<"u"&&t.endian==="little"&&(e=dp(e));var r=e.toString("hex"),i=new tt(r,16);return i};tt.fromSM=function(e,t){var r;if(e.length===0)return tt.fromBuffer(l.Buffer.from([0]));var i="big";return t&&(i=t.endian),i==="little"&&(e=dp(e)),e[0]&128?(e[0]=e[0]&127,r=tt.fromBuffer(e),r.neg().copy(r)):r=tt.fromBuffer(e),r};tt.prototype.toNumber=function(){return parseInt(this.toString(10),10)};tt.prototype.toBuffer=function(e){var t,r;if(e&&e.size){r=this.toString(16,2);var i=r.length/2;t=l.Buffer.from(r,"hex"),i===e.size||(i>e.size?t=tt.trim(t,i):i<e.size&&(t=tt.pad(t,i,e.size)))}else r=this.toString(16,2),t=l.Buffer.from(r,"hex");return typeof e<"u"&&e.endian==="little"&&(t=dp(t)),t};tt.prototype.toSMBigEndian=function(){var e;return this.cmp(tt.Zero)===-1?(e=this.neg().toBuffer(),e[0]&128?e=l.Buffer.concat([l.Buffer.from([128]),e]):e[0]=e[0]|128):(e=this.toBuffer(),e[0]&128&&(e=l.Buffer.concat([l.Buffer.from([0]),e]))),e.length===1&&e[0]===0&&(e=l.Buffer.from([])),e};tt.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return t==="little"&&(r=dp(r)),r};function WA(e,t){var r=new Error(e);return r.scriptErr=t,r}tt.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(e.length>i)throw WA("script number overflow","SCRIPT_ERR_SCRIPTNUM_OVERFLOW");if(t&&e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))throw WA("non-minimally encoded script number","SCRIPT_ERR_SCRIPTNUM_MINENCODE");return tt.fromSM(e,{endian:"little"})};tt.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})};tt.trim=function(e,t){return e.slice(t-e.length,e.length)};tt.pad=function(e,t,r){for(var i=l.Buffer.alloc(r),n=0;n<e.length;n++)i[i.length-1-n]=e[e.length-1-n];for(n=0;n<r-t;n++)i[n]=0;return i};tt.prototype.toHex=function(...e){return this.toBuffer(...e).toString("hex")};tt.fromHex=function(e,...t){return tt.fromBuffer(l.Buffer.from(e,"hex"),...t)};$A.exports=tt});function vy(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ya(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(`${r}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw new RangeError(`${r}expected integer >= 0, got ${e}`)}}function Vn(e,t,r=""){let i=vy(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function pp(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ya(e.outputLen),ya(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function $u(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function gp(e,t){Vn(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function ri(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function mp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gn(e,t){return e<<32-t|e>>>t}function Lo(e,t){return e<<t|e>>>32-t>>>0}function vp(e){if(Vn(e),JA)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=pj[e[r]];return t}function XA(e){if(e>=Co._0&&e<=Co._9)return e-Co._0;if(e>=Co.A&&e<=Co.F)return e-(Co.A-10);if(e>=Co.a&&e<=Co.f)return e-(Co.a-10)}function yy(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(JA)try{return Uint8Array.fromHex(e)}catch(n){throw n instanceof SyntaxError?new RangeError(n.message):n}let t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let n=0,o=0;n<r;n++,o+=2){let a=XA(e.charCodeAt(o)),s=XA(e.charCodeAt(o+1));if(a===void 0||s===void 0){let u=e[o]+e[o+1];throw new RangeError('hex string expected, got non-hex character "'+u+'" at index '+o)}i[n]=a*16+s}return i}function Mo(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function QA(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];Vn(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function mn(e,t={}){let r=(n,o)=>e(o).update(n).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=n=>e(n),Object.assign(r,t),Object.freeze(r)}function $f(e=32){ya(e,"bytesLength");let t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}var JA,pj,Co,Es,Do=Br(()=>{p();JA=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",pj=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Co={_0:48,_9:57,A:65,F:70,a:97,f:102};Es=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})});function Xu(e,t,r){return e&t^~e&r}function yp(e,t,r){return e&t^e&r^t&r}var qo,Fo,Uo,zr,Kr,by=Br(()=>{p();Do();qo=class{constructor(t,r,i,n){H(this,"blockLen");H(this,"outputLen");H(this,"canXOF",!1);H(this,"padOffset");H(this,"isLE");H(this,"buffer");H(this,"view");H(this,"finished",!1);H(this,"length",0);H(this,"pos",0);H(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=mp(this.buffer)}update(t){$u(this),Vn(t);let{view:r,buffer:i,blockLen:n}=this,o=t.length;for(let a=0;a<o;){let s=Math.min(n-this.pos,o-a);if(s===n){let u=mp(t);for(;n<=o-a;a+=n)this.process(u,a);continue}i.set(t.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){$u(this),gp(t,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:a}=this;r[a++]=128,ri(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(i,0),a=0);for(let d=a;d<n;d++)r[d]=0;i.setBigUint64(n-8,BigInt(this.length*8),o),this.process(i,0);let s=mp(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=u/4,f=this.get();if(c>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)s.setUint32(4*d,f[d],o)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:i,length:n,finished:o,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=o,t.length=n,t.pos=s,n%r&&t.buffer.set(i),t}clone(){return this._cloneInto()}},Fo=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Uo=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),zr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Kr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});function gj(e,t=!1){return t?{h:Number(e&bp),l:Number(e>>eT&bp)}:{h:Number(e>>eT&bp)|0,l:Number(e&bp)|0}}function tT(e,t=!1){let r=e.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=gj(e[o],t);[i[o],n[o]]=[a,s]}return[i,n]}function Gn(e,t,r,i){let n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:n|0}}var bp,eT,_y,Sy,xs,Is,Xf,Jf,rT,iT,nT,oT,aT,sT,uT=Br(()=>{p();bp=BigInt(4294967295),eT=BigInt(32);_y=(e,t,r)=>e>>>r,Sy=(e,t,r)=>e<<32-r|t>>>r,xs=(e,t,r)=>e>>>r|t<<32-r,Is=(e,t,r)=>e<<32-r|t>>>r,Xf=(e,t,r)=>e<<64-r|t>>>r-32,Jf=(e,t,r)=>e>>>r-32|t<<64-r;rT=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),iT=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,nT=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),oT=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,aT=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),sT=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0});var Ap={};ff(Ap,{_SHA224:()=>wp,_SHA256:()=>Sp,_SHA384:()=>xp,_SHA512:()=>Ep,_SHA512_224:()=>Ip,_SHA512_256:()=>Op,sha224:()=>_j,sha256:()=>wa,sha384:()=>wj,sha512:()=>Sj,sha512_224:()=>xj,sha512_256:()=>Ej});var vj,ba,_p,Sp,wp,cT,yj,bj,_a,Sa,Ju,Ep,xp,ii,ni,Ip,Op,wa,_j,Sj,wj,Ej,xj,Qf=Br(()=>{p();by();uT();Do();vj=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ba=new Uint32Array(64),_p=class extends qo{constructor(t){super(64,t,8,!1)}get(){let{A:t,B:r,C:i,D:n,E:o,F:a,G:s,H:u}=this;return[t,r,i,n,o,a,s,u]}set(t,r,i,n,o,a,s,u){this.A=t|0,this.B=r|0,this.C=i|0,this.D=n|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0}process(t,r){for(let d=0;d<16;d++,r+=4)ba[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){let m=ba[d-15],y=ba[d-2],w=gn(m,7)^gn(m,18)^m>>>3,T=gn(y,17)^gn(y,19)^y>>>10;ba[d]=T+ba[d-7]+w+ba[d-16]|0}let{A:i,B:n,C:o,D:a,E:s,F:u,G:c,H:f}=this;for(let d=0;d<64;d++){let m=gn(s,6)^gn(s,11)^gn(s,25),y=f+m+Xu(s,u,c)+vj[d]+ba[d]|0,T=(gn(i,2)^gn(i,13)^gn(i,22))+yp(i,n,o)|0;f=c,c=u,u=s,s=a+y|0,a=o,o=n,n=i,i=y+T|0}i=i+this.A|0,n=n+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,c=c+this.G|0,f=f+this.H|0,this.set(i,n,o,a,s,u,c,f)}roundClean(){ri(ba)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ri(this.buffer)}},Sp=class extends _p{constructor(){super(32);H(this,"A",Fo[0]|0);H(this,"B",Fo[1]|0);H(this,"C",Fo[2]|0);H(this,"D",Fo[3]|0);H(this,"E",Fo[4]|0);H(this,"F",Fo[5]|0);H(this,"G",Fo[6]|0);H(this,"H",Fo[7]|0)}},wp=class extends _p{constructor(){super(28);H(this,"A",Uo[0]|0);H(this,"B",Uo[1]|0);H(this,"C",Uo[2]|0);H(this,"D",Uo[3]|0);H(this,"E",Uo[4]|0);H(this,"F",Uo[5]|0);H(this,"G",Uo[6]|0);H(this,"H",Uo[7]|0)}},cT=tT(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),yj=cT[0],bj=cT[1],_a=new Uint32Array(80),Sa=new Uint32Array(80),Ju=class extends qo{constructor(t){super(128,t,16,!1)}get(){let{Ah:t,Al:r,Bh:i,Bl:n,Ch:o,Cl:a,Dh:s,Dl:u,Eh:c,El:f,Fh:d,Fl:m,Gh:y,Gl:w,Hh:T,Hl:B}=this;return[t,r,i,n,o,a,s,u,c,f,d,m,y,w,T,B]}set(t,r,i,n,o,a,s,u,c,f,d,m,y,w,T,B){this.Ah=t|0,this.Al=r|0,this.Bh=i|0,this.Bl=n|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=u|0,this.Eh=c|0,this.El=f|0,this.Fh=d|0,this.Fl=m|0,this.Gh=y|0,this.Gl=w|0,this.Hh=T|0,this.Hl=B|0}process(t,r){for(let F=0;F<16;F++,r+=4)_a[F]=t.getUint32(r),Sa[F]=t.getUint32(r+=4);for(let F=16;F<80;F++){let P=_a[F-15]|0,k=Sa[F-15]|0,M=xs(P,k,1)^xs(P,k,8)^_y(P,k,7),K=Is(P,k,1)^Is(P,k,8)^Sy(P,k,7),z=_a[F-2]|0,V=Sa[F-2]|0,x=xs(z,V,19)^Xf(z,V,61)^_y(z,V,6),h=Is(z,V,19)^Jf(z,V,61)^Sy(z,V,6),v=nT(K,h,Sa[F-7],Sa[F-16]),b=oT(v,M,x,_a[F-7],_a[F-16]);_a[F]=b|0,Sa[F]=v|0}let{Ah:i,Al:n,Bh:o,Bl:a,Ch:s,Cl:u,Dh:c,Dl:f,Eh:d,El:m,Fh:y,Fl:w,Gh:T,Gl:B,Hh:C,Hl:q}=this;for(let F=0;F<80;F++){let P=xs(d,m,14)^xs(d,m,18)^Xf(d,m,41),k=Is(d,m,14)^Is(d,m,18)^Jf(d,m,41),M=d&y^~d&T,K=m&w^~m&B,z=aT(q,k,K,bj[F],Sa[F]),V=sT(z,C,P,M,yj[F],_a[F]),x=z|0,h=xs(i,n,28)^Xf(i,n,34)^Xf(i,n,39),v=Is(i,n,28)^Jf(i,n,34)^Jf(i,n,39),b=i&o^i&s^o&s,S=n&a^n&u^a&u;C=T|0,q=B|0,T=y|0,B=w|0,y=d|0,w=m|0,{h:d,l:m}=Gn(c|0,f|0,V|0,x|0),c=s|0,f=u|0,s=o|0,u=a|0,o=i|0,a=n|0;let E=rT(x,v,S);i=iT(E,V,h,b),n=E|0}({h:i,l:n}=Gn(this.Ah|0,this.Al|0,i|0,n|0)),{h:o,l:a}=Gn(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:u}=Gn(this.Ch|0,this.Cl|0,s|0,u|0),{h:c,l:f}=Gn(this.Dh|0,this.Dl|0,c|0,f|0),{h:d,l:m}=Gn(this.Eh|0,this.El|0,d|0,m|0),{h:y,l:w}=Gn(this.Fh|0,this.Fl|0,y|0,w|0),{h:T,l:B}=Gn(this.Gh|0,this.Gl|0,T|0,B|0),{h:C,l:q}=Gn(this.Hh|0,this.Hl|0,C|0,q|0),this.set(i,n,o,a,s,u,c,f,d,m,y,w,T,B,C,q)}roundClean(){ri(_a,Sa)}destroy(){this.destroyed=!0,ri(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Ep=class extends Ju{constructor(){super(64);H(this,"Ah",Kr[0]|0);H(this,"Al",Kr[1]|0);H(this,"Bh",Kr[2]|0);H(this,"Bl",Kr[3]|0);H(this,"Ch",Kr[4]|0);H(this,"Cl",Kr[5]|0);H(this,"Dh",Kr[6]|0);H(this,"Dl",Kr[7]|0);H(this,"Eh",Kr[8]|0);H(this,"El",Kr[9]|0);H(this,"Fh",Kr[10]|0);H(this,"Fl",Kr[11]|0);H(this,"Gh",Kr[12]|0);H(this,"Gl",Kr[13]|0);H(this,"Hh",Kr[14]|0);H(this,"Hl",Kr[15]|0)}},xp=class extends Ju{constructor(){super(48);H(this,"Ah",zr[0]|0);H(this,"Al",zr[1]|0);H(this,"Bh",zr[2]|0);H(this,"Bl",zr[3]|0);H(this,"Ch",zr[4]|0);H(this,"Cl",zr[5]|0);H(this,"Dh",zr[6]|0);H(this,"Dl",zr[7]|0);H(this,"Eh",zr[8]|0);H(this,"El",zr[9]|0);H(this,"Fh",zr[10]|0);H(this,"Fl",zr[11]|0);H(this,"Gh",zr[12]|0);H(this,"Gl",zr[13]|0);H(this,"Hh",zr[14]|0);H(this,"Hl",zr[15]|0)}},ii=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),ni=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),Ip=class extends Ju{constructor(){super(28);H(this,"Ah",ii[0]|0);H(this,"Al",ii[1]|0);H(this,"Bh",ii[2]|0);H(this,"Bl",ii[3]|0);H(this,"Ch",ii[4]|0);H(this,"Cl",ii[5]|0);H(this,"Dh",ii[6]|0);H(this,"Dl",ii[7]|0);H(this,"Eh",ii[8]|0);H(this,"El",ii[9]|0);H(this,"Fh",ii[10]|0);H(this,"Fl",ii[11]|0);H(this,"Gh",ii[12]|0);H(this,"Gl",ii[13]|0);H(this,"Hh",ii[14]|0);H(this,"Hl",ii[15]|0)}},Op=class extends Ju{constructor(){super(32);H(this,"Ah",ni[0]|0);H(this,"Al",ni[1]|0);H(this,"Bh",ni[2]|0);H(this,"Bl",ni[3]|0);H(this,"Ch",ni[4]|0);H(this,"Cl",ni[5]|0);H(this,"Dh",ni[6]|0);H(this,"Dl",ni[7]|0);H(this,"Eh",ni[8]|0);H(this,"El",ni[9]|0);H(this,"Fh",ni[10]|0);H(this,"Fl",ni[11]|0);H(this,"Gh",ni[12]|0);H(this,"Gl",ni[13]|0);H(this,"Hh",ni[14]|0);H(this,"Hl",ni[15]|0)}},wa=mn(()=>new Sp,Es(1)),_j=mn(()=>new wp,Es(4)),Sj=mn(()=>new Ep,Es(3)),wj=mn(()=>new xp,Es(2)),Ej=mn(()=>new Op,Es(6)),xj=mn(()=>new Ip,Es(5))});function As(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}" `;throw new TypeError(r+"expected boolean, got type="+typeof e)}return e}function Rp(e){if(typeof e=="bigint"){if(!Tp(e))throw new RangeError("positive bigint expected, got "+e)}else Ey(e);return e}function Wi(e,t=""){if(typeof e!="number"){let r=t&&`"${t}" `;throw new TypeError(r+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){let r=t&&`"${t}" `;throw new RangeError(r+"expected safe integer, got "+e)}}function el(e){let t=Rp(e).toString(16);return t.length&1?"0"+t:t}function fT(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Pp:BigInt("0x"+e)}function ci(e){return fT(vp(e))}function ec(e){return fT(vp(Bp(Vn(e)).reverse()))}function kp(e,t){if(ya(t),t===0)throw new RangeError("zero length");e=Rp(e);let r=e.toString(16);if(r.length>t*2)throw new RangeError("number too large");return yy(r.padStart(t*2,"0"))}function xy(e,t){return kp(e,t).reverse()}function Bp(e){return Uint8Array.from(ht(e))}function tc(e){if(typeof e!="string")throw new TypeError("ascii string expected, got "+typeof e);return Uint8Array.from(e,(t,r)=>{let i=t.charCodeAt(0);if(t.length!==1||i>127)throw new RangeError(`string contains non-ASCII character "${e[r]}" with code ${i} at position ${r}`);return i})}function Ij(e,t,r){return Tp(e)&&Tp(t)&&Tp(r)&&t<=e&&e<r}function Iy(e,t,r,i){if(!Ij(t,r,i))throw new RangeError("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function Ts(e){if(e<Pp)throw new Error("expected non-negative bigint, got "+e);let t;for(t=0;e>Pp;e>>=wy,t+=1);return t}function lT(e,t,r){if(ya(e,"hashLen"),ya(t,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let i=B=>new Uint8Array(B),n=Uint8Array.of(),o=Uint8Array.of(0),a=Uint8Array.of(1),s=1e3,u=i(e),c=i(e),f=0,d=()=>{u.fill(1),c.fill(0),f=0},m=(...B)=>r(c,ot(u,...B)),y=(B=n)=>{c=m(o,B),u=m(),B.length!==0&&(c=m(a,B),u=m())},w=()=>{if(f++>=s)throw new Error("drbg: tried max amount of iterations");let B=0,C=[];for(;B<t;){u=m();let q=u.slice();C.push(q),B+=u.length}return ot(...C)};return(B,C)=>{d(),y(B);let q;for(;(q=C(w()))===void 0;)y();return d(),q}}function Zi(e,t={},r={}){if(Object.prototype.toString.call(e)!=="[object Object]")throw new TypeError("expected valid options object");function i(o,a,s){if(!s&&a!=="function"&&!Object.hasOwn(e,o))throw new TypeError(`param "${o}" is invalid: expected own property`);let u=e[o];if(s&&u===void 0)return;let c=typeof u;if(c!==a||u===null)throw new TypeError(`param "${o}" is invalid: expected ${a}, got ${c}`)}let n=(o,a)=>Object.entries(o).forEach(([s,u])=>i(s,u,a));n(t,!1),n(r,!0)}var ht,Ey,Ho,ot,Qu,Os,bi,Pp,wy,Tp,rc,Ps=Br(()=>{p();Do();ht=(e,t,r)=>Vn(e,t,r),Ey=ya,Ho=vp,ot=(...e)=>QA(...e),Qu=e=>yy(e),Os=vy,bi=e=>$f(e),Pp=BigInt(0),wy=BigInt(1);Tp=e=>typeof e=="bigint"&&Pp<=e;rc=e=>(wy<<BigInt(e))-wy});function ki(e,t){if(t<=Vr)throw new Error("mod: expected positive modulus, got "+t);let r=e%t;return r>=Vr?r:t+r}function Bi(e,t,r){if(t<Vr)throw new Error("pow2: expected non-negative exponent, got "+t);let i=e;for(;t-- >Vr;)i*=i,i%=r;return i}function hT(e,t){if(e===Vr)throw new Error("invert: expected non-zero number");if(t<=Vr)throw new Error("invert: expected positive modulus, got "+t);let r=ki(e,t),i=t,n=Vr,o=pr,a=pr,s=Vr;for(;r!==Vr;){let c=i/r,f=i-r*c,d=n-a*c,m=o-s*c;i=r,r=f,n=a,o=s,a=d,s=m}if(i!==pr)throw new Error("invert: does not exist");return ki(n,t)}function Ay(e,t,r){let i=e;if(!i.eql(i.sqr(t),r))throw new Error("Cannot find square root")}function bT(e,t){let r=e,i=(r.ORDER+pr)/gT,n=r.pow(t,i);return Ay(r,n,t),n}function Tj(e,t){let r=e,i=(r.ORDER-mT)/vT,n=r.mul(t,Rs),o=r.pow(n,i),a=r.mul(t,o),s=r.mul(r.mul(a,Rs),o),u=r.mul(a,r.sub(s,r.ONE));return Ay(r,u,t),u}function Pj(e){let t=ic(e),r=_T(e),i=r(t,t.neg(t.ONE)),n=r(t,i),o=r(t,t.neg(i)),a=(e+Oj)/yT;return((s,u)=>{let c=s,f=c.pow(u,a),d=c.mul(f,i),m=c.mul(f,n),y=c.mul(f,o),w=c.eql(c.sqr(d),u),T=c.eql(c.sqr(m),u);f=c.cmov(f,d,w),d=c.cmov(y,m,T);let B=c.eql(c.sqr(d),u),C=c.cmov(f,d,B);return Ay(c,C,u),C})}function _T(e){if(e<pT)throw new Error("sqrt is not defined for small field");let t=e-pr,r=0;for(;t%Rs===Vr;)t/=Rs,r++;let i=Rs,n=ic(e);for(;Oy(n,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return bT;let o=n.pow(i,t),a=(t+pr)/Rs;return function(u,c){let f=u;if(f.is0(c))return c;if(Oy(f,c)!==1)throw new Error("Cannot find square root");let d=r,m=f.mul(f.ONE,o),y=f.pow(c,t),w=f.pow(c,a);for(;!f.eql(y,f.ONE);){if(f.is0(y))return f.ZERO;let T=1,B=f.sqr(y);for(;!f.eql(B,f.ONE);)if(T++,B=f.sqr(B),T===d)throw new Error("Cannot find square root");let C=pr<<BigInt(d-T-1),q=f.pow(m,C);d=T,m=f.sqr(q),y=f.mul(y,m),w=f.mul(w,q)}return w}}function Rj(e){return e%gT===pT?bT:e%vT===mT?Tj:e%yT===Aj?Pj(e):_T(e)}function ks(e){let t={ORDER:"bigint",BYTES:"number",BITS:"number"},r=kj.reduce((i,n)=>(i[n]="function",i),t);if(Zi(e,r),Wi(e.BYTES,"BYTES"),Wi(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=pr)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function Bj(e,t,r){let i=e;if(r<Vr)throw new Error("invalid exponent, negatives unsupported");if(r===Vr)return i.ONE;if(r===pr)return t;let n=i.ONE,o=t;for(;r>Vr;)r&pr&&(n=i.mul(n,o)),o=i.sqr(o),r>>=pr;return n}function Bs(e,t,r=!1){let i=e,n=new Array(t.length).fill(r?i.ZERO:void 0),o=t.reduce((s,u,c)=>i.is0(u)?s:(n[c]=s,i.mul(s,u)),i.ONE),a=i.inv(o);return t.reduceRight((s,u,c)=>i.is0(u)?s:(n[c]=i.mul(s,n[c]),i.mul(s,u)),a),n}function Oy(e,t){let r=e,i=(r.ORDER-pr)/Rs,n=r.pow(t,i),o=r.eql(n,r.ONE),a=r.eql(n,r.ZERO),s=r.eql(n,r.neg(r.ONE));if(!o&&!a&&!s)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function Ty(e,t){return Oy(e,t)!==-1}function Nj(e,t){if(t!==void 0&&Ey(t),e<=Vr)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);let r=Ts(e);if(t!==void 0&&t<r)throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);let i=t!==void 0?t:r,n=Math.ceil(i/8);return{nBitLength:i,nByteLength:n}}function ic(e,t={}){return new Np(e,t)}function ST(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=pr)throw new Error("field order must be greater than 1");let t=Ts(e-pr);return Math.ceil(t/8)}function tl(e){let t=ST(e);return t+Math.ceil(t/2)}function nc(e,t,r=!1){ht(e);let i=e.length,n=ST(t),o=Math.max(tl(t),16);if(i<o||i>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+i);let a=r?ec(e):ci(e),s=ki(a,t-pr)+pr;return r?xy(s,n):kp(s,n)}var Vr,pr,Rs,pT,gT,mT,Oj,vT,Aj,yT,kj,dT,Np,oc=Br(()=>{p();Ps();Vr=BigInt(0),pr=BigInt(1),Rs=BigInt(2),pT=BigInt(3),gT=BigInt(4),mT=BigInt(5),Oj=BigInt(7),vT=BigInt(8),Aj=BigInt(9),yT=BigInt(16);kj=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];dT=new WeakMap,Np=class{constructor(t,r={}){H(this,"ORDER");H(this,"BITS");H(this,"BYTES");H(this,"isLE");H(this,"ZERO",Vr);H(this,"ONE",pr);H(this,"_lengths");H(this,"_mod");if(t<=pr)throw new Error("invalid field: expected ORDER > 1, got "+t);let i;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(i=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:n,nByteLength:o}=Nj(t,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=n,this.BYTES=o,Object.freeze(this)}create(t){return ki(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return Vr<=t&&t<this.ORDER}is0(t){return t===Vr}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&pr)===pr}neg(t){return ki(-t,this.ORDER)}eql(t,r){return t===r}sqr(t){return ki(t*t,this.ORDER)}add(t,r){return ki(t+r,this.ORDER)}sub(t,r){return ki(t-r,this.ORDER)}mul(t,r){return ki(t*r,this.ORDER)}pow(t,r){return Bj(this,t,r)}div(t,r){return ki(t*hT(r,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,r){return t+r}subN(t,r){return t-r}mulN(t,r){return t*r}inv(t){return hT(t,this.ORDER)}sqrt(t){let r=dT.get(this);return r||dT.set(this,r=Rj(this.ORDER)),r(this,t)}toBytes(t){return this.isLE?xy(t,this.BYTES):kp(t,this.BYTES)}fromBytes(t,r=!1){ht(t);let{_lengths:i,BYTES:n,isLE:o,ORDER:a,_mod:s}=this;if(i){if(t.length<1||!i.includes(t.length)||t.length>n)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let c=new Uint8Array(n);c.set(t,o?0:c.length-t.length),t=c}if(t.length!==n)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+t.length);let u=o?ec(t):ci(t);if(s&&(u=ki(u,a)),!r&&!this.isValid(u))throw new Error("invalid field element: outside of range 0..ORDER");return u}invertBatch(t){return Bs(this,t)}cmov(t,r,i){return As(i,"condition"),i?r:t}};Object.freeze(Np.prototype)});function IT(e){let t=e;if(typeof t!="function")throw new TypeError("Point must be a constructor");Zi({Fp:t.Fp,Fn:t.Fn,fromAffine:t.fromAffine,fromBytes:t.fromBytes,fromHex:t.fromHex},{Fp:"object",Fn:"object",fromAffine:"function",fromBytes:"function",fromHex:"function"}),ks(t.Fp),ks(t.Fn)}function rl(e,t){let r=t.negate();return e?r:t}function By(e,t){let r=Bs(e.Fp,t.map(i=>i.Z));return t.map((i,n)=>e.fromAffine(i.toAffine(r[n])))}function OT(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Py(e,t){OT(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e,o=rc(e),a=BigInt(e);return{windows:r,windowSize:i,mask:o,maxNumber:n,shiftBy:a}}function wT(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:a}=r,s=Number(e&n),u=e>>a;s>i&&(s-=o,u+=Ns);let c=t*i,f=c+Math.abs(s)-1,d=s===0,m=s<0,y=t%2!==0;return{nextN:u,offset:f,isZero:d,isNeg:m,isNegF:y,offsetF:c}}function Cj(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,i)=>{if(!(r instanceof t))throw new Error("invalid point at index "+i)})}function Lj(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+i)})}function ky(e){return AT.get(e)||1}function ET(e){if(e!==ac)throw new Error("invalid wNAF")}function TT(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>ac||i>ac;)r&Ns&&(o=o.add(n)),i&Ns&&(a=a.add(n)),n=n.double(),r>>=Ns,i>>=Ns;return{p1:o,p2:a}}function PT(e,t,r){let i=e.Fn;Cj(t,e),Lj(r,i);let n=t.length,o=r.length;if(n!==o)throw new Error("arrays of points and scalars must have equal length");let a=e.ZERO,s=Ts(BigInt(n)),u=1;s>12?u=s-3:s>4?u=s-2:s>0&&(u=2);let c=rc(u),f=new Array(Number(c)+1).fill(a),d=Math.floor((i.BITS-1)/u)*u,m=a;for(let y=d;y>=0;y-=u){f.fill(a);for(let T=0;T<o;T++){let B=r[T],C=Number(B>>BigInt(y)&c);f[C]=f[C].add(t[T])}let w=a;for(let T=f.length-1,B=a;T>0;T--)B=B.add(f[T]),w=w.add(B);if(m=m.add(w),y!==0)for(let T=0;T<u;T++)m=m.double()}return m}function xT(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return ks(t),t}else return ic(e,{isLE:r})}function RT(e,t,r={},i){if(i===void 0&&(i=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let u of["p","n","h"]){let c=t[u];if(!(typeof c=="bigint"&&c>ac))throw new Error(`CURVE.${u} must be positive bigint`)}let n=xT(t.p,r.Fp,i),o=xT(t.n,r.Fn,i),s=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let u of s)if(!n.isValid(t[u]))throw new Error(`CURVE.${u} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:n,Fn:o}}function Lp(e,t){return function(i){let n=e(i);return{secretKey:n,publicKey:t(n)}}}var ac,Ns,Ry,AT,Cp,Mp=Br(()=>{p();Ps();oc();ac=BigInt(0),Ns=BigInt(1);Ry=new WeakMap,AT=new WeakMap;Cp=class{constructor(t,r){H(this,"BASE");H(this,"ZERO");H(this,"Fn");H(this,"bits");this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,i=this.ZERO){let n=t;for(;r>ac;)r&Ns&&(i=i.add(n)),n=n.double(),r>>=Ns;return i}precomputeWindow(t,r){let{windows:i,windowSize:n}=Py(r,this.bits),o=[],a=t,s=a;for(let u=0;u<i;u++){s=a,o.push(s);for(let c=1;c<n;c++)s=s.add(a),o.push(s);a=s.double()}return o}wNAF(t,r,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE,a=Py(t,this.bits);for(let s=0;s<a.windows;s++){let{nextN:u,offset:c,isZero:f,isNeg:d,isNegF:m,offsetF:y}=wT(i,s,a);i=u,f?o=o.add(rl(m,r[y])):n=n.add(rl(d,r[c]))}return ET(i),{p:n,f:o}}wNAFUnsafe(t,r,i,n=this.ZERO){let o=Py(t,this.bits);for(let a=0;a<o.windows&&i!==ac;a++){let{nextN:s,offset:u,isZero:c,isNeg:f}=wT(i,a,o);if(i=s,!c){let d=r[u];n=n.add(f?d.negate():d)}}return ET(i),n}getPrecomputes(t,r,i){let n=Ry.get(r);return n||(n=this.precomputeWindow(r,t),t!==1&&(typeof i=="function"&&(n=i(n)),Ry.set(r,n))),n}cached(t,r,i){let n=ky(t);return this.wNAF(n,this.getPrecomputes(n,t,i),r)}unsafe(t,r,i,n){let o=ky(t);return o===1?this._unsafeLadder(t,r,n):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,n)}createCache(t,r){OT(r,this.bits),AT.set(t,r),Ry.delete(t)}hasCache(t){return ky(t)!==1}}});function kT(e){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw new Error("wrong u32 integer:"+e);return e}function Mj(e){if(kT(e),e<=1)return 1;if(e>2147483648)throw new Error("nextPowerOfTwo overflow: result does not fit u32");return 1<<Ny(e-1)+1>>>0}function Ny(e){return kT(e),31-Math.clz32(e)}function BT(e,t,r,i,n){let o=e,a=r||((f,d)=>new Array(f).fill(d??o.ZERO)),s=f=>{if(Array.isArray(f))return!0;if(!ArrayBuffer.isView(f))return!1;let d=f;return typeof d.length=="number"&&typeof d.slice=="function"&&typeof d[Symbol.iterator]=="function"},u=(...f)=>{if(!f.length)return 0;for(let m of f)if(!s(m))throw new Error("poly: not polynomial: "+m);let d=f[0].length;for(let m=1;m<f.length;m++)if(f[m].length!==d)throw new Error(`poly: mismatched lengths ${d} vs ${f[m].length}`);if(n!==void 0&&d!==n)throw new Error(`poly: expected fixed length ${n}, got ${d}`);return d};function c(f,d,m=!1){let y=Ny(d),w=m?t.brp(y):t.roots(y);for(let T=0;T<d;T++)if(o.eql(f,w[T]))return T;return-1}return{roots:t,create:a,length:n,extend:(f,d)=>{u(f);let m=a(d,o.ZERO);for(let y=0;y<Math.min(f.length,d);y++)m[y]=f[y];return m},degree:f=>{u(f);for(let d=f.length-1;d>=0;d--)if(!o.is0(f[d]))return d;return-1},add:(f,d)=>{let m=u(f,d),y=a(m);for(let w=0;w<m;w++)y[w]=o.add(f[w],d[w]);return y},sub:(f,d)=>{let m=u(f,d),y=a(m);for(let w=0;w<m;w++)y[w]=o.sub(f[w],d[w]);return y},dot:(f,d)=>{let m=u(f,d),y=a(m);for(let w=0;w<m;w++)y[w]=o.mul(f[w],d[w]);return y},mul:(f,d)=>{if(s(d)){let m=u(f,d);if(i){let y=i.direct(f,!1,!0),w=i.direct(d,!1,!0);for(let T=0;T<y.length;T++)y[T]=o.mul(y[T],w[T]);return i.inverse(y,!0,!1)}else{let y=a(m);for(let w=0;w<m;w++)for(let T=0;T<m;T++){let B=(w+T)%m;y[B]=o.add(y[B],o.mul(f[w],d[T]))}return y}}else{let m=a(u(f));for(let y=0;y<m.length;y++)m[y]=o.mul(f[y],d);return m}},convolve(f,d){let m=Mj(f.length+d.length-1);return this.mul(this.extend(f,m),this.extend(d,m))},shift(f,d){let m=a(u(f));m[0]=f[0];for(let y=1,w=o.ONE;y<f.length;y++)w=o.mul(w,d),m[y]=o.mul(f[y],w);return m},clone:f=>{u(f);let d=a(f.length);for(let m=0;m<f.length;m++)d[m]=f[m];return d},eval:(f,d)=>{u(f,d);let m=o.ZERO;for(let y=0;y<f.length;y++)m=o.add(m,o.mul(f[y],d[y]));return m},monomial:{basis:(f,d)=>{let m=a(d),y=o.ONE;for(let w=0;w<d;w++)m[w]=y,y=o.mul(y,f);return m},eval:(f,d)=>{u(f);let m=o.ZERO;for(let y=f.length-1;y>=0;y--)m=o.add(o.mul(m,d),f[y]);return m}},lagrange:{basis:(f,d,m=!1,y)=>{let w=Ny(d),T=y||(m?t.brp(w):t.roots(w)),B=a(d),C=c(f,d,m);if(C!==-1)return B[C]=o.ONE,B;let q=o.pow(f,BigInt(d)),F=o.mul(o.sub(q,o.ONE),o.inv(BigInt(d))),P=a(d);for(let M=0;M<d;M++)P[M]=o.sub(f,T[M]);let k=o.invertBatch(P);for(let M=0;M<d;M++)B[M]=o.mul(F,o.mul(T[M],k[M]));return B},eval(f,d,m=!1){u(f);let y=c(d,f.length,m);if(y!==-1)return f[y];let w=this.basis(d,f.length,m),T=o.ZERO;for(let B=0;B<f.length;B++)o.is0(f[B])||(T=o.add(T,o.mul(f[B],w[B])));return T}},vanishing(f){u(f);let d=a(f.length+1,o.ZERO);d[0]=o.ONE;for(let m of f){let y=o.neg(m);for(let w=d.length-1;w>0;w--)d[w]=o.add(o.mul(d[w],y),d[w-1]);d[0]=o.mul(d[0],y)}return d}}}var NT=Br(()=>{p()});function Cs(e,t){if(Wi(e),Wi(t),t<0||t>4)throw new Error("invalid I2OSP length: "+t);if(e<0||e>2**(8*t)-1)throw new Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let i=t-1;i>=0;i--)r[i]=e&255,e>>>=8;return new Uint8Array(r)}function qj(e,t){let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]^t[i];return r}function CT(e){if(!Os(e)&&typeof e!="string")throw new Error("DST must be Uint8Array or ascii string");let t=typeof e=="string"?tc(e):e;if(t.length===0)throw new Error("DST must be non-empty");return t}function Fj(e,t,r,i){ht(e),Wi(r),t=CT(t),t.length>255&&(t=i(ot(tc("H2C-OVERSIZE-DST-"),t)));let{outputLen:n,blockLen:o}=i,a=Math.ceil(r/n);if(r>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");let s=ot(t,Cs(t.length,1)),u=new Uint8Array(o),c=Cs(r,2),f=new Array(a),d=i(ot(u,e,c,Cs(0,1),s));f[0]=i(ot(d,Cs(1,1),s));for(let y=1;y<a;y++){let w=[qj(d,f[y-1]),Cs(y+1,1),s];f[y]=i(ot(...w))}return ot(...f).slice(0,r)}function Uj(e,t,r,i,n){if(ht(e),Wi(r),t=CT(t),t.length>255){let o=Math.ceil(2*i/8);t=n.create({dkLen:o}).update(tc("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(e).update(Cs(r,2)).update(t).update(Cs(t.length,1)).digest()}function Cy(e,t,r){Zi(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:i,k:n,m:o,hash:a,expand:s,DST:u}=r;if(Wi(a.outputLen,"valid hash"),ht(e),Wi(t),t<1)throw new Error("hash_to_field: expected count >= 1");if(o<1)throw new Error("hash_to_field: expected m >= 1");let c=i.toString(2).length,f=Math.ceil((c+n)/8),d=t*o*f,m;if(s==="xmd")m=Fj(e,u,d,a);else if(s==="xof")m=Uj(e,u,d,n,a);else if(s==="_internal_pass")m=e;else throw new Error('expand must be "xmd" or "xof"');let y=new Array(t);for(let w=0;w<t;w++){let T=new Array(o);for(let B=0;B<o;B++){let C=f*(B+w*o),q=m.subarray(C,C+f);T[B]=ki(Dj(q),i)}y[w]=T}return y}function LT(e,t){let r=t.map(i=>Array.from(i).reverse());return(i,n)=>{let[o,a,s,u]=r.map(d=>d.reduce((m,y)=>e.add(e.mul(m,i),y))),[c,f]=Bs(e,[a,u],!0);return i=e.mul(o,c),n=e.mul(n,e.mul(s,f)),{x:i,y:n}}}function MT(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");let i=s=>Object.freeze({...s,DST:Os(s.DST)?Bp(s.DST):s.DST,...s.encodeDST===void 0?{}:{encodeDST:Os(s.encodeDST)?Bp(s.encodeDST):s.encodeDST}}),n=i(r);function o(s){return e.fromAffine(t(s))}function a(s){let u=s.clearCofactor();return u.equals(e.ZERO)?e.ZERO:(u.assertValidity(),u)}return Object.freeze({get defaults(){return i(n)},Point:e,hashToCurve(s,u){let c=Object.assign({},n,u),f=Cy(s,2,c),d=o(f[0]),m=o(f[1]);return a(d.add(m))},encodeToCurve(s,u){let c=n.encodeDST?{DST:n.encodeDST}:{},f=Object.assign({},n,c,u),d=Cy(s,1,f),m=o(d[0]);return a(m)},mapToCurve(s){if(n.m===1){if(typeof s!="bigint")throw new Error("expected bigint (m=1)");return a(o([s]))}if(!Array.isArray(s))throw new Error("expected array of bigints");for(let u of s)if(typeof u!="bigint")throw new Error("expected array of bigints");return a(o(s))},hashToScalar(s,u){let c=e.Fn.ORDER,f=Object.assign({},n,{p:c,m:1,DST:Hj},u);return Cy(s,1,f)[0][0]}})}var Dj,Hj,DT=Br(()=>{p();Ps();oc();Dj=ci;Hj="HashToScalar-"});function Ly(e){Zi(e,{name:"string",hash:"function"},{hashToScalar:"function",validatePoint:"function",parsePublicKey:"function",adjustScalar:"function",adjustPoint:"function",challenge:"function",adjustNonces:"function",adjustSecret:"function",adjustPublic:"function",adjustGroupCommitmentShare:"function",adjustDKG:"function"}),IT(e.Point);let{Point:t}=e,r=e.Fn===void 0?t.Fn:e.Fn,i=e.hash,n=e.hashToScalar===void 0?(L,G={DST:new Uint8Array})=>{let Q=i(ot(G.DST,L));return r.create(r.isLE?ec(Q):ci(Q))}:e.hashToScalar,o=Mo(e.H1!==void 0?e.H1:e.name+"rho"),a=Mo(e.H2!==void 0?e.H2:e.name+"chal"),s=Mo(e.H3!==void 0?e.H3:e.name+"nonce"),u=Mo(e.H4!==void 0?e.H4:e.name+"msg"),c=Mo(e.H5!==void 0?e.H5:e.name+"com"),f=Mo(e.HDKG!==void 0?e.HDKG:e.name+"dkg"),d=Mo(e.HID!==void 0?e.HID:e.name+"id"),m=L=>n(L,{DST:o}),y=L=>n(L,{DST:a}),w=L=>n(L,{DST:s}),T=L=>i(ot(u,L)),B=L=>i(ot(c,L)),C=L=>n(L,{DST:f}),q=L=>n(L,{DST:d}),F=(L=bi)=>{let G=nc(L(tl(r.ORDER)),r.ORDER,r.isLE);return r.isLE?ec(G):ci(G)},P=L=>L.toBytes(),k=L=>{let G=t.fromBytes(L);return e.validatePoint&&e.validatePoint(G),G},M=(L,G)=>({identifier:L,hiding:P(t.BASE.multiply(r.fromBytes(G.hiding))),binding:P(t.BASE.multiply(r.fromBytes(G.binding)))}),K=e.adjustPoint===void 0?L=>L:e.adjustPoint,z=L=>{if(!r.isValid(L)||r.is0(L))throw new Error("Invalid identifier "+L);return L},V=L=>Ho(r.toBytes(z(L))),x=L=>{let G=z(r.fromBytes(Qu(L)));if(V(G)!==L)throw new Error("expected canonical identifier hex");return G},h={encode:(L,G)=>{let Q=ot(P(L),r.toBytes(G));return e.adjustTx&&(Q=e.adjustTx.encode(Q)),Q},decode:L=>{e.adjustTx&&(L=e.adjustTx.decode(L));let G=k(L.subarray(0,-r.BYTES)),Q=r.fromBytes(L.subarray(-r.BYTES));return{R:G,z:Q}}},v=(L=bi)=>{let G=F(L);e.adjustScalar&&(G=e.adjustScalar(G));let Q=t.BASE.multiply(G);return{scalar:G,point:Q}},b="roots are unavailable in FROST polynomial mode",S={info:{G:r.ZERO,oddFactor:r.ZERO,powerOfTwo:0},roots(){throw new Error(b)},brp(){throw new Error(b)},inverse(){throw new Error(b)},omega(){throw new Error(b)},clear(){}},E=BT(r,S),A=(L,G)=>PT(t,L,G),N=(L,G)=>{if(!G.length)throw new Error("empty coefficients");return E.monomial.eval(G,L)},I=(L,G)=>{let Q="invalid parameters";if(!L.some(fe=>r.eql(fe,G)))throw new Error(Q);let re=new Set(L);if(re.size!==L.length)throw new Error(Q);if(!re.has(G))throw new Error(Q);let de=r.ONE,ce=r.ONE;for(let fe of L)r.eql(fe,G)||(de=r.mul(de,fe),ce=r.mul(ce,r.sub(fe,G)));return r.div(de,ce)},g=(L,G)=>{let Q=E.monomial.basis(L,G.length);return A(G,Q)},O=(L,G,Q,re=bi)=>{Dp(L);let de=G===void 0?F(re):r.fromBytes(G);if(!Q){Q=[];for(let Se=0;Se<L.min-1;Se++)Q.push(F(re))}if(Q.length!==L.min-1)throw new Error("wrong coefficients length");let ce=[de,...Q],fe=ce.map(Se=>t.BASE.multiply(Se));return{coefficients:ce,commitment:fe,secret:de}},ee={challenge:(L,G,Q)=>C(ot(r.toBytes(L),P(G),P(Q))),compute(L,G,Q,re=bi){if(G.length<1)throw new Error("coefficients should have at least one element");let{point:de,scalar:ce}=v(re),fe=Q[0],Se=this.challenge(L,fe,de),pe=r.add(ce,r.mul(G[0],Se));return h.encode(de,pe)},validate(L,G,Q){if(G.length<1)throw new Error("commitment should have at least one element");let{R:re,z:de}=h.decode(Q),ce=k(G[0]),fe=this.challenge(L,ce,re);if(!re.equals(t.BASE.multiply(de).subtract(ce.multiply(fe))))throw new Error("invalid proof of knowledge")}},X={challenge:(L,G,Q)=>e.challenge?e.challenge(L,G,Q):y(ot(P(L),P(G),Q)),sign(L,G,Q=bi){let{point:re,scalar:de}=v(Q),ce=t.BASE.multiply(G),fe=this.challenge(re,ce,L),Se=r.add(de,r.mul(fe,G));return[re,Se]},verify(L,G,Q,re){e.adjustPoint&&(re=e.adjustPoint(re)),e.adjustPoint&&(G=e.adjustPoint(G));let de=this.challenge(G,re,L),ce=t.BASE.multiply(Q),fe=re.multiply(de),Se=ce.subtract(fe).subtract(G);return Se.clearCofactor&&(Se=Se.clearCofactor()),t.ZERO.equals(Se)}},ne=(L,G,Q)=>{if(!t.BASE.multiply(Q).equals(g(L,G)))throw new Error("invalid secret share")},oe={fromNumber(L){if(!Number.isSafeInteger(L))throw new Error("expected safe interger");return V(BigInt(L))},derive(L){if(typeof L!="string")throw new Error("wrong identifier string: "+L);return V(q(Mo(L)))}},ue=(L,G=bi)=>w(ot(G(32),r.toBytes(L))),ge=(L,G,Q)=>{let re=G.map(le=>[le.identifier,x(le.identifier),k(le.hiding),k(le.binding)]);re.sort((le,Te)=>le[1]<Te[1]?-1:le[1]>Te[1]?1:0);let de=[];for(let[le,Te,Re,Me]of re)de.push(r.toBytes(Te),P(Re),P(Me));let ce=B(ot(...de)),fe=ot(P(L),T(Q),ce),Se={};for(let[le,Te]of re)Se[le]=m(ot(fe,r.toBytes(Te)));let pe=[],me=[];for(let[le,Te,Re,Me]of re){if(t.ZERO.equals(Re)||t.ZERO.equals(Me))throw new Error("infinity commitment");pe.push(Re,Me),me.push(r.ONE,Se[le])}let xt=A(pe,me);return{identifiers:re.map(le=>le[1]),groupCommitment:xt,bindingFactors:Se}},Ie=(L,G,Q,re)=>{let de=K(k(L)),ce=x(re),{identifiers:fe,groupCommitment:Se,bindingFactors:pe}=ge(de,G,Q),me=pe[re],xt=I(fe,ce),$e=X.challenge(Se,de,Q);return{lambda:xt,challenge:$e,bindingFactor:me,groupCommitment:Se}};Object.freeze(oe);let _e={Identifier:oe,DKG:Object.freeze({round1:(L,G,Q,re=bi)=>{Dp(G);let de=x(L),{coefficients:ce,commitment:fe}=O(G,Q,void 0,re),Se=ee.compute(de,ce,fe,re),pe=fe.map(P),me={identifier:V(de),commitment:pe,proofOfKnowledge:Se},xt={identifier:de,coefficients:ce,commitment:fe.map(P),signers:{min:G.min,max:G.max},step:1};return{public:me,secret:xt}},round2:(L,G)=>{if(G.length!==L.signers.max-1)throw new Error("wrong number of round1 packages");if(!L.coefficients||L.step===3)throw new Error("round3 package used in round2");let Q={};for(let re of G){if(re.commitment.length!==L.signers.min)throw new Error("wrong number of commitments");let de=x(re.identifier);if(de===L.identifier)throw new Error("duplicate id="+V(de));ee.validate(de,re.commitment,re.proofOfKnowledge);for(let fe of re.commitment)k(fe);if(Q[re.identifier])throw new Error("Duplicate id="+de);let ce=r.toBytes(N(de,L.coefficients));Q[re.identifier]={identifier:V(L.identifier),signingShare:ce}}return L.step=2,Q},round3:(L,G,Q)=>{if(G.length!==L.signers.max-1)throw new Error("wrong length of round1 packages");if(!L.coefficients||L.step!==2)throw new Error("round2 package used in round3");if(Q.length!==G.length)throw new Error("wrong length of round2 packages");let re={};for(let Te of G){if(!Te.identifier||!Te.commitment)throw new Error("wrong round1 share");re[Te.identifier]={...Te}}for(let Te of Q){if(!Te.identifier||!Te.signingShare)throw new Error("wrong round2 share");if(!re[Te.identifier])throw new Error("round1 share for "+Te.identifier+" is missing");re[Te.identifier].signingShare=Te.signingShare}if(Object.keys(re).length!==G.length)throw new Error("mismatch identifiers between rounds");let de=r.ZERO;if(L.commitment.length!==L.signers.min)throw new Error("wrong commitments length");let ce=L.commitment.map(k),fe=N(L.identifier,L.coefficients);ne(L.identifier,ce,fe);let Se=ce.map(P),pe={[V(L.identifier)]:Se};for(let Te in re){let Re=re[Te];if(!Re.signingShare||!Re.commitment)throw new Error("mismatch identifiers");let Me=x(Te),xo=r.fromBytes(Re.signingShare),It=Re.commitment.map(k);ne(L.identifier,It,xo),de=r.add(de,xo);let yt=V(Me);if(pe[yt])throw new Error("duplicated id="+yt);pe[yt]=Re.commitment}de=r.add(de,fe);let me=new Array(L.signers.min).fill(t.ZERO);for(let Te in pe){let Re=pe[Te];if(Re.length!==L.signers.min)throw new Error("wrong commitments length");for(let Me=0;Me<Re.length;Me++)me[Me]=me[Me].add(k(Re[Me]))}let xt=me.map(P),$e={};for(let Te in pe)$e[Te]=P(g(x(Te),me));let le={public:{signers:{min:L.signers.min,max:L.signers.max},commitments:xt,verifyingShares:Object.fromEntries(Object.entries($e).map(([Te,Re])=>[Te,Re.slice()]))},secret:{identifier:V(L.identifier),signingShare:r.toBytes(de)}};e.adjustDKG&&(le=e.adjustDKG(le));for(let Te=0;Te<L.coefficients.length;Te++)L.coefficients[Te]-=L.coefficients[Te];return delete L.coefficients,L.step=3,le},clean(L){if(L.identifier-=L.identifier,L.coefficients)for(let G=0;G<L.coefficients.length;G++)L.coefficients[G]-=L.coefficients[G];L.step=3}}),trustedDealer(L,G,Q,re=bi){if(Dp(L),G===void 0){G=[];for(let me=1;me<=L.max;me++)G.push(oe.fromNumber(me))}else if(!Array.isArray(G)||G.length!==L.max)throw new Error("identifiers should be array of "+L.max);let de={};for(let me of G){let xt=x(me);if(me in de)throw new Error("duplicated id="+me);de[me]=xt}let ce=O(L,Q,void 0,re),fe=ce.commitment.map(P),Se={},pe={};for(let me of G){let xt=N(de[me],ce.coefficients);pe[me]=P(t.BASE.multiply(xt)),Se[me]={identifier:me,signingShare:r.toBytes(xt)}}return{public:{signers:{min:L.min,max:L.max},commitments:fe,verifyingShares:pe},secretShares:Se}},validateSecret(L,G){let Q=x(L.identifier),re=G.commitments.map(k),de=r.fromBytes(L.signingShare);ne(Q,re,de)},commit(L,G=bi){let Q=r.fromBytes(L.signingShare),re=ue(Q,G),de=ue(Q,G),ce={hiding:r.toBytes(re),binding:r.toBytes(de)};return{nonces:ce,commitments:M(L.identifier,ce)}},signShare(L,G,Q,re,de){qT(G.signers,re.length);let ce=r.fromBytes(Q.hiding),fe=r.fromBytes(Q.binding);if(r.is0(ce)||r.is0(fe))throw new Error("signing nonces already used");let Se={identifier:L.identifier,hiding:P(t.BASE.multiply(ce)),binding:P(t.BASE.multiply(fe))},pe=re.find(Ct=>Ct.identifier===L.identifier);if(!pe)throw new Error("missing signer commitment");if(Ho(pe.hiding)!==Ho(Se.hiding)||Ho(pe.binding)!==Ho(Se.binding))throw new Error("incorrect signer commitment");e.adjustSecret&&(L=e.adjustSecret(L,G)),e.adjustPublic&&(G=e.adjustPublic(G));let me=r.fromBytes(L.signingShare),{lambda:xt,challenge:$e,bindingFactor:le,groupCommitment:Te}=Ie(G.commitments[0],re,de,L.identifier),Re=e.adjustNonces?e.adjustNonces(Te,Q):Q,Me=e.adjustNonces?r.fromBytes(Re.hiding):ce,xo=e.adjustNonces?r.fromBytes(Re.binding):fe,It=r.mul(r.mul(xt,me),$e),yt=r.mul(xo,le),Hh=r.toBytes(r.add(r.add(Me,yt),It));return Q.hiding.fill(0),Q.binding.fill(0),Hh},verifyShare(L,G,Q,re,de){e.adjustPublic&&(L=e.adjustPublic(L));let ce=G.find(xo=>xo.identifier===re);if(!ce)throw new Error("cannot find identifier commitment");let fe=k(L.verifyingShares[re]),Se=k(ce.hiding),pe=k(ce.binding),{lambda:me,challenge:xt,bindingFactor:$e,groupCommitment:le}=Ie(L.commitments[0],G,Q,re),Te=Se.add(pe.multiply($e));e.adjustGroupCommitmentShare&&(Te=e.adjustGroupCommitmentShare(le,Te));let Re=t.BASE.multiply(r.fromBytes(de)),Me=Te.add(fe.multiply(r.mul(xt,me)));return Re.equals(Me)},aggregate(L,G,Q,re){e.adjustPublic&&(L=e.adjustPublic(L));try{qT(L.signers,G.length)}catch{throw new sc("aggregation failed",[])}let de=G.map(pe=>pe.identifier);if(de.length!==Object.keys(re).length)throw new sc("aggregation failed",[]);for(let pe of de)if(!(pe in re)||!(pe in L.verifyingShares))throw new sc("aggregation failed",[]);let ce=k(L.commitments[0]),{groupCommitment:fe}=ge(ce,G,Q),Se=r.ZERO;for(let pe of de)Se=r.add(Se,r.fromBytes(re[pe]));if(!X.verify(Q,fe,Se,ce)){let pe=[];for(let me of de)this.verifyShare(L,G,Q,me,re[me])||pe.push(me);throw new sc("aggregation failed",pe)}return h.encode(fe,Se)},sign(L,G){let Q=r.fromBytes(G);e.adjustScalar&&(Q=e.adjustScalar(Q));let[re,de]=X.sign(L,Q);return h.encode(re,de)},verify(L,G,Q){let re=e.parsePublicKey?e.parsePublicKey(Q):k(Q),{R:de,z:ce}=h.decode(L);return X.verify(G,de,ce,re)},combineSecret(L,G){if(Dp(G),!Array.isArray(L)||L.length<G.min)throw new Error("wrong secret shares array");let Q=[],re={};for(let fe of L){let Se=x(fe.identifier),pe=V(Se);if(re[pe])throw new Error("duplicated id="+pe);re[pe]=!0,Q.push([Se,r.fromBytes(fe.signingShare)])}let de=Q.map(([fe])=>fe),ce=r.ZERO;for(let[fe,Se]of Q)ce=r.add(ce,r.mul(Se,I(de,fe)));return r.toBytes(ce)},utils:Object.freeze({Fn:r,randomScalar:(L=bi)=>r.toBytes(v(L).scalar),generateSecretPolynomial:(L,G,Q,re)=>{let de=O(L,G,Q,re);return{...de,commitment:de.commitment.map(P)}}})};return Object.freeze(_e)}var Dp,qT,sc,FT=Br(()=>{p();Do();Ps();Mp();NT();oc();Dp=e=>{if(!Number.isSafeInteger(e.min)||!Number.isSafeInteger(e.max))throw new Error("Wrong signers info: min="+e.min+" max="+e.max);if(e.min<2||e.max<2||e.min>e.max)throw new Error("Wrong signers info: min="+e.min+" max="+e.max)},qT=(e,t)=>{if(t<e.min||t>e.max)throw new Error("Wrong number of commitments="+t)},sc=class extends Error{constructor(r,i){super(r);H(this,"cheaters");this.cheaters=i}}});var Dy={};ff(Dy,{_HMAC:()=>il,hmac:()=>My});var il,My,qp=Br(()=>{p();Do();il=class{constructor(t,r){H(this,"oHash");H(this,"iHash");H(this,"blockLen");H(this,"outputLen");H(this,"canXOF",!1);H(this,"finished",!1);H(this,"destroyed",!1);if(pp(t),Vn(r,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let o=0;o<n.length;o++)n[o]^=54;this.iHash.update(n),this.oHash=t.create();for(let o=0;o<n.length;o++)n[o]^=106;this.oHash.update(n),ri(n)}update(t){return $u(this),this.iHash.update(t),this}digestInto(t){$u(this),gp(t,this),this.finished=!0;let r=t.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:i,finished:n,destroyed:o,blockLen:a,outputLen:s}=this;return t=t,t.finished=n,t.destroyed=o,t.blockLen=a,t.outputLen=s,t.oHash=r._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},My=(()=>{let e=((t,r,i)=>new il(t,r).update(i).digest());return e.create=(t,r)=>new il(t,r),e})()});function jj(e,t,r){Iy("scalar",e,Yi,r);let[[i,n],[o,a]]=t,s=UT(a*e,r),u=UT(-n*e,r),c=e-s*i-u*o,f=-s*n-u*a,d=c<Yi,m=f<Yi;d&&(c=-c),m&&(f=-f);let y=rc(Math.ceil(Ts(r)/2))+Dr;if(c<Yi||c>=y||f<Yi||f>=y)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:d,k1:c,k2neg:m,k2:f}}function Fy(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function qy(e,t){Zi(e);let r={};for(let i of Object.keys(t))r[i]=e[i]===void 0?t[i]:e[i];return As(r.lowS,"lowS"),As(r.prehash,"prehash"),r.format!==void 0&&Fy(r.format),r}function HT(e,t={}){let r=RT("weierstrass",e,t),i=r.Fp,n=r.Fn,o=r.CURVE,{h:a,n:s}=o;Zi(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:u,allowInfinityPoint:c}=t;if(u&&(!i.is0(o.a)||typeof u.beta!="bigint"||!Array.isArray(u.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let f=KT(i,n);function d(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function m(v,b,S){if(c&&b.is0())return Uint8Array.of(0);let{x:E,y:A}=b.toAffine(),N=i.toBytes(E);if(As(S,"isCompressed"),S){d();let I=!i.isOdd(A);return ot(jT(I),N)}else return ot(Uint8Array.of(4),N,i.toBytes(A))}function y(v){ht(v,void 0,"Point");let{publicKey:b,publicKeyUncompressed:S}=f,E=v.length,A=v[0],N=v.subarray(1);if(c&&E===1&&A===0)return{x:i.ZERO,y:i.ZERO};if(E===b&&(A===2||A===3)){let I=i.fromBytes(N);if(!i.isValid(I))throw new Error("bad point: is not on curve, wrong x");let g=B(I),O;try{O=i.sqrt(g)}catch(ne){let oe=ne instanceof Error?": "+ne.message:"";throw new Error("bad point: is not on curve, sqrt error"+oe)}d();let ee=i.isOdd(O);return(A&1)===1!==ee&&(O=i.neg(O)),{x:I,y:O}}else if(E===S&&A===4){let I=i.BYTES,g=i.fromBytes(N.subarray(0,I)),O=i.fromBytes(N.subarray(I,I*2));if(!C(g,O))throw new Error("bad point: is not on curve");return{x:g,y:O}}else throw new Error(`bad point: got length ${E}, expected compressed=${b} or uncompressed=${S}`)}let w=t.toBytes===void 0?m:t.toBytes,T=t.fromBytes===void 0?y:t.fromBytes;function B(v){let b=i.sqr(v),S=i.mul(b,v);return i.add(i.add(S,i.mul(v,o.a)),o.b)}function C(v,b){let S=i.sqr(b),E=B(v);return i.eql(S,E)}if(!C(o.Gx,o.Gy))throw new Error("bad curve params: generator point");let q=i.mul(i.pow(o.a,uc),Hy),F=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(q,F)))throw new Error("bad curve params: a or b");function P(v,b,S=!1){if(!i.isValid(b)||S&&i.is0(b))throw new Error(`bad point coordinate ${v}`);return b}function k(v){if(!(v instanceof z))throw new Error("Weierstrass Point expected")}function M(v){if(!u||!u.basises)throw new Error("no endo");return jj(v,u.basises,n.ORDER)}function K(v,b,S,E,A){return S=new z(i.mul(S.X,v),S.Y,S.Z),b=rl(E,b),S=rl(A,S),b.add(S)}let h=class h{constructor(b,S,E){H(this,"X");H(this,"Y");H(this,"Z");this.X=P("x",b),this.Y=P("y",S,!0),this.Z=P("z",E),Object.freeze(this)}static CURVE(){return o}static fromAffine(b){let{x:S,y:E}=b||{};if(!b||!i.isValid(S)||!i.isValid(E))throw new Error("invalid affine point");if(b instanceof h)throw new Error("projective point not allowed");return i.is0(S)&&i.is0(E)?h.ZERO:new h(S,E,i.ONE)}static fromBytes(b){let S=h.fromAffine(T(ht(b,void 0,"point")));return S.assertValidity(),S}static fromHex(b){return h.fromBytes(Qu(b))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(b=8,S=!0){return x.createCache(this,b),S||this.multiply(uc),this}assertValidity(){let b=this;if(b.is0()){if(t.allowInfinityPoint&&i.is0(b.X)&&i.eql(b.Y,i.ONE)&&i.is0(b.Z))return;throw new Error("bad point: ZERO")}let{x:S,y:E}=b.toAffine();if(!i.isValid(S)||!i.isValid(E))throw new Error("bad point: x or y not field elements");if(!C(S,E))throw new Error("bad point: equation left != right");if(!b.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:b}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(b)}equals(b){k(b);let{X:S,Y:E,Z:A}=this,{X:N,Y:I,Z:g}=b,O=i.eql(i.mul(S,g),i.mul(N,A)),ee=i.eql(i.mul(E,g),i.mul(I,A));return O&&ee}negate(){return new h(this.X,i.neg(this.Y),this.Z)}double(){let{a:b,b:S}=o,E=i.mul(S,uc),{X:A,Y:N,Z:I}=this,g=i.ZERO,O=i.ZERO,ee=i.ZERO,X=i.mul(A,A),ne=i.mul(N,N),oe=i.mul(I,I),ue=i.mul(A,N);return ue=i.add(ue,ue),ee=i.mul(A,I),ee=i.add(ee,ee),g=i.mul(b,ee),O=i.mul(E,oe),O=i.add(g,O),g=i.sub(ne,O),O=i.add(ne,O),O=i.mul(g,O),g=i.mul(ue,g),ee=i.mul(E,ee),oe=i.mul(b,oe),ue=i.sub(X,oe),ue=i.mul(b,ue),ue=i.add(ue,ee),ee=i.add(X,X),X=i.add(ee,X),X=i.add(X,oe),X=i.mul(X,ue),O=i.add(O,X),oe=i.mul(N,I),oe=i.add(oe,oe),X=i.mul(oe,ue),g=i.sub(g,X),ee=i.mul(oe,ne),ee=i.add(ee,ee),ee=i.add(ee,ee),new h(g,O,ee)}add(b){k(b);let{X:S,Y:E,Z:A}=this,{X:N,Y:I,Z:g}=b,O=i.ZERO,ee=i.ZERO,X=i.ZERO,ne=o.a,oe=i.mul(o.b,uc),ue=i.mul(S,N),ge=i.mul(E,I),Ie=i.mul(A,g),_e=i.add(S,E),L=i.add(N,I);_e=i.mul(_e,L),L=i.add(ue,ge),_e=i.sub(_e,L),L=i.add(S,A);let G=i.add(N,g);return L=i.mul(L,G),G=i.add(ue,Ie),L=i.sub(L,G),G=i.add(E,A),O=i.add(I,g),G=i.mul(G,O),O=i.add(ge,Ie),G=i.sub(G,O),X=i.mul(ne,L),O=i.mul(oe,Ie),X=i.add(O,X),O=i.sub(ge,X),X=i.add(ge,X),ee=i.mul(O,X),ge=i.add(ue,ue),ge=i.add(ge,ue),Ie=i.mul(ne,Ie),L=i.mul(oe,L),ge=i.add(ge,Ie),Ie=i.sub(ue,Ie),Ie=i.mul(ne,Ie),L=i.add(L,Ie),ue=i.mul(ge,L),ee=i.add(ee,ue),ue=i.mul(G,L),O=i.mul(_e,O),O=i.sub(O,ue),ue=i.mul(_e,ge),X=i.mul(G,X),X=i.add(X,ue),new h(O,ee,X)}subtract(b){return k(b),this.add(b.negate())}is0(){return this.equals(h.ZERO)}multiply(b){let{endo:S}=t;if(!n.isValidNot0(b))throw new RangeError("invalid scalar: out of range");let E,A,N=I=>x.cached(this,I,g=>By(h,g));if(S){let{k1neg:I,k1:g,k2neg:O,k2:ee}=M(b),{p:X,f:ne}=N(g),{p:oe,f:ue}=N(ee);A=ne.add(ue),E=K(S.beta,X,oe,I,O)}else{let{p:I,f:g}=N(b);E=I,A=g}return By(h,[E,A])[0]}multiplyUnsafe(b){let{endo:S}=t,E=this,A=b;if(!n.isValid(A))throw new RangeError("invalid scalar: out of range");if(A===Yi||E.is0())return h.ZERO;if(A===Dr)return E;if(x.hasCache(this))return this.multiply(A);if(S){let{k1neg:N,k1:I,k2neg:g,k2:O}=M(A),{p1:ee,p2:X}=TT(h,E,I,O);return K(S.beta,ee,X,N,g)}else return x.unsafe(E,A)}toAffine(b){let S=this,E=b,{X:A,Y:N,Z:I}=S;if(i.eql(I,i.ONE))return{x:A,y:N};let g=S.is0();E==null&&(E=g?i.ONE:i.inv(I));let O=i.mul(A,E),ee=i.mul(N,E),X=i.mul(I,E);if(g)return{x:i.ZERO,y:i.ZERO};if(!i.eql(X,i.ONE))throw new Error("invZ was invalid");return{x:O,y:ee}}isTorsionFree(){let{isTorsionFree:b}=t;return a===Dr?!0:b?b(h,this):x.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:b}=t;return a===Dr?this:b?b(h,this):this.multiplyUnsafe(a)}isSmallOrder(){return a===Dr?this.is0():this.clearCofactor().is0()}toBytes(b=!0){return As(b,"isCompressed"),this.assertValidity(),w(h,this,b)}toHex(b=!0){return Ho(this.toBytes(b))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}};H(h,"BASE",new h(o.Gx,o.Gy,i.ONE)),H(h,"ZERO",new h(i.ZERO,i.ONE,i.ZERO)),H(h,"Fp",i),H(h,"Fn",n);let z=h,V=n.BITS,x=new Cp(z,t.endo?Math.ceil(V/2):V);return V>=8&&z.BASE.precompute(8),Object.freeze(z.prototype),Object.freeze(z),z}function jT(e){return Uint8Array.of(e?2:3)}function zj(e,t){let r=ks(e),i=r.ORDER,n=Yi;for(let T=i-Dr;T%Wn===Yi;T/=Wn)n+=Dr;let o=n,a=Wn<<o-Dr-Dr,s=a*Wn,u=(i-Dr)/s,c=(u-Dr)/Wn,f=s-Dr,d=a,m=r.pow(t,u),y=r.pow(t,(u+Dr)/Wn),w=(T,B)=>{let C=m,q=r.pow(B,f),F=r.sqr(q);F=r.mul(F,B);let P=r.mul(T,F);P=r.pow(P,c),P=r.mul(P,q),q=r.mul(P,B),F=r.mul(P,T);let k=r.mul(F,q);P=r.pow(k,d);let M=r.eql(P,r.ONE);q=r.mul(F,y),P=r.mul(k,C),F=r.cmov(q,F,M),k=r.cmov(P,k,M);for(let K=o;K>Dr;K--){let z=K-Wn;z=Wn<<z-Dr;let V=r.pow(k,z),x=r.eql(V,r.ONE);q=r.mul(F,C),C=r.mul(C,C),V=r.mul(k,C),F=r.cmov(q,F,x),k=r.cmov(V,k,x)}return{isValid:!r.is0(B)&&(M||r.is0(T)),value:F}};if(r.ORDER%Hy===uc){let T=(r.ORDER-uc)/Hy,B=r.sqrt(r.neg(t));w=(C,q)=>{let F=r.sqr(q),P=r.mul(C,q);F=r.mul(F,P);let k=r.pow(F,T);k=r.mul(k,P);let M=r.mul(k,B),K=r.mul(r.sqr(k),q),z=r.eql(K,C),V=r.cmov(M,k,z);return{isValid:!r.is0(q)&&z,value:V}}}return w}function zT(e,t){let r=ks(e),{A:i,B:n,Z:o}=t;if(!r.isValidNot0(i)||!r.isValidNot0(n)||!r.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");if(r.eql(o,r.neg(r.ONE))||Ty(r,o))throw new Error("mapToCurveSimpleSWU: invalid opts");let a=r.mul(n,r.inv(r.mul(o,i))),s=r.add(r.add(r.mul(r.sqr(a),a),r.mul(i,a)),n);if(!Ty(r,s))throw new Error("mapToCurveSimpleSWU: invalid opts");let u=zj(r,o);if(!r.isOdd)throw new Error("Field does not have .isOdd()");return c=>{let f,d,m,y,w,T,B,C;f=r.sqr(c),f=r.mul(f,o),d=r.sqr(f),d=r.add(d,f),m=r.add(d,r.ONE),m=r.mul(m,n),y=r.cmov(o,r.neg(d),!r.eql(d,r.ZERO)),y=r.mul(y,i),d=r.sqr(m),T=r.sqr(y),w=r.mul(T,i),d=r.add(d,w),d=r.mul(d,m),T=r.mul(T,y),w=r.mul(T,n),d=r.add(d,w),B=r.mul(f,m);let{isValid:q,value:F}=u(d,T);C=r.mul(f,c),C=r.mul(C,F),B=r.cmov(B,m,q),C=r.cmov(C,F,q);let P=r.isOdd(c)===r.isOdd(C);C=r.cmov(r.neg(C),C,P);let k=Bs(r,[y],!0)[0];return B=r.mul(B,k),{x:B,y:C}}}function KT(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Kj(e,t={}){let{Fn:r}=e,i=t.randomBytes===void 0?bi:t.randomBytes,n=Object.assign(KT(e.Fp,r),{seed:Math.max(tl(r.ORDER),16)});function o(y){try{let w=r.fromBytes(y);return r.isValidNot0(w)}catch{return!1}}function a(y,w){let{publicKey:T,publicKeyUncompressed:B}=n;try{let C=y.length;return w===!0&&C!==T||w===!1&&C!==B?!1:!!e.fromBytes(y)}catch{return!1}}function s(y){return y=y===void 0?i(n.seed):y,nc(ht(y,n.seed,"seed"),r.ORDER)}function u(y,w=!0){return e.BASE.multiply(r.fromBytes(y)).toBytes(w)}function c(y){let{secretKey:w,publicKey:T,publicKeyUncompressed:B}=n,C=r._lengths;if(!Os(y))return;let q=ht(y,void 0,"key").length,F=q===T||q===B,P=q===w||!!C?.includes(q);if(!(F&&P))return F}function f(y,w,T=!0){if(c(y)===!0)throw new Error("first arg must be private key");if(c(w)===!1)throw new Error("second arg must be public key");let B=r.fromBytes(y);return e.fromBytes(w).multiply(B).toBytes(T)}let d={isValidSecretKey:o,isValidPublicKey:a,randomSecretKey:s},m=Lp(s,u);return Object.freeze(d),Object.freeze(n),Object.freeze({getPublicKey:u,getSharedSecret:f,keygen:m,Point:e,utils:d,lengths:n})}function VT(e,t,r={}){let i=t;pp(i),Zi(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?bi:r.randomBytes,o=r.hmac===void 0?(E,A)=>My(i,E,A):r.hmac,{Fp:a,Fn:s}=e,{ORDER:u,BITS:c}=s,{keygen:f,getPublicKey:d,getSharedSecret:m,utils:y,lengths:w}=Kj(e,r),T={prehash:!0,lowS:typeof r.lowS=="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},B=u*Wn+Dr<a.ORDER;function C(E){let A=u>>Dr;return E>A}function q(E,A){if(!s.isValidNot0(A))throw new Error(`invalid signature ${E}: out of range 1..Point.Fn.ORDER`);return A}function F(){if(B)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function P(E,A){Fy(A);let N=w.signature,I=A==="compact"?N:A==="recovered"?N+1:void 0;return ht(E,I)}class k{constructor(A,N,I){H(this,"r");H(this,"s");H(this,"recovery");if(this.r=q("r",A),this.s=q("s",N),I!=null){if(F(),![0,1,2,3].includes(I))throw new Error("invalid recovery id");this.recovery=I}Object.freeze(this)}static fromBytes(A,N=T.format){P(A,N);let I;if(N==="der"){let{r:X,s:ne}=vn.toSig(ht(A));return new k(X,ne)}N==="recovered"&&(I=A[0],N="compact",A=A.subarray(1));let g=w.signature/2,O=A.subarray(0,g),ee=A.subarray(g,g*2);return new k(s.fromBytes(O),s.fromBytes(ee),I)}static fromHex(A,N){return this.fromBytes(Qu(A),N)}assertRecovery(){let{recovery:A}=this;if(A==null)throw new Error("invalid recovery id: must be present");return A}addRecoveryBit(A){return new k(this.r,this.s,A)}recoverPublicKey(A){let{r:N,s:I}=this,g=this.assertRecovery(),O=g===2||g===3?N+u:N;if(!a.isValid(O))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let ee=a.toBytes(O),X=e.fromBytes(ot(jT((g&1)===0),ee)),ne=s.inv(O),oe=K(ht(A,void 0,"msgHash")),ue=s.create(-oe*ne),ge=s.create(I*ne),Ie=e.BASE.multiplyUnsafe(ue).add(X.multiplyUnsafe(ge));if(Ie.is0())throw new Error("invalid recovery: point at infinify");return Ie.assertValidity(),Ie}hasHighS(){return C(this.s)}toBytes(A=T.format){if(Fy(A),A==="der")return Qu(vn.hexFromSig(this));let{r:N,s:I}=this,g=s.toBytes(N),O=s.toBytes(I);return A==="recovered"?(F(),ot(Uint8Array.of(this.assertRecovery()),g,O)):ot(g,O)}toHex(A){return Ho(this.toBytes(A))}}Object.freeze(k.prototype),Object.freeze(k);let M=r.bits2int===void 0?function(A){if(A.length>8192)throw new Error("input is too large");let N=ci(A),I=A.length*8-c;return I>0?N>>BigInt(I):N}:r.bits2int,K=r.bits2int_modN===void 0?function(A){return s.create(M(A))}:r.bits2int_modN,z=rc(c);function V(E){return Iy("num < 2^"+c,E,Yi,z),s.toBytes(E)}function x(E,A){return ht(E,void 0,"message"),A?ht(i(E),void 0,"prehashed message"):E}function h(E,A,N){let{lowS:I,prehash:g,extraEntropy:O}=qy(N,T);E=x(E,g);let ee=K(E),X=s.fromBytes(A);if(!s.isValidNot0(X))throw new Error("invalid private key");let ne=[V(X),V(ee)];if(O!=null&&O!==!1){let Ie=O===!0?n(w.secretKey):O;ne.push(ht(Ie,void 0,"extraEntropy"))}let oe=ot(...ne),ue=ee;function ge(Ie){let _e=M(Ie);if(!s.isValidNot0(_e))return;let L=s.inv(_e),G=e.BASE.multiply(_e).toAffine(),Q=s.create(G.x);if(Q===Yi)return;let re=s.create(L*s.create(ue+Q*X));if(re===Yi)return;let de=(G.x===Q?0:2)|Number(G.y&Dr),ce=re;return I&&C(re)&&(ce=s.neg(re),de^=1),new k(Q,ce,B?void 0:de)}return{seed:oe,k2sig:ge}}function v(E,A,N={}){let{seed:I,k2sig:g}=h(E,A,N);return lT(i.outputLen,s.BYTES,o)(I,g).toBytes(N.format)}function b(E,A,N,I={}){let{lowS:g,prehash:O,format:ee}=qy(I,T);if(N=ht(N,void 0,"publicKey"),A=x(A,O),!Os(E)){let X=E instanceof k?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+X)}P(E,ee);try{let X=k.fromBytes(E,ee),ne=e.fromBytes(N);if(g&&X.hasHighS())return!1;let{r:oe,s:ue}=X,ge=K(A),Ie=s.inv(ue),_e=s.create(ge*Ie),L=s.create(oe*Ie),G=e.BASE.multiplyUnsafe(_e).add(ne.multiplyUnsafe(L));return G.is0()?!1:s.create(G.x)===oe}catch{return!1}}function S(E,A,N={}){let{prehash:I}=qy(N,T);return A=x(A,I),k.fromBytes(E,"recovered").recoverPublicKey(A).toBytes()}return Object.freeze({keygen:f,getPublicKey:d,getSharedSecret:m,utils:y,lengths:w,Point:e,sign:v,verify:b,recoverPublicKey:S,Signature:k,hash:i})}var UT,Uy,vn,Yi,Dr,Wn,uc,Hy,GT=Br(()=>{p();qp();Do();Ps();Mp();oc();UT=(e,t)=>(e+(e>=0?t:-t)/Wn)/t;Uy=class extends Error{constructor(t=""){super(t)}},vn={Err:Uy,_tlv:{encode:(e,t)=>{let{Err:r}=vn;if(Wi(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if(typeof t!="string")throw new TypeError('"data" expected string, got type='+typeof t);if(t.length&1)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=el(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?el(n.length/2|128):"";return el(e)+o+n+t},decode(e,t){let{Err:r}=vn;t=ht(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[i++],o=!!(n&128),a=0;if(!o)a=n;else{let u=n&127;if(!u)throw new r("tlv.decode(long): indefinite length not supported");if(u>4)throw new r("tlv.decode(long): byte length is too big");let c=t.subarray(i,i+u);if(c.length!==u)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let f of c)a=a<<8|f;if(i+=u,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){let{Err:t}=vn;if(Rp(e),e<Yi)throw new t("integer: negative integers are not allowed");let r=el(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=vn;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return ci(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=vn,n=ht(e,void 0,"signature"),{v:o,l:a}=i.decode(48,n);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:s,l:u}=i.decode(2,o),{v:c,l:f}=i.decode(2,u);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(s),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=vn,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s)),o=i+n;return t.encode(48,o)}};Object.freeze(vn._tlv);Object.freeze(vn._int);Object.freeze(vn);Yi=BigInt(0),Dr=BigInt(1),Wn=BigInt(2),uc=BigInt(3),Hy=BigInt(4)});var ol={};ff(ol,{__TEST:()=>Yj,schnorr:()=>$j,schnorr_FROST:()=>iz,secp256k1:()=>Wj,secp256k1_FROST:()=>Qj,secp256k1_hasher:()=>Ky});function Gj(e){let t=Fp.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,f=c*c*e%t,d=Bi(f,r,t)*f%t,m=Bi(d,r,t)*f%t,y=Bi(m,jy,t)*c%t,w=Bi(y,n,t)*y%t,T=Bi(w,o,t)*w%t,B=Bi(T,s,t)*T%t,C=Bi(B,u,t)*B%t,q=Bi(C,s,t)*T%t,F=Bi(q,r,t)*f%t,P=Bi(F,a,t)*w%t,k=Bi(P,i,t)*c%t,M=Bi(k,jy,t);if(!jo.eql(jo.sqr(M),e))throw new Error("Cannot find square root");return M}function nl(e,...t){let r=WT[e];if(r===void 0){let i=wa(tc(e));r=ot(i,i),WT[e]=r}return wa(ot(r,...t))}function XT(e){let{Fn:t,BASE:r}=pt,i=t.fromBytes(e),n=r.multiply(i);return{scalar:Zn(n.y)?i:t.neg(i),bytes:Ls(n)}}function Up(e){let t=jo;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x \u2265 p");let r=t.create(e*e),i=t.create(r*e+BigInt(7)),n=t.sqrt(i);Zn(n)||(n=t.neg(n));let o=pt.fromAffine({x:e,y:n});return o.assertValidity(),o}function zy(...e){return pt.Fn.create(cc(nl("BIP0340/challenge",...e)))}function ZT(e){return XT(e).bytes}function Zj(e,t,r=$f(32)){let{Fn:i,BASE:n}=pt,o=ht(e,void 0,"message"),{bytes:a,scalar:s}=XT(t),u=ht(r,32,"auxRand"),c=i.toBytes(s^cc(nl("BIP0340/aux",u))),f=nl("BIP0340/nonce",c,a,o),d=i.create(cc(f));if(d===0n)throw new Error("sign failed: k is zero");let m=n.multiply(d),y=Zn(m.y)?d:i.neg(d),w=Ls(m),T=zy(w,a,o),B=new Uint8Array(64);if(B.set(w,0),B.set(i.toBytes(i.create(y+T*s)),32),!JT(B,o,a))throw new Error("sign: Invalid signature produced");return B}function JT(e,t,r){let{Fp:i,Fn:n,BASE:o}=pt,a=ht(e,64,"signature"),s=ht(t,void 0,"message"),u=ht(r,32,"publicKey");try{let c=Up(cc(u)),f=cc(a.subarray(0,32));if(!i.isValidNot0(f))return!1;let d=cc(a.subarray(32,64));if(!n.isValidNot0(d))return!1;let m=zy(n.toBytes(f),Ls(c),s),y=o.multiplyUnsafe(d).add(c.multiplyUnsafe(n.neg(m))),{x:w,y:T}=y.toAffine();return!(y.is0()||!Zn(T)||w!==f)}catch{return!1}}function QT(e,t){if(t===void 0)return $T;let r=Ls(e),i=ci(nl("TapTweak",r,t));if(!pt.Fn.isValid(i))throw new Error("invalid TapTweak hash");return i}function Vy(e){let t=pt.fromBytes(e.commitments[0]);return Zn(t.y)?e:{signers:{min:e.signers.min,max:e.signers.max},commitments:e.commitments.map(r=>pt.fromBytes(r).negate().toBytes()),verifyingShares:Object.fromEntries(Object.entries(e.verifyingShares).map(([r,i])=>[r,pt.fromBytes(i).negate().toBytes()]))}}function eP(e,t){let r=pt.fromBytes(t.commitments[0]);if(Zn(r.y))return e;let i=pt.Fn;return{...e,signingShare:i.toBytes(i.neg(i.fromBytes(e.signingShare)))}}function ez(e,t){if(Zn(e.y))return t;let r=pt.Fn;return{binding:r.toBytes(r.neg(r.fromBytes(t.binding))),hiding:r.toBytes(r.neg(r.fromBytes(t.hiding)))}}function tz(e,t,r){let i=pt.Fn,n=eP(e,t),o=Vy(t),a=QT(pt.fromBytes(o.commitments[0]),r),s=i.toBytes(i.add(i.fromBytes(n.signingShare),a));return{identifier:n.identifier,signingShare:s}}function rz(e,t){let r=Vy(e),i=QT(pt.fromBytes(r.commitments[0]),t),n=pt.BASE.multiply(i),o=r.commitments.map((s,u)=>(u===0?pt.fromBytes(s).add(n):pt.fromBytes(s)).toBytes()),a={};for(let s in r.verifyingShares)a[s]=pt.fromBytes(r.verifyingShares[s]).add(n).toBytes();return{signers:{min:r.signers.min,max:r.signers.max},commitments:o,verifyingShares:a}}var Fp,Vj,$T,jy,jo,pt,Wj,WT,Ls,Zn,cc,Yj,$j,Xj,YT,Jj,Ky,Qj,iz,al=Br(()=>{p();Qf();Do();Mp();FT();DT();oc();GT();Ps();Fp={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Vj={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},$T=BigInt(0),jy=BigInt(2);jo=ic(Fp.p,{sqrt:Gj}),pt=HT(Fp,{Fp:jo,endo:Vj}),Wj=VT(pt,wa),WT={};Ls=e=>e.toBytes(!0).slice(1),Zn=e=>e%jy===$T;cc=ci;Yj=Object.freeze({lift_x:Up}),$j=(()=>{let r=i=>(i=i===void 0?$f(48):i,nc(i,Fp.n));return Object.freeze({keygen:Lp(r,ZT),getPublicKey:ZT,sign:Zj,verify:JT,Point:pt,utils:Object.freeze({randomSecretKey:r,taggedHash:nl,lift_x:Up,pointToBytes:Ls}),lengths:Object.freeze({secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48})})})(),Xj=LT(jo,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),Jj=()=>YT||(YT=zT(jo,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:jo.create(BigInt("-11"))})),Ky=MT(pt,e=>{let{x:t,y:r}=Jj()(jo.create(e[0]));return Xj(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:jo.ORDER,m:1,k:128,expand:"xmd",hash:wa}),Qj=Ly({name:"FROST-secp256k1-SHA256-v1",Point:pt,hashToScalar:Ky.hashToScalar,hash:wa});iz=Ly({name:"FROST-secp256k1-SHA256-TR-v1",Point:pt,hashToScalar:Ky.hashToScalar,hash:wa,parsePublicKey(e){if(e.length===32)return Up(ci(e));if(e.length===33)return pt.fromBytes(e);throw new Error(`expected x-only or compressed public key, got length=${e.length}`)},adjustScalar(e){let t=pt.BASE.multiply(e);return Zn(t.y)?e:pt.Fn.neg(e)},adjustPoint:e=>Zn(e.y)?e:e.negate(),challenge(e,t,r){return zy(Ls(e),Ls(t),r)},adjustNonces:ez,adjustGroupCommitmentShare:(e,t)=>Zn(e.y)?t:t.negate(),adjustPublic:Vy,adjustSecret:eP,adjustTx:{encode:e=>e.subarray(1),decode:e=>ot(Uint8Array.of(2),e)},adjustDKG:e=>{let t=new Uint8Array(0);return{public:rz(e.public,t),secret:tz(e.secret,e.public,t)}}})});var $i=R((tie,nP)=>{"use strict";p();var tP=Ge(),{secp256k1:nz}=(al(),Hi(ol)),ul=nz.Point,Hp=ul.Fn.ORDER;function oz(e){return BigInt("0x"+(e.toString(16)||"0"))}function Gy(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new tP(t,16)}function jp(e){if(e==null)throw new Error("Invalid Point");if(typeof e=="bigint")return e;if(typeof e=="number")return BigInt(e);if(typeof e=="string")return BigInt(e.indexOf("0x")===0?e:"0x"+e);if(typeof e.toString=="function")return oz(e);throw new Error("Invalid Point")}function sl(e){var t=Object.create(gt.prototype);return t._p=e,t}function rP(e,t){var r=jp(t).toString(16).padStart(64,"0");return ul.fromHex((e?"03":"02")+r)}function iP(e,t){var r;try{r=rP((t&1n)===1n,e)}catch{throw new Error("Point does not lie on the curve")}if(r.toAffine().y!==t)throw new Error("Invalid y value for curve.")}function gt(e,t,r){if(!(this instanceof gt))return new gt(e,t,r);var i,n;try{i=jp(e),n=jp(t)}catch{throw new Error("Invalid Point")}iP(i,n);try{this._p=ul.fromAffine({x:i,y:n})}catch{throw new Error("Invalid Point")}return this}gt.fromX=function(t,r){try{var i=sl(rP(t,r))}catch{throw new Error("Invalid X")}return i.validate(),i};gt.getG=function(){return sl(ul.BASE)};gt.getN=function(){return Gy(Hp)};gt.prototype.getX=function(){return Gy(this._p.toAffine().x)};gt.prototype.getY=function(){return Gy(this._p.toAffine().y)};Object.defineProperty(gt.prototype,"x",{configurable:!0,enumerable:!0,get:function(){return this.getX()}});Object.defineProperty(gt.prototype,"y",{configurable:!0,enumerable:!0,get:function(){return this.getY()}});gt.prototype.mul=function(t){var r=(jp(t)%Hp+Hp)%Hp;return r===0n||this._p.is0()?sl(ul.ZERO):sl(this._p.multiply(r))};gt.prototype.add=function(t){return sl(this._p.add(t._p))};gt.prototype.mulAdd=function(t,r,i){return this.mul(t).add(r.mul(i))};gt.prototype.eq=function(t){return this._p.equals(t._p)};gt.prototype.isInfinity=function(){return this._p.is0()};gt.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var t=this._p.toAffine();return iP(t.x,t.y),this};gt.pointToCompressed=function(t){var r=t.getX().toBuffer({size:32}),i=t.getY().toBuffer({size:32}),n,o=i[i.length-1]%2;return o?n=l.Buffer.from([3]):n=l.Buffer.from([2]),l.Buffer.concat([n,r])};gt.pointFromCompressed=function(e){if(e.length!==33)throw new Error("invalid buffer length");var t=e[0],r;if(t===3)r=!0;else if(t===2)r=!1;else throw new Error("invalid value of compressed prefix");var i=tP.fromBuffer(e.slice(1,33));return gt.fromX(r,i)};gt.prototype.toBuffer=function(){return gt.pointToCompressed(this)};gt.prototype.toHex=function(){return this.toBuffer().toString("hex")};gt.fromBuffer=function(e){return gt.pointFromCompressed(e)};gt.fromHex=function(e){return gt.fromBuffer(l.Buffer.from(e,"hex"))};nP.exports=gt});var Gr=R((iie,sP)=>{"use strict";p();var aP=Ve(),az=Oe(),oP=function(t){return aP.isString(t)?/^[0-9a-fA-F]+$/.test(t):!1};sP.exports={isValidJSON:function(t){var r;if(!aP.isString(t))return!1;try{r=JSON.parse(t)}catch{return!1}return typeof r=="object"},isHexa:oP,isHexaString:oP,defineImmutable:function(t,r){return Object.keys(r).forEach(function(i){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,value:r[i]})}),t},isNaturalNumber:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&t>=0},integerAsBuffer:function(t){az.checkArgumentType(t,"number","integer");let r=l.Buffer.allocUnsafe(4);return r.writeUInt32BE(t,0),r}}});var at=R((oie,cP)=>{"use strict";p();var Ms=Ge(),sz=Ve(),fi=Oe(),uz=Gr(),je=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof Ms)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};je.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=typeof e.i<"u"?e.i:this.i,this.compressed=typeof e.compressed<"u"?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this};je.fromCompact=function(e){fi.checkArgument(l.Buffer.isBuffer(e),"Argument is expected to be a Buffer");var t=new je,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i=i+4);var n=e.slice(1,33),o=e.slice(33,65);return fi.checkArgument(i===0||i===1||i===2||i===3,new Error("i must be 0, 1, 2, or 3")),fi.checkArgument(n.length===32,new Error("r must be 32 bytes")),fi.checkArgument(o.length===32,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=Ms.fromBuffer(n),t.s=Ms.fromBuffer(o),t};je.fromDER=je.fromBuffer=function(e,t){var r=je.parseDER(e,t),i=new je;return i.r=r.r,i.s=r.s,i};je.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=je.fromDER(r,!1);return i.nhashtype=t,i};je.fromString=function(e){var t=l.Buffer.from(e,"hex");return je.fromDER(t)};function uP(e,t){fi.checkArgument(t.length>0,new Error("Length of "+e+" is zero")),fi.checkArgument(!(t[0]&128),new Error("Value of "+e+" is negative")),fi.checkArgument(!(t.length>1&&t[0]===0&&!(t[1]&128)),new Error("Value of "+e+" is excessively padded"))}je.parseDER=function(e,t){fi.checkArgument(l.Buffer.isBuffer(e),new Error("DER formatted signature should be a buffer")),sz.isUndefined(t)&&(t=!0);var r=e[0];fi.checkArgument(r===48,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;fi.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i<n?i:n;var o=e[2];fi.checkArgument(o===2,new Error("Integer byte for r should be 0x02"));var a=e[3],s=e.slice(4,4+a),u=Ms.fromBuffer(s),c=e[4]===0;fi.checkArgument(a===s.length,new Error("Length of r incorrect"));var f=e[4+a+0];fi.checkArgument(f===2,new Error("Integer byte for s should be 0x02"));var d=e[4+a+1],m=e.slice(4+a+2,4+a+2+d),y=Ms.fromBuffer(m),w=e[4+a+2]===0;fi.checkArgument(d===m.length,new Error("Length of s incorrect"));var T=4+a+2+d;fi.checkArgument(i===T-2,new Error("Length of signature incorrect")),t&&(uP("r",s),uP("s",m));var B={header:r,length:i,rheader:o,rlength:a,rneg:c,rbuf:s,r:u,sheader:f,slength:d,sneg:w,sbuf:m,s:y};return B};je.prototype.toCompact=function(e,t){if(e=typeof e=="number"?e:this.i,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;t===!1&&(r=r-4);var i=l.Buffer.from([r]),n=this.r.toBuffer({size:32}),o=this.s.toBuffer({size:32});return l.Buffer.concat([i,n,o])};je.prototype.toBuffer=je.prototype.toDER=function(){var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(e[0]&128),i=!!(t[0]&128),n=r?l.Buffer.concat([l.Buffer.from([0]),e]):e,o=i?l.Buffer.concat([l.Buffer.from([0]),t]):t,a=n.length,s=o.length,u=2+a+2+s,c=2,f=2,d=48,m=l.Buffer.concat([l.Buffer.from([d,u,c,a]),n,l.Buffer.from([f,s]),o]);return m};je.prototype.toString=function(){var e=this.toDER();return e.toString("hex")};je.isTxDER=function(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(e[2]!==2||t===0||i[0]&128||t>1&&i[0]===0&&!(i[1]&128))return!1;var n=e.slice(6+t);return!(e[6+t-2]!==2||r===0||n[0]&128||r>1&&n[0]===0&&!(n[1]&128))};je.prototype.hasLowS=function(){return!(this.s.lt(new Ms(1))||this.s.gt(new Ms("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))};je.prototype.hasDefinedHashtype=function(){if(!uz.isNaturalNumber(this.nhashtype))return!1;var e=this.nhashtype&31;return!(e<je.SIGHASH_ALL||e>je.SIGHASH_SINGLE)};je.prototype.toTxFormat=function(){var e=this.toDER(),t=l.Buffer.alloc(1);return t.writeUInt8(this.nhashtype,0),l.Buffer.concat([e,t])};je.SIGHASH_ALL=1;je.SIGHASH_NONE=2;je.SIGHASH_SINGLE=3;je.SIGHASH_CHRONICLE=32;je.SIGHASH_FORKID=64;je.SIGHASH_ANYONECANPAY=128;je.prototype.isCanonical=function(){var e=$i(),t=e.getN().shrn(1);return this.s.lte(t)};je.prototype.toCanonical=function(){if(this.isCanonical())return new je({r:this.r,s:this.s,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype});var e=$i(),t=e.getN(),r=t.sub(this.s);return new je({r:this.r,s:r,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype})};je.prototype.validate=function(){if(!this.r||!this.s)throw new Error("Signature missing r or s component");if(this.r.isZero())throw new Error("Signature r component is zero");if(this.s.isZero())throw new Error("Signature s component is zero");var e=$i(),t=e.getN();if(this.r.gte(t))throw new Error("Signature r component >= curve order");if(this.s.gte(t))throw new Error("Signature s component >= curve order");if(this.r.isNeg())throw new Error("Signature r component is negative");if(this.s.isNeg())throw new Error("Signature s component is negative");return!0};je.prototype.isValid=function(){try{return this.validate(),!0}catch{return!1}};je.prototype.applySecurityPatches=function(){var e=$i(),t=e.getN(),r=t.shrn(1);if(this.r.isZero()||this.s.isZero())throw new Error("Invalid signature: zero r or s");if(this.r.gte(t)||this.s.gte(t))throw new Error("Invalid signature: out of range");if(this.s.gt(r))throw new Error("Invalid signature: non-canonical (high) s");return this};cP.exports=je});var lP=R((sie,fP)=>{"use strict";p();var zp=Dt(),zo=Oe(),gr=fP.exports;gr.sha1=function(e){return zo.checkArgument(l.Buffer.isBuffer(e)),zp.createHash("sha1").update(e).digest()};gr.sha1.blocksize=512;gr.sha256=function(e){return zo.checkArgument(l.Buffer.isBuffer(e)),zp.createHash("sha256").update(e).digest()};gr.sha256.blocksize=512;gr.sha256sha256=function(e){return zo.checkArgument(l.Buffer.isBuffer(e)),gr.sha256(gr.sha256(e))};gr.ripemd160=function(e){return zo.checkArgument(l.Buffer.isBuffer(e)),zp.createHash("ripemd160").update(e).digest()};gr.sha256ripemd160=function(e){return zo.checkArgument(l.Buffer.isBuffer(e)),gr.ripemd160(gr.sha256(e))};gr.sha512=function(e){return zo.checkArgument(l.Buffer.isBuffer(e)),zp.createHash("sha512").update(e).digest()};gr.sha512.blocksize=1024;gr.hmac=function(e,t,r){zo.checkArgument(l.Buffer.isBuffer(t)),zo.checkArgument(l.Buffer.isBuffer(r)),zo.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r.length<i){var n=l.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=l.Buffer.alloc(i);o.fill(92);var a=l.Buffer.alloc(i);a.fill(54);for(var s=l.Buffer.alloc(i),u=l.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(l.Buffer.concat([s,e(l.Buffer.concat([u,t]))]))};gr.sha256hmac=function(e,t){return gr.hmac(gr.sha256,e,t)};gr.sha512hmac=function(e,t){return gr.hmac(gr.sha512,e,t)}});var yP={};ff(yP,{_MD5:()=>Wp,_RIPEMD160:()=>Zp,_SHA1:()=>Gp,md5:()=>hz,ripemd160:()=>bz,sha1:()=>cz});function hP(e,t,r,i){return e===0?t^r^i:e===1?t&r|~t&i:e===2?(t|~r)^i:e===3?t&i|r&~i:t^(r|~i)}var fc,Ea,Gp,cz,fz,lz,Kp,Wy,Wp,hz,dz,dP,pz,pP,gP,mP,vP,gz,mz,vz,yz,Vp,Zp,bz,bP=Br(()=>{p();by();Do();fc=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),Ea=new Uint32Array(80),Gp=class extends qo{constructor(){super(64,20,8,!1);H(this,"A",fc[0]|0);H(this,"B",fc[1]|0);H(this,"C",fc[2]|0);H(this,"D",fc[3]|0);H(this,"E",fc[4]|0)}get(){let{A:r,B:i,C:n,D:o,E:a}=this;return[r,i,n,o,a]}set(r,i,n,o,a){this.A=r|0,this.B=i|0,this.C=n|0,this.D=o|0,this.E=a|0}process(r,i){for(let c=0;c<16;c++,i+=4)Ea[c]=r.getUint32(i,!1);for(let c=16;c<80;c++)Ea[c]=Lo(Ea[c-3]^Ea[c-8]^Ea[c-14]^Ea[c-16],1);let{A:n,B:o,C:a,D:s,E:u}=this;for(let c=0;c<80;c++){let f,d;c<20?(f=Xu(o,a,s),d=1518500249):c<40?(f=o^a^s,d=1859775393):c<60?(f=yp(o,a,s),d=2400959708):(f=o^a^s,d=3395469782);let m=Lo(n,5)+f+u+d+Ea[c]|0;u=s,s=a,a=Lo(o,30),o=n,n=m}n=n+this.A|0,o=o+this.B|0,a=a+this.C|0,s=s+this.D|0,u=u+this.E|0,this.set(n,o,a,s,u)}roundClean(){ri(Ea)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0),ri(this.buffer)}},cz=mn(()=>new Gp),fz=Math.pow(2,32),lz=Array.from({length:64},(e,t)=>Math.floor(fz*Math.abs(Math.sin(t+1)))),Kp=fc.slice(0,4),Wy=new Uint32Array(16),Wp=class extends qo{constructor(){super(64,16,8,!0);H(this,"A",Kp[0]|0);H(this,"B",Kp[1]|0);H(this,"C",Kp[2]|0);H(this,"D",Kp[3]|0)}get(){let{A:r,B:i,C:n,D:o}=this;return[r,i,n,o]}set(r,i,n,o){this.A=r|0,this.B=i|0,this.C=n|0,this.D=o|0}process(r,i){for(let u=0;u<16;u++,i+=4)Wy[u]=r.getUint32(i,!0);let{A:n,B:o,C:a,D:s}=this;for(let u=0;u<64;u++){let c,f,d;u<16?(c=Xu(o,a,s),f=u,d=[7,12,17,22]):u<32?(c=Xu(s,o,a),f=(5*u+1)%16,d=[5,9,14,20]):u<48?(c=o^a^s,f=(3*u+5)%16,d=[4,11,16,23]):(c=a^(o|~s),f=7*u%16,d=[6,10,15,21]),c=c+n+lz[u]+Wy[f],n=s,s=a,a=o,o=o+Lo(c,d[u%4])}n=n+this.A|0,o=o+this.B|0,a=a+this.C|0,s=s+this.D|0,this.set(n,o,a,s)}roundClean(){ri(Wy)}destroy(){this.destroyed=!0,this.set(0,0,0,0),ri(this.buffer)}},hz=mn(()=>new Wp),dz=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),dP=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),pz=dP.map(e=>(9*e+5)%16),pP=(()=>{let r=[[dP],[pz]];for(let i=0;i<4;i++)for(let n of r)n.push(n[i].map(o=>dz[o]));return r})(),gP=pP[0],mP=pP[1],vP=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),gz=gP.map((e,t)=>e.map(r=>vP[t][r])),mz=mP.map((e,t)=>e.map(r=>vP[t][r])),vz=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),yz=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);Vp=new Uint32Array(16),Zp=class extends qo{constructor(){super(64,20,8,!0);H(this,"h0",1732584193);H(this,"h1",-271733879);H(this,"h2",-1732584194);H(this,"h3",271733878);H(this,"h4",-1009589776)}get(){let{h0:r,h1:i,h2:n,h3:o,h4:a}=this;return[r,i,n,o,a]}set(r,i,n,o,a){this.h0=r|0,this.h1=i|0,this.h2=n|0,this.h3=o|0,this.h4=a|0}process(r,i){for(let w=0;w<16;w++,i+=4)Vp[w]=r.getUint32(i,!0);let n=this.h0|0,o=n,a=this.h1|0,s=a,u=this.h2|0,c=u,f=this.h3|0,d=f,m=this.h4|0,y=m;for(let w=0;w<5;w++){let T=4-w,B=vz[w],C=yz[w],q=gP[w],F=mP[w],P=gz[w],k=mz[w];for(let M=0;M<16;M++){let K=Lo(n+hP(w,a,u,f)+Vp[q[M]]+B,P[M])+m|0;n=m,m=f,f=Lo(u,10)|0,u=a,a=K}for(let M=0;M<16;M++){let K=Lo(o+hP(T,s,c,d)+Vp[F[M]]+C,k[M])+y|0;o=y,y=d,d=Lo(c,10)|0,c=s,s=K}}this.set(this.h1+u+d|0,this.h2+f+y|0,this.h3+m+o|0,this.h4+n+s|0,this.h0+a+c|0)}roundClean(){ri(Vp)}destroy(){this.destroyed=!0,ri(this.buffer),this.set(0,0,0,0,0)}},bz=mn(()=>new Zp)});var SP=R((die,_P)=>{"use strict";p();var{sha256:_z,sha512:Sz}=(Qf(),Hi(Ap)),{sha1:wz,ripemd160:Ez}=(bP(),Hi(yP)),Ko=Oe(),mr=_P.exports;mr.sha1=function(e){return Ko.checkArgument(l.Buffer.isBuffer(e)),l.Buffer.from(wz(e))};mr.sha1.blocksize=512;mr.sha256=function(e){return Ko.checkArgument(l.Buffer.isBuffer(e)),l.Buffer.from(_z(e))};mr.sha256.blocksize=512;mr.sha256sha256=function(e){return Ko.checkArgument(l.Buffer.isBuffer(e)),mr.sha256(mr.sha256(e))};mr.ripemd160=function(e){return Ko.checkArgument(l.Buffer.isBuffer(e)),l.Buffer.from(Ez(e))};mr.sha256ripemd160=function(e){return Ko.checkArgument(l.Buffer.isBuffer(e)),mr.ripemd160(mr.sha256(e))};mr.sha512=function(e){return Ko.checkArgument(l.Buffer.isBuffer(e)),l.Buffer.from(Sz(e))};mr.sha512.blocksize=1024;mr.hmac=function(e,t,r){Ko.checkArgument(l.Buffer.isBuffer(t)),Ko.checkArgument(l.Buffer.isBuffer(r)),Ko.checkArgument(e.blocksize);var i=e.blocksize/8;if(r.length>i)r=e(r);else if(r.length<i){var n=l.Buffer.alloc(i);n.fill(0),r.copy(n),r=n}var o=l.Buffer.alloc(i);o.fill(92);var a=l.Buffer.alloc(i);a.fill(54);for(var s=l.Buffer.alloc(i),u=l.Buffer.alloc(i),c=0;c<i;c++)s[c]=o[c]^r[c],u[c]=a[c]^r[c];return e(l.Buffer.concat([s,e(l.Buffer.concat([u,t]))]))};mr.sha256hmac=function(e,t){return mr.hmac(mr.sha256,e,t)};mr.sha512hmac=function(e,t){return mr.hmac(mr.sha512,e,t)}});var ke=R((gie,EP)=>{"use strict";p();var wP={sha1:"a9993e364706816aba3e25717850c26c9cd0d89d",sha256:"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",sha512:"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f",ripemd160:"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"};function xz(){var e;try{e=Dt()}catch{return!1}if(!e||typeof e.createHash!="function")return!1;for(var t=Object.keys(wP),r=0;r<t.length;r++){var i=t[r];try{if(e.createHash(i).update("abc").digest("hex")!==wP[i])return!1}catch{return!1}}return!0}EP.exports=xz()?lP():SP()});var Wo=R((vie,OP)=>{"use strict";p();var Vo=Ve(),cl=Gr(),Ds=[],fl={};function xP(){}xP.prototype.toString=function(){return this.name};function ll(e,t){if(~Ds.indexOf(e))return e;if(t){Vo.isArray(t)||(t=[t]);for(var r=0;r<Ds.length;r++){var i=Ds[r],n=Vo.pick(i,t),o=Vo.values(n);if(~o.indexOf(e))return i}return}return fl[e]}function Yp(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r)&31);return t}function hl(e){var t=new xP;cl.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey});var r=e.indexBy||Object.keys(e);return e.cashAddrPrefix&&Vo.extend(t,{cashAddrPrefix:e.cashAddrPrefix,cashAddrPrefixArray:Yp(e.cashAddrPrefix)}),e.networkMagic&&Vo.extend(t,{networkMagic:cl.integerAsBuffer(e.networkMagic)}),e.port&&Vo.extend(t,{port:e.port}),e.dnsSeeds&&Vo.extend(t,{dnsSeeds:e.dnsSeeds}),Ds.push(t),Iz(t,r),t}function Iz(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=e[i];!Vo.isUndefined(n)&&!Vo.isObject(n)&&(fl[n]=e)}}function Oz(e,t){for(var r=0;r<t.length;r++){var i=t[r];fl[i]===e&&delete fl[i]}}function Az(e){for(var t=0;t<Ds.length;t++)Ds[t]===e&&Ds.splice(t,1);Oz(e,Object.keys(fl))}var $p={livenet:3823236072,testnet:4108710900,regtest:3669344250,stn:4224632057},IP=["seed.bitcoinsv.org","seed.bitcoinunlimited.info"],xa={PORT:18333,NETWORK_MAGIC:$p.testnet,DNS_SEEDS:IP,PREFIX:"testnet",CASHADDRPREFIX:"bchtest"},Go={PORT:18444,NETWORK_MAGIC:$p.regtest,DNS_SEEDS:[],PREFIX:"regtest",CASHADDRPREFIX:"bchreg"},Ia={PORT:9333,NETWORK_MAGIC:$p.stn,DNS_SEEDS:["stn-seed.bitcoinsv.io"],PREFIX:"stn",CASHADDRPREFIX:"bsvstn"},Tz={name:"livenet",alias:"mainnet",prefix:"bitcoin",cashAddrPrefix:"bitcoincash",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:$p.livenet,port:8333,dnsSeeds:IP},Pz={name:"testnet",prefix:xa.PREFIX,cashAddrPrefix:xa.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:xa.NETWORK_MAGIC},Rz={name:"regtest",prefix:Go.PREFIX,cashAddrPrefix:Go.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Go.NETWORK_MAGIC,port:Go.PORT,dnsSeeds:[],indexBy:["port","name","cashAddrPrefix","networkMagic"]},kz={name:"stn",prefix:Ia.PREFIX,cashAddrPrefix:Ia.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:Ia.NETWORK_MAGIC,indexBy:["port","name","cashAddrPrefix","networkMagic"]};hl(Pz);hl(kz);hl(Rz);hl(Tz);var Zy=ll("livenet"),Bz=ll("regtest"),Yn=ll("testnet"),Nz=ll("stn");Object.defineProperty(Yn,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Go.PORT:this.stnEnabled?Ia.PORT:xa.PORT}});Object.defineProperty(Yn,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?cl.integerAsBuffer(Go.NETWORK_MAGIC):this.stnEnabled?cl.integerAsBuffer(Ia.NETWORK_MAGIC):cl.integerAsBuffer(xa.NETWORK_MAGIC)}});Object.defineProperty(Yn,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Go.DNS_SEEDS:this.stnEnabled?Ia.DNS_SEEDS:xa.DNS_SEEDS}});Object.defineProperty(Yn,"cashAddrPrefix",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Go.CASHADDRPREFIX:this.stnEnabled?Ia.CASHADDRPREFIX:xa.CASHADDRPREFIX}});Object.defineProperty(Yn,"cashAddrPrefixArray",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?Yp(Go.CASHADDRPREFIX):this.stnEnabled?Yp(Ia.CASHADDRPREFIX):Yp(xa.CASHADDRPREFIX)}});function Cz(){Yn.regtestEnabled=!0}function Lz(){Yn.regtestEnabled=!1}function Mz(){Yn.stnEnabled=!0}function Dz(){Yn.stnEnabled=!1}OP.exports={add:hl,remove:Az,defaultNetwork:Zy,livenet:Zy,mainnet:Zy,testnet:Yn,regtest:Bz,stn:Nz,get:ll,enableRegtest:Cz,disableRegtest:Lz,enableStn:Mz,disableStn:Dz}});var lc=R((bie,RP)=>{"use strict";p();var AP=Ve(),Xp=Zu(),TP=Lt(),PP=ke().sha256sha256,qt=function e(t){if(!(this instanceof e))return new e(t);if(l.Buffer.isBuffer(t)){var r=t;this.fromBuffer(r)}else if(typeof t=="string"){var i=t;this.fromString(i)}};qt.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this};qt.validChecksum=function(t,r){return AP.isString(t)&&(t=TP.Buffer.from(Xp.decode(t))),AP.isString(r)&&(r=TP.Buffer.from(Xp.decode(r))),r||(r=t.slice(-4),t=t.slice(0,-4)),qt.checksum(t).toString("hex")===r.toString("hex")};qt.decode=function(e){if(typeof e!="string")throw new Error("Input must be a string");var t=l.Buffer.from(Xp.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),i=t.slice(-4),n=PP(r),o=n.slice(0,4);if(i.toString("hex")!==o.toString("hex"))throw new Error("Checksum mismatch");return r};qt.checksum=function(e){return PP(e).slice(0,4)};qt.encode=function(e){if(!l.Buffer.isBuffer(e))throw new Error("Input must be a buffer");var t=l.Buffer.alloc(e.length+4),r=qt.checksum(e);return e.copy(t),r.copy(t,e.length),Xp.encode(t)};qt.prototype.fromBuffer=function(e){return this.buf=e,this};qt.fromBuffer=function(e){return new qt().fromBuffer(e)};qt.fromHex=function(e){return qt.fromBuffer(l.Buffer.from(e,"hex"))};qt.prototype.fromString=function(e){var t=qt.decode(e);return this.buf=t,this};qt.fromString=function(e){var t=qt.decode(e);return new qt(t)};qt.prototype.toBuffer=function(){return this.buf};qt.prototype.toHex=function(){return this.toBuffer().toString("hex")};qt.prototype.toString=function(){return qt.encode(this.buf)};RP.exports=qt});var $n=R((Sie,BP)=>{"use strict";p();var dl=Ve(),kP=Oe(),hc=Ge(),jt=function e(t){if(!(this instanceof e))return new e(t);if(!dl.isUndefined(t))if(l.Buffer.isBuffer(t))this.set({buf:t});else if(dl.isString(t)){var r=l.Buffer.from(t,"hex");if(r.length*2!==t.length)throw new TypeError("Invalid hex string");this.set({buf:r})}else if(dl.isObject(t)){var i=t;this.set(i)}else throw new TypeError("Unrecognized argument for BufferReader")};jt.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this};jt.prototype.eof=function(){return this.pos>=this.buf.length};jt.prototype.finished=jt.prototype.eof;jt.prototype.read=function(e){kP.checkArgument(!dl.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t};jt.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e};jt.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e};jt.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e};jt.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e};jt.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e};jt.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e};jt.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e};jt.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=hc.fromBuffer(e);return this.pos=this.pos+8,t};jt.prototype.readUInt64LEBN=function(){var e=this.buf.readUInt32LE(this.pos),t=this.buf.readUInt32LE(this.pos+4),r=t*4294967296+e,i;if(r<=9007199254740991)i=new hc(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);i=new hc(n,10,"le")}return this.pos=this.pos+8,i};jt.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN(),r=t.toNumber();if(r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarintBN");default:return e}};jt.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return kP.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t};jt.prototype.readVarintBuf=function(){var e=this.buf.readUInt8(this.pos);switch(e){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}};jt.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new hc(this.readUInt16LE());case 254:return new hc(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new hc(e)}};jt.prototype.reverse=function(){for(var e=l.Buffer.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this};jt.prototype.readReverse=function(e){dl.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,l.Buffer.from(t).reverse()};BP.exports=jt});var Xy=R((Eie,MP)=>{"use strict";p();function Oa(e){"@babel/helpers - typeof";return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(e)}function NP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Fz(i.key),i)}}function qz(e,t,r){return t&&NP(e.prototype,t),r&&NP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fz(e){var t=Uz(e,"string");return Oa(t)==="symbol"?t:String(t)}function Uz(e,t){if(Oa(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(Oa(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jz(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$y(e,t)}function $y(e,t){return $y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},$y(e,t)}function zz(e){var t=Gz();return function(){var i=Jp(e),n;if(t){var o=Jp(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return Kz(this,n)}}function Kz(e,t){if(t&&(Oa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vz(e)}function Vz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gz(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jp(e){return Jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jp(e)}var LP={},dc,Yy;function pl(e,t,r){r||(r=Error);function i(o,a,s){return typeof t=="string"?t:t(o,a,s)}var n=(function(o){jz(s,o);var a=zz(s);function s(u,c,f){var d;return Hz(this,s),d=a.call(this,i(u,c,f)),d.code=e,d}return qz(s)})(r);LP[e]=n}function CP(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Wz(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Zz(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Yz(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}pl("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);pl("ERR_INVALID_ARG_TYPE",function(e,t,r){dc===void 0&&(dc=Aa()),dc(typeof e=="string","'name' must be a string");var i;typeof t=="string"&&Wz(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(Zz(e," argument"))n="The ".concat(e," ").concat(i," ").concat(CP(t,"type"));else{var o=Yz(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(o," ").concat(i," ").concat(CP(t,"type"))}return n+=". Received type ".concat(Oa(r)),n},TypeError);pl("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";Yy===void 0&&(Yy=Ki());var i=Yy.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)},TypeError,RangeError);pl("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return r&&r.constructor&&r.constructor.name?i="instance of ".concat(r.constructor.name):i="type ".concat(Oa(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError);pl("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];dc===void 0&&(dc=Aa()),dc(t.length>0,"At least one arg needs to be specified");var i="The ",n=t.length;switch(t=t.map(function(o){return'"'.concat(o,'"')}),n){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,n-1).join(", "),i+=", and ".concat(t[n-1]," arguments");break}return"".concat(i," must be specified")},TypeError);MP.exports.codes=LP});var GP=R((Iie,VP)=>{"use strict";p();function DP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function qP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DP(Object(r),!0).forEach(function(i){$z(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DP(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function $z(e,t,r){return t=jP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,jP(i.key),i)}}function Jz(e,t,r){return t&&FP(e.prototype,t),r&&FP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jP(e){var t=Qz(e,"string");return _i(t)==="symbol"?t:String(t)}function Qz(e,t){if(_i(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(_i(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yl(e,t)}function tK(e){var t=KP();return function(){var i=bl(e),n;if(t){var o=bl(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return zP(this,n)}}function zP(e,t){if(t&&(_i(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jy(e)}function Jy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qy(e){var t=typeof Map=="function"?new Map:void 0;return Qy=function(i){if(i===null||!rK(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(i))return t.get(i);t.set(i,n)}function n(){return Qp(i,arguments,bl(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),yl(n,i)},Qy(e)}function Qp(e,t,r){return KP()?Qp=Reflect.construct.bind():Qp=function(n,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(n,s),c=new u;return a&&yl(c,a.prototype),c},Qp.apply(null,arguments)}function KP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rK(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function yl(e,t){return yl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},yl(e,t)}function bl(e){return bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bl(e)}function _i(e){"@babel/helpers - typeof";return _i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_i(e)}var iK=Ki(),eb=iK.inspect,nK=Xy(),oK=nK.codes.ERR_INVALID_ARG_TYPE;function UP(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function aK(e,t){if(t=Math.floor(t),e.length==0||t==0)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,r-e.length),e}var yn="",gl="",ml="",Wr="",qs={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},sK=10;function HP(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(i){r[i]=e[i]}),Object.defineProperty(r,"message",{value:e.message}),r}function vl(e){return eb(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function uK(e,t,r){var i="",n="",o=0,a="",s=!1,u=vl(e),c=u.split(`
|
|
14
14
|
`),f=vl(t).split(`
|
|
@@ -66,7 +66,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
66
66
|
`))}throw i}};function _R(e,t,r,i,n){if(!hg(t))throw new pc("regexp","RegExp",t);var o=n==="match";if(typeof e!="string"||dg(t,e)!==o){if(r instanceof Error)throw r;var a=!r;r=r||(typeof e!="string"?'The "string" argument must be of type string. Received type '+"".concat(bn(e)," (").concat(lg(e),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(lg(t),`. Input:
|
|
67
67
|
|
|
68
68
|
`).concat(lg(e),`
|
|
69
|
-
`));var s=new Ra({actual:e,expected:t,message:r,operator:n,stackStartFn:i});throw s.generatedMessage=a,s}}_t.match=function e(t,r,i){_R(t,r,i,e,"match")};_t.doesNotMatch=function e(t,r,i){_R(t,r,i,e,"doesNotMatch")};function SR(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];dR.apply(void 0,[SR,t.length].concat(t))}_t.strict=_V(SR,_t,{equal:_t.strictEqual,deepEqual:_t.deepStrictEqual,notEqual:_t.notStrictEqual,notDeepEqual:_t.notDeepStrictEqual});_t.strict.strict=_t.strict});var Qi=R((sne,xR)=>{"use strict";p();var ER=Aa(),zt=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};zt.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};zt.prototype.toBuffer=function(){return this.concat()};zt.prototype.concat=function(){return l.Buffer.concat(this.bufs,this.bufLen)};zt.prototype.write=function(e){return ER(l.Buffer.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};zt.prototype.writeReverse=function(e){return ER(l.Buffer.isBuffer(e)),this.bufs.push(l.Buffer.from(e).reverse()),this.bufLen+=e.length,this};zt.prototype.writeUInt8=function(e){var t=l.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};zt.prototype.writeUInt16BE=function(e){var t=l.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};zt.prototype.writeUInt16LE=function(e){var t=l.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};zt.prototype.writeUInt32BE=function(e){var t=l.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};zt.prototype.writeInt32LE=function(e){var t=l.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};zt.prototype.writeUInt32LE=function(e){var t=l.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};zt.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};zt.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};zt.prototype.writeVarintNum=function(e){var t=zt.varintBufNum(e);return this.write(t),this};zt.prototype.writeVarintBN=function(e){var t=zt.varintBufBN(e);return this.write(t),this};zt.varintBufNum=function(e){var t;return e<253?(t=l.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=l.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=l.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=l.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};zt.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)t=l.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=l.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=l.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new zt;i.writeUInt8(255),i.writeUInt64LEBN(e),t=i.concat()}return t};xR.exports=zt});var xr=R((cne,IR)=>{"use strict";p();var gc=Ve(),Al=Oe(),wV=Gr();function et(e){if(!(this instanceof et))return new et(e);var t;if(gc.isNumber(e))t=e;else if(gc.isString(e))t=et.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return wV.defineImmutable(this,{num:t}),this}et.fromBuffer=function(e){return Al.checkArgument(l.Buffer.isBuffer(e)),new et(+("0x"+e.toString("hex")))};et.fromNumber=function(e){return Al.checkArgument(gc.isNumber(e)),new et(e)};et.fromString=function(e){Al.checkArgument(gc.isString(e));var t=et.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new et(t)};et.prototype.toHex=function(){return this.num.toString(16)};et.prototype.toBuffer=function(){return l.Buffer.from(this.toHex(),"hex")};et.prototype.toNumber=function(){return this.num};et.prototype.toString=function(){var e=et.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};et.smallInt=function(e){return Al.checkArgument(gc.isNumber(e),"Invalid Argument: n should be number"),Al.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?et("OP_0"):new et(et.map.OP_1+e-1)};et.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_LSHIFTNUM:182,OP_RSHIFTNUM:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};et.reverseMap=[];for(pb in et.map)et.reverseMap[et.map[pb]]=pb;var pb;gc.extend(et,et.map);et.isSmallIntOp=function(e){return e instanceof et&&(e=e.toNumber()),e===et.map.OP_0||e>=et.map.OP_1&&e<=et.map.OP_16};et.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};IR.exports=et});var vb=R((lne,TR)=>{"use strict";p();var Sn=Si(),EV=$n(),xV=Qi(),gb=ke(),ae=xr(),Us=Kt(),Fs=at(),OR=Wo(),Ot=Oe(),We=Ve(),mb=ti(),AR=Lt(),IV=Gr(),Z=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],l.Buffer.isBuffer(t))return e.fromBuffer(t);if(t instanceof Sn)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(We.isString(t))return e.fromString(t);We.isObject(t)&&We.isArray(t.chunks)&&this.set(t)};Z.prototype.set=function(e){return Ot.checkArgument(We.isObject(e)),Ot.checkArgument(We.isArray(e.chunks)),this.chunks=e.chunks,this};Z.fromBuffer=function(e){var t=new Z;t.chunks=[];for(var r=new EV(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<ae.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===ae.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===ae.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===ae.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(a){throw a instanceof RangeError?new mb.Script.InvalidBuffer(e.toString("hex")):a}return t};Z.prototype.toBuffer=function(){for(var e=new xV,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<ae.OP_PUSHDATA1?e.write(r.buf):i===ae.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===ae.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===ae.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};Z.fromASM=function(e){var t=new Z;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=ae(n),a=o.toNumber();if(n==="0")a=0,t.chunks.push({opcodenum:a}),i=i+1;else if(n==="-1")a=ae.OP_1NEGATE,t.chunks.push({opcodenum:a}),i=i+1;else if(We.isUndefined(a)){var s=l.Buffer.from(r[i],"hex");if(s.toString("hex")!==r[i])throw new Error("invalid hex string in script");var u=s.length;u>=0&&u<ae.OP_PUSHDATA1?a=u:u<Math.pow(2,8)?a=ae.OP_PUSHDATA1:u<Math.pow(2,16)?a=ae.OP_PUSHDATA2:u<Math.pow(2,32)&&(a=ae.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),i=i+1}else t.chunks.push({opcodenum:a}),i=i+1}return t};Z.fromHex=function(e){return new Z(AR.Buffer.from(e,"hex"))};Z.fromString=function(e){if(IV.isHexa(e)||e.length===0)return new Z(AR.Buffer.from(e,"hex"));var t=new Z;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=ae(n),a=o.toNumber();if(We.isUndefined(a))if(a=parseInt(n),a>0&&a<ae.OP_PUSHDATA1)t.chunks.push({buf:l.Buffer.from(r[i+1].slice(2),"hex"),len:a,opcodenum:a}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(a===ae.OP_PUSHDATA1||a===ae.OP_PUSHDATA2||a===ae.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:l.Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:a}),i=i+3}else t.chunks.push({opcodenum:a}),i=i+1}return t};Z.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)!i&&(r===ae.OP_PUSHDATA1||r===ae.OP_PUSHDATA2||r===ae.OP_PUSHDATA4)&&(n=n+" "+ae(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof ae.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+ae(r).toString():n=n+" "+ae(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};Z.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};Z.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};Z.prototype.toHex=function(){return this.toBuffer().toString("hex")};Z.prototype.inspect=function(){return"<Script: "+this.toString()+">"};Z.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===ae.OP_DUP&&this.chunks[1].opcodenum===ae.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===ae.OP_EQUALVERIFY&&this.chunks[4].opcodenum===ae.OP_CHECKSIG)};Z.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===ae.OP_DUP&&this.chunks[1].opcodenum===ae.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===ae.OP_EQUALVERIFY&&this.chunks[4].opcodenum===ae.OP_CHECKSIG)};Z.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};Z.prototype.getPublicKey=function(){return Ot.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};Z.prototype.getPublicKeyHash=function(){return Ot.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf};Z.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===ae.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return Us.isValid(e)}return!1};Z.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};Z.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===ae.OP_HASH160&&e[1]===20&&e[e.length-1]===ae.OP_EQUAL};Z.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=Z.fromBuffer(t)}catch(n){if(n instanceof mb.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==Z.types.UNKNOWN};Z.prototype.isMultisigOut=function(){return this.chunks.length>3&&ae.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&l.Buffer.isBuffer(e.buf)})&&ae.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===ae.OP_CHECKMULTISIG};Z.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&l.Buffer.isBuffer(e.buf)&&Fs.isTxDER(e.buf)})};Z.prototype.isDataOut=function(){var e=this.chunks.length>=1&&this.chunks[0].opcodenum===ae.OP_RETURN;if(!e)return!1;var t=this.chunks.slice(1),r=new Z({chunks:t});return r.isPushOnly()};Z.prototype.isSafeDataOut=function(){if(this.chunks.length<2||this.chunks[0].opcodenum!==ae.OP_FALSE)return!1;var e=this.chunks.slice(1),t=new Z({chunks:e});return t.isDataOut()};Z.prototype.getData=function(){if(this.isSafeDataOut()){var e=this.chunks.slice(2),t=e.map(r=>r.buf);return t}if(this.isDataOut()||this.isScriptHashOut())return We.isUndefined(this.chunks[1])?l.Buffer.alloc(0):l.Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return l.Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};Z.prototype.isPushOnly=function(){return We.every(this.chunks,function(e){return e.opcodenum<=ae.OP_16||e.opcodenum===ae.OP_PUSHDATA1||e.opcodenum===ae.OP_PUSHDATA2||e.opcodenum===ae.OP_PUSHDATA4})};Z.types={};Z.types.UNKNOWN="Unknown";Z.types.PUBKEY_OUT="Pay to public key";Z.types.PUBKEY_IN="Spend from public key";Z.types.PUBKEYHASH_OUT="Pay to public key hash";Z.types.PUBKEYHASH_IN="Spend from public key hash";Z.types.SCRIPTHASH_OUT="Pay to script hash";Z.types.SCRIPTHASH_IN="Spend from script hash";Z.types.MULTISIG_OUT="Pay to multisig";Z.types.MULTISIG_IN="Spend from multisig";Z.types.DATA_OUT="Data push";Z.types.SAFE_DATA_OUT="Safe data push";Z.OP_RETURN_STANDARD_SIZE=220;Z.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==Z.types.UNKNOWN?e:this.classifyInput()};Z.outputIdentifiers={};Z.outputIdentifiers.PUBKEY_OUT=Z.prototype.isPublicKeyOut;Z.outputIdentifiers.PUBKEYHASH_OUT=Z.prototype.isPublicKeyHashOut;Z.outputIdentifiers.MULTISIG_OUT=Z.prototype.isMultisigOut;Z.outputIdentifiers.SCRIPTHASH_OUT=Z.prototype.isScriptHashOut;Z.outputIdentifiers.DATA_OUT=Z.prototype.isDataOut;Z.outputIdentifiers.SAFE_DATA_OUT=Z.prototype.isSafeDataOut;Z.prototype.classifyOutput=function(){for(var e in Z.outputIdentifiers)if(Z.outputIdentifiers[e].bind(this)())return Z.types[e];return Z.types.UNKNOWN};Z.inputIdentifiers={};Z.inputIdentifiers.PUBKEY_IN=Z.prototype.isPublicKeyIn;Z.inputIdentifiers.PUBKEYHASH_IN=Z.prototype.isPublicKeyHashIn;Z.inputIdentifiers.MULTISIG_IN=Z.prototype.isMultisigIn;Z.inputIdentifiers.SCRIPTHASH_IN=Z.prototype.isScriptHashIn;Z.prototype.classifyInput=function(){for(var e in Z.inputIdentifiers)if(Z.inputIdentifiers[e].bind(this)())return Z.types[e];return Z.types.UNKNOWN};Z.prototype.isStandard=function(){return this.classify()!==Z.types.UNKNOWN};Z.prototype.prepend=function(e){return this._addByType(e,!0),this};Z.prototype.equals=function(e){if(Ot.checkState(e instanceof Z,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(l.Buffer.isBuffer(this.chunks[t].buf)&&!l.Buffer.isBuffer(e.chunks[t].buf)||l.Buffer.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};Z.prototype.add=function(e){return this._addByType(e,!1),this};Z.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof ae)this._addOpcode(e,t);else if(l.Buffer.isBuffer(e))this._addBuffer(e,t);else if(e instanceof Z)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};Z.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};Z.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof ae?r=e.toNumber():r=ae(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};Z.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<ae.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=ae.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=ae.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=ae.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};Z.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==ae.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};Z.buildMultisigOut=function(e,t,r){Ot.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new Z;i.add(ae.smallInt(t)),e=We.map(e,Us);var n=e;r.noSorting||(n=e.map(s=>s.toString("hex")).sort().map(s=>new Us(s)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(ae.smallInt(e.length)),i.add(ae.OP_CHECKMULTISIG),i};Z.buildMultisigIn=function(e,t,r,i){Ot.checkArgument(We.isArray(e)),Ot.checkArgument(We.isNumber(t)),Ot.checkArgument(We.isArray(r)),i=i||{};var n=new Z;return n.add(ae.OP_0),We.each(r,function(o){Ot.checkArgument(l.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n};Z.buildP2SHMultisigIn=function(e,t,r,i){Ot.checkArgument(We.isArray(e)),Ot.checkArgument(We.isNumber(t)),Ot.checkArgument(We.isArray(r)),i=i||{};var n=new Z;return n.add(ae.OP_0),We.each(r,function(o){Ot.checkArgument(l.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n.add((i.cachedMultisig||Z.buildMultisigOut(e,t,i)).toBuffer()),n};Z.buildPublicKeyHashOut=function(e){Ot.checkArgument(!We.isUndefined(e)),Ot.checkArgument(e instanceof Us||e instanceof Sn||We.isString(e)),e instanceof Us?e=e.toAddress():We.isString(e)&&(e=new Sn(e));var t=new Z;return t.add(ae.OP_DUP).add(ae.OP_HASH160).add(e.hashBuffer).add(ae.OP_EQUALVERIFY).add(ae.OP_CHECKSIG),t._network=e.network,t};Z.buildPublicKeyOut=function(e){Ot.checkArgument(e instanceof Us);var t=new Z;return t.add(e.toBuffer()).add(ae.OP_CHECKSIG),t};Z.buildDataOut=function(e,t){Ot.checkArgument(We.isUndefined(e)||We.isString(e)||We.isArray(e)||l.Buffer.isBuffer(e));var r=e;We.isArray(r)||(r=[e]);var i=new Z;i.add(ae.OP_RETURN);for(let n of r)Ot.checkArgument(We.isUndefined(n)||We.isString(n)||l.Buffer.isBuffer(n)),We.isString(n)&&(n=l.Buffer.from(n,t)),We.isUndefined(n)||i.add(n);return i};Z.buildSafeDataOut=function(e,t){var r=Z.buildDataOut(e,t),i=new Z;return i.add(ae.OP_FALSE),i.add(r),i};Z.buildScriptHashOut=function(e){Ot.checkArgument(e instanceof Z||e instanceof Sn&&e.isPayToScriptHash());var t=new Z;return t.add(ae.OP_HASH160).add(e instanceof Sn?e.hashBuffer:gb.sha256ripemd160(e.toBuffer())).add(ae.OP_EQUAL),t._network=e._network||e.network,t};Z.buildPublicKeyIn=function(e,t){Ot.checkArgument(e instanceof Fs||l.Buffer.isBuffer(e)),Ot.checkArgument(We.isUndefined(t)||We.isNumber(t)),e instanceof Fs&&(e=e.toBuffer());var r=new Z;return r.add(l.Buffer.concat([e,l.Buffer.from([(t||Fs.SIGHASH_ALL)&255])])),r};Z.buildPublicKeyHashIn=function(e,t,r){Ot.checkArgument(t instanceof Fs||l.Buffer.isBuffer(t)),Ot.checkArgument(We.isUndefined(r)||We.isNumber(r)),t instanceof Fs&&(t=t.toBuffer());var i=new Z().add(l.Buffer.concat([t,l.Buffer.from([(r||Fs.SIGHASH_ALL)&255])])).add(new Us(e).toBuffer());return i};Z.empty=function(){return new Z};Z.prototype.toScriptHashOut=function(){return Z.buildScriptHashOut(this)};Z.fromAddress=function(e){if(e=Sn(e),e.isPayToScriptHash())return Z.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return Z.buildPublicKeyHashOut(e);throw new mb.Script.UnrecognizedAddress(e)};Z.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};Z.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Sn.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Sn.PayToPublicKeyHash;else return!1;return e};Z.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=gb.sha256ripemd160(this.chunks[1].buf),e.type=Sn.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=gb.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Sn.PayToScriptHash;else return!1;return e};Z.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=OR.get(e)||this._network||OR.defaultNetwork,new Sn(t)):!1};Z.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=Z({chunks:[this.chunks[i]]}),o=n.toBuffer(),a=o.toString("hex");r===a&&this.chunks.splice(i,1)}return this};Z.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===ae.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===ae.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===ae.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===ae.OP_PUSHDATA1:r.length<=65535?i===ae.OP_PUSHDATA2:!0:!0};Z.prototype._decodeOP_N=function(e){if(e===ae.OP_0)return 0;if(e>=ae.OP_1&&e<=ae.OP_16)return e-(ae.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))};Z.prototype.getSignatureOperationsCount=function(e){e=We.isUndefined(e)?!0:e;var t=this,r=0,i=ae.OP_INVALIDOPCODE;return We.each(t.chunks,function(o){var a=o.opcodenum;a===ae.OP_CHECKSIG||a===ae.OP_CHECKSIGVERIFY?r++:(a===ae.OP_CHECKMULTISIG||a===ae.OP_CHECKMULTISIGVERIFY)&&(e&&i>=ae.OP_1&&i<=ae.OP_16?r+=t._decodeOP_N(i):r+=20),i=a}),r};TR.exports=Z});var mc=R((dne,kR)=>{"use strict";p();var PR=Qi(),RR=$n(),OV=Ge(),wn=function e(t){if(!(this instanceof e))return new e(t);if(l.Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof OV){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};wn.prototype.set=function(e){return this.buf=e.buf||this.buf,this};wn.prototype.fromString=function(e){return this.set({buf:l.Buffer.from(e,"hex")}),this};wn.prototype.toString=function(){return this.buf.toString("hex")};wn.prototype.fromBuffer=function(e){return this.buf=e,this};wn.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};wn.prototype.fromBN=function(e){return this.buf=PR().writeVarintBN(e).concat(),this};wn.prototype.fromNumber=function(e){return this.buf=PR().writeVarintNum(e).concat(),this};wn.prototype.toBuffer=function(){return this.buf};wn.prototype.toBN=function(){return RR(this.buf).readVarintBN()};wn.prototype.toNumber=function(){return RR(this.buf).readVarintNum()};kR.exports=wn});var oi=R((gne,NR)=>{"use strict";p();var mg=Ve(),yb=Ge(),BR=Lt(),vg=Gr(),AV=Qi(),TV=mc(),bb=Ze(),_b=Oe(),PV=ti(),RV=9007199254740991;function qr(e){if(!(this instanceof qr))return new qr(e);if(mg.isObject(e))if(this.satoshis=e.satoshis,l.Buffer.isBuffer(e.script))this._scriptBuffer=e.script;else{var t;mg.isString(e.script)&&vg.isHexa(e.script)?t=BR.Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(qr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(qr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof yb?(this._satoshisBN=e,this._satoshis=e.toNumber()):mg.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=yb.fromNumber(this._satoshis)):(_b.checkArgument(vg.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=yb.fromNumber(e),this._satoshis=e),_b.checkState(vg.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});qr.prototype.invalidSatoshis=function(){return this._satoshis>RV?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};Object.defineProperty(qr.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),_b.checkState(vg.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});qr.prototype.toObject=qr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};qr.fromObject=function(e){return new qr(e)};qr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=bb.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof PV.Script.InvalidBuffer)this._script=null;else throw t}};qr.prototype.setScript=function(e){if(e instanceof bb)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(mg.isString(e))this._script=bb.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(l.Buffer.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};qr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};qr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=BR.Buffer.from([]),new qr(t)};qr.prototype.toBufferWriter=function(e){e||(e=new AV),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};qr.prototype.getSize=function(){var e=this.script.toBuffer().length,t=TV(e).toBuffer().length;return 8+t+e};NR.exports=qr});var vc=R((vne,DR)=>{"use strict";p();var ka=Ve(),kV=Oe(),Tl=ti(),BV=Qi(),Sb=Lt(),LR=Gr(),yg=Ze(),NV=ai(),CR=oi(),bg=4294967295,CV=bg-2,MR=bg,LV=bg-1;function mt(e){if(!(this instanceof mt))return new mt(e);if(e)return this._fromObject(e)}mt.MAXINT=bg;mt.DEFAULT_SEQNUMBER=MR;mt.DEFAULT_LOCKTIME_SEQNUMBER=LV;mt.DEFAULT_RBF_SEQNUMBER=CV;mt.BASE_SIZE=40;Object.defineProperty(mt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new yg(this._scriptBuffer),this._script._isInput=!0),this._script)}});mt.fromObject=function(e){kV.checkArgument(ka.isObject(e));var t=new mt;return t._fromObject(e)};mt.prototype._fromObject=function(e){var t;if(ka.isString(e.prevTxId)&&LR.isHexa(e.prevTxId)?t=Sb.Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.output=e.output?e.output instanceof CR?e.output:new CR(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=ka.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=ka.isUndefined(e.sequenceNumber)?ka.isUndefined(e.seqnum)?MR:e.seqnum:e.sequenceNumber,ka.isUndefined(e.script)&&ka.isUndefined(e.scriptBuffer))throw new Tl.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};mt.prototype.toObject=mt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};mt.fromBufferReader=function(e){var t=new mt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};mt.prototype.toBufferWriter=function(e){e||(e=new BV),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};mt.prototype.setScript=function(e){if(this._script=null,e instanceof yg)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(e===null)this._script=yg.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(LR.isHexa(e))this._scriptBuffer=Sb.Buffer.from(e,"hex");else if(ka.isString(e))this._script=new yg(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(l.Buffer.isBuffer(e))this._scriptBuffer=Sb.Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};mt.prototype.getSignatures=function(){throw new Tl.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};mt.prototype.isFullySigned=function(){throw new Tl.AbstractMethodInvoked("Input#isFullySigned")};mt.prototype.isFinal=function(){return this.sequenceNumber===mt.MAXINT};mt.prototype.addSignature=function(){throw new Tl.AbstractMethodInvoked("Input#addSignature")};mt.prototype.clearSignatures=function(){throw new Tl.AbstractMethodInvoked("Input#clearSignatures")};mt.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,NV.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};mt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};mt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};DR.exports=mt});var yc=R((bne,qR)=>{"use strict";p();qR.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}});var _c=R((Sne,HR)=>{"use strict";p();var bc=Ve(),en=Oe(),MV=yc(),FR=Gr(),UR=Kt(),DV=ti(),Pl=at();function En(e){if(!(this instanceof En))return new En(e);if(e instanceof En)return e;if(bc.isObject(e))return this._fromObject(e);throw new DV.InvalidArgument("TransactionSignatures must be instantiated from an object")}MV(En,Pl);En.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new UR(e.publicKey),this.prevTxId=l.Buffer.isBuffer(e.prevTxId)?e.prevTxId:l.Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof Pl?e.signature:l.Buffer.isBuffer(e.signature)?Pl.fromBuffer(e.signature):Pl.fromString(e.signature),this.sigtype=e.sigtype,this};En.prototype._checkObjectArgs=function(e){en.checkArgument(UR(e.publicKey),"publicKey"),en.checkArgument(!bc.isUndefined(e.inputIndex),"inputIndex"),en.checkArgument(!bc.isUndefined(e.outputIndex),"outputIndex"),en.checkState(bc.isNumber(e.inputIndex),"inputIndex must be a number"),en.checkState(bc.isNumber(e.outputIndex),"outputIndex must be a number"),en.checkArgument(e.signature,"signature"),en.checkArgument(e.prevTxId,"prevTxId"),en.checkState(e.signature instanceof Pl||l.Buffer.isBuffer(e.signature)||FR.isHexa(e.signature),"signature must be a buffer or hexa value"),en.checkState(l.Buffer.isBuffer(e.prevTxId)||FR.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),en.checkArgument(e.sigtype,"sigtype"),en.checkState(bc.isNumber(e.sigtype),"sigtype must be a number")};En.prototype.toObject=En.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};En.fromObject=function(e){return en.checkArgument(e),new En(e)};HR.exports=En});var GR=R((Ene,VR)=>{"use strict";p();var qV=yc(),zR=Oe(),wb=vc(),FV=oi(),UV=ai(),KR=Ze(),jR=at(),HV=_c();function Zo(){wb.apply(this,arguments)}qV(Zo,wb);Zo.prototype.getSignatures=function(e,t,r,i){zR.checkState(this.output instanceof FV),i=i||jR.SIGHASH_ALL|jR.SIGHASH_FORKID;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new HV({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:UV.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Zo.prototype.addSignature=function(e,t){return zR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(KR.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};Zo.prototype.clearSignatures=function(){return this.setScript(KR.empty()),this};Zo.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};Zo.SCRIPT_MAX_SIZE=74;Zo.prototype._estimateSize=function(){return wb.BASE_SIZE+Zo.SCRIPT_MAX_SIZE};VR.exports=Zo});var XR=R((Ine,$R)=>{"use strict";p();var jV=yc(),ZR=Oe(),zV=ke(),Eb=vc(),KV=oi(),VV=ai(),YR=Ze(),WR=at(),GV=_c();function Yo(){Eb.apply(this,arguments)}jV(Yo,Eb);Yo.prototype.getSignatures=function(e,t,r,i,n){ZR.checkState(this.output instanceof KV),n=n||zV.sha256ripemd160(t.publicKey.toBuffer()),i=i||WR.SIGHASH_ALL|WR.SIGHASH_FORKID;var o=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return o&&n.equals(o)?[new GV({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:VV.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Yo.prototype.addSignature=function(e,t){return ZR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(YR.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};Yo.prototype.clearSignatures=function(){return this.setScript(YR.empty()),this};Yo.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()};Yo.SCRIPT_MAX_SIZE=108;Yo.prototype._estimateSize=function(){return Eb.BASE_SIZE+Yo.SCRIPT_MAX_SIZE};$R.exports=Yo});var ek=R((Ane,QR)=>{"use strict";p();var xn=Ve(),WV=yc(),Sg=vc(),ZV=oi(),Rl=Oe(),JR=Ze(),_g=at(),xb=ai(),Ib=_c(),YV=Kt(),$V=mc();function Ir(e,t,r,i){Sg.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new YV(o)),Rl.checkState(JR.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},xn.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}WV(Ir,Sg);Ir.prototype.toObject=function(){var e=Sg.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=xn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Ir.prototype._deserializeSignatures=function(e){return xn.map(e,function(t){if(t)return new Ib(t)})};Ir.prototype._serializeSignatures=function(){return xn.map(this.signatures,function(e){if(e)return e.toObject()})};Ir.prototype.getSignatures=function(e,t,r,i){Rl.checkState(this.output instanceof ZV),i=i||_g.SIGHASH_ALL|_g.SIGHASH_FORKID;var n=this,o=[];return xn.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new Ib({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:xb.sign(e,t,i,r,n.output.script,n.output.satoshisBN),sigtype:i}))}),o};Ir.prototype.addSignature=function(e,t){return Rl.checkState(!this.isFullySigned(),"All needed signatures have already been added"),Rl.checkArgument(!xn.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),Rl.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Ir.prototype._updateScript=function(){return this.setScript(JR.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Ir.prototype._createSignatures=function(){return xn.map(xn.filter(this.signatures,function(e){return!xn.isUndefined(e)}),function(e){return l.Buffer.concat([e.signature.toDER(),l.Buffer.from([e.sigtype&255])])})};Ir.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Ir.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Ir.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Ir.prototype.countSignatures=function(){return xn.reduce(this.signatures,function(e,t){return e+!!t},0)};Ir.prototype.publicKeysWithoutSignature=function(){var e=this;return xn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Ir.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,xb.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};Ir.normalizeSignatures=function(e,t,r,i,n){return n.map(function(o){var a=null;return i=i.filter(function(s){if(a)return!0;var u=new Ib({signature:_g.fromTxFormat(s),publicKey:o,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:_g.SIGHASH_ALL});u.signature.nhashtype=u.sigtype;var c=xb.verify(e,u.signature,u.publicKey,u.inputIndex,t.output.script);return c?(a=u,!1):!0}),a||null})};Ir.SIGNATURE_SIZE=73;Ir.prototype._estimateSize=function(){var e=1+this.threshold*Ir.SIGNATURE_SIZE;return Sg.BASE_SIZE+$V(e).toBuffer().length+e};QR.exports=Ir});var ok=R((Pne,nk)=>{"use strict";p();var In=Ve(),XV=yc(),wg=vc(),JV=oi(),kl=Oe(),Ob=Ze(),tk=at(),rk=ai(),ik=_c(),QV=Kt(),e7=mc();function vr(e,t,r,i){wg.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new QV(o)),this.redeemScript=Ob.buildMultisigOut(this.publicKeys,r),kl.checkState(Ob.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},In.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}XV(vr,wg);vr.prototype.toObject=function(){var e=wg.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=In.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};vr.prototype._deserializeSignatures=function(e){return In.map(e,function(t){if(t)return new ik(t)})};vr.prototype._serializeSignatures=function(){return In.map(this.signatures,function(e){if(e)return e.toObject()})};vr.prototype.getSignatures=function(e,t,r,i){kl.checkState(this.output instanceof JV),i=i||tk.SIGHASH_ALL|tk.SIGHASH_FORKID;var n=this,o=[];return In.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new ik({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:rk.sign(e,t,i,r,n.redeemScript,n.output.satoshisBN),sigtype:i}))}),o};vr.prototype.addSignature=function(e,t){return kl.checkState(!this.isFullySigned(),"All needed signatures have already been added"),kl.checkArgument(!In.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),kl.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};vr.prototype._updateScript=function(){return this.setScript(Ob.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this};vr.prototype._createSignatures=function(){return In.map(In.filter(this.signatures,function(e){return!In.isUndefined(e)}),function(e){return l.Buffer.concat([e.signature.toDER(),l.Buffer.from([e.sigtype&255])])})};vr.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};vr.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};vr.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};vr.prototype.countSignatures=function(){return In.reduce(this.signatures,function(e,t){return e+!!t},0)};vr.prototype.publicKeysWithoutSignature=function(){var e=this;return In.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};vr.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,rk.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)};vr.SIGNATURE_SIZE=73;vr.PUBKEY_SIZE=34;vr.prototype._estimateSize=function(){var e=this.publicKeys.length*vr.PUBKEY_SIZE,t=this.threshold*vr.SIGNATURE_SIZE,r=3+e,i=r<=75?1:r<=255?2:3,n=t+1+i+r;return wg.BASE_SIZE+e7(n).toBuffer().length+n};nk.exports=vr});var Xn=R((kne,Sc)=>{p();Sc.exports=vc();Sc.exports.PublicKey=GR();Sc.exports.PublicKeyHash=XR();Sc.exports.MultiSig=ek();Sc.exports.MultiSigScriptHash=ok()});var ai=R((Nne,fk)=>{"use strict";p();var t7=Lt(),wi=at(),Ab=Ze(),r7=oi(),i7=$n(),Bl=Qi(),ak=Ge(),Eg=ke(),sk=On(),Tb=Oe(),Pb=tn(),Ba=Ve(),uk=l.Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),n7="ffffffffffffffff",o7=Pb.SCRIPT_ENABLE_SIGHASH_FORKID,a7=function(e,t,r,i,n){var o=e.inputs[r];Tb.checkArgument(n instanceof ak,"For ForkId=0 signatures, satoshis or complete input must be provided");function a(T){var B=new Bl;Ba.each(T.inputs,function(F){B.writeReverse(F.prevTxId),B.writeUInt32LE(F.outputIndex)});var C=B.toBuffer(),q=Eg.sha256sha256(C);return q}function s(T){var B=new Bl;Ba.each(T.inputs,function(F){B.writeUInt32LE(F.sequenceNumber)});var C=B.toBuffer(),q=Eg.sha256sha256(C);return q}function u(T,B){var C=new Bl;Ba.isUndefined(B)?Ba.each(T.outputs,function(P){P.toBufferWriter(C)}):T.outputs[B].toBufferWriter(C);var q=C.toBuffer(),F=Eg.sha256sha256(q);return F}var c=l.Buffer.alloc(32),f=l.Buffer.alloc(32),d=l.Buffer.alloc(32);t&wi.SIGHASH_ANYONECANPAY||(c=a(e)),!(t&wi.SIGHASH_ANYONECANPAY)&&(t&31)!==wi.SIGHASH_SINGLE&&(t&31)!==wi.SIGHASH_NONE&&(f=s(e)),(t&31)!==wi.SIGHASH_SINGLE&&(t&31)!==wi.SIGHASH_NONE?d=u(e):(t&31)===wi.SIGHASH_SINGLE&&r<e.outputs.length&&(d=u(e,r));var m=new Bl;m.writeInt32LE(e.version),m.write(c),m.write(f),m.writeReverse(o.prevTxId),m.writeUInt32LE(o.outputIndex),m.writeVarintNum(i.toBuffer().length),m.write(i.toBuffer()),m.writeUInt64LEBN(n);var y=o.sequenceNumber;m.writeUInt32LE(y),m.write(d),m.writeUInt32LE(e.nLockTime),m.writeUInt32LE(t>>>0);var w=m.toBuffer();return w},ck=function(t,r,i,n,o,a){var s=kb(),u=Xn();Ba.isUndefined(a)&&(a=o7);var c=s.shallowCopy(t);if(n=new Ab(n),a&Pb.SCRIPT_ENABLE_REPLAY_PROTECTION){var f=r>>8,d=16711680|f^57005;r=d<<8|r&255}if(r&wi.SIGHASH_FORKID&&!(r&wi.SIGHASH_CHRONICLE)&&a&Pb.SCRIPT_ENABLE_SIGHASH_FORKID)return a7(c,r,i,n,o);n.removeCodeseparators();var m;for(m=0;m<c.inputs.length;m++)c.inputs[m]=new u(c.inputs[m]).setScript(Ab.empty());if(c.inputs[i]=new u(c.inputs[i]).setScript(n),(r&31)===wi.SIGHASH_NONE||(r&31)===wi.SIGHASH_SINGLE)for(m=0;m<c.inputs.length;m++)m!==i&&(c.inputs[m].sequenceNumber=0);if((r&31)===wi.SIGHASH_NONE)c.outputs=[];else if((r&31)===wi.SIGHASH_SINGLE){if(i>=c.outputs.length)return uk;for(c.outputs.length=i+1,m=0;m<i;m++)c.outputs[m]=new r7({satoshis:ak.fromBuffer(t7.Buffer.from(n7,"hex")),script:Ab.empty()})}r&wi.SIGHASH_ANYONECANPAY&&(c.inputs=[c.inputs[i]]);var y=new Bl().write(c.toBuffer()).writeInt32LE(r).toBuffer();return y},Rb=function(t,r,i,n,o,a){var s=ck(t,r,i,n,o,a);if(s.compare(uk)===0)return s;var u=Eg.sha256sha256(s);return u=new i7(u).readReverse(),u};function s7(e,t,r,i,n,o,a){var s=Rb(e,r,i,n,o,a),u=sk.sign(s,t,"little").set({nhashtype:r});return u}function u7(e,t,r,i,n,o,a){Tb.checkArgument(!Ba.isUndefined(e)),Tb.checkArgument(!Ba.isUndefined(t)&&!Ba.isUndefined(t.nhashtype));var s=Rb(e,t.nhashtype,i,n,o,a);return sk.verify(s,t,r,"little")}fk.exports={sighashPreimage:ck,sighash:Rb,sign:s7,verify:u7}});var Bb=R((Lne,hk)=>{"use strict";p();var $o=Ve(),xg=Oe(),lk=Gr(),c7=Ze(),f7=Si();function Xo(e){if(!(this instanceof Xo))return new Xo(e);xg.checkArgument($o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f7(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!lk.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=$o.isUndefined(e.vout)?e.outputIndex:e.vout;if(!$o.isNumber(i))throw new Error("Invalid outputIndex, received "+i);xg.checkArgument(!$o.isUndefined(e.scriptPubKey)||!$o.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new c7(e.scriptPubKey||e.script);xg.checkArgument(!$o.isUndefined(e.amount)||!$o.isUndefined(e.satoshis),"Must provide an amount for the output");var o=$o.isUndefined(e.amount)?e.satoshis:Math.round(e.amount*1e8);xg.checkArgument($o.isNumber(o),"Amount must be a number"),lk.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}Xo.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};Xo.prototype.toString=function(){return this.txId+":"+this.outputIndex};Xo.fromObject=function(e){return new Xo(e)};Xo.prototype.toObject=Xo.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}};hk.exports=Xo});var kb=R((Dne,_k)=>{"use strict";p();var we=Ve(),Fr=Oe(),l7=Lt(),Ar=ti(),pk=Gr(),gk=$n(),h7=Qi(),dk=mc(),mk=ke(),Og=at(),vk=ai(),d7=Si(),yk=Bb(),Or=Xn(),p7=Or.PublicKeyHash,g7=Or.PublicKey,m7=Or.MultiSigScriptHash,v7=Or.MultiSig,An=oi(),Jn=Ze(),y7=Ur(),Ig=Ge(),b7=tn(),_7=b7.SCRIPT_ENABLE_SIGHASH_FORKID;function ie(e){if(!(this instanceof ie))return new ie(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof ie)return ie.shallowCopy(e);if(pk.isHexa(e))this.fromString(e);else if(l.Buffer.isBuffer(e))this.fromBuffer(e);else if(we.isObject(e))this.fromObject(e);else throw new Ar.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var S7=1,w7=0,E7=1e6;ie.DUST_AMOUNT=546;ie.FEE_SECURITY_MARGIN=150;ie.MAX_MONEY=21e6*1e8;ie.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;ie.NLOCKTIME_MAX_VALUE=4294967295;ie.FEE_PER_KB=500;ie.CHANGE_OUTPUT_MAX_SIZE=62;ie.shallowCopy=function(e){var t=new ie(e.toBuffer());return t};var bk={configurable:!1,enumerable:!0,get:function(){return this._hash=new gk(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(ie.prototype,"hash",bk);Object.defineProperty(ie.prototype,"id",bk);var Nb={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(ie.prototype,"inputAmount",Nb);Nb.get=function(){return this._getOutputAmount()};Object.defineProperty(ie.prototype,"outputAmount",Nb);ie.prototype._getHash=function(){return mk.sha256sha256(this.toBuffer())};ie.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};ie.prototype.uncheckedSerialize=ie.prototype.toString=function(){return this.toBuffer().toString("hex")};ie.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()};ie.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};ie.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Ar.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Ar.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};ie.prototype._hasFeeError=function(e,t){if(!we.isUndefined(this._fee)&&this._fee!==t)return new Ar.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(ie.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Ar.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Ar.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}};ie.prototype._missingChange=function(){return!this._changeScript};ie.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<ie.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new Ar.Transaction.DustOutputs}};ie.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Ar.Transaction.MissingSignatures};ie.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};ie.prototype.toBuffer=function(){var e=new h7;return this.toBufferWriter(e).toBuffer()};ie.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),we.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),we.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e};ie.prototype.fromBuffer=function(e){var t=new gk(e);return this.fromBufferReader(t)};ie.prototype.fromBufferReader=function(e){Fr.checkArgument(!e.finished(),"No transaction data received");var t,r,i;for(this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=Or.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(An.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this};ie.prototype.toObject=ie.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),we.isUndefined(this._changeIndex)||(i.changeIndex=this._changeIndex),we.isUndefined(this._fee)||(i.fee=this._fee),i};ie.prototype.fromObject=function(t){Fr.checkArgument(we.isObject(t)||t instanceof ie);var r=this,i;return t instanceof ie?i=t.toObject():i=t,we.each(i.inputs,function(n){if(!n.output||!n.output.script){r.uncheckedAddInput(new Or(n));return}var o=new Jn(n.output.script),a;if(o.isPublicKeyHashOut())a=new Or.PublicKeyHash(n);else if(o.isScriptHashOut()&&n.publicKeys&&n.threshold)a=new Or.MultiSigScriptHash(n,n.publicKeys,n.threshold,n.signatures);else if(o.isPublicKeyOut())a=new Or.PublicKey(n);else throw new Ar.Transaction.Input.UnsupportedScript(n.output.script);r.addInput(a)}),we.each(i.outputs,function(n){r.addOutput(new An(n))}),i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new Jn(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};ie.prototype._checkConsistency=function(e){we.isUndefined(this._changeIndex)||(Fr.checkState(this._changeScript,"Change script is expected."),Fr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),Fr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&Fr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};ie.prototype.lockUntilDate=function(e){if(Fr.checkArgument(e),we.isNumber(e)&&e<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Ar.Transaction.LockTimeTooEarly;we.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Or.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Or.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.lockUntilBlockHeight=function(e){if(Fr.checkArgument(we.isNumber(e)),e>=ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Ar.Transaction.BlockHeightTooHigh;if(e<0)throw new Ar.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Or.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Or.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};ie.prototype.fromString=function(e){this.fromBuffer(l7.Buffer.from(e,"hex"))};ie.prototype._newTransaction=function(){this.version=S7,this.nLockTime=w7};ie.prototype.from=function(e,t,r){if(we.isArray(e)){var i=this;return we.each(e,function(o){i.from(o,t,r)}),this}var n=we.some(this.inputs,function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex});return n?this:(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e),this)};ie.prototype._fromNonP2SH=function(e){var t;e=new yk(e),e.script.isPublicKeyHashOutPrefix()?t=p7:e.script.isPublicKeyOut()?t=g7:t=Or,this.addInput(new t({output:new An({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Jn.empty()}))};ie.prototype._fromMultisigUtxo=function(e,t,r){Fr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");var i;if(e=new yk(e),e.script.isMultisigOut())i=v7;else if(e.script.isScriptHashOut())i=m7;else throw new Ar.Transaction.Input.UnsupportedScript(e.script.toString());this.addInput(new i({output:new An({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Jn.empty()},t,r))};ie.prototype.addInput=function(e,t,r){if(Fr.checkArgumentType(e,Or,"input"),!e.output&&(we.isUndefined(t)||we.isUndefined(r)))throw new Ar.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&!we.isUndefined(r)&&(t=t instanceof Jn?t:new Jn(t),Fr.checkArgumentType(r,"number","satoshis"),e.output=new An({script:t,satoshis:r})),this.uncheckedAddInput(e)};ie.prototype.uncheckedAddInput=function(e){return Fr.checkArgumentType(e,Or,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};ie.prototype.hasAllUtxoInfo=function(){return we.every(this.inputs.map(function(e){return!!e.output}))};ie.prototype.fee=function(e){return Fr.checkArgument(we.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};ie.prototype.feePerKb=function(e){return Fr.checkArgument(we.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};ie.prototype.change=function(e){return Fr.checkArgument(e,"address is required"),this._changeScript=Jn.fromAddress(e),this._updateChangeOutput(),this};ie.prototype.getChangeOutput=function(){return we.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]};ie.prototype.to=function(e,t){if(we.isArray(e)){var r=this;return we.each(e,function(i){r.to(i.address,i.satoshis)}),this}return Fr.checkArgument(pk.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new An({script:Jn(new d7(e)),satoshis:t})),this};ie.prototype.addData=function(e){return this.addOutput(new An({script:Jn.buildDataOut(e),satoshis:0})),this};ie.prototype.addSafeData=function(e){return this.addOutput(new An({script:Jn.buildSafeDataOut(e),satoshis:0})),this};ie.prototype.addOutput=function(e){return Fr.checkArgumentType(e,An,"output"),this._addOutput(e),this._updateChangeOutput(),this};ie.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};ie.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};ie.prototype._getOutputAmount=function(){if(we.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,we.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount};ie.prototype._getInputAmount=function(){if(we.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,we.each(this.inputs,function(t){if(we.isUndefined(t.output))throw new Ar.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount};ie.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),we.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new An({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue(),t=this.getFee(),r=e-t;this._removeOutput(this._changeIndex),this._changeIndex=void 0,r>=ie.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new An({script:this._changeScript,satoshis:r})))}};ie.prototype.getFee=function(){return this.isCoinbase()?0:we.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee};ie.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||ie.FEE_PER_KB))};ie.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};ie.prototype._clearSignatures=function(){we.each(this.inputs,function(e){e.clearSignatures!==Or.prototype.clearSignatures&&e.clearSignatures()})};ie.prototype._estimateSize=function(){var e=8;return e+=dk(this.inputs.length).toBuffer().length,e+=dk(this.outputs.length).toBuffer().length,we.each(this.inputs,function(t){e+=t._estimateSize()}),we.each(this.outputs,function(t){e+=t.getSize()}),e};ie.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=we.without(this.outputs,t),this._outputAmount=void 0};ie.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};ie.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.prevTxId.compare(i.prevTxId)||r.outputIndex-i.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.satoshis-i.satoshis||r.script.toBuffer().compare(i.script.toBuffer())}),t}),this};ie.prototype.shuffleOutputs=function(){return this.sortOutputs(we.shuffle)};ie.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};ie.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};ie.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||we.difference(this.outputs,e).length!==0;if(t)throw new Ar.Transaction.InvalidSorting;if(!we.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};ie.prototype.removeInput=function(e,t){var r;if(!t&&we.isNumber(e)?r=e:r=we.findIndex(this.inputs,function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Ar.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=we.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};ie.prototype.sign=function(e,t){Fr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return we.isArray(e)?(we.each(e,function(i){r.sign(i,t)}),this):(we.each(this.getSignatures(e,t),function(i){r.applySignature(i)}),this)};ie.prototype.getSignatures=function(e,t){e=new y7(e),t=t||Og.SIGHASH_ALL|Og.SIGHASH_FORKID;var r=this,i=[],n=mk.sha256ripemd160(e.publicKey.toBuffer());return we.each(this.inputs,function(a,s){we.each(a.getSignatures(r,e,s,t,n),function(u){i.push(u)})}),i};ie.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this};ie.prototype.isFullySigned=function(){return we.each(this.inputs,function(e){if(e.isFullySigned===Or.prototype.isFullySigned)throw new Ar.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),we.every(we.map(this.inputs,function(e){return e.isFullySigned()}))};ie.prototype.isValidSignature=function(e){var t=this;if(this.inputs[e.inputIndex].isValidSignature===Or.prototype.isValidSignature)throw new Ar.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(t,e)};ie.prototype.verifySignature=function(e,t,r,i,n,o){return vk.verify(this,e,t,r,i,n,o)};ie.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new Ig(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new Ig(ie.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new Ig(ie.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>E7)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(!we.isUndefined(i[o]))return"transaction input "+t+" duplicate input";i[o]=!0}var a=this.isCoinbase();if(a){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};ie.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};ie.prototype.sighash=function(e,t,r,i,n){t=t||Og.SIGHASH_ALL|Og.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new Ig(o.output.satoshis)),n=n||_7,vk.sighash(this,t,e,r,i,n)};_k.exports=ie});var At=R((Fne,Hs)=>{p();Hs.exports=kb();Hs.exports.Input=Xn();Hs.exports.Output=oi();Hs.exports.UnspentOutput=Bb();Hs.exports.Signature=_c();Hs.exports.Sighash=ai()});var tn=R((Hne,Ek)=>{"use strict";p();var Ag=Ve(),Cl=vb(),j=xr(),ye=Ge(),Nl=ke(),Na=at(),Cb=Kt();function Sk(e){return e.map(function(t){return l.Buffer.isBuffer(t)?l.Buffer.from(t):t})}var U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n,o){var a=At();if(Ag.isUndefined(r)&&(r=new a),Ag.isUndefined(i)&&(i=0),Ag.isUndefined(n)&&(n=U.currentConsensusFlags(),o||(n&=~U.SCRIPT_ENABLE_SIGHASH_FORKID)),n&U.SCRIPT_ENABLE_SIGHASH_FORKID&&(n|=U.SCRIPT_VERIFY_STRICTENC,!o))throw new Error("internal error - need satoshisBN to verify FORKID transactions");this.set({script:e,tx:r,nin:i,flags:n,satoshisBN:o});var s;if((n&U.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;var u=(n&U.SCRIPT_VERIFY_P2SH)!==0&&(n&U.SCRIPT_UTXO_AFTER_GENESIS)===0;u&&(s=this.stack.slice());var c=this.stack;if(this.initialize(),this.set({script:t,stack:c,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var f=this.stack[this.stack.length-1];if(!U.castToBool(f))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(u&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(s.length===0)throw new Error("internal error - stack copy empty");var d=s[s.length-1],m=Cl.fromBuffer(d);if(s.pop(),this.initialize(),this.set({script:m,stack:s,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(s.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!U.castToBool(s[s.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if((n&U.SCRIPT_VERIFY_CLEANSTACK)!==0){if((n&U.SCRIPT_VERIFY_P2SH)===0&&(n&U.SCRIPT_UTXO_AFTER_GENESIS)===0)throw new Error("internal error - CLEANSTACK without P2SH");if(this.stack.length!==1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0};Ek.exports=U;U.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.returned=!1,this.nonTopLevelReturnAfterGenesis=!1,this.vfExec=[],this.vfElse=[],this.errstr="",this.flags=0};U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin<"u"?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc<"u"?e.pc:this.pc,this.pbegincodehash=typeof e.pbegincodehash<"u"?e.pbegincodehash:this.pbegincodehash,this.nOpCount=typeof e.nOpCount<"u"?e.nOpCount:this.nOpCount,this.returned=typeof e.returned<"u"?e.returned:this.returned,this.nonTopLevelReturnAfterGenesis=typeof e.nonTopLevelReturnAfterGenesis<"u"?e.nonTopLevelReturnAfterGenesis:this.nonTopLevelReturnAfterGenesis,this.vfExec=e.vfExec||this.vfExec,this.vfElse=e.vfElse||this.vfElse,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags<"u"?e.flags:this.flags};U.true=l.Buffer.from([1]);U.false=l.Buffer.from([]);U.MAX_SCRIPT_ELEMENT_SIZE=520;U.MAXIMUM_ELEMENT_SIZE=4;U.MAX_OPS_PER_SCRIPT=500;U.MAX_SCRIPT_SIZE=1e4;U.UNLIMITED=Number.MAX_SAFE_INTEGER;U.MAX_SCRIPT_NUM_LENGTH_AFTER_GENESIS=75e4;U.MAX_SCRIPT_NUM_LENGTH_AFTER_CHRONICLE=32e6;U.MAX_PUBKEYS_PER_MULTISIG_AFTER_GENESIS=4294967295;U.LOCKTIME_THRESHOLD=5e8;U.LOCKTIME_THRESHOLD_BN=new ye(U.LOCKTIME_THRESHOLD);U.useGenesisLimits=function(e){return e=e||2147483647,U.MAX_SCRIPT_ELEMENT_SIZE=e,U.MAXIMUM_ELEMENT_SIZE=e,U.MAX_OPS_PER_SCRIPT=e,U.MAX_SCRIPT_SIZE=e,U};U.getLimits=function(){return{maxScriptElementSize:U.MAX_SCRIPT_ELEMENT_SIZE,maximumElementSize:U.MAXIMUM_ELEMENT_SIZE,maxOpsPerScript:U.MAX_OPS_PER_SCRIPT,maxScriptSize:U.MAX_SCRIPT_SIZE}};U.setLimits=function(e){return e=e||{},e.maxScriptElementSize!=null&&(U.MAX_SCRIPT_ELEMENT_SIZE=e.maxScriptElementSize),e.maximumElementSize!=null&&(U.MAXIMUM_ELEMENT_SIZE=e.maximumElementSize),e.maxOpsPerScript!=null&&(U.MAX_OPS_PER_SCRIPT=e.maxOpsPerScript),e.maxScriptSize!=null&&(U.MAX_SCRIPT_SIZE=e.maxScriptSize),U};U.SCRIPT_VERIFY_NONE=0;U.SCRIPT_VERIFY_P2SH=1;U.SCRIPT_VERIFY_STRICTENC=2;U.SCRIPT_VERIFY_DERSIG=4;U.SCRIPT_VERIFY_LOW_S=8;U.SCRIPT_VERIFY_NULLDUMMY=16;U.SCRIPT_VERIFY_SIGPUSHONLY=32;U.SCRIPT_VERIFY_MINIMALDATA=64;U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;U.SCRIPT_VERIFY_CLEANSTACK=256;U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;U.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;U.SCRIPT_VERIFY_MINIMALIF=8192;U.SCRIPT_VERIFY_NULLFAIL=16384;U.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768;U.SCRIPT_ENABLE_SIGHASH_FORKID=65536;U.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;U.SCRIPT_ENABLE_MONOLITH_OPCODES=2048;U.SCRIPT_ENABLE_MAGNETIC_OPCODES=4096;U.SCRIPT_GENESIS=1<<18;U.SCRIPT_UTXO_AFTER_GENESIS=1<<19;U.SCRIPT_ENABLE_CHRONICLE=1<<20;U.SCRIPT_CHRONICLE=U.SCRIPT_ENABLE_CHRONICLE;U.SCRIPT_UTXO_AFTER_CHRONICLE=1<<21;U.CHRONICLE_ACTIVATION_HEIGHT=943816;U.mainnetFlags=function(e){e=e||{};var t=U.SCRIPT_VERIFY_P2SH|U.SCRIPT_VERIFY_STRICTENC|U.SCRIPT_VERIFY_DERSIG|U.SCRIPT_VERIFY_LOW_S|U.SCRIPT_VERIFY_NULLFAIL|U.SCRIPT_VERIFY_MINIMALDATA|U.SCRIPT_ENABLE_SIGHASH_FORKID|U.SCRIPT_ENABLE_MAGNETIC_OPCODES|U.SCRIPT_ENABLE_MONOLITH_OPCODES|U.SCRIPT_GENESIS|U.SCRIPT_UTXO_AFTER_GENESIS;return e.afterChronicle!==!1&&(t|=U.SCRIPT_ENABLE_CHRONICLE|U.SCRIPT_UTXO_AFTER_CHRONICLE),t};U.currentConsensusFlags=function(){return U.SCRIPT_ENABLE_MONOLITH_OPCODES|U.SCRIPT_ENABLE_MAGNETIC_OPCODES|U.SCRIPT_GENESIS|U.SCRIPT_UTXO_AFTER_GENESIS|U.SCRIPT_ENABLE_CHRONICLE|U.SCRIPT_UTXO_AFTER_CHRONICLE|U.SCRIPT_ENABLE_SIGHASH_FORKID};U.useMainnetConsensus=function(e){return e=e||{},U.useGenesisLimits(e.max),U.mainnetFlags(e)};U.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;U.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;U.SEQUENCE_LOCKTIME_MASK=65535;U.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};U.prototype.checkSignatureEncoding=function(e){var t;if(e.length===0)return!0;if((this.flags&(U.SCRIPT_VERIFY_DERSIG|U.SCRIPT_VERIFY_LOW_S|U.SCRIPT_VERIFY_STRICTENC))!==0&&!Na.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if((this.flags&U.SCRIPT_VERIFY_LOW_S)!==0){if(t=Na.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if((this.flags&U.SCRIPT_VERIFY_STRICTENC)!==0){if(t=Na.fromTxFormat(e),!t.hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&U.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&Na.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(!(this.flags&U.SCRIPT_CHRONICLE)&&t.nhashtype&Na.SIGHASH_CHRONICLE)return this.errstr="SCRIPT_ERR_ILLEGAL_CHRONICLE",!1;if(this.flags&U.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&Na.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0};U.prototype.checkPubkeyEncoding=function(e){return(this.flags&U.SCRIPT_VERIFY_STRICTENC)!==0&&!Cb.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):!0};U.prototype.isAfterGenesis=function(){return(this.flags&U.SCRIPT_UTXO_AFTER_GENESIS)!==0};U.prototype.isAfterChronicle=function(){return(this.flags&(U.SCRIPT_UTXO_AFTER_CHRONICLE|U.SCRIPT_ENABLE_CHRONICLE))!==0};U.prototype.maxScriptElementSize=function(){return this.isAfterGenesis()?U.UNLIMITED:U.MAX_SCRIPT_ELEMENT_SIZE};U.prototype.maxScriptSize=function(){return this.isAfterGenesis()?U.UNLIMITED:U.MAX_SCRIPT_SIZE};U.prototype.maxOpsPerScript=function(){return this.isAfterGenesis()?U.UNLIMITED:U.MAX_OPS_PER_SCRIPT};U.prototype.maxScriptNumLength=function(){return this.isAfterChronicle()?U.MAX_SCRIPT_NUM_LENGTH_AFTER_CHRONICLE:this.isAfterGenesis()?U.MAX_SCRIPT_NUM_LENGTH_AFTER_GENESIS:U.MAXIMUM_ELEMENT_SIZE};U.prototype.maxPubKeysPerMultisig=function(){return this.isAfterGenesis()?U.MAX_PUBKEYS_PER_MULTISIG_AFTER_GENESIS:20};U._isMinimallyEncoded=function(e,t){return t=t||U.MAXIMUM_ELEMENT_SIZE,!(e.length>t||e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))};U._minimallyEncode=function(e){if(e.length===0)return e;var t=e[e.length-1];if(t&127)return e;if(e.length===1)return l.Buffer.from("");if(e[e.length-2]&128)return e;for(var r=e.length-1;r>0;r--)if(e[r-1]!==0)return e[r-1]&128?e[r++]=t:e[r-1]|=t,e.slice(0,r);return l.Buffer.from("")};U.prototype.evaluate=function(){if(this.script.toBuffer().length>this.maxScriptSize())return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:j.fromNumber(this.script.chunks[this.pc].opcodenum)};var e=this.step();if(!e)return!1;if(this._callbackStep(t),this.returned)return!0}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr=t.scriptErr||"SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};U.prototype._callbackStep=function(e){if(typeof this.stepListener=="function")try{this.stepListener(e,Sk(this.stack),Sk(this.altstack))}catch(t){console.log(`Error in Step callback:${t}`)}};U.prototype.checkLockTime=function(e){if(!(this.tx.nLockTime<U.LOCKTIME_THRESHOLD&&e.lt(U.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))||e.gt(new ye(this.tx.nLockTime)))return!1;var t=this.tx.inputs[this.nin];return!(!t||t.isFinal())};U.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin];if(!t)return!1;var r=t.sequenceNumber;if(this.tx.version<2||r&U.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var i=U.SEQUENCE_LOCKTIME_TYPE_FLAG|U.SEQUENCE_LOCKTIME_MASK,n=new ye(r&i),o=e.and(new ye(i)),a=new ye(U.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(n.lt(a)&&o.lt(a)||n.gte(a)&&o.gte(a))||o.gt(n))};function x7(e,t){let r=e;for(;r.length<t;)r=l.Buffer.concat([l.Buffer.from([0]),r]);return r}function wk(e){var t=l.Buffer.alloc(4);return t.writeInt32LE(e|0,0),t}U.prototype.step=function(){var e=this;function t(le){return e.stack[e.stack.length+le]}function r(le){switch(le){case j.OP_2MUL:case j.OP_2DIV:if(!e.isAfterChronicle())return!0;break;case j.OP_INVERT:case j.OP_MUL:case j.OP_LSHIFT:case j.OP_RSHIFT:if((e.flags&U.SCRIPT_ENABLE_MAGNETIC_OPCODES)===0)return!0;break;case j.OP_DIV:case j.OP_MOD:case j.OP_SPLIT:case j.OP_CAT:case j.OP_AND:case j.OP_OR:case j.OP_XOR:case j.OP_BIN2NUM:case j.OP_NUM2BIN:return!1;default:break}return!1}var i=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA)!==0,n,o,a,s,u,c,f,d,m,y,w,T,B,C,q,F,P,k=this.script.chunks[this.pc];this.pc++;var M=k.opcodenum,K=this.vfExec.indexOf(!1)===-1&&(!this.nonTopLevelReturnAfterGenesis||M===j.OP_RETURN);if(Ag.isUndefined(M))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(k.buf&&k.buf.length>this.maxScriptElementSize())return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(M>j.OP_16&&++this.nOpCount>this.maxOpsPerScript())return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(r(M)&&(!this.isAfterGenesis()||K))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(K&&M>=0&&M<=j.OP_PUSHDATA4){if(i&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!k.buf)this.stack.push(U.false);else{if(k.len!==k.buf.length)return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1;this.stack.push(k.buf)}}else if(K||j.OP_IF<=M&&M<=j.OP_ENDIF)switch(M){case j.OP_1NEGATE:case j.OP_1:case j.OP_2:case j.OP_3:case j.OP_4:case j.OP_5:case j.OP_6:case j.OP_7:case j.OP_8:case j.OP_9:case j.OP_10:case j.OP_11:case j.OP_12:case j.OP_13:case j.OP_14:case j.OP_15:case j.OP_16:u=M-(j.OP_1-1),n=new ye(u).toScriptNumBuffer(),this.stack.push(n);break;case j.OP_NOP:break;case j.OP_NOP2:case j.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)||this.isAfterGenesis()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=ye.fromScriptNumBuffer(this.stack[this.stack.length-1],i,5);if(z.lt(new ye(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(z))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case j.OP_NOP3:case j.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)||this.isAfterGenesis()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var V=ye.fromScriptNumBuffer(t(-1),i,5);if(V.lt(new ye(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((V&U.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(V))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case j.OP_NOP1:case j.OP_NOP9:case j.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case j.OP_LSHIFTNUM:case j.OP_RSHIFTNUM:if(!this.isAfterChronicle()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var x=this.maxScriptNumLength(),h=ye.fromScriptNumBuffer(t(-1),i,x);if(h.isNeg())return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop();var v=ye.fromScriptNumBuffer(t(-1),i,x);this.stack.pop();var b=h.toNumber(),S=v.isNeg(),E=v.abs(),A;if(M===j.OP_LSHIFTNUM){var N=v.toScriptNumBuffer().length;if(N+Math.floor(b/8)>x)return this.errstr="SCRIPT_ERR_SCRIPTNUM_OVERFLOW",!1;A=E.shln(b)}else A=b>=E.bitLength()?new ye(0):E.shrn(b);if(S&&!A.isZero()&&(A=A.neg()),A.toScriptNumBuffer().length>x)return this.errstr="SCRIPT_ERR_SCRIPTNUM_OVERFLOW",!1;this.stack.push(A.toScriptNumBuffer());break;case j.OP_VER:if(!this.isAfterChronicle())return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1;if(this.tx==null)return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR",!1;this.stack.push(wk(this.tx.version));break;case j.OP_VERIF:case j.OP_VERNOTIF:if(!this.isAfterChronicle()){if(this.isAfterGenesis()&&!K)break;return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}if(F=!1,K){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(this.tx==null)return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR",!1;n=t(-1),F=n.length===4&&n.equals(wk(this.tx.version)),M===j.OP_VERNOTIF&&(F=!F),this.stack.pop()}this.vfExec.push(F),this.vfElse.push(!1);break;case j.OP_IF:case j.OP_NOTIF:if(F=!1,K){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(n=t(-1),this.flags&U.SCRIPT_VERIFY_MINIMALIF){if(n.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(n.length===1&&n[0]!==1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}F=U.castToBool(n),M===j.OP_NOTIF&&(F=!F),this.stack.pop()}this.vfExec.push(F),this.vfElse.push(!1);break;case j.OP_ELSE:if(this.vfExec.length===0||this.vfElse[this.vfElse.length-1]&&this.isAfterGenesis())return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1],this.vfElse[this.vfElse.length-1]=!0;break;case j.OP_ENDIF:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop(),this.vfElse.pop();break;case j.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(n=t(-1),F=U.castToBool(n),F)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1;break;case j.OP_RETURN:if(this.isAfterGenesis()){if(this.vfExec.length===0){this.returned=!0;break}this.nonTopLevelReturnAfterGenesis=!0;break}return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case j.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case j.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case j.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case j.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-2),a=t(-1),this.stack.push(l.Buffer.from(o)),this.stack.push(l.Buffer.from(a));break;case j.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-3),a=t(-2);var I=t(-1);this.stack.push(l.Buffer.from(o)),this.stack.push(l.Buffer.from(a)),this.stack.push(l.Buffer.from(I));break;case j.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-4),a=t(-3),this.stack.push(l.Buffer.from(o)),this.stack.push(l.Buffer.from(a));break;case j.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;s=this.stack.splice(this.stack.length-6,2),this.stack.push(s[0]),this.stack.push(s[1]);break;case j.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;s=this.stack.splice(this.stack.length-4,2),this.stack.push(s[0]),this.stack.push(s[1]);break;case j.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-1),F=U.castToBool(n),F&&this.stack.push(l.Buffer.from(n));break;case j.OP_DEPTH:n=new ye(this.stack.length).toScriptNumBuffer(),this.stack.push(n);break;case j.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case j.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(l.Buffer.from(t(-1)));break;case j.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case j.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(l.Buffer.from(t(-2)));break;case j.OP_PICK:case j.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(n=t(-1),d=ye.fromScriptNumBuffer(n,i,this.maxScriptNumLength()),u=d.toNumber(),this.stack.pop(),u<0||u>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-u-1),M===j.OP_ROLL&&this.stack.splice(this.stack.length-u-1,1),this.stack.push(l.Buffer.from(n));break;case j.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;c=t(-3),f=t(-2);var g=t(-1);this.stack[this.stack.length-3]=f,this.stack[this.stack.length-2]=g,this.stack[this.stack.length-1]=c;break;case j.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;c=t(-2),f=t(-1),this.stack[this.stack.length-2]=f,this.stack[this.stack.length-1]=c;break;case j.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,l.Buffer.from(t(-1)));break;case j.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=new ye(t(-1).length),this.stack.push(d.toScriptNumBuffer());break;case j.OP_AND:case j.OP_OR:case j.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),a=t(-1),o.length!==a.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(M){case j.OP_AND:for(let le=0;le<o.length;le++)o[le]&=a[le];break;case j.OP_OR:for(let le=0;le<o.length;le++)o[le]|=a[le];break;case j.OP_XOR:for(let le=0;le<o.length;le++)o[le]^=a[le];break;default:break}this.stack.pop();break;case j.OP_INVERT:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-1);for(let le=0;le<n.length;le++)n[le]=~n[le];break;case j.OP_LSHIFT:case j.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),o.length===0)this.stack.pop();else{if(m=new ye(o),y=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()),u=y.toNumber(),u<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop();let le;M===j.OP_LSHIFT&&(le=m.ushln(u)),M===j.OP_RSHIFT&&(le=m.ushrn(u));let Te=x7(l.Buffer.from(le.toArray().slice(o.length*-1)),o.length);this.stack.push(Te)}break;case j.OP_EQUAL:case j.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-2),a=t(-1);var O=o.toString("hex")===a.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?U.true:U.false),M===j.OP_EQUALVERIFY)if(O)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;break;case j.OP_2MUL:case j.OP_2DIV:case j.OP_1ADD:case j.OP_1SUB:case j.OP_NEGATE:case j.OP_ABS:case j.OP_NOT:case j.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(n=t(-1),d=ye.fromScriptNumBuffer(n,i,this.maxScriptNumLength()),M){case j.OP_2MUL:d=d.mul(new ye(2));break;case j.OP_2DIV:d=d.div(new ye(2));break;case j.OP_1ADD:d=d.add(ye.One);break;case j.OP_1SUB:d=d.sub(ye.One);break;case j.OP_NEGATE:d=d.neg();break;case j.OP_ABS:d.cmp(ye.Zero)<0&&(d=d.neg());break;case j.OP_NOT:d=new ye((d.cmp(ye.Zero)===0)+0);break;case j.OP_0NOTEQUAL:d=new ye((d.cmp(ye.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(d.toScriptNumBuffer());break;case j.OP_ADD:case j.OP_SUB:case j.OP_MUL:case j.OP_MOD:case j.OP_DIV:case j.OP_BOOLAND:case j.OP_BOOLOR:case j.OP_NUMEQUAL:case j.OP_NUMEQUALVERIFY:case j.OP_NUMNOTEQUAL:case j.OP_LESSTHAN:case j.OP_GREATERTHAN:case j.OP_LESSTHANOREQUAL:case j.OP_GREATERTHANOREQUAL:case j.OP_MIN:case j.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(m=ye.fromScriptNumBuffer(t(-2),i,this.maxScriptNumLength()),y=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()),d=new ye(0),M){case j.OP_ADD:d=m.add(y);break;case j.OP_SUB:d=m.sub(y);break;case j.OP_MUL:d=m.mul(y);break;case j.OP_DIV:if(y.cmp(ye.Zero)===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;d=m.div(y);break;case j.OP_MOD:if(y.cmp(ye.Zero)===0)return this.errstr="SCRIPT_ERR_MOD_BY_ZERO",!1;d=m.mod(y);break;case j.OP_BOOLAND:d=new ye((m.cmp(ye.Zero)!==0&&y.cmp(ye.Zero)!==0)+0);break;case j.OP_BOOLOR:d=new ye((m.cmp(ye.Zero)!==0||y.cmp(ye.Zero)!==0)+0);break;case j.OP_NUMEQUAL:d=new ye((m.cmp(y)===0)+0);break;case j.OP_NUMEQUALVERIFY:d=new ye((m.cmp(y)===0)+0);break;case j.OP_NUMNOTEQUAL:d=new ye((m.cmp(y)!==0)+0);break;case j.OP_LESSTHAN:d=new ye((m.cmp(y)<0)+0);break;case j.OP_GREATERTHAN:d=new ye((m.cmp(y)>0)+0);break;case j.OP_LESSTHANOREQUAL:d=new ye((m.cmp(y)<=0)+0);break;case j.OP_GREATERTHANOREQUAL:d=new ye((m.cmp(y)>=0)+0);break;case j.OP_MIN:d=m.cmp(y)<0?m:y;break;case j.OP_MAX:d=m.cmp(y)>0?m:y;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(d.toScriptNumBuffer()),M===j.OP_NUMEQUALVERIFY)if(U.castToBool(t(-1)))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;break;case j.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=ye.fromScriptNumBuffer(t(-3),i,this.maxScriptNumLength()),y=ye.fromScriptNumBuffer(t(-2),i,this.maxScriptNumLength());var ee=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength());F=y.cmp(m)<=0&&m.cmp(ee)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(F?U.true:U.false);break;case j.OP_RIPEMD160:case j.OP_SHA1:case j.OP_SHA256:case j.OP_HASH160:case j.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-1);var X;M===j.OP_RIPEMD160?X=Nl.ripemd160(n):M===j.OP_SHA1?X=Nl.sha1(n):M===j.OP_SHA256?X=Nl.sha256(n):M===j.OP_HASH160?X=Nl.sha256ripemd160(n):M===j.OP_HASH256&&(X=Nl.sha256sha256(n)),this.stack.pop(),this.stack.push(X);break;case j.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case j.OP_CHECKSIG:case j.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(w=t(-2),T=t(-1),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(T))return!1;B=new Cl().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var ne=new Cl().add(w);B.findAndDelete(ne);try{C=Na.fromTxFormat(w),q=Cb.fromBuffer(T,!1),P=this.tx.verifySignature(C,q,this.nin,B,this.satoshisBN,this.flags)}catch{P=!1}if(!P&&this.flags&U.SCRIPT_VERIFY_NULLFAIL&&w.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(P?U.true:U.false),M===j.OP_CHECKSIGVERIFY)if(P)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;break;case j.OP_CHECKMULTISIG:case j.OP_CHECKMULTISIGVERIFY:var oe=1;if(this.stack.length<oe)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var ue=ye.fromScriptNumBuffer(t(-oe),i,this.maxScriptNumLength()).toNumber();if(ue<0||ue>this.maxPubKeysPerMultisig())return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=ue,this.nOpCount>U.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var ge=++oe;oe+=ue;var Ie=ue+2;if(this.stack.length<oe)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var _e=ye.fromScriptNumBuffer(t(-oe),i,this.maxScriptNumLength()).toNumber();if(_e<0||_e>ue)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var L=++oe;if(oe+=_e,this.stack.length<oe)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;B=new Cl().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var G=0;G<_e;G++)w=t(-L-G),B.findAndDelete(new Cl().add(w));for(P=!0;P&&_e>0;){if(w=t(-L),T=t(-ge),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(T))return!1;var Q;try{C=Na.fromTxFormat(w),q=Cb.fromBuffer(T,!1),Q=this.tx.verifySignature(C,q,this.nin,B,this.satoshisBN,this.flags)}catch{Q=!1}Q&&(L++,_e--),ge++,ue--,_e>ue&&(P=!1)}for(;oe-- >1;){if(!P&&this.flags&U.SCRIPT_VERIFY_NULLFAIL&&!Ie&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;Ie>0&&Ie--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&U.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(P?U.true:U.false),M===j.OP_CHECKMULTISIGVERIFY)if(P)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;break;case j.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),a=t(-1),o.length+a.length>this.maxScriptElementSize())return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=l.Buffer.concat([o,a]),this.stack.pop();break;case j.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-2);var re=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber();if(re<0||re>o.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var de=l.Buffer.from(o);this.stack[this.stack.length-2]=de.slice(0,re),this.stack[this.stack.length-1]=de.slice(re);break;case j.OP_LEFT:case j.OP_RIGHT:if(!this.isAfterChronicle()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),u=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber(),u<0||u>o.length)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),M===j.OP_LEFT?this.stack[this.stack.length-1]=l.Buffer.from(o).slice(0,u):this.stack[this.stack.length-1]=l.Buffer.from(o).slice(o.length-u);break;case j.OP_SUBSTR:if(!this.isAfterChronicle()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-3);var ce=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber(),fe=ye.fromScriptNumBuffer(t(-2),i,this.maxScriptNumLength()).toNumber();if(fe<0||fe>=o.length||ce<0||ce>o.length-fe)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=l.Buffer.from(o).slice(fe,fe+ce);break;case j.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Se=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber();if(Se<0||Se>this.maxScriptElementSize())return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var pe=t(-1);if(pe=U._minimallyEncode(pe),pe.length>Se)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(pe.length===Se){this.stack[this.stack.length-1]=pe;break}var me=0;pe.length>0&&(me=pe[pe.length-1]&128,pe[pe.length-1]&=127);var xt=l.Buffer.alloc(Se);pe.copy(xt,0);for(var $e=pe.length-1;$e++<Se-2;)xt[$e]=0;xt[$e]=me,this.stack[this.stack.length-1]=xt;break;case j.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),a=U._minimallyEncode(o),this.stack[this.stack.length-1]=a,!U._isMinimallyEncoded(a))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}});var Ze=R((zne,Lb)=>{p();Lb.exports=vb();Lb.exports.Interpreter=tn()});var Si=R((Vne,Ak)=>{"use strict";p();var Mb=Ve(),Jo=Oe(),I7=ti(),xk=lc(),rn=Wo(),Ik=ke(),Ok=Gr(),Db=Kt();function he(e,t,r){if(!(this instanceof he))return new he(e,t,r);if(Mb.isArray(e)&&Mb.isNumber(t))return he.createMultisig(e,t,r);if(e instanceof he)return e;if(Jo.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!rn.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==he.PayToPublicKeyHash&&r!==he.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||rn.get(t)||rn.defaultNetwork,i.type=i.type||r||he.PayToPublicKeyHash,Ok.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}he.prototype._classifyArguments=function(e,t,r){if((e instanceof l.Buffer||e instanceof Uint8Array)&&e.length===20)return he._transformHash(e);if((e instanceof l.Buffer||e instanceof Uint8Array)&&e.length===21)return he._transformBuffer(e,t,r);if(e instanceof Db)return he._transformPublicKey(e);if(e instanceof Ll())return he._transformScript(e,t);if(typeof e=="string")return he._transformString(e,t,r);if(Mb.isObject(e))return he._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};he.PayToPublicKeyHash="pubkeyhash";he.PayToScriptHash="scripthash";he._transformHash=function(e){var t={};if(!(e instanceof l.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t};he._transformObject=function(e){return Jo.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),Jo.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?l.Buffer.from(e.hash,"hex"):e.hashBuffer,network:rn.get(e.network)||rn.defaultNetwork,type:e.type}};he._classifyFromVersion=function(e){var t={},r=rn.get(e[0],"pubkeyhash"),i=rn.get(e[0],"scripthash");return r?(t.network=r,t.type=he.PayToPublicKeyHash):i&&(t.network=i,t.type=he.PayToScriptHash),t};he._transformBuffer=function(e,t,r){var i={};if(!(e instanceof l.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==21)throw new TypeError("Address buffers must be exactly 21 bytes.");var n=rn.get(t),o=he._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=o.network,i.type=o.type,i};he._transformPublicKey=function(e){var t={};if(!(e instanceof Db))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=Ik.sha256ripemd160(e.toBuffer()),t.type=he.PayToPublicKeyHash,t};he._transformScript=function(e,t){Jo.checkArgument(e instanceof Ll(),"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new I7.Script.CantDeriveAddress(e);return r};he.createMultisig=function(e,t,r){return r=r||e[0].network||rn.defaultNetwork,he.payingTo(Ll().buildMultisigOut(e,t),r)};he._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=rn.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=xk.decode(e);return he._transformBuffer(n,t,r)};he.fromPublicKey=function(e,t){var r=he._transformPublicKey(e);return t=t||rn.defaultNetwork,new he(r.hashBuffer,t,r.type)};he.fromPrivateKey=function(e,t){let r=Db.fromPrivateKey(e);return t=t||e.network||rn.defaultNetwork,he.fromPublicKey(r,t)};he.fromPublicKeyHash=function(e,t){var r=he._transformHash(e);return new he(r.hashBuffer,t,he.PayToPublicKeyHash)};he.fromScriptHash=function(e,t){Jo.checkArgument(e,"hash parameter is required");var r=he._transformHash(e);return new he(r.hashBuffer,t,he.PayToScriptHash)};he.payingTo=function(e,t){return Jo.checkArgument(e,"script is required"),Jo.checkArgument(e instanceof Ll(),"script must be instance of Script"),he.fromScriptHash(Ik.sha256ripemd160(e.toBuffer()),t)};he.fromScript=function(e,t){Jo.checkArgument(e instanceof Ll(),"script must be a Script instance");var r=he._transformScript(e,t);return new he(r.hashBuffer,t,r.type)};he.fromBuffer=function(e,t,r){var i=he._transformBuffer(e,t,r);return new he(i.hashBuffer,i.network,i.type)};he.fromHex=function(e,t,r){return he.fromBuffer(l.Buffer.from(e,"hex"),t,r)};he.fromString=function(e,t,r){var i=he._transformString(e,t,r);return new he(i.hashBuffer,i.network,i.type)};he.fromObject=function(t){Jo.checkState(Ok.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=l.Buffer.from(t.hash,"hex");return new he(r,t.network,t.type)};he.getValidationError=function(e,t,r){var i;try{new he(e,t,r)}catch(n){i=n}return i};he.isValid=function(e,t,r){return!he.getValidationError(e,t,r)};he.prototype.isPayToPublicKeyHash=function(){return this.type===he.PayToPublicKeyHash};he.prototype.isPayToScriptHash=function(){return this.type===he.PayToScriptHash};he.prototype.toBuffer=function(){var e=l.Buffer.from([this.network[this.type]]),t=l.Buffer.concat([e,this.hashBuffer]);return t};he.prototype.toHex=function(){return this.toBuffer().toString("hex")};he.prototype.toObject=he.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};he.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};he.prototype.toString=function(){return xk.encode(this.toBuffer())};Ak.exports=he;function Ll(){return Ze()}});var Ur=R((Wne,kk)=>{"use strict";p();var Tg=Ve(),O7=Si(),Tk=lc(),Ca=Ge(),Pk=Gr(),Qn=Wo(),Fb=$i(),A7=Kt(),T7=Ri(),Rk=Oe(),qb="[REDACTED]";function Ae(e,t){if(!(this instanceof Ae))return new Ae(e,t);if(e instanceof Ae)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new Ca(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(Fb.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return Pk.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}Ae.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?Qn.get(t):Qn.defaultNetwork};if(Tg.isUndefined(e)||Tg.isNull(e))r.bn=Ae._getRandomBN();else if(e instanceof Ca)r.bn=e;else if(e instanceof l.Buffer||e instanceof Uint8Array)r=Ae._transformBuffer(e,t);else if(e.bn&&e.network)r=Ae._transformObject(e);else if(!t&&Qn.get(e))r.bn=Ae._getRandomBN(),r.network=Qn.get(e);else if(typeof e=="string")Pk.isHexa(e)?r.bn=new Ca(l.Buffer.from(e,"hex")):r=Ae._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};Ae._getRandomBN=function(){var e,t;do{var r=T7.getRandomBuffer(32);t=Ca.fromBuffer(r),e=t.lt(Fb.getN())}while(!e);return t};Ae._transformBuffer=function(e,t){var r={};if(e.length===32)return Ae._transformBNBuffer(e,t);if(r.network=Qn.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==Qn.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=Ca.fromBuffer(e.slice(1,33)),r};Ae._transformBNBuffer=function(e,t,r){var i={};return i.network=Qn.get(t)||Qn.defaultNetwork,i.bn=Ca.fromBuffer(e),i.compressed=r===void 0?!0:!!r,i};Ae._transformWIF=function(e,t){return Ae._transformBuffer(Tk.decode(e),t)};Ae.fromBuffer=function(e,t,r){return r!==void 0&&e&&e.length===32?new Ae(Ae._transformBNBuffer(e,t,r)):new Ae(e,t)};Ae.fromHex=function(e,t,r){return Ae.fromBuffer(l.Buffer.from(e,"hex"),t,r)};Ae._transformObject=function(e){if(e.bn instanceof Ca)return{bn:e.bn,network:Qn.get(e.network),compressed:e.compressed};if(typeof e.bn!="string"||!e.bn.length)throw new TypeError("Invalid private key: `bn` must be a hex string");if(e.bn===qb)throw new TypeError('Invalid private key: `bn` is "'+qb+'". JSON.stringify() redacts the secret on purpose \u2014 use toObject() for a round-trippable export, or toWIF().');if(!/^[0-9a-fA-F]+$/.test(e.bn))throw new TypeError("Invalid private key: `bn` is not hexadecimal");var t=new Ca(e.bn,"hex");if(t.isZero()||t.gte(Fb.getN()))throw new TypeError("Invalid private key: outside the range of valid keys");var r=Qn.get(e.network);return{bn:t,network:r,compressed:e.compressed}};Ae.fromString=Ae.fromWIF=function(e,t){return Rk.checkArgument(Tg.isString(e),"First argument is expected to be a string."),new Ae(e,t)};Ae.fromObject=Ae.fromJSON=function(e){return Rk.checkArgument(Tg.isObject(e),"First argument is expected to be an object."),new Ae(e)};Ae.fromRandom=function(e){var t=Ae._getRandomBN();return new Ae(t,e)};Ae.getValidationError=function(e,t){var r;try{new Ae(e,t)}catch(i){r=i}return r};Ae.isValid=function(e,t){return e?!Ae.getValidationError(e,t):!1};Ae.prototype.toString=function(){return this.toWIF()};Ae.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=l.Buffer.concat([l.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),l.Buffer.from([1])]):r=l.Buffer.concat([l.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),Tk.encode(r)};Ae.prototype.toBigNumber=function(){return this.bn};Ae.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};Ae.prototype.toHex=function(){return this.toBuffer().toString("hex")};Ae.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=A7.fromPrivateKey(this)),this._pubkey};Ae.prototype.toAddress=function(e){var t=this.toPublicKey();return O7.fromPublicKey(t,e||this.network)};Ae.prototype.toObject=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};Ae.prototype.toJSON=function(){return{bn:qb,compressed:this.compressed,network:this.network.toString()}};Ae.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"};kk.exports=Ae});var Kt=R((Yne,Nk)=>{"use strict";p();var wc=Ge(),Ec=$i(),P7=ke(),R7=Gr(),Bk=Wo(),Ub=Ve(),js=Oe();function be(e,t){if(!(this instanceof be))return new be(e,t);if(js.checkArgument(e,"First argument is required, please include public key data."),e instanceof be)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),R7.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||Bk.defaultNetwork}),this}be.prototype._classifyArgs=function(e,t){var r={compressed:Ub.isUndefined(t.compressed)||t.compressed};if(e instanceof Ec)r.point=e;else if(e.x&&e.y)r=be._transformObject(e);else if(typeof e=="string")r=be._transformDER(l.Buffer.from(e,"hex"));else if(be._isBuffer(e))r=be._transformDER(e);else if(be._isPrivateKey(e))r=be._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=Ub.isUndefined(t.network)?void 0:Bk.get(t.network)),r};be._isPrivateKey=function(e){var t=Ur();return e instanceof t};be._isBuffer=function(e){return e instanceof l.Buffer||e instanceof Uint8Array};be._transformPrivateKey=function(e){js.checkArgument(be._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=Ec.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};be._transformDER=function(e,t){js.checkArgument(be._isBuffer(e),"Must be a buffer of DER encoded public key");var r={};t=Ub.isUndefined(t)?!0:t;var i,n,o,a;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),a=e.slice(33,65),o.length!==32||a.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new wc(o),n=new wc(a),r.point=new Ec(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new wc(o),r=be._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new wc(o),r=be._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};be._transformX=function(e,t){js.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=Ec.fromX(e,t),r};be._transformObject=function(e){var t=new wc(e.x,"hex"),r=new wc(e.y,"hex"),i=new Ec(t,r);return new be(i,{compressed:e.compressed})};be.fromPrivateKey=function(e){js.checkArgument(be._isPrivateKey(e),"Must be an instance of PrivateKey");var t=be._transformPrivateKey(e);return new be(t.point,{compressed:t.compressed,network:t.network})};be.fromDER=be.fromBuffer=function(e,t){js.checkArgument(be._isBuffer(e),"Must be a buffer of DER encoded public key");var r=be._transformDER(e,t);return new be(r.point,{compressed:r.compressed})};be.fromPoint=function(e,t){return js.checkArgument(e instanceof Ec,"First argument must be an instance of Point."),new be(e,{compressed:t})};be.fromHex=be.fromString=function(e,t){var r=l.Buffer.from(e,t||"hex"),i=be._transformDER(r);return new be(i.point,{compressed:i.compressed})};be.fromX=function(e,t){var r=be._transformX(e,t);return new be(r.point,{compressed:r.compressed})};be.getValidationError=function(e){var t;try{new be(e)}catch(r){t=r}return t};be.isValid=function(e){return!be.getValidationError(e)};be.prototype.toObject=be.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};be.prototype.toBuffer=be.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=l.Buffer.from([3]):n=l.Buffer.from([2]),l.Buffer.concat([n,r])}else return n=l.Buffer.from([4]),l.Buffer.concat([n,r,i])};be.prototype._getID=function(){return P7.sha256ripemd160(this.toBuffer())};be.prototype.toAddress=function(e){var t=Si();return t.fromPublicKey(this,e||this.network)};be.prototype.toString=be.prototype.toHex=function(){return this.toDER().toString("hex")};be.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"};Nk.exports=be});var On=R((Xne,Ck)=>{"use strict";p();var Ni=Ge(),eo=$i(),k7=at(),B7=Kt(),N7=Ri(),La=ke(),C7=Ve(),Hb=Oe(),vt=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};Object.defineProperty(vt.prototype,"k",{get:function(){return this._k},set:function(e){this._k=e,this._kFresh=!0},enumerable:!0,configurable:!0});vt.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(l.Buffer.isBuffer(e.sig)){var t=at();this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return e.k&&(this.k=e.k),this.verified=e.verified||this.verified,this};vt.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()};vt.prototype.calci=function(){for(var e=0;e<4;e++){this.sig.i=e;var t;try{t=this.toPublicKey()}catch(r){console.error(r);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")};vt.fromString=function(e){var t=JSON.parse(e);return new vt(t)};vt.prototype.randomK=function(){var e=eo.getN(),t;do t=Ni.fromBuffer(N7.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(Ni.Zero)));return this.k=t,this};vt.prototype.deterministicK=function(e){C7.isUndefined(e)&&(e=0);var t=l.Buffer.alloc(32);t.fill(1);var r=l.Buffer.alloc(32);r.fill(0);var i=this.privkey.bn.toBuffer({size:32}),n=this.endian==="little"?l.Buffer.from(this.hashbuf).reverse():this.hashbuf;r=La.sha256hmac(l.Buffer.concat([t,l.Buffer.from([0]),i,n]),r),t=La.sha256hmac(t,r),r=La.sha256hmac(l.Buffer.concat([t,l.Buffer.from([1]),i,n]),r),t=La.sha256hmac(t,r),t=La.sha256hmac(t,r);for(var o=Ni.fromBuffer(t),a=eo.getN(),s=0;s<e||!(o.lt(a)&&o.gt(Ni.Zero));s++)r=La.sha256hmac(l.Buffer.concat([t,l.Buffer.from([0])]),r),t=La.sha256hmac(t,r),t=La.sha256hmac(t,r),o=Ni.fromBuffer(t);return this.k=o,this};vt.prototype.toPublicKey=function(){var e=this.sig.i;Hb.checkArgument(e===0||e===1||e===2||e===3,new Error("i must be equal to 0, 1, 2, or 3"));var t=Ni.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,n=e&1,o=e>>1,a=eo.getN(),s=eo.getG(),u=o?r.add(a):r,c=eo.fromX(n,u),f=c.mul(a);if(!f.isInfinity())throw new Error("nR is not a valid curve point");var d=t.neg().umod(a),m=r.invm(a),y=c.mul(i).add(s.mul(d)).mul(m),w=B7.fromPoint(y,this.sig.compressed);return w};vt.prototype.sigError=function(){if(!l.Buffer.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=eo.getN();try{if(e.lte(Ni.Zero)||t.lte(Ni.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var i=Ni.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),n=t.invm(r),o=n.mul(i).umod(r),a=n.mul(e).umod(r),s=eo.getG().mulAdd(o,this.pubkey.point,a);return s.isInfinity()?"p is infinity":s.getX().umod(r).cmp(e)!==0?"Invalid signature":!1}catch(u){return"Signature security validation failed: "+u.message}};vt.toLowS=function(e){return e.gt(Ni.fromBuffer(l.Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=eo.getN().sub(e)),e};vt.prototype._findSignature=function(e,t){var r=eo.getN(),i=eo.getG(),n=0,o,a,s,u;do(!this.k||!this._kFresh||n>0)&&this.deterministicK(n),n++,o=this.k,a=i.mul(o),s=a.x.umod(r),u=o.invm(r).mul(t.add(e.mul(s))).umod(r);while(s.cmp(Ni.Zero)<=0||u.cmp(Ni.Zero)<=0);return this._kFresh=!1,u=vt.toLowS(u),{s:u,r:s}};vt.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;Hb.checkState(e&&t&&r,new Error("invalid parameters")),Hb.checkState(l.Buffer.isBuffer(e)&&e.length===32,new Error("hashbuf must be a 32 byte buffer"));var i=Ni.fromBuffer(e,this.endian?{endian:this.endian}:void 0),n=this._findSignature(r,i);return n.compressed=this.pubkey.compressed,this.sig=new k7(n),this};vt.prototype.signRandomK=function(){return this.randomK(),this.sign()};vt.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)};vt.prototype.verify=function(){return this.verified=!this.sigError(),this.verified};vt.prototype.verifyBool=function(){return this.verify()===!0};vt.sign=function(e,t,r){return vt().set({hashbuf:e,endian:r,privkey:t}).sign().sig};vt.signWithCalcI=function(e,t,r){return vt().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig};vt.signRandomK=function(e,t,r){return vt().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig};vt.verify=function(e,t,r,i){return vt().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify()};Ck.exports=vt});var Mk=R((jb,Lk)=>{p();(function(e,t){"use strict";typeof define=="function"&&define.amd?define([],function(){return e.secrets=t()}):typeof jb=="object"?Lk.exports=t(Dt()):e.secrets=t(e.crypto)})(jb,function(e){"use strict";var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!!(r&&r.rng&&typeof r.rng=="function")}function u(P,k){var M;if(k===0||k===1)return P;if(k&&k>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return k=k||r.bits,P&&(M=P.length%k),M?(i+P).slice(-(k-M+P.length)):P}function c(P){var k="",M,K;for(K=P.length-1;K>=0;K--){if(M=parseInt(P[K],16),isNaN(M))throw new Error("Invalid hex character.");k=u(M.toString(2),4)+k}return k}function f(P){var k="",M,K;for(P=u(P,4),K=P.length;K>=4;K-=4){if(M=parseInt(P.slice(K-4,K),2),isNaN(M))throw new Error("Invalid binary character.");k=M.toString(16)+k}return k}function d(){return!!(e&&typeof e=="object"&&(typeof e.getRandomValues=="function"||typeof e.getRandomValues=="object")&&(typeof Uint32Array=="function"||typeof Uint32Array=="object"))}function m(){return typeof e=="object"&&typeof e.randomBytes=="function"}function y(P){function k(V,x,h,v){var b=0,S,E="",A;for(x&&(S=x.length-1);b<S||E.length<V;)A=Math.abs(parseInt(x[b],h)),E=E+u(A.toString(2),v),b++;return E=E.substr(-V),(E.match(/0/g)||[]).length===E.length?null:E}function M(V){var x,h,v,b,S=null;for(v=16,b=4,h=Math.ceil(V/8);S===null;)x=e.randomBytes(h),S=k(V,x.toString("hex"),v,b);return S}function K(V){var x,h,v,b=null;for(h=10,v=32,x=Math.ceil(V/32);b===null;)b=k(V,e.getRandomValues(new Uint32Array(x)),h,v);return b}function z(V){var x,h,v,b,S,E=null;b=10,S=32,h=Math.ceil(V/32),v=123456789,x=new Uint32Array(h);for(var A=0;A<x.length;A++)x[A]=v;for(;E===null;)E=k(V,x,b,S);return E}if(P&&P==="testRandom")return r.typeCSPRNG=P,z;if(P&&P==="nodeCryptoRandomBytes")return r.typeCSPRNG=P,M;if(P&&P==="browserCryptoGetRandomValues")return r.typeCSPRNG=P,K;if(m())return r.typeCSPRNG="nodeCryptoRandomBytes",M;if(d())return r.typeCSPRNG="browserCryptoGetRandomValues",K}function w(P,k){var M=[],K;for(k&&(P=u(P,k)),K=P.length;K>r.bits;K-=r.bits)M.push(parseInt(P.slice(K-r.bits,K),2));return M.push(parseInt(P.slice(0,K),2)),M}function T(P,k){var M=r.logs[P],K=0,z;for(z=k.length-1;z>=0;z--)K!==0?K=r.exps[(M+r.logs[K])%r.maxShares]^k[z]:K=k[z];return K}function B(P,k,M){var K=0,z,V,x,h;for(x=0,z=k.length;x<z;x++)if(M[x]){for(V=r.logs[M[x]],h=0;h<z;h++)if(x!==h){if(P===k[h]){V=-1;break}V=(V+r.logs[P^k[h]]-r.logs[k[x]^k[h]]+r.maxShares)%r.maxShares}K=V===-1?K:K^r.exps[V]}return K}function C(P,k,M){var K=[],z=[P],V,x;for(V=1;V<M;V++)z[V]=parseInt(r.rng(r.bits),2);for(V=1,x=k+1;V<x;V++)K[V-1]={x:V,y:T(V,z)};return K}function q(P,k,M){var K,z,V,x,h;if(k=parseInt(k,r.radix),P=parseInt(P,10)||r.bits,K=P.toString(36).toUpperCase(),V=Math.pow(2,P)-1,x=V.toString(r.radix).length,z=u(k.toString(r.radix),x),typeof k!="number"||k%1!==0||k<1||k>V)throw new Error("Share id must be an integer between 1 and "+V+", inclusive.");return h=K+z+M,h}var F={init:function(P,k){var M=[],K=[],z=1,V,x;if(a(),P&&(typeof P!="number"||P%1!==0||P<t.minBits||P>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(k&&o.indexOf(k)===-1)throw new Error("Invalid RNG type argument : '"+k+"'");for(r.radix=t.radix,r.bits=P||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,V=t.primitivePolynomials[r.bits],x=0;x<r.size;x++)K[x]=z,M[z]=x,z=z<<1,z>=r.size&&(z=z^V,z=z&r.maxShares);if(r.logs=M,r.exps=K,k&&this.setRNG(k),s()||this.setRNG(),!s()||!r.bits||!r.size||!r.maxShares||!r.logs||!r.exps||r.logs.length!==r.size||r.exps.length!==r.size)throw new Error("Initialization failed.")},combine:function(P,k){var M,K,z,V,x="",h,v,b,S=[],E=[];for(k=k||0,M=0,z=P.length;M<z;M++){if(v=this.extractShareComponents(P[M]),h===void 0)h=v.bits;else if(v.bits!==h)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==h&&this.init(h),S.indexOf(v.id)===-1)for(S.push(v.id),b=w(c(v.data)),K=0,V=b.length;K<V;K++)E[K]=E[K]||[],E[K][S.length-1]=b[K]}for(M=0,z=E.length;M<z;M++)x=u(B(k,S,E[M]).toString(2))+x;return f(k>=1?x:x.slice(x.indexOf("1")+1))},getConfig:function(){var P={};return P.radix=r.radix,P.bits=r.bits,P.maxShares=r.maxShares,P.hasCSPRNG=s(),P.typeCSPRNG=r.typeCSPRNG,P},extractShareComponents:function(P){var k,M,K,z,V={},x,h;if(k=parseInt(P.substr(0,1),36),k&&(typeof k!="number"||k%1!==0||k<t.minBits||k>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(z=Math.pow(2,k)-1,K=(Math.pow(2,k)-1).toString(r.radix).length,x="^([a-kA-K3-9]{1})([a-fA-F0-9]{"+K+"})([a-fA-F0-9]+)$",h=new RegExp(x).exec(P),h&&(M=parseInt(h[2],r.radix)),typeof M!="number"||M%1!==0||M<1||M>z)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(h&&h[3])return V.bits=k,V.id=M,V.data=h[3],V;throw new Error("The share data provided is invalid : "+P)},setRNG:function(P){var k="Random number generator is invalid ",M=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(P&&typeof P=="string"&&o.indexOf(P)===-1)throw new Error("Invalid RNG type argument : '"+P+"'");if(P||(P=y()),P&&typeof P=="string"&&(P=y(P)),n){if(P&&typeof P!="function")throw new Error(k+"(Not a function)."+M);if(P&&typeof P(r.bits)!="string")throw new Error(k+"(Output is not a string)."+M);if(P&&!parseInt(P(r.bits),2))throw new Error(k+"(Binary string output not parseable to an Integer)."+M);if(P&&P(r.bits).length>r.bits)throw new Error(k+"(Output length is greater than config.bits)."+M);if(P&&P(r.bits).length<r.bits)throw new Error(k+"(Output length is less than config.bits)."+M)}return r.rng=P,!0},str2hex:function(P,k){var M,K,z="",V,x,h,v;if(typeof P!="string")throw new Error("Input must be a character string.");if(k||(k=t.bytesPerChar),typeof k!="number"||k<1||k>t.maxBytesPerChar||k%1!==0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(M=2*k,K=Math.pow(16,M)-1,h=0,v=P.length;h<v;h++){if(x=P[h].charCodeAt(),isNaN(x))throw new Error("Invalid character: "+P[h]);if(x>K)throw V=Math.ceil(Math.log(x+1)/Math.log(256)),new Error("Invalid character code ("+x+"). Maximum allowable is 256^bytes-1 ("+K+"). To convert this character, use at least "+V+" bytes.");z=u(x.toString(16),M)+z}return z},hex2str:function(P,k){var M,K="",z,V;if(typeof P!="string")throw new Error("Input must be a hexadecimal string.");if(k=k||t.bytesPerChar,typeof k!="number"||k%1!==0||k<1||k>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(M=2*k,P=u(P,M),z=0,V=P.length;z<V;z+=M)K=String.fromCharCode(parseInt(P.slice(z,z+M),16))+K;return K},random:function(P){if(typeof P!="number"||P%1!==0||P<2||P>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return f(r.rng(P))},share:function(P,k,M,K){var z,V,x=new Array(k),h=new Array(k),v,b,S;if(K=K||128,typeof P!="string")throw new Error("Secret must be a string.");if(typeof k!="number"||k%1!==0||k<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(k>r.maxShares)throw z=Math.ceil(Math.log(k+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+k+" shares, use at least "+z+" bits.");if(typeof M!="number"||M%1!==0||M<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(M>r.maxShares)throw z=Math.ceil(Math.log(M+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+M+", use at least "+z+" bits.");if(M>k)throw new Error("Threshold number of shares was "+M+" but must be less than or equal to the "+k+" shares specified as the total to generate.");if(typeof K!="number"||K%1!==0||K<0||K>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(P="1"+c(P),P=w(P,K),v=0,S=P.length;v<S;v++)for(V=C(P[v],k,M),b=0;b<k;b++)x[b]=x[b]||V[b].x.toString(r.radix),h[b]=u(V[b].y.toString(2))+(h[b]||"");for(v=0;v<k;v++)x[v]=q(r.bits,x[v],f(h[v]));return x},newShare:function(P,k){var M,K;if(P&&typeof P=="string"&&(P=parseInt(P,r.radix)),K=P.toString(r.radix),P&&K&&k&&k[0])return M=this.extractShareComponents(k[0]),q(M.bits,K,this.combine(k,P));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:f,_hasCryptoGetRandomValues:d,_hasCryptoRandomBytes:m,_getRNG:y,_isSetRNG:s,_splitNumStringToIntArray:w,_horner:T,_lagrange:B,_getShares:C,_constructPublicShareString:q};return F.init(),F})});var Kb=R((eoe,Uk)=>{"use strict";p();var si=Ge(),Dk=Ri(),qk=ke(),Pg=null;function zb(){if(Pg)return Pg;var e=Mk();return e.setRNG(function(t){for(var r=64,i=0;i<r;i++){for(var n=Dk.getRandomBuffer(Math.ceil(t/8)),o="",a=0;a<n.length;a++)o+=("00000000"+n[a].toString(2)).slice(-8);if(o=o.slice(0,t),/1/.test(o))return o}throw new Error("shamir: CSPRNG returned all-zero draws "+r+" times in a row \u2014 refusing to hang on a degenerate/stubbed random source")}),Pg=e,Pg}var Rg="ff",Fk=2;function yr(e){return this instanceof yr?(this.options=e||{},this):new yr(e)}yr.split=function(e,t,r,i){if(i=i||{},e==null)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var n=l.Buffer.isBuffer(e)?e:l.Buffer.from(e,"utf8"),o=Rg+n.toString("hex"),a=zb().share(o,r,t),s=Dk.getRandomBuffer(8).toString("hex"),u=i.checksum===!0,c=u?qk.sha256(n).slice(0,4).toString("hex"):null,f=[],d=0;d<a.length;d++)f.push({v:Fk,id:d+1,threshold:t,shares:r,length:n.length,splitId:s,share:a[d],checksum:c});return f};yr.combine=function(e){if(!e||e.length===0)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&e[0].share===void 0)return yr._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var i=[],n=0;n<e.length;n++){var o=e[n];if(!o||typeof o.share!="string")throw new Error("Invalid share at index "+n);if(r!==void 0&&o.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(o.threshold!==t)throw new Error("Shares have inconsistent threshold");i.push(o.share)}var a=zb().combine(i);if(a.slice(0,Rg.length)!==Rg)throw new Error("Reconstruction failed: invalid or insufficient shares");var s=l.Buffer.from(a.slice(Rg.length),"hex"),u=e[0].checksum;if(u){var c=qk.sha256(s).slice(0,4).toString("hex");if(c!==u)throw new Error("Integrity check failed: shares are inconsistent or tampered")}return s};yr.verifyShare=function(e){try{return!e||typeof e!="object"?!1:Array.isArray(e.bytes)&&e.share===void 0?yr._verifyLegacyShare(e):e.v!==Fk||typeof e.share!="string"||!/^[0-9a-fA-F]+$/.test(e.share)||typeof e.threshold!="number"||typeof e.shares!="number"||e.threshold<2||e.shares<e.threshold||e.shares>255||e.id<1||e.id>e.shares||e.checksum!==null&&e.checksum!==void 0&&!/^[0-9a-fA-F]{8}$/.test(e.checksum)?!1:(zb().extractShareComponents(e.share),!0)}catch{return!1}};yr.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=3,r=5,i=yr.split(e,t,r),n=yr.combine(i.slice(0,t));return{secret:e,threshold:t,totalShares:r,shares:i,reconstructed:n.toString("utf8"),valid:n.toString("utf8")===e}};var Ma=new si(2147483647);yr._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,i=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=0;n<e.length;n++){if(e[n].threshold!==t||e[n].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[n].length!==i)throw new Error("Shares have different secret lengths")}for(var o=[],a=0;a<i;a++){for(var s=[],u=0;u<Math.min(e.length,t);u++)s.push(e[u].bytes[a]);o.push(yr._combineByteLegacy(s))}return l.Buffer.from(o)};yr._combineByteLegacy=function(e){for(var t=new si(0),r=0;r<e.length;r++){for(var i=new si(e[r].x),n=new si(e[r].y,16),o=new si(1),a=new si(1),s=0;s<e.length;s++)if(r!==s){var u=new si(e[s].x),c=new si(0).sub(u);c.lt(new si(0))&&(c=c.add(Ma)),o=o.mul(c).mod(Ma);var f=i.sub(u);f.lt(new si(0))&&(f=f.add(Ma)),a=a.mul(f).mod(Ma)}var d=yr._modInverseLegacy(a,Ma),m=o.mul(d).mod(Ma);t=t.add(n.mul(m)).mod(Ma)}return t.mod(Ma).mod(new si(256)).toNumber()};yr._modInverseLegacy=function(e,t){e.lt(new si(0))&&(e=e.mod(t).add(t));var r=yr._extendedGCDLegacy(e,t);if(!r.gcd.eq(new si(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)};yr._extendedGCDLegacy=function(e,t){if(e.eq(new si(0)))return{gcd:t,x:new si(0),y:new si(1)};var r=yr._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}};yr._verifyLegacyShare=function(e){if(!e.id||!e.threshold||!e.shares||!e.bytes||typeof e.length!="number"||e.threshold<2||e.shares<e.threshold||!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y||r.x<1||r.x>e.shares||!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0};Uk.exports=yr});var Bg=R((roe,Hk)=>{"use strict";p();var to=Ge(),L7=$i(),M7=On(),Ml=L7.getN(),kg=Ml.shrn(1);function D7(e,t,r){if(!l.Buffer.isBuffer(e)||e.length!==32)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let i=t;if(l.Buffer.isBuffer(t))try{i=at().fromDER(t)}catch{return!1}if(!i||!i.r||!i.s)return!1;let n=to.isBN(i.r)?i.r:new to(i.r),o=to.isBN(i.s)?i.s:new to(i.s);if(n.isZero()||o.isZero()||n.gte(Ml)||o.gte(Ml)||o.gt(kg))return!1;let a=at(),s=new a({r:n,s:o});return M7.verify(e,s,r)}function q7(e){if(!e)return!1;let t=e;if(l.Buffer.isBuffer(e))try{t=at().fromDER(e)}catch{return!1}return!t||!t.s?!1:(to.isBN(t.s)?t.s:new to(t.s)).lte(kg)}function F7(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");let t=to.isBN(e.r)?e.r:new to(e.r),r=to.isBN(e.s)?e.s:new to(e.s),i=r;return r.gt(kg)&&(i=Ml.sub(r)),{r:t,s:i}}Hk.exports={smartVerify:D7,isCanonical:q7,canonicalize:F7,constants:{n:Ml,nh:kg}}});var Ng=R((noe,Kk)=>{"use strict";p();var U7=Ge(),{secp256k1:xc}=(al(),Hi(ol)),jk=xc.Point,H7=jk.Fn.ORDER;function Vb(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new U7(t,16)}function Gb(e){return l.Buffer.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(l.Buffer.from(e,"hex"))}function Wb(e){this._p=e}Wb.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var zk={curve:{n:Vb(H7)},keyFromPrivate:function(e,t){var r;l.Buffer.isBuffer(e)?r=e:e instanceof Uint8Array?r=l.Buffer.from(e):r=l.Buffer.from(e,t||"hex");var i=Uint8Array.from(r);return{_priv:i,getPublic:function(){return new Wb(jk.fromBytes(xc.getPublicKey(i,!0)))}}},sign:function(e,t){var r=xc.sign(Gb(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),i=r[0],n=Vb(BigInt("0x"+l.Buffer.from(r.subarray(1,33)).toString("hex"))),o=Vb(BigInt("0x"+l.Buffer.from(r.subarray(33,65)).toString("hex")));return{r:n,s:o,recoveryParam:i}},verify:function(e,t,r){try{if(!t||typeof t!="object")return!1;var i=t.r,n=t.s;if(!i||!n||typeof i.cmp!="function"||typeof n.cmp!="function"||i.isZero()||n.isZero())return!1;var o=zk.curve.n;if(i.cmp(o)>=0||n.cmp(o)>=0)return!1;var a=l.Buffer.concat([i.toBuffer({size:32}),n.toBuffer({size:32})]),s=r._priv?xc.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return xc.verify(Uint8Array.from(a),Gb(e),Uint8Array.from(s),{lowS:!1,prehash:!1})}catch{return!1}},recoverPubKey:function(e,t,r){var i=l.Buffer.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]),n=xc.Signature.fromBytes(Uint8Array.from(i),"compact").addRecoveryBit(r);return new Wb(n.recoverPublicKey(Gb(e)))}};Kk.exports=zk});var zs=R((aoe,Wk)=>{"use strict";p();var Cg=Ve(),Dl=Ge(),Lg=$n(),j7=Qi(),z7=ke(),Vk=Oe(),K7=486604799,ze=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&Vk.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};ze._from=function(t){var r={};if(l.Buffer.isBuffer(t))r=ze._fromBufferReader(Lg(t));else if(Cg.isObject(t))r=ze._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};ze._fromObject=function(t){Vk.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;Cg.isString(t.prevHash)&&(r=l.Buffer.from(t.prevHash,"hex").reverse()),Cg.isString(t.merkleRoot)&&(i=l.Buffer.from(t.merkleRoot,"hex").reverse());var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};ze.fromObject=function(t){var r=ze._fromObject(t);return new ze(r)};ze.fromRawBlock=function(t){l.Buffer.isBuffer(t)||(t=l.Buffer.from(t,"binary"));var r=Lg(t);r.pos=ze.Constants.START_OF_HEADER;var i=ze._fromBufferReader(r);return new ze(i)};ze.fromBuffer=function(t){var r=ze._fromBufferReader(Lg(t));return new ze(r)};ze.fromString=function(t){var r=l.Buffer.from(t,"hex");return ze.fromBuffer(r)};ze._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};ze.fromBufferReader=function(t){var r=ze._fromBufferReader(t);return new ze(r)};ze.prototype.toObject=ze.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:l.Buffer.from(this.prevHash).reverse().toString("hex"),merkleRoot:l.Buffer.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};ze.prototype.toBuffer=function(){return this.toBufferWriter().concat()};ze.prototype.toString=function(){return this.toBuffer().toString("hex")};ze.prototype.toBufferWriter=function(t){return t||(t=new j7),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};ze.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new Dl(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new Dl(2));return r};ze.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(K7).mul(new Dl(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};ze.prototype._getHash=function(){var t=this.toBuffer();return z7.sha256sha256(t)};var Gk={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=Lg(this._getHash()).readReverse().toString("hex")),this._id},set:Cg.noop};Object.defineProperty(ze.prototype,"id",Gk);Object.defineProperty(ze.prototype,"hash",Gk);ze.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+ze.Constants.MAX_TIME_OFFSET)};ze.prototype.validProofOfWork=function(){var t=new Dl(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};ze.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};ze.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new Dl("10000000000000000000000000000000000000000000000000000000000000000","hex")};Wk.exports=ze});var Qk=R((uoe,Jk)=>{"use strict";p();var Yb=Ve(),Yk=zs(),Zk=Ge(),$b=$n(),V7=Qi(),G7=ke(),Zb=At(),$k=Oe();function Be(e){return this instanceof Be?(Yb.extend(this,Be._from(e)),this):new Be(e)}Be.MAX_BLOCK_SIZE=128e6;Be._from=function(t){var r={};if(l.Buffer.isBuffer(t))r=Be._fromBufferReader($b(t));else if(Yb.isObject(t))r=Be._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};Be._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof Zb?r.push(n):r.push(Zb().fromObject(n))});var i={header:Yk.fromObject(t.header),transactions:r};return i};Be.fromObject=function(t){var r=Be._fromObject(t);return new Be(r)};Be._fromBufferReader=function(t){var r={};$k.checkState(!t.finished(),"No block data received"),r.header=Yk.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(Zb().fromBufferReader(t));return r};Be.fromBufferReader=function(t){$k.checkArgument(t,"br is required");var r=Be._fromBufferReader(t);return new Be(r)};Be.fromBuffer=function(t){return Be.fromBufferReader(new $b(t))};Be.fromString=function(t){var r=l.Buffer.from(t,"hex");return Be.fromBuffer(r)};Be.fromRawBlock=function(t){l.Buffer.isBuffer(t)||(t=l.Buffer.from(t,"binary"));var r=$b(t);r.pos=Be.Values.START_OF_BLOCK;var i=Be._fromBufferReader(r);return new Be(i)};Be.prototype.toObject=Be.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};Be.prototype.toBuffer=function(){return this.toBufferWriter().concat()};Be.prototype.toString=function(){return this.toBuffer().toString("hex")};Be.prototype.toBufferWriter=function(t){t||(t=new V7),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};Be.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[Be.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};Be.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),a=l.Buffer.concat([t[r+n],t[r+o]]);t.push(G7.sha256sha256(a))}r+=i}return t};Be.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};Be.prototype.validMerkleRoot=function(){var t=new Zk(this.header.merkleRoot.toString("hex"),"hex"),r=new Zk(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};Be.prototype._getHash=function(){return this.header._getHash()};var Xk={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:Yb.noop};Object.defineProperty(Be.prototype,"id",Xk);Object.defineProperty(Be.prototype,"hash",Xk);Be.prototype.inspect=function(){return"<Block "+this.id+">"};Be.Values={START_OF_BLOCK:8,NULL_HASH:l.Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};Jk.exports=Be});var Qb=R((foe,rB)=>{"use strict";p();var Ks=Ve(),Jb=zs(),tB=$n(),W7=Qi(),Z7=ke(),eB=At(),Xb=ti(),Vs=Oe();function kt(e){if(!(this instanceof kt))return new kt(e);var t={};if(l.Buffer.isBuffer(e))t=kt._fromBufferReader(tB(e));else if(Ks.isObject(e)){var r;e.header instanceof Jb?r=e.header:r=Jb.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return Ks.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}kt.fromBuffer=function(t){return kt.fromBufferReader(tB(t))};kt.fromBufferReader=function(t){return new kt(kt._fromBufferReader(t))};kt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};kt.prototype.toBufferWriter=function(t){t||(t=new W7),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(l.Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};kt.prototype.toObject=kt.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};kt.prototype.validMerkleTree=function(){if(Vs.checkState(Ks.isArray(this.flags),"MerkleBlock flags is not an array"),Vs.checkState(Ks.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:i.equals(this.header.merkleRoot)};kt.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")};kt.prototype.filteredTxsHash=function(){if(Vs.checkState(Ks.isArray(this.flags),"MerkleBlock flags is not an array"),Vs.checkState(Ks.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new Xb.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new Xb.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new Xb.MerkleBlock.InvalidMerkleTree;return i};kt.prototype._traverseMerkleTree=function(t,r,i,n){if(i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0,n=n||!1,i.flagBitsUsed>this.flags.length*8)return null;var o=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!o){if(i.hashesUsed>=this.hashes.length)return null;var a=this.hashes[i.hashesUsed++];return t===0&&o&&i.txs.push(a),l.Buffer.from(a,"hex")}else{var s=this._traverseMerkleTree(t-1,r*2,i),u=s;return r*2+1<this._calcTreeWidth(t-1)&&(u=this._traverseMerkleTree(t-1,r*2+1,i)),n?i.txs:Z7.sha256sha256(l.Buffer.concat([s,u]))}};kt.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};kt.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};kt.prototype.hasTransaction=function(t){Vs.checkArgument(!Ks.isUndefined(t),"tx cannot be undefined"),Vs.checkArgument(t instanceof eB||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof eB&&(r=l.Buffer.from(t.id,"hex").reverse().toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};kt._fromBufferReader=function(t){Vs.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=Jb.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};kt.fromObject=function(t){return new kt(t)};rB.exports=kt});var iB=R((hoe,Mg)=>{p();Mg.exports=Qk();Mg.exports.BlockHeader=zs();Mg.exports.MerkleBlock=Qb()});var fB=R((poe,cB)=>{"use strict";p();var Y7=zs(),nB=ke(),oB=/^[0-9a-fA-F]{64}$/;function sB(e){return l.Buffer.from(e).reverse()}function aB(e){return sB(l.Buffer.from(e,"hex"))}function uB(e){return sB(e).toString("hex")}function e_(e,t,r){if(!oB.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var i=aB(e),n=t,o=0;o<r.length;o++){var a=r[o],s;if(a==="*"||a===""||a==null)s=i;else{if(!oB.test(String(a)))throw new Error("proof node "+o+' must be 32-byte hex or "*"');s=aB(a)}i=n&1?nB.sha256sha256(l.Buffer.concat([s,i])):nB.sha256sha256(l.Buffer.concat([i,s])),n=Math.floor(n/2)}return uB(i)}function $7(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");var t=e_(e.txid,e.index,e.nodes);return t.toLowerCase()===String(e.merkleRoot).toLowerCase()}function X7(e){var t=e.header;if((l.Buffer.isBuffer(t)||typeof t=="string")&&(t=Y7.fromBuffer(l.Buffer.isBuffer(t)?t:l.Buffer.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=uB(t.merkleRoot),i=e_(e.txid,e.index,e.nodes),n=i.toLowerCase()===r.toLowerCase(),o=e.requirePow!==!1,a=t.validProofOfWork();return{valid:n&&(!o||a),rootMatches:n,powValid:a,merkleRoot:i,blockHash:t.id}}cB.exports={merkleRootFromBranch:e_,verifyMerkleProof:$7,verifyTxInclusion:X7}});var dB=R((moe,hB)=>{"use strict";p();var lB=zs();function J7(e){return l.Buffer.from(e).reverse()}function Q7(e){if(e&&typeof e.validProofOfWork=="function")return e;if(l.Buffer.isBuffer(e))return lB.fromBuffer(e);if(typeof e=="string")return lB.fromBuffer(l.Buffer.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}function eG(e,t){if(t=t||{},!Array.isArray(e)||e.length===0)throw new Error("headers must be a non-empty array");for(var r=e.map(Q7),i=t.requirePow!==!1,n=0,o=0;o<r.length;o++){if(i&&!r[o].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+o,count:r.length};if(n+=r[o].getDifficulty(),o>0){var a=J7(r[o].prevHash).toString("hex").toLowerCase()===r[o-1].id.toLowerCase();if(!a)return{valid:!1,reason:"broken link at index "+o,count:r.length}}}var s=r[0].id,u=r[r.length-1].id;if(t.trustedHash){var c=String(t.trustedHash).toLowerCase();if(c!==u.toLowerCase()&&c!==s.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:s,tipHash:u}}return{valid:!0,count:r.length,anchorHash:s,tipHash:u,work:n}}hB.exports={verifyHeaderChain:eG}});var r_=R((yoe,pB)=>{"use strict";p();var t_=fB(),tG=dB();pB.exports={merkleRootFromBranch:t_.merkleRootFromBranch,verifyMerkleProof:t_.verifyMerkleProof,verifyTxInclusion:t_.verifyTxInclusion,verifyHeaderChain:tG.verifyHeaderChain}});var n_=R((_oe,_B)=>{"use strict";p();var br=Ve(),gB=Oe(),mB=Ge(),rG=Zu(),Dg=lc(),vB=ke(),qg=Fl(),Gs=Wo(),i_=$i(),yB=Kt(),bB=ti(),ql=bB,Tn=bB.HDPublicKey,Fg=Aa(),Da=Gr();function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(e)if(br.isString(e)||l.Buffer.isBuffer(e)){var t=J.getSerializedError(e);if(t){if(l.Buffer.isBuffer(e)&&!J.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof Tn.ArgumentIsPrivateExtended)return new qg(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(br.isObject(e))return e instanceof qg?this._buildFromPrivate(e):this._buildFromObject(e);throw new Tn.UnrecognizedArgument(e)}else throw new Tn.MustSupplyArgument}J.fromHDPrivateKey=function(e){return new J(e)};J.isValidPath=function(e){if(br.isString(e)){var t=qg._getDerivationIndexes(e);return t!==null&&br.every(t,J.isValidPath)}return br.isNumber(e)?e>=0&&e<J.Hardened:!1};J.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};J.prototype.deriveChild=function(e,t){if(br.isNumber(e))return this._deriveWithNumber(e,t);if(br.isString(e))return this._deriveFromString(e);throw new Tn.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t){if(e>=J.Hardened||t)throw new Tn.InvalidIndexCantDeriveHardened;if(e<0)throw new Tn.InvalidPath(e);var r=Da.integerAsBuffer(e),i=l.Buffer.concat([this.publicKey.toBuffer(),r]),n=vB.sha512hmac(i,this._buffers.chainCode),o=mB.fromBuffer(n.slice(0,32),{size:32}),a=n.slice(32,64),s;try{s=yB.fromPoint(i_.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var u=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:a,publicKey:s});return u};J.prototype._deriveFromString=function(e){if(br.includes(e,"'"))throw new Tn.InvalidIndexCantDeriveHardened;if(!J.isValidPath(e))throw new Tn.InvalidPath(e);var t=qg._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};J.isValidSerialized=function(e,t){return br.isNull(J.getSerializedError(e,t))};J.getSerializedError=function(e,t){if(!(br.isString(e)||l.Buffer.isBuffer(e)))return new Tn.UnrecognizedArgument("expected buffer or string");if(!rG.validCharacters(e))return new ql.InvalidB58Char("(unknown)",e);try{e=Dg.decode(e)}catch{return new ql.InvalidB58Checksum(e)}if(e.length!==J.DataSize)return new Tn.InvalidLength(e);if(!br.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}var i=e.readUInt32BE(0);return i===Gs.livenet.xprivkey||i===Gs.testnet.xprivkey?new Tn.ArgumentIsPrivateExtended:null};J._validateNetwork=function(e,t){var r=Gs.get(t);if(!r)return new ql.InvalidNetworkArgument(t);var i=e.slice(J.VersionStart,J.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new ql.InvalidNetwork(i):null};J.prototype._buildFromPrivate=function(e){var t=br.clone(e._buffers),r=i_.getG().mul(mB.fromBuffer(t.privateKey));return t.publicKey=i_.pointToCompressed(r),t.version=Da.integerAsBuffer(Gs.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};J.prototype._buildFromObject=function(e){var t={version:e.network?Da.integerAsBuffer(Gs.get(e.network).xpubkey):e.version,depth:br.isNumber(e.depth)?l.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:br.isNumber(e.parentFingerPrint)?Da.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:br.isNumber(e.childIndex)?Da.integerAsBuffer(e.childIndex):e.childIndex,chainCode:br.isString(e.chainCode)?l.Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:br.isString(e.publicKey)?l.Buffer.from(e.publicKey,"hex"):l.Buffer.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:br.isNumber(e.checksum)?Da.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=Dg.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),publicKey:t.slice(J.PublicKeyStart,J.PublicKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),Da.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=l.Buffer.concat(t),i=Dg.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new ql.InvalidB58Checksum(r,i);var n=Gs.get(e.version.readUInt32BE(0)),o;o=Dg.encode(l.Buffer.concat(t)),e.xpubkey=l.Buffer.from(o);var a=new yB(e.publicKey,{network:n}),s=J.ParentFingerPrintSize,u=vB.sha256ripemd160(a.toBuffer()).slice(0,s);return Da.defineImmutable(this,{xpubkey:o,network:n,depth:e.depth[0],publicKey:a,fingerPrint:u}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Fg(l.Buffer.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),Fg(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("publicKey",J.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.fromString=function(e){return gB.checkArgument(br.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return gB.checkArgument(br.isObject(e),"No valid argument was provided"),new J(e)};J.prototype.toString=function(){return this.xpubkey};J.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:Gs.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}};J.fromBuffer=function(e){return new J(e)};J.fromHex=function(e){return J.fromBuffer(l.Buffer.from(e,"hex"))};J.prototype.toBuffer=function(){return l.Buffer.from(this._buffers.xpubkey)};J.prototype.toHex=function(){return this.toBuffer().toString("hex")};J.Hardened=2147483648;J.RootElementAlias=["m","M"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PublicKeySize=33;J.CheckSumSize=4;J.DataSize=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PublicKeyStart=J.ChainCodeEnd;J.PublicKeyEnd=J.PublicKeyStart+J.PublicKeySize;J.ChecksumStart=J.PublicKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;Fg(J.PublicKeyEnd===J.DataSize);Fg(J.ChecksumEnd===J.SerializedByteSize);_B.exports=J});var Fl=R((woe,IB)=>{"use strict";p();var Ug=Aa(),Hl=Lt(),Vt=Ve(),wB=Oe(),EB=Ge(),iG=Zu(),Ul=lc(),o_=ke(),Ws=Wo(),nG=$i(),xB=Ur(),oG=Ri(),Ic=ti(),io=Ic.HDPrivateKey,ro=Gr(),aG=128,SB=1/8,sG=512;function W(e){if(e instanceof W)return e;if(!(this instanceof W))return new W(e);if(!e)return this._generateRandomly();if(Ws.get(e))return this._generateRandomly(e);if(Vt.isString(e)||l.Buffer.isBuffer(e))if(W.isValidSerialized(e))this._buildFromSerialized(e);else if(ro.isValidJSON(e))this._buildFromJSON(e);else if(l.Buffer.isBuffer(e)&&W.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw W.getSerializedError(e);else if(Vt.isObject(e))this._buildFromObject(e);else throw new io.UnrecognizedArgument(e)}W.fromRandom=function(e){return new W(e)};W.isValidPath=function(e,t){if(Vt.isString(e)){var r=W._getDerivationIndexes(e);return r!==null&&Vt.every(r,W.isValidPath)}return Vt.isNumber(e)?(e<W.Hardened&&t===!0&&(e+=W.Hardened),e>=0&&e<W.MaxIndex):!1};W._getDerivationIndexes=function(e){var t=e.split("/");if(Vt.includes(W.RootElementAlias,e))return[];if(!Vt.includes(W.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=W.Hardened),o});return Vt.some(r,isNaN)?null:r};W.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};W.prototype.deriveChild=function(e,t){if(Vt.isNumber(e))return this._deriveWithNumber(e,t);if(Vt.isString(e))return this._deriveFromString(e);throw new io.InvalidDerivationArgument(e)};W.prototype.deriveNonCompliantChild=function(e,t){if(Vt.isNumber(e))return this._deriveWithNumber(e,t,!0);if(Vt.isString(e))return this._deriveFromString(e,!0);throw new io.InvalidDerivationArgument(e)};W.prototype._deriveWithNumber=function(e,t,r){if(!W.isValidPath(e,t))throw new io.InvalidPath(e);t=e>=W.Hardened?!0:t,e<W.Hardened&&t===!0&&(e+=W.Hardened);var i=ro.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=l.Buffer.concat([Hl.Buffer.from([0]),o,i])}else if(t){var a=this.privateKey.bn.toBuffer({size:32});Ug(a.length===32,"length of private key buffer is expected to be 32 bytes"),n=l.Buffer.concat([Hl.Buffer.from([0]),a,i])}else n=l.Buffer.concat([this.publicKey.toBuffer(),i]);var s=o_.sha512hmac(n,this._buffers.chainCode),u=EB.fromBuffer(s.slice(0,32),{size:32}),c=s.slice(32,64),f=u.add(this.privateKey.toBigNumber()).umod(nG.getN()).toBuffer({size:32});if(!xB.isValid(f))return this._deriveWithNumber(e+1,null,r);var d=new W({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:c,privateKey:f});return d};W.prototype._deriveFromString=function(e,t){if(!W.isValidPath(e))throw new io.InvalidPath(e);var r=W._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};W.isValidSerialized=function(e,t){return!W.getSerializedError(e,t)};W.getSerializedError=function(e,t){if(!(Vt.isString(e)||l.Buffer.isBuffer(e)))return new io.UnrecognizedArgument("Expected string or buffer");if(!iG.validCharacters(e))return new Ic.InvalidB58Char("(unknown)",e);try{e=Ul.decode(e)}catch{return new Ic.InvalidB58Checksum(e)}if(e.length!==W.DataLength)return new io.InvalidLength(e);if(!Vt.isUndefined(t)){var r=W._validateNetwork(e,t);if(r)return r}return null};W._validateNetwork=function(e,t){var r=Ws.get(t);if(!r)return new Ic.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new Ic.InvalidNetwork(i):null};W.fromString=function(e){return wB.checkArgument(Vt.isString(e),"No valid string was provided"),new W(e)};W.fromObject=function(e){return wB.checkArgument(Vt.isObject(e),"No valid argument was provided"),new W(e)};W.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};W.prototype._buildFromObject=function(e){var t={version:e.network?ro.integerAsBuffer(Ws.get(e.network).xprivkey):e.version,depth:Vt.isNumber(e.depth)?l.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:Vt.isNumber(e.parentFingerPrint)?ro.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Vt.isNumber(e.childIndex)?ro.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Vt.isString(e.chainCode)?l.Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:Vt.isString(e.privateKey)&&ro.isHexa(e.privateKey)?l.Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:ro.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};W.prototype._buildFromSerialized=function(e){var t=Ul.decode(e),r={version:t.slice(W.VersionStart,W.VersionEnd),depth:t.slice(W.DepthStart,W.DepthEnd),parentFingerPrint:t.slice(W.ParentFingerPrintStart,W.ParentFingerPrintEnd),childIndex:t.slice(W.ChildIndexStart,W.ChildIndexEnd),chainCode:t.slice(W.ChainCodeStart,W.ChainCodeEnd),privateKey:t.slice(W.PrivateKeyStart,W.PrivateKeyEnd),checksum:t.slice(W.ChecksumStart,W.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};W.prototype._generateRandomly=function(e){return W.fromSeed(oG.getRandomBuffer(64),e)};W.fromSeed=function(e,t){if(ro.isHexaString(e)&&(e=l.Buffer.from(e,"hex")),!l.Buffer.isBuffer(e))throw new io.InvalidEntropyArgument(e);if(e.length<aG*SB)throw new io.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>sG*SB)throw new io.InvalidEntropyArgument.TooMuchEntropy(e);var r=o_.sha512hmac(e,Hl.Buffer.from("Bitcoin seed"));return new W({network:Ws.get(t)||Ws.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};W.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=n_();this._hdPublicKey=new e(this)}};W.prototype._buildFromBuffers=function(e){W._validateBufferArguments(e),ro.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,l.Buffer.alloc(1),e.privateKey],r=Hl.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=Ul.checksum(r);else if(e.checksum.toString()!==Ul.checksum(r).toString())throw new Ic.InvalidB58Checksum(r);var i=Ws.get(e.version.readUInt32BE(0)),n;n=Ul.encode(Hl.Buffer.concat(t)),e.xprivkey=l.Buffer.from(n);var o=new xB(EB.fromBuffer(e.privateKey),i),a=o.toPublicKey(),s=W.ParentFingerPrintSize,u=o_.sha256ripemd160(a.toBuffer()).slice(0,s);return ro.defineImmutable(this,{xprivkey:n,network:i,depth:e.depth[0],privateKey:o,publicKey:a,fingerPrint:u}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};W._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Ug(l.Buffer.isBuffer(n),r+" argument is not a buffer"),Ug(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",W.VersionSize),t("depth",W.DepthSize),t("parentFingerPrint",W.ParentFingerPrintSize),t("childIndex",W.ChildIndexSize),t("chainCode",W.ChainCodeSize),t("privateKey",W.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",W.CheckSumSize)};W.prototype.toString=function(){return this.xprivkey};W.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};W.prototype.toObject=W.prototype.toJSON=function(){return{network:Ws.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}};W.fromBuffer=function(e){return new W(e.toString())};W.fromHex=function(e){return W.fromBuffer(l.Buffer.from(e,"hex"))};W.prototype.toBuffer=function(){return l.Buffer.from(this.toString())};W.prototype.toHex=function(){return this.toBuffer().toString("hex")};W.DefaultDepth=0;W.DefaultFingerprint=0;W.DefaultChildIndex=0;W.Hardened=2147483648;W.MaxIndex=2*W.Hardened;W.RootElementAlias=["m","M","m'","M'"];W.VersionSize=4;W.DepthSize=1;W.ParentFingerPrintSize=4;W.ChildIndexSize=4;W.ChainCodeSize=32;W.PrivateKeySize=32;W.CheckSumSize=4;W.DataLength=78;W.SerializedByteSize=82;W.VersionStart=0;W.VersionEnd=W.VersionStart+W.VersionSize;W.DepthStart=W.VersionEnd;W.DepthEnd=W.DepthStart+W.DepthSize;W.ParentFingerPrintStart=W.DepthEnd;W.ParentFingerPrintEnd=W.ParentFingerPrintStart+W.ParentFingerPrintSize;W.ChildIndexStart=W.ParentFingerPrintEnd;W.ChildIndexEnd=W.ChildIndexStart+W.ChildIndexSize;W.ChainCodeStart=W.ChildIndexEnd;W.ChainCodeEnd=W.ChainCodeStart+W.ChainCodeSize;W.PrivateKeyStart=W.ChainCodeEnd+1;W.PrivateKeyEnd=W.PrivateKeyStart+W.PrivateKeySize;W.ChecksumStart=W.PrivateKeyEnd;W.ChecksumEnd=W.ChecksumStart+W.CheckSumSize;Ug(W.ChecksumEnd===W.SerializedByteSize);IB.exports=W});var RB=R((xoe,PB)=>{"use strict";p();var uG=ke(),Hg=Ve(),cG=Ur(),fG=Kt(),OB=Si(),AB=Qi(),a_=On(),TB=at(),lG=uG.sha256sha256,hG=Gr(),Oc=Oe(),Bt=function e(t){return this instanceof e?(Oc.checkArgument(Hg.isString(t)||l.Buffer.isBuffer(t),"First argument should be a string or Buffer"),Hg.isString(t)&&(this.messageBuffer=l.Buffer.from(t)),l.Buffer.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};Bt.sign=function(e,t){return new Bt(e).sign(t)};Bt.verify=function(e,t,r){return new Bt(e).verify(t,r)};Bt.MAGIC_BYTES=l.Buffer.from(`Bitcoin Signed Message:
|
|
69
|
+
`));var s=new Ra({actual:e,expected:t,message:r,operator:n,stackStartFn:i});throw s.generatedMessage=a,s}}_t.match=function e(t,r,i){_R(t,r,i,e,"match")};_t.doesNotMatch=function e(t,r,i){_R(t,r,i,e,"doesNotMatch")};function SR(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];dR.apply(void 0,[SR,t.length].concat(t))}_t.strict=_V(SR,_t,{equal:_t.strictEqual,deepEqual:_t.deepStrictEqual,notEqual:_t.notStrictEqual,notDeepEqual:_t.notDeepStrictEqual});_t.strict.strict=_t.strict});var Qi=R((sne,xR)=>{"use strict";p();var ER=Aa(),zt=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};zt.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(t,r){return t+r.length},0),this};zt.prototype.toBuffer=function(){return this.concat()};zt.prototype.concat=function(){return l.Buffer.concat(this.bufs,this.bufLen)};zt.prototype.write=function(e){return ER(l.Buffer.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this};zt.prototype.writeReverse=function(e){return ER(l.Buffer.isBuffer(e)),this.bufs.push(l.Buffer.from(e).reverse()),this.bufLen+=e.length,this};zt.prototype.writeUInt8=function(e){var t=l.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this};zt.prototype.writeUInt16BE=function(e){var t=l.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this};zt.prototype.writeUInt16LE=function(e){var t=l.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this};zt.prototype.writeUInt32BE=function(e){var t=l.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this};zt.prototype.writeInt32LE=function(e){var t=l.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this};zt.prototype.writeUInt32LE=function(e){var t=l.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this};zt.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this};zt.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this};zt.prototype.writeVarintNum=function(e){var t=zt.varintBufNum(e);return this.write(t),this};zt.prototype.writeVarintBN=function(e){var t=zt.varintBufBN(e);return this.write(t),this};zt.varintBufNum=function(e){var t;return e<253?(t=l.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=l.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=l.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=l.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t};zt.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)t=l.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=l.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=l.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{var i=new zt;i.writeUInt8(255),i.writeUInt64LEBN(e),t=i.concat()}return t};xR.exports=zt});var xr=R((cne,IR)=>{"use strict";p();var gc=Ve(),Al=Oe(),wV=Gr();function et(e){if(!(this instanceof et))return new et(e);var t;if(gc.isNumber(e))t=e;else if(gc.isString(e))t=et.map[e];else throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');return wV.defineImmutable(this,{num:t}),this}et.fromBuffer=function(e){return Al.checkArgument(l.Buffer.isBuffer(e)),new et(+("0x"+e.toString("hex")))};et.fromNumber=function(e){return Al.checkArgument(gc.isNumber(e)),new et(e)};et.fromString=function(e){Al.checkArgument(gc.isString(e));var t=et.map[e];if(typeof t>"u")throw new TypeError("Invalid opcodestr");return new et(t)};et.prototype.toHex=function(){return this.num.toString(16)};et.prototype.toBuffer=function(){return l.Buffer.from(this.toHex(),"hex")};et.prototype.toNumber=function(){return this.num};et.prototype.toString=function(){var e=et.reverseMap[this.num];if(typeof e>"u")throw new Error("Opcode does not have a string representation");return e};et.smallInt=function(e){return Al.checkArgument(gc.isNumber(e),"Invalid Argument: n should be number"),Al.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),e===0?et("OP_0"):new et(et.map.OP_1+e-1)};et.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_LSHIFTNUM:182,OP_RSHIFTNUM:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};et.reverseMap=[];for(pb in et.map)et.reverseMap[et.map[pb]]=pb;var pb;gc.extend(et,et.map);et.isSmallIntOp=function(e){return e instanceof et&&(e=e.toNumber()),e===et.map.OP_0||e>=et.map.OP_1&&e<=et.map.OP_16};et.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};IR.exports=et});var vb=R((lne,TR)=>{"use strict";p();var Sn=Si(),EV=$n(),xV=Qi(),gb=ke(),ae=xr(),Us=Kt(),Fs=at(),OR=Wo(),Ot=Oe(),We=Ve(),mb=ti(),AR=Lt(),IV=Gr(),Z=function e(t){if(!(this instanceof e))return new e(t);if(this.chunks=[],l.Buffer.isBuffer(t))return e.fromBuffer(t);if(t instanceof Sn)return e.fromAddress(t);if(t instanceof e)return e.fromBuffer(t.toBuffer());if(We.isString(t))return e.fromString(t);We.isObject(t)&&We.isArray(t.chunks)&&this.set(t)};Z.prototype.set=function(e){return Ot.checkArgument(We.isObject(e)),Ot.checkArgument(We.isArray(e.chunks)),this.chunks=e.chunks,this};Z.fromBuffer=function(e){var t=new Z;t.chunks=[];for(var r=new EV(e);!r.finished();)try{var i=r.readUInt8(),n,o;i>0&&i<ae.OP_PUSHDATA1?(n=i,t.chunks.push({buf:r.read(n),len:n,opcodenum:i})):i===ae.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===ae.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):i===ae.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),t.chunks.push({buf:o,len:n,opcodenum:i})):t.chunks.push({opcodenum:i})}catch(a){throw a instanceof RangeError?new mb.Script.InvalidBuffer(e.toString("hex")):a}return t};Z.prototype.toBuffer=function(){for(var e=new xV,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<ae.OP_PUSHDATA1?e.write(r.buf):i===ae.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===ae.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===ae.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()};Z.fromASM=function(e){var t=new Z;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=ae(n),a=o.toNumber();if(n==="0")a=0,t.chunks.push({opcodenum:a}),i=i+1;else if(n==="-1")a=ae.OP_1NEGATE,t.chunks.push({opcodenum:a}),i=i+1;else if(We.isUndefined(a)){var s=l.Buffer.from(r[i],"hex");if(s.toString("hex")!==r[i])throw new Error("invalid hex string in script");var u=s.length;u>=0&&u<ae.OP_PUSHDATA1?a=u:u<Math.pow(2,8)?a=ae.OP_PUSHDATA1:u<Math.pow(2,16)?a=ae.OP_PUSHDATA2:u<Math.pow(2,32)&&(a=ae.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),i=i+1}else t.chunks.push({opcodenum:a}),i=i+1}return t};Z.fromHex=function(e){return new Z(AR.Buffer.from(e,"hex"))};Z.fromString=function(e){if(IV.isHexa(e)||e.length===0)return new Z(AR.Buffer.from(e,"hex"));var t=new Z;t.chunks=[];for(var r=e.split(" "),i=0;i<r.length;){var n=r[i],o=ae(n),a=o.toNumber();if(We.isUndefined(a))if(a=parseInt(n),a>0&&a<ae.OP_PUSHDATA1)t.chunks.push({buf:l.Buffer.from(r[i+1].slice(2),"hex"),len:a,opcodenum:a}),i=i+2;else throw new Error("Invalid script: "+JSON.stringify(e));else if(a===ae.OP_PUSHDATA1||a===ae.OP_PUSHDATA2||a===ae.OP_PUSHDATA4){if(r[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:l.Buffer.from(r[i+2].slice(2),"hex"),len:parseInt(r[i+1]),opcodenum:a}),i=i+3}else t.chunks.push({opcodenum:a}),i=i+1}return t};Z.prototype._chunkToString=function(e,t){var r=e.opcodenum,i=t==="asm",n="";if(e.buf)!i&&(r===ae.OP_PUSHDATA1||r===ae.OP_PUSHDATA2||r===ae.OP_PUSHDATA4)&&(n=n+" "+ae(r).toString()),e.len>0&&(i?n=n+" "+e.buf.toString("hex"):n=n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(typeof ae.reverseMap[r]<"u")i?r===0?n=n+" 0":r===79?n=n+" -1":n=n+" "+ae(r).toString():n=n+" "+ae(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i?n=n+" "+o:n=n+" 0x"+o}return n};Z.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)};Z.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)};Z.prototype.toHex=function(){return this.toBuffer().toString("hex")};Z.prototype.inspect=function(){return"<Script: "+this.toString()+">"};Z.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===ae.OP_DUP&&this.chunks[1].opcodenum===ae.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===ae.OP_EQUALVERIFY&&this.chunks[4].opcodenum===ae.OP_CHECKSIG)};Z.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===ae.OP_DUP&&this.chunks[1].opcodenum===ae.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===ae.OP_EQUALVERIFY&&this.chunks[4].opcodenum===ae.OP_CHECKSIG)};Z.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&e[0]===48&&t&&t.length){var r=t[0];if((r===4||r===6||r===7)&&t.length===65)return!0;if((r===3||r===2)&&t.length===33)return!0}}return!1};Z.prototype.getPublicKey=function(){return Ot.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf};Z.prototype.getPublicKeyHash=function(){return Ot.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf};Z.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===ae.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if(((t===4||t===6||t===7)&&e.length===65||(t===3||t===2)&&e.length===33)&&(r=!0),r)return Us.isValid(e)}return!1};Z.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var e=this.chunks[0].buf;if(e&&e.length&&e[0]===48)return!0}return!1};Z.prototype.isScriptHashOut=function(){var e=this.toBuffer();return e.length===23&&e[0]===ae.OP_HASH160&&e[1]===20&&e[e.length-1]===ae.OP_EQUAL};Z.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e=this.chunks[this.chunks.length-1],t=e.buf;if(!t)return!1;var r;try{r=Z.fromBuffer(t)}catch(n){if(n instanceof mb.Script.InvalidBuffer)return!1;throw n}var i=r.classify();return i!==Z.types.UNKNOWN};Z.prototype.isMultisigOut=function(){return this.chunks.length>3&&ae.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&l.Buffer.isBuffer(e.buf)})&&ae.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===ae.OP_CHECKMULTISIG};Z.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&l.Buffer.isBuffer(e.buf)&&Fs.isTxDER(e.buf)})};Z.prototype.isDataOut=function(){var e=this.chunks.length>=1&&this.chunks[0].opcodenum===ae.OP_RETURN;if(!e)return!1;var t=this.chunks.slice(1),r=new Z({chunks:t});return r.isPushOnly()};Z.prototype.isSafeDataOut=function(){if(this.chunks.length<2||this.chunks[0].opcodenum!==ae.OP_FALSE)return!1;var e=this.chunks.slice(1),t=new Z({chunks:e});return t.isDataOut()};Z.prototype.getData=function(){if(this.isSafeDataOut()){var e=this.chunks.slice(2),t=e.map(r=>r.buf);return t}if(this.isDataOut()||this.isScriptHashOut())return We.isUndefined(this.chunks[1])?l.Buffer.alloc(0):l.Buffer.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return l.Buffer.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")};Z.prototype.isPushOnly=function(){return We.every(this.chunks,function(e){return e.opcodenum<=ae.OP_16||e.opcodenum===ae.OP_PUSHDATA1||e.opcodenum===ae.OP_PUSHDATA2||e.opcodenum===ae.OP_PUSHDATA4})};Z.types={};Z.types.UNKNOWN="Unknown";Z.types.PUBKEY_OUT="Pay to public key";Z.types.PUBKEY_IN="Spend from public key";Z.types.PUBKEYHASH_OUT="Pay to public key hash";Z.types.PUBKEYHASH_IN="Spend from public key hash";Z.types.SCRIPTHASH_OUT="Pay to script hash";Z.types.SCRIPTHASH_IN="Spend from script hash";Z.types.MULTISIG_OUT="Pay to multisig";Z.types.MULTISIG_IN="Spend from multisig";Z.types.DATA_OUT="Data push";Z.types.SAFE_DATA_OUT="Safe data push";Z.OP_RETURN_STANDARD_SIZE=220;Z.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==Z.types.UNKNOWN?e:this.classifyInput()};Z.outputIdentifiers={};Z.outputIdentifiers.PUBKEY_OUT=Z.prototype.isPublicKeyOut;Z.outputIdentifiers.PUBKEYHASH_OUT=Z.prototype.isPublicKeyHashOut;Z.outputIdentifiers.MULTISIG_OUT=Z.prototype.isMultisigOut;Z.outputIdentifiers.SCRIPTHASH_OUT=Z.prototype.isScriptHashOut;Z.outputIdentifiers.DATA_OUT=Z.prototype.isDataOut;Z.outputIdentifiers.SAFE_DATA_OUT=Z.prototype.isSafeDataOut;Z.prototype.classifyOutput=function(){for(var e in Z.outputIdentifiers)if(Z.outputIdentifiers[e].bind(this)())return Z.types[e];return Z.types.UNKNOWN};Z.inputIdentifiers={};Z.inputIdentifiers.PUBKEY_IN=Z.prototype.isPublicKeyIn;Z.inputIdentifiers.PUBKEYHASH_IN=Z.prototype.isPublicKeyHashIn;Z.inputIdentifiers.MULTISIG_IN=Z.prototype.isMultisigIn;Z.inputIdentifiers.SCRIPTHASH_IN=Z.prototype.isScriptHashIn;Z.prototype.classifyInput=function(){for(var e in Z.inputIdentifiers)if(Z.inputIdentifiers[e].bind(this)())return Z.types[e];return Z.types.UNKNOWN};Z.prototype.isStandard=function(){return this.classify()!==Z.types.UNKNOWN};Z.prototype.prepend=function(e){return this._addByType(e,!0),this};Z.prototype.equals=function(e){if(Ot.checkState(e instanceof Z,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(l.Buffer.isBuffer(this.chunks[t].buf)&&!l.Buffer.isBuffer(e.chunks[t].buf)||l.Buffer.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0};Z.prototype.add=function(e){return this._addByType(e,!1),this};Z.prototype._addByType=function(e,t){if(typeof e=="string")this._addOpcode(e,t);else if(typeof e=="number")this._addOpcode(e,t);else if(e instanceof ae)this._addOpcode(e,t);else if(l.Buffer.isBuffer(e))this._addBuffer(e,t);else if(e instanceof Z)this.chunks=this.chunks.concat(e.chunks);else if(typeof e=="object")this._insertAtPosition(e,t);else throw new Error("Invalid script chunk")};Z.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)};Z.prototype._addOpcode=function(e,t){var r;return typeof e=="number"?r=e:e instanceof ae?r=e.toNumber():r=ae(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this};Z.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<ae.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=ae.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=ae.OP_PUSHDATA2;else if(i<Math.pow(2,32))r=ae.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this};Z.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==ae.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this};Z.buildMultisigOut=function(e,t,r){Ot.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new Z;i.add(ae.smallInt(t)),e=We.map(e,Us);var n=e;r.noSorting||(n=e.map(s=>s.toString("hex")).sort().map(s=>new Us(s)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(ae.smallInt(e.length)),i.add(ae.OP_CHECKMULTISIG),i};Z.buildMultisigIn=function(e,t,r,i){Ot.checkArgument(We.isArray(e)),Ot.checkArgument(We.isNumber(t)),Ot.checkArgument(We.isArray(r)),i=i||{};var n=new Z;return n.add(ae.OP_0),We.each(r,function(o){Ot.checkArgument(l.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n};Z.buildP2SHMultisigIn=function(e,t,r,i){Ot.checkArgument(We.isArray(e)),Ot.checkArgument(We.isNumber(t)),Ot.checkArgument(We.isArray(r)),i=i||{};var n=new Z;return n.add(ae.OP_0),We.each(r,function(o){Ot.checkArgument(l.Buffer.isBuffer(o),"Signatures must be an array of Buffers"),n.add(o)}),n.add((i.cachedMultisig||Z.buildMultisigOut(e,t,i)).toBuffer()),n};Z.buildPublicKeyHashOut=function(e){Ot.checkArgument(!We.isUndefined(e)),Ot.checkArgument(e instanceof Us||e instanceof Sn||We.isString(e)),e instanceof Us?e=e.toAddress():We.isString(e)&&(e=new Sn(e));var t=new Z;return t.add(ae.OP_DUP).add(ae.OP_HASH160).add(e.hashBuffer).add(ae.OP_EQUALVERIFY).add(ae.OP_CHECKSIG),t._network=e.network,t};Z.buildPublicKeyOut=function(e){Ot.checkArgument(e instanceof Us);var t=new Z;return t.add(e.toBuffer()).add(ae.OP_CHECKSIG),t};Z.buildDataOut=function(e,t){Ot.checkArgument(We.isUndefined(e)||We.isString(e)||We.isArray(e)||l.Buffer.isBuffer(e));var r=e;We.isArray(r)||(r=[e]);var i=new Z;i.add(ae.OP_RETURN);for(let n of r)Ot.checkArgument(We.isUndefined(n)||We.isString(n)||l.Buffer.isBuffer(n)),We.isString(n)&&(n=l.Buffer.from(n,t)),We.isUndefined(n)||i.add(n);return i};Z.buildSafeDataOut=function(e,t){var r=Z.buildDataOut(e,t),i=new Z;return i.add(ae.OP_FALSE),i.add(r),i};Z.buildScriptHashOut=function(e){Ot.checkArgument(e instanceof Z||e instanceof Sn&&e.isPayToScriptHash());var t=new Z;return t.add(ae.OP_HASH160).add(e instanceof Sn?e.hashBuffer:gb.sha256ripemd160(e.toBuffer())).add(ae.OP_EQUAL),t._network=e._network||e.network,t};Z.buildPublicKeyIn=function(e,t){Ot.checkArgument(e instanceof Fs||l.Buffer.isBuffer(e)),Ot.checkArgument(We.isUndefined(t)||We.isNumber(t)),e instanceof Fs&&(e=e.toBuffer());var r=new Z;return r.add(l.Buffer.concat([e,l.Buffer.from([(t||Fs.SIGHASH_ALL)&255])])),r};Z.buildPublicKeyHashIn=function(e,t,r){Ot.checkArgument(t instanceof Fs||l.Buffer.isBuffer(t)),Ot.checkArgument(We.isUndefined(r)||We.isNumber(r)),t instanceof Fs&&(t=t.toBuffer());var i=new Z().add(l.Buffer.concat([t,l.Buffer.from([(r||Fs.SIGHASH_ALL)&255])])).add(new Us(e).toBuffer());return i};Z.empty=function(){return new Z};Z.prototype.toScriptHashOut=function(){return Z.buildScriptHashOut(this)};Z.fromAddress=function(e){if(e=Sn(e),e.isPayToScriptHash())return Z.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return Z.buildPublicKeyHashOut(e);throw new mb.Script.UnrecognizedAddress(e)};Z.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()};Z.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=Sn.PayToScriptHash;else if(this.isPublicKeyHashOut())e.hashBuffer=this.getData(),e.type=Sn.PayToPublicKeyHash;else return!1;return e};Z.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=gb.sha256ripemd160(this.chunks[1].buf),e.type=Sn.PayToPublicKeyHash;else if(this.isScriptHashIn())e.hashBuffer=gb.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=Sn.PayToScriptHash;else return!1;return e};Z.prototype.toAddress=function(e){var t=this.getAddressInfo();return t?(t.network=OR.get(e)||this._network||OR.defaultNetwork,new Sn(t)):!1};Z.prototype.findAndDelete=function(e){for(var t=e.toBuffer(),r=t.toString("hex"),i=0;i<this.chunks.length;i++){var n=Z({chunks:[this.chunks[i]]}),o=n.toBuffer(),a=o.toString("hex");r===a&&this.chunks.splice(i,1)}return this};Z.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return r?r.length===0?i===ae.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?i===ae.OP_1+(r[0]-1):r.length===1&&r[0]===129?i===ae.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===ae.OP_PUSHDATA1:r.length<=65535?i===ae.OP_PUSHDATA2:!0:!0};Z.prototype._decodeOP_N=function(e){if(e===ae.OP_0)return 0;if(e>=ae.OP_1&&e<=ae.OP_16)return e-(ae.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))};Z.prototype.getSignatureOperationsCount=function(e){e=We.isUndefined(e)?!0:e;var t=this,r=0,i=ae.OP_INVALIDOPCODE;return We.each(t.chunks,function(o){var a=o.opcodenum;a===ae.OP_CHECKSIG||a===ae.OP_CHECKSIGVERIFY?r++:(a===ae.OP_CHECKMULTISIG||a===ae.OP_CHECKMULTISIGVERIFY)&&(e&&i>=ae.OP_1&&i<=ae.OP_16?r+=t._decodeOP_N(i):r+=20),i=a}),r};TR.exports=Z});var mc=R((dne,kR)=>{"use strict";p();var PR=Qi(),RR=$n(),OV=Ge(),wn=function e(t){if(!(this instanceof e))return new e(t);if(l.Buffer.isBuffer(t))this.buf=t;else if(typeof t=="number"){var r=t;this.fromNumber(r)}else if(t instanceof OV){var i=t;this.fromBN(i)}else if(t){var n=t;this.set(n)}};wn.prototype.set=function(e){return this.buf=e.buf||this.buf,this};wn.prototype.fromString=function(e){return this.set({buf:l.Buffer.from(e,"hex")}),this};wn.prototype.toString=function(){return this.buf.toString("hex")};wn.prototype.fromBuffer=function(e){return this.buf=e,this};wn.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this};wn.prototype.fromBN=function(e){return this.buf=PR().writeVarintBN(e).concat(),this};wn.prototype.fromNumber=function(e){return this.buf=PR().writeVarintNum(e).concat(),this};wn.prototype.toBuffer=function(){return this.buf};wn.prototype.toBN=function(){return RR(this.buf).readVarintBN()};wn.prototype.toNumber=function(){return RR(this.buf).readVarintNum()};kR.exports=wn});var oi=R((gne,NR)=>{"use strict";p();var mg=Ve(),yb=Ge(),BR=Lt(),vg=Gr(),AV=Qi(),TV=mc(),bb=Ze(),_b=Oe(),PV=ti(),RV=9007199254740991;function qr(e){if(!(this instanceof qr))return new qr(e);if(mg.isObject(e))if(this.satoshis=e.satoshis,l.Buffer.isBuffer(e.script))this._scriptBuffer=e.script;else{var t;mg.isString(e.script)&&vg.isHexa(e.script)?t=BR.Buffer.from(e.script,"hex"):t=e.script,this.setScript(t)}else throw new TypeError("Unrecognized argument for Output")}Object.defineProperty(qr.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}});Object.defineProperty(qr.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof yb?(this._satoshisBN=e,this._satoshis=e.toNumber()):mg.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=yb.fromNumber(this._satoshis)):(_b.checkArgument(vg.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=yb.fromNumber(e),this._satoshis=e),_b.checkState(vg.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});qr.prototype.invalidSatoshis=function(){return this._satoshis>RV?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1};Object.defineProperty(qr.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),_b.checkState(vg.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}});qr.prototype.toObject=qr.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t};qr.fromObject=function(e){return new qr(e)};qr.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=bb.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(t){if(t instanceof PV.Script.InvalidBuffer)this._script=null;else throw t}};qr.prototype.setScript=function(e){if(e instanceof bb)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(mg.isString(e))this._script=bb.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(l.Buffer.isBuffer(e))this.setScriptFromBuffer(e);else throw new TypeError("Invalid argument type: script");return this};qr.prototype.inspect=function(){var e;return this.script?e=this.script.inspect():e=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"};qr.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return r!==0?t.script=e.read(r):t.script=BR.Buffer.from([]),new qr(t)};qr.prototype.toBufferWriter=function(e){e||(e=new AV),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e};qr.prototype.getSize=function(){var e=this.script.toBuffer().length,t=TV(e).toBuffer().length;return 8+t+e};NR.exports=qr});var vc=R((vne,DR)=>{"use strict";p();var ka=Ve(),kV=Oe(),Tl=ti(),BV=Qi(),Sb=Lt(),LR=Gr(),yg=Ze(),NV=ai(),CR=oi(),bg=4294967295,CV=bg-2,MR=bg,LV=bg-1;function mt(e){if(!(this instanceof mt))return new mt(e);if(e)return this._fromObject(e)}mt.MAXINT=bg;mt.DEFAULT_SEQNUMBER=MR;mt.DEFAULT_LOCKTIME_SEQNUMBER=LV;mt.DEFAULT_RBF_SEQNUMBER=CV;mt.BASE_SIZE=40;Object.defineProperty(mt.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new yg(this._scriptBuffer),this._script._isInput=!0),this._script)}});mt.fromObject=function(e){kV.checkArgument(ka.isObject(e));var t=new mt;return t._fromObject(e)};mt.prototype._fromObject=function(e){var t;if(ka.isString(e.prevTxId)&&LR.isHexa(e.prevTxId)?t=Sb.Buffer.from(e.prevTxId,"hex"):t=e.prevTxId,this.output=e.output?e.output instanceof CR?e.output:new CR(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=ka.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=ka.isUndefined(e.sequenceNumber)?ka.isUndefined(e.seqnum)?MR:e.seqnum:e.sequenceNumber,ka.isUndefined(e.script)&&ka.isUndefined(e.scriptBuffer))throw new Tl.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this};mt.prototype.toObject=mt.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t};mt.fromBufferReader=function(e){var t=new mt;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t};mt.prototype.toBufferWriter=function(e){e||(e=new BV),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e};mt.prototype.setScript=function(e){if(this._script=null,e instanceof yg)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(e===null)this._script=yg.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(LR.isHexa(e))this._scriptBuffer=Sb.Buffer.from(e,"hex");else if(ka.isString(e))this._script=new yg(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(l.Buffer.isBuffer(e))this._scriptBuffer=Sb.Buffer.from(e);else throw new TypeError("Invalid argument type: script");return this};mt.prototype.getSignatures=function(){throw new Tl.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))};mt.prototype.isFullySigned=function(){throw new Tl.AbstractMethodInvoked("Input#isFullySigned")};mt.prototype.isFinal=function(){return this.sequenceNumber===mt.MAXINT};mt.prototype.addSignature=function(){throw new Tl.AbstractMethodInvoked("Input#addSignature")};mt.prototype.clearSignatures=function(){throw new Tl.AbstractMethodInvoked("Input#clearSignatures")};mt.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,NV.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};mt.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295};mt.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length};DR.exports=mt});var yc=R((bne,qR)=>{"use strict";p();qR.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}});var _c=R((Sne,HR)=>{"use strict";p();var bc=Ve(),en=Oe(),MV=yc(),FR=Gr(),UR=Kt(),DV=ti(),Pl=at();function En(e){if(!(this instanceof En))return new En(e);if(e instanceof En)return e;if(bc.isObject(e))return this._fromObject(e);throw new DV.InvalidArgument("TransactionSignatures must be instantiated from an object")}MV(En,Pl);En.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new UR(e.publicKey),this.prevTxId=l.Buffer.isBuffer(e.prevTxId)?e.prevTxId:l.Buffer.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof Pl?e.signature:l.Buffer.isBuffer(e.signature)?Pl.fromBuffer(e.signature):Pl.fromString(e.signature),this.sigtype=e.sigtype,this};En.prototype._checkObjectArgs=function(e){en.checkArgument(UR(e.publicKey),"publicKey"),en.checkArgument(!bc.isUndefined(e.inputIndex),"inputIndex"),en.checkArgument(!bc.isUndefined(e.outputIndex),"outputIndex"),en.checkState(bc.isNumber(e.inputIndex),"inputIndex must be a number"),en.checkState(bc.isNumber(e.outputIndex),"outputIndex must be a number"),en.checkArgument(e.signature,"signature"),en.checkArgument(e.prevTxId,"prevTxId"),en.checkState(e.signature instanceof Pl||l.Buffer.isBuffer(e.signature)||FR.isHexa(e.signature),"signature must be a buffer or hexa value"),en.checkState(l.Buffer.isBuffer(e.prevTxId)||FR.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),en.checkArgument(e.sigtype,"sigtype"),en.checkState(bc.isNumber(e.sigtype),"sigtype must be a number")};En.prototype.toObject=En.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}};En.fromObject=function(e){return en.checkArgument(e),new En(e)};HR.exports=En});var GR=R((Ene,VR)=>{"use strict";p();var qV=yc(),zR=Oe(),wb=vc(),FV=oi(),UV=ai(),KR=Ze(),jR=at(),HV=_c();function Zo(){wb.apply(this,arguments)}qV(Zo,wb);Zo.prototype.getSignatures=function(e,t,r,i){zR.checkState(this.output instanceof FV),i=i||jR.SIGHASH_ALL|jR.SIGHASH_FORKID;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new HV({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:UV.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Zo.prototype.addSignature=function(e,t){return zR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(KR.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this};Zo.prototype.clearSignatures=function(){return this.setScript(KR.empty()),this};Zo.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()};Zo.SCRIPT_MAX_SIZE=74;Zo.prototype._estimateSize=function(){return wb.BASE_SIZE+Zo.SCRIPT_MAX_SIZE};VR.exports=Zo});var XR=R((Ine,$R)=>{"use strict";p();var jV=yc(),ZR=Oe(),zV=ke(),Eb=vc(),KV=oi(),VV=ai(),YR=Ze(),WR=at(),GV=_c();function Yo(){Eb.apply(this,arguments)}jV(Yo,Eb);Yo.prototype.getSignatures=function(e,t,r,i,n){ZR.checkState(this.output instanceof KV),n=n||zV.sha256ripemd160(t.publicKey.toBuffer()),i=i||WR.SIGHASH_ALL|WR.SIGHASH_FORKID;var o=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return o&&n.equals(o)?[new GV({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:VV.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]};Yo.prototype.addSignature=function(e,t){return ZR.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(YR.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this};Yo.prototype.clearSignatures=function(){return this.setScript(YR.empty()),this};Yo.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()};Yo.SCRIPT_MAX_SIZE=108;Yo.prototype._estimateSize=function(){return Eb.BASE_SIZE+Yo.SCRIPT_MAX_SIZE};$R.exports=Yo});var ek=R((Ane,QR)=>{"use strict";p();var xn=Ve(),WV=yc(),Sg=vc(),ZV=oi(),Rl=Oe(),JR=Ze(),_g=at(),xb=ai(),Ib=_c(),YV=Kt(),$V=mc();function Ir(e,t,r,i){Sg.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new YV(o)),Rl.checkState(JR.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},xn.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}WV(Ir,Sg);Ir.prototype.toObject=function(){var e=Sg.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=xn.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};Ir.prototype._deserializeSignatures=function(e){return xn.map(e,function(t){if(t)return new Ib(t)})};Ir.prototype._serializeSignatures=function(){return xn.map(this.signatures,function(e){if(e)return e.toObject()})};Ir.prototype.getSignatures=function(e,t,r,i){Rl.checkState(this.output instanceof ZV),i=i||_g.SIGHASH_ALL|_g.SIGHASH_FORKID;var n=this,o=[];return xn.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new Ib({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:xb.sign(e,t,i,r,n.output.script,n.output.satoshisBN),sigtype:i}))}),o};Ir.prototype.addSignature=function(e,t){return Rl.checkState(!this.isFullySigned(),"All needed signatures have already been added"),Rl.checkArgument(!xn.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),Rl.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};Ir.prototype._updateScript=function(){return this.setScript(JR.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this};Ir.prototype._createSignatures=function(){return xn.map(xn.filter(this.signatures,function(e){return!xn.isUndefined(e)}),function(e){return l.Buffer.concat([e.signature.toDER(),l.Buffer.from([e.sigtype&255])])})};Ir.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};Ir.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};Ir.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};Ir.prototype.countSignatures=function(){return xn.reduce(this.signatures,function(e,t){return e+!!t},0)};Ir.prototype.publicKeysWithoutSignature=function(){var e=this;return xn.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};Ir.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,xb.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)};Ir.normalizeSignatures=function(e,t,r,i,n){return n.map(function(o){var a=null;return i=i.filter(function(s){if(a)return!0;var u=new Ib({signature:_g.fromTxFormat(s),publicKey:o,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:_g.SIGHASH_ALL});u.signature.nhashtype=u.sigtype;var c=xb.verify(e,u.signature,u.publicKey,u.inputIndex,t.output.script);return c?(a=u,!1):!0}),a||null})};Ir.SIGNATURE_SIZE=73;Ir.prototype._estimateSize=function(){var e=1+this.threshold*Ir.SIGNATURE_SIZE;return Sg.BASE_SIZE+$V(e).toBuffer().length+e};QR.exports=Ir});var ok=R((Pne,nk)=>{"use strict";p();var In=Ve(),XV=yc(),wg=vc(),JV=oi(),kl=Oe(),Ob=Ze(),tk=at(),rk=ai(),ik=_c(),QV=Kt(),e7=mc();function vr(e,t,r,i){wg.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(o=>o.toString("hex")).sort().map(o=>new QV(o)),this.redeemScript=Ob.buildMultisigOut(this.publicKeys,r),kl.checkState(Ob.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},In.each(this.publicKeys,function(o,a){n.publicKeyIndex[o.toString()]=a}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}XV(vr,wg);vr.prototype.toObject=function(){var e=wg.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=In.map(this.publicKeys,function(t){return t.toString()}),e.signatures=this._serializeSignatures(),e};vr.prototype._deserializeSignatures=function(e){return In.map(e,function(t){if(t)return new ik(t)})};vr.prototype._serializeSignatures=function(){return In.map(this.signatures,function(e){if(e)return e.toObject()})};vr.prototype.getSignatures=function(e,t,r,i){kl.checkState(this.output instanceof JV),i=i||tk.SIGHASH_ALL|tk.SIGHASH_FORKID;var n=this,o=[];return In.each(this.publicKeys,function(a){a.toString()===t.publicKey.toString()&&o.push(new ik({publicKey:t.publicKey,prevTxId:n.prevTxId,outputIndex:n.outputIndex,inputIndex:r,signature:rk.sign(e,t,i,r,n.redeemScript,n.output.satoshisBN),sigtype:i}))}),o};vr.prototype.addSignature=function(e,t){return kl.checkState(!this.isFullySigned(),"All needed signatures have already been added"),kl.checkArgument(!In.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),kl.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this};vr.prototype._updateScript=function(){return this.setScript(Ob.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this};vr.prototype._createSignatures=function(){return In.map(In.filter(this.signatures,function(e){return!In.isUndefined(e)}),function(e){return l.Buffer.concat([e.signature.toDER(),l.Buffer.from([e.sigtype&255])])})};vr.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()};vr.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold};vr.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()};vr.prototype.countSignatures=function(){return In.reduce(this.signatures,function(e,t){return e+!!t},0)};vr.prototype.publicKeysWithoutSignature=function(){var e=this;return In.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})};vr.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,rk.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)};vr.SIGNATURE_SIZE=73;vr.PUBKEY_SIZE=34;vr.prototype._estimateSize=function(){var e=this.publicKeys.length*vr.PUBKEY_SIZE,t=this.threshold*vr.SIGNATURE_SIZE,r=3+e,i=r<=75?1:r<=255?2:3,n=t+1+i+r;return wg.BASE_SIZE+e7(n).toBuffer().length+n};nk.exports=vr});var Xn=R((kne,Sc)=>{p();Sc.exports=vc();Sc.exports.PublicKey=GR();Sc.exports.PublicKeyHash=XR();Sc.exports.MultiSig=ek();Sc.exports.MultiSigScriptHash=ok()});var ai=R((Nne,fk)=>{"use strict";p();var t7=Lt(),wi=at(),Ab=Ze(),r7=oi(),i7=$n(),Bl=Qi(),ak=Ge(),Eg=ke(),sk=On(),Tb=Oe(),Pb=tn(),Ba=Ve(),uk=l.Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),n7="ffffffffffffffff",o7=Pb.SCRIPT_ENABLE_SIGHASH_FORKID,a7=function(e,t,r,i,n){var o=e.inputs[r];Tb.checkArgument(n instanceof ak,"For ForkId=0 signatures, satoshis or complete input must be provided");function a(T){var B=new Bl;Ba.each(T.inputs,function(F){B.writeReverse(F.prevTxId),B.writeUInt32LE(F.outputIndex)});var C=B.toBuffer(),q=Eg.sha256sha256(C);return q}function s(T){var B=new Bl;Ba.each(T.inputs,function(F){B.writeUInt32LE(F.sequenceNumber)});var C=B.toBuffer(),q=Eg.sha256sha256(C);return q}function u(T,B){var C=new Bl;Ba.isUndefined(B)?Ba.each(T.outputs,function(P){P.toBufferWriter(C)}):T.outputs[B].toBufferWriter(C);var q=C.toBuffer(),F=Eg.sha256sha256(q);return F}var c=l.Buffer.alloc(32),f=l.Buffer.alloc(32),d=l.Buffer.alloc(32);t&wi.SIGHASH_ANYONECANPAY||(c=a(e)),!(t&wi.SIGHASH_ANYONECANPAY)&&(t&31)!==wi.SIGHASH_SINGLE&&(t&31)!==wi.SIGHASH_NONE&&(f=s(e)),(t&31)!==wi.SIGHASH_SINGLE&&(t&31)!==wi.SIGHASH_NONE?d=u(e):(t&31)===wi.SIGHASH_SINGLE&&r<e.outputs.length&&(d=u(e,r));var m=new Bl;m.writeInt32LE(e.version),m.write(c),m.write(f),m.writeReverse(o.prevTxId),m.writeUInt32LE(o.outputIndex),m.writeVarintNum(i.toBuffer().length),m.write(i.toBuffer()),m.writeUInt64LEBN(n);var y=o.sequenceNumber;m.writeUInt32LE(y),m.write(d),m.writeUInt32LE(e.nLockTime),m.writeUInt32LE(t>>>0);var w=m.toBuffer();return w},ck=function(t,r,i,n,o,a){var s=kb(),u=Xn();Ba.isUndefined(a)&&(a=o7);var c=s.shallowCopy(t);if(n=new Ab(n),a&Pb.SCRIPT_ENABLE_REPLAY_PROTECTION){var f=r>>8,d=16711680|f^57005;r=d<<8|r&255}if(r&wi.SIGHASH_FORKID&&!(r&wi.SIGHASH_CHRONICLE)&&a&Pb.SCRIPT_ENABLE_SIGHASH_FORKID)return a7(c,r,i,n,o);n.removeCodeseparators();var m;for(m=0;m<c.inputs.length;m++)c.inputs[m]=new u(c.inputs[m]).setScript(Ab.empty());if(c.inputs[i]=new u(c.inputs[i]).setScript(n),(r&31)===wi.SIGHASH_NONE||(r&31)===wi.SIGHASH_SINGLE)for(m=0;m<c.inputs.length;m++)m!==i&&(c.inputs[m].sequenceNumber=0);if((r&31)===wi.SIGHASH_NONE)c.outputs=[];else if((r&31)===wi.SIGHASH_SINGLE){if(i>=c.outputs.length)return uk;for(c.outputs.length=i+1,m=0;m<i;m++)c.outputs[m]=new r7({satoshis:ak.fromBuffer(t7.Buffer.from(n7,"hex")),script:Ab.empty()})}r&wi.SIGHASH_ANYONECANPAY&&(c.inputs=[c.inputs[i]]);var y=new Bl().write(c.toBuffer()).writeInt32LE(r).toBuffer();return y},Rb=function(t,r,i,n,o,a){var s=ck(t,r,i,n,o,a);if(s.compare(uk)===0)return s;var u=Eg.sha256sha256(s);return u=new i7(u).readReverse(),u};function s7(e,t,r,i,n,o,a){var s=Rb(e,r,i,n,o,a),u=sk.sign(s,t,"little").set({nhashtype:r});return u}function u7(e,t,r,i,n,o,a){Tb.checkArgument(!Ba.isUndefined(e)),Tb.checkArgument(!Ba.isUndefined(t)&&!Ba.isUndefined(t.nhashtype));var s=Rb(e,t.nhashtype,i,n,o,a);return sk.verify(s,t,r,"little")}fk.exports={sighashPreimage:ck,sighash:Rb,sign:s7,verify:u7}});var Bb=R((Lne,hk)=>{"use strict";p();var $o=Ve(),xg=Oe(),lk=Gr(),c7=Ze(),f7=Si();function Xo(e){if(!(this instanceof Xo))return new Xo(e);xg.checkArgument($o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f7(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!lk.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var i=$o.isUndefined(e.vout)?e.outputIndex:e.vout;if(!$o.isNumber(i))throw new Error("Invalid outputIndex, received "+i);xg.checkArgument(!$o.isUndefined(e.scriptPubKey)||!$o.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var n=new c7(e.scriptPubKey||e.script);xg.checkArgument(!$o.isUndefined(e.amount)||!$o.isUndefined(e.satoshis),"Must provide an amount for the output");var o=$o.isUndefined(e.amount)?e.satoshis:Math.round(e.amount*1e8);xg.checkArgument($o.isNumber(o),"Amount must be a number"),lk.defineImmutable(this,{address:t,txId:r,outputIndex:i,script:n,satoshis:o})}Xo.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"};Xo.prototype.toString=function(){return this.txId+":"+this.outputIndex};Xo.fromObject=function(e){return new Xo(e)};Xo.prototype.toObject=Xo.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}};hk.exports=Xo});var kb=R((Dne,_k)=>{"use strict";p();var we=Ve(),Fr=Oe(),l7=Lt(),Ar=ti(),pk=Gr(),gk=$n(),h7=Qi(),dk=mc(),mk=ke(),Og=at(),vk=ai(),d7=Si(),yk=Bb(),Or=Xn(),p7=Or.PublicKeyHash,g7=Or.PublicKey,m7=Or.MultiSigScriptHash,v7=Or.MultiSig,An=oi(),Jn=Ze(),y7=Ur(),Ig=Ge(),b7=tn(),_7=b7.SCRIPT_ENABLE_SIGHASH_FORKID;function ie(e){if(!(this instanceof ie))return new ie(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof ie)return ie.shallowCopy(e);if(pk.isHexa(e))this.fromString(e);else if(l.Buffer.isBuffer(e))this.fromBuffer(e);else if(we.isObject(e))this.fromObject(e);else throw new Ar.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var S7=1,w7=0,E7=1e6;ie.DUST_AMOUNT=546;ie.FEE_SECURITY_MARGIN=150;ie.MAX_MONEY=21e6*1e8;ie.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8;ie.NLOCKTIME_MAX_VALUE=4294967295;ie.FEE_PER_KB=500;ie.CHANGE_OUTPUT_MAX_SIZE=62;ie.shallowCopy=function(e){var t=new ie(e.toBuffer());return t};var bk={configurable:!1,enumerable:!0,get:function(){return this._hash=new gk(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(ie.prototype,"hash",bk);Object.defineProperty(ie.prototype,"id",bk);var Nb={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(ie.prototype,"inputAmount",Nb);Nb.get=function(){return this._getOutputAmount()};Object.defineProperty(ie.prototype,"outputAmount",Nb);ie.prototype._getHash=function(){return mk.sha256sha256(this.toBuffer())};ie.prototype.serialize=function(e){return e===!0||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)};ie.prototype.uncheckedSerialize=ie.prototype.toString=function(){return this.toBuffer().toString("hex")};ie.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()};ie.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e};ie.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new Ar.Transaction.InvalidSatoshis;var t=this._getUnspentValue(),r;return t<0?e.disableMoreOutputThanInput||(r=new Ar.Transaction.InvalidOutputAmountSum):r=this._hasFeeError(e,t),r||this._hasDustOutputs(e)||this._isMissingSignatures(e)};ie.prototype._hasFeeError=function(e,t){if(!we.isUndefined(this._fee)&&this._fee!==t)return new Ar.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(ie.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new Ar.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new Ar.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}};ie.prototype._missingChange=function(){return!this._changeScript};ie.prototype._hasDustOutputs=function(e){if(!e.disableDustOutputs){var t,r;for(t in this.outputs)if(r=this.outputs[t],r.satoshis<ie.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new Ar.Transaction.DustOutputs}};ie.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned&&!this.isFullySigned())return new Ar.Transaction.MissingSignatures};ie.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"};ie.prototype.toBuffer=function(){var e=new h7;return this.toBufferWriter(e).toBuffer()};ie.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),we.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),we.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e};ie.prototype.fromBuffer=function(e){var t=new gk(e);return this.fromBufferReader(t)};ie.prototype.fromBufferReader=function(e){Fr.checkArgument(!e.finished(),"No transaction data received");var t,r,i;for(this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=Or.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(An.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this};ie.prototype.toObject=ie.prototype.toJSON=function(){var t=[];this.inputs.forEach(function(n){t.push(n.toObject())});var r=[];this.outputs.forEach(function(n){r.push(n.toObject())});var i={hash:this.hash,version:this.version,inputs:t,outputs:r,nLockTime:this.nLockTime};return this._changeScript&&(i.changeScript=this._changeScript.toString()),we.isUndefined(this._changeIndex)||(i.changeIndex=this._changeIndex),we.isUndefined(this._fee)||(i.fee=this._fee),i};ie.prototype.fromObject=function(t){Fr.checkArgument(we.isObject(t)||t instanceof ie);var r=this,i;return t instanceof ie?i=t.toObject():i=t,we.each(i.inputs,function(n){if(!n.output||!n.output.script){r.uncheckedAddInput(new Or(n));return}var o=new Jn(n.output.script),a;if(o.isPublicKeyHashOut())a=new Or.PublicKeyHash(n);else if(o.isScriptHashOut()&&n.publicKeys&&n.threshold)a=new Or.MultiSigScriptHash(n,n.publicKeys,n.threshold,n.signatures);else if(o.isPublicKeyOut())a=new Or.PublicKey(n);else throw new Ar.Transaction.Input.UnsupportedScript(n.output.script);r.addInput(a)}),we.each(i.outputs,function(n){r.addOutput(new An(n))}),i.changeIndex&&(this._changeIndex=i.changeIndex),i.changeScript&&(this._changeScript=new Jn(i.changeScript)),i.fee&&(this._fee=i.fee),this.nLockTime=i.nLockTime,this.version=i.version,this._checkConsistency(t),this};ie.prototype._checkConsistency=function(e){we.isUndefined(this._changeIndex)||(Fr.checkState(this._changeScript,"Change script is expected."),Fr.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),Fr.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&Fr.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")};ie.prototype.lockUntilDate=function(e){if(Fr.checkArgument(e),we.isNumber(e)&&e<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Ar.Transaction.LockTimeTooEarly;we.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Or.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Or.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.lockUntilBlockHeight=function(e){if(Fr.checkArgument(we.isNumber(e)),e>=ie.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new Ar.Transaction.BlockHeightTooHigh;if(e<0)throw new Ar.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===Or.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=Or.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this};ie.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<ie.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null};ie.prototype.fromString=function(e){this.fromBuffer(l7.Buffer.from(e,"hex"))};ie.prototype._newTransaction=function(){this.version=S7,this.nLockTime=w7};ie.prototype.from=function(e,t,r){if(we.isArray(e)){var i=this;return we.each(e,function(o){i.from(o,t,r)}),this}var n=we.some(this.inputs,function(o){return o.prevTxId.toString("hex")===e.txId&&o.outputIndex===e.outputIndex});return n?this:(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e),this)};ie.prototype._fromNonP2SH=function(e){var t;e=new yk(e),e.script.isPublicKeyHashOutPrefix()?t=p7:e.script.isPublicKeyOut()?t=g7:t=Or,this.addInput(new t({output:new An({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Jn.empty()}))};ie.prototype._fromMultisigUtxo=function(e,t,r){Fr.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys");var i;if(e=new yk(e),e.script.isMultisigOut())i=v7;else if(e.script.isScriptHashOut())i=m7;else throw new Ar.Transaction.Input.UnsupportedScript(e.script.toString());this.addInput(new i({output:new An({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:Jn.empty()},t,r))};ie.prototype.addInput=function(e,t,r){if(Fr.checkArgumentType(e,Or,"input"),!e.output&&(we.isUndefined(t)||we.isUndefined(r)))throw new Ar.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!e.output&&t&&!we.isUndefined(r)&&(t=t instanceof Jn?t:new Jn(t),Fr.checkArgumentType(r,"number","satoshis"),e.output=new An({script:t,satoshis:r})),this.uncheckedAddInput(e)};ie.prototype.uncheckedAddInput=function(e){return Fr.checkArgumentType(e,Or,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this};ie.prototype.hasAllUtxoInfo=function(){return we.every(this.inputs.map(function(e){return!!e.output}))};ie.prototype.fee=function(e){return Fr.checkArgument(we.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this};ie.prototype.feePerKb=function(e){return Fr.checkArgument(we.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this};ie.prototype.change=function(e){return Fr.checkArgument(e,"address is required"),this._changeScript=Jn.fromAddress(e),this._updateChangeOutput(),this};ie.prototype.getChangeOutput=function(){return we.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]};ie.prototype.to=function(e,t){if(we.isArray(e)){var r=this;return we.each(e,function(i){r.to(i.address,i.satoshis)}),this}return Fr.checkArgument(pk.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new An({script:Jn(new d7(e)),satoshis:t})),this};ie.prototype.addData=function(e){return this.addOutput(new An({script:Jn.buildDataOut(e),satoshis:0})),this};ie.prototype.addSafeData=function(e){return this.addOutput(new An({script:Jn.buildSafeDataOut(e),satoshis:0})),this};ie.prototype.addOutput=function(e){return Fr.checkArgumentType(e,An,"output"),this._addOutput(e),this._updateChangeOutput(),this};ie.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this};ie.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0};ie.prototype._getOutputAmount=function(){if(we.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,we.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount};ie.prototype._getInputAmount=function(){if(we.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,we.each(this.inputs,function(t){if(we.isUndefined(t.output))throw new Ar.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount};ie.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),we.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new An({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue(),t=this.getFee(),r=e-t;this._removeOutput(this._changeIndex),this._changeIndex=void 0,r>=ie.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new An({script:this._changeScript,satoshis:r})))}};ie.prototype.getFee=function(){return this.isCoinbase()?0:we.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee};ie.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||ie.FEE_PER_KB))};ie.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()};ie.prototype._clearSignatures=function(){we.each(this.inputs,function(e){e.clearSignatures!==Or.prototype.clearSignatures&&e.clearSignatures()})};ie.prototype._estimateSize=function(){var e=8;return e+=dk(this.inputs.length).toBuffer().length,e+=dk(this.outputs.length).toBuffer().length,we.each(this.inputs,function(t){e+=t._estimateSize()}),we.each(this.outputs,function(t){e+=t.getSize()}),e};ie.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=we.without(this.outputs,t),this._outputAmount=void 0};ie.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()};ie.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.prevTxId.compare(i.prevTxId)||r.outputIndex-i.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(r,i){return r.satoshis-i.satoshis||r.script.toBuffer().compare(i.script.toBuffer())}),t}),this};ie.prototype.shuffleOutputs=function(){return this.sortOutputs(we.shuffle)};ie.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)};ie.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this};ie.prototype._newOutputOrder=function(e){var t=this.outputs.length!==e.length||we.difference(this.outputs,e).length!==0;if(t)throw new Ar.Transaction.InvalidSorting;if(!we.isUndefined(this._changeIndex)){var r=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(r)}return this.outputs=e,this};ie.prototype.removeInput=function(e,t){var r;if(!t&&we.isNumber(e)?r=e:r=we.findIndex(this.inputs,function(n){return n.prevTxId.toString("hex")===e&&n.outputIndex===t}),r<0||r>=this.inputs.length)throw new Ar.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=we.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()};ie.prototype.sign=function(e,t){Fr.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return we.isArray(e)?(we.each(e,function(i){r.sign(i,t)}),this):(we.each(this.getSignatures(e,t),function(i){r.applySignature(i)}),this)};ie.prototype.getSignatures=function(e,t){e=new y7(e),t=t||Og.SIGHASH_ALL|Og.SIGHASH_FORKID;var r=this,i=[],n=mk.sha256ripemd160(e.publicKey.toBuffer());return we.each(this.inputs,function(a,s){we.each(a.getSignatures(r,e,s,t,n),function(u){i.push(u)})}),i};ie.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this};ie.prototype.isFullySigned=function(){return we.each(this.inputs,function(e){if(e.isFullySigned===Or.prototype.isFullySigned)throw new Ar.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),we.every(we.map(this.inputs,function(e){return e.isFullySigned()}))};ie.prototype.isValidSignature=function(e){var t=this;if(this.inputs[e.inputIndex].isValidSignature===Or.prototype.isValidSignature)throw new Ar.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(t,e)};ie.prototype.verifySignature=function(e,t,r,i,n,o){return vk.verify(this,e,t,r,i,n,o)};ie.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var e=new Ig(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new Ig(ie.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if(e=e.add(r._satoshisBN),e.gt(new Ig(ie.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>E7)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var n=this.inputs[t],o=n.prevTxId+":"+n.outputIndex;if(!we.isUndefined(i[o]))return"transaction input "+t+" duplicate input";i[o]=!0}var a=this.isCoinbase();if(a){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0};ie.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()};ie.prototype.sighash=function(e,t,r,i,n){t=t||Og.SIGHASH_ALL|Og.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new Ig(o.output.satoshis)),n=n||_7,vk.sighash(this,t,e,r,i,n)};_k.exports=ie});var At=R((Fne,Hs)=>{p();Hs.exports=kb();Hs.exports.Input=Xn();Hs.exports.Output=oi();Hs.exports.UnspentOutput=Bb();Hs.exports.Signature=_c();Hs.exports.Sighash=ai()});var tn=R((Hne,Ek)=>{"use strict";p();var Ag=Ve(),Cl=vb(),j=xr(),ye=Ge(),Nl=ke(),Na=at(),Cb=Kt();function Sk(e){return e.map(function(t){return l.Buffer.isBuffer(t)?l.Buffer.from(t):t})}var U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n,o){var a=At();if(Ag.isUndefined(r)&&(r=new a),Ag.isUndefined(i)&&(i=0),Ag.isUndefined(n)&&(n=U.currentConsensusFlags(),o||(n&=~U.SCRIPT_ENABLE_SIGHASH_FORKID)),n&U.SCRIPT_ENABLE_SIGHASH_FORKID&&(n|=U.SCRIPT_VERIFY_STRICTENC,!o))throw new Error("internal error - need satoshisBN to verify FORKID transactions");this.set({script:e,tx:r,nin:i,flags:n,satoshisBN:o});var s;if((n&U.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;var u=(n&U.SCRIPT_VERIFY_P2SH)!==0&&(n&U.SCRIPT_UTXO_AFTER_GENESIS)===0;u&&(s=this.stack.slice());var c=this.stack;if(this.initialize(),this.set({script:t,stack:c,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var f=this.stack[this.stack.length-1];if(!U.castToBool(f))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(u&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(s.length===0)throw new Error("internal error - stack copy empty");var d=s[s.length-1],m=Cl.fromBuffer(d);if(s.pop(),this.initialize(),this.set({script:m,stack:s,tx:r,nin:i,flags:n,satoshisBN:o}),!this.evaluate())return!1;if(s.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!U.castToBool(s[s.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if((n&U.SCRIPT_VERIFY_CLEANSTACK)!==0){if((n&U.SCRIPT_VERIFY_P2SH)===0&&(n&U.SCRIPT_UTXO_AFTER_GENESIS)===0)throw new Error("internal error - CLEANSTACK without P2SH");if(this.stack.length!==1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0};Ek.exports=U;U.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.returned=!1,this.nonTopLevelReturnAfterGenesis=!1,this.vfExec=[],this.vfElse=[],this.errstr="",this.flags=0};U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=typeof e.nin<"u"?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=typeof e.pc<"u"?e.pc:this.pc,this.pbegincodehash=typeof e.pbegincodehash<"u"?e.pbegincodehash:this.pbegincodehash,this.nOpCount=typeof e.nOpCount<"u"?e.nOpCount:this.nOpCount,this.returned=typeof e.returned<"u"?e.returned:this.returned,this.nonTopLevelReturnAfterGenesis=typeof e.nonTopLevelReturnAfterGenesis<"u"?e.nonTopLevelReturnAfterGenesis:this.nonTopLevelReturnAfterGenesis,this.vfExec=e.vfExec||this.vfExec,this.vfElse=e.vfElse||this.vfElse,this.errstr=e.errstr||this.errstr,this.flags=typeof e.flags<"u"?e.flags:this.flags};U.true=l.Buffer.from([1]);U.false=l.Buffer.from([]);U.MAX_SCRIPT_ELEMENT_SIZE=520;U.MAXIMUM_ELEMENT_SIZE=4;U.MAX_OPS_PER_SCRIPT=500;U.MAX_SCRIPT_SIZE=1e4;U.UNLIMITED=Number.MAX_SAFE_INTEGER;U.MAX_SCRIPT_NUM_LENGTH_AFTER_GENESIS=75e4;U.MAX_SCRIPT_NUM_LENGTH_AFTER_CHRONICLE=32e6;U.MAX_PUBKEYS_PER_MULTISIG_AFTER_GENESIS=4294967295;U.LOCKTIME_THRESHOLD=5e8;U.LOCKTIME_THRESHOLD_BN=new ye(U.LOCKTIME_THRESHOLD);U.useGenesisLimits=function(e){return e=e||2147483647,U.MAX_SCRIPT_ELEMENT_SIZE=e,U.MAX_OPS_PER_SCRIPT=e,U.MAX_SCRIPT_SIZE=e,U};U.getLimits=function(){return{maxScriptElementSize:U.MAX_SCRIPT_ELEMENT_SIZE,maximumElementSize:U.MAXIMUM_ELEMENT_SIZE,maxOpsPerScript:U.MAX_OPS_PER_SCRIPT,maxScriptSize:U.MAX_SCRIPT_SIZE}};U.setLimits=function(e){return e=e||{},e.maxScriptElementSize!=null&&(U.MAX_SCRIPT_ELEMENT_SIZE=e.maxScriptElementSize),e.maximumElementSize!=null&&(U.MAXIMUM_ELEMENT_SIZE=e.maximumElementSize),e.maxOpsPerScript!=null&&(U.MAX_OPS_PER_SCRIPT=e.maxOpsPerScript),e.maxScriptSize!=null&&(U.MAX_SCRIPT_SIZE=e.maxScriptSize),U};U.SCRIPT_VERIFY_NONE=0;U.SCRIPT_VERIFY_P2SH=1;U.SCRIPT_VERIFY_STRICTENC=2;U.SCRIPT_VERIFY_DERSIG=4;U.SCRIPT_VERIFY_LOW_S=8;U.SCRIPT_VERIFY_NULLDUMMY=16;U.SCRIPT_VERIFY_SIGPUSHONLY=32;U.SCRIPT_VERIFY_MINIMALDATA=64;U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;U.SCRIPT_VERIFY_CLEANSTACK=256;U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;U.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;U.SCRIPT_VERIFY_MINIMALIF=8192;U.SCRIPT_VERIFY_NULLFAIL=16384;U.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768;U.SCRIPT_ENABLE_SIGHASH_FORKID=65536;U.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17;U.SCRIPT_ENABLE_MONOLITH_OPCODES=2048;U.SCRIPT_ENABLE_MAGNETIC_OPCODES=4096;U.SCRIPT_GENESIS=1<<18;U.SCRIPT_UTXO_AFTER_GENESIS=1<<19;U.SCRIPT_ENABLE_CHRONICLE=1<<20;U.SCRIPT_CHRONICLE=U.SCRIPT_ENABLE_CHRONICLE;U.SCRIPT_UTXO_AFTER_CHRONICLE=1<<21;U.CHRONICLE_ACTIVATION_HEIGHT=943816;U.mainnetFlags=function(e){e=e||{};var t=U.SCRIPT_VERIFY_P2SH|U.SCRIPT_VERIFY_STRICTENC|U.SCRIPT_VERIFY_DERSIG|U.SCRIPT_VERIFY_LOW_S|U.SCRIPT_VERIFY_NULLFAIL|U.SCRIPT_VERIFY_MINIMALDATA|U.SCRIPT_ENABLE_SIGHASH_FORKID|U.SCRIPT_ENABLE_MAGNETIC_OPCODES|U.SCRIPT_ENABLE_MONOLITH_OPCODES|U.SCRIPT_GENESIS|U.SCRIPT_UTXO_AFTER_GENESIS;return e.afterChronicle!==!1&&(t|=U.SCRIPT_ENABLE_CHRONICLE|U.SCRIPT_UTXO_AFTER_CHRONICLE),t};U.currentConsensusFlags=function(){return U.SCRIPT_ENABLE_MONOLITH_OPCODES|U.SCRIPT_ENABLE_MAGNETIC_OPCODES|U.SCRIPT_GENESIS|U.SCRIPT_UTXO_AFTER_GENESIS|U.SCRIPT_ENABLE_CHRONICLE|U.SCRIPT_UTXO_AFTER_CHRONICLE|U.SCRIPT_ENABLE_SIGHASH_FORKID};U.useMainnetConsensus=function(e){return e=e||{},U.useGenesisLimits(e.max),U.mainnetFlags(e)};U.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;U.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;U.SEQUENCE_LOCKTIME_MASK=65535;U.castToBool=function(e){for(var t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1};U.prototype.checkSignatureEncoding=function(e){var t;if(e.length===0)return!0;if((this.flags&(U.SCRIPT_VERIFY_DERSIG|U.SCRIPT_VERIFY_LOW_S|U.SCRIPT_VERIFY_STRICTENC))!==0&&!Na.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if((this.flags&U.SCRIPT_VERIFY_LOW_S)!==0){if(t=Na.fromTxFormat(e),!t.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if((this.flags&U.SCRIPT_VERIFY_STRICTENC)!==0){if(t=Na.fromTxFormat(e),!t.hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&U.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&Na.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(!(this.flags&U.SCRIPT_CHRONICLE)&&t.nhashtype&Na.SIGHASH_CHRONICLE)return this.errstr="SCRIPT_ERR_ILLEGAL_CHRONICLE",!1;if(this.flags&U.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&Na.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0};U.prototype.checkPubkeyEncoding=function(e){return(this.flags&U.SCRIPT_VERIFY_STRICTENC)!==0&&!Cb.isValid(e)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):!0};U.prototype.isAfterGenesis=function(){return(this.flags&U.SCRIPT_UTXO_AFTER_GENESIS)!==0};U.prototype.isAfterChronicle=function(){return(this.flags&(U.SCRIPT_UTXO_AFTER_CHRONICLE|U.SCRIPT_ENABLE_CHRONICLE))!==0};U.prototype.maxScriptElementSize=function(){return this.isAfterGenesis()?U.UNLIMITED:U.MAX_SCRIPT_ELEMENT_SIZE};U.prototype.maxScriptSize=function(){return this.isAfterGenesis()?U.UNLIMITED:U.MAX_SCRIPT_SIZE};U.prototype.maxOpsPerScript=function(){return this.isAfterGenesis()?U.UNLIMITED:U.MAX_OPS_PER_SCRIPT};U.prototype.maxScriptNumLength=function(){return this.isAfterChronicle()?U.MAX_SCRIPT_NUM_LENGTH_AFTER_CHRONICLE:this.isAfterGenesis()?U.MAX_SCRIPT_NUM_LENGTH_AFTER_GENESIS:U.MAXIMUM_ELEMENT_SIZE};U.prototype.maxPubKeysPerMultisig=function(){return this.isAfterGenesis()?U.MAX_PUBKEYS_PER_MULTISIG_AFTER_GENESIS:20};U._isMinimallyEncoded=function(e,t){return t=t||U.MAXIMUM_ELEMENT_SIZE,!(e.length>t||e.length>0&&(e[e.length-1]&127)===0&&(e.length<=1||(e[e.length-2]&128)===0))};U._minimallyEncode=function(e){if(e.length===0)return e;var t=e[e.length-1];if(t&127)return e;if(e.length===1)return l.Buffer.from("");if(e[e.length-2]&128)return e;for(var r=e.length-1;r>0;r--)if(e[r-1]!==0)return e[r-1]&128?e[r++]=t:e[r-1]|=t,e.slice(0,r);return l.Buffer.from("")};U.prototype.evaluate=function(){if(this.script.toBuffer().length>this.maxScriptSize())return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:j.fromNumber(this.script.chunks[this.pc].opcodenum)};var e=this.step();if(!e)return!1;if(this._callbackStep(t),this.returned)return!0}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr=t.scriptErr||"SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0};U.prototype._callbackStep=function(e){if(typeof this.stepListener=="function")try{this.stepListener(e,Sk(this.stack),Sk(this.altstack))}catch(t){console.log(`Error in Step callback:${t}`)}};U.prototype.checkLockTime=function(e){if(!(this.tx.nLockTime<U.LOCKTIME_THRESHOLD&&e.lt(U.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))||e.gt(new ye(this.tx.nLockTime)))return!1;var t=this.tx.inputs[this.nin];return!(!t||t.isFinal())};U.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin];if(!t)return!1;var r=t.sequenceNumber;if(this.tx.version<2||r&U.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var i=U.SEQUENCE_LOCKTIME_TYPE_FLAG|U.SEQUENCE_LOCKTIME_MASK,n=new ye(r&i),o=e.and(new ye(i)),a=new ye(U.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(n.lt(a)&&o.lt(a)||n.gte(a)&&o.gte(a))||o.gt(n))};function x7(e,t){let r=e;for(;r.length<t;)r=l.Buffer.concat([l.Buffer.from([0]),r]);return r}function wk(e){var t=l.Buffer.alloc(4);return t.writeInt32LE(e|0,0),t}U.prototype.step=function(){var e=this;function t(le){return e.stack[e.stack.length+le]}function r(le){switch(le){case j.OP_2MUL:case j.OP_2DIV:if(!e.isAfterChronicle())return!0;break;case j.OP_INVERT:case j.OP_MUL:case j.OP_LSHIFT:case j.OP_RSHIFT:if((e.flags&U.SCRIPT_ENABLE_MAGNETIC_OPCODES)===0)return!0;break;case j.OP_DIV:case j.OP_MOD:case j.OP_SPLIT:case j.OP_CAT:case j.OP_AND:case j.OP_OR:case j.OP_XOR:case j.OP_BIN2NUM:case j.OP_NUM2BIN:return!1;default:break}return!1}var i=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA)!==0,n,o,a,s,u,c,f,d,m,y,w,T,B,C,q,F,P,k=this.script.chunks[this.pc];this.pc++;var M=k.opcodenum,K=this.vfExec.indexOf(!1)===-1&&(!this.nonTopLevelReturnAfterGenesis||M===j.OP_RETURN);if(Ag.isUndefined(M))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(k.buf&&k.buf.length>this.maxScriptElementSize())return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(M>j.OP_16&&++this.nOpCount>this.maxOpsPerScript())return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(r(M)&&(!this.isAfterGenesis()||K))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(K&&M>=0&&M<=j.OP_PUSHDATA4){if(i&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!k.buf)this.stack.push(U.false);else{if(k.len!==k.buf.length)return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1;this.stack.push(k.buf)}}else if(K||j.OP_IF<=M&&M<=j.OP_ENDIF)switch(M){case j.OP_1NEGATE:case j.OP_1:case j.OP_2:case j.OP_3:case j.OP_4:case j.OP_5:case j.OP_6:case j.OP_7:case j.OP_8:case j.OP_9:case j.OP_10:case j.OP_11:case j.OP_12:case j.OP_13:case j.OP_14:case j.OP_15:case j.OP_16:u=M-(j.OP_1-1),n=new ye(u).toScriptNumBuffer(),this.stack.push(n);break;case j.OP_NOP:break;case j.OP_NOP2:case j.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)||this.isAfterGenesis()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var z=ye.fromScriptNumBuffer(this.stack[this.stack.length-1],i,5);if(z.lt(new ye(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(z))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case j.OP_NOP3:case j.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)||this.isAfterGenesis()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var V=ye.fromScriptNumBuffer(t(-1),i,5);if(V.lt(new ye(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((V&U.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(V))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case j.OP_NOP1:case j.OP_NOP9:case j.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case j.OP_LSHIFTNUM:case j.OP_RSHIFTNUM:if(!this.isAfterChronicle()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var x=this.maxScriptNumLength(),h=ye.fromScriptNumBuffer(t(-1),i,x);if(h.isNeg())return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop();var v=ye.fromScriptNumBuffer(t(-1),i,x);this.stack.pop();var b=h.toNumber(),S=v.isNeg(),E=v.abs(),A;if(M===j.OP_LSHIFTNUM){var N=v.toScriptNumBuffer().length;if(N+Math.floor(b/8)>x)return this.errstr="SCRIPT_ERR_SCRIPTNUM_OVERFLOW",!1;A=E.shln(b)}else A=b>=E.bitLength()?new ye(0):E.shrn(b);if(S&&!A.isZero()&&(A=A.neg()),A.toScriptNumBuffer().length>x)return this.errstr="SCRIPT_ERR_SCRIPTNUM_OVERFLOW",!1;this.stack.push(A.toScriptNumBuffer());break;case j.OP_VER:if(!this.isAfterChronicle())return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1;if(this.tx==null)return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR",!1;this.stack.push(wk(this.tx.version));break;case j.OP_VERIF:case j.OP_VERNOTIF:if(!this.isAfterChronicle()){if(this.isAfterGenesis()&&!K)break;return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}if(F=!1,K){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(this.tx==null)return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR",!1;n=t(-1),F=n.length===4&&n.equals(wk(this.tx.version)),M===j.OP_VERNOTIF&&(F=!F),this.stack.pop()}this.vfExec.push(F),this.vfElse.push(!1);break;case j.OP_IF:case j.OP_NOTIF:if(F=!1,K){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(n=t(-1),this.flags&U.SCRIPT_VERIFY_MINIMALIF){if(n.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(n.length===1&&n[0]!==1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}F=U.castToBool(n),M===j.OP_NOTIF&&(F=!F),this.stack.pop()}this.vfExec.push(F),this.vfElse.push(!1);break;case j.OP_ELSE:if(this.vfExec.length===0||this.vfElse[this.vfElse.length-1]&&this.isAfterGenesis())return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1],this.vfElse[this.vfElse.length-1]=!0;break;case j.OP_ENDIF:if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop(),this.vfElse.pop();break;case j.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(n=t(-1),F=U.castToBool(n),F)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1;break;case j.OP_RETURN:if(this.isAfterGenesis()){if(this.vfExec.length===0){this.returned=!0;break}this.nonTopLevelReturnAfterGenesis=!0;break}return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case j.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case j.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case j.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case j.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-2),a=t(-1),this.stack.push(l.Buffer.from(o)),this.stack.push(l.Buffer.from(a));break;case j.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-3),a=t(-2);var I=t(-1);this.stack.push(l.Buffer.from(o)),this.stack.push(l.Buffer.from(a)),this.stack.push(l.Buffer.from(I));break;case j.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-4),a=t(-3),this.stack.push(l.Buffer.from(o)),this.stack.push(l.Buffer.from(a));break;case j.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;s=this.stack.splice(this.stack.length-6,2),this.stack.push(s[0]),this.stack.push(s[1]);break;case j.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;s=this.stack.splice(this.stack.length-4,2),this.stack.push(s[0]),this.stack.push(s[1]);break;case j.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-1),F=U.castToBool(n),F&&this.stack.push(l.Buffer.from(n));break;case j.OP_DEPTH:n=new ye(this.stack.length).toScriptNumBuffer(),this.stack.push(n);break;case j.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case j.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(l.Buffer.from(t(-1)));break;case j.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case j.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(l.Buffer.from(t(-2)));break;case j.OP_PICK:case j.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(n=t(-1),d=ye.fromScriptNumBuffer(n,i,this.maxScriptNumLength()),u=d.toNumber(),this.stack.pop(),u<0||u>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-u-1),M===j.OP_ROLL&&this.stack.splice(this.stack.length-u-1,1),this.stack.push(l.Buffer.from(n));break;case j.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;c=t(-3),f=t(-2);var g=t(-1);this.stack[this.stack.length-3]=f,this.stack[this.stack.length-2]=g,this.stack[this.stack.length-1]=c;break;case j.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;c=t(-2),f=t(-1),this.stack[this.stack.length-2]=f,this.stack[this.stack.length-1]=c;break;case j.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,l.Buffer.from(t(-1)));break;case j.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=new ye(t(-1).length),this.stack.push(d.toScriptNumBuffer());break;case j.OP_AND:case j.OP_OR:case j.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),a=t(-1),o.length!==a.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(M){case j.OP_AND:for(let le=0;le<o.length;le++)o[le]&=a[le];break;case j.OP_OR:for(let le=0;le<o.length;le++)o[le]|=a[le];break;case j.OP_XOR:for(let le=0;le<o.length;le++)o[le]^=a[le];break;default:break}this.stack.pop();break;case j.OP_INVERT:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-1);for(let le=0;le<n.length;le++)n[le]=~n[le];break;case j.OP_LSHIFT:case j.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),o.length===0)this.stack.pop();else{if(m=new ye(o),y=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()),u=y.toNumber(),u<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop();let le;M===j.OP_LSHIFT&&(le=m.ushln(u)),M===j.OP_RSHIFT&&(le=m.ushrn(u));let Te=x7(l.Buffer.from(le.toArray().slice(o.length*-1)),o.length);this.stack.push(Te)}break;case j.OP_EQUAL:case j.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-2),a=t(-1);var O=o.toString("hex")===a.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(O?U.true:U.false),M===j.OP_EQUALVERIFY)if(O)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;break;case j.OP_2MUL:case j.OP_2DIV:case j.OP_1ADD:case j.OP_1SUB:case j.OP_NEGATE:case j.OP_ABS:case j.OP_NOT:case j.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(n=t(-1),d=ye.fromScriptNumBuffer(n,i,this.maxScriptNumLength()),M){case j.OP_2MUL:d=d.mul(new ye(2));break;case j.OP_2DIV:d=d.div(new ye(2));break;case j.OP_1ADD:d=d.add(ye.One);break;case j.OP_1SUB:d=d.sub(ye.One);break;case j.OP_NEGATE:d=d.neg();break;case j.OP_ABS:d.cmp(ye.Zero)<0&&(d=d.neg());break;case j.OP_NOT:d=new ye((d.cmp(ye.Zero)===0)+0);break;case j.OP_0NOTEQUAL:d=new ye((d.cmp(ye.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(d.toScriptNumBuffer());break;case j.OP_ADD:case j.OP_SUB:case j.OP_MUL:case j.OP_MOD:case j.OP_DIV:case j.OP_BOOLAND:case j.OP_BOOLOR:case j.OP_NUMEQUAL:case j.OP_NUMEQUALVERIFY:case j.OP_NUMNOTEQUAL:case j.OP_LESSTHAN:case j.OP_GREATERTHAN:case j.OP_LESSTHANOREQUAL:case j.OP_GREATERTHANOREQUAL:case j.OP_MIN:case j.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(m=ye.fromScriptNumBuffer(t(-2),i,this.maxScriptNumLength()),y=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()),d=new ye(0),M){case j.OP_ADD:d=m.add(y);break;case j.OP_SUB:d=m.sub(y);break;case j.OP_MUL:d=m.mul(y);break;case j.OP_DIV:if(y.cmp(ye.Zero)===0)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;d=m.div(y);break;case j.OP_MOD:if(y.cmp(ye.Zero)===0)return this.errstr="SCRIPT_ERR_MOD_BY_ZERO",!1;d=m.mod(y);break;case j.OP_BOOLAND:d=new ye((m.cmp(ye.Zero)!==0&&y.cmp(ye.Zero)!==0)+0);break;case j.OP_BOOLOR:d=new ye((m.cmp(ye.Zero)!==0||y.cmp(ye.Zero)!==0)+0);break;case j.OP_NUMEQUAL:d=new ye((m.cmp(y)===0)+0);break;case j.OP_NUMEQUALVERIFY:d=new ye((m.cmp(y)===0)+0);break;case j.OP_NUMNOTEQUAL:d=new ye((m.cmp(y)!==0)+0);break;case j.OP_LESSTHAN:d=new ye((m.cmp(y)<0)+0);break;case j.OP_GREATERTHAN:d=new ye((m.cmp(y)>0)+0);break;case j.OP_LESSTHANOREQUAL:d=new ye((m.cmp(y)<=0)+0);break;case j.OP_GREATERTHANOREQUAL:d=new ye((m.cmp(y)>=0)+0);break;case j.OP_MIN:d=m.cmp(y)<0?m:y;break;case j.OP_MAX:d=m.cmp(y)>0?m:y;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(d.toScriptNumBuffer()),M===j.OP_NUMEQUALVERIFY)if(U.castToBool(t(-1)))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;break;case j.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=ye.fromScriptNumBuffer(t(-3),i,this.maxScriptNumLength()),y=ye.fromScriptNumBuffer(t(-2),i,this.maxScriptNumLength());var ee=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength());F=y.cmp(m)<=0&&m.cmp(ee)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(F?U.true:U.false);break;case j.OP_RIPEMD160:case j.OP_SHA1:case j.OP_SHA256:case j.OP_HASH160:case j.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;n=t(-1);var X;M===j.OP_RIPEMD160?X=Nl.ripemd160(n):M===j.OP_SHA1?X=Nl.sha1(n):M===j.OP_SHA256?X=Nl.sha256(n):M===j.OP_HASH160?X=Nl.sha256ripemd160(n):M===j.OP_HASH256&&(X=Nl.sha256sha256(n)),this.stack.pop(),this.stack.push(X);break;case j.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case j.OP_CHECKSIG:case j.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(w=t(-2),T=t(-1),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(T))return!1;B=new Cl().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var ne=new Cl().add(w);B.findAndDelete(ne);try{C=Na.fromTxFormat(w),q=Cb.fromBuffer(T,!1),P=this.tx.verifySignature(C,q,this.nin,B,this.satoshisBN,this.flags)}catch{P=!1}if(!P&&this.flags&U.SCRIPT_VERIFY_NULLFAIL&&w.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(P?U.true:U.false),M===j.OP_CHECKSIGVERIFY)if(P)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;break;case j.OP_CHECKMULTISIG:case j.OP_CHECKMULTISIGVERIFY:var oe=1;if(this.stack.length<oe)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var ue=ye.fromScriptNumBuffer(t(-oe),i,this.maxScriptNumLength()).toNumber();if(ue<0||ue>this.maxPubKeysPerMultisig())return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=ue,this.nOpCount>U.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var ge=++oe;oe+=ue;var Ie=ue+2;if(this.stack.length<oe)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var _e=ye.fromScriptNumBuffer(t(-oe),i,this.maxScriptNumLength()).toNumber();if(_e<0||_e>ue)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var L=++oe;if(oe+=_e,this.stack.length<oe)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;B=new Cl().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var G=0;G<_e;G++)w=t(-L-G),B.findAndDelete(new Cl().add(w));for(P=!0;P&&_e>0;){if(w=t(-L),T=t(-ge),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(T))return!1;var Q;try{C=Na.fromTxFormat(w),q=Cb.fromBuffer(T,!1),Q=this.tx.verifySignature(C,q,this.nin,B,this.satoshisBN,this.flags)}catch{Q=!1}Q&&(L++,_e--),ge++,ue--,_e>ue&&(P=!1)}for(;oe-- >1;){if(!P&&this.flags&U.SCRIPT_VERIFY_NULLFAIL&&!Ie&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;Ie>0&&Ie--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&U.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(P?U.true:U.false),M===j.OP_CHECKMULTISIGVERIFY)if(P)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;break;case j.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),a=t(-1),o.length+a.length>this.maxScriptElementSize())return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=l.Buffer.concat([o,a]),this.stack.pop();break;case j.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-2);var re=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber();if(re<0||re>o.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var de=l.Buffer.from(o);this.stack[this.stack.length-2]=de.slice(0,re),this.stack[this.stack.length-1]=de.slice(re);break;case j.OP_LEFT:case j.OP_RIGHT:if(!this.isAfterChronicle()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-2),u=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber(),u<0||u>o.length)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),M===j.OP_LEFT?this.stack[this.stack.length-1]=l.Buffer.from(o).slice(0,u):this.stack[this.stack.length-1]=l.Buffer.from(o).slice(o.length-u);break;case j.OP_SUBSTR:if(!this.isAfterChronicle()){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;o=t(-3);var ce=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber(),fe=ye.fromScriptNumBuffer(t(-2),i,this.maxScriptNumLength()).toNumber();if(fe<0||fe>=o.length||ce<0||ce>o.length-fe)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=l.Buffer.from(o).slice(fe,fe+ce);break;case j.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Se=ye.fromScriptNumBuffer(t(-1),i,this.maxScriptNumLength()).toNumber();if(Se<0||Se>this.maxScriptElementSize())return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var pe=t(-1);if(pe=U._minimallyEncode(pe),pe.length>Se)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(pe.length===Se){this.stack[this.stack.length-1]=pe;break}var me=0;pe.length>0&&(me=pe[pe.length-1]&128,pe[pe.length-1]&=127);var xt=l.Buffer.alloc(Se);pe.copy(xt,0);for(var $e=pe.length-1;$e++<Se-2;)xt[$e]=0;xt[$e]=me,this.stack[this.stack.length-1]=xt;break;case j.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(o=t(-1),a=U._minimallyEncode(o),this.stack[this.stack.length-1]=a,!U._isMinimallyEncoded(a))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}});var Ze=R((zne,Lb)=>{p();Lb.exports=vb();Lb.exports.Interpreter=tn()});var Si=R((Vne,Ak)=>{"use strict";p();var Mb=Ve(),Jo=Oe(),I7=ti(),xk=lc(),rn=Wo(),Ik=ke(),Ok=Gr(),Db=Kt();function he(e,t,r){if(!(this instanceof he))return new he(e,t,r);if(Mb.isArray(e)&&Mb.isNumber(t))return he.createMultisig(e,t,r);if(e instanceof he)return e;if(Jo.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!rn.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==he.PayToPublicKeyHash&&r!==he.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||rn.get(t)||rn.defaultNetwork,i.type=i.type||r||he.PayToPublicKeyHash,Ok.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}he.prototype._classifyArguments=function(e,t,r){if((e instanceof l.Buffer||e instanceof Uint8Array)&&e.length===20)return he._transformHash(e);if((e instanceof l.Buffer||e instanceof Uint8Array)&&e.length===21)return he._transformBuffer(e,t,r);if(e instanceof Db)return he._transformPublicKey(e);if(e instanceof Ll())return he._transformScript(e,t);if(typeof e=="string")return he._transformString(e,t,r);if(Mb.isObject(e))return he._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")};he.PayToPublicKeyHash="pubkeyhash";he.PayToScriptHash="scripthash";he._transformHash=function(e){var t={};if(!(e instanceof l.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==20)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t};he._transformObject=function(e){return Jo.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),Jo.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?l.Buffer.from(e.hash,"hex"):e.hashBuffer,network:rn.get(e.network)||rn.defaultNetwork,type:e.type}};he._classifyFromVersion=function(e){var t={},r=rn.get(e[0],"pubkeyhash"),i=rn.get(e[0],"scripthash");return r?(t.network=r,t.type=he.PayToPublicKeyHash):i&&(t.network=i,t.type=he.PayToScriptHash),t};he._transformBuffer=function(e,t,r){var i={};if(!(e instanceof l.Buffer)&&!(e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(e.length!==21)throw new TypeError("Address buffers must be exactly 21 bytes.");var n=rn.get(t),o=he._classifyFromVersion(e);if(t&&!n)throw new TypeError("Unknown network");if(!o.network||n&&n!==o.network)throw new TypeError("Address has mismatched network type.");if(!o.type||r&&r!==o.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=o.network,i.type=o.type,i};he._transformPublicKey=function(e){var t={};if(!(e instanceof Db))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=Ik.sha256ripemd160(e.toBuffer()),t.type=he.PayToPublicKeyHash,t};he._transformScript=function(e,t){Jo.checkArgument(e instanceof Ll(),"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new I7.Script.CantDeriveAddress(e);return r};he.createMultisig=function(e,t,r){return r=r||e[0].network||rn.defaultNetwork,he.payingTo(Ll().buildMultisigOut(e,t),r)};he._transformString=function(e,t,r){if(typeof e!="string")throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=rn.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=xk.decode(e);return he._transformBuffer(n,t,r)};he.fromPublicKey=function(e,t){var r=he._transformPublicKey(e);return t=t||rn.defaultNetwork,new he(r.hashBuffer,t,r.type)};he.fromPrivateKey=function(e,t){let r=Db.fromPrivateKey(e);return t=t||e.network||rn.defaultNetwork,he.fromPublicKey(r,t)};he.fromPublicKeyHash=function(e,t){var r=he._transformHash(e);return new he(r.hashBuffer,t,he.PayToPublicKeyHash)};he.fromScriptHash=function(e,t){Jo.checkArgument(e,"hash parameter is required");var r=he._transformHash(e);return new he(r.hashBuffer,t,he.PayToScriptHash)};he.payingTo=function(e,t){return Jo.checkArgument(e,"script is required"),Jo.checkArgument(e instanceof Ll(),"script must be instance of Script"),he.fromScriptHash(Ik.sha256ripemd160(e.toBuffer()),t)};he.fromScript=function(e,t){Jo.checkArgument(e instanceof Ll(),"script must be a Script instance");var r=he._transformScript(e,t);return new he(r.hashBuffer,t,r.type)};he.fromBuffer=function(e,t,r){var i=he._transformBuffer(e,t,r);return new he(i.hashBuffer,i.network,i.type)};he.fromHex=function(e,t,r){return he.fromBuffer(l.Buffer.from(e,"hex"),t,r)};he.fromString=function(e,t,r){var i=he._transformString(e,t,r);return new he(i.hashBuffer,i.network,i.type)};he.fromObject=function(t){Jo.checkState(Ok.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.');var r=l.Buffer.from(t.hash,"hex");return new he(r,t.network,t.type)};he.getValidationError=function(e,t,r){var i;try{new he(e,t,r)}catch(n){i=n}return i};he.isValid=function(e,t,r){return!he.getValidationError(e,t,r)};he.prototype.isPayToPublicKeyHash=function(){return this.type===he.PayToPublicKeyHash};he.prototype.isPayToScriptHash=function(){return this.type===he.PayToScriptHash};he.prototype.toBuffer=function(){var e=l.Buffer.from([this.network[this.type]]),t=l.Buffer.concat([e,this.hashBuffer]);return t};he.prototype.toHex=function(){return this.toBuffer().toString("hex")};he.prototype.toObject=he.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}};he.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"};he.prototype.toString=function(){return xk.encode(this.toBuffer())};Ak.exports=he;function Ll(){return Ze()}});var Ur=R((Wne,kk)=>{"use strict";p();var Tg=Ve(),O7=Si(),Tk=lc(),Ca=Ge(),Pk=Gr(),Qn=Wo(),Fb=$i(),A7=Kt(),T7=Ri(),Rk=Oe(),qb="[REDACTED]";function Ae(e,t){if(!(this instanceof Ae))return new Ae(e,t);if(e instanceof Ae)return e;var r=this._classifyArguments(e,t);if(!r.bn||r.bn.cmp(new Ca(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(Fb.getN()))throw new TypeError("Number must be less than N");if(typeof r.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return Pk.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}Ae.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?Qn.get(t):Qn.defaultNetwork};if(Tg.isUndefined(e)||Tg.isNull(e))r.bn=Ae._getRandomBN();else if(e instanceof Ca)r.bn=e;else if(e instanceof l.Buffer||e instanceof Uint8Array)r=Ae._transformBuffer(e,t);else if(e.bn&&e.network)r=Ae._transformObject(e);else if(!t&&Qn.get(e))r.bn=Ae._getRandomBN(),r.network=Qn.get(e);else if(typeof e=="string")Pk.isHexa(e)?r.bn=new Ca(l.Buffer.from(e,"hex")):r=Ae._transformWIF(e,t);else throw new TypeError("First argument is an unrecognized data type.");return r};Ae._getRandomBN=function(){var e,t;do{var r=T7.getRandomBuffer(32);t=Ca.fromBuffer(r),e=t.lt(Fb.getN())}while(!e);return t};Ae._transformBuffer=function(e,t){var r={};if(e.length===32)return Ae._transformBNBuffer(e,t);if(r.network=Qn.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==Qn.get(t))throw new TypeError("Private key network mismatch");if(e.length===34&&e[33]===1)r.compressed=!0;else if(e.length===33)r.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return r.bn=Ca.fromBuffer(e.slice(1,33)),r};Ae._transformBNBuffer=function(e,t,r){var i={};return i.network=Qn.get(t)||Qn.defaultNetwork,i.bn=Ca.fromBuffer(e),i.compressed=r===void 0?!0:!!r,i};Ae._transformWIF=function(e,t){return Ae._transformBuffer(Tk.decode(e),t)};Ae.fromBuffer=function(e,t,r){return r!==void 0&&e&&e.length===32?new Ae(Ae._transformBNBuffer(e,t,r)):new Ae(e,t)};Ae.fromHex=function(e,t,r){return Ae.fromBuffer(l.Buffer.from(e,"hex"),t,r)};Ae._transformObject=function(e){if(e.bn instanceof Ca)return{bn:e.bn,network:Qn.get(e.network),compressed:e.compressed};if(typeof e.bn!="string"||!e.bn.length)throw new TypeError("Invalid private key: `bn` must be a hex string");if(e.bn===qb)throw new TypeError('Invalid private key: `bn` is "'+qb+'". JSON.stringify() redacts the secret on purpose \u2014 use toObject() for a round-trippable export, or toWIF().');if(!/^[0-9a-fA-F]+$/.test(e.bn))throw new TypeError("Invalid private key: `bn` is not hexadecimal");var t=new Ca(e.bn,"hex");if(t.isZero()||t.gte(Fb.getN()))throw new TypeError("Invalid private key: outside the range of valid keys");var r=Qn.get(e.network);return{bn:t,network:r,compressed:e.compressed}};Ae.fromString=Ae.fromWIF=function(e,t){return Rk.checkArgument(Tg.isString(e),"First argument is expected to be a string."),new Ae(e,t)};Ae.fromObject=Ae.fromJSON=function(e){return Rk.checkArgument(Tg.isObject(e),"First argument is expected to be an object."),new Ae(e)};Ae.fromRandom=function(e){var t=Ae._getRandomBN();return new Ae(t,e)};Ae.getValidationError=function(e,t){var r;try{new Ae(e,t)}catch(i){r=i}return r};Ae.isValid=function(e,t){return e?!Ae.getValidationError(e,t):!1};Ae.prototype.toString=function(){return this.toWIF()};Ae.prototype.toWIF=function(){var e=this.network,t=this.compressed,r;return t?r=l.Buffer.concat([l.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32}),l.Buffer.from([1])]):r=l.Buffer.concat([l.Buffer.from([e.privatekey]),this.bn.toBuffer({size:32})]),Tk.encode(r)};Ae.prototype.toBigNumber=function(){return this.bn};Ae.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})};Ae.prototype.toHex=function(){return this.toBuffer().toString("hex")};Ae.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=A7.fromPrivateKey(this)),this._pubkey};Ae.prototype.toAddress=function(e){var t=this.toPublicKey();return O7.fromPublicKey(t,e||this.network)};Ae.prototype.toObject=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}};Ae.prototype.toJSON=function(){return{bn:qb,compressed:this.compressed,network:this.network.toString()}};Ae.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"};kk.exports=Ae});var Kt=R((Yne,Nk)=>{"use strict";p();var wc=Ge(),Ec=$i(),P7=ke(),R7=Gr(),Bk=Wo(),Ub=Ve(),js=Oe();function be(e,t){if(!(this instanceof be))return new be(e,t);if(js.checkArgument(e,"First argument is required, please include public key data."),e instanceof be)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),R7.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||Bk.defaultNetwork}),this}be.prototype._classifyArgs=function(e,t){var r={compressed:Ub.isUndefined(t.compressed)||t.compressed};if(e instanceof Ec)r.point=e;else if(e.x&&e.y)r=be._transformObject(e);else if(typeof e=="string")r=be._transformDER(l.Buffer.from(e,"hex"));else if(be._isBuffer(e))r=be._transformDER(e);else if(be._isPrivateKey(e))r=be._transformPrivateKey(e);else throw new TypeError("First argument is an unrecognized data format.");return r.network||(r.network=Ub.isUndefined(t.network)?void 0:Bk.get(t.network)),r};be._isPrivateKey=function(e){var t=Ur();return e instanceof t};be._isBuffer=function(e){return e instanceof l.Buffer||e instanceof Uint8Array};be._transformPrivateKey=function(e){js.checkArgument(be._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=Ec.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t};be._transformDER=function(e,t){js.checkArgument(be._isBuffer(e),"Must be a buffer of DER encoded public key");var r={};t=Ub.isUndefined(t)?!0:t;var i,n,o,a;if(e[0]===4||!t&&(e[0]===6||e[0]===7)){if(o=e.slice(1,33),a=e.slice(33,65),o.length!==32||a.length!==32||e.length!==65)throw new TypeError("Length of x and y must be 32 bytes");i=new wc(o),n=new wc(a),r.point=new Ec(i,n),r.compressed=!1}else if(e[0]===3)o=e.slice(1),i=new wc(o),r=be._transformX(!0,i),r.compressed=!0;else if(e[0]===2)o=e.slice(1),i=new wc(o),r=be._transformX(!1,i),r.compressed=!0;else throw new TypeError("Invalid DER format public key");return r};be._transformX=function(e,t){js.checkArgument(typeof e=="boolean","Must specify whether y is odd or not (true or false)");var r={};return r.point=Ec.fromX(e,t),r};be._transformObject=function(e){var t=new wc(e.x,"hex"),r=new wc(e.y,"hex"),i=new Ec(t,r);return new be(i,{compressed:e.compressed})};be.fromPrivateKey=function(e){js.checkArgument(be._isPrivateKey(e),"Must be an instance of PrivateKey");var t=be._transformPrivateKey(e);return new be(t.point,{compressed:t.compressed,network:t.network})};be.fromDER=be.fromBuffer=function(e,t){js.checkArgument(be._isBuffer(e),"Must be a buffer of DER encoded public key");var r=be._transformDER(e,t);return new be(r.point,{compressed:r.compressed})};be.fromPoint=function(e,t){return js.checkArgument(e instanceof Ec,"First argument must be an instance of Point."),new be(e,{compressed:t})};be.fromHex=be.fromString=function(e,t){var r=l.Buffer.from(e,t||"hex"),i=be._transformDER(r);return new be(i.point,{compressed:i.compressed})};be.fromX=function(e,t){var r=be._transformX(e,t);return new be(r.point,{compressed:r.compressed})};be.getValidationError=function(e){var t;try{new be(e)}catch(r){t=r}return t};be.isValid=function(e){return!be.getValidationError(e)};be.prototype.toObject=be.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}};be.prototype.toBuffer=be.prototype.toDER=function(){var e=this.point.getX(),t=this.point.getY(),r=e.toBuffer({size:32}),i=t.toBuffer({size:32}),n;if(this.compressed){var o=i[i.length-1]%2;return o?n=l.Buffer.from([3]):n=l.Buffer.from([2]),l.Buffer.concat([n,r])}else return n=l.Buffer.from([4]),l.Buffer.concat([n,r,i])};be.prototype._getID=function(){return P7.sha256ripemd160(this.toBuffer())};be.prototype.toAddress=function(e){var t=Si();return t.fromPublicKey(this,e||this.network)};be.prototype.toString=be.prototype.toHex=function(){return this.toDER().toString("hex")};be.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"};Nk.exports=be});var On=R((Xne,Ck)=>{"use strict";p();var Ni=Ge(),eo=$i(),k7=at(),B7=Kt(),N7=Ri(),La=ke(),C7=Ve(),Hb=Oe(),vt=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};Object.defineProperty(vt.prototype,"k",{get:function(){return this._k},set:function(e){this._k=e,this._kFresh=!0},enumerable:!0,configurable:!0});vt.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(l.Buffer.isBuffer(e.sig)){var t=at();this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return e.k&&(this.k=e.k),this.verified=e.verified||this.verified,this};vt.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()};vt.prototype.calci=function(){for(var e=0;e<4;e++){this.sig.i=e;var t;try{t=this.toPublicKey()}catch(r){console.error(r);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")};vt.fromString=function(e){var t=JSON.parse(e);return new vt(t)};vt.prototype.randomK=function(){var e=eo.getN(),t;do t=Ni.fromBuffer(N7.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(Ni.Zero)));return this.k=t,this};vt.prototype.deterministicK=function(e){C7.isUndefined(e)&&(e=0);var t=l.Buffer.alloc(32);t.fill(1);var r=l.Buffer.alloc(32);r.fill(0);var i=this.privkey.bn.toBuffer({size:32}),n=this.endian==="little"?l.Buffer.from(this.hashbuf).reverse():this.hashbuf;r=La.sha256hmac(l.Buffer.concat([t,l.Buffer.from([0]),i,n]),r),t=La.sha256hmac(t,r),r=La.sha256hmac(l.Buffer.concat([t,l.Buffer.from([1]),i,n]),r),t=La.sha256hmac(t,r),t=La.sha256hmac(t,r);for(var o=Ni.fromBuffer(t),a=eo.getN(),s=0;s<e||!(o.lt(a)&&o.gt(Ni.Zero));s++)r=La.sha256hmac(l.Buffer.concat([t,l.Buffer.from([0])]),r),t=La.sha256hmac(t,r),t=La.sha256hmac(t,r),o=Ni.fromBuffer(t);return this.k=o,this};vt.prototype.toPublicKey=function(){var e=this.sig.i;Hb.checkArgument(e===0||e===1||e===2||e===3,new Error("i must be equal to 0, 1, 2, or 3"));var t=Ni.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,n=e&1,o=e>>1,a=eo.getN(),s=eo.getG(),u=o?r.add(a):r,c=eo.fromX(n,u),f=c.mul(a);if(!f.isInfinity())throw new Error("nR is not a valid curve point");var d=t.neg().umod(a),m=r.invm(a),y=c.mul(i).add(s.mul(d)).mul(m),w=B7.fromPoint(y,this.sig.compressed);return w};vt.prototype.sigError=function(){if(!l.Buffer.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=eo.getN();try{if(e.lte(Ni.Zero)||t.lte(Ni.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var i=Ni.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),n=t.invm(r),o=n.mul(i).umod(r),a=n.mul(e).umod(r),s=eo.getG().mulAdd(o,this.pubkey.point,a);return s.isInfinity()?"p is infinity":s.getX().umod(r).cmp(e)!==0?"Invalid signature":!1}catch(u){return"Signature security validation failed: "+u.message}};vt.toLowS=function(e){return e.gt(Ni.fromBuffer(l.Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=eo.getN().sub(e)),e};vt.prototype._findSignature=function(e,t){var r=eo.getN(),i=eo.getG(),n=0,o,a,s,u;do(!this.k||!this._kFresh||n>0)&&this.deterministicK(n),n++,o=this.k,a=i.mul(o),s=a.x.umod(r),u=o.invm(r).mul(t.add(e.mul(s))).umod(r);while(s.cmp(Ni.Zero)<=0||u.cmp(Ni.Zero)<=0);return this._kFresh=!1,u=vt.toLowS(u),{s:u,r:s}};vt.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;Hb.checkState(e&&t&&r,new Error("invalid parameters")),Hb.checkState(l.Buffer.isBuffer(e)&&e.length===32,new Error("hashbuf must be a 32 byte buffer"));var i=Ni.fromBuffer(e,this.endian?{endian:this.endian}:void 0),n=this._findSignature(r,i);return n.compressed=this.pubkey.compressed,this.sig=new k7(n),this};vt.prototype.signRandomK=function(){return this.randomK(),this.sign()};vt.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)};vt.prototype.verify=function(){return this.verified=!this.sigError(),this.verified};vt.prototype.verifyBool=function(){return this.verify()===!0};vt.sign=function(e,t,r){return vt().set({hashbuf:e,endian:r,privkey:t}).sign().sig};vt.signWithCalcI=function(e,t,r){return vt().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig};vt.signRandomK=function(e,t,r){return vt().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig};vt.verify=function(e,t,r,i){return vt().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify()};Ck.exports=vt});var Mk=R((jb,Lk)=>{p();(function(e,t){"use strict";typeof define=="function"&&define.amd?define([],function(){return e.secrets=t()}):typeof jb=="object"?Lk.exports=t(Dt()):e.secrets=t(e.crypto)})(jb,function(e){"use strict";var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!!(r&&r.rng&&typeof r.rng=="function")}function u(P,k){var M;if(k===0||k===1)return P;if(k&&k>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return k=k||r.bits,P&&(M=P.length%k),M?(i+P).slice(-(k-M+P.length)):P}function c(P){var k="",M,K;for(K=P.length-1;K>=0;K--){if(M=parseInt(P[K],16),isNaN(M))throw new Error("Invalid hex character.");k=u(M.toString(2),4)+k}return k}function f(P){var k="",M,K;for(P=u(P,4),K=P.length;K>=4;K-=4){if(M=parseInt(P.slice(K-4,K),2),isNaN(M))throw new Error("Invalid binary character.");k=M.toString(16)+k}return k}function d(){return!!(e&&typeof e=="object"&&(typeof e.getRandomValues=="function"||typeof e.getRandomValues=="object")&&(typeof Uint32Array=="function"||typeof Uint32Array=="object"))}function m(){return typeof e=="object"&&typeof e.randomBytes=="function"}function y(P){function k(V,x,h,v){var b=0,S,E="",A;for(x&&(S=x.length-1);b<S||E.length<V;)A=Math.abs(parseInt(x[b],h)),E=E+u(A.toString(2),v),b++;return E=E.substr(-V),(E.match(/0/g)||[]).length===E.length?null:E}function M(V){var x,h,v,b,S=null;for(v=16,b=4,h=Math.ceil(V/8);S===null;)x=e.randomBytes(h),S=k(V,x.toString("hex"),v,b);return S}function K(V){var x,h,v,b=null;for(h=10,v=32,x=Math.ceil(V/32);b===null;)b=k(V,e.getRandomValues(new Uint32Array(x)),h,v);return b}function z(V){var x,h,v,b,S,E=null;b=10,S=32,h=Math.ceil(V/32),v=123456789,x=new Uint32Array(h);for(var A=0;A<x.length;A++)x[A]=v;for(;E===null;)E=k(V,x,b,S);return E}if(P&&P==="testRandom")return r.typeCSPRNG=P,z;if(P&&P==="nodeCryptoRandomBytes")return r.typeCSPRNG=P,M;if(P&&P==="browserCryptoGetRandomValues")return r.typeCSPRNG=P,K;if(m())return r.typeCSPRNG="nodeCryptoRandomBytes",M;if(d())return r.typeCSPRNG="browserCryptoGetRandomValues",K}function w(P,k){var M=[],K;for(k&&(P=u(P,k)),K=P.length;K>r.bits;K-=r.bits)M.push(parseInt(P.slice(K-r.bits,K),2));return M.push(parseInt(P.slice(0,K),2)),M}function T(P,k){var M=r.logs[P],K=0,z;for(z=k.length-1;z>=0;z--)K!==0?K=r.exps[(M+r.logs[K])%r.maxShares]^k[z]:K=k[z];return K}function B(P,k,M){var K=0,z,V,x,h;for(x=0,z=k.length;x<z;x++)if(M[x]){for(V=r.logs[M[x]],h=0;h<z;h++)if(x!==h){if(P===k[h]){V=-1;break}V=(V+r.logs[P^k[h]]-r.logs[k[x]^k[h]]+r.maxShares)%r.maxShares}K=V===-1?K:K^r.exps[V]}return K}function C(P,k,M){var K=[],z=[P],V,x;for(V=1;V<M;V++)z[V]=parseInt(r.rng(r.bits),2);for(V=1,x=k+1;V<x;V++)K[V-1]={x:V,y:T(V,z)};return K}function q(P,k,M){var K,z,V,x,h;if(k=parseInt(k,r.radix),P=parseInt(P,10)||r.bits,K=P.toString(36).toUpperCase(),V=Math.pow(2,P)-1,x=V.toString(r.radix).length,z=u(k.toString(r.radix),x),typeof k!="number"||k%1!==0||k<1||k>V)throw new Error("Share id must be an integer between 1 and "+V+", inclusive.");return h=K+z+M,h}var F={init:function(P,k){var M=[],K=[],z=1,V,x;if(a(),P&&(typeof P!="number"||P%1!==0||P<t.minBits||P>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(k&&o.indexOf(k)===-1)throw new Error("Invalid RNG type argument : '"+k+"'");for(r.radix=t.radix,r.bits=P||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,V=t.primitivePolynomials[r.bits],x=0;x<r.size;x++)K[x]=z,M[z]=x,z=z<<1,z>=r.size&&(z=z^V,z=z&r.maxShares);if(r.logs=M,r.exps=K,k&&this.setRNG(k),s()||this.setRNG(),!s()||!r.bits||!r.size||!r.maxShares||!r.logs||!r.exps||r.logs.length!==r.size||r.exps.length!==r.size)throw new Error("Initialization failed.")},combine:function(P,k){var M,K,z,V,x="",h,v,b,S=[],E=[];for(k=k||0,M=0,z=P.length;M<z;M++){if(v=this.extractShareComponents(P[M]),h===void 0)h=v.bits;else if(v.bits!==h)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==h&&this.init(h),S.indexOf(v.id)===-1)for(S.push(v.id),b=w(c(v.data)),K=0,V=b.length;K<V;K++)E[K]=E[K]||[],E[K][S.length-1]=b[K]}for(M=0,z=E.length;M<z;M++)x=u(B(k,S,E[M]).toString(2))+x;return f(k>=1?x:x.slice(x.indexOf("1")+1))},getConfig:function(){var P={};return P.radix=r.radix,P.bits=r.bits,P.maxShares=r.maxShares,P.hasCSPRNG=s(),P.typeCSPRNG=r.typeCSPRNG,P},extractShareComponents:function(P){var k,M,K,z,V={},x,h;if(k=parseInt(P.substr(0,1),36),k&&(typeof k!="number"||k%1!==0||k<t.minBits||k>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(z=Math.pow(2,k)-1,K=(Math.pow(2,k)-1).toString(r.radix).length,x="^([a-kA-K3-9]{1})([a-fA-F0-9]{"+K+"})([a-fA-F0-9]+)$",h=new RegExp(x).exec(P),h&&(M=parseInt(h[2],r.radix)),typeof M!="number"||M%1!==0||M<1||M>z)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(h&&h[3])return V.bits=k,V.id=M,V.data=h[3],V;throw new Error("The share data provided is invalid : "+P)},setRNG:function(P){var k="Random number generator is invalid ",M=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(P&&typeof P=="string"&&o.indexOf(P)===-1)throw new Error("Invalid RNG type argument : '"+P+"'");if(P||(P=y()),P&&typeof P=="string"&&(P=y(P)),n){if(P&&typeof P!="function")throw new Error(k+"(Not a function)."+M);if(P&&typeof P(r.bits)!="string")throw new Error(k+"(Output is not a string)."+M);if(P&&!parseInt(P(r.bits),2))throw new Error(k+"(Binary string output not parseable to an Integer)."+M);if(P&&P(r.bits).length>r.bits)throw new Error(k+"(Output length is greater than config.bits)."+M);if(P&&P(r.bits).length<r.bits)throw new Error(k+"(Output length is less than config.bits)."+M)}return r.rng=P,!0},str2hex:function(P,k){var M,K,z="",V,x,h,v;if(typeof P!="string")throw new Error("Input must be a character string.");if(k||(k=t.bytesPerChar),typeof k!="number"||k<1||k>t.maxBytesPerChar||k%1!==0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(M=2*k,K=Math.pow(16,M)-1,h=0,v=P.length;h<v;h++){if(x=P[h].charCodeAt(),isNaN(x))throw new Error("Invalid character: "+P[h]);if(x>K)throw V=Math.ceil(Math.log(x+1)/Math.log(256)),new Error("Invalid character code ("+x+"). Maximum allowable is 256^bytes-1 ("+K+"). To convert this character, use at least "+V+" bytes.");z=u(x.toString(16),M)+z}return z},hex2str:function(P,k){var M,K="",z,V;if(typeof P!="string")throw new Error("Input must be a hexadecimal string.");if(k=k||t.bytesPerChar,typeof k!="number"||k%1!==0||k<1||k>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(M=2*k,P=u(P,M),z=0,V=P.length;z<V;z+=M)K=String.fromCharCode(parseInt(P.slice(z,z+M),16))+K;return K},random:function(P){if(typeof P!="number"||P%1!==0||P<2||P>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return f(r.rng(P))},share:function(P,k,M,K){var z,V,x=new Array(k),h=new Array(k),v,b,S;if(K=K||128,typeof P!="string")throw new Error("Secret must be a string.");if(typeof k!="number"||k%1!==0||k<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(k>r.maxShares)throw z=Math.ceil(Math.log(k+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+k+" shares, use at least "+z+" bits.");if(typeof M!="number"||M%1!==0||M<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(M>r.maxShares)throw z=Math.ceil(Math.log(M+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+M+", use at least "+z+" bits.");if(M>k)throw new Error("Threshold number of shares was "+M+" but must be less than or equal to the "+k+" shares specified as the total to generate.");if(typeof K!="number"||K%1!==0||K<0||K>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(P="1"+c(P),P=w(P,K),v=0,S=P.length;v<S;v++)for(V=C(P[v],k,M),b=0;b<k;b++)x[b]=x[b]||V[b].x.toString(r.radix),h[b]=u(V[b].y.toString(2))+(h[b]||"");for(v=0;v<k;v++)x[v]=q(r.bits,x[v],f(h[v]));return x},newShare:function(P,k){var M,K;if(P&&typeof P=="string"&&(P=parseInt(P,r.radix)),K=P.toString(r.radix),P&&K&&k&&k[0])return M=this.extractShareComponents(k[0]),q(M.bits,K,this.combine(k,P));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:f,_hasCryptoGetRandomValues:d,_hasCryptoRandomBytes:m,_getRNG:y,_isSetRNG:s,_splitNumStringToIntArray:w,_horner:T,_lagrange:B,_getShares:C,_constructPublicShareString:q};return F.init(),F})});var Kb=R((eoe,Uk)=>{"use strict";p();var si=Ge(),Dk=Ri(),qk=ke(),Pg=null;function zb(){if(Pg)return Pg;var e=Mk();return e.setRNG(function(t){for(var r=64,i=0;i<r;i++){for(var n=Dk.getRandomBuffer(Math.ceil(t/8)),o="",a=0;a<n.length;a++)o+=("00000000"+n[a].toString(2)).slice(-8);if(o=o.slice(0,t),/1/.test(o))return o}throw new Error("shamir: CSPRNG returned all-zero draws "+r+" times in a row \u2014 refusing to hang on a degenerate/stubbed random source")}),Pg=e,Pg}var Rg="ff",Fk=2;function yr(e){return this instanceof yr?(this.options=e||{},this):new yr(e)}yr.split=function(e,t,r,i){if(i=i||{},e==null)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var n=l.Buffer.isBuffer(e)?e:l.Buffer.from(e,"utf8"),o=Rg+n.toString("hex"),a=zb().share(o,r,t),s=Dk.getRandomBuffer(8).toString("hex"),u=i.checksum===!0,c=u?qk.sha256(n).slice(0,4).toString("hex"):null,f=[],d=0;d<a.length;d++)f.push({v:Fk,id:d+1,threshold:t,shares:r,length:n.length,splitId:s,share:a[d],checksum:c});return f};yr.combine=function(e){if(!e||e.length===0)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&e[0].share===void 0)return yr._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var i=[],n=0;n<e.length;n++){var o=e[n];if(!o||typeof o.share!="string")throw new Error("Invalid share at index "+n);if(r!==void 0&&o.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(o.threshold!==t)throw new Error("Shares have inconsistent threshold");i.push(o.share)}var a=zb().combine(i);if(a.slice(0,Rg.length)!==Rg)throw new Error("Reconstruction failed: invalid or insufficient shares");var s=l.Buffer.from(a.slice(Rg.length),"hex"),u=e[0].checksum;if(u){var c=qk.sha256(s).slice(0,4).toString("hex");if(c!==u)throw new Error("Integrity check failed: shares are inconsistent or tampered")}return s};yr.verifyShare=function(e){try{return!e||typeof e!="object"?!1:Array.isArray(e.bytes)&&e.share===void 0?yr._verifyLegacyShare(e):e.v!==Fk||typeof e.share!="string"||!/^[0-9a-fA-F]+$/.test(e.share)||typeof e.threshold!="number"||typeof e.shares!="number"||e.threshold<2||e.shares<e.threshold||e.shares>255||e.id<1||e.id>e.shares||e.checksum!==null&&e.checksum!==void 0&&!/^[0-9a-fA-F]{8}$/.test(e.checksum)?!1:(zb().extractShareComponents(e.share),!0)}catch{return!1}};yr.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=3,r=5,i=yr.split(e,t,r),n=yr.combine(i.slice(0,t));return{secret:e,threshold:t,totalShares:r,shares:i,reconstructed:n.toString("utf8"),valid:n.toString("utf8")===e}};var Ma=new si(2147483647);yr._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,i=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=0;n<e.length;n++){if(e[n].threshold!==t||e[n].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[n].length!==i)throw new Error("Shares have different secret lengths")}for(var o=[],a=0;a<i;a++){for(var s=[],u=0;u<Math.min(e.length,t);u++)s.push(e[u].bytes[a]);o.push(yr._combineByteLegacy(s))}return l.Buffer.from(o)};yr._combineByteLegacy=function(e){for(var t=new si(0),r=0;r<e.length;r++){for(var i=new si(e[r].x),n=new si(e[r].y,16),o=new si(1),a=new si(1),s=0;s<e.length;s++)if(r!==s){var u=new si(e[s].x),c=new si(0).sub(u);c.lt(new si(0))&&(c=c.add(Ma)),o=o.mul(c).mod(Ma);var f=i.sub(u);f.lt(new si(0))&&(f=f.add(Ma)),a=a.mul(f).mod(Ma)}var d=yr._modInverseLegacy(a,Ma),m=o.mul(d).mod(Ma);t=t.add(n.mul(m)).mod(Ma)}return t.mod(Ma).mod(new si(256)).toNumber()};yr._modInverseLegacy=function(e,t){e.lt(new si(0))&&(e=e.mod(t).add(t));var r=yr._extendedGCDLegacy(e,t);if(!r.gcd.eq(new si(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)};yr._extendedGCDLegacy=function(e,t){if(e.eq(new si(0)))return{gcd:t,x:new si(0),y:new si(1)};var r=yr._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}};yr._verifyLegacyShare=function(e){if(!e.id||!e.threshold||!e.shares||!e.bytes||typeof e.length!="number"||e.threshold<2||e.shares<e.threshold||!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y||r.x<1||r.x>e.shares||!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0};Uk.exports=yr});var Bg=R((roe,Hk)=>{"use strict";p();var to=Ge(),L7=$i(),M7=On(),Ml=L7.getN(),kg=Ml.shrn(1);function D7(e,t,r){if(!l.Buffer.isBuffer(e)||e.length!==32)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let i=t;if(l.Buffer.isBuffer(t))try{i=at().fromDER(t)}catch{return!1}if(!i||!i.r||!i.s)return!1;let n=to.isBN(i.r)?i.r:new to(i.r),o=to.isBN(i.s)?i.s:new to(i.s);if(n.isZero()||o.isZero()||n.gte(Ml)||o.gte(Ml)||o.gt(kg))return!1;let a=at(),s=new a({r:n,s:o});return M7.verify(e,s,r)}function q7(e){if(!e)return!1;let t=e;if(l.Buffer.isBuffer(e))try{t=at().fromDER(e)}catch{return!1}return!t||!t.s?!1:(to.isBN(t.s)?t.s:new to(t.s)).lte(kg)}function F7(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");let t=to.isBN(e.r)?e.r:new to(e.r),r=to.isBN(e.s)?e.s:new to(e.s),i=r;return r.gt(kg)&&(i=Ml.sub(r)),{r:t,s:i}}Hk.exports={smartVerify:D7,isCanonical:q7,canonicalize:F7,constants:{n:Ml,nh:kg}}});var Ng=R((noe,Kk)=>{"use strict";p();var U7=Ge(),{secp256k1:xc}=(al(),Hi(ol)),jk=xc.Point,H7=jk.Fn.ORDER;function Vb(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new U7(t,16)}function Gb(e){return l.Buffer.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(l.Buffer.from(e,"hex"))}function Wb(e){this._p=e}Wb.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var zk={curve:{n:Vb(H7)},keyFromPrivate:function(e,t){var r;l.Buffer.isBuffer(e)?r=e:e instanceof Uint8Array?r=l.Buffer.from(e):r=l.Buffer.from(e,t||"hex");var i=Uint8Array.from(r);return{_priv:i,getPublic:function(){return new Wb(jk.fromBytes(xc.getPublicKey(i,!0)))}}},sign:function(e,t){var r=xc.sign(Gb(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),i=r[0],n=Vb(BigInt("0x"+l.Buffer.from(r.subarray(1,33)).toString("hex"))),o=Vb(BigInt("0x"+l.Buffer.from(r.subarray(33,65)).toString("hex")));return{r:n,s:o,recoveryParam:i}},verify:function(e,t,r){try{if(!t||typeof t!="object")return!1;var i=t.r,n=t.s;if(!i||!n||typeof i.cmp!="function"||typeof n.cmp!="function"||i.isZero()||n.isZero())return!1;var o=zk.curve.n;if(i.cmp(o)>=0||n.cmp(o)>=0)return!1;var a=l.Buffer.concat([i.toBuffer({size:32}),n.toBuffer({size:32})]),s=r._priv?xc.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return xc.verify(Uint8Array.from(a),Gb(e),Uint8Array.from(s),{lowS:!1,prehash:!1})}catch{return!1}},recoverPubKey:function(e,t,r){var i=l.Buffer.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]),n=xc.Signature.fromBytes(Uint8Array.from(i),"compact").addRecoveryBit(r);return new Wb(n.recoverPublicKey(Gb(e)))}};Kk.exports=zk});var zs=R((aoe,Wk)=>{"use strict";p();var Cg=Ve(),Dl=Ge(),Lg=$n(),j7=Qi(),z7=ke(),Vk=Oe(),K7=486604799,ze=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&Vk.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};ze._from=function(t){var r={};if(l.Buffer.isBuffer(t))r=ze._fromBufferReader(Lg(t));else if(Cg.isObject(t))r=ze._fromObject(t);else throw new TypeError("Unrecognized argument for BlockHeader");return r};ze._fromObject=function(t){Vk.checkArgument(t,"data is required");var r=t.prevHash,i=t.merkleRoot;Cg.isString(t.prevHash)&&(r=l.Buffer.from(t.prevHash,"hex").reverse()),Cg.isString(t.merkleRoot)&&(i=l.Buffer.from(t.merkleRoot,"hex").reverse());var n={hash:t.hash,version:t.version,prevHash:r,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce};return n};ze.fromObject=function(t){var r=ze._fromObject(t);return new ze(r)};ze.fromRawBlock=function(t){l.Buffer.isBuffer(t)||(t=l.Buffer.from(t,"binary"));var r=Lg(t);r.pos=ze.Constants.START_OF_HEADER;var i=ze._fromBufferReader(r);return new ze(i)};ze.fromBuffer=function(t){var r=ze._fromBufferReader(Lg(t));return new ze(r)};ze.fromString=function(t){var r=l.Buffer.from(t,"hex");return ze.fromBuffer(r)};ze._fromBufferReader=function(t){var r={};return r.version=t.readInt32LE(),r.prevHash=t.read(32),r.merkleRoot=t.read(32),r.time=t.readUInt32LE(),r.bits=t.readUInt32LE(),r.nonce=t.readUInt32LE(),r};ze.fromBufferReader=function(t){var r=ze._fromBufferReader(t);return new ze(r)};ze.prototype.toObject=ze.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:l.Buffer.from(this.prevHash).reverse().toString("hex"),merkleRoot:l.Buffer.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}};ze.prototype.toBuffer=function(){return this.toBufferWriter().concat()};ze.prototype.toString=function(){return this.toBuffer().toString("hex")};ze.prototype.toBufferWriter=function(t){return t||(t=new j7),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t};ze.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var r=new Dl(t&16777215),i=8*((t>>>24)-3);i-- >0;)r=r.mul(new Dl(2));return r};ze.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(K7).mul(new Dl(Math.pow(10,8))),r=this.getTargetDifficulty(),i=t.div(r).toString(10),n=i.length-8;return i=i.slice(0,n)+"."+i.slice(n),parseFloat(i)};ze.prototype._getHash=function(){var t=this.toBuffer();return z7.sha256sha256(t)};var Gk={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=Lg(this._getHash()).readReverse().toString("hex")),this._id},set:Cg.noop};Object.defineProperty(ze.prototype,"id",Gk);Object.defineProperty(ze.prototype,"hash",Gk);ze.prototype.validTimestamp=function(){var t=Math.round(new Date().getTime()/1e3);return!(this.time>t+ze.Constants.MAX_TIME_OFFSET)};ze.prototype.validProofOfWork=function(){var t=new Dl(this.id,"hex"),r=this.getTargetDifficulty();return!(t.cmp(r)>0)};ze.prototype.inspect=function(){return"<BlockHeader "+this.id+">"};ze.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new Dl("10000000000000000000000000000000000000000000000000000000000000000","hex")};Wk.exports=ze});var Qk=R((uoe,Jk)=>{"use strict";p();var Yb=Ve(),Yk=zs(),Zk=Ge(),$b=$n(),V7=Qi(),G7=ke(),Zb=At(),$k=Oe();function Be(e){return this instanceof Be?(Yb.extend(this,Be._from(e)),this):new Be(e)}Be.MAX_BLOCK_SIZE=128e6;Be._from=function(t){var r={};if(l.Buffer.isBuffer(t))r=Be._fromBufferReader($b(t));else if(Yb.isObject(t))r=Be._fromObject(t);else throw new TypeError("Unrecognized argument for Block");return r};Be._fromObject=function(t){var r=[];t.transactions.forEach(function(n){n instanceof Zb?r.push(n):r.push(Zb().fromObject(n))});var i={header:Yk.fromObject(t.header),transactions:r};return i};Be.fromObject=function(t){var r=Be._fromObject(t);return new Be(r)};Be._fromBufferReader=function(t){var r={};$k.checkState(!t.finished(),"No block data received"),r.header=Yk.fromBufferReader(t);var i=t.readVarintNum();r.transactions=[];for(var n=0;n<i;n++)r.transactions.push(Zb().fromBufferReader(t));return r};Be.fromBufferReader=function(t){$k.checkArgument(t,"br is required");var r=Be._fromBufferReader(t);return new Be(r)};Be.fromBuffer=function(t){return Be.fromBufferReader(new $b(t))};Be.fromString=function(t){var r=l.Buffer.from(t,"hex");return Be.fromBuffer(r)};Be.fromRawBlock=function(t){l.Buffer.isBuffer(t)||(t=l.Buffer.from(t,"binary"));var r=$b(t);r.pos=Be.Values.START_OF_BLOCK;var i=Be._fromBufferReader(r);return new Be(i)};Be.prototype.toObject=Be.prototype.toJSON=function(){var t=[];return this.transactions.forEach(function(r){t.push(r.toObject())}),{header:this.header.toObject(),transactions:t}};Be.prototype.toBuffer=function(){return this.toBufferWriter().concat()};Be.prototype.toString=function(){return this.toBuffer().toString("hex")};Be.prototype.toBufferWriter=function(t){t||(t=new V7),t.write(this.header.toBuffer()),t.writeVarintNum(this.transactions.length);for(var r=0;r<this.transactions.length;r++)this.transactions[r].toBufferWriter(t);return t};Be.prototype.getTransactionHashes=function(){var t=[];if(this.transactions.length===0)return[Be.Values.NULL_HASH];for(var r=0;r<this.transactions.length;r++)t.push(this.transactions[r]._getHash());return t};Be.prototype.getMerkleTree=function(){for(var t=this.getTransactionHashes(),r=0,i=this.transactions.length;i>1;i=Math.floor((i+1)/2)){for(var n=0;n<i;n+=2){var o=Math.min(n+1,i-1),a=l.Buffer.concat([t[r+n],t[r+o]]);t.push(G7.sha256sha256(a))}r+=i}return t};Be.prototype.getMerkleRoot=function(){var t=this.getMerkleTree();return t[t.length-1]};Be.prototype.validMerkleRoot=function(){var t=new Zk(this.header.merkleRoot.toString("hex"),"hex"),r=new Zk(this.getMerkleRoot().toString("hex"),"hex");return t.cmp(r)===0};Be.prototype._getHash=function(){return this.header._getHash()};var Xk={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:Yb.noop};Object.defineProperty(Be.prototype,"id",Xk);Object.defineProperty(Be.prototype,"hash",Xk);Be.prototype.inspect=function(){return"<Block "+this.id+">"};Be.Values={START_OF_BLOCK:8,NULL_HASH:l.Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};Jk.exports=Be});var Qb=R((foe,rB)=>{"use strict";p();var Ks=Ve(),Jb=zs(),tB=$n(),W7=Qi(),Z7=ke(),eB=At(),Xb=ti(),Vs=Oe();function kt(e){if(!(this instanceof kt))return new kt(e);var t={};if(l.Buffer.isBuffer(e))t=kt._fromBufferReader(tB(e));else if(Ks.isObject(e)){var r;e.header instanceof Jb?r=e.header:r=Jb.fromObject(e.header),t={header:r,numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return Ks.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}kt.fromBuffer=function(t){return kt.fromBufferReader(tB(t))};kt.fromBufferReader=function(t){return new kt(kt._fromBufferReader(t))};kt.prototype.toBuffer=function(){return this.toBufferWriter().concat()};kt.prototype.toBufferWriter=function(t){t||(t=new W7),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var r=0;r<this.hashes.length;r++)t.write(l.Buffer.from(this.hashes[r],"hex"));for(t.writeVarintNum(this.flags.length),r=0;r<this.flags.length;r++)t.writeUInt8(this.flags[r]);return t};kt.prototype.toObject=kt.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}};kt.prototype.validMerkleTree=function(){if(Vs.checkState(Ks.isArray(this.flags),"MerkleBlock flags is not an array"),Vs.checkState(Ks.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r);return r.hashesUsed!==this.hashes.length?!1:i.equals(this.header.merkleRoot)};kt.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")};kt.prototype.filteredTxsHash=function(){if(Vs.checkState(Ks.isArray(this.flags),"MerkleBlock flags is not an array"),Vs.checkState(Ks.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new Xb.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new Xb.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var t=this._calcTreeHeight(),r={hashesUsed:0,flagBitsUsed:0},i=this._traverseMerkleTree(t,0,r,!0);if(r.hashesUsed!==this.hashes.length)throw new Xb.MerkleBlock.InvalidMerkleTree;return i};kt.prototype._traverseMerkleTree=function(t,r,i,n){if(i=i||{},i.txs=i.txs||[],i.flagBitsUsed=i.flagBitsUsed||0,i.hashesUsed=i.hashesUsed||0,n=n||!1,i.flagBitsUsed>this.flags.length*8)return null;var o=this.flags[i.flagBitsUsed>>3]>>>(i.flagBitsUsed++&7)&1;if(t===0||!o){if(i.hashesUsed>=this.hashes.length)return null;var a=this.hashes[i.hashesUsed++];return t===0&&o&&i.txs.push(a),l.Buffer.from(a,"hex")}else{var s=this._traverseMerkleTree(t-1,r*2,i),u=s;return r*2+1<this._calcTreeWidth(t-1)&&(u=this._traverseMerkleTree(t-1,r*2+1,i)),n?i.txs:Z7.sha256sha256(l.Buffer.concat([s,u]))}};kt.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<<t)-1>>t};kt.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t};kt.prototype.hasTransaction=function(t){Vs.checkArgument(!Ks.isUndefined(t),"tx cannot be undefined"),Vs.checkArgument(t instanceof eB||typeof t=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var r=t;t instanceof eB&&(r=l.Buffer.from(t.id,"hex").reverse().toString("hex"));var i=[],n=this._calcTreeHeight();return this._traverseMerkleTree(n,0,{txs:i}),i.indexOf(r)!==-1};kt._fromBufferReader=function(t){Vs.checkState(!t.finished(),"No merkleblock data received");var r={};r.header=Jb.fromBufferReader(t),r.numTransactions=t.readUInt32LE();var i=t.readVarintNum();r.hashes=[];for(var n=0;n<i;n++)r.hashes.push(t.read(32).toString("hex"));var o=t.readVarintNum();for(r.flags=[],n=0;n<o;n++)r.flags.push(t.readUInt8());return r};kt.fromObject=function(t){return new kt(t)};rB.exports=kt});var iB=R((hoe,Mg)=>{p();Mg.exports=Qk();Mg.exports.BlockHeader=zs();Mg.exports.MerkleBlock=Qb()});var fB=R((poe,cB)=>{"use strict";p();var Y7=zs(),nB=ke(),oB=/^[0-9a-fA-F]{64}$/;function sB(e){return l.Buffer.from(e).reverse()}function aB(e){return sB(l.Buffer.from(e,"hex"))}function uB(e){return sB(e).toString("hex")}function e_(e,t,r){if(!oB.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var i=aB(e),n=t,o=0;o<r.length;o++){var a=r[o],s;if(a==="*"||a===""||a==null)s=i;else{if(!oB.test(String(a)))throw new Error("proof node "+o+' must be 32-byte hex or "*"');s=aB(a)}i=n&1?nB.sha256sha256(l.Buffer.concat([s,i])):nB.sha256sha256(l.Buffer.concat([i,s])),n=Math.floor(n/2)}return uB(i)}function $7(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");var t=e_(e.txid,e.index,e.nodes);return t.toLowerCase()===String(e.merkleRoot).toLowerCase()}function X7(e){var t=e.header;if((l.Buffer.isBuffer(t)||typeof t=="string")&&(t=Y7.fromBuffer(l.Buffer.isBuffer(t)?t:l.Buffer.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=uB(t.merkleRoot),i=e_(e.txid,e.index,e.nodes),n=i.toLowerCase()===r.toLowerCase(),o=e.requirePow!==!1,a=t.validProofOfWork();return{valid:n&&(!o||a),rootMatches:n,powValid:a,merkleRoot:i,blockHash:t.id}}cB.exports={merkleRootFromBranch:e_,verifyMerkleProof:$7,verifyTxInclusion:X7}});var dB=R((moe,hB)=>{"use strict";p();var lB=zs();function J7(e){return l.Buffer.from(e).reverse()}function Q7(e){if(e&&typeof e.validProofOfWork=="function")return e;if(l.Buffer.isBuffer(e))return lB.fromBuffer(e);if(typeof e=="string")return lB.fromBuffer(l.Buffer.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}function eG(e,t){if(t=t||{},!Array.isArray(e)||e.length===0)throw new Error("headers must be a non-empty array");for(var r=e.map(Q7),i=t.requirePow!==!1,n=0,o=0;o<r.length;o++){if(i&&!r[o].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+o,count:r.length};if(n+=r[o].getDifficulty(),o>0){var a=J7(r[o].prevHash).toString("hex").toLowerCase()===r[o-1].id.toLowerCase();if(!a)return{valid:!1,reason:"broken link at index "+o,count:r.length}}}var s=r[0].id,u=r[r.length-1].id;if(t.trustedHash){var c=String(t.trustedHash).toLowerCase();if(c!==u.toLowerCase()&&c!==s.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:s,tipHash:u}}return{valid:!0,count:r.length,anchorHash:s,tipHash:u,work:n}}hB.exports={verifyHeaderChain:eG}});var r_=R((yoe,pB)=>{"use strict";p();var t_=fB(),tG=dB();pB.exports={merkleRootFromBranch:t_.merkleRootFromBranch,verifyMerkleProof:t_.verifyMerkleProof,verifyTxInclusion:t_.verifyTxInclusion,verifyHeaderChain:tG.verifyHeaderChain}});var n_=R((_oe,_B)=>{"use strict";p();var br=Ve(),gB=Oe(),mB=Ge(),rG=Zu(),Dg=lc(),vB=ke(),qg=Fl(),Gs=Wo(),i_=$i(),yB=Kt(),bB=ti(),ql=bB,Tn=bB.HDPublicKey,Fg=Aa(),Da=Gr();function J(e){if(e instanceof J)return e;if(!(this instanceof J))return new J(e);if(e)if(br.isString(e)||l.Buffer.isBuffer(e)){var t=J.getSerializedError(e);if(t){if(l.Buffer.isBuffer(e)&&!J.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof Tn.ArgumentIsPrivateExtended)return new qg(e).hdPublicKey;throw t}else return this._buildFromSerialized(e)}else{if(br.isObject(e))return e instanceof qg?this._buildFromPrivate(e):this._buildFromObject(e);throw new Tn.UnrecognizedArgument(e)}else throw new Tn.MustSupplyArgument}J.fromHDPrivateKey=function(e){return new J(e)};J.isValidPath=function(e){if(br.isString(e)){var t=qg._getDerivationIndexes(e);return t!==null&&br.every(t,J.isValidPath)}return br.isNumber(e)?e>=0&&e<J.Hardened:!1};J.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};J.prototype.deriveChild=function(e,t){if(br.isNumber(e))return this._deriveWithNumber(e,t);if(br.isString(e))return this._deriveFromString(e);throw new Tn.InvalidDerivationArgument(e)};J.prototype._deriveWithNumber=function(e,t){if(e>=J.Hardened||t)throw new Tn.InvalidIndexCantDeriveHardened;if(e<0)throw new Tn.InvalidPath(e);var r=Da.integerAsBuffer(e),i=l.Buffer.concat([this.publicKey.toBuffer(),r]),n=vB.sha512hmac(i,this._buffers.chainCode),o=mB.fromBuffer(n.slice(0,32),{size:32}),a=n.slice(32,64),s;try{s=yB.fromPoint(i_.getG().mul(o).add(this.publicKey.point))}catch{return this._deriveWithNumber(e+1)}var u=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:a,publicKey:s});return u};J.prototype._deriveFromString=function(e){if(br.includes(e,"'"))throw new Tn.InvalidIndexCantDeriveHardened;if(!J.isValidPath(e))throw new Tn.InvalidPath(e);var t=qg._getDerivationIndexes(e),r=t.reduce(function(i,n){return i._deriveWithNumber(n)},this);return r};J.isValidSerialized=function(e,t){return br.isNull(J.getSerializedError(e,t))};J.getSerializedError=function(e,t){if(!(br.isString(e)||l.Buffer.isBuffer(e)))return new Tn.UnrecognizedArgument("expected buffer or string");if(!rG.validCharacters(e))return new ql.InvalidB58Char("(unknown)",e);try{e=Dg.decode(e)}catch{return new ql.InvalidB58Checksum(e)}if(e.length!==J.DataSize)return new Tn.InvalidLength(e);if(!br.isUndefined(t)){var r=J._validateNetwork(e,t);if(r)return r}var i=e.readUInt32BE(0);return i===Gs.livenet.xprivkey||i===Gs.testnet.xprivkey?new Tn.ArgumentIsPrivateExtended:null};J._validateNetwork=function(e,t){var r=Gs.get(t);if(!r)return new ql.InvalidNetworkArgument(t);var i=e.slice(J.VersionStart,J.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new ql.InvalidNetwork(i):null};J.prototype._buildFromPrivate=function(e){var t=br.clone(e._buffers),r=i_.getG().mul(mB.fromBuffer(t.privateKey));return t.publicKey=i_.pointToCompressed(r),t.version=Da.integerAsBuffer(Gs.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)};J.prototype._buildFromObject=function(e){var t={version:e.network?Da.integerAsBuffer(Gs.get(e.network).xpubkey):e.version,depth:br.isNumber(e.depth)?l.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:br.isNumber(e.parentFingerPrint)?Da.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:br.isNumber(e.childIndex)?Da.integerAsBuffer(e.childIndex):e.childIndex,chainCode:br.isString(e.chainCode)?l.Buffer.from(e.chainCode,"hex"):e.chainCode,publicKey:br.isString(e.publicKey)?l.Buffer.from(e.publicKey,"hex"):l.Buffer.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:br.isNumber(e.checksum)?Da.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)};J.prototype._buildFromSerialized=function(e){var t=Dg.decode(e),r={version:t.slice(J.VersionStart,J.VersionEnd),depth:t.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:t.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:t.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:t.slice(J.ChainCodeStart,J.ChainCodeEnd),publicKey:t.slice(J.PublicKeyStart,J.PublicKeyEnd),checksum:t.slice(J.ChecksumStart,J.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)};J.prototype._buildFromBuffers=function(e){J._validateBufferArguments(e),Da.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=l.Buffer.concat(t),i=Dg.checksum(r);if(!e.checksum||!e.checksum.length)e.checksum=i;else if(e.checksum.toString("hex")!==i.toString("hex"))throw new ql.InvalidB58Checksum(r,i);var n=Gs.get(e.version.readUInt32BE(0)),o;o=Dg.encode(l.Buffer.concat(t)),e.xpubkey=l.Buffer.from(o);var a=new yB(e.publicKey,{network:n}),s=J.ParentFingerPrintSize,u=vB.sha256ripemd160(a.toBuffer()).slice(0,s);return Da.defineImmutable(this,{xpubkey:o,network:n,depth:e.depth[0],publicKey:a,fingerPrint:u}),this};J._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Fg(l.Buffer.isBuffer(n),r+" argument is not a buffer, it's "+typeof n),Fg(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",J.VersionSize),t("depth",J.DepthSize),t("parentFingerPrint",J.ParentFingerPrintSize),t("childIndex",J.ChildIndexSize),t("chainCode",J.ChainCodeSize),t("publicKey",J.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",J.CheckSumSize)};J.fromString=function(e){return gB.checkArgument(br.isString(e),"No valid string was provided"),new J(e)};J.fromObject=function(e){return gB.checkArgument(br.isObject(e),"No valid argument was provided"),new J(e)};J.prototype.toString=function(){return this.xpubkey};J.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"};J.prototype.toObject=J.prototype.toJSON=function(){return{network:Gs.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}};J.fromBuffer=function(e){return new J(e)};J.fromHex=function(e){return J.fromBuffer(l.Buffer.from(e,"hex"))};J.prototype.toBuffer=function(){return l.Buffer.from(this._buffers.xpubkey)};J.prototype.toHex=function(){return this.toBuffer().toString("hex")};J.Hardened=2147483648;J.RootElementAlias=["m","M"];J.VersionSize=4;J.DepthSize=1;J.ParentFingerPrintSize=4;J.ChildIndexSize=4;J.ChainCodeSize=32;J.PublicKeySize=33;J.CheckSumSize=4;J.DataSize=78;J.SerializedByteSize=82;J.VersionStart=0;J.VersionEnd=J.VersionStart+J.VersionSize;J.DepthStart=J.VersionEnd;J.DepthEnd=J.DepthStart+J.DepthSize;J.ParentFingerPrintStart=J.DepthEnd;J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize;J.ChildIndexStart=J.ParentFingerPrintEnd;J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize;J.ChainCodeStart=J.ChildIndexEnd;J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize;J.PublicKeyStart=J.ChainCodeEnd;J.PublicKeyEnd=J.PublicKeyStart+J.PublicKeySize;J.ChecksumStart=J.PublicKeyEnd;J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize;Fg(J.PublicKeyEnd===J.DataSize);Fg(J.ChecksumEnd===J.SerializedByteSize);_B.exports=J});var Fl=R((woe,IB)=>{"use strict";p();var Ug=Aa(),Hl=Lt(),Vt=Ve(),wB=Oe(),EB=Ge(),iG=Zu(),Ul=lc(),o_=ke(),Ws=Wo(),nG=$i(),xB=Ur(),oG=Ri(),Ic=ti(),io=Ic.HDPrivateKey,ro=Gr(),aG=128,SB=1/8,sG=512;function W(e){if(e instanceof W)return e;if(!(this instanceof W))return new W(e);if(!e)return this._generateRandomly();if(Ws.get(e))return this._generateRandomly(e);if(Vt.isString(e)||l.Buffer.isBuffer(e))if(W.isValidSerialized(e))this._buildFromSerialized(e);else if(ro.isValidJSON(e))this._buildFromJSON(e);else if(l.Buffer.isBuffer(e)&&W.isValidSerialized(e.toString()))this._buildFromSerialized(e.toString());else throw W.getSerializedError(e);else if(Vt.isObject(e))this._buildFromObject(e);else throw new io.UnrecognizedArgument(e)}W.fromRandom=function(e){return new W(e)};W.isValidPath=function(e,t){if(Vt.isString(e)){var r=W._getDerivationIndexes(e);return r!==null&&Vt.every(r,W.isValidPath)}return Vt.isNumber(e)?(e<W.Hardened&&t===!0&&(e+=W.Hardened),e>=0&&e<W.MaxIndex):!1};W._getDerivationIndexes=function(e){var t=e.split("/");if(Vt.includes(W.RootElementAlias,e))return[];if(!Vt.includes(W.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(i){var n=i.slice(-1)==="'";if(n&&(i=i.slice(0,-1)),!i||i[0]==="-")return NaN;var o=+i;return n&&(o+=W.Hardened),o});return Vt.some(r,isNaN)?null:r};W.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")};W.prototype.deriveChild=function(e,t){if(Vt.isNumber(e))return this._deriveWithNumber(e,t);if(Vt.isString(e))return this._deriveFromString(e);throw new io.InvalidDerivationArgument(e)};W.prototype.deriveNonCompliantChild=function(e,t){if(Vt.isNumber(e))return this._deriveWithNumber(e,t,!0);if(Vt.isString(e))return this._deriveFromString(e,!0);throw new io.InvalidDerivationArgument(e)};W.prototype._deriveWithNumber=function(e,t,r){if(!W.isValidPath(e,t))throw new io.InvalidPath(e);t=e>=W.Hardened?!0:t,e<W.Hardened&&t===!0&&(e+=W.Hardened);var i=ro.integerAsBuffer(e),n;if(t&&r){var o=this.privateKey.bn.toBuffer();n=l.Buffer.concat([Hl.Buffer.from([0]),o,i])}else if(t){var a=this.privateKey.bn.toBuffer({size:32});Ug(a.length===32,"length of private key buffer is expected to be 32 bytes"),n=l.Buffer.concat([Hl.Buffer.from([0]),a,i])}else n=l.Buffer.concat([this.publicKey.toBuffer(),i]);var s=o_.sha512hmac(n,this._buffers.chainCode),u=EB.fromBuffer(s.slice(0,32),{size:32}),c=s.slice(32,64),f=u.add(this.privateKey.toBigNumber()).umod(nG.getN()).toBuffer({size:32});if(!xB.isValid(f))return this._deriveWithNumber(e+1,null,r);var d=new W({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:c,privateKey:f});return d};W.prototype._deriveFromString=function(e,t){if(!W.isValidPath(e))throw new io.InvalidPath(e);var r=W._getDerivationIndexes(e),i=r.reduce(function(n,o){return n._deriveWithNumber(o,null,t)},this);return i};W.isValidSerialized=function(e,t){return!W.getSerializedError(e,t)};W.getSerializedError=function(e,t){if(!(Vt.isString(e)||l.Buffer.isBuffer(e)))return new io.UnrecognizedArgument("Expected string or buffer");if(!iG.validCharacters(e))return new Ic.InvalidB58Char("(unknown)",e);try{e=Ul.decode(e)}catch{return new Ic.InvalidB58Checksum(e)}if(e.length!==W.DataLength)return new io.InvalidLength(e);if(!Vt.isUndefined(t)){var r=W._validateNetwork(e,t);if(r)return r}return null};W._validateNetwork=function(e,t){var r=Ws.get(t);if(!r)return new Ic.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new Ic.InvalidNetwork(i):null};W.fromString=function(e){return wB.checkArgument(Vt.isString(e),"No valid string was provided"),new W(e)};W.fromObject=function(e){return wB.checkArgument(Vt.isObject(e),"No valid argument was provided"),new W(e)};W.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))};W.prototype._buildFromObject=function(e){var t={version:e.network?ro.integerAsBuffer(Ws.get(e.network).xprivkey):e.version,depth:Vt.isNumber(e.depth)?l.Buffer.from([e.depth&255]):e.depth,parentFingerPrint:Vt.isNumber(e.parentFingerPrint)?ro.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:Vt.isNumber(e.childIndex)?ro.integerAsBuffer(e.childIndex):e.childIndex,chainCode:Vt.isString(e.chainCode)?l.Buffer.from(e.chainCode,"hex"):e.chainCode,privateKey:Vt.isString(e.privateKey)&&ro.isHexa(e.privateKey)?l.Buffer.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:ro.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)};W.prototype._buildFromSerialized=function(e){var t=Ul.decode(e),r={version:t.slice(W.VersionStart,W.VersionEnd),depth:t.slice(W.DepthStart,W.DepthEnd),parentFingerPrint:t.slice(W.ParentFingerPrintStart,W.ParentFingerPrintEnd),childIndex:t.slice(W.ChildIndexStart,W.ChildIndexEnd),chainCode:t.slice(W.ChainCodeStart,W.ChainCodeEnd),privateKey:t.slice(W.PrivateKeyStart,W.PrivateKeyEnd),checksum:t.slice(W.ChecksumStart,W.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)};W.prototype._generateRandomly=function(e){return W.fromSeed(oG.getRandomBuffer(64),e)};W.fromSeed=function(e,t){if(ro.isHexaString(e)&&(e=l.Buffer.from(e,"hex")),!l.Buffer.isBuffer(e))throw new io.InvalidEntropyArgument(e);if(e.length<aG*SB)throw new io.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>sG*SB)throw new io.InvalidEntropyArgument.TooMuchEntropy(e);var r=o_.sha512hmac(e,Hl.Buffer.from("Bitcoin seed"));return new W({network:Ws.get(t)||Ws.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})};W.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=n_();this._hdPublicKey=new e(this)}};W.prototype._buildFromBuffers=function(e){W._validateBufferArguments(e),ro.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,l.Buffer.alloc(1),e.privateKey],r=Hl.Buffer.concat(t);if(!e.checksum||!e.checksum.length)e.checksum=Ul.checksum(r);else if(e.checksum.toString()!==Ul.checksum(r).toString())throw new Ic.InvalidB58Checksum(r);var i=Ws.get(e.version.readUInt32BE(0)),n;n=Ul.encode(Hl.Buffer.concat(t)),e.xprivkey=l.Buffer.from(n);var o=new xB(EB.fromBuffer(e.privateKey),i),a=o.toPublicKey(),s=W.ParentFingerPrintSize,u=o_.sha256ripemd160(a.toBuffer()).slice(0,s);return ro.defineImmutable(this,{xprivkey:n,network:i,depth:e.depth[0],privateKey:o,publicKey:a,fingerPrint:u}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this};W._validateBufferArguments=function(e){var t=function(r,i){var n=e[r];Ug(l.Buffer.isBuffer(n),r+" argument is not a buffer"),Ug(n.length===i,r+" has not the expected size: found "+n.length+", expected "+i)};t("version",W.VersionSize),t("depth",W.DepthSize),t("parentFingerPrint",W.ParentFingerPrintSize),t("childIndex",W.ChildIndexSize),t("chainCode",W.ChainCodeSize),t("privateKey",W.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",W.CheckSumSize)};W.prototype.toString=function(){return this.xprivkey};W.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"};W.prototype.toObject=W.prototype.toJSON=function(){return{network:Ws.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}};W.fromBuffer=function(e){return new W(e.toString())};W.fromHex=function(e){return W.fromBuffer(l.Buffer.from(e,"hex"))};W.prototype.toBuffer=function(){return l.Buffer.from(this.toString())};W.prototype.toHex=function(){return this.toBuffer().toString("hex")};W.DefaultDepth=0;W.DefaultFingerprint=0;W.DefaultChildIndex=0;W.Hardened=2147483648;W.MaxIndex=2*W.Hardened;W.RootElementAlias=["m","M","m'","M'"];W.VersionSize=4;W.DepthSize=1;W.ParentFingerPrintSize=4;W.ChildIndexSize=4;W.ChainCodeSize=32;W.PrivateKeySize=32;W.CheckSumSize=4;W.DataLength=78;W.SerializedByteSize=82;W.VersionStart=0;W.VersionEnd=W.VersionStart+W.VersionSize;W.DepthStart=W.VersionEnd;W.DepthEnd=W.DepthStart+W.DepthSize;W.ParentFingerPrintStart=W.DepthEnd;W.ParentFingerPrintEnd=W.ParentFingerPrintStart+W.ParentFingerPrintSize;W.ChildIndexStart=W.ParentFingerPrintEnd;W.ChildIndexEnd=W.ChildIndexStart+W.ChildIndexSize;W.ChainCodeStart=W.ChildIndexEnd;W.ChainCodeEnd=W.ChainCodeStart+W.ChainCodeSize;W.PrivateKeyStart=W.ChainCodeEnd+1;W.PrivateKeyEnd=W.PrivateKeyStart+W.PrivateKeySize;W.ChecksumStart=W.PrivateKeyEnd;W.ChecksumEnd=W.ChecksumStart+W.CheckSumSize;Ug(W.ChecksumEnd===W.SerializedByteSize);IB.exports=W});var RB=R((xoe,PB)=>{"use strict";p();var uG=ke(),Hg=Ve(),cG=Ur(),fG=Kt(),OB=Si(),AB=Qi(),a_=On(),TB=at(),lG=uG.sha256sha256,hG=Gr(),Oc=Oe(),Bt=function e(t){return this instanceof e?(Oc.checkArgument(Hg.isString(t)||l.Buffer.isBuffer(t),"First argument should be a string or Buffer"),Hg.isString(t)&&(this.messageBuffer=l.Buffer.from(t)),l.Buffer.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};Bt.sign=function(e,t){return new Bt(e).sign(t)};Bt.verify=function(e,t,r){return new Bt(e).verify(t,r)};Bt.MAGIC_BYTES=l.Buffer.from(`Bitcoin Signed Message:
|
|
70
70
|
`);Bt.prototype.magicHash=function(){var t=AB.varintBufNum(Bt.MAGIC_BYTES.length),r=AB.varintBufNum(this.messageBuffer.length),i=l.Buffer.concat([t,Bt.MAGIC_BYTES,r,this.messageBuffer]),n=lG(i);return n};Bt.prototype._sign=function(t){Oc.checkArgument(t instanceof cG,"First argument should be an instance of PrivateKey");var r=this.magicHash();return a_.signWithCalcI(r,t)};Bt.prototype.sign=function(t){var r=this._sign(t);return r.toCompact().toString("base64")};Bt.prototype._verify=function(t,r){Oc.checkArgument(t instanceof fG,"First argument should be an instance of PublicKey"),Oc.checkArgument(r instanceof TB,"Second argument should be an instance of Signature");var i=this.magicHash(),n=a_.verify(i,r,t);return n||(this.error="The signature was invalid"),n};Bt.prototype.verify=function(t,r){Oc.checkArgument(t),Oc.checkArgument(r&&Hg.isString(r)),Hg.isString(t)&&(t=OB.fromString(t));var i=TB.fromCompact(l.Buffer.from(r,"base64")),n=new a_;n.hashbuf=this.magicHash(),n.sig=i;var o=n.toPublicKey(),a=OB.fromPublicKey(o,t.network);return t.toString()!==a.toString()?(this.error="The signature did not match the message digest",!1):this._verify(o,i)};Bt.fromString=function(e){return new Bt(e)};Bt.fromJSON=function(t){return hG.isValidJSON(t)&&(t=JSON.parse(t)),Bt.fromObject(t)};Bt.prototype.toObject=function(){return{messageHex:this.messageBuffer.toString("hex")}};Bt.fromObject=function(e){let t=l.Buffer.from(e.messageHex,"hex");return new Bt(t)};Bt.prototype.toJSON=function(){return JSON.stringify(this.toObject())};Bt.prototype.toString=function(){return this.messageBuffer.toString()};Bt.prototype.inspect=function(){return"<Message: "+this.toString()+">"};PB.exports=Bt});var BB=R((Ooe,kB)=>{p();kB.exports=RB()});var LB=R((Toe,CB)=>{"use strict";p();var NB=Dt();function dG(e,t,r,i){var n=64;if(i>(Math.pow(2,32)-1)*n)throw Error("Requested key length too long");if(typeof e!="string"&&!l.Buffer.isBuffer(e))throw new TypeError("key must a string or Buffer");if(typeof t!="string"&&!l.Buffer.isBuffer(t))throw new TypeError("salt must a string or Buffer");typeof e=="string"&&(e=l.Buffer.from(e)),typeof t=="string"&&(t=l.Buffer.from(t));var o=l.Buffer.alloc(i),a=l.Buffer.alloc(n),s=l.Buffer.alloc(n),u=l.Buffer.alloc(t.length+4),c=Math.ceil(i/n),f=i-(c-1)*n;t.copy(u,0,0,t.length);for(var d=1;d<=c;d++){u[t.length+0]=d>>24&255,u[t.length+1]=d>>16&255,u[t.length+2]=d>>8&255,u[t.length+3]=d>>0&255,a=NB.createHmac("sha512",e).update(u).digest(),a.copy(s,0,0,n);for(var m=1;m<r;m++){a=NB.createHmac("sha512",e).update(a).digest();for(var y=0;y<n;y++)s[y]^=a[y]}var w=(d-1)*n,T=d===c?f:n;s.copy(o,w,0,T)}return o}CB.exports=dG});var qB=R((Roe,DB)=>{"use strict";p();var MB=ke();function pG(e,t,r,i){var n=64;if(i>(Math.pow(2,32)-1)*n)throw Error("Requested key length too long");if(typeof e!="string"&&!l.Buffer.isBuffer(e))throw new TypeError("key must a string or Buffer");if(typeof t!="string"&&!l.Buffer.isBuffer(t))throw new TypeError("salt must a string or Buffer");typeof e=="string"&&(e=l.Buffer.from(e)),typeof t=="string"&&(t=l.Buffer.from(t));var o=l.Buffer.alloc(i),a=l.Buffer.alloc(n),s=l.Buffer.alloc(n),u=l.Buffer.alloc(t.length+4),c=Math.ceil(i/n),f=i-(c-1)*n;t.copy(u,0,0,t.length);for(var d=1;d<=c;d++){u[t.length+0]=d>>24&255,u[t.length+1]=d>>16&255,u[t.length+2]=d>>8&255,u[t.length+3]=d>>0&255,a=MB.sha512hmac(u,e),a.copy(s,0,0,n);for(var m=1;m<r;m++){a=MB.sha512hmac(a,e);for(var y=0;y<n;y++)s[y]^=a[y]}var w=(d-1)*n,T=d===c?f:n;s.copy(o,w,0,T)}return o}DB.exports=pG});var UB=R((Boe,FB)=>{"use strict";p();var gG="87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854";function mG(){var e;try{e=Dt()}catch{return!1}if(!e||typeof e.createHmac!="function")return!1;try{var t=e.createHmac("sha512",l.Buffer.alloc(20,11)).update("Hi There").digest("hex");return t===gG}catch{return!1}}FB.exports=mG()?LB():qB()});var jB=R((Coe,HB)=>{"use strict";p();var vG={name:"Mnemonic",message:"Internal Error on bsv-mnemonic module {0}",errors:[{name:"InvalidEntropy",message:"Entropy length must be an even multiple of 11 bits: {0}"},{name:"UnknownWordlist",message:"Could not detect the used word list: {0}"},{name:"InvalidMnemonic",message:"Mnemonic string is invalid: {0}"}]};HB.exports=ti().extend(vG)});var KB=R((Moe,zB)=>{"use strict";p();var yG=["\u7684","\u4E00","\u662F","\u5728","\u4E0D","\u4E86","\u6709","\u548C","\u4EBA","\u8FD9","\u4E2D","\u5927","\u4E3A","\u4E0A","\u4E2A","\u56FD","\u6211","\u4EE5","\u8981","\u4ED6","\u65F6","\u6765","\u7528","\u4EEC","\u751F","\u5230","\u4F5C","\u5730","\u4E8E","\u51FA","\u5C31","\u5206","\u5BF9","\u6210","\u4F1A","\u53EF","\u4E3B","\u53D1","\u5E74","\u52A8","\u540C","\u5DE5","\u4E5F","\u80FD","\u4E0B","\u8FC7","\u5B50","\u8BF4","\u4EA7","\u79CD","\u9762","\u800C","\u65B9","\u540E","\u591A","\u5B9A","\u884C","\u5B66","\u6CD5","\u6240","\u6C11","\u5F97","\u7ECF","\u5341","\u4E09","\u4E4B","\u8FDB","\u7740","\u7B49","\u90E8","\u5EA6","\u5BB6","\u7535","\u529B","\u91CC","\u5982","\u6C34","\u5316","\u9AD8","\u81EA","\u4E8C","\u7406","\u8D77","\u5C0F","\u7269","\u73B0","\u5B9E","\u52A0","\u91CF","\u90FD","\u4E24","\u4F53","\u5236","\u673A","\u5F53","\u4F7F","\u70B9","\u4ECE","\u4E1A","\u672C","\u53BB","\u628A","\u6027","\u597D","\u5E94","\u5F00","\u5B83","\u5408","\u8FD8","\u56E0","\u7531","\u5176","\u4E9B","\u7136","\u524D","\u5916","\u5929","\u653F","\u56DB","\u65E5","\u90A3","\u793E","\u4E49","\u4E8B","\u5E73","\u5F62","\u76F8","\u5168","\u8868","\u95F4","\u6837","\u4E0E","\u5173","\u5404","\u91CD","\u65B0","\u7EBF","\u5185","\u6570","\u6B63","\u5FC3","\u53CD","\u4F60","\u660E","\u770B","\u539F","\u53C8","\u4E48","\u5229","\u6BD4","\u6216","\u4F46","\u8D28","\u6C14","\u7B2C","\u5411","\u9053","\u547D","\u6B64","\u53D8","\u6761","\u53EA","\u6CA1","\u7ED3","\u89E3","\u95EE","\u610F","\u5EFA","\u6708","\u516C","\u65E0","\u7CFB","\u519B","\u5F88","\u60C5","\u8005","\u6700","\u7ACB","\u4EE3","\u60F3","\u5DF2","\u901A","\u5E76","\u63D0","\u76F4","\u9898","\u515A","\u7A0B","\u5C55","\u4E94","\u679C","\u6599","\u8C61","\u5458","\u9769","\u4F4D","\u5165","\u5E38","\u6587","\u603B","\u6B21","\u54C1","\u5F0F","\u6D3B","\u8BBE","\u53CA","\u7BA1","\u7279","\u4EF6","\u957F","\u6C42","\u8001","\u5934","\u57FA","\u8D44","\u8FB9","\u6D41","\u8DEF","\u7EA7","\u5C11","\u56FE","\u5C71","\u7EDF","\u63A5","\u77E5","\u8F83","\u5C06","\u7EC4","\u89C1","\u8BA1","\u522B","\u5979","\u624B","\u89D2","\u671F","\u6839","\u8BBA","\u8FD0","\u519C","\u6307","\u51E0","\u4E5D","\u533A","\u5F3A","\u653E","\u51B3","\u897F","\u88AB","\u5E72","\u505A","\u5FC5","\u6218","\u5148","\u56DE","\u5219","\u4EFB","\u53D6","\u636E","\u5904","\u961F","\u5357","\u7ED9","\u8272","\u5149","\u95E8","\u5373","\u4FDD","\u6CBB","\u5317","\u9020","\u767E","\u89C4","\u70ED","\u9886","\u4E03","\u6D77","\u53E3","\u4E1C","\u5BFC","\u5668","\u538B","\u5FD7","\u4E16","\u91D1","\u589E","\u4E89","\u6D4E","\u9636","\u6CB9","\u601D","\u672F","\u6781","\u4EA4","\u53D7","\u8054","\u4EC0","\u8BA4","\u516D","\u5171","\u6743","\u6536","\u8BC1","\u6539","\u6E05","\u7F8E","\u518D","\u91C7","\u8F6C","\u66F4","\u5355","\u98CE","\u5207","\u6253","\u767D","\u6559","\u901F","\u82B1","\u5E26","\u5B89","\u573A","\u8EAB","\u8F66","\u4F8B","\u771F","\u52A1","\u5177","\u4E07","\u6BCF","\u76EE","\u81F3","\u8FBE","\u8D70","\u79EF","\u793A","\u8BAE","\u58F0","\u62A5","\u6597","\u5B8C","\u7C7B","\u516B","\u79BB","\u534E","\u540D","\u786E","\u624D","\u79D1","\u5F20","\u4FE1","\u9A6C","\u8282","\u8BDD","\u7C73","\u6574","\u7A7A","\u5143","\u51B5","\u4ECA","\u96C6","\u6E29","\u4F20","\u571F","\u8BB8","\u6B65","\u7FA4","\u5E7F","\u77F3","\u8BB0","\u9700","\u6BB5","\u7814","\u754C","\u62C9","\u6797","\u5F8B","\u53EB","\u4E14","\u7A76","\u89C2","\u8D8A","\u7EC7","\u88C5","\u5F71","\u7B97","\u4F4E","\u6301","\u97F3","\u4F17","\u4E66","\u5E03","\u590D","\u5BB9","\u513F","\u987B","\u9645","\u5546","\u975E","\u9A8C","\u8FDE","\u65AD","\u6DF1","\u96BE","\u8FD1","\u77FF","\u5343","\u5468","\u59D4","\u7D20","\u6280","\u5907","\u534A","\u529E","\u9752","\u7701","\u5217","\u4E60","\u54CD","\u7EA6","\u652F","\u822C","\u53F2","\u611F","\u52B3","\u4FBF","\u56E2","\u5F80","\u9178","\u5386","\u5E02","\u514B","\u4F55","\u9664","\u6D88","\u6784","\u5E9C","\u79F0","\u592A","\u51C6","\u7CBE","\u503C","\u53F7","\u7387","\u65CF","\u7EF4","\u5212","\u9009","\u6807","\u5199","\u5B58","\u5019","\u6BDB","\u4EB2","\u5FEB","\u6548","\u65AF","\u9662","\u67E5","\u6C5F","\u578B","\u773C","\u738B","\u6309","\u683C","\u517B","\u6613","\u7F6E","\u6D3E","\u5C42","\u7247","\u59CB","\u5374","\u4E13","\u72B6","\u80B2","\u5382","\u4EAC","\u8BC6","\u9002","\u5C5E","\u5706","\u5305","\u706B","\u4F4F","\u8C03","\u6EE1","\u53BF","\u5C40","\u7167","\u53C2","\u7EA2","\u7EC6","\u5F15","\u542C","\u8BE5","\u94C1","\u4EF7","\u4E25","\u9996","\u5E95","\u6DB2","\u5B98","\u5FB7","\u968F","\u75C5","\u82CF","\u5931","\u5C14","\u6B7B","\u8BB2","\u914D","\u5973","\u9EC4","\u63A8","\u663E","\u8C08","\u7F6A","\u795E","\u827A","\u5462","\u5E2D","\u542B","\u4F01","\u671B","\u5BC6","\u6279","\u8425","\u9879","\u9632","\u4E3E","\u7403","\u82F1","\u6C27","\u52BF","\u544A","\u674E","\u53F0","\u843D","\u6728","\u5E2E","\u8F6E","\u7834","\u4E9A","\u5E08","\u56F4","\u6CE8","\u8FDC","\u5B57","\u6750","\u6392","\u4F9B","\u6CB3","\u6001","\u5C01","\u53E6","\u65BD","\u51CF","\u6811","\u6EB6","\u600E","\u6B62","\u6848","\u8A00","\u58EB","\u5747","\u6B66","\u56FA","\u53F6","\u9C7C","\u6CE2","\u89C6","\u4EC5","\u8D39","\u7D27","\u7231","\u5DE6","\u7AE0","\u65E9","\u671D","\u5BB3","\u7EED","\u8F7B","\u670D","\u8BD5","\u98DF","\u5145","\u5175","\u6E90","\u5224","\u62A4","\u53F8","\u8DB3","\u67D0","\u7EC3","\u5DEE","\u81F4","\u677F","\u7530","\u964D","\u9ED1","\u72AF","\u8D1F","\u51FB","\u8303","\u7EE7","\u5174","\u4F3C","\u4F59","\u575A","\u66F2","\u8F93","\u4FEE","\u6545","\u57CE","\u592B","\u591F","\u9001","\u7B14","\u8239","\u5360","\u53F3","\u8D22","\u5403","\u5BCC","\u6625","\u804C","\u89C9","\u6C49","\u753B","\u529F","\u5DF4","\u8DDF","\u867D","\u6742","\u98DE","\u68C0","\u5438","\u52A9","\u5347","\u9633","\u4E92","\u521D","\u521B","\u6297","\u8003","\u6295","\u574F","\u7B56","\u53E4","\u5F84","\u6362","\u672A","\u8DD1","\u7559","\u94A2","\u66FE","\u7AEF","\u8D23","\u7AD9","\u7B80","\u8FF0","\u94B1","\u526F","\u5C3D","\u5E1D","\u5C04","\u8349","\u51B2","\u627F","\u72EC","\u4EE4","\u9650","\u963F","\u5BA3","\u73AF","\u53CC","\u8BF7","\u8D85","\u5FAE","\u8BA9","\u63A7","\u5DDE","\u826F","\u8F74","\u627E","\u5426","\u7EAA","\u76CA","\u4F9D","\u4F18","\u9876","\u7840","\u8F7D","\u5012","\u623F","\u7A81","\u5750","\u7C89","\u654C","\u7565","\u5BA2","\u8881","\u51B7","\u80DC","\u7EDD","\u6790","\u5757","\u5242","\u6D4B","\u4E1D","\u534F","\u8BC9","\u5FF5","\u9648","\u4ECD","\u7F57","\u76D0","\u53CB","\u6D0B","\u9519","\u82E6","\u591C","\u5211","\u79FB","\u9891","\u9010","\u9760","\u6DF7","\u6BCD","\u77ED","\u76AE","\u7EC8","\u805A","\u6C7D","\u6751","\u4E91","\u54EA","\u65E2","\u8DDD","\u536B","\u505C","\u70C8","\u592E","\u5BDF","\u70E7","\u8FC5","\u5883","\u82E5","\u5370","\u6D32","\u523B","\u62EC","\u6FC0","\u5B54","\u641E","\u751A","\u5BA4","\u5F85","\u6838","\u6821","\u6563","\u4FB5","\u5427","\u7532","\u6E38","\u4E45","\u83DC","\u5473","\u65E7","\u6A21","\u6E56","\u8D27","\u635F","\u9884","\u963B","\u6BEB","\u666E","\u7A33","\u4E59","\u5988","\u690D","\u606F","\u6269","\u94F6","\u8BED","\u6325","\u9152","\u5B88","\u62FF","\u5E8F","\u7EB8","\u533B","\u7F3A","\u96E8","\u5417","\u9488","\u5218","\u554A","\u6025","\u5531","\u8BEF","\u8BAD","\u613F","\u5BA1","\u9644","\u83B7","\u8336","\u9C9C","\u7CAE","\u65A4","\u5B69","\u8131","\u786B","\u80A5","\u5584","\u9F99","\u6F14","\u7236","\u6E10","\u8840","\u6B22","\u68B0","\u638C","\u6B4C","\u6C99","\u521A","\u653B","\u8C13","\u76FE","\u8BA8","\u665A","\u7C92","\u4E71","\u71C3","\u77DB","\u4E4E","\u6740","\u836F","\u5B81","\u9C81","\u8D35","\u949F","\u7164","\u8BFB","\u73ED","\u4F2F","\u9999","\u4ECB","\u8FEB","\u53E5","\u4E30","\u57F9","\u63E1","\u5170","\u62C5","\u5F26","\u86CB","\u6C89","\u5047","\u7A7F","\u6267","\u7B54","\u4E50","\u8C01","\u987A","\u70DF","\u7F29","\u5F81","\u8138","\u559C","\u677E","\u811A","\u56F0","\u5F02","\u514D","\u80CC","\u661F","\u798F","\u4E70","\u67D3","\u4E95","\u6982","\u6162","\u6015","\u78C1","\u500D","\u7956","\u7687","\u4FC3","\u9759","\u8865","\u8BC4","\u7FFB","\u8089","\u8DF5","\u5C3C","\u8863","\u5BBD","\u626C","\u68C9","\u5E0C","\u4F24","\u64CD","\u5782","\u79CB","\u5B9C","\u6C22","\u5957","\u7763","\u632F","\u67B6","\u4EAE","\u672B","\u5BAA","\u5E86","\u7F16","\u725B","\u89E6","\u6620","\u96F7","\u9500","\u8BD7","\u5EA7","\u5C45","\u6293","\u88C2","\u80DE","\u547C","\u5A18","\u666F","\u5A01","\u7EFF","\u6676","\u539A","\u76DF","\u8861","\u9E21","\u5B59","\u5EF6","\u5371","\u80F6","\u5C4B","\u4E61","\u4E34","\u9646","\u987E","\u6389","\u5440","\u706F","\u5C81","\u63AA","\u675F","\u8010","\u5267","\u7389","\u8D75","\u8DF3","\u54E5","\u5B63","\u8BFE","\u51EF","\u80E1","\u989D","\u6B3E","\u7ECD","\u5377","\u9F50","\u4F1F","\u84B8","\u6B96","\u6C38","\u5B97","\u82D7","\u5DDD","\u7089","\u5CA9","\u5F31","\u96F6","\u6768","\u594F","\u6CBF","\u9732","\u6746","\u63A2","\u6ED1","\u9547","\u996D","\u6D53","\u822A","\u6000","\u8D76","\u5E93","\u593A","\u4F0A","\u7075","\u7A0E","\u9014","\u706D","\u8D5B","\u5F52","\u53EC","\u9F13","\u64AD","\u76D8","\u88C1","\u9669","\u5EB7","\u552F","\u5F55","\u83CC","\u7EAF","\u501F","\u7CD6","\u76D6","\u6A2A","\u7B26","\u79C1","\u52AA","\u5802","\u57DF","\u67AA","\u6DA6","\u5E45","\u54C8","\u7ADF","\u719F","\u866B","\u6CFD","\u8111","\u58E4","\u78B3","\u6B27","\u904D","\u4FA7","\u5BE8","\u6562","\u5F7B","\u8651","\u659C","\u8584","\u5EAD","\u7EB3","\u5F39","\u9972","\u4F38","\u6298","\u9EA6","\u6E7F","\u6697","\u8377","\u74E6","\u585E","\u5E8A","\u7B51","\u6076","\u6237","\u8BBF","\u5854","\u5947","\u900F","\u6881","\u5200","\u65CB","\u8FF9","\u5361","\u6C2F","\u9047","\u4EFD","\u6BD2","\u6CE5","\u9000","\u6D17","\u6446","\u7070","\u5F69","\u5356","\u8017","\u590F","\u62E9","\u5FD9","\u94DC","\u732E","\u786C","\u4E88","\u7E41","\u5708","\u96EA","\u51FD","\u4EA6","\u62BD","\u7BC7","\u9635","\u9634","\u4E01","\u5C3A","\u8FFD","\u5806","\u96C4","\u8FCE","\u6CDB","\u7238","\u697C","\u907F","\u8C0B","\u5428","\u91CE","\u732A","\u65D7","\u7D2F","\u504F","\u5178","\u9986","\u7D22","\u79E6","\u8102","\u6F6E","\u7237","\u8C46","\u5FFD","\u6258","\u60CA","\u5851","\u9057","\u6108","\u6731","\u66FF","\u7EA4","\u7C97","\u503E","\u5C1A","\u75DB","\u695A","\u8C22","\u594B","\u8D2D","\u78E8","\u541B","\u6C60","\u65C1","\u788E","\u9AA8","\u76D1","\u6355","\u5F1F","\u66B4","\u5272","\u8D2F","\u6B8A","\u91CA","\u8BCD","\u4EA1","\u58C1","\u987F","\u5B9D","\u5348","\u5C18","\u95FB","\u63ED","\u70AE","\u6B8B","\u51AC","\u6865","\u5987","\u8B66","\u7EFC","\u62DB","\u5434","\u4ED8","\u6D6E","\u906D","\u5F90","\u60A8","\u6447","\u8C37","\u8D5E","\u7BB1","\u9694","\u8BA2","\u7537","\u5439","\u56ED","\u7EB7","\u5510","\u8D25","\u5B8B","\u73BB","\u5DE8","\u8015","\u5766","\u8363","\u95ED","\u6E7E","\u952E","\u51E1","\u9A7B","\u9505","\u6551","\u6069","\u5265","\u51DD","\u78B1","\u9F7F","\u622A","\u70BC","\u9EBB","\u7EBA","\u7981","\u5E9F","\u76DB","\u7248","\u7F13","\u51C0","\u775B","\u660C","\u5A5A","\u6D89","\u7B52","\u5634","\u63D2","\u5CB8","\u6717","\u5E84","\u8857","\u85CF","\u59D1","\u8D38","\u8150","\u5974","\u5566","\u60EF","\u4E58","\u4F19","\u6062","\u5300","\u7EB1","\u624E","\u8FA9","\u8033","\u5F6A","\u81E3","\u4EBF","\u7483","\u62B5","\u8109","\u79C0","\u8428","\u4FC4","\u7F51","\u821E","\u5E97","\u55B7","\u7EB5","\u5BF8","\u6C57","\u6302","\u6D2A","\u8D3A","\u95EA","\u67EC","\u7206","\u70EF","\u6D25","\u7A3B","\u5899","\u8F6F","\u52C7","\u50CF","\u6EDA","\u5398","\u8499","\u82B3","\u80AF","\u5761","\u67F1","\u8361","\u817F","\u4EEA","\u65C5","\u5C3E","\u8F67","\u51B0","\u8D21","\u767B","\u9ECE","\u524A","\u94BB","\u52D2","\u9003","\u969C","\u6C28","\u90ED","\u5CF0","\u5E01","\u6E2F","\u4F0F","\u8F68","\u4EA9","\u6BD5","\u64E6","\u83AB","\u523A","\u6D6A","\u79D8","\u63F4","\u682A","\u5065","\u552E","\u80A1","\u5C9B","\u7518","\u6CE1","\u7761","\u7AE5","\u94F8","\u6C64","\u9600","\u4F11","\u6C47","\u820D","\u7267","\u7ED5","\u70B8","\u54F2","\u78F7","\u7EE9","\u670B","\u6DE1","\u5C16","\u542F","\u9677","\u67F4","\u5448","\u5F92","\u989C","\u6CEA","\u7A0D","\u5FD8","\u6CF5","\u84DD","\u62D6","\u6D1E","\u6388","\u955C","\u8F9B","\u58EE","\u950B","\u8D2B","\u865A","\u5F2F","\u6469","\u6CF0","\u5E7C","\u5EF7","\u5C0A","\u7A97","\u7EB2","\u5F04","\u96B6","\u7591","\u6C0F","\u5BAB","\u59D0","\u9707","\u745E","\u602A","\u5C24","\u7434","\u5FAA","\u63CF","\u819C","\u8FDD","\u5939","\u8170","\u7F18","\u73E0","\u7A77","\u68EE","\u679D","\u7AF9","\u6C9F","\u50AC","\u7EF3","\u5FC6","\u90A6","\u5269","\u5E78","\u6D46","\u680F","\u62E5","\u7259","\u8D2E","\u793C","\u6EE4","\u94A0","\u7EB9","\u7F62","\u62CD","\u54B1","\u558A","\u8896","\u57C3","\u52E4","\u7F5A","\u7126","\u6F5C","\u4F0D","\u58A8","\u6B32","\u7F1D","\u59D3","\u520A","\u9971","\u4EFF","\u5956","\u94DD","\u9B3C","\u4E3D","\u8DE8","\u9ED8","\u6316","\u94FE","\u626B","\u559D","\u888B","\u70AD","\u6C61","\u5E55","\u8BF8","\u5F27","\u52B1","\u6885","\u5976","\u6D01","\u707E","\u821F","\u9274","\u82EF","\u8BBC","\u62B1","\u6BC1","\u61C2","\u5BD2","\u667A","\u57D4","\u5BC4","\u5C4A","\u8DC3","\u6E21","\u6311","\u4E39","\u8270","\u8D1D","\u78B0","\u62D4","\u7239","\u6234","\u7801","\u68A6","\u82BD","\u7194","\u8D64","\u6E14","\u54ED","\u656C","\u9897","\u5954","\u94C5","\u4EF2","\u864E","\u7A00","\u59B9","\u4E4F","\u73CD","\u7533","\u684C","\u9075","\u5141","\u9686","\u87BA","\u4ED3","\u9B4F","\u9510","\u6653","\u6C2E","\u517C","\u9690","\u788D","\u8D6B","\u62E8","\u5FE0","\u8083","\u7F38","\u7275","\u62A2","\u535A","\u5DE7","\u58F3","\u5144","\u675C","\u8BAF","\u8BDA","\u78A7","\u7965","\u67EF","\u9875","\u5DE1","\u77E9","\u60B2","\u704C","\u9F84","\u4F26","\u7968","\u5BFB","\u6842","\u94FA","\u5723","\u6050","\u6070","\u90D1","\u8DA3","\u62AC","\u8352","\u817E","\u8D34","\u67D4","\u6EF4","\u731B","\u9614","\u8F86","\u59BB","\u586B","\u64A4","\u50A8","\u7B7E","\u95F9","\u6270","\u7D2B","\u7802","\u9012","\u620F","\u540A","\u9676","\u4F10","\u5582","\u7597","\u74F6","\u5A46","\u629A","\u81C2","\u6478","\u5FCD","\u867E","\u8721","\u90BB","\u80F8","\u5DE9","\u6324","\u5076","\u5F03","\u69FD","\u52B2","\u4E73","\u9093","\u5409","\u4EC1","\u70C2","\u7816","\u79DF","\u4E4C","\u8230","\u4F34","\u74DC","\u6D45","\u4E19","\u6682","\u71E5","\u6A61","\u67F3","\u8FF7","\u6696","\u724C","\u79E7","\u80C6","\u8BE6","\u7C27","\u8E0F","\u74F7","\u8C31","\u5446","\u5BBE","\u7CCA","\u6D1B","\u8F89","\u6124","\u7ADE","\u9699","\u6012","\u7C98","\u4E43","\u7EEA","\u80A9","\u7C4D","\u654F","\u6D82","\u7199","\u7686","\u4FA6","\u60AC","\u6398","\u4EAB","\u7EA0","\u9192","\u72C2","\u9501","\u6DC0","\u6068","\u7272","\u9738","\u722C","\u8D4F","\u9006","\u73A9","\u9675","\u795D","\u79D2","\u6D59","\u8C8C","\u5F79","\u5F7C","\u6089","\u9E2D","\u8D8B","\u51E4","\u6668","\u755C","\u8F88","\u79E9","\u5375","\u7F72","\u68AF","\u708E","\u6EE9","\u68CB","\u9A71","\u7B5B","\u5CE1","\u5192","\u5565","\u5BFF","\u8BD1","\u6D78","\u6CC9","\u5E3D","\u8FDF","\u7845","\u7586","\u8D37","\u6F0F","\u7A3F","\u51A0","\u5AE9","\u80C1","\u82AF","\u7262","\u53DB","\u8680","\u5965","\u9E23","\u5CAD","\u7F8A","\u51ED","\u4E32","\u5858","\u7ED8","\u9175","\u878D","\u76C6","\u9521","\u5E99","\u7B79","\u51BB","\u8F85","\u6444","\u88AD","\u7B4B","\u62D2","\u50DA","\u65F1","\u94BE","\u9E1F","\u6F06","\u6C88","\u7709","\u758F","\u6DFB","\u68D2","\u7A57","\u785D","\u97E9","\u903C","\u626D","\u4FA8","\u51C9","\u633A","\u7897","\u683D","\u7092","\u676F","\u60A3","\u998F","\u529D","\u8C6A","\u8FBD","\u52C3","\u9E3F","\u65E6","\u540F","\u62DC","\u72D7","\u57CB","\u8F8A","\u63A9","\u996E","\u642C","\u9A82","\u8F9E","\u52FE","\u6263","\u4F30","\u848B","\u7ED2","\u96FE","\u4E08","\u6735","\u59C6","\u62DF","\u5B87","\u8F91","\u9655","\u96D5","\u507F","\u84C4","\u5D07","\u526A","\u5021","\u5385","\u54AC","\u9A76","\u85AF","\u5237","\u65A5","\u756A","\u8D4B","\u5949","\u4F5B","\u6D47","\u6F2B","\u66FC","\u6247","\u9499","\u6843","\u6276","\u4ED4","\u8FD4","\u4FD7","\u4E8F","\u8154","\u978B","\u68F1","\u8986","\u6846","\u6084","\u53D4","\u649E","\u9A97","\u52D8","\u65FA","\u6CB8","\u5B64","\u5410","\u5B5F","\u6E20","\u5C48","\u75BE","\u5999","\u60DC","\u4EF0","\u72E0","\u80C0","\u8C10","\u629B","\u9709","\u6851","\u5C97","\u561B","\u8870","\u76D7","\u6E17","\u810F","\u8D56","\u6D8C","\u751C","\u66F9","\u9605","\u808C","\u54E9","\u5389","\u70C3","\u7EAC","\u6BC5","\u6628","\u4F2A","\u75C7","\u716E","\u53F9","\u9489","\u642D","\u830E","\u7B3C","\u9177","\u5077","\u5F13","\u9525","\u6052","\u6770","\u5751","\u9F3B","\u7FFC","\u7EB6","\u53D9","\u72F1","\u902E","\u7F50","\u7EDC","\u68DA","\u6291","\u81A8","\u852C","\u5BFA","\u9AA4","\u7A46","\u51B6","\u67AF","\u518C","\u5C38","\u51F8","\u7EC5","\u576F","\u727A","\u7130","\u8F70","\u6B23","\u664B","\u7626","\u5FA1","\u952D","\u9526","\u4E27","\u65EC","\u953B","\u5784","\u641C","\u6251","\u9080","\u4EAD","\u916F","\u8FC8","\u8212","\u8106","\u9176","\u95F2","\u5FE7","\u915A","\u987D","\u7FBD","\u6DA8","\u5378","\u4ED7","\u966A","\u8F9F","\u60E9","\u676D","\u59DA","\u809A","\u6349","\u98D8","\u6F02","\u6606","\u6B3A","\u543E","\u90CE","\u70F7","\u6C41","\u5475","\u9970","\u8427","\u96C5","\u90AE","\u8FC1","\u71D5","\u6492","\u59FB","\u8D74","\u5BB4","\u70E6","\u503A","\u5E10","\u6591","\u94C3","\u65E8","\u9187","\u8463","\u997C","\u96CF","\u59FF","\u62CC","\u5085","\u8179","\u59A5","\u63C9","\u8D24","\u62C6","\u6B6A","\u8461","\u80FA","\u4E22","\u6D69","\u5FBD","\u6602","\u57AB","\u6321","\u89C8","\u8D2A","\u6170","\u7F34","\u6C6A","\u614C","\u51AF","\u8BFA","\u59DC","\u8C0A","\u51F6","\u52A3","\u8BEC","\u8000","\u660F","\u8EBA","\u76C8","\u9A91","\u4E54","\u6EAA","\u4E1B","\u5362","\u62B9","\u95F7","\u54A8","\u522E","\u9A7E","\u7F06","\u609F","\u6458","\u94D2","\u63B7","\u9887","\u5E7B","\u67C4","\u60E0","\u60E8","\u4F73","\u4EC7","\u814A","\u7A9D","\u6DA4","\u5251","\u77A7","\u5821","\u6CFC","\u8471","\u7F69","\u970D","\u635E","\u80CE","\u82CD","\u6EE8","\u4FE9","\u6345","\u6E58","\u780D","\u971E","\u90B5","\u8404","\u75AF","\u6DEE","\u9042","\u718A","\u7CAA","\u70D8","\u5BBF","\u6863","\u6208","\u9A73","\u5AC2","\u88D5","\u5F99","\u7BAD","\u6350","\u80A0","\u6491","\u6652","\u8FA8","\u6BBF","\u83B2","\u644A","\u6405","\u9171","\u5C4F","\u75AB","\u54C0","\u8521","\u5835","\u6CAB","\u76B1","\u7545","\u53E0","\u9601","\u83B1","\u6572","\u8F96","\u94A9","\u75D5","\u575D","\u5DF7","\u997F","\u7978","\u4E18","\u7384","\u6E9C","\u66F0","\u903B","\u5F6D","\u5C1D","\u537F","\u59A8","\u8247","\u541E","\u97E6","\u6028","\u77EE","\u6B47"];zB.exports=yG});var GB=R((qoe,VB)=>{"use strict";p();var bG=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];VB.exports=bG});var ZB=R((Uoe,WB)=>{"use string";p();var _G=["abaisser","abandon","abdiquer","abeille","abolir","aborder","aboutir","aboyer","abrasif","abreuver","abriter","abroger","abrupt","absence","absolu","absurde","abusif","abyssal","acade\u0301mie","acajou","acarien","accabler","accepter","acclamer","accolade","accroche","accuser","acerbe","achat","acheter","aciduler","acier","acompte","acque\u0301rir","acronyme","acteur","actif","actuel","adepte","ade\u0301quat","adhe\u0301sif","adjectif","adjuger","admettre","admirer","adopter","adorer","adoucir","adresse","adroit","adulte","adverbe","ae\u0301rer","ae\u0301ronef","affaire","affecter","affiche","affreux","affubler","agacer","agencer","agile","agiter","agrafer","agre\u0301able","agrume","aider","aiguille","ailier","aimable","aisance","ajouter","ajuster","alarmer","alchimie","alerte","alge\u0300bre","algue","alie\u0301ner","aliment","alle\u0301ger","alliage","allouer","allumer","alourdir","alpaga","altesse","alve\u0301ole","amateur","ambigu","ambre","ame\u0301nager","amertume","amidon","amiral","amorcer","amour","amovible","amphibie","ampleur","amusant","analyse","anaphore","anarchie","anatomie","ancien","ane\u0301antir","angle","angoisse","anguleux","animal","annexer","annonce","annuel","anodin","anomalie","anonyme","anormal","antenne","antidote","anxieux","apaiser","ape\u0301ritif","aplanir","apologie","appareil","appeler","apporter","appuyer","aquarium","aqueduc","arbitre","arbuste","ardeur","ardoise","argent","arlequin","armature","armement","armoire","armure","arpenter","arracher","arriver","arroser","arsenic","arte\u0301riel","article","aspect","asphalte","aspirer","assaut","asservir","assiette","associer","assurer","asticot","astre","astuce","atelier","atome","atrium","atroce","attaque","attentif","attirer","attraper","aubaine","auberge","audace","audible","augurer","aurore","automne","autruche","avaler","avancer","avarice","avenir","averse","aveugle","aviateur","avide","avion","aviser","avoine","avouer","avril","axial","axiome","badge","bafouer","bagage","baguette","baignade","balancer","balcon","baleine","balisage","bambin","bancaire","bandage","banlieue","bannie\u0300re","banquier","barbier","baril","baron","barque","barrage","bassin","bastion","bataille","bateau","batterie","baudrier","bavarder","belette","be\u0301lier","belote","be\u0301ne\u0301fice","berceau","berger","berline","bermuda","besace","besogne","be\u0301tail","beurre","biberon","bicycle","bidule","bijou","bilan","bilingue","billard","binaire","biologie","biopsie","biotype","biscuit","bison","bistouri","bitume","bizarre","blafard","blague","blanchir","blessant","blinder","blond","bloquer","blouson","bobard","bobine","boire","boiser","bolide","bonbon","bondir","bonheur","bonifier","bonus","bordure","borne","botte","boucle","boueux","bougie","boulon","bouquin","bourse","boussole","boutique","boxeur","branche","brasier","brave","brebis","bre\u0300che","breuvage","bricoler","brigade","brillant","brioche","brique","brochure","broder","bronzer","brousse","broyeur","brume","brusque","brutal","bruyant","buffle","buisson","bulletin","bureau","burin","bustier","butiner","butoir","buvable","buvette","cabanon","cabine","cachette","cadeau","cadre","cafe\u0301ine","caillou","caisson","calculer","calepin","calibre","calmer","calomnie","calvaire","camarade","came\u0301ra","camion","campagne","canal","caneton","canon","cantine","canular","capable","caporal","caprice","capsule","capter","capuche","carabine","carbone","caresser","caribou","carnage","carotte","carreau","carton","cascade","casier","casque","cassure","causer","caution","cavalier","caverne","caviar","ce\u0301dille","ceinture","ce\u0301leste","cellule","cendrier","censurer","central","cercle","ce\u0301re\u0301bral","cerise","cerner","cerveau","cesser","chagrin","chaise","chaleur","chambre","chance","chapitre","charbon","chasseur","chaton","chausson","chavirer","chemise","chenille","che\u0301quier","chercher","cheval","chien","chiffre","chignon","chime\u0300re","chiot","chlorure","chocolat","choisir","chose","chouette","chrome","chute","cigare","cigogne","cimenter","cine\u0301ma","cintrer","circuler","cirer","cirque","citerne","citoyen","citron","civil","clairon","clameur","claquer","classe","clavier","client","cligner","climat","clivage","cloche","clonage","cloporte","cobalt","cobra","cocasse","cocotier","coder","codifier","coffre","cogner","cohe\u0301sion","coiffer","coincer","cole\u0300re","colibri","colline","colmater","colonel","combat","come\u0301die","commande","compact","concert","conduire","confier","congeler","connoter","consonne","contact","convexe","copain","copie","corail","corbeau","cordage","corniche","corpus","correct","corte\u0300ge","cosmique","costume","coton","coude","coupure","courage","couteau","couvrir","coyote","crabe","crainte","cravate","crayon","cre\u0301ature","cre\u0301diter","cre\u0301meux","creuser","crevette","cribler","crier","cristal","crite\u0300re","croire","croquer","crotale","crucial","cruel","crypter","cubique","cueillir","cuille\u0300re","cuisine","cuivre","culminer","cultiver","cumuler","cupide","curatif","curseur","cyanure","cycle","cylindre","cynique","daigner","damier","danger","danseur","dauphin","de\u0301battre","de\u0301biter","de\u0301border","de\u0301brider","de\u0301butant","de\u0301caler","de\u0301cembre","de\u0301chirer","de\u0301cider","de\u0301clarer","de\u0301corer","de\u0301crire","de\u0301cupler","de\u0301dale","de\u0301ductif","de\u0301esse","de\u0301fensif","de\u0301filer","de\u0301frayer","de\u0301gager","de\u0301givrer","de\u0301glutir","de\u0301grafer","de\u0301jeuner","de\u0301lice","de\u0301loger","demander","demeurer","de\u0301molir","de\u0301nicher","de\u0301nouer","dentelle","de\u0301nuder","de\u0301part","de\u0301penser","de\u0301phaser","de\u0301placer","de\u0301poser","de\u0301ranger","de\u0301rober","de\u0301sastre","descente","de\u0301sert","de\u0301signer","de\u0301sobe\u0301ir","dessiner","destrier","de\u0301tacher","de\u0301tester","de\u0301tourer","de\u0301tresse","devancer","devenir","deviner","devoir","diable","dialogue","diamant","dicter","diffe\u0301rer","dige\u0301rer","digital","digne","diluer","dimanche","diminuer","dioxyde","directif","diriger","discuter","disposer","dissiper","distance","divertir","diviser","docile","docteur","dogme","doigt","domaine","domicile","dompter","donateur","donjon","donner","dopamine","dortoir","dorure","dosage","doseur","dossier","dotation","douanier","double","douceur","douter","doyen","dragon","draper","dresser","dribbler","droiture","duperie","duplexe","durable","durcir","dynastie","e\u0301blouir","e\u0301carter","e\u0301charpe","e\u0301chelle","e\u0301clairer","e\u0301clipse","e\u0301clore","e\u0301cluse","e\u0301cole","e\u0301conomie","e\u0301corce","e\u0301couter","e\u0301craser","e\u0301cre\u0301mer","e\u0301crivain","e\u0301crou","e\u0301cume","e\u0301cureuil","e\u0301difier","e\u0301duquer","effacer","effectif","effigie","effort","effrayer","effusion","e\u0301galiser","e\u0301garer","e\u0301jecter","e\u0301laborer","e\u0301largir","e\u0301lectron","e\u0301le\u0301gant","e\u0301le\u0301phant","e\u0301le\u0300ve","e\u0301ligible","e\u0301litisme","e\u0301loge","e\u0301lucider","e\u0301luder","emballer","embellir","embryon","e\u0301meraude","e\u0301mission","emmener","e\u0301motion","e\u0301mouvoir","empereur","employer","emporter","emprise","e\u0301mulsion","encadrer","enche\u0300re","enclave","encoche","endiguer","endosser","endroit","enduire","e\u0301nergie","enfance","enfermer","enfouir","engager","engin","englober","e\u0301nigme","enjamber","enjeu","enlever","ennemi","ennuyeux","enrichir","enrobage","enseigne","entasser","entendre","entier","entourer","entraver","e\u0301nume\u0301rer","envahir","enviable","envoyer","enzyme","e\u0301olien","e\u0301paissir","e\u0301pargne","e\u0301patant","e\u0301paule","e\u0301picerie","e\u0301pide\u0301mie","e\u0301pier","e\u0301pilogue","e\u0301pine","e\u0301pisode","e\u0301pitaphe","e\u0301poque","e\u0301preuve","e\u0301prouver","e\u0301puisant","e\u0301querre","e\u0301quipe","e\u0301riger","e\u0301rosion","erreur","e\u0301ruption","escalier","espadon","espe\u0300ce","espie\u0300gle","espoir","esprit","esquiver","essayer","essence","essieu","essorer","estime","estomac","estrade","e\u0301tage\u0300re","e\u0301taler","e\u0301tanche","e\u0301tatique","e\u0301teindre","e\u0301tendoir","e\u0301ternel","e\u0301thanol","e\u0301thique","ethnie","e\u0301tirer","e\u0301toffer","e\u0301toile","e\u0301tonnant","e\u0301tourdir","e\u0301trange","e\u0301troit","e\u0301tude","euphorie","e\u0301valuer","e\u0301vasion","e\u0301ventail","e\u0301vidence","e\u0301viter","e\u0301volutif","e\u0301voquer","exact","exage\u0301rer","exaucer","exceller","excitant","exclusif","excuse","exe\u0301cuter","exemple","exercer","exhaler","exhorter","exigence","exiler","exister","exotique","expe\u0301dier","explorer","exposer","exprimer","exquis","extensif","extraire","exulter","fable","fabuleux","facette","facile","facture","faiblir","falaise","fameux","famille","farceur","farfelu","farine","farouche","fasciner","fatal","fatigue","faucon","fautif","faveur","favori","fe\u0301brile","fe\u0301conder","fe\u0301de\u0301rer","fe\u0301lin","femme","fe\u0301mur","fendoir","fe\u0301odal","fermer","fe\u0301roce","ferveur","festival","feuille","feutre","fe\u0301vrier","fiasco","ficeler","fictif","fide\u0300le","figure","filature","filetage","filie\u0300re","filleul","filmer","filou","filtrer","financer","finir","fiole","firme","fissure","fixer","flairer","flamme","flasque","flatteur","fle\u0301au","fle\u0300che","fleur","flexion","flocon","flore","fluctuer","fluide","fluvial","folie","fonderie","fongible","fontaine","forcer","forgeron","formuler","fortune","fossile","foudre","fouge\u0300re","fouiller","foulure","fourmi","fragile","fraise","franchir","frapper","frayeur","fre\u0301gate","freiner","frelon","fre\u0301mir","fre\u0301ne\u0301sie","fre\u0300re","friable","friction","frisson","frivole","froid","fromage","frontal","frotter","fruit","fugitif","fuite","fureur","furieux","furtif","fusion","futur","gagner","galaxie","galerie","gambader","garantir","gardien","garnir","garrigue","gazelle","gazon","ge\u0301ant","ge\u0301latine","ge\u0301lule","gendarme","ge\u0301ne\u0301ral","ge\u0301nie","genou","gentil","ge\u0301ologie","ge\u0301ome\u0300tre","ge\u0301ranium","germe","gestuel","geyser","gibier","gicler","girafe","givre","glace","glaive","glisser","globe","gloire","glorieux","golfeur","gomme","gonfler","gorge","gorille","goudron","gouffre","goulot","goupille","gourmand","goutte","graduel","graffiti","graine","grand","grappin","gratuit","gravir","grenat","griffure","griller","grimper","grogner","gronder","grotte","groupe","gruger","grutier","gruye\u0300re","gue\u0301pard","guerrier","guide","guimauve","guitare","gustatif","gymnaste","gyrostat","habitude","hachoir","halte","hameau","hangar","hanneton","haricot","harmonie","harpon","hasard","he\u0301lium","he\u0301matome","herbe","he\u0301risson","hermine","he\u0301ron","he\u0301siter","heureux","hiberner","hibou","hilarant","histoire","hiver","homard","hommage","homoge\u0300ne","honneur","honorer","honteux","horde","horizon","horloge","hormone","horrible","houleux","housse","hublot","huileux","humain","humble","humide","humour","hurler","hydromel","hygie\u0300ne","hymne","hypnose","idylle","ignorer","iguane","illicite","illusion","image","imbiber","imiter","immense","immobile","immuable","impact","impe\u0301rial","implorer","imposer","imprimer","imputer","incarner","incendie","incident","incliner","incolore","indexer","indice","inductif","ine\u0301dit","ineptie","inexact","infini","infliger","informer","infusion","inge\u0301rer","inhaler","inhiber","injecter","injure","innocent","inoculer","inonder","inscrire","insecte","insigne","insolite","inspirer","instinct","insulter","intact","intense","intime","intrigue","intuitif","inutile","invasion","inventer","inviter","invoquer","ironique","irradier","irre\u0301el","irriter","isoler","ivoire","ivresse","jaguar","jaillir","jambe","janvier","jardin","jauger","jaune","javelot","jetable","jeton","jeudi","jeunesse","joindre","joncher","jongler","joueur","jouissif","journal","jovial","joyau","joyeux","jubiler","jugement","junior","jupon","juriste","justice","juteux","juve\u0301nile","kayak","kimono","kiosque","label","labial","labourer","lace\u0301rer","lactose","lagune","laine","laisser","laitier","lambeau","lamelle","lampe","lanceur","langage","lanterne","lapin","largeur","larme","laurier","lavabo","lavoir","lecture","le\u0301gal","le\u0301ger","le\u0301gume","lessive","lettre","levier","lexique","le\u0301zard","liasse","libe\u0301rer","libre","licence","licorne","lie\u0300ge","lie\u0300vre","ligature","ligoter","ligue","limer","limite","limonade","limpide","line\u0301aire","lingot","lionceau","liquide","lisie\u0300re","lister","lithium","litige","littoral","livreur","logique","lointain","loisir","lombric","loterie","louer","lourd","loutre","louve","loyal","lubie","lucide","lucratif","lueur","lugubre","luisant","lumie\u0300re","lunaire","lundi","luron","lutter","luxueux","machine","magasin","magenta","magique","maigre","maillon","maintien","mairie","maison","majorer","malaxer","male\u0301fice","malheur","malice","mallette","mammouth","mandater","maniable","manquant","manteau","manuel","marathon","marbre","marchand","mardi","maritime","marqueur","marron","marteler","mascotte","massif","mate\u0301riel","matie\u0300re","matraque","maudire","maussade","mauve","maximal","me\u0301chant","me\u0301connu","me\u0301daille","me\u0301decin","me\u0301diter","me\u0301duse","meilleur","me\u0301lange","me\u0301lodie","membre","me\u0301moire","menacer","mener","menhir","mensonge","mentor","mercredi","me\u0301rite","merle","messager","mesure","me\u0301tal","me\u0301te\u0301ore","me\u0301thode","me\u0301tier","meuble","miauler","microbe","miette","mignon","migrer","milieu","million","mimique","mince","mine\u0301ral","minimal","minorer","minute","miracle","miroiter","missile","mixte","mobile","moderne","moelleux","mondial","moniteur","monnaie","monotone","monstre","montagne","monument","moqueur","morceau","morsure","mortier","moteur","motif","mouche","moufle","moulin","mousson","mouton","mouvant","multiple","munition","muraille","mure\u0300ne","murmure","muscle","muse\u0301um","musicien","mutation","muter","mutuel","myriade","myrtille","myste\u0300re","mythique","nageur","nappe","narquois","narrer","natation","nation","nature","naufrage","nautique","navire","ne\u0301buleux","nectar","ne\u0301faste","ne\u0301gation","ne\u0301gliger","ne\u0301gocier","neige","nerveux","nettoyer","neurone","neutron","neveu","niche","nickel","nitrate","niveau","noble","nocif","nocturne","noirceur","noisette","nomade","nombreux","nommer","normatif","notable","notifier","notoire","nourrir","nouveau","novateur","novembre","novice","nuage","nuancer","nuire","nuisible","nume\u0301ro","nuptial","nuque","nutritif","obe\u0301ir","objectif","obliger","obscur","observer","obstacle","obtenir","obturer","occasion","occuper","oce\u0301an","octobre","octroyer","octupler","oculaire","odeur","odorant","offenser","officier","offrir","ogive","oiseau","oisillon","olfactif","olivier","ombrage","omettre","onctueux","onduler","one\u0301reux","onirique","opale","opaque","ope\u0301rer","opinion","opportun","opprimer","opter","optique","orageux","orange","orbite","ordonner","oreille","organe","orgueil","orifice","ornement","orque","ortie","osciller","osmose","ossature","otarie","ouragan","ourson","outil","outrager","ouvrage","ovation","oxyde","oxyge\u0300ne","ozone","paisible","palace","palmare\u0300s","palourde","palper","panache","panda","pangolin","paniquer","panneau","panorama","pantalon","papaye","papier","papoter","papyrus","paradoxe","parcelle","paresse","parfumer","parler","parole","parrain","parsemer","partager","parure","parvenir","passion","paste\u0300que","paternel","patience","patron","pavillon","pavoiser","payer","paysage","peigne","peintre","pelage","pe\u0301lican","pelle","pelouse","peluche","pendule","pe\u0301ne\u0301trer","pe\u0301nible","pensif","pe\u0301nurie","pe\u0301pite","pe\u0301plum","perdrix","perforer","pe\u0301riode","permuter","perplexe","persil","perte","peser","pe\u0301tale","petit","pe\u0301trir","peuple","pharaon","phobie","phoque","photon","phrase","physique","piano","pictural","pie\u0300ce","pierre","pieuvre","pilote","pinceau","pipette","piquer","pirogue","piscine","piston","pivoter","pixel","pizza","placard","plafond","plaisir","planer","plaque","plastron","plateau","pleurer","plexus","pliage","plomb","plonger","pluie","plumage","pochette","poe\u0301sie","poe\u0300te","pointe","poirier","poisson","poivre","polaire","policier","pollen","polygone","pommade","pompier","ponctuel","ponde\u0301rer","poney","portique","position","posse\u0301der","posture","potager","poteau","potion","pouce","poulain","poumon","pourpre","poussin","pouvoir","prairie","pratique","pre\u0301cieux","pre\u0301dire","pre\u0301fixe","pre\u0301lude","pre\u0301nom","pre\u0301sence","pre\u0301texte","pre\u0301voir","primitif","prince","prison","priver","proble\u0300me","proce\u0301der","prodige","profond","progre\u0300s","proie","projeter","prologue","promener","propre","prospe\u0300re","prote\u0301ger","prouesse","proverbe","prudence","pruneau","psychose","public","puceron","puiser","pulpe","pulsar","punaise","punitif","pupitre","purifier","puzzle","pyramide","quasar","querelle","question","quie\u0301tude","quitter","quotient","racine","raconter","radieux","ragondin","raideur","raisin","ralentir","rallonge","ramasser","rapide","rasage","ratisser","ravager","ravin","rayonner","re\u0301actif","re\u0301agir","re\u0301aliser","re\u0301animer","recevoir","re\u0301citer","re\u0301clamer","re\u0301colter","recruter","reculer","recycler","re\u0301diger","redouter","refaire","re\u0301flexe","re\u0301former","refrain","refuge","re\u0301galien","re\u0301gion","re\u0301glage","re\u0301gulier","re\u0301ite\u0301rer","rejeter","rejouer","relatif","relever","relief","remarque","reme\u0300de","remise","remonter","remplir","remuer","renard","renfort","renifler","renoncer","rentrer","renvoi","replier","reporter","reprise","reptile","requin","re\u0301serve","re\u0301sineux","re\u0301soudre","respect","rester","re\u0301sultat","re\u0301tablir","retenir","re\u0301ticule","retomber","retracer","re\u0301union","re\u0301ussir","revanche","revivre","re\u0301volte","re\u0301vulsif","richesse","rideau","rieur","rigide","rigoler","rincer","riposter","risible","risque","rituel","rival","rivie\u0300re","rocheux","romance","rompre","ronce","rondin","roseau","rosier","rotatif","rotor","rotule","rouge","rouille","rouleau","routine","royaume","ruban","rubis","ruche","ruelle","rugueux","ruiner","ruisseau","ruser","rustique","rythme","sabler","saboter","sabre","sacoche","safari","sagesse","saisir","salade","salive","salon","saluer","samedi","sanction","sanglier","sarcasme","sardine","saturer","saugrenu","saumon","sauter","sauvage","savant","savonner","scalpel","scandale","sce\u0301le\u0301rat","sce\u0301nario","sceptre","sche\u0301ma","science","scinder","score","scrutin","sculpter","se\u0301ance","se\u0301cable","se\u0301cher","secouer","se\u0301cre\u0301ter","se\u0301datif","se\u0301duire","seigneur","se\u0301jour","se\u0301lectif","semaine","sembler","semence","se\u0301minal","se\u0301nateur","sensible","sentence","se\u0301parer","se\u0301quence","serein","sergent","se\u0301rieux","serrure","se\u0301rum","service","se\u0301same","se\u0301vir","sevrage","sextuple","side\u0301ral","sie\u0300cle","sie\u0301ger","siffler","sigle","signal","silence","silicium","simple","since\u0300re","sinistre","siphon","sirop","sismique","situer","skier","social","socle","sodium","soigneux","soldat","soleil","solitude","soluble","sombre","sommeil","somnoler","sonde","songeur","sonnette","sonore","sorcier","sortir","sosie","sottise","soucieux","soudure","souffle","soulever","soupape","source","soutirer","souvenir","spacieux","spatial","spe\u0301cial","sphe\u0300re","spiral","stable","station","sternum","stimulus","stipuler","strict","studieux","stupeur","styliste","sublime","substrat","subtil","subvenir","succe\u0300s","sucre","suffixe","sugge\u0301rer","suiveur","sulfate","superbe","supplier","surface","suricate","surmener","surprise","sursaut","survie","suspect","syllabe","symbole","syme\u0301trie","synapse","syntaxe","syste\u0300me","tabac","tablier","tactile","tailler","talent","talisman","talonner","tambour","tamiser","tangible","tapis","taquiner","tarder","tarif","tartine","tasse","tatami","tatouage","taupe","taureau","taxer","te\u0301moin","temporel","tenaille","tendre","teneur","tenir","tension","terminer","terne","terrible","te\u0301tine","texte","the\u0300me","the\u0301orie","the\u0301rapie","thorax","tibia","tie\u0300de","timide","tirelire","tiroir","tissu","titane","titre","tituber","toboggan","tole\u0301rant","tomate","tonique","tonneau","toponyme","torche","tordre","tornade","torpille","torrent","torse","tortue","totem","toucher","tournage","tousser","toxine","traction","trafic","tragique","trahir","train","trancher","travail","tre\u0300fle","tremper","tre\u0301sor","treuil","triage","tribunal","tricoter","trilogie","triomphe","tripler","triturer","trivial","trombone","tronc","tropical","troupeau","tuile","tulipe","tumulte","tunnel","turbine","tuteur","tutoyer","tuyau","tympan","typhon","typique","tyran","ubuesque","ultime","ultrason","unanime","unifier","union","unique","unitaire","univers","uranium","urbain","urticant","usage","usine","usuel","usure","utile","utopie","vacarme","vaccin","vagabond","vague","vaillant","vaincre","vaisseau","valable","valise","vallon","valve","vampire","vanille","vapeur","varier","vaseux","vassal","vaste","vecteur","vedette","ve\u0301ge\u0301tal","ve\u0301hicule","veinard","ve\u0301loce","vendredi","ve\u0301ne\u0301rer","venger","venimeux","ventouse","verdure","ve\u0301rin","vernir","verrou","verser","vertu","veston","ve\u0301te\u0301ran","ve\u0301tuste","vexant","vexer","viaduc","viande","victoire","vidange","vide\u0301o","vignette","vigueur","vilain","village","vinaigre","violon","vipe\u0300re","virement","virtuose","virus","visage","viseur","vision","visqueux","visuel","vital","vitesse","viticole","vitrine","vivace","vivipare","vocation","voguer","voile","voisin","voiture","volaille","volcan","voltiger","volume","vorace","vortex","voter","vouloir","voyage","voyelle","wagon","xe\u0301non","yacht","ze\u0300bre","ze\u0301nith","zeste","zoologie"];WB.exports=_G});var $B=R((joe,YB)=>{"use strict";p();var SG=["abaco","abbaglio","abbinato","abete","abisso","abolire","abrasivo","abrogato","accadere","accenno","accusato","acetone","achille","acido","acqua","acre","acrilico","acrobata","acuto","adagio","addebito","addome","adeguato","aderire","adipe","adottare","adulare","affabile","affetto","affisso","affranto","aforisma","afoso","africano","agave","agente","agevole","aggancio","agire","agitare","agonismo","agricolo","agrumeto","aguzzo","alabarda","alato","albatro","alberato","albo","albume","alce","alcolico","alettone","alfa","algebra","aliante","alibi","alimento","allagato","allegro","allievo","allodola","allusivo","almeno","alogeno","alpaca","alpestre","altalena","alterno","alticcio","altrove","alunno","alveolo","alzare","amalgama","amanita","amarena","ambito","ambrato","ameba","america","ametista","amico","ammasso","ammenda","ammirare","ammonito","amore","ampio","ampliare","amuleto","anacardo","anagrafe","analista","anarchia","anatra","anca","ancella","ancora","andare","andrea","anello","angelo","angolare","angusto","anima","annegare","annidato","anno","annuncio","anonimo","anticipo","anzi","apatico","apertura","apode","apparire","appetito","appoggio","approdo","appunto","aprile","arabica","arachide","aragosta","araldica","arancio","aratura","arazzo","arbitro","archivio","ardito","arenile","argento","argine","arguto","aria","armonia","arnese","arredato","arringa","arrosto","arsenico","arso","artefice","arzillo","asciutto","ascolto","asepsi","asettico","asfalto","asino","asola","aspirato","aspro","assaggio","asse","assoluto","assurdo","asta","astenuto","astice","astratto","atavico","ateismo","atomico","atono","attesa","attivare","attorno","attrito","attuale","ausilio","austria","autista","autonomo","autunno","avanzato","avere","avvenire","avviso","avvolgere","azione","azoto","azzimo","azzurro","babele","baccano","bacino","baco","badessa","badilata","bagnato","baita","balcone","baldo","balena","ballata","balzano","bambino","bandire","baraonda","barbaro","barca","baritono","barlume","barocco","basilico","basso","batosta","battuto","baule","bava","bavosa","becco","beffa","belgio","belva","benda","benevole","benigno","benzina","bere","berlina","beta","bibita","bici","bidone","bifido","biga","bilancia","bimbo","binocolo","biologo","bipede","bipolare","birbante","birra","biscotto","bisesto","bisnonno","bisonte","bisturi","bizzarro","blando","blatta","bollito","bonifico","bordo","bosco","botanico","bottino","bozzolo","braccio","bradipo","brama","branca","bravura","bretella","brevetto","brezza","briglia","brillante","brindare","broccolo","brodo","bronzina","brullo","bruno","bubbone","buca","budino","buffone","buio","bulbo","buono","burlone","burrasca","bussola","busta","cadetto","caduco","calamaro","calcolo","calesse","calibro","calmo","caloria","cambusa","camerata","camicia","cammino","camola","campale","canapa","candela","cane","canino","canotto","cantina","capace","capello","capitolo","capogiro","cappero","capra","capsula","carapace","carcassa","cardo","carisma","carovana","carretto","cartolina","casaccio","cascata","caserma","caso","cassone","castello","casuale","catasta","catena","catrame","cauto","cavillo","cedibile","cedrata","cefalo","celebre","cellulare","cena","cenone","centesimo","ceramica","cercare","certo","cerume","cervello","cesoia","cespo","ceto","chela","chiaro","chicca","chiedere","chimera","china","chirurgo","chitarra","ciao","ciclismo","cifrare","cigno","cilindro","ciottolo","circa","cirrosi","citrico","cittadino","ciuffo","civetta","civile","classico","clinica","cloro","cocco","codardo","codice","coerente","cognome","collare","colmato","colore","colposo","coltivato","colza","coma","cometa","commando","comodo","computer","comune","conciso","condurre","conferma","congelare","coniuge","connesso","conoscere","consumo","continuo","convegno","coperto","copione","coppia","copricapo","corazza","cordata","coricato","cornice","corolla","corpo","corredo","corsia","cortese","cosmico","costante","cottura","covato","cratere","cravatta","creato","credere","cremoso","crescita","creta","criceto","crinale","crisi","critico","croce","cronaca","crostata","cruciale","crusca","cucire","cuculo","cugino","cullato","cupola","curatore","cursore","curvo","cuscino","custode","dado","daino","dalmata","damerino","daniela","dannoso","danzare","datato","davanti","davvero","debutto","decennio","deciso","declino","decollo","decreto","dedicato","definito","deforme","degno","delegare","delfino","delirio","delta","demenza","denotato","dentro","deposito","derapata","derivare","deroga","descritto","deserto","desiderio","desumere","detersivo","devoto","diametro","dicembre","diedro","difeso","diffuso","digerire","digitale","diluvio","dinamico","dinnanzi","dipinto","diploma","dipolo","diradare","dire","dirotto","dirupo","disagio","discreto","disfare","disgelo","disposto","distanza","disumano","dito","divano","divelto","dividere","divorato","doblone","docente","doganale","dogma","dolce","domato","domenica","dominare","dondolo","dono","dormire","dote","dottore","dovuto","dozzina","drago","druido","dubbio","dubitare","ducale","duna","duomo","duplice","duraturo","ebano","eccesso","ecco","eclissi","economia","edera","edicola","edile","editoria","educare","egemonia","egli","egoismo","egregio","elaborato","elargire","elegante","elencato","eletto","elevare","elfico","elica","elmo","elsa","eluso","emanato","emblema","emesso","emiro","emotivo","emozione","empirico","emulo","endemico","enduro","energia","enfasi","enoteca","entrare","enzima","epatite","epilogo","episodio","epocale","eppure","equatore","erario","erba","erboso","erede","eremita","erigere","ermetico","eroe","erosivo","errante","esagono","esame","esanime","esaudire","esca","esempio","esercito","esibito","esigente","esistere","esito","esofago","esortato","esoso","espanso","espresso","essenza","esso","esteso","estimare","estonia","estroso","esultare","etilico","etnico","etrusco","etto","euclideo","europa","evaso","evidenza","evitato","evoluto","evviva","fabbrica","faccenda","fachiro","falco","famiglia","fanale","fanfara","fango","fantasma","fare","farfalla","farinoso","farmaco","fascia","fastoso","fasullo","faticare","fato","favoloso","febbre","fecola","fede","fegato","felpa","feltro","femmina","fendere","fenomeno","fermento","ferro","fertile","fessura","festivo","fetta","feudo","fiaba","fiducia","fifa","figurato","filo","finanza","finestra","finire","fiore","fiscale","fisico","fiume","flacone","flamenco","flebo","flemma","florido","fluente","fluoro","fobico","focaccia","focoso","foderato","foglio","folata","folclore","folgore","fondente","fonetico","fonia","fontana","forbito","forchetta","foresta","formica","fornaio","foro","fortezza","forzare","fosfato","fosso","fracasso","frana","frassino","fratello","freccetta","frenata","fresco","frigo","frollino","fronde","frugale","frutta","fucilata","fucsia","fuggente","fulmine","fulvo","fumante","fumetto","fumoso","fune","funzione","fuoco","furbo","furgone","furore","fuso","futile","gabbiano","gaffe","galateo","gallina","galoppo","gambero","gamma","garanzia","garbo","garofano","garzone","gasdotto","gasolio","gastrico","gatto","gaudio","gazebo","gazzella","geco","gelatina","gelso","gemello","gemmato","gene","genitore","gennaio","genotipo","gergo","ghepardo","ghiaccio","ghisa","giallo","gilda","ginepro","giocare","gioiello","giorno","giove","girato","girone","gittata","giudizio","giurato","giusto","globulo","glutine","gnomo","gobba","golf","gomito","gommone","gonfio","gonna","governo","gracile","grado","grafico","grammo","grande","grattare","gravoso","grazia","greca","gregge","grifone","grigio","grinza","grotta","gruppo","guadagno","guaio","guanto","guardare","gufo","guidare","ibernato","icona","identico","idillio","idolo","idra","idrico","idrogeno","igiene","ignaro","ignorato","ilare","illeso","illogico","illudere","imballo","imbevuto","imbocco","imbuto","immane","immerso","immolato","impacco","impeto","impiego","importo","impronta","inalare","inarcare","inattivo","incanto","incendio","inchino","incisivo","incluso","incontro","incrocio","incubo","indagine","india","indole","inedito","infatti","infilare","inflitto","ingaggio","ingegno","inglese","ingordo","ingrosso","innesco","inodore","inoltrare","inondato","insano","insetto","insieme","insonnia","insulina","intasato","intero","intonaco","intuito","inumidire","invalido","invece","invito","iperbole","ipnotico","ipotesi","ippica","iride","irlanda","ironico","irrigato","irrorare","isolato","isotopo","isterico","istituto","istrice","italia","iterare","labbro","labirinto","lacca","lacerato","lacrima","lacuna","laddove","lago","lampo","lancetta","lanterna","lardoso","larga","laringe","lastra","latenza","latino","lattuga","lavagna","lavoro","legale","leggero","lembo","lentezza","lenza","leone","lepre","lesivo","lessato","lesto","letterale","leva","levigato","libero","lido","lievito","lilla","limatura","limitare","limpido","lineare","lingua","liquido","lira","lirica","lisca","lite","litigio","livrea","locanda","lode","logica","lombare","londra","longevo","loquace","lorenzo","loto","lotteria","luce","lucidato","lumaca","luminoso","lungo","lupo","luppolo","lusinga","lusso","lutto","macabro","macchina","macero","macinato","madama","magico","maglia","magnete","magro","maiolica","malafede","malgrado","malinteso","malsano","malto","malumore","mana","mancia","mandorla","mangiare","manifesto","mannaro","manovra","mansarda","mantide","manubrio","mappa","maratona","marcire","maretta","marmo","marsupio","maschera","massaia","mastino","materasso","matricola","mattone","maturo","mazurca","meandro","meccanico","mecenate","medesimo","meditare","mega","melassa","melis","melodia","meninge","meno","mensola","mercurio","merenda","merlo","meschino","mese","messere","mestolo","metallo","metodo","mettere","miagolare","mica","micelio","michele","microbo","midollo","miele","migliore","milano","milite","mimosa","minerale","mini","minore","mirino","mirtillo","miscela","missiva","misto","misurare","mitezza","mitigare","mitra","mittente","mnemonico","modello","modifica","modulo","mogano","mogio","mole","molosso","monastero","monco","mondina","monetario","monile","monotono","monsone","montato","monviso","mora","mordere","morsicato","mostro","motivato","motosega","motto","movenza","movimento","mozzo","mucca","mucosa","muffa","mughetto","mugnaio","mulatto","mulinello","multiplo","mummia","munto","muovere","murale","musa","muscolo","musica","mutevole","muto","nababbo","nafta","nanometro","narciso","narice","narrato","nascere","nastrare","naturale","nautica","naviglio","nebulosa","necrosi","negativo","negozio","nemmeno","neofita","neretto","nervo","nessuno","nettuno","neutrale","neve","nevrotico","nicchia","ninfa","nitido","nobile","nocivo","nodo","nome","nomina","nordico","normale","norvegese","nostrano","notare","notizia","notturno","novella","nucleo","nulla","numero","nuovo","nutrire","nuvola","nuziale","oasi","obbedire","obbligo","obelisco","oblio","obolo","obsoleto","occasione","occhio","occidente","occorrere","occultare","ocra","oculato","odierno","odorare","offerta","offrire","offuscato","oggetto","oggi","ognuno","olandese","olfatto","oliato","oliva","ologramma","oltre","omaggio","ombelico","ombra","omega","omissione","ondoso","onere","onice","onnivoro","onorevole","onta","operato","opinione","opposto","oracolo","orafo","ordine","orecchino","orefice","orfano","organico","origine","orizzonte","orma","ormeggio","ornativo","orologio","orrendo","orribile","ortensia","ortica","orzata","orzo","osare","oscurare","osmosi","ospedale","ospite","ossa","ossidare","ostacolo","oste","otite","otre","ottagono","ottimo","ottobre","ovale","ovest","ovino","oviparo","ovocito","ovunque","ovviare","ozio","pacchetto","pace","pacifico","padella","padrone","paese","paga","pagina","palazzina","palesare","pallido","palo","palude","pandoro","pannello","paolo","paonazzo","paprica","parabola","parcella","parere","pargolo","pari","parlato","parola","partire","parvenza","parziale","passivo","pasticca","patacca","patologia","pattume","pavone","peccato","pedalare","pedonale","peggio","peloso","penare","pendice","penisola","pennuto","penombra","pensare","pentola","pepe","pepita","perbene","percorso","perdonato","perforare","pergamena","periodo","permesso","perno","perplesso","persuaso","pertugio","pervaso","pesatore","pesista","peso","pestifero","petalo","pettine","petulante","pezzo","piacere","pianta","piattino","piccino","picozza","piega","pietra","piffero","pigiama","pigolio","pigro","pila","pilifero","pillola","pilota","pimpante","pineta","pinna","pinolo","pioggia","piombo","piramide","piretico","pirite","pirolisi","pitone","pizzico","placebo","planare","plasma","platano","plenario","pochezza","poderoso","podismo","poesia","poggiare","polenta","poligono","pollice","polmonite","polpetta","polso","poltrona","polvere","pomice","pomodoro","ponte","popoloso","porfido","poroso","porpora","porre","portata","posa","positivo","possesso","postulato","potassio","potere","pranzo","prassi","pratica","precluso","predica","prefisso","pregiato","prelievo","premere","prenotare","preparato","presenza","pretesto","prevalso","prima","principe","privato","problema","procura","produrre","profumo","progetto","prolunga","promessa","pronome","proposta","proroga","proteso","prova","prudente","prugna","prurito","psiche","pubblico","pudica","pugilato","pugno","pulce","pulito","pulsante","puntare","pupazzo","pupilla","puro","quadro","qualcosa","quasi","querela","quota","raccolto","raddoppio","radicale","radunato","raffica","ragazzo","ragione","ragno","ramarro","ramingo","ramo","randagio","rantolare","rapato","rapina","rappreso","rasatura","raschiato","rasente","rassegna","rastrello","rata","ravveduto","reale","recepire","recinto","recluta","recondito","recupero","reddito","redimere","regalato","registro","regola","regresso","relazione","remare","remoto","renna","replica","reprimere","reputare","resa","residente","responso","restauro","rete","retina","retorica","rettifica","revocato","riassunto","ribadire","ribelle","ribrezzo","ricarica","ricco","ricevere","riciclato","ricordo","ricreduto","ridicolo","ridurre","rifasare","riflesso","riforma","rifugio","rigare","rigettato","righello","rilassato","rilevato","rimanere","rimbalzo","rimedio","rimorchio","rinascita","rincaro","rinforzo","rinnovo","rinomato","rinsavito","rintocco","rinuncia","rinvenire","riparato","ripetuto","ripieno","riportare","ripresa","ripulire","risata","rischio","riserva","risibile","riso","rispetto","ristoro","risultato","risvolto","ritardo","ritegno","ritmico","ritrovo","riunione","riva","riverso","rivincita","rivolto","rizoma","roba","robotico","robusto","roccia","roco","rodaggio","rodere","roditore","rogito","rollio","romantico","rompere","ronzio","rosolare","rospo","rotante","rotondo","rotula","rovescio","rubizzo","rubrica","ruga","rullino","rumine","rumoroso","ruolo","rupe","russare","rustico","sabato","sabbiare","sabotato","sagoma","salasso","saldatura","salgemma","salivare","salmone","salone","saltare","saluto","salvo","sapere","sapido","saporito","saraceno","sarcasmo","sarto","sassoso","satellite","satira","satollo","saturno","savana","savio","saziato","sbadiglio","sbalzo","sbancato","sbarra","sbattere","sbavare","sbendare","sbirciare","sbloccato","sbocciato","sbrinare","sbruffone","sbuffare","scabroso","scadenza","scala","scambiare","scandalo","scapola","scarso","scatenare","scavato","scelto","scenico","scettro","scheda","schiena","sciarpa","scienza","scindere","scippo","sciroppo","scivolo","sclerare","scodella","scolpito","scomparto","sconforto","scoprire","scorta","scossone","scozzese","scriba","scrollare","scrutinio","scuderia","scultore","scuola","scuro","scusare","sdebitare","sdoganare","seccatura","secondo","sedano","seggiola","segnalato","segregato","seguito","selciato","selettivo","sella","selvaggio","semaforo","sembrare","seme","seminato","sempre","senso","sentire","sepolto","sequenza","serata","serbato","sereno","serio","serpente","serraglio","servire","sestina","setola","settimana","sfacelo","sfaldare","sfamato","sfarzoso","sfaticato","sfera","sfida","sfilato","sfinge","sfocato","sfoderare","sfogo","sfoltire","sforzato","sfratto","sfruttato","sfuggito","sfumare","sfuso","sgabello","sgarbato","sgonfiare","sgorbio","sgrassato","sguardo","sibilo","siccome","sierra","sigla","signore","silenzio","sillaba","simbolo","simpatico","simulato","sinfonia","singolo","sinistro","sino","sintesi","sinusoide","sipario","sisma","sistole","situato","slitta","slogatura","sloveno","smarrito","smemorato","smentito","smeraldo","smilzo","smontare","smottato","smussato","snellire","snervato","snodo","sobbalzo","sobrio","soccorso","sociale","sodale","soffitto","sogno","soldato","solenne","solido","sollazzo","solo","solubile","solvente","somatico","somma","sonda","sonetto","sonnifero","sopire","soppeso","sopra","sorgere","sorpasso","sorriso","sorso","sorteggio","sorvolato","sospiro","sosta","sottile","spada","spalla","spargere","spatola","spavento","spazzola","specie","spedire","spegnere","spelatura","speranza","spessore","spettrale","spezzato","spia","spigoloso","spillato","spinoso","spirale","splendido","sportivo","sposo","spranga","sprecare","spronato","spruzzo","spuntino","squillo","sradicare","srotolato","stabile","stacco","staffa","stagnare","stampato","stantio","starnuto","stasera","statuto","stelo","steppa","sterzo","stiletto","stima","stirpe","stivale","stizzoso","stonato","storico","strappo","stregato","stridulo","strozzare","strutto","stuccare","stufo","stupendo","subentro","succoso","sudore","suggerito","sugo","sultano","suonare","superbo","supporto","surgelato","surrogato","sussurro","sutura","svagare","svedese","sveglio","svelare","svenuto","svezia","sviluppo","svista","svizzera","svolta","svuotare","tabacco","tabulato","tacciare","taciturno","tale","talismano","tampone","tannino","tara","tardivo","targato","tariffa","tarpare","tartaruga","tasto","tattico","taverna","tavolata","tazza","teca","tecnico","telefono","temerario","tempo","temuto","tendone","tenero","tensione","tentacolo","teorema","terme","terrazzo","terzetto","tesi","tesserato","testato","tetro","tettoia","tifare","tigella","timbro","tinto","tipico","tipografo","tiraggio","tiro","titanio","titolo","titubante","tizio","tizzone","toccare","tollerare","tolto","tombola","tomo","tonfo","tonsilla","topazio","topologia","toppa","torba","tornare","torrone","tortora","toscano","tossire","tostatura","totano","trabocco","trachea","trafila","tragedia","tralcio","tramonto","transito","trapano","trarre","trasloco","trattato","trave","treccia","tremolio","trespolo","tributo","tricheco","trifoglio","trillo","trincea","trio","tristezza","triturato","trivella","tromba","trono","troppo","trottola","trovare","truccato","tubatura","tuffato","tulipano","tumulto","tunisia","turbare","turchino","tuta","tutela","ubicato","uccello","uccisore","udire","uditivo","uffa","ufficio","uguale","ulisse","ultimato","umano","umile","umorismo","uncinetto","ungere","ungherese","unicorno","unificato","unisono","unitario","unte","uovo","upupa","uragano","urgenza","urlo","usanza","usato","uscito","usignolo","usuraio","utensile","utilizzo","utopia","vacante","vaccinato","vagabondo","vagliato","valanga","valgo","valico","valletta","valoroso","valutare","valvola","vampata","vangare","vanitoso","vano","vantaggio","vanvera","vapore","varano","varcato","variante","vasca","vedetta","vedova","veduto","vegetale","veicolo","velcro","velina","velluto","veloce","venato","vendemmia","vento","verace","verbale","vergogna","verifica","vero","verruca","verticale","vescica","vessillo","vestale","veterano","vetrina","vetusto","viandante","vibrante","vicenda","vichingo","vicinanza","vidimare","vigilia","vigneto","vigore","vile","villano","vimini","vincitore","viola","vipera","virgola","virologo","virulento","viscoso","visione","vispo","vissuto","visura","vita","vitello","vittima","vivanda","vivido","viziare","voce","voga","volatile","volere","volpe","voragine","vulcano","zampogna","zanna","zappato","zattera","zavorra","zefiro","zelante","zelo","zenzero","zerbino","zibetto","zinco","zircone","zitto","zolla","zotico","zucchero","zufolo","zulu","zuppa"];YB.exports=SG});var JB=R((Koe,XB)=>{"use strict";p();var wG=["\u3042\u3044\u3053\u304F\u3057\u3093","\u3042\u3044\u3055\u3064","\u3042\u3044\u305F\u3099","\u3042\u304A\u305D\u3099\u3089","\u3042\u304B\u3061\u3083\u3093","\u3042\u304D\u308B","\u3042\u3051\u304B\u3099\u305F","\u3042\u3051\u308B","\u3042\u3053\u304B\u3099\u308C\u308B","\u3042\u3055\u3044","\u3042\u3055\u3072","\u3042\u3057\u3042\u3068","\u3042\u3057\u3099\u308F\u3046","\u3042\u3059\u3099\u304B\u308B","\u3042\u3059\u3099\u304D","\u3042\u305D\u3075\u3099","\u3042\u305F\u3048\u308B","\u3042\u305F\u305F\u3081\u308B","\u3042\u305F\u308A\u307E\u3048","\u3042\u305F\u308B","\u3042\u3064\u3044","\u3042\u3064\u304B\u3046","\u3042\u3063\u3057\u3085\u304F","\u3042\u3064\u307E\u308A","\u3042\u3064\u3081\u308B","\u3042\u3066\u306A","\u3042\u3066\u306F\u307E\u308B","\u3042\u3072\u308B","\u3042\u3075\u3099\u3089","\u3042\u3075\u3099\u308B","\u3042\u3075\u308C\u308B","\u3042\u307E\u3044","\u3042\u307E\u3068\u3099","\u3042\u307E\u3084\u304B\u3059","\u3042\u307E\u308A","\u3042\u307F\u3082\u306E","\u3042\u3081\u308A\u304B","\u3042\u3084\u307E\u308B","\u3042\u3086\u3080","\u3042\u3089\u3044\u304F\u3099\u307E","\u3042\u3089\u3057","\u3042\u3089\u3059\u3057\u3099","\u3042\u3089\u305F\u3081\u308B","\u3042\u3089\u3086\u308B","\u3042\u3089\u308F\u3059","\u3042\u308A\u304B\u3099\u3068\u3046","\u3042\u308F\u305B\u308B","\u3042\u308F\u3066\u308B","\u3042\u3093\u3044","\u3042\u3093\u304B\u3099\u3044","\u3042\u3093\u3053","\u3042\u3093\u305B\u3099\u3093","\u3042\u3093\u3066\u3044","\u3042\u3093\u306A\u3044","\u3042\u3093\u307E\u308A","\u3044\u3044\u305F\u3099\u3059","\u3044\u304A\u3093","\u3044\u304B\u3099\u3044","\u3044\u304B\u3099\u304F","\u3044\u304D\u304A\u3044","\u3044\u304D\u306A\u308A","\u3044\u304D\u3082\u306E","\u3044\u304D\u308B","\u3044\u304F\u3057\u3099","\u3044\u304F\u3075\u3099\u3093","\u3044\u3051\u306F\u3099\u306A","\u3044\u3051\u3093","\u3044\u3053\u3046","\u3044\u3053\u304F","\u3044\u3053\u3064","\u3044\u3055\u307E\u3057\u3044","\u3044\u3055\u3093","\u3044\u3057\u304D","\u3044\u3057\u3099\u3085\u3046","\u3044\u3057\u3099\u3087\u3046","\u3044\u3057\u3099\u308F\u308B","\u3044\u3059\u3099\u307F","\u3044\u3059\u3099\u308C","\u3044\u305B\u3044","\u3044\u305B\u3048\u3072\u3099","\u3044\u305B\u304B\u3044","\u3044\u305B\u304D","\u3044\u305B\u3099\u3093","\u3044\u305D\u3046\u308D\u3046","\u3044\u305D\u304B\u3099\u3057\u3044","\u3044\u305F\u3099\u3044","\u3044\u305F\u3099\u304F","\u3044\u305F\u3059\u3099\u3089","\u3044\u305F\u307F","\u3044\u305F\u308A\u3042","\u3044\u3061\u304A\u3046","\u3044\u3061\u3057\u3099","\u3044\u3061\u3068\u3099","\u3044\u3061\u306F\u3099","\u3044\u3061\u3075\u3099","\u3044\u3061\u308A\u3085\u3046","\u3044\u3064\u304B","\u3044\u3063\u3057\u3085\u3093","\u3044\u3063\u305B\u3044","\u3044\u3063\u305D\u3046","\u3044\u3063\u305F\u3093","\u3044\u3063\u3061","\u3044\u3063\u3066\u3044","\u3044\u3063\u307B\u309A\u3046","\u3044\u3066\u3055\u3099","\u3044\u3066\u3093","\u3044\u3068\u3099\u3046","\u3044\u3068\u3053","\u3044\u306A\u3044","\u3044\u306A\u304B","\u3044\u306D\u3080\u308A","\u3044\u306E\u3061","\u3044\u306E\u308B","\u3044\u306F\u3064","\u3044\u306F\u3099\u308B","\u3044\u306F\u3093","\u3044\u3072\u3099\u304D","\u3044\u3072\u3093","\u3044\u3075\u304F","\u3044\u3078\u3093","\u3044\u307B\u3046","\u3044\u307F\u3093","\u3044\u3082\u3046\u3068","\u3044\u3082\u305F\u308C","\u3044\u3082\u308A","\u3044\u3084\u304B\u3099\u308B","\u3044\u3084\u3059","\u3044\u3088\u304B\u3093","\u3044\u3088\u304F","\u3044\u3089\u3044","\u3044\u3089\u3059\u3068","\u3044\u308A\u304F\u3099\u3061","\u3044\u308A\u3087\u3046","\u3044\u308C\u3044","\u3044\u308C\u3082\u306E","\u3044\u308C\u308B","\u3044\u308D\u3048\u3093\u3072\u309A\u3064","\u3044\u308F\u3044","\u3044\u308F\u3046","\u3044\u308F\u304B\u3093","\u3044\u308F\u306F\u3099","\u3044\u308F\u3086\u308B","\u3044\u3093\u3051\u3099\u3093\u307E\u3081","\u3044\u3093\u3055\u3064","\u3044\u3093\u3057\u3087\u3046","\u3044\u3093\u3088\u3046","\u3046\u3048\u304D","\u3046\u3048\u308B","\u3046\u304A\u3055\u3099","\u3046\u304B\u3099\u3044","\u3046\u304B\u3075\u3099","\u3046\u304B\u3078\u3099\u308B","\u3046\u304D\u308F","\u3046\u304F\u3089\u3044\u306A","\u3046\u304F\u308C\u308C","\u3046\u3051\u305F\u307E\u308F\u308B","\u3046\u3051\u3064\u3051","\u3046\u3051\u3068\u308B","\u3046\u3051\u3082\u3064","\u3046\u3051\u308B","\u3046\u3053\u3099\u304B\u3059","\u3046\u3053\u3099\u304F","\u3046\u3053\u3093","\u3046\u3055\u304D\u3099","\u3046\u3057\u306A\u3046","\u3046\u3057\u308D\u304B\u3099\u307F","\u3046\u3059\u3044","\u3046\u3059\u304D\u3099","\u3046\u3059\u304F\u3099\u3089\u3044","\u3046\u3059\u3081\u308B","\u3046\u305B\u3064","\u3046\u3061\u3042\u308F\u305B","\u3046\u3061\u304B\u3099\u308F","\u3046\u3061\u304D","\u3046\u3061\u3085\u3046","\u3046\u3063\u304B\u308A","\u3046\u3064\u304F\u3057\u3044","\u3046\u3063\u305F\u3048\u308B","\u3046\u3064\u308B","\u3046\u3068\u3099\u3093","\u3046\u306A\u304D\u3099","\u3046\u306A\u3057\u3099","\u3046\u306A\u3059\u3099\u304F","\u3046\u306A\u308B","\u3046\u306D\u308B","\u3046\u306E\u3046","\u3046\u3075\u3099\u3051\u3099","\u3046\u3075\u3099\u3053\u3099\u3048","\u3046\u307E\u308C\u308B","\u3046\u3081\u308B","\u3046\u3082\u3046","\u3046\u3084\u307E\u3046","\u3046\u3088\u304F","\u3046\u3089\u304B\u3099\u3048\u3059","\u3046\u3089\u304F\u3099\u3061","\u3046\u3089\u306A\u3044","\u3046\u308A\u3042\u3051\u3099","\u3046\u308A\u304D\u308C","\u3046\u308B\u3055\u3044","\u3046\u308C\u3057\u3044","\u3046\u308C\u3086\u304D","\u3046\u308C\u308B","\u3046\u308D\u3053","\u3046\u308F\u304D","\u3046\u308F\u3055","\u3046\u3093\u3053\u3046","\u3046\u3093\u3061\u3093","\u3046\u3093\u3066\u3093","\u3046\u3093\u3068\u3099\u3046","\u3048\u3044\u3048\u3093","\u3048\u3044\u304B\u3099","\u3048\u3044\u304D\u3087\u3046","\u3048\u3044\u3053\u3099","\u3048\u3044\u305B\u3044","\u3048\u3044\u3075\u3099\u3093","\u3048\u3044\u3088\u3046","\u3048\u3044\u308F","\u3048\u304A\u308A","\u3048\u304B\u3099\u304A","\u3048\u304B\u3099\u304F","\u3048\u304D\u305F\u3044","\u3048\u304F\u305B\u308B","\u3048\u3057\u3083\u304F","\u3048\u3059\u3066","\u3048\u3064\u3089\u3093","\u3048\u306E\u304F\u3099","\u3048\u307B\u3046\u307E\u304D","\u3048\u307B\u3093","\u3048\u307E\u304D","\u3048\u3082\u3057\u3099","\u3048\u3082\u306E","\u3048\u3089\u3044","\u3048\u3089\u3075\u3099","\u3048\u308A\u3042","\u3048\u3093\u3048\u3093","\u3048\u3093\u304B\u3044","\u3048\u3093\u304D\u3099","\u3048\u3093\u3051\u3099\u304D","\u3048\u3093\u3057\u3085\u3046","\u3048\u3093\u305B\u3099\u3064","\u3048\u3093\u305D\u304F","\u3048\u3093\u3061\u3087\u3046","\u3048\u3093\u3068\u3064","\u304A\u3044\u304B\u3051\u308B","\u304A\u3044\u3053\u3059","\u304A\u3044\u3057\u3044","\u304A\u3044\u3064\u304F","\u304A\u3046\u3048\u3093","\u304A\u3046\u3055\u307E","\u304A\u3046\u3057\u3099","\u304A\u3046\u305B\u3064","\u304A\u3046\u305F\u3044","\u304A\u3046\u3075\u304F","\u304A\u3046\u3078\u3099\u3044","\u304A\u3046\u3088\u3046","\u304A\u3048\u308B","\u304A\u304A\u3044","\u304A\u304A\u3046","\u304A\u304A\u3068\u3099\u304A\u308A","\u304A\u304A\u3084","\u304A\u304A\u3088\u305D","\u304A\u304B\u3048\u308A","\u304A\u304B\u3059\u3099","\u304A\u304B\u3099\u3080","\u304A\u304B\u308F\u308A","\u304A\u304D\u3099\u306A\u3046","\u304A\u304D\u308B","\u304A\u304F\u3055\u307E","\u304A\u304F\u3057\u3099\u3087\u3046","\u304A\u304F\u308A\u304B\u3099\u306A","\u304A\u304F\u308B","\u304A\u304F\u308C\u308B","\u304A\u3053\u3059","\u304A\u3053\u306A\u3046","\u304A\u3053\u308B","\u304A\u3055\u3048\u308B","\u304A\u3055\u306A\u3044","\u304A\u3055\u3081\u308B","\u304A\u3057\u3044\u308C","\u304A\u3057\u3048\u308B","\u304A\u3057\u3099\u304D\u3099","\u304A\u3057\u3099\u3055\u3093","\u304A\u3057\u3083\u308C","\u304A\u305D\u3089\u304F","\u304A\u305D\u308F\u308B","\u304A\u305F\u304B\u3099\u3044","\u304A\u305F\u304F","\u304A\u305F\u3099\u3084\u304B","\u304A\u3061\u3064\u304F","\u304A\u3063\u3068","\u304A\u3064\u308A","\u304A\u3066\u3099\u304B\u3051","\u304A\u3068\u3057\u3082\u306E","\u304A\u3068\u306A\u3057\u3044","\u304A\u3068\u3099\u308A","\u304A\u3068\u3099\u308D\u304B\u3059","\u304A\u306F\u3099\u3055\u3093","\u304A\u307E\u3044\u308A","\u304A\u3081\u3066\u3099\u3068\u3046","\u304A\u3082\u3044\u3066\u3099","\u304A\u3082\u3046","\u304A\u3082\u305F\u3044","\u304A\u3082\u3061\u3083","\u304A\u3084\u3064","\u304A\u3084\u3086\u3072\u3099","\u304A\u3088\u307B\u3099\u3059","\u304A\u3089\u3093\u305F\u3099","\u304A\u308D\u3059","\u304A\u3093\u304B\u3099\u304F","\u304A\u3093\u3051\u3044","\u304A\u3093\u3057\u3083","\u304A\u3093\u305B\u3093","\u304A\u3093\u305F\u3099\u3093","\u304A\u3093\u3061\u3085\u3046","\u304A\u3093\u3068\u3099\u3051\u3044","\u304B\u3042\u3064","\u304B\u3044\u304B\u3099","\u304B\u3099\u3044\u304D","\u304B\u3099\u3044\u3051\u3093","\u304B\u3099\u3044\u3053\u3046","\u304B\u3044\u3055\u3064","\u304B\u3044\u3057\u3083","\u304B\u3044\u3059\u3044\u3088\u304F","\u304B\u3044\u305B\u3099\u3093","\u304B\u3044\u305D\u3099\u3046\u3068\u3099","\u304B\u3044\u3064\u3046","\u304B\u3044\u3066\u3093","\u304B\u3044\u3068\u3046","\u304B\u3044\u3075\u304F","\u304B\u3099\u3044\u3078\u304D","\u304B\u3044\u307B\u3046","\u304B\u3044\u3088\u3046","\u304B\u3099\u3044\u3089\u3044","\u304B\u3044\u308F","\u304B\u3048\u308B","\u304B\u304A\u308A","\u304B\u304B\u3048\u308B","\u304B\u304B\u3099\u304F","\u304B\u304B\u3099\u3057","\u304B\u304B\u3099\u307F","\u304B\u304F\u3053\u3099","\u304B\u304F\u3068\u304F","\u304B\u3055\u3099\u308B","\u304B\u3099\u305D\u3099\u3046","\u304B\u305F\u3044","\u304B\u305F\u3061","\u304B\u3099\u3061\u3087\u3046","\u304B\u3099\u3063\u304D\u3085\u3046","\u304B\u3099\u3063\u3053\u3046","\u304B\u3099\u3063\u3055\u3093","\u304B\u3099\u3063\u3057\u3087\u3046","\u304B\u306A\u3055\u3099\u308F\u3057","\u304B\u306E\u3046","\u304B\u3099\u306F\u304F","\u304B\u3075\u3099\u304B","\u304B\u307B\u3046","\u304B\u307B\u3053\u3099","\u304B\u307E\u3046","\u304B\u307E\u307B\u3099\u3053","\u304B\u3081\u308C\u304A\u3093","\u304B\u3086\u3044","\u304B\u3088\u3046\u3072\u3099","\u304B\u3089\u3044","\u304B\u308B\u3044","\u304B\u308D\u3046","\u304B\u308F\u304F","\u304B\u308F\u3089","\u304B\u3099\u3093\u304B","\u304B\u3093\u3051\u3044","\u304B\u3093\u3053\u3046","\u304B\u3093\u3057\u3083","\u304B\u3093\u305D\u3046","\u304B\u3093\u305F\u3093","\u304B\u3093\u3061","\u304B\u3099\u3093\u306F\u3099\u308B","\u304D\u3042\u3044","\u304D\u3042\u3064","\u304D\u3044\u308D","\u304D\u3099\u3044\u3093","\u304D\u3046\u3044","\u304D\u3046\u3093","\u304D\u3048\u308B","\u304D\u304A\u3046","\u304D\u304A\u304F","\u304D\u304A\u3061","\u304D\u304A\u3093","\u304D\u304B\u3044","\u304D\u304B\u304F","\u304D\u304B\u3093\u3057\u3083","\u304D\u304D\u3066","\u304D\u304F\u306F\u3099\u308A","\u304D\u304F\u3089\u3051\u3099","\u304D\u3051\u3093\u305B\u3044","\u304D\u3053\u3046","\u304D\u3053\u3048\u308B","\u304D\u3053\u304F","\u304D\u3055\u3044","\u304D\u3055\u304F","\u304D\u3055\u307E","\u304D\u3055\u3089\u304D\u3099","\u304D\u3099\u3057\u3099\u304B\u304B\u3099\u304F","\u304D\u3099\u3057\u304D","\u304D\u3099\u3057\u3099\u305F\u3044\u3051\u3093","\u304D\u3099\u3057\u3099\u306B\u3063\u3066\u3044","\u304D\u3099\u3057\u3099\u3085\u3064\u3057\u3083","\u304D\u3059\u3046","\u304D\u305B\u3044","\u304D\u305B\u304D","\u304D\u305B\u3064","\u304D\u305D\u3046","\u304D\u305D\u3099\u304F","\u304D\u305D\u3099\u3093","\u304D\u305F\u3048\u308B","\u304D\u3061\u3087\u3046","\u304D\u3064\u3048\u3093","\u304D\u3099\u3063\u3061\u308A","\u304D\u3064\u3064\u304D","\u304D\u3064\u306D","\u304D\u3066\u3044","\u304D\u3068\u3099\u3046","\u304D\u3068\u3099\u304F","\u304D\u306A\u3044","\u304D\u306A\u304B\u3099","\u304D\u306A\u3053","\u304D\u306C\u3053\u3099\u3057","\u304D\u306D\u3093","\u304D\u306E\u3046","\u304D\u306E\u3057\u305F","\u304D\u306F\u304F","\u304D\u3072\u3099\u3057\u3044","\u304D\u3072\u3093","\u304D\u3075\u304F","\u304D\u3075\u3099\u3093","\u304D\u307B\u3099\u3046","\u304D\u307B\u3093","\u304D\u307E\u308B","\u304D\u307F\u3064","\u304D\u3080\u3059\u3099\u304B\u3057\u3044","\u304D\u3081\u308B","\u304D\u3082\u305F\u3099\u3081\u3057","\u304D\u3082\u3061","\u304D\u3082\u306E","\u304D\u3083\u304F","\u304D\u3084\u304F","\u304D\u3099\u3085\u3046\u306B\u304F","\u304D\u3088\u3046","\u304D\u3087\u3046\u308A\u3085\u3046","\u304D\u3089\u3044","\u304D\u3089\u304F","\u304D\u308A\u3093","\u304D\u308C\u3044","\u304D\u308C\u3064","\u304D\u308D\u304F","\u304D\u3099\u308D\u3093","\u304D\u308F\u3081\u308B","\u304D\u3099\u3093\u3044\u308D","\u304D\u3093\u304B\u304F\u3057\u3099","\u304D\u3093\u3057\u3099\u3087","\u304D\u3093\u3088\u3046\u3072\u3099","\u304F\u3099\u3042\u3044","\u304F\u3044\u3059\u3099","\u304F\u3046\u304B\u3093","\u304F\u3046\u304D","\u304F\u3046\u304F\u3099\u3093","\u304F\u3046\u3053\u3046","\u304F\u3099\u3046\u305B\u3044","\u304F\u3046\u305D\u3046","\u304F\u3099\u3046\u305F\u3089","\u304F\u3046\u3075\u304F","\u304F\u3046\u307B\u3099","\u304F\u304B\u3093","\u304F\u304D\u3087\u3046","\u304F\u3051\u3099\u3093","\u304F\u3099\u3053\u3046","\u304F\u3055\u3044","\u304F\u3055\u304D","\u304F\u3055\u306F\u3099\u306A","\u304F\u3055\u308B","\u304F\u3057\u3083\u307F","\u304F\u3057\u3087\u3046","\u304F\u3059\u306E\u304D","\u304F\u3059\u308A\u3086\u3072\u3099","\u304F\u305B\u3051\u3099","\u304F\u305B\u3093","\u304F\u3099\u305F\u3044\u3066\u304D","\u304F\u305F\u3099\u3055\u308B","\u304F\u305F\u3072\u3099\u308C\u308B","\u304F\u3061\u3053\u307F","\u304F\u3061\u3055\u304D","\u304F\u3064\u3057\u305F","\u304F\u3099\u3063\u3059\u308A","\u304F\u3064\u308D\u304F\u3099","\u304F\u3068\u3046\u3066\u3093","\u304F\u3068\u3099\u304F","\u304F\u306A\u3093","\u304F\u306D\u304F\u306D","\u304F\u306E\u3046","\u304F\u3075\u3046","\u304F\u307F\u3042\u308F\u305B","\u304F\u307F\u305F\u3066\u308B","\u304F\u3081\u308B","\u304F\u3084\u304F\u3057\u3087","\u304F\u3089\u3059","\u304F\u3089\u3078\u3099\u308B","\u304F\u308B\u307E","\u304F\u308C\u308B","\u304F\u308D\u3046","\u304F\u308F\u3057\u3044","\u304F\u3099\u3093\u304B\u3093","\u304F\u3099\u3093\u3057\u3087\u304F","\u304F\u3099\u3093\u305F\u3044","\u304F\u3099\u3093\u3066","\u3051\u3042\u306A","\u3051\u3044\u304B\u304F","\u3051\u3044\u3051\u3093","\u3051\u3044\u3053","\u3051\u3044\u3055\u3064","\u3051\u3099\u3044\u3057\u3099\u3085\u3064","\u3051\u3044\u305F\u3044","\u3051\u3099\u3044\u306E\u3046\u3057\u3099\u3093","\u3051\u3044\u308C\u304D","\u3051\u3044\u308D","\u3051\u304A\u3068\u3059","\u3051\u304A\u308A\u3082\u306E","\u3051\u3099\u304D\u304B","\u3051\u3099\u304D\u3051\u3099\u3093","\u3051\u3099\u304D\u305F\u3099\u3093","\u3051\u3099\u304D\u3061\u3093","\u3051\u3099\u304D\u3068\u3064","\u3051\u3099\u304D\u306F","\u3051\u3099\u304D\u3084\u304F","\u3051\u3099\u3053\u3046","\u3051\u3099\u3053\u304F\u3057\u3099\u3087\u3046","\u3051\u3099\u3055\u3099\u3044","\u3051\u3055\u304D","\u3051\u3099\u3055\u3099\u3093","\u3051\u3057\u304D","\u3051\u3057\u3053\u3099\u3080","\u3051\u3057\u3087\u3046","\u3051\u3099\u3059\u3068","\u3051\u305F\u306F\u3099","\u3051\u3061\u3083\u3063\u3075\u309A","\u3051\u3061\u3089\u3059","\u3051\u3064\u3042\u3064","\u3051\u3064\u3044","\u3051\u3064\u3048\u304D","\u3051\u3063\u3053\u3093","\u3051\u3064\u3057\u3099\u3087","\u3051\u3063\u305B\u304D","\u3051\u3063\u3066\u3044","\u3051\u3064\u307E\u3064","\u3051\u3099\u3064\u3088\u3046\u3072\u3099","\u3051\u3099\u3064\u308C\u3044","\u3051\u3064\u308D\u3093","\u3051\u3099\u3068\u3099\u304F","\u3051\u3068\u306F\u3099\u3059","\u3051\u3068\u308B","\u3051\u306A\u3051\u3099","\u3051\u306A\u3059","\u3051\u306A\u307F","\u3051\u306C\u304D","\u3051\u3099\u306D\u3064","\u3051\u306D\u3093","\u3051\u306F\u3044","\u3051\u3099\u3072\u3093","\u3051\u3075\u3099\u304B\u3044","\u3051\u3099\u307B\u3099\u304F","\u3051\u307E\u308A","\u3051\u307F\u304B\u308B","\u3051\u3080\u3057","\u3051\u3080\u308A","\u3051\u3082\u306E","\u3051\u3089\u3044","\u3051\u308D\u3051\u308D","\u3051\u308F\u3057\u3044","\u3051\u3093\u3044","\u3051\u3093\u3048\u3064","\u3051\u3093\u304A","\u3051\u3093\u304B","\u3051\u3099\u3093\u304D","\u3051\u3093\u3051\u3099\u3093","\u3051\u3093\u3053\u3046","\u3051\u3093\u3055\u304F","\u3051\u3093\u3057\u3085\u3046","\u3051\u3093\u3059\u3046","\u3051\u3099\u3093\u305D\u3046","\u3051\u3093\u3061\u304F","\u3051\u3093\u3066\u3044","\u3051\u3093\u3068\u3046","\u3051\u3093\u306A\u3044","\u3051\u3093\u306B\u3093","\u3051\u3099\u3093\u3075\u3099\u3064","\u3051\u3093\u307E","\u3051\u3093\u307F\u3093","\u3051\u3093\u3081\u3044","\u3051\u3093\u3089\u3093","\u3051\u3093\u308A","\u3053\u3042\u304F\u307E","\u3053\u3044\u306C","\u3053\u3044\u3072\u3099\u3068","\u3053\u3099\u3046\u3044","\u3053\u3046\u3048\u3093","\u3053\u3046\u304A\u3093","\u3053\u3046\u304B\u3093","\u3053\u3099\u3046\u304D\u3085\u3046","\u3053\u3099\u3046\u3051\u3044","\u3053\u3046\u3053\u3046","\u3053\u3046\u3055\u3044","\u3053\u3046\u3057\u3099","\u3053\u3046\u3059\u3044","\u3053\u3099\u3046\u305B\u3044","\u3053\u3046\u305D\u304F","\u3053\u3046\u305F\u3044","\u3053\u3046\u3061\u3083","\u3053\u3046\u3064\u3046","\u3053\u3046\u3066\u3044","\u3053\u3046\u3068\u3099\u3046","\u3053\u3046\u306A\u3044","\u3053\u3046\u306F\u3044","\u3053\u3099\u3046\u307B\u3046","\u3053\u3099\u3046\u307E\u3093","\u3053\u3046\u3082\u304F","\u3053\u3046\u308A\u3064","\u3053\u3048\u308B","\u3053\u304A\u308A","\u3053\u3099\u304B\u3044","\u3053\u3099\u304B\u3099\u3064","\u3053\u3099\u304B\u3093","\u3053\u304F\u3053\u3099","\u3053\u304F\u3055\u3044","\u3053\u304F\u3068\u3046","\u3053\u304F\u306A\u3044","\u3053\u304F\u306F\u304F","\u3053\u304F\u3099\u307E","\u3053\u3051\u3044","\u3053\u3051\u308B","\u3053\u3053\u306E\u304B","\u3053\u3053\u308D","\u3053\u3055\u3081","\u3053\u3057\u3064","\u3053\u3059\u3046","\u3053\u305B\u3044","\u3053\u305B\u304D","\u3053\u305B\u3099\u3093","\u3053\u305D\u305F\u3099\u3066","\u3053\u305F\u3044","\u3053\u305F\u3048\u308B","\u3053\u305F\u3064","\u3053\u3061\u3087\u3046","\u3053\u3063\u304B","\u3053\u3064\u3053\u3064","\u3053\u3064\u306F\u3099\u3093","\u3053\u3064\u3075\u3099","\u3053\u3066\u3044","\u3053\u3066\u3093","\u3053\u3068\u304B\u3099\u3089","\u3053\u3068\u3057","\u3053\u3068\u306F\u3099","\u3053\u3068\u308A","\u3053\u306A\u3053\u3099\u306A","\u3053\u306D\u3053\u306D","\u3053\u306E\u307E\u307E","\u3053\u306E\u307F","\u3053\u306E\u3088","\u3053\u3099\u306F\u3093","\u3053\u3072\u3064\u3057\u3099","\u3053\u3075\u3046","\u3053\u3075\u3093","\u3053\u307B\u3099\u308C\u308B","\u3053\u3099\u307E\u3042\u3075\u3099\u3089","\u3053\u307E\u304B\u3044","\u3053\u3099\u307E\u3059\u308A","\u3053\u307E\u3064\u306A","\u3053\u307E\u308B","\u3053\u3080\u304D\u3099\u3053","\u3053\u3082\u3057\u3099","\u3053\u3082\u3061","\u3053\u3082\u306E","\u3053\u3082\u3093","\u3053\u3084\u304F","\u3053\u3084\u307E","\u3053\u3086\u3046","\u3053\u3086\u3072\u3099","\u3053\u3088\u3044","\u3053\u3088\u3046","\u3053\u308A\u308B","\u3053\u308C\u304F\u3057\u3087\u3093","\u3053\u308D\u3063\u3051","\u3053\u308F\u3082\u3066","\u3053\u308F\u308C\u308B","\u3053\u3093\u3044\u3093","\u3053\u3093\u304B\u3044","\u3053\u3093\u304D","\u3053\u3093\u3057\u3085\u3046","\u3053\u3093\u3059\u3044","\u3053\u3093\u305F\u3099\u3066","\u3053\u3093\u3068\u3093","\u3053\u3093\u306A\u3093","\u3053\u3093\u3072\u3099\u306B","\u3053\u3093\u307B\u309A\u3093","\u3053\u3093\u307E\u3051","\u3053\u3093\u3084","\u3053\u3093\u308C\u3044","\u3053\u3093\u308F\u304F","\u3055\u3099\u3044\u3048\u304D","\u3055\u3044\u304B\u3044","\u3055\u3044\u304D\u3093","\u3055\u3099\u3044\u3051\u3099\u3093","\u3055\u3099\u3044\u3053","\u3055\u3044\u3057\u3087","\u3055\u3044\u305B\u3044","\u3055\u3099\u3044\u305F\u304F","\u3055\u3099\u3044\u3061\u3085\u3046","\u3055\u3044\u3066\u304D","\u3055\u3099\u3044\u308A\u3087\u3046","\u3055\u3046\u306A","\u3055\u304B\u3044\u3057","\u3055\u304B\u3099\u3059","\u3055\u304B\u306A","\u3055\u304B\u307F\u3061","\u3055\u304B\u3099\u308B","\u3055\u304D\u3099\u3087\u3046","\u3055\u304F\u3057","\u3055\u304F\u3072\u3093","\u3055\u304F\u3089","\u3055\u3053\u304F","\u3055\u3053\u3064","\u3055\u3059\u3099\u304B\u308B","\u3055\u3099\u305B\u304D","\u3055\u305F\u3093","\u3055\u3064\u3048\u3044","\u3055\u3099\u3064\u304A\u3093","\u3055\u3099\u3063\u304B","\u3055\u3099\u3064\u304B\u3099\u304F","\u3055\u3063\u304D\u3087\u304F","\u3055\u3099\u3063\u3057","\u3055\u3064\u3057\u3099\u3093","\u3055\u3099\u3063\u305D\u3046","\u3055\u3064\u305F\u306F\u3099","\u3055\u3064\u307E\u3044\u3082","\u3055\u3066\u3044","\u3055\u3068\u3044\u3082","\u3055\u3068\u3046","\u3055\u3068\u304A\u3084","\u3055\u3068\u3057","\u3055\u3068\u308B","\u3055\u306E\u3046","\u3055\u306F\u3099\u304F","\u3055\u3072\u3099\u3057\u3044","\u3055\u3078\u3099\u3064","\u3055\u307B\u3046","\u3055\u307B\u3068\u3099","\u3055\u307E\u3059","\u3055\u307F\u3057\u3044","\u3055\u307F\u305F\u3099\u308C","\u3055\u3080\u3051","\u3055\u3081\u308B","\u3055\u3084\u3048\u3093\u3068\u3099\u3046","\u3055\u3086\u3046","\u3055\u3088\u3046","\u3055\u3088\u304F","\u3055\u3089\u305F\u3099","\u3055\u3099\u308B\u305D\u306F\u3099","\u3055\u308F\u3084\u304B","\u3055\u308F\u308B","\u3055\u3093\u3044\u3093","\u3055\u3093\u304B","\u3055\u3093\u304D\u3083\u304F","\u3055\u3093\u3053\u3046","\u3055\u3093\u3055\u3044","\u3055\u3099\u3093\u3057\u3087","\u3055\u3093\u3059\u3046","\u3055\u3093\u305B\u3044","\u3055\u3093\u305D","\u3055\u3093\u3061","\u3055\u3093\u307E","\u3055\u3093\u307F","\u3055\u3093\u3089\u3093","\u3057\u3042\u3044","\u3057\u3042\u3051\u3099","\u3057\u3042\u3055\u3063\u3066","\u3057\u3042\u308F\u305B","\u3057\u3044\u304F","\u3057\u3044\u3093","\u3057\u3046\u3061","\u3057\u3048\u3044","\u3057\u304A\u3051","\u3057\u304B\u3044","\u3057\u304B\u304F","\u3057\u3099\u304B\u3093","\u3057\u3053\u3099\u3068","\u3057\u3059\u3046","\u3057\u3099\u305F\u3099\u3044","\u3057\u305F\u3046\u3051","\u3057\u305F\u304D\u3099","\u3057\u305F\u3066","\u3057\u305F\u307F","\u3057\u3061\u3087\u3046","\u3057\u3061\u308A\u3093","\u3057\u3063\u304B\u308A","\u3057\u3064\u3057\u3099","\u3057\u3064\u3082\u3093","\u3057\u3066\u3044","\u3057\u3066\u304D","\u3057\u3066\u3064","\u3057\u3099\u3066\u3093","\u3057\u3099\u3068\u3099\u3046","\u3057\u306A\u304D\u3099\u308C","\u3057\u306A\u3082\u306E","\u3057\u306A\u3093","\u3057\u306D\u307E","\u3057\u306D\u3093","\u3057\u306E\u304F\u3099","\u3057\u306E\u3075\u3099","\u3057\u306F\u3044","\u3057\u306F\u3099\u304B\u308A","\u3057\u306F\u3064","\u3057\u306F\u3089\u3044","\u3057\u306F\u3093","\u3057\u3072\u3087\u3046","\u3057\u3075\u304F","\u3057\u3099\u3075\u3099\u3093","\u3057\u3078\u3044","\u3057\u307B\u3046","\u3057\u307B\u3093","\u3057\u307E\u3046","\u3057\u307E\u308B","\u3057\u307F\u3093","\u3057\u3080\u3051\u308B","\u3057\u3099\u3080\u3057\u3087","\u3057\u3081\u3044","\u3057\u3081\u308B","\u3057\u3082\u3093","\u3057\u3083\u3044\u3093","\u3057\u3083\u3046\u3093","\u3057\u3083\u304A\u3093","\u3057\u3099\u3083\u304B\u3099\u3044\u3082","\u3057\u3084\u304F\u3057\u3087","\u3057\u3083\u304F\u307B\u3046","\u3057\u3083\u3051\u3093","\u3057\u3083\u3053","\u3057\u3083\u3055\u3099\u3044","\u3057\u3083\u3057\u3093","\u3057\u3083\u305B\u3093","\u3057\u3083\u305D\u3046","\u3057\u3083\u305F\u3044","\u3057\u3083\u3061\u3087\u3046","\u3057\u3083\u3063\u304D\u3093","\u3057\u3099\u3083\u307E","\u3057\u3083\u308A\u3093","\u3057\u3083\u308C\u3044","\u3057\u3099\u3086\u3046","\u3057\u3099\u3085\u3046\u3057\u3087","\u3057\u3085\u304F\u306F\u304F","\u3057\u3099\u3085\u3057\u3093","\u3057\u3085\u3063\u305B\u304D","\u3057\u3085\u307F","\u3057\u3085\u3089\u306F\u3099","\u3057\u3099\u3085\u3093\u306F\u3099\u3093","\u3057\u3087\u3046\u304B\u3044","\u3057\u3087\u304F\u305F\u304F","\u3057\u3087\u3063\u3051\u3093","\u3057\u3087\u3068\u3099\u3046","\u3057\u3087\u3082\u3064","\u3057\u3089\u305B\u308B","\u3057\u3089\u3078\u3099\u308B","\u3057\u3093\u304B","\u3057\u3093\u3053\u3046","\u3057\u3099\u3093\u3057\u3099\u3083","\u3057\u3093\u305B\u3044\u3057\u3099","\u3057\u3093\u3061\u304F","\u3057\u3093\u308A\u3093","\u3059\u3042\u3051\u3099","\u3059\u3042\u3057","\u3059\u3042\u306A","\u3059\u3099\u3042\u3093","\u3059\u3044\u3048\u3044","\u3059\u3044\u304B","\u3059\u3044\u3068\u3046","\u3059\u3099\u3044\u3075\u3099\u3093","\u3059\u3044\u3088\u3046\u3072\u3099","\u3059\u3046\u304B\u3099\u304F","\u3059\u3046\u3057\u3099\u3064","\u3059\u3046\u305B\u3093","\u3059\u304A\u3068\u3099\u308A","\u3059\u304D\u307E","\u3059\u304F\u3046","\u3059\u304F\u306A\u3044","\u3059\u3051\u308B","\u3059\u3053\u3099\u3044","\u3059\u3053\u3057","\u3059\u3099\u3055\u3093","\u3059\u3059\u3099\u3057\u3044","\u3059\u3059\u3080","\u3059\u3059\u3081\u308B","\u3059\u3063\u304B\u308A","\u3059\u3099\u3063\u3057\u308A","\u3059\u3099\u3063\u3068","\u3059\u3066\u304D","\u3059\u3066\u308B","\u3059\u306D\u308B","\u3059\u306E\u3053","\u3059\u306F\u305F\u3099","\u3059\u306F\u3099\u3089\u3057\u3044","\u3059\u3099\u3072\u3087\u3046","\u3059\u3099\u3075\u3099\u306C\u308C","\u3059\u3075\u3099\u308A","\u3059\u3075\u308C","\u3059\u3078\u3099\u3066","\u3059\u3078\u3099\u308B","\u3059\u3099\u307B\u3046","\u3059\u307B\u3099\u3093","\u3059\u307E\u3044","\u3059\u3081\u3057","\u3059\u3082\u3046","\u3059\u3084\u304D","\u3059\u3089\u3059\u3089","\u3059\u308B\u3081","\u3059\u308C\u3061\u304B\u3099\u3046","\u3059\u308D\u3063\u3068","\u3059\u308F\u308B","\u3059\u3093\u305B\u3099\u3093","\u3059\u3093\u307B\u309A\u3046","\u305B\u3042\u3075\u3099\u3089","\u305B\u3044\u304B\u3064","\u305B\u3044\u3051\u3099\u3093","\u305B\u3044\u3057\u3099","\u305B\u3044\u3088\u3046","\u305B\u304A\u3046","\u305B\u304B\u3044\u304B\u3093","\u305B\u304D\u306B\u3093","\u305B\u304D\u3080","\u305B\u304D\u3086","\u305B\u304D\u3089\u3093\u3046\u3093","\u305B\u3051\u3093","\u305B\u3053\u3046","\u305B\u3059\u3057\u3099","\u305B\u305F\u3044","\u305B\u305F\u3051","\u305B\u3063\u304B\u304F","\u305B\u3063\u304D\u3083\u304F","\u305B\u3099\u3063\u304F","\u305B\u3063\u3051\u3093","\u305B\u3063\u3053\u3064","\u305B\u3063\u3055\u305F\u304F\u307E","\u305B\u3064\u305D\u3099\u304F","\u305B\u3064\u305F\u3099\u3093","\u305B\u3064\u3066\u3099\u3093","\u305B\u3063\u306F\u309A\u3093","\u305B\u3064\u3072\u3099","\u305B\u3064\u3075\u3099\u3093","\u305B\u3064\u3081\u3044","\u305B\u3064\u308A\u3064","\u305B\u306A\u304B","\u305B\u306E\u3072\u3099","\u305B\u306F\u306F\u3099","\u305B\u3072\u3099\u308D","\u305B\u307B\u3099\u306D","\u305B\u307E\u3044","\u305B\u307E\u308B","\u305B\u3081\u308B","\u305B\u3082\u305F\u308C","\u305B\u308A\u3075","\u305B\u3099\u3093\u3042\u304F","\u305B\u3093\u3044","\u305B\u3093\u3048\u3044","\u305B\u3093\u304B","\u305B\u3093\u304D\u3087","\u305B\u3093\u304F","\u305B\u3093\u3051\u3099\u3093","\u305B\u3099\u3093\u3053\u3099","\u305B\u3093\u3055\u3044","\u305B\u3093\u3057\u3085","\u305B\u3093\u3059\u3044","\u305B\u3093\u305B\u3044","\u305B\u3093\u305D\u3099","\u305B\u3093\u305F\u304F","\u305B\u3093\u3061\u3087\u3046","\u305B\u3093\u3066\u3044","\u305B\u3093\u3068\u3046","\u305B\u3093\u306C\u304D","\u305B\u3093\u306D\u3093","\u305B\u3093\u306F\u309A\u3044","\u305B\u3099\u3093\u3075\u3099","\u305B\u3099\u3093\u307B\u309A\u3046","\u305B\u3093\u3080","\u305B\u3093\u3081\u3093\u3057\u3099\u3087","\u305B\u3093\u3082\u3093","\u305B\u3093\u3084\u304F","\u305B\u3093\u3086\u3046","\u305B\u3093\u3088\u3046","\u305B\u3099\u3093\u3089","\u305B\u3099\u3093\u308A\u3083\u304F","\u305B\u3093\u308C\u3044","\u305B\u3093\u308D","\u305D\u3042\u304F","\u305D\u3044\u3068\u3051\u3099\u308B","\u305D\u3044\u306D","\u305D\u3046\u304B\u3099\u3093\u304D\u3087\u3046","\u305D\u3046\u304D","\u305D\u3046\u3053\u3099","\u305D\u3046\u3057\u3093","\u305D\u3046\u305F\u3099\u3093","\u305D\u3046\u306A\u3093","\u305D\u3046\u3072\u3099","\u305D\u3046\u3081\u3093","\u305D\u3046\u308A","\u305D\u3048\u3082\u306E","\u305D\u3048\u3093","\u305D\u304B\u3099\u3044","\u305D\u3051\u3099\u304D","\u305D\u3053\u3046","\u305D\u3053\u305D\u3053","\u305D\u3055\u3099\u3044","\u305D\u3057\u306A","\u305D\u305B\u3044","\u305D\u305B\u3093","\u305D\u305D\u304F\u3099","\u305D\u305F\u3099\u3066\u308B","\u305D\u3064\u3046","\u305D\u3064\u3048\u3093","\u305D\u3063\u304B\u3093","\u305D\u3064\u304D\u3099\u3087\u3046","\u305D\u3063\u3051\u3064","\u305D\u3063\u3053\u3046","\u305D\u3063\u305B\u3093","\u305D\u3063\u3068","\u305D\u3068\u304B\u3099\u308F","\u305D\u3068\u3064\u3099\u3089","\u305D\u306A\u3048\u308B","\u305D\u306A\u305F","\u305D\u3075\u307B\u3099","\u305D\u307B\u3099\u304F","\u305D\u307B\u3099\u308D","\u305D\u307E\u3064","\u305D\u307E\u308B","\u305D\u3080\u304F","\u305D\u3080\u308A\u3048","\u305D\u3081\u308B","\u305D\u3082\u305D\u3082","\u305D\u3088\u304B\u305B\u3099","\u305D\u3089\u307E\u3081","\u305D\u308D\u3046","\u305D\u3093\u304B\u3044","\u305D\u3093\u3051\u3044","\u305D\u3093\u3055\u3099\u3044","\u305D\u3093\u3057\u3064","\u305D\u3093\u305D\u3099\u304F","\u305D\u3093\u3061\u3087\u3046","\u305D\u3099\u3093\u3072\u3099","\u305D\u3099\u3093\u3075\u3099\u3093","\u305D\u3093\u307F\u3093","\u305F\u3042\u3044","\u305F\u3044\u3044\u3093","\u305F\u3044\u3046\u3093","\u305F\u3044\u3048\u304D","\u305F\u3044\u304A\u3046","\u305F\u3099\u3044\u304B\u3099\u304F","\u305F\u3044\u304D","\u305F\u3044\u304F\u3099\u3046","\u305F\u3044\u3051\u3093","\u305F\u3044\u3053","\u305F\u3044\u3055\u3099\u3044","\u305F\u3099\u3044\u3057\u3099\u3087\u3046\u3075\u3099","\u305F\u3099\u3044\u3059\u304D","\u305F\u3044\u305B\u3064","\u305F\u3044\u305D\u3046","\u305F\u3099\u3044\u305F\u3044","\u305F\u3044\u3061\u3087\u3046","\u305F\u3044\u3066\u3044","\u305F\u3099\u3044\u3068\u3099\u3053\u308D","\u305F\u3044\u306A\u3044","\u305F\u3044\u306D\u3064","\u305F\u3044\u306E\u3046","\u305F\u3044\u306F\u3093","\u305F\u3099\u3044\u3072\u3087\u3046","\u305F\u3044\u3075\u3046","\u305F\u3044\u3078\u3093","\u305F\u3044\u307B","\u305F\u3044\u307E\u3064\u306F\u3099\u306A","\u305F\u3044\u307F\u3093\u304F\u3099","\u305F\u3044\u3080","\u305F\u3044\u3081\u3093","\u305F\u3044\u3084\u304D","\u305F\u3044\u3088\u3046","\u305F\u3044\u3089","\u305F\u3044\u308A\u3087\u304F","\u305F\u3044\u308B","\u305F\u3044\u308F\u3093","\u305F\u3046\u3048","\u305F\u3048\u308B","\u305F\u304A\u3059","\u305F\u304A\u308B","\u305F\u304A\u308C\u308B","\u305F\u304B\u3044","\u305F\u304B\u306D","\u305F\u304D\u3072\u3099","\u305F\u304F\u3055\u3093","\u305F\u3053\u304F","\u305F\u3053\u3084\u304D","\u305F\u3055\u3044","\u305F\u3057\u3055\u3099\u3093","\u305F\u3099\u3057\u3099\u3083\u308C","\u305F\u3059\u3051\u308B","\u305F\u3059\u3099\u3055\u308F\u308B","\u305F\u305D\u304B\u3099\u308C","\u305F\u305F\u304B\u3046","\u305F\u305F\u304F","\u305F\u305F\u3099\u3057\u3044","\u305F\u305F\u307F","\u305F\u3061\u306F\u3099\u306A","\u305F\u3099\u3063\u304B\u3044","\u305F\u3099\u3063\u304D\u3083\u304F","\u305F\u3099\u3063\u3053","\u305F\u3099\u3063\u3057\u3085\u3064","\u305F\u3099\u3063\u305F\u3044","\u305F\u3066\u308B","\u305F\u3068\u3048\u308B","\u305F\u306A\u306F\u3099\u305F","\u305F\u306B\u3093","\u305F\u306C\u304D","\u305F\u306E\u3057\u307F","\u305F\u306F\u3064","\u305F\u3075\u3099\u3093","\u305F\u3078\u3099\u308B","\u305F\u307B\u3099\u3046","\u305F\u307E\u3053\u3099","\u305F\u307E\u308B","\u305F\u3099\u3080\u308B","\u305F\u3081\u3044\u304D","\u305F\u3081\u3059","\u305F\u3081\u308B","\u305F\u3082\u3064","\u305F\u3084\u3059\u3044","\u305F\u3088\u308B","\u305F\u3089\u3059","\u305F\u308A\u304D\u307B\u3093\u304B\u3099\u3093","\u305F\u308A\u3087\u3046","\u305F\u308A\u308B","\u305F\u308B\u3068","\u305F\u308C\u308B","\u305F\u308C\u3093\u3068","\u305F\u308D\u3063\u3068","\u305F\u308F\u3080\u308C\u308B","\u305F\u3099\u3093\u3042\u3064","\u305F\u3093\u3044","\u305F\u3093\u304A\u3093","\u305F\u3093\u304B","\u305F\u3093\u304D","\u305F\u3093\u3051\u3093","\u305F\u3093\u3053\u3099","\u305F\u3093\u3055\u3093","\u305F\u3093\u3057\u3099\u3087\u3046\u3072\u3099","\u305F\u3099\u3093\u305B\u3044","\u305F\u3093\u305D\u304F","\u305F\u3093\u305F\u3044","\u305F\u3099\u3093\u3061","\u305F\u3093\u3066\u3044","\u305F\u3093\u3068\u3046","\u305F\u3099\u3093\u306A","\u305F\u3093\u306B\u3093","\u305F\u3099\u3093\u306D\u3064","\u305F\u3093\u306E\u3046","\u305F\u3093\u3072\u309A\u3093","\u305F\u3099\u3093\u307B\u3099\u3046","\u305F\u3093\u307E\u3064","\u305F\u3093\u3081\u3044","\u305F\u3099\u3093\u308C\u3064","\u305F\u3099\u3093\u308D","\u305F\u3099\u3093\u308F","\u3061\u3042\u3044","\u3061\u3042\u3093","\u3061\u3044\u304D","\u3061\u3044\u3055\u3044","\u3061\u3048\u3093","\u3061\u304B\u3044","\u3061\u304B\u3089","\u3061\u304D\u3085\u3046","\u3061\u304D\u3093","\u3061\u3051\u3044\u3059\u3099","\u3061\u3051\u3093","\u3061\u3053\u304F","\u3061\u3055\u3044","\u3061\u3057\u304D","\u3061\u3057\u308A\u3087\u3046","\u3061\u305B\u3044","\u3061\u305D\u3046","\u3061\u305F\u3044","\u3061\u305F\u3093","\u3061\u3061\u304A\u3084","\u3061\u3064\u3057\u3099\u3087","\u3061\u3066\u304D","\u3061\u3066\u3093","\u3061\u306C\u304D","\u3061\u306C\u308A","\u3061\u306E\u3046","\u3061\u3072\u3087\u3046","\u3061\u3078\u3044\u305B\u3093","\u3061\u307B\u3046","\u3061\u307E\u305F","\u3061\u307F\u3064","\u3061\u307F\u3068\u3099\u308D","\u3061\u3081\u3044\u3068\u3099","\u3061\u3083\u3093\u3053\u306A\u3078\u3099","\u3061\u3085\u3046\u3044","\u3061\u3086\u308A\u3087\u304F","\u3061\u3087\u3046\u3057","\u3061\u3087\u3055\u304F\u3051\u3093","\u3061\u3089\u3057","\u3061\u3089\u307F","\u3061\u308A\u304B\u3099\u307F","\u3061\u308A\u3087\u3046","\u3061\u308B\u3068\u3099","\u3061\u308F\u308F","\u3061\u3093\u305F\u3044","\u3061\u3093\u3082\u304F","\u3064\u3044\u304B","\u3064\u3044\u305F\u3061","\u3064\u3046\u304B","\u3064\u3046\u3057\u3099\u3087\u3046","\u3064\u3046\u306F\u3093","\u3064\u3046\u308F","\u3064\u304B\u3046","\u3064\u304B\u308C\u308B","\u3064\u304F\u306D","\u3064\u304F\u308B","\u3064\u3051\u306D","\u3064\u3051\u308B","\u3064\u3053\u3099\u3046","\u3064\u305F\u3048\u308B","\u3064\u3064\u3099\u304F","\u3064\u3064\u3057\u3099","\u3064\u3064\u3080","\u3064\u3068\u3081\u308B","\u3064\u306A\u304B\u3099\u308B","\u3064\u306A\u307F","\u3064\u306D\u3064\u3099\u306D","\u3064\u306E\u308B","\u3064\u3075\u3099\u3059","\u3064\u307E\u3089\u306A\u3044","\u3064\u307E\u308B","\u3064\u307F\u304D","\u3064\u3081\u305F\u3044","\u3064\u3082\u308A","\u3064\u3082\u308B","\u3064\u3088\u3044","\u3064\u308B\u307B\u3099","\u3064\u308B\u307F\u304F","\u3064\u308F\u3082\u306E","\u3064\u308F\u308A","\u3066\u3042\u3057","\u3066\u3042\u3066","\u3066\u3042\u307F","\u3066\u3044\u304A\u3093","\u3066\u3044\u304B","\u3066\u3044\u304D","\u3066\u3044\u3051\u3044","\u3066\u3044\u3053\u304F","\u3066\u3044\u3055\u3064","\u3066\u3044\u3057","\u3066\u3044\u305B\u3044","\u3066\u3044\u305F\u3044","\u3066\u3044\u3068\u3099","\u3066\u3044\u306D\u3044","\u3066\u3044\u3072\u3087\u3046","\u3066\u3044\u3078\u3093","\u3066\u3044\u307B\u3099\u3046","\u3066\u3046\u3061","\u3066\u304A\u304F\u308C","\u3066\u304D\u3068\u3046","\u3066\u304F\u3072\u3099","\u3066\u3099\u3053\u307B\u3099\u3053","\u3066\u3055\u304D\u3099\u3087\u3046","\u3066\u3055\u3051\u3099","\u3066\u3059\u308A","\u3066\u305D\u3046","\u3066\u3061\u304B\u3099\u3044","\u3066\u3061\u3087\u3046","\u3066\u3064\u304B\u3099\u304F","\u3066\u3064\u3064\u3099\u304D","\u3066\u3099\u3063\u306F\u309A","\u3066\u3064\u307B\u3099\u3046","\u3066\u3064\u3084","\u3066\u3099\u306C\u304B\u3048","\u3066\u306C\u304D","\u3066\u306C\u304F\u3099\u3044","\u3066\u306E\u3072\u3089","\u3066\u306F\u3044","\u3066\u3075\u3099\u304F\u308D","\u3066\u3075\u305F\u3099","\u3066\u307B\u3068\u3099\u304D","\u3066\u307B\u3093","\u3066\u307E\u3048","\u3066\u307E\u304D\u3059\u3099\u3057","\u3066\u307F\u3057\u3099\u304B","\u3066\u307F\u3084\u3051\u3099","\u3066\u3089\u3059","\u3066\u308C\u3072\u3099","\u3066\u308F\u3051","\u3066\u308F\u305F\u3057","\u3066\u3099\u3093\u3042\u3064","\u3066\u3093\u3044\u3093","\u3066\u3093\u304B\u3044","\u3066\u3093\u304D","\u3066\u3093\u304F\u3099","\u3066\u3093\u3051\u3093","\u3066\u3093\u3053\u3099\u304F","\u3066\u3093\u3055\u3044","\u3066\u3093\u3057","\u3066\u3093\u3059\u3046","\u3066\u3099\u3093\u3061","\u3066\u3093\u3066\u304D","\u3066\u3093\u3068\u3046","\u3066\u3093\u306A\u3044","\u3066\u3093\u3075\u309A\u3089","\u3066\u3093\u307B\u3099\u3046\u305F\u3099\u3044","\u3066\u3093\u3081\u3064","\u3066\u3093\u3089\u3093\u304B\u3044","\u3066\u3099\u3093\u308A\u3087\u304F","\u3066\u3099\u3093\u308F","\u3068\u3099\u3042\u3044","\u3068\u3044\u308C","\u3068\u3099\u3046\u304B\u3093","\u3068\u3046\u304D\u3085\u3046","\u3068\u3099\u3046\u304F\u3099","\u3068\u3046\u3057","\u3068\u3046\u3080\u304D\u3099","\u3068\u304A\u3044","\u3068\u304A\u304B","\u3068\u304A\u304F","\u3068\u304A\u3059","\u3068\u304A\u308B","\u3068\u304B\u3044","\u3068\u304B\u3059","\u3068\u304D\u304A\u308A","\u3068\u304D\u3068\u3099\u304D","\u3068\u304F\u3044","\u3068\u304F\u3057\u3085\u3046","\u3068\u304F\u3066\u3093","\u3068\u304F\u306B","\u3068\u304F\u3078\u3099\u3064","\u3068\u3051\u3044","\u3068\u3051\u308B","\u3068\u3053\u3084","\u3068\u3055\u304B","\u3068\u3057\u3087\u304B\u3093","\u3068\u305D\u3046","\u3068\u305F\u3093","\u3068\u3061\u3085\u3046","\u3068\u3063\u304D\u3085\u3046","\u3068\u3063\u304F\u3093","\u3068\u3064\u305B\u3099\u3093","\u3068\u3064\u306B\u3085\u3046","\u3068\u3068\u3099\u3051\u308B","\u3068\u3068\u306E\u3048\u308B","\u3068\u306A\u3044","\u3068\u306A\u3048\u308B","\u3068\u306A\u308A","\u3068\u306E\u3055\u307E","\u3068\u306F\u3099\u3059","\u3068\u3099\u3075\u3099\u304B\u3099\u308F","\u3068\u307B\u3046","\u3068\u307E\u308B","\u3068\u3081\u308B","\u3068\u3082\u305F\u3099\u3061","\u3068\u3082\u308B","\u3068\u3099\u3088\u3046\u3072\u3099","\u3068\u3089\u3048\u308B","\u3068\u3093\u304B\u3064","\u3068\u3099\u3093\u3075\u3099\u308A","\u306A\u3044\u304B\u304F","\u306A\u3044\u3053\u3046","\u306A\u3044\u3057\u3087","\u306A\u3044\u3059","\u306A\u3044\u305B\u3093","\u306A\u3044\u305D\u3046","\u306A\u304A\u3059","\u306A\u304B\u3099\u3044","\u306A\u304F\u3059","\u306A\u3051\u3099\u308B","\u306A\u3053\u3046\u3068\u3099","\u306A\u3055\u3051","\u306A\u305F\u3066\u3099\u3053\u3053","\u306A\u3063\u3068\u3046","\u306A\u3064\u3084\u3059\u307F","\u306A\u306A\u304A\u3057","\u306A\u306B\u3053\u3099\u3068","\u306A\u306B\u3082\u306E","\u306A\u306B\u308F","\u306A\u306E\u304B","\u306A\u3075\u305F\u3099","\u306A\u307E\u3044\u304D","\u306A\u307E\u3048","\u306A\u307E\u307F","\u306A\u307F\u305F\u3099","\u306A\u3081\u3089\u304B","\u306A\u3081\u308B","\u306A\u3084\u3080","\u306A\u3089\u3046","\u306A\u3089\u3072\u3099","\u306A\u3089\u3075\u3099","\u306A\u308C\u308B","\u306A\u308F\u3068\u3072\u3099","\u306A\u308F\u306F\u3099\u308A","\u306B\u3042\u3046","\u306B\u3044\u304B\u3099\u305F","\u306B\u3046\u3051","\u306B\u304A\u3044","\u306B\u304B\u3044","\u306B\u304B\u3099\u3066","\u306B\u304D\u3072\u3099","\u306B\u304F\u3057\u307F","\u306B\u304F\u307E\u3093","\u306B\u3051\u3099\u308B","\u306B\u3055\u3093\u304B\u305F\u3093\u305D","\u306B\u3057\u304D","\u306B\u305B\u3082\u306E","\u306B\u3061\u3057\u3099\u3087\u3046","\u306B\u3061\u3088\u3046\u3072\u3099","\u306B\u3063\u304B","\u306B\u3063\u304D","\u306B\u3063\u3051\u3044","\u306B\u3063\u3053\u3046","\u306B\u3063\u3055\u3093","\u306B\u3063\u3057\u3087\u304F","\u306B\u3063\u3059\u3046","\u306B\u3063\u305B\u304D","\u306B\u3063\u3066\u3044","\u306B\u306A\u3046","\u306B\u307B\u3093","\u306B\u307E\u3081","\u306B\u3082\u3064","\u306B\u3084\u308A","\u306B\u3085\u3046\u3044\u3093","\u306B\u308A\u3093\u3057\u3083","\u306B\u308F\u3068\u308A","\u306B\u3093\u3044","\u306B\u3093\u304B","\u306B\u3093\u304D","\u306B\u3093\u3051\u3099\u3093","\u306B\u3093\u3057\u304D","\u306B\u3093\u3059\u3099\u3046","\u306B\u3093\u305D\u3046","\u306B\u3093\u305F\u3044","\u306B\u3093\u3061","\u306B\u3093\u3066\u3044","\u306B\u3093\u306B\u304F","\u306B\u3093\u3075\u309A","\u306B\u3093\u307E\u308A","\u306B\u3093\u3080","\u306B\u3093\u3081\u3044","\u306B\u3093\u3088\u3046","\u306C\u3044\u304F\u304D\u3099","\u306C\u304B\u3059","\u306C\u304F\u3099\u3044\u3068\u308B","\u306C\u304F\u3099\u3046","\u306C\u304F\u3082\u308A","\u306C\u3059\u3080","\u306C\u307E\u3048\u3072\u3099","\u306C\u3081\u308A","\u306C\u3089\u3059","\u306C\u3093\u3061\u3083\u304F","\u306D\u3042\u3051\u3099","\u306D\u3044\u304D","\u306D\u3044\u308B","\u306D\u3044\u308D","\u306D\u304F\u3099\u305B","\u306D\u304F\u305F\u3044","\u306D\u304F\u3089","\u306D\u3053\u305B\u3099","\u306D\u3053\u3080","\u306D\u3055\u3051\u3099","\u306D\u3059\u3053\u3099\u3059","\u306D\u305D\u3078\u3099\u308B","\u306D\u305F\u3099\u3093","\u306D\u3064\u3044","\u306D\u3063\u3057\u3093","\u306D\u3064\u305D\u3099\u3046","\u306D\u3063\u305F\u3044\u304D\u3099\u3087","\u306D\u3075\u3099\u305D\u304F","\u306D\u3075\u305F\u3099","\u306D\u307B\u3099\u3046","\u306D\u307B\u308A\u306F\u307B\u308A","\u306D\u307E\u304D","\u306D\u307E\u308F\u3057","\u306D\u307F\u307F","\u306D\u3080\u3044","\u306D\u3080\u305F\u3044","\u306D\u3082\u3068","\u306D\u3089\u3046","\u306D\u308F\u3055\u3099","\u306D\u3093\u3044\u308A","\u306D\u3093\u304A\u3057","\u306D\u3093\u304B\u3093","\u306D\u3093\u304D\u3093","\u306D\u3093\u304F\u3099","\u306D\u3093\u3055\u3099","\u306D\u3093\u3057","\u306D\u3093\u3061\u3083\u304F","\u306D\u3093\u3068\u3099","\u306D\u3093\u3072\u309A","\u306D\u3093\u3075\u3099\u3064","\u306D\u3093\u307E\u3064","\u306D\u3093\u308A\u3087\u3046","\u306D\u3093\u308C\u3044","\u306E\u3044\u3059\u3099","\u306E\u304A\u3064\u3099\u307E","\u306E\u304B\u3099\u3059","\u306E\u304D\u306A\u307F","\u306E\u3053\u304D\u3099\u308A","\u306E\u3053\u3059","\u306E\u3053\u308B","\u306E\u305B\u308B","\u306E\u305D\u3099\u304F","\u306E\u305D\u3099\u3080","\u306E\u305F\u307E\u3046","\u306E\u3061\u307B\u3068\u3099","\u306E\u3063\u304F","\u306E\u306F\u3099\u3059","\u306E\u306F\u3089","\u306E\u3078\u3099\u308B","\u306E\u307B\u3099\u308B","\u306E\u307F\u3082\u306E","\u306E\u3084\u307E","\u306E\u3089\u3044\u306C","\u306E\u3089\u306D\u3053","\u306E\u308A\u3082\u306E","\u306E\u308A\u3086\u304D","\u306E\u308C\u3093","\u306E\u3093\u304D","\u306F\u3099\u3042\u3044","\u306F\u3042\u304F","\u306F\u3099\u3042\u3055\u3093","\u306F\u3099\u3044\u304B","\u306F\u3099\u3044\u304F","\u306F\u3044\u3051\u3093","\u306F\u3044\u3053\u3099","\u306F\u3044\u3057\u3093","\u306F\u3044\u3059\u3044","\u306F\u3044\u305B\u3093","\u306F\u3044\u305D\u3046","\u306F\u3044\u3061","\u306F\u3099\u3044\u306F\u3099\u3044","\u306F\u3044\u308C\u3064","\u306F\u3048\u308B","\u306F\u304A\u308B","\u306F\u304B\u3044","\u306F\u3099\u304B\u308A","\u306F\u304B\u308B","\u306F\u304F\u3057\u3085","\u306F\u3051\u3093","\u306F\u3053\u3075\u3099","\u306F\u3055\u307F","\u306F\u3055\u3093","\u306F\u3057\u3053\u3099","\u306F\u3099\u3057\u3087","\u306F\u3057\u308B","\u306F\u305B\u308B","\u306F\u309A\u305D\u3053\u3093","\u306F\u305D\u3093","\u306F\u305F\u3093","\u306F\u3061\u307F\u3064","\u306F\u3064\u304A\u3093","\u306F\u3063\u304B\u304F","\u306F\u3064\u3099\u304D","\u306F\u3063\u304D\u308A","\u306F\u3063\u304F\u3064","\u306F\u3063\u3051\u3093","\u306F\u3063\u3053\u3046","\u306F\u3063\u3055\u3093","\u306F\u3063\u3057\u3093","\u306F\u3063\u305F\u3064","\u306F\u3063\u3061\u3085\u3046","\u306F\u3063\u3066\u3093","\u306F\u3063\u3072\u309A\u3087\u3046","\u306F\u3063\u307B\u309A\u3046","\u306F\u306A\u3059","\u306F\u306A\u3072\u3099","\u306F\u306B\u304B\u3080","\u306F\u3075\u3099\u3089\u3057","\u306F\u307F\u304B\u3099\u304D","\u306F\u3080\u304B\u3046","\u306F\u3081\u3064","\u306F\u3084\u3044","\u306F\u3084\u3057","\u306F\u3089\u3046","\u306F\u308D\u3046\u3043\u3093","\u306F\u308F\u3044","\u306F\u3093\u3044","\u306F\u3093\u3048\u3044","\u306F\u3093\u304A\u3093","\u306F\u3093\u304B\u304F","\u306F\u3093\u304D\u3087\u3046","\u306F\u3099\u3093\u304F\u3099\u307F","\u306F\u3093\u3053","\u306F\u3093\u3057\u3083","\u306F\u3093\u3059\u3046","\u306F\u3093\u305F\u3099\u3093","\u306F\u309A\u3093\u3061","\u306F\u309A\u3093\u3064","\u306F\u3093\u3066\u3044","\u306F\u3093\u3068\u3057","\u306F\u3093\u306E\u3046","\u306F\u3093\u306F\u309A","\u306F\u3093\u3075\u3099\u3093","\u306F\u3093\u3078\u309A\u3093","\u306F\u3093\u307B\u3099\u3046\u304D","\u306F\u3093\u3081\u3044","\u306F\u3093\u3089\u3093","\u306F\u3093\u308D\u3093","\u3072\u3044\u304D","\u3072\u3046\u3093","\u3072\u3048\u308B","\u3072\u304B\u304F","\u3072\u304B\u308A","\u3072\u304B\u308B","\u3072\u304B\u3093","\u3072\u304F\u3044","\u3072\u3051\u3064","\u3072\u3053\u3046\u304D","\u3072\u3053\u304F","\u3072\u3055\u3044","\u3072\u3055\u3057\u3075\u3099\u308A","\u3072\u3055\u3093","\u3072\u3099\u3057\u3099\u3085\u3064\u304B\u3093","\u3072\u3057\u3087","\u3072\u305D\u304B","\u3072\u305D\u3080","\u3072\u305F\u3080\u304D","\u3072\u305F\u3099\u308A","\u3072\u305F\u308B","\u3072\u3064\u304D\u3099","\u3072\u3063\u3053\u3057","\u3072\u3063\u3057","\u3072\u3064\u3057\u3099\u3085\u3072\u3093","\u3072\u3063\u3059","\u3072\u3064\u305B\u3099\u3093","\u3072\u309A\u3063\u305F\u308A","\u3072\u309A\u3063\u3061\u308A","\u3072\u3064\u3088\u3046","\u3072\u3066\u3044","\u3072\u3068\u3053\u3099\u307F","\u3072\u306A\u307E\u3064\u308A","\u3072\u306A\u3093","\u3072\u306D\u308B","\u3072\u306F\u3093","\u3072\u3072\u3099\u304F","\u3072\u3072\u3087\u3046","\u3072\u307B\u3046","\u3072\u307E\u308F\u308A","\u3072\u307E\u3093","\u3072\u307F\u3064","\u3072\u3081\u3044","\u3072\u3081\u3057\u3099\u3057","\u3072\u3084\u3051","\u3072\u3084\u3059","\u3072\u3088\u3046","\u3072\u3099\u3087\u3046\u304D","\u3072\u3089\u304B\u3099\u306A","\u3072\u3089\u304F","\u3072\u308A\u3064","\u3072\u308A\u3087\u3046","\u3072\u308B\u307E","\u3072\u308B\u3084\u3059\u307F","\u3072\u308C\u3044","\u3072\u308D\u3044","\u3072\u308D\u3046","\u3072\u308D\u304D","\u3072\u308D\u3086\u304D","\u3072\u3093\u304B\u304F","\u3072\u3093\u3051\u3064","\u3072\u3093\u3053\u3093","\u3072\u3093\u3057\u3085","\u3072\u3093\u305D\u3046","\u3072\u309A\u3093\u3061","\u3072\u3093\u306F\u309A\u3093","\u3072\u3099\u3093\u307B\u3099\u3046","\u3075\u3042\u3093","\u3075\u3044\u3046\u3061","\u3075\u3046\u3051\u3044","\u3075\u3046\u305B\u3093","\u3075\u309A\u3046\u305F\u308D\u3046","\u3075\u3046\u3068\u3046","\u3075\u3046\u3075","\u3075\u3048\u308B","\u3075\u304A\u3093","\u3075\u304B\u3044","\u3075\u304D\u3093","\u3075\u304F\u3055\u3099\u3064","\u3075\u304F\u3075\u3099\u304F\u308D","\u3075\u3053\u3046","\u3075\u3055\u3044","\u3075\u3057\u304D\u3099","\u3075\u3057\u3099\u307F","\u3075\u3059\u307E","\u3075\u305B\u3044","\u3075\u305B\u304F\u3099","\u3075\u305D\u304F","\u3075\u3099\u305F\u306B\u304F","\u3075\u305F\u3093","\u3075\u3061\u3087\u3046","\u3075\u3064\u3046","\u3075\u3064\u304B","\u3075\u3063\u304B\u3064","\u3075\u3063\u304D","\u3075\u3063\u3053\u304F","\u3075\u3099\u3068\u3099\u3046","\u3075\u3068\u308B","\u3075\u3068\u3093","\u3075\u306E\u3046","\u3075\u306F\u3044","\u3075\u3072\u3087\u3046","\u3075\u3078\u3093","\u3075\u307E\u3093","\u3075\u307F\u3093","\u3075\u3081\u3064","\u3075\u3081\u3093","\u3075\u3088\u3046","\u3075\u308A\u3053","\u3075\u308A\u308B","\u3075\u308B\u3044","\u3075\u3093\u3044\u304D","\u3075\u3099\u3093\u304B\u3099\u304F","\u3075\u3099\u3093\u304F\u3099","\u3075\u3093\u3057\u3064","\u3075\u3099\u3093\u305B\u304D","\u3075\u3093\u305D\u3046","\u3075\u3099\u3093\u307B\u309A\u3046","\u3078\u3044\u3042\u3093","\u3078\u3044\u304A\u3093","\u3078\u3044\u304B\u3099\u3044","\u3078\u3044\u304D","\u3078\u3044\u3051\u3099\u3093","\u3078\u3044\u3053\u3046","\u3078\u3044\u3055","\u3078\u3044\u3057\u3083","\u3078\u3044\u305B\u3064","\u3078\u3044\u305D","\u3078\u3044\u305F\u304F","\u3078\u3044\u3066\u3093","\u3078\u3044\u306D\u3064","\u3078\u3044\u308F","\u3078\u304D\u304B\u3099","\u3078\u3053\u3080","\u3078\u3099\u306B\u3044\u308D","\u3078\u3099\u306B\u3057\u3087\u3046\u304B\u3099","\u3078\u3089\u3059","\u3078\u3093\u304B\u3093","\u3078\u3099\u3093\u304D\u3087\u3046","\u3078\u3099\u3093\u3053\u3099\u3057","\u3078\u3093\u3055\u3044","\u3078\u3093\u305F\u3044","\u3078\u3099\u3093\u308A","\u307B\u3042\u3093","\u307B\u3044\u304F","\u307B\u3099\u3046\u304D\u3099\u3087","\u307B\u3046\u3053\u304F","\u307B\u3046\u305D\u3046","\u307B\u3046\u307B\u3046","\u307B\u3046\u3082\u3093","\u307B\u3046\u308A\u3064","\u307B\u3048\u308B","\u307B\u304A\u3093","\u307B\u304B\u3093","\u307B\u304D\u3087\u3046","\u307B\u3099\u304D\u3093","\u307B\u304F\u308D","\u307B\u3051\u3064","\u307B\u3051\u3093","\u307B\u3053\u3046","\u307B\u3053\u308B","\u307B\u3057\u3044","\u307B\u3057\u3064","\u307B\u3057\u3085","\u307B\u3057\u3087\u3046","\u307B\u305B\u3044","\u307B\u305D\u3044","\u307B\u305D\u304F","\u307B\u305F\u3066","\u307B\u305F\u308B","\u307B\u309A\u3061\u3075\u3099\u304F\u308D","\u307B\u3063\u304D\u3087\u304F","\u307B\u3063\u3055","\u307B\u3063\u305F\u3093","\u307B\u3068\u3093\u3068\u3099","\u307B\u3081\u308B","\u307B\u3093\u3044","\u307B\u3093\u304D","\u307B\u3093\u3051","\u307B\u3093\u3057\u3064","\u307B\u3093\u3084\u304F","\u307E\u3044\u306B\u3061","\u307E\u304B\u3044","\u307E\u304B\u305B\u308B","\u307E\u304B\u3099\u308B","\u307E\u3051\u308B","\u307E\u3053\u3068","\u307E\u3055\u3064","\u307E\u3057\u3099\u3081","\u307E\u3059\u304F","\u307E\u305B\u3099\u308B","\u307E\u3064\u308A","\u307E\u3068\u3081","\u307E\u306A\u3075\u3099","\u307E\u306C\u3051","\u307E\u306D\u304F","\u307E\u307B\u3046","\u307E\u3082\u308B","\u307E\u3086\u3051\u3099","\u307E\u3088\u3046","\u307E\u308D\u3084\u304B","\u307E\u308F\u3059","\u307E\u308F\u308A","\u307E\u308F\u308B","\u307E\u3093\u304B\u3099","\u307E\u3093\u304D\u3064","\u307E\u3093\u305D\u3099\u304F","\u307E\u3093\u306A\u304B","\u307F\u3044\u3089","\u307F\u3046\u3061","\u307F\u3048\u308B","\u307F\u304B\u3099\u304F","\u307F\u304B\u305F","\u307F\u304B\u3093","\u307F\u3051\u3093","\u307F\u3053\u3093","\u307F\u3057\u3099\u304B\u3044","\u307F\u3059\u3044","\u307F\u3059\u3048\u308B","\u307F\u305B\u308B","\u307F\u3063\u304B","\u307F\u3064\u304B\u308B","\u307F\u3064\u3051\u308B","\u307F\u3066\u3044","\u307F\u3068\u3081\u308B","\u307F\u306A\u3068","\u307F\u306A\u307F\u304B\u3055\u3044","\u307F\u306D\u3089\u308B","\u307F\u306E\u3046","\u307F\u306E\u304B\u3099\u3059","\u307F\u307B\u3093","\u307F\u3082\u3068","\u307F\u3084\u3051\u3099","\u307F\u3089\u3044","\u307F\u308A\u3087\u304F","\u307F\u308F\u304F","\u307F\u3093\u304B","\u307F\u3093\u305D\u3099\u304F","\u3080\u3044\u304B","\u3080\u3048\u304D","\u3080\u3048\u3093","\u3080\u304B\u3044","\u3080\u304B\u3046","\u3080\u304B\u3048","\u3080\u304B\u3057","\u3080\u304D\u3099\u3061\u3083","\u3080\u3051\u308B","\u3080\u3051\u3099\u3093","\u3080\u3055\u307B\u3099\u308B","\u3080\u3057\u3042\u3064\u3044","\u3080\u3057\u306F\u3099","\u3080\u3057\u3099\u3085\u3093","\u3080\u3057\u308D","\u3080\u3059\u3046","\u3080\u3059\u3053","\u3080\u3059\u3075\u3099","\u3080\u3059\u3081","\u3080\u305B\u308B","\u3080\u305B\u3093","\u3080\u3061\u3085\u3046","\u3080\u306A\u3057\u3044","\u3080\u306E\u3046","\u3080\u3084\u307F","\u3080\u3088\u3046","\u3080\u3089\u3055\u304D","\u3080\u308A\u3087\u3046","\u3080\u308D\u3093","\u3081\u3044\u3042\u3093","\u3081\u3044\u3046\u3093","\u3081\u3044\u3048\u3093","\u3081\u3044\u304B\u304F","\u3081\u3044\u304D\u3087\u304F","\u3081\u3044\u3055\u3044","\u3081\u3044\u3057","\u3081\u3044\u305D\u3046","\u3081\u3044\u3075\u3099\u3064","\u3081\u3044\u308C\u3044","\u3081\u3044\u308F\u304F","\u3081\u304F\u3099\u307E\u308C\u308B","\u3081\u3055\u3099\u3059","\u3081\u3057\u305F","\u3081\u3059\u3099\u3089\u3057\u3044","\u3081\u305F\u3099\u3064","\u3081\u307E\u3044","\u3081\u3084\u3059","\u3081\u3093\u304D\u3087","\u3081\u3093\u305B\u304D","\u3081\u3093\u3068\u3099\u3046","\u3082\u3046\u3057\u3042\u3051\u3099\u308B","\u3082\u3046\u3068\u3099\u3046\u3051\u3093","\u3082\u3048\u308B","\u3082\u304F\u3057","\u3082\u304F\u3066\u304D","\u3082\u304F\u3088\u3046\u3072\u3099","\u3082\u3061\u308D\u3093","\u3082\u3068\u3099\u308B","\u3082\u3089\u3046","\u3082\u3093\u304F","\u3082\u3093\u305F\u3099\u3044","\u3084\u304A\u3084","\u3084\u3051\u308B","\u3084\u3055\u3044","\u3084\u3055\u3057\u3044","\u3084\u3059\u3044","\u3084\u3059\u305F\u308D\u3046","\u3084\u3059\u307F","\u3084\u305B\u308B","\u3084\u305D\u3046","\u3084\u305F\u3044","\u3084\u3061\u3093","\u3084\u3063\u3068","\u3084\u3063\u306F\u309A\u308A","\u3084\u3075\u3099\u308B","\u3084\u3081\u308B","\u3084\u3084\u3053\u3057\u3044","\u3084\u3088\u3044","\u3084\u308F\u3089\u304B\u3044","\u3086\u3046\u304D","\u3086\u3046\u3072\u3099\u3093\u304D\u3087\u304F","\u3086\u3046\u3078\u3099","\u3086\u3046\u3081\u3044","\u3086\u3051\u3064","\u3086\u3057\u3085\u3064","\u3086\u305B\u3093","\u3086\u305D\u3046","\u3086\u305F\u304B","\u3086\u3061\u3083\u304F","\u3086\u3066\u3099\u308B","\u3086\u306B\u3085\u3046","\u3086\u3072\u3099\u308F","\u3086\u3089\u3044","\u3086\u308C\u308B","\u3088\u3046\u3044","\u3088\u3046\u304B","\u3088\u3046\u304D\u3085\u3046","\u3088\u3046\u3057\u3099","\u3088\u3046\u3059","\u3088\u3046\u3061\u3048\u3093","\u3088\u304B\u305B\u3099","\u3088\u304B\u3093","\u3088\u304D\u3093","\u3088\u304F\u305B\u3044","\u3088\u304F\u307B\u3099\u3046","\u3088\u3051\u3044","\u3088\u3053\u3099\u308C\u308B","\u3088\u3055\u3093","\u3088\u3057\u3085\u3046","\u3088\u305D\u3046","\u3088\u305D\u304F","\u3088\u3063\u304B","\u3088\u3066\u3044","\u3088\u3068\u3099\u304B\u3099\u308F\u304F","\u3088\u306D\u3064","\u3088\u3084\u304F","\u3088\u3086\u3046","\u3088\u308D\u3053\u3075\u3099","\u3088\u308D\u3057\u3044","\u3089\u3044\u3046","\u3089\u304F\u304B\u3099\u304D","\u3089\u304F\u3053\u3099","\u3089\u304F\u3055\u3064","\u3089\u304F\u305F\u3099","\u3089\u3057\u3093\u306F\u3099\u3093","\u3089\u305B\u3093","\u3089\u305D\u3099\u304F","\u3089\u305F\u3044","\u3089\u3063\u304B","\u3089\u308C\u3064","\u308A\u3048\u304D","\u308A\u304B\u3044","\u308A\u304D\u3055\u304F","\u308A\u304D\u305B\u3064","\u308A\u304F\u304F\u3099\u3093","\u308A\u304F\u3064","\u308A\u3051\u3093","\u308A\u3053\u3046","\u308A\u305B\u3044","\u308A\u305D\u3046","\u308A\u305D\u304F","\u308A\u3066\u3093","\u308A\u306D\u3093","\u308A\u3086\u3046","\u308A\u3085\u3046\u304B\u3099\u304F","\u308A\u3088\u3046","\u308A\u3087\u3046\u308A","\u308A\u3087\u304B\u3093","\u308A\u3087\u304F\u3061\u3083","\u308A\u3087\u3053\u3046","\u308A\u308A\u304F","\u308A\u308C\u304D","\u308A\u308D\u3093","\u308A\u3093\u3053\u3099","\u308B\u3044\u3051\u3044","\u308B\u3044\u3055\u3044","\u308B\u3044\u3057\u3099","\u308B\u3044\u305B\u304D","\u308B\u3059\u306F\u3099\u3093","\u308B\u308A\u304B\u3099\u308F\u3089","\u308C\u3044\u304B\u3093","\u308C\u3044\u304D\u3099","\u308C\u3044\u305B\u3044","\u308C\u3044\u305D\u3099\u3046\u3053","\u308C\u3044\u3068\u3046","\u308C\u3044\u307B\u3099\u3046","\u308C\u304D\u3057","\u308C\u304D\u305F\u3099\u3044","\u308C\u3093\u3042\u3044","\u308C\u3093\u3051\u3044","\u308C\u3093\u3053\u3093","\u308C\u3093\u3055\u3044","\u308C\u3093\u3057\u3085\u3046","\u308C\u3093\u305D\u3099\u304F","\u308C\u3093\u3089\u304F","\u308D\u3046\u304B","\u308D\u3046\u3053\u3099","\u308D\u3046\u3057\u3099\u3093","\u308D\u3046\u305D\u304F","\u308D\u304F\u304B\u3099","\u308D\u3053\u3064","\u308D\u3057\u3099\u3046\u3089","\u308D\u3057\u3085\u3064","\u308D\u305B\u3093","\u308D\u3066\u3093","\u308D\u3081\u3093","\u308D\u308C\u3064","\u308D\u3093\u304D\u3099","\u308D\u3093\u306F\u309A","\u308D\u3093\u3075\u3099\u3093","\u308D\u3093\u308A","\u308F\u304B\u3059","\u308F\u304B\u3081","\u308F\u304B\u3084\u307E","\u308F\u304B\u308C\u308B","\u308F\u3057\u3064","\u308F\u3057\u3099\u307E\u3057","\u308F\u3059\u308C\u3082\u306E","\u308F\u3089\u3046","\u308F\u308C\u308B"];XB.exports=wG});var eN=R((Goe,QB)=>{"use strict";p();var EG=["a\u0301baco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","accio\u0301n","aceite","acelga","acento","aceptar","a\u0301cido","aclarar","acne\u0301","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","ae\u0301reo","afectar","aficio\u0301n","afinar","afirmar","a\u0301gil","agitar","agoni\u0301a","agosto","agotar","agregar","agrio","agua","agudo","a\u0301guila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacra\u0301n","alambre","alarma","alba","a\u0301lbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodo\u0301n","aliado","aliento","alivio","alma","almeja","almi\u0301bar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","a\u0301mbar","a\u0301mbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","ande\u0301n","anemia","a\u0301ngulo","anillo","a\u0301nimo","ani\u0301s","anotar","antena","antiguo","antojo","anual","anular","anuncio","an\u0303adir","an\u0303ejo","an\u0303o","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","aran\u0303a","arar","a\u0301rbitro","a\u0301rbol","arbusto","archivo","arco","arder","ardilla","arduo","a\u0301rea","a\u0301rido","aries","armoni\u0301a","arne\u0301s","aroma","arpa","arpo\u0301n","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","a\u0301spero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","a\u0301tico","atleta","a\u0301tomo","atraer","atroz","atu\u0301n","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avio\u0301n","aviso","ayer","ayuda","ayuno","azafra\u0301n","azar","azote","azu\u0301car","azufre","azul","baba","babor","bache","bahi\u0301a","baile","bajar","balanza","balco\u0301n","balde","bambu\u0301","banco","banda","ban\u0303o","barba","barco","barniz","barro","ba\u0301scula","basto\u0301n","basura","batalla","bateri\u0301a","batir","batuta","bau\u0301l","bazar","bebe\u0301","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsa\u0301i","borde","borrar","bosque","bote","boti\u0301n","bo\u0301veda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufo\u0301n","bu\u0301ho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzo\u0301n","caballo","cabeza","cabina","cabra","cacao","cada\u0301ver","cadena","caer","cafe\u0301","cai\u0301da","caima\u0301n","caja","cajo\u0301n","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","ca\u0301ncer","candil","canela","canguro","canica","canto","can\u0303a","can\u0303o\u0301n","caoba","caos","capaz","capita\u0301n","capote","captar","capucha","cara","carbo\u0301n","ca\u0301rcel","careta","carga","carin\u0303o","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","ce\u0301lebre","celoso","ce\u0301lula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","ce\u0301sped","cetro","chacal","chaleco","champu\u0301","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclo\u0301n","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","cipre\u0301s","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","cli\u0301nica","cobre","coccio\u0301n","cochino","cocina","coco","co\u0301digo","codo","cofre","coger","cohete","coji\u0301n","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","co\u0301modo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazo\u0301n","corbata","corcho","cordo\u0301n","corona","correr","coser","cosmos","costa","cra\u0301neo","cra\u0301ter","crear","crecer","crei\u0301do","crema","cri\u0301a","crimen","cripta","crisis","cromo","cro\u0301nica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupo\u0301n","cu\u0301pula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","da\u0301til","deber","de\u0301bil","de\u0301cada","decir","dedo","defensa","definir","dejar","delfi\u0301n","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvi\u0301o","detalle","detener","deuda","di\u0301a","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difi\u0301cil","digno","dilema","diluir","dinero","directo","dirigir","disco","disen\u0303o","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","drago\u0301n","droga","ducha","duda","duelo","duen\u0303o","dulce","du\u0301o","duque","durar","dureza","duro","e\u0301bano","ebrio","echar","eco","ecuador","edad","edicio\u0301n","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","e\u0301lite","elixir","elogio","eludir","embudo","emitir","emocio\u0301n","empate","empen\u0303o","empleo","empresa","enano","encargo","enchufe","enci\u0301a","enemigo","enero","enfado","enfermo","engan\u0303o","enigma","enlace","enorme","enredo","ensayo","ensen\u0303ar","entero","entrar","envase","envi\u0301o","e\u0301poca","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espi\u0301a","esposa","espuma","esqui\u0301","estar","este","estilo","estufa","etapa","eterno","e\u0301tica","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","e\u0301xito","experto","explicar","exponer","extremo","fa\u0301brica","fa\u0301bula","fachada","fa\u0301cil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","farao\u0301n","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fe\u0301rtil","fervor","festi\u0301n","fiable","fianza","fiar","fibra","ficcio\u0301n","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flu\u0301or","fobia","foca","fogata","fogo\u0301n","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","fra\u0301gil","franja","frase","fraude","frei\u0301r","freno","fresa","fri\u0301o","frito","fruta","fuego","fuente","fuerza","fuga","fumar","funcio\u0301n","funda","furgo\u0301n","furia","fusil","fu\u0301tbol","futuro","gacela","gafas","gaita","gajo","gala","galeri\u0301a","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavila\u0301n","gemelo","gemir","gen","ge\u0301nero","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gra\u0301fico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","gru\u0301a","grueso","grumo","grupo","guante","guapo","guardia","guerra","gui\u0301a","guin\u0303o","guion","guiso","guitarra","gusano","gustar","haber","ha\u0301bil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazan\u0303a","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","he\u0301roe","hervir","hielo","hierro","hi\u0301gado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","hu\u0301medo","humilde","humo","hundir","huraca\u0301n","hurto","icono","ideal","idioma","i\u0301dolo","iglesia","iglu\u0301","igual","ilegal","ilusio\u0301n","imagen","ima\u0301n","imitar","impar","imperio","imponer","impulso","incapaz","i\u0301ndice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","intere\u0301s","i\u0301ntimo","intuir","inu\u0301til","invierno","ira","iris","ironi\u0301a","isla","islote","jabali\u0301","jabo\u0301n","jamo\u0301n","jarabe","jardi\u0301n","jarra","jaula","jazmi\u0301n","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","ju\u0301piter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladro\u0301n","lagarto","la\u0301grima","laguna","laico","lamer","la\u0301mina","la\u0301mpara","lana","lancha","langosta","lanza","la\u0301piz","largo","larva","la\u0301stima","lata","la\u0301tex","latir","laurel","lavar","lazo","leal","leccio\u0301n","leche","lector","leer","legio\u0301n","legumbre","lejano","lengua","lento","len\u0303a","leo\u0301n","leopardo","lesio\u0301n","letal","letra","leve","leyenda","libertad","libro","licor","li\u0301der","lidiar","lienzo","liga","ligero","lima","li\u0301mite","limo\u0301n","limpio","lince","lindo","li\u0301nea","lingote","lino","linterna","li\u0301quido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","locio\u0301n","loco","locura","lo\u0301gica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","mai\u0301z","maldad","maleta","malla","malo","mama\u0301","mambo","mamut","manco","mando","manejar","manga","maniqui\u0301","manjar","mano","manso","manta","man\u0303ana","mapa","ma\u0301quina","mar","marco","marea","marfil","margen","marido","ma\u0301rmol","marro\u0301n","martes","marzo","masa","ma\u0301scara","masivo","matar","materia","matiz","matriz","ma\u0301ximo","mayor","mazorca","mecha","medalla","medio","me\u0301dula","mejilla","mejor","melena","melo\u0301n","memoria","menor","mensaje","mente","menu\u0301","mercado","merengue","me\u0301rito","mes","meso\u0301n","meta","meter","me\u0301todo","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millo\u0301n","mimo","mina","minero","mi\u0301nimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","mocio\u0301n","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","mon\u0303o","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","mo\u0301vil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","mun\u0303eca","mural","muro","mu\u0301sculo","museo","musgo","mu\u0301sica","muslo","na\u0301car","nacio\u0301n","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","na\u0301usea","naval","nave","navidad","necio","ne\u0301ctar","negar","negocio","negro","neo\u0301n","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","nin\u0303ez","nin\u0303o","ni\u0301tido","nivel","nobleza","noche","no\u0301mina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","nu\u0301cleo","nudillo","nudo","nuera","nueve","nuez","nulo","nu\u0301mero","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","oce\u0301ano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oi\u0301do","oi\u0301r","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opcio\u0301n","o\u0301pera","opinar","oponer","optar","o\u0301ptica","opuesto","oracio\u0301n","orador","oral","o\u0301rbita","orca","orden","oreja","o\u0301rgano","orgi\u0301a","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadi\u0301a","oscuro","osezno","oso","ostra","oton\u0303o","otro","oveja","o\u0301vulo","o\u0301xido","oxi\u0301geno","oyente","ozono","pacto","padre","paella","pa\u0301gina","pago","pai\u0301s","pa\u0301jaro","palabra","palco","paleta","pa\u0301lido","palma","paloma","palpar","pan","panal","pa\u0301nico","pantera","pan\u0303uelo","papa\u0301","papel","papilla","paquete","parar","parcela","pared","parir","paro","pa\u0301rpado","parque","pa\u0301rrafo","parte","pasar","paseo","pasio\u0301n","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peato\u0301n","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldan\u0303o","pelea","peligro","pellejo","pelo","peluca","pena","pensar","pen\u0303o\u0301n","peo\u0301n","peor","pepino","pequen\u0303o","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pe\u0301simo","pestan\u0303a","pe\u0301talo","petro\u0301leo","pez","pezun\u0303a","picar","picho\u0301n","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","pin\u0303a","piojo","pipa","pirata","pisar","piscina","piso","pista","pito\u0301n","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesi\u0301a","poeta","polen","polici\u0301a","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porcio\u0301n","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","pri\u0301ncipe","prisio\u0301n","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","pro\u0301ximo","prueba","pu\u0301blico","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmo\u0301n","pulpo","pulso","puma","punto","pun\u0303al","pun\u0303o","pupa","pupila","pure\u0301","quedar","queja","quemar","querer","queso","quieto","qui\u0301mica","quince","quitar","ra\u0301bano","rabia","rabo","racio\u0301n","radical","rai\u0301z","rama","rampa","rancho","rango","rapaz","ra\u0301pido","rapto","rasgo","raspa","rato","rayo","raza","razo\u0301n","reaccio\u0301n","realidad","reban\u0303o","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refra\u0301n","refugio","regalo","regir","regla","regreso","rehe\u0301n","reino","rei\u0301r","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","reve\u0301s","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","ri\u0301gido","rigor","rinco\u0301n","rin\u0303o\u0301n","ri\u0301o","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubi\u0301","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sa\u0301bado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmo\u0301n","salo\u0301n","salsa","salto","salud","salvar","samba","sancio\u0301n","sandi\u0301a","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sarte\u0301n","sastre","sata\u0301n","sauna","saxofo\u0301n","seccio\u0301n","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","sen\u0303al","sen\u0303or","separar","sepia","sequi\u0301a","ser","serie","sermo\u0301n","servir","sesenta","sesio\u0301n","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","si\u0301laba","silbar","silencio","silla","si\u0301mbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","so\u0301lido","soltar","solucio\u0301n","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","soste\u0301n","so\u0301tano","suave","subir","suceso","sudor","suegra","suelo","suen\u0303o","suerte","sufrir","sujeto","sulta\u0301n","sumar","superar","suplir","suponer","supremo","sur","surco","suren\u0303o","surgir","susto","sutil","tabaco","tabique","tabla","tabu\u0301","taco","tacto","tajo","talar","talco","talento","talla","talo\u0301n","taman\u0303o","tambor","tango","tanque","tapa","tapete","tapia","tapo\u0301n","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazo\u0301n","teatro","techo","tecla","te\u0301cnica","tejado","tejer","tejido","tela","tele\u0301fono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teori\u0301a","terapia","terco","te\u0301rmino","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburo\u0301n","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","ti\u0301mido","timo","tinta","ti\u0301o","ti\u0301pico","tipo","tira","tiro\u0301n","tita\u0301n","ti\u0301tere","ti\u0301tulo","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","to\u0301rax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","to\u0301xico","trabajo","tractor","traer","tra\u0301fico","trago","traje","tramo","trance","trato","trauma","trazar","tre\u0301bol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tuberi\u0301a","tubo","tuerto","tumba","tumor","tu\u0301nel","tu\u0301nica","turbina","turismo","turno","tutor","ubicar","u\u0301lcera","umbral","unidad","unir","universo","uno","untar","un\u0303a","urbano","urbe","urgente","urna","usar","usuario","u\u0301til","utopi\u0301a","uva","vaca","vaci\u0301o","vacuna","vagar","vago","vaina","vajilla","vale","va\u0301lido","valle","valor","va\u0301lvula","vampiro","vara","variar","varo\u0301n","vaso","vecino","vector","vehi\u0301culo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vi\u0301a","viaje","vibrar","vicio","vi\u0301ctima","vida","vi\u0301deo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","vin\u0303edo","violi\u0301n","viral","virgo","virtud","visor","vi\u0301spera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volca\u0301n","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"];QB.exports=EG});var rN=R((Zoe,tN)=>{p();tN.exports={CHINESE:KB(),ENGLISH:GB(),FRENCH:ZB(),ITALIAN:$B(),JAPANESE:JB(),SPANISH:eN()}});var aN=R(($oe,oN)=>{"use strict";p();var xG=Fl(),IG=Ge(),Ac=Ve(),OG=UB(),s_=jB(),iN=ti(),AG=ke(),TG=Ri(),nN=Oe();function jl(e){return typeof e=="string"?e.normalize("NFKD"):""}var Ue=function(e,t){if(!(this instanceof Ue))return new Ue(e,t);Ac.isArray(e)&&(t=e,e=null);var r,i,n;if(l.Buffer.isBuffer(e))n=e;else if(Ac.isString(e))i=jl(e);else if(Ac.isNumber(e))r=e;else if(e)throw new iN.InvalidArgument("data","Must be a Buffer, a string or an integer");if(r=r||128,t=t||Ue._getDictionary(i),i&&!t)throw new s_.UnknownWordlist(i);if(t=t||Ue.Words.ENGLISH,n&&(i=Ue._entropy2mnemonic(n,t)),i&&!Ue.isValid(i,t))throw new s_.InvalidMnemonic(i);if(r%32!==0||r<128)throw new iN.InvalidArgument("ENT","Values must be ENT > 128 and ENT % 32 == 0");i=i||Ue._mnemonic(r,t),Object.defineProperty(this,"wordlist",{configurable:!1,value:t}),Object.defineProperty(this,"phrase",{configurable:!1,value:i})};Ue.fromRandom=function(e,t){if(Ac.isNumber(e)){var r=t;t=e,e=r}return e=e||Ue.Words.ENGLISH,t=t||128,new Ue(t,e)};Ue.fromString=function(e,t=Ue.Words.ENGLISH){return new Ue(e,t)};Ue.Words=rN();Ue.isValid=function(e,t){if(e=jl(e),t=t||Ue._getDictionary(e),!t)return!1;for(var r=e.split(" "),i="",n=0;n<r.length;n++){var o=t.indexOf(r[n]);if(o<0)return!1;i=i+("00000000000"+o.toString(2)).slice(-11)}var a=i.length/33,s=i.slice(-a),u=i.slice(0,i.length-a),c=l.Buffer.alloc(u.length/8);for(n=0;n<u.length/8;n++)c.writeUInt8(parseInt(i.slice(n*8,(n+1)*8),2),n);var f=Ue._entropyChecksum(c);return f===s};Ue._belongsToWordlist=function(e,t){for(var r=jl(e).split(" "),i=0;i<r.length;i++){var n=t.indexOf(r[i]);if(n<0)return!1}return!0};Ue._getDictionary=function(e){if(!e)return null;for(var t=Object.keys(Ue.Words),r=0;r<t.length;r++){var i=t[r];if(Ue._belongsToWordlist(e,Ue.Words[i]))return Ue.Words[i]}return null};Ue.prototype.toSeed=function(e){return e=e||"",OG(jl(this.phrase),jl("mnemonic"+e),2048,64)};Ue.fromSeed=function(e,t){return nN.checkArgument(l.Buffer.isBuffer(e),"seed must be a Buffer."),nN.checkArgument(Ac.isArray(t)||Ac.isString(t),"wordlist must be a string or an array."),new Ue(e,t)};Ue.prototype.toHDPrivateKey=function(e,t){var r=this.toSeed(e);return xG.fromSeed(r,t)};Ue.prototype.toString=function(){return this.phrase};Ue.prototype.inspect=function(){return"<Mnemonic: "+this.toString()+" >"};Ue._mnemonic=function(e,t){var r=TG.getRandomBuffer(e/8);return Ue._entropy2mnemonic(r,t)};Ue._entropy2mnemonic=function(e,t){for(var r="",i=0;i<e.length;i++)r=r+("00000000"+e[i].toString(2)).slice(-8);if(r=r+Ue._entropyChecksum(e),r.length%11!==0)throw new s_.InvalidEntropy(r);var n=[];for(i=0;i<r.length/11;i++){var o=parseInt(r.slice(i*11,(i+1)*11),2);n.push(t[o])}var a;return t===Ue.Words.JAPANESE?a=n.join("\u3000"):a=n.join(" "),a};Ue._entropyChecksum=function(e){for(var t=AG.sha256(e),r=e.length*8,i=r/32,n=new IG(t.toString("hex"),16).toString(2);n.length%256!==0;)n="0"+n;var o=n.slice(0,i);return o};Object.defineProperty(Ue,"bsv",{configurable:!0,enumerable:!0,get:function(){return u_()}});oN.exports=Ue});var c_=R((Joe,sN)=>{p();sN.exports=aN()});function PG(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function RG(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function jg(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function Ne(e,t,r=""){let i=PG(e),n=e?.length,o=t!==void 0;if(!i||o&&n!==t){let a=r&&`"${r}" `,s=o?` of length ${t}`:"",u=i?`length=${n}`:`type=${typeof e}`,c=a+"expected Uint8Array"+s+", got "+u;throw i?new RangeError(c):new TypeError(c)}return e}function zl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Kl(e,t,r=!1){Ne(e,void 0,"output");let i=t.outputLen;if(e.length<i)throw new RangeError("digestInto() expects output buffer of length at least "+i);if(r&&!Hr(e))throw new Error("invalid output, must be aligned")}function zg(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Ke(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function st(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Tc(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function f_(e,t){return!e.byteLength||!t.byteLength?!1:e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength}function Vl(e,t){if(f_(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}function l_(...e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];Ne(n),t+=n.length}let r=new Uint8Array(t);for(let i=0,n=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return r}function Gl(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return r===0}function Wl(e,t,r){let i=t,n=r||(()=>[]),o=(s,u)=>i(u,...n(s)).update(s).digest(),a=i(new Uint8Array(e),...n(new Uint8Array(0)));return o.outputLen=a.outputLen,o.blockLen=a.blockLen,o.create=(s,...u)=>i(s,...u),o}function Ys(e,t,r=!0){if(t===void 0)return new Uint8Array(e);if(Ne(t,void 0,"output"),t.length!==e)throw new Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&!Hr(t))throw new Error("invalid output, must be aligned");return t}function uN(e,t,r){jg(e),jg(t),RG(r);let i=new Uint8Array(16),n=Tc(i);return n.setBigUint64(0,BigInt(t),r),n.setBigUint64(8,BigInt(e),r),i}function Hr(e){return e.byteOffset%4===0}function Tt(e){return Uint8Array.from(Ne(e))}var nn,Zs,Ce,kG,Xe,no,h_=Br(()=>{p();nn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Zs=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,Ce=nn?e=>e:e=>Zs(e)>>>0,kG=e=>{for(let t=0;t<e.length;t++)e[t]=Zs(e[t]);return e},Xe=nn?e=>e:kG;no=(e,t)=>{function r(i,...n){if(Ne(i,void 0,"key"),e.nonceLength!==void 0){let f=n[0];Ne(f,e.varSizeNonce?void 0:e.nonceLength,"nonce")}let o=e.tagLength;o&&n[1]!==void 0&&Ne(n[1],void 0,"AAD");let a=t(i,...n),s=(f,d)=>{if(d!==void 0){if(f!==2)throw new Error("cipher output not supported");Ne(d,void 0,"output")}},u=!1;return{encrypt(f,d){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,Ne(f),s(a.encrypt.length,d),a.encrypt(f,d)},decrypt(f,d){if(Ne(f),o&&f.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return s(a.decrypt.length,d),a.decrypt(f,d)}}}return Object.assign(r,e),r}});function CG(e){e.reverse();let t=e[15]&1,r=0;for(let i=0;i<e.length;i++){let n=e[i];e[i]=n>>>1|r,r=(n&1)<<7}return e[0]^=-t&225,e}var Qo,p_,oo,BG,NG,Zl,qa,LG,Kg,d_,g_,cN,fN=Br(()=>{p();h_();Qo=16,p_=new Uint8Array(16),oo=Ke(p_),BG=225,NG=(e,t,r,i)=>{let n=i&1;return{s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^BG<<24&-(n&1)}},Zl=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255|0,qa=e=>Ce(Zl(e));LG=e=>e>64*1024?8:e>1024?4:2,Kg=class{constructor(t,r){H(this,"blockLen",Qo);H(this,"outputLen",Qo);H(this,"s0",0);H(this,"s1",0);H(this,"s2",0);H(this,"s3",0);H(this,"finished",!1);H(this,"destroyed",!1);H(this,"t");H(this,"W");H(this,"windowSize");Ne(t,16,"key"),t=Tt(t);let i=Tc(t),n=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),s=i.getUint32(12,!1),u=[];for(let w=0;w<128;w++)u.push({s0:Zl(n),s1:Zl(o),s2:Zl(a),s3:Zl(s)}),{s0:n,s1:o,s2:a,s3:s}=NG(n,o,a,s);let c=LG(r||1024);if(![1,2,4,8].includes(c))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=c;let d=128/c,m=this.windowSize=2**c,y=[];for(let w=0;w<d;w++)for(let T=0;T<m;T++){let B=0,C=0,q=0,F=0;for(let P=0;P<c;P++){if(!(T>>>c-P-1&1))continue;let{s0:M,s1:K,s2:z,s3:V}=u[c*w+P];B^=M,C^=K,q^=z,F^=V}y.push({s0:B,s1:C,s2:q,s3:F})}this.t=y}_updateBlock(t,r,i,n){t^=this.s0,r^=this.s1,i^=this.s2,n^=this.s3;let{W:o,t:a,windowSize:s}=this,u=0,c=0,f=0,d=0,m=(1<<o)-1,y=0;for(let w of[t,r,i,n])for(let T=0;T<4;T++){let B=w>>>8*T&255;for(let C=8/o-1;C>=0;C--){let q=B>>>o*C&m,{s0:F,s1:P,s2:k,s3:M}=a[y*s+q];u^=F,c^=P,f^=k,d^=M,y+=1}}this.s0=u,this.s1=c,this.s2=f,this.s3=d}update(t){zl(this),Ne(t),t=Tt(t);let r=Ke(t),i=Math.floor(t.length/Qo),n=t.length%Qo;for(let o=0;o<i;o++)this._updateBlock(Ce(r[o*4+0]),Ce(r[o*4+1]),Ce(r[o*4+2]),Ce(r[o*4+3]));return n&&(p_.set(t.subarray(i*Qo)),this._updateBlock(Ce(oo[0]),Ce(oo[1]),Ce(oo[2]),Ce(oo[3])),st(oo)),this}destroy(){this.destroyed=!0;let{t}=this;for(let r of t)r.s0=0,r.s1=0,r.s2=0,r.s3=0}digestInto(t){zl(this),Kl(t,this,!0),this.finished=!0;let{s0:r,s1:i,s2:n,s3:o}=this,a=Ke(t);a[0]=r,a[1]=i,a[2]=n,a[3]=o,Xe(a)}digest(){let t=new Uint8Array(Qo);return this.digestInto(t),this.destroy(),t}},d_=class extends Kg{constructor(t,r){Ne(t);let i=CG(Tt(t));super(i,r),st(i)}update(t){zl(this),Ne(t),t=Tt(t);let r=Ke(t),i=t.length%Qo,n=Math.floor(t.length/Qo);for(let o=0;o<n;o++)this._updateBlock(qa(r[o*4+3]),qa(r[o*4+2]),qa(r[o*4+1]),qa(r[o*4+0]));return i&&(p_.set(t.subarray(n*Qo)),this._updateBlock(qa(oo[3]),qa(oo[2]),qa(oo[1]),qa(oo[0])),st(oo)),this}digestInto(t){zl(this),Kl(t,this,!0),this.finished=!0;let r=t.subarray(0,this.outputLen),{s0:i,s1:n,s2:o,s3:a}=this,s=Ke(r);s[0]=i,s[1]=n,s[2]=o,s[3]=a,Xe(s),r.reverse()}},g_=Wl(16,(e,t)=>new Kg(e,t),e=>[e.length]),cN=Wl(16,(e,t)=>new d_(e,t),e=>[e.length])});var x_={};ff(x_,{__TESTS:()=>QG,aeskw:()=>GG,aeskwp:()=>WG,aessiv:()=>XG,cbc:()=>jG,cfb:()=>zG,cmac:()=>$l,ctr:()=>Bc,ecb:()=>HG,gcm:()=>KG,gcmsiv:()=>VG,rngAesCtrDrbg128:()=>ZG,rngAesCtrDrbg256:()=>YG,siv:()=>$G,unsafe:()=>JG});function Gg(e){if(![16,24,32].includes(e.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+e.length)}function w_(e){return e<<1^DG&-(e>>7)}function Pc(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(t&1),e=w_(e);return r}function dN(e,t){if(e.length!==256)throw new Error("Wrong sbox length");let r=new Uint32Array(256).map((c,f)=>t(e[f])),i=r.map(m_),n=i.map(m_),o=n.map(m_),a=new Uint32Array(256*256),s=new Uint32Array(256*256),u=new Uint16Array(256*256);for(let c=0;c<256;c++)for(let f=0;f<256;f++){let d=c*256+f;a[d]=r[c]^i[f],s[d]=n[c]^o[f],u[d]=e[c]<<8|e[f]}return{sbox:e,sbox2:u,T0:r,T1:i,T2:n,T3:o,T01:a,T23:s}}function Pn(e){Ne(e);let t=e.length;Gg(e);let{sbox2:r}=E_,i=[];(!nn||!Hr(e))&&i.push(e=Tt(e));let n=Xe(Ke(e)),o=n.length,a=u=>ao(r,u,u,u,u),s=new Uint32Array(t+28);s.set(n);for(let u=o;u<s.length;u++){let c=s[u-1];u%o===0?c=a(FG(c))^UG[u/o-1]:o>6&&u%o===4&&(c=a(c)),s[u]=s[u-o]^c}return st(...i),s}function Wg(e){let t=Pn(e),r=t.slice(),i=t.length,{sbox2:n}=E_,{T0:o,T1:a,T2:s,T3:u}=pN;for(let c=0;c<i;c+=4)for(let f=0;f<4;f++)r[c+f]=t[i-c-4+f];st(t);for(let c=4;c<i-4;c++){let f=r[c],d=ao(n,f,f,f,f);r[c]=o[d&255]^a[d>>>8&255]^s[d>>>16&255]^u[d>>>24]}return r}function Fa(e,t,r,i,n,o){return e[r<<8&65280|i>>>8&255]^t[n>>>8&65280|o>>>24&255]}function ao(e,t,r,i,n){return e[t&255|r&65280]|e[i>>>16&255|n>>>16&65280]<<16}function hi(e,t,r,i,n){let{sbox2:o,T01:a,T23:s}=E_,u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];let c=e.length/4-2;for(let w=0;w<c;w++){let T=e[u++]^Fa(a,s,t,r,i,n),B=e[u++]^Fa(a,s,r,i,n,t),C=e[u++]^Fa(a,s,i,n,t,r),q=e[u++]^Fa(a,s,n,t,r,i);t=T,r=B,i=C,n=q}let f=e[u++]^ao(o,t,r,i,n),d=e[u++]^ao(o,r,i,n,t),m=e[u++]^ao(o,i,n,t,r),y=e[u++]^ao(o,n,t,r,i);return{s0:f,s1:d,s2:m,s3:y}}function eh(e,t,r,i,n){let{sbox2:o,T01:a,T23:s}=pN,u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];let c=e.length/4-2;for(let w=0;w<c;w++){let T=e[u++]^Fa(a,s,t,n,i,r),B=e[u++]^Fa(a,s,r,t,n,i),C=e[u++]^Fa(a,s,i,r,t,n),q=e[u++]^Fa(a,s,n,i,r,t);t=T,r=B,i=C,n=q}let f=e[u++]^ao(o,t,n,i,r),d=e[u++]^ao(o,r,t,n,i),m=e[u++]^ao(o,i,r,t,n),y=e[u++]^ao(o,n,i,r,t);return{s0:f,s1:d,s2:m,s3:y}}function gN(e,t,r,i){Ne(t,rt,"nonce"),Ne(r);let n=r.length;i=Ys(n,i),Vl(r,i);let o=t,a=Ke(o),s=Ke(r),u=Ke(i),{s0:c,s1:f,s2:d,s3:m}=hi(e,Ce(a[0]),Ce(a[1]),Ce(a[2]),Ce(a[3]));for(let w=0;w+4<=s.length;w+=4)u[w+0]=s[w+0]^Ce(c),u[w+1]=s[w+1]^Ce(f),u[w+2]=s[w+2]^Ce(d),u[w+3]=s[w+3]^Ce(m),Xl(o,!1,1),{s0:c,s1:f,s2:d,s3:m}=hi(e,Ce(a[0]),Ce(a[1]),Ce(a[2]),Ce(a[3]));let y=rt*Math.floor(s.length/S_);if(y<n){let w=new Uint32Array([c,f,d,m]);Xe(w);let T=zg(w);for(let B=y,C=0;B<n;B++,C++)i[B]=r[B]^T[C];st(w)}return i}function Rc(e,t,r,i,n){Ne(r,rt,"nonce"),Ne(i),n=Ys(i.length,n);let o=r,a=Ke(o),s=Tc(o),u=Ke(i),c=Ke(n),f=t?0:12,d=i.length,m=s.getUint32(f,t),{s0:y,s1:w,s2:T,s3:B}=hi(e,Ce(a[0]),Ce(a[1]),Ce(a[2]),Ce(a[3]));for(let q=0;q+4<=u.length;q+=4)c[q+0]=u[q+0]^Ce(y),c[q+1]=u[q+1]^Ce(w),c[q+2]=u[q+2]^Ce(T),c[q+3]=u[q+3]^Ce(B),m=m+1>>>0,s.setUint32(f,m,t),{s0:y,s1:w,s2:T,s3:B}=hi(e,Ce(a[0]),Ce(a[1]),Ce(a[2]),Ce(a[3]));let C=rt*Math.floor(u.length/S_);if(C<d){let q=new Uint32Array([y,w,T,B]);Xe(q);let F=zg(q);for(let P=C,k=0;P<d;P++,k++)n[P]=i[P]^F[k];st(q)}return n}function mN(e){if(Ne(e),e.length%rt!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+rt)}function vN(e,t,r){Ne(e);let i=e.length,n=i%rt;if(!t&&n!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");if(t){let s=rt-n;s||(s=rt),i=i+s}r=Ys(i,r),Vl(e,r),(!nn||!Hr(e))&&(e=Tt(e));let o=Ke(e);Xe(o);let a=Ke(r);return{b:o,o:a,out:r}}function yN(e,t){if(!t)return e;let r=e.length;if(r===0)throw new Error("aes/pkcs7: empty ciphertext not allowed");let i=e[r-1],n=1;n&=i-1>>>31^1,n&=16-i>>>31^1;for(let o=0;o<16;o++){let a=o-i>>>31,s=(e[r-1-o]^i)===0?1:0;n&=s|a^1}if(!n)throw new Error("aes/pkcs7: wrong padding");return e.subarray(0,r-i)}function bN(e){let t=new Uint8Array(16),r=Ke(t);t.set(e);let i=rt-e.length;for(let n=rt-i;n<rt;n++)t[n]=i;return r}function _N(e,t,r,i,n){let o=n?n.length:0,a=e.create(r,i.length+o);n&&a.update(n);let s=uN(8*i.length,8*o,t);a.update(i),a.update(s);let u=a.digest();return st(s),u}function SN(e){return e instanceof Uint32Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint32Array"}function Jl(e,t){if(Ne(t,16,"block"),!SN(e))throw new Error("_encryptBlock accepts result of expandKeyLE");let r=Ke(t);Xe(r);let{s0:i,s1:n,s2:o,s3:a}=hi(e,r[0],r[1],r[2],r[3]);return r[0]=i,r[1]=n,r[2]=o,r[3]=a,Xe(r),t}function wN(e,t){if(Ne(t,16,"block"),!SN(e))throw new Error("_decryptBlock accepts result of expandKeyLE");let r=Ke(t);Xe(r);let{s0:i,s1:n,s2:o,s3:a}=eh(e,r[0],r[1],r[2],r[3]);return r[0]=i,r[1]=n,r[2]=o,r[3]=a,Xe(r),t}function Ql(e){let t=0;for(let r=rt-1;r>=0;r--){let i=(e[r]&128)>>>7;e[r]=e[r]<<1|t,t=i}return t&&(e[rt-1]^=135),e}function $s(e,t){if(e.length!==t.length)throw new Error("xorBlock: blocks must have same length");for(let r=0;r<e.length;r++)e[r]=e[r]^t[r];return e}function xN(e,t){if(t.length>e.length)throw new Error("xorend: len(B) must be less than or equal to len(A)");let r=e.length-t.length;for(let i=0;i<t.length;i++)e[r+i]=e[r+i]^t[i];return e}function __(e,t){Gg(e);let r=t.length;if(r>127)throw new Error("s2v: number of input strings must be less than or equal to 127");if(r===0)return $l(MG,e);let i=$l(Yl,e);for(let s=0;s<r-1;s++){Ql(i);let u=$l(t[s],e);$s(i,u),st(u)}let n=t[r-1];Ne(n);let o;if(n.byteLength>=rt)o=xN(Uint8Array.from(n),i);else{let s=new Uint8Array(rt);s.set(n),s[n.length]=128,o=$s(Ql(i),s),st(s)}let a=$l(o,e);return st(i,o),a}var rt,S_,Yl,MG,DG,Xl,v_,qG,FG,m_,E_,pN,UG,Bc,HG,jG,zG,KG,kc,VG,Vg,lN,GG,hN,WG,y_,EN,ZG,YG,b_,$l,$G,XG,JG,QG,I_=Br(()=>{p();fN();h_();rt=16,S_=4,Yl=new Uint8Array(rt),MG=Uint8Array.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]),DG=283;Xl=(e,t,r=1)=>{if(!Number.isSafeInteger(r)||r>4294967040)throw new Error("incBytes: wrong carry "+r);Ne(e);for(let i=0;i<e.length;i++){let n=t?i:e.length-1-i;r=r+(e[n]&255)|0,e[n]=r&255,r>>>=8}},v_=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=w_(i))e[r]=i;let t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=(i^i>>4^i>>5^i>>6^i>>7^99)&255}return st(e),t})(),qG=v_.map((e,t)=>v_.indexOf(t)),FG=e=>e<<24|e>>>8,m_=e=>e<<8|e>>>24;E_=dN(v_,e=>Pc(e,3)<<24|e<<16|e<<8|Pc(e,2)),pN=dN(qG,e=>Pc(e,11)<<24|Pc(e,13)<<16|Pc(e,9)<<8|Pc(e,14)),UG=(()=>{let e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=w_(r))e[t]=r;return e})();Bc=no({blockSize:16,nonceLength:16},function(t,r){function i(n,o){if(Ne(n),o!==void 0&&(Ne(o),!Hr(o)))throw new Error("unaligned destination");let a=Pn(t),s=Tt(r),u=[a,s];Hr(n)||u.push(n=Tt(n));let c=gN(a,s,n,o);return st(...u),c}return{encrypt:(n,o)=>i(n,o),decrypt:(n,o)=>i(n,o)}});HG=no({blockSize:16},function(t,r={}){let i=!r.disablePadding;return{encrypt(n,o){let{b:a,o:s,out:u}=vN(n,i,o),c=Pn(t),f=0;for(;f+4<=a.length;){let{s0:d,s1:m,s2:y,s3:w}=hi(c,a[f+0],a[f+1],a[f+2],a[f+3]);s[f++]=d,s[f++]=m,s[f++]=y,s[f++]=w}if(i){let d=bN(n.subarray(f*4));Xe(d);let{s0:m,s1:y,s2:w,s3:T}=hi(c,d[0],d[1],d[2],d[3]);s[f++]=m,s[f++]=y,s[f++]=w,s[f++]=T}return Xe(s),st(c),u},decrypt(n,o){mN(n);let a=Wg(t);o=Ys(n.length,o);let s=[a];Vl(n,o),(!nn||!Hr(n))&&s.push(n=Tt(n));let u=Ke(n),c=Ke(o);Xe(u);for(let f=0;f+4<=u.length;){let{s0:d,s1:m,s2:y,s3:w}=eh(a,u[f+0],u[f+1],u[f+2],u[f+3]);c[f++]=d,c[f++]=m,c[f++]=y,c[f++]=w}return Xe(c),st(...s),yN(o,i)}}}),jG=no({blockSize:16,nonceLength:16},function(t,r,i={}){let n=!i.disablePadding;return{encrypt(o,a){let s=Pn(t),{b:u,o:c,out:f}=vN(o,n,a),d=r,m=[s];(!nn||!Hr(d))&&m.push(d=Tt(d));let y=Ke(d);Xe(y);let w=y[0],T=y[1],B=y[2],C=y[3],q=0;for(;q+4<=u.length;)w^=u[q+0],T^=u[q+1],B^=u[q+2],C^=u[q+3],{s0:w,s1:T,s2:B,s3:C}=hi(s,w,T,B,C),c[q++]=w,c[q++]=T,c[q++]=B,c[q++]=C;if(n){let F=bN(o.subarray(q*4));Xe(F),w^=F[0],T^=F[1],B^=F[2],C^=F[3],{s0:w,s1:T,s2:B,s3:C}=hi(s,w,T,B,C),c[q++]=w,c[q++]=T,c[q++]=B,c[q++]=C}return Xe(c),st(...m),f},decrypt(o,a){mN(o);let s=Wg(t),u=r,c=[s];(!nn||!Hr(u))&&c.push(u=Tt(u));let f=Ke(u);Xe(f),a=Ys(o.length,a),Vl(o,a),(!nn||!Hr(o))&&c.push(o=Tt(o));let d=Ke(o),m=Ke(a);Xe(d);let y=f[0],w=f[1],T=f[2],B=f[3];for(let C=0;C+4<=d.length;){let q=y,F=w,P=T,k=B;y=d[C+0],w=d[C+1],T=d[C+2],B=d[C+3];let{s0:M,s1:K,s2:z,s3:V}=eh(s,y,w,T,B);m[C++]=M^q,m[C++]=K^F,m[C++]=z^P,m[C++]=V^k}return Xe(m),st(...c),yN(a,n)}}}),zG=no({blockSize:16,nonceLength:16},function(t,r){function i(n,o,a){Ne(n);let s=n.length;if(a=Ys(s,a),f_(n,a))throw new Error("overlapping src and dst not supported.");let u=Pn(t),c=r,f=[u];(!nn||!Hr(c))&&f.push(c=Tt(c)),(!nn||!Hr(n))&&f.push(n=Tt(n));let d=Ke(n),m=Ke(a),y=o?m:d,w=Ke(c);Xe(d),Xe(w);let T=w[0],B=w[1],C=w[2],q=w[3];for(let P=0;P+4<=d.length;){let{s0:k,s1:M,s2:K,s3:z}=hi(u,T,B,C,q);m[P+0]=d[P+0]^k,m[P+1]=d[P+1]^M,m[P+2]=d[P+2]^K,m[P+3]=d[P+3]^z,T=y[P++],B=y[P++],C=y[P++],q=y[P++]}let F=rt*Math.floor(d.length/S_);if(F<s){({s0:T,s1:B,s2:C,s3:q}=hi(u,T,B,C,q));let P=new Uint32Array([T,B,C,q]);Xe(P);let k=zg(P);for(let M=F,K=0;M<s;M++,K++)a[M]=n[M]^k[K];st(k)}return Xe(m),st(...f),a}return{encrypt:(n,o)=>i(n,!0,o),decrypt:(n,o)=>i(n,!1,o)}});KG=no({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,r,i){if(r.length<8)throw new Error("aes/gcm: invalid nonce length");let n=16;function o(s,u,c){let f=_N(g_,!1,s,c,i);for(let d=0;d<u.length;d++)f[d]^=u[d];return f}function a(){let s=Pn(t),u=Yl.slice(),c=Yl.slice();if(Rc(s,!1,c,c,u),r.length===12)c.set(r);else{let d=Yl.slice();Tc(d).setBigUint64(8,BigInt(r.length*8),!1);let y=g_.create(u).update(r).update(d);y.digestInto(c),y.destroy()}let f=Rc(s,!1,c,Yl);return{xk:s,authKey:u,counter:c,tagMask:f}}return{encrypt(s){let{xk:u,authKey:c,counter:f,tagMask:d}=a(),m=new Uint8Array(s.length+n),y=[u,c,f,d];Hr(s)||y.push(s=Tt(s)),Rc(u,!1,f,s,m.subarray(0,s.length));let w=o(c,d,m.subarray(0,m.length-n));return y.push(w),m.set(w,s.length),st(...y),m},decrypt(s){let{xk:u,authKey:c,counter:f,tagMask:d}=a(),m=[u,c,d,f];Hr(s)||m.push(s=Tt(s));let y=s.subarray(0,-n),w=s.subarray(-n),T=o(c,d,y);if(m.push(T),!Gl(T,w))throw st(...m),new Error("aes/gcm: invalid ghash tag");let B=Rc(u,!1,f,y);return st(...m),B}}}),kc=(e,t,r)=>i=>{if(!Number.isSafeInteger(i)||t>i||i>r){let n="["+t+".."+r+"]";throw new Error(""+e+": expected value in range "+n+", got "+i)}},VG=no({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(t,r,i){let o=kc("AAD",0,68719476736),a=kc("plaintext",0,2**36),s=kc("nonce",12,12),u=kc("ciphertext",16,2**36+16);Ne(t),Gg(t),s(r.length),i!==void 0&&o(i.length);function c(){let m=Pn(t),y=new Uint8Array(t.length),w=new Uint8Array(16),T=[m,y],B=r;(!nn||!Hr(B))&&T.push(B=Tt(B));let C=Ke(B);Xe(C);let q=0,F=C[0],P=C[1],k=C[2],M=0;for(let z of[w,y].map(Ke)){let V=Ke(z);for(let x=0;x<V.length;x+=2){let{s0:h,s1:v}=hi(m,q,F,P,k);V[x+0]=h,V[x+1]=v,q=++M}Xe(V)}let K={authKey:w,encKey:Pn(y)};return st(...T),K}function f(m,y,w){let T=_N(cN,!0,y,w,i);for(let k=0;k<12;k++)T[k]^=r[k];T[15]&=127;let B=Ke(T);Xe(B);let C=B[0],q=B[1],F=B[2],P=B[3];return{s0:C,s1:q,s2:F,s3:P}=hi(m,C,q,F,P),B[0]=C,B[1]=q,B[2]=F,B[3]=P,Xe(B),T}function d(m,y,w){let T=Tt(y);T[15]|=128;let B=Rc(m,!0,T,w);return st(T),B}return{encrypt(m){a(m.length);let{encKey:y,authKey:w}=c(),T=f(y,w,m),B=[y,w,T];Hr(m)||B.push(m=Tt(m));let C=new Uint8Array(m.length+16);return C.set(T,m.length),C.set(d(y,T,m)),st(...B),C},decrypt(m){u(m.length);let y=m.subarray(-16),{encKey:w,authKey:T}=c(),B=[w,T];Hr(m)||B.push(m=Tt(m));let C=d(w,y,m.subarray(0,-16)),q=f(w,T,C);if(B.push(q),!Gl(y,q))throw st(...B),new Error("invalid polyval tag");return st(...B),C}}});Vg={encrypt(e,t){if(t.length>=2**32)throw new Error("plaintext should be less than 4gb");let r=Pn(e);if(t.length===16)Jl(r,t);else{let i=Ke(t);Xe(i);let n=i[0],o=i[1];for(let a=0,s=1;a<6;a++)for(let u=2;u<i.length;u+=2,s++){let{s0:c,s1:f,s2:d,s3:m}=hi(r,n,o,i[u],i[u+1]);n=c,o=f^Zs(s),i[u]=d,i[u+1]=m}i[0]=n,i[1]=o,Xe(i)}r.fill(0)},decrypt(e,t){if(t.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");let r=Wg(e),i=t.length/8-1;if(i===1)wN(r,t);else{let n=Ke(t);Xe(n);let o=n[0],a=n[1];for(let s=0,u=i*6;s<6;s++)for(let c=i*2;c>=1;c-=2,u--){a^=Zs(u);let{s0:f,s1:d,s2:m,s3:y}=eh(r,o,a,n[c],n[c+1]);o=f,a=d,n[c]=m,n[c+1]=y}n[0]=o,n[1]=a,Xe(n)}r.fill(0)}},lN=new Uint8Array(8).fill(166),GG=no({blockSize:8},e=>({encrypt(t){if(!t.length||t.length%8!==0)throw new Error("invalid plaintext length");if(t.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");let r=l_(lN,t);return Vg.encrypt(e,r),r},decrypt(t){if(t.length%8!==0||t.length<24)throw new Error("invalid ciphertext length");let r=Tt(t);if(Vg.decrypt(e,r),!Gl(r.subarray(0,8),lN))throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8)}})),hN=2790873510,WG=no({blockSize:8},e=>({encrypt(t){if(!t.length)throw new Error("invalid plaintext length");let r=Math.ceil(t.length/8)*8,i=new Uint8Array(8+r);i.set(t,8);let n=Ke(i);return n[0]=Ce(hN),n[1]=Ce(Zs(t.length)),Vg.encrypt(e,i),i},decrypt(t){if(t.length<16)throw new Error("invalid ciphertext length");let r=Tt(t),i=Ke(r);Vg.decrypt(e,r);let n=Zs(Ce(i[1]))>>>0,o=Math.ceil(n/8)*8;if(Ce(i[0])!==hN||r.length-8!==o)throw new Error("integrity check failed");for(let a=n;a<o;a++)if(r[8+a]!==0)throw new Error("integrity check failed");return r.subarray(0,8).fill(0),r.subarray(8,8+n)}})),y_=class{constructor(t,r,i){H(this,"blockLen");H(this,"key");H(this,"nonce");H(this,"state");H(this,"reseedCnt");this.blockLen=Bc.blockSize;let n=t/8,o=16;this.state=new Uint8Array(n+o),this.key=this.state.subarray(0,n),this.nonce=this.state.subarray(n,n+o),this.reseedCnt=1,Xl(this.nonce,!1,1),this.addEntropy(r,i)}update(t){if(Bc(this.key,this.nonce).encrypt(new Uint8Array(this.state.length),this.state),t){Ne(t);for(let r=0;r<t.length;r++)this.state[r]^=t[r]}Xl(this.nonce,!1,1)}addEntropy(t,r){Ne(t,this.state.length,"seed");let i=t.slice();if(r){if(Ne(r),r.length>i.length)throw new Error("info length is too big");for(let n=0;n<r.length;n++)i[n]^=r[n]}this.update(i),i.fill(0),this.reseedCnt=1}randomBytes(t,r){if(jg(t),t>2**16)throw new Error("requested output is too big");if(this.reseedCnt>2**48)throw new Error("entropy exhausted");if(r){if(Ne(r),r.length>this.state.length)throw new Error("info length is too big");this.update(r)}let i=new Uint8Array(t);return Bc(this.key,this.nonce).encrypt(i,i),Xl(this.nonce,!1,Math.ceil(t/this.blockLen)),this.update(r),this.reseedCnt++,i}clean(){this.state.fill(0),this.reseedCnt=0}},EN=e=>(t,r=void 0)=>new y_(e,t,r),ZG=EN(128),YG=EN(256);b_=class{constructor(t){H(this,"blockLen",rt);H(this,"outputLen",rt);H(this,"buffer");H(this,"pos");H(this,"finished");H(this,"destroyed");H(this,"k1");H(this,"k2");H(this,"x");H(this,"xk");Ne(t),Gg(t),this.xk=Pn(t),this.buffer=new Uint8Array(rt),this.pos=0,this.finished=!1,this.destroyed=!1,this.x=new Uint8Array(rt);let r=new Uint8Array(rt);Jl(this.xk,r),this.k1=Ql(r),this.k2=Ql(new Uint8Array(this.k1))}process(t){$s(this.x,t),Jl(this.xk,this.x)}update(t){if(this.destroyed)throw new Error("Hash instance has been destroyed");if(this.finished)throw new Error("Hash#digest() has already been called");Ne(t);let r=0;if(this.pos){let i=Math.min(rt-this.pos,t.length);this.buffer.set(t.subarray(0,i),this.pos),this.pos+=i,r=i,this.pos===rt&&r<t.length&&(this.process(this.buffer),this.pos=0)}for(;r+rt<t.length;)this.process(t.subarray(r,r+rt)),r+=rt;return r<t.length&&(this.buffer.set(t.subarray(r),0),this.pos=t.length-r),this}digestInto(t){if(this.destroyed)throw new Error("Hash instance has been destroyed");if(this.finished)throw new Error("Hash#digest() has already been called");Kl(t,this,!0),this.finished=!0;let r=t.subarray(0,this.outputLen),i=new Uint8Array(rt);this.pos===rt?(i.set(this.buffer),$s(i,this.k1)):(i.set(this.buffer.subarray(0,this.pos)),i[this.pos]=128,$s(i,this.k2)),r.set(this.x),$s(r,i),Jl(this.xk,r),st(i)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}destroy(){let{buffer:t,destroyed:r,x:i,xk:n,k1:o,k2:a}=this;r||(this.destroyed=!0,st(t,i,n,o,a))}},$l=Wl(16,e=>new b_(e));$G=()=>{throw new Error('"siv" from v1 is now "gcmsiv"')},XG=no({blockSize:16,tagLength:16},function(t,...r){let i=kc("plaintext",0,5444517870735016e24),n=kc("ciphertext",16,2**132+16);if(r.length>126)throw new Error('"AAD" number of elements must be less than or equal to 126');if(r.forEach(s=>Ne(s)),Ne(t),![32,48,64].includes(t.length))throw new Error('"aes key" expected Uint8Array of length 32/48/64, got length='+t.length);let o=t.subarray(0,t.length/2),a=t.subarray(t.length/2);return{encrypt(s){i(s.length);let u=__(o,[...r,s]),c=Uint8Array.from(u);c[8]&=127,c[12]&=127;let f=Bc(a,c).encrypt(s);return l_(u,f)},decrypt(s){n(s.length);let u=s.subarray(0,rt),c=s.subarray(rt),f=Uint8Array.from(u);f[8]&=127,f[12]&=127;let d=Bc(a,f).decrypt(c),m=__(o,[...r,d]);if(Gl(m,u))return d;throw new Error("invalid siv tag")}}}),JG=Object.freeze({expandKeyLE:Pn,expandKeyDecLE:Wg,encrypt:hi,decrypt:eh,encryptBlock:Jl,decryptBlock:wN,ctrCounter:gN,ctr32:Rc,dbl:Ql,xorBlock:$s,xorend:xN,s2v:__}),QG=Object.freeze({incBytes:Xl})});var TN=R((fae,AN)=>{"use strict";p();var{secp256k1:IN}=(al(),Hi(ol)),{sha512:e9,sha256:t9}=(Qf(),Hi(Ap)),{hmac:r9}=(qp(),Hi(Dy)),{cbc:ON}=(I_(),Hi(x_)),i9=Kt(),Ua=Oe(),n9=Ri();function th(e){return l.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function O_(e,t){return th(r9(t9,e,t))}function o9(e,t){if(e.length!==t.length)return!1;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return r===0}var Zg=function(){};Zg.encrypt=function(e,t,r){Ua.checkArgument(e),Ua.checkArgument(t),Ua.checkArgument(r),r=r||n9.getRandomBuffer(128/8);var i=ON(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e));return l.Buffer.concat([l.Buffer.from(r),th(i)])};Zg.decrypt=function(e,t){Ua.checkArgument(e),Ua.checkArgument(t);var r=e.slice(0,128/8),i=e.slice(128/8),n=ON(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(i));return th(n)};var Nc=function e(t){if(!(this instanceof e))return new e(t);this.opts=t||{}};Nc.prototype.privateKey=function(e){return Ua.checkArgument(e,"no private key provided"),this._privateKey=e||null,this};Nc.prototype.publicKey=function(e){return Ua.checkArgument(e,"no public key provided"),this._publicKey=e||null,this};var Yg=function(e,t){var r="_"+e;Object.defineProperty(Nc.prototype,e,{configurable:!1,enumerable:!0,get:function(){var i=this[r];return i||(i=this[r]=t.apply(this)),i}})};Yg("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return th(IN.getPublicKey(Uint8Array.from(e),!0))});Yg("kEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=IN.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0),i=r.slice(1);return th(e9(i))});Yg("kE",function(){return this.kEkM.slice(0,32)});Yg("kM",function(){return this.kEkM.slice(32,64)});Nc.prototype.encrypt=function(e,t){l.Buffer.isBuffer(e)||(e=l.Buffer.from(e)),t===void 0&&(t=O_(this._privateKey.toBuffer(),e).slice(0,16));var r=Zg.encrypt(e,this.kE,t),i=O_(this.kM,r);return this.opts.shortTag&&(i=i.slice(0,4)),this.opts.noKey?l.Buffer.concat([r,i]):l.Buffer.concat([this.Rbuf,r,i])};Nc.prototype.decrypt=function(e){Ua.checkArgument(e);var t=0,r=this.opts.shortTag?4:32;if(!this.opts.noKey){var i;switch(e[0]){case 4:i=e.slice(0,65);break;case 3:case 2:i=e.slice(0,33);break;default:throw new Error("Invalid type: "+e[0])}this._publicKey=i9.fromDER(i),t+=i.length}var n=e.slice(t,e.length-r),o=e.slice(e.length-r,e.length),a=O_(this.kM,n);if(this.opts.shortTag&&(a=a.slice(0,4)),!o9(o,a))throw new Error("Invalid checksum");return Zg.decrypt(n,this.kE)};AN.exports=Nc});var RN=R((hae,PN)=>{"use strict";p();var a9={name:"ECIES",message:"Internal Error on bsv-ecies Module {0}",errors:[{name:"DecryptionError",message:"Invalid Message: {0}"},{name:"UnsupportAlgorithm",message:"Unsupport Algorithm: {0}"}]};PN.exports=ti().extend(a9)});var LN=R((pae,CN)=>{"use strict";p();var A_=Kt(),T_=Ur(),Ci=Oe(),s9=TN(),$g=RN(),{secp256k1:kN}=(al(),Hi(ol)),{sha512:u9,sha256:c9}=(Qf(),Hi(Ap)),{hmac:f9}=(qp(),Hi(Dy)),{cbc:BN}=(I_(),Hi(x_));function rh(e){return l.Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function NN(e,t){return rh(f9(c9,t,e))}var Xg=function(){};Xg.encrypt=function(e,t,r){return Ci.checkArgument(e),Ci.checkArgument(t),Ci.checkArgument(r),Ci.checkArgument(t.length===16,"keybuf length must be 16"),Ci.checkArgument(r.length===16,"ivbuf length must be 16"),rh(BN(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e)))};Xg.decrypt=function(e,t,r){return Ci.checkArgument(e),Ci.checkArgument(t),Ci.checkArgument(r),Ci.checkArgument(t.length===16,"keybuf length must be 16"),Ci.checkArgument(r.length===16,"ivbuf length must be 16"),rh(BN(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(e)))};var Xs=function e(t,r="BIE1"){if(r!=="BIE1")throw new $g.UnsupportAlgorithm(r);if(!(this instanceof e))return new e(t,r);this._privateKey=new T_,this.opts=t||{},this.opts.ephemeralKey=!0};Xs.prototype.privateKey=function(e){return Ci.checkArgument(T_.isValid(e),"no private key provided"),this._privateKey=T_(e.toHex())||null,this.opts.ephemeralKey=!1,this};Xs.prototype.publicKey=function(e){return Ci.checkArgument(A_.isValid(e),"no public key provided"),this._publicKey=A_(e.toString())||null,this._publicKey!=null&&(this.opts.fixedPublicKey=!0),this};var ih=function(e,t){var r="_"+e;Object.defineProperty(Xs.prototype,e,{configurable:!1,enumerable:!0,get:function(){var i=this[r];return i=this[r]=t.apply(this),i}})};ih("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return rh(kN.getPublicKey(Uint8Array.from(e),!0))});ih("ivkEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=kN.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0);return rh(u9(r))});ih("iv",function(){return this.ivkEkM.slice(0,16)});ih("kE",function(){return this.ivkEkM.slice(16,32)});ih("kM",function(){return this.ivkEkM.slice(32,64)});Xs.prototype.encrypt=function(e){l.Buffer.isBuffer(e)||(e=l.Buffer.from(e));var t=Xg.encrypt(e,this.kE,this.iv),r,i=l.Buffer.from("BIE1");this.opts.noKey&&!this.opts.ephemeralKey?r=l.Buffer.concat([i,t]):r=l.Buffer.concat([i,this.Rbuf,t]);var n=NN(r,this.kM);return this.opts.shortTag&&(n=n.slice(0,4)),l.Buffer.concat([r,n])};Xs.prototype.decrypt=function(e){Ci.checkArgument(l.Buffer.isBuffer(e),"ciphetext must be a buffer");var t=this.opts.shortTag?4:32,r=4,i=e.slice(0,4);if(!i.equals(l.Buffer.from("BIE1")))throw new $g.DecryptionError("Invalid Magic");if(!this.opts.noKey){var n=e.slice(4,37);this.opts.fixedPublicKey?console.log('Notice: Overriding PublicKey in message. Consider use "noKey" option if you are not sending message to electrum and do not want to use ephemeral key'):this._publicKey=A_.fromDER(n),r=37}var o=e.slice(r,e.length-t),a=e.slice(e.length-t,e.length),s=NN(e.slice(0,e.length-t),this.kM);if(this.opts.shortTag&&(s=s.slice(0,4)),a.length!==s.length)throw new $g.DecryptionError("Invalid checksum");for(var u=0,c=0;c<s.length;c++)u|=a[c]^s[c];if(u!==0)throw new $g.DecryptionError("Invalid checksum");return Xg.decrypt(o,this.kE,this.iv)};Xs.bitcoreECIES=s9;CN.exports=Xs});var DN=R((mae,MN)=>{p();MN.exports=LN()});var Jg=R((yae,FN)=>{"use strict";p();function so(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function qN(e,t){for(var r="",i=0,n=-1,o=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(n===s-1||o===1))if(n!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",i=0):(r=r.slice(0,u),i=r.length-1-r.lastIndexOf("/")),n=s,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=s,o=0;continue}}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(n+1,s):r=e.slice(n+1,s),i=s-n-1;n=s,o=0}else a===46&&o!==-1?++o:o=-1}return r}function l9(e,t){var r=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+i:r+e+i:i}var Cc={resolve:function(){for(var t="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=_.default.cwd()),o=i),so(o),o.length!==0&&(t=o+"/"+t,r=o.charCodeAt(0)===47)}return t=qN(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(so(t),t.length===0)return".";var r=t.charCodeAt(0)===47,i=t.charCodeAt(t.length-1)===47;return t=qN(t,!r),t.length===0&&!r&&(t="."),t.length>0&&i&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return so(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];so(i),i.length>0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":Cc.normalize(t)},relative:function(t,r){if(so(t),so(r),t===r||(t=Cc.resolve(t),r=Cc.resolve(r),t===r))return"";for(var i=1;i<t.length&&t.charCodeAt(i)===47;++i);for(var n=t.length,o=n-i,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var s=r.length,u=s-a,c=o<u?o:u,f=-1,d=0;d<=c;++d){if(d===c){if(u>c){if(r.charCodeAt(a+d)===47)return r.slice(a+d+1);if(d===0)return r.slice(a+d)}else o>c&&(t.charCodeAt(i+d)===47?f=d:d===0&&(f=0));break}var m=t.charCodeAt(i+d),y=r.charCodeAt(a+d);if(m!==y)break;m===47&&(f=d)}var w="";for(d=i+f+1;d<=n;++d)(d===n||t.charCodeAt(d)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+r.slice(a+f):(a+=f,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(so(t),t.length===0)return".";for(var r=t.charCodeAt(0),i=r===47,n=-1,o=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!o){n=a;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":t.slice(0,n)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');so(t);var i=0,n=-1,o=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,u=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!o){i=a+1;break}}else u===-1&&(o=!1,u=a+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(n=a):(s=-1,n=u))}return i===n?n=u:n===-1&&(n=t.length),t.slice(i,n)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!o){i=a+1;break}}else n===-1&&(o=!1,n=a+1);return n===-1?"":t.slice(i,n)}},extname:function(t){so(t);for(var r=-1,i=0,n=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(u===47){if(!o){i=s+1;break}continue}n===-1&&(o=!1,n=s+1),u===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||n===-1||a===0||a===1&&r===n-1&&r===i+1?"":t.slice(r,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return l9("/",t)},parse:function(t){so(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var i=t.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var a=-1,s=0,u=-1,c=!0,f=t.length-1,d=0;f>=o;--f){if(i=t.charCodeAt(f),i===47){if(!c){s=f+1;break}continue}u===-1&&(c=!1,u=f+1),i===46?a===-1?a=f:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||u===-1||d===0||d===1&&a===u-1&&a===s+1?u!==-1&&(s===0&&n?r.base=r.name=t.slice(1,u):r.base=r.name=t.slice(s,u)):(s===0&&n?(r.name=t.slice(1,a),r.base=t.slice(1,u)):(r.name=t.slice(s,a),r.base=t.slice(s,u)),r.ext=t.slice(a,u)),s>0?r.dir=t.slice(0,s-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Cc.posix=Cc;FN.exports=Cc});var nh=R((_ae,UN)=>{"use strict";p();UN.exports={}});var GN=R((wae,VN)=>{"use strict";p();var zN=ai(),h9=Xn(),Lc=tn(),HN=at(),d9=ke(),P_=Ge(),KN=At(),Ha=Ze(),jN=Jg(),ea;try{ea=nh()}catch{ea=null}var p9=function(){var e=typeof _.default<"u"&&_.default.env&&_.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)};function Ei(e,t){if(!(this instanceof Ei))return new Ei(e,t);this.privateKey=e,this.publicKey=e.publicKey,this.address=e.toAddress(),t=t||{},this.storageDir=t.storageDir||(typeof _.default<"u"?jN.join(_.default.cwd(),".bsv-covenants"):".bsv-covenants"),this.covenantUtxoPath=jN.join(this.storageDir,"covenant_utxos.json"),this.sighashType=HN.SIGHASH_ALL|HN.SIGHASH_FORKID,this.allowNonEnforcing=t.allowNonEnforcing===!0,ea&&this._ensureStorageDir()}Ei.prototype.createFromP2PKH=function(e){if(!this.allowNonEnforcing)throw new Error("SmartContract.Covenant builds a NON-ENFORCING script that reduces to plain P2PK \u2014 it does not constrain the spend. Use SmartContract.PushTx.valueCovenant (output binding) or SmartContract.Token / perpetualCovenant (stateful covenants) for real covenants. To use this demo anyway, construct with { allowNonEnforcing: true }.");e.script||(e.script=Ei.reconstructP2pkhScript(this.address));var t=new KN().from({txId:e.txid,outputIndex:e.vout,script:e.script,satoshis:e.satoshis}).to(this.address,e.satoshis-1e3),r=Ha.fromHex(e.script),i=zN.sighashPreimage(t,this.sighashType,0,r,new P_(e.satoshis)),n=d9.sha256sha256(i),o=new Ha().add("OP_DUP").add("OP_HASH256").add(n).add("OP_EQUALVERIFY").add("OP_DROP").add(this.publicKey.toBuffer()).add("OP_CHECKSIG");t.outputs[0].setScript(o),t.sign(this.privateKey);var a={txid:t.id,vout:0,satoshis:e.satoshis-1e3,script:o.toHex(),scriptPubKey:o.toHex(),preimageHash:n.toString("hex"),originalPreimage:i.toString("hex"),status:"local",createdAt:new Date().toISOString(),type:"preimage_covenant"};return{transaction:t,covenantUtxo:a}};Ei.prototype.createSpendingTx=function(e,t,r){var i=t||this.address,n=r||e.satoshis-500,o=new KN;o.addInput(new h9({prevTxId:e.txid,outputIndex:e.vout,script:Ha.empty()}),Ha.fromHex(e.script),e.satoshis),o.to(i,n);var a=Ha.fromHex(e.script),s=zN.sign(o,this.privateKey,this.sighashType,0,a,new P_(e.satoshis)),u=l.Buffer.concat([s.toDER(),l.Buffer.from([this.sighashType])]),c=l.Buffer.from(e.originalPreimage,"hex"),f=new Ha().add(u).add(c);return o.inputs[0].setScript(f),o};Ei.prototype.validate=function(e,t){var r=new Lc,i=Lc.SCRIPT_VERIFY_P2SH|Lc.SCRIPT_VERIFY_STRICTENC|Lc.SCRIPT_VERIFY_DERSIG|Lc.SCRIPT_VERIFY_LOW_S|Lc.SCRIPT_ENABLE_SIGHASH_FORKID,n=e.inputs[0].script,o=Ha.fromHex(t.script),a=r.verify(n,o,e,0,i,new P_(t.satoshis));return{valid:a,error:a?null:r.errstr}};Ei.prototype.save=function(e){if(!ea)return p9("File system operations not available in browser environment"),e;var t=this.list();return t.push(e),ea.writeFileSync(this.covenantUtxoPath,JSON.stringify(t,null,2)),e};Ei.prototype.load=function(e){var t=this.list();if(e){var r=t.find(function(i){return i.txid===e});if(!r)throw new Error("Covenant UTXO with TXID "+e+" not found");return r}else{var r=t.find(function(n){return n.type==="preimage_covenant"});if(!r)throw new Error("No preimage covenant UTXO found");return r}};Ei.prototype.list=function(){return ea.existsSync(this.covenantUtxoPath)?JSON.parse(ea.readFileSync(this.covenantUtxoPath,"utf8")):[]};Ei.prototype.getPortfolio=function(){var e=this.list(),t={total:e.length,totalValue:e.reduce(function(r,i){return r+i.satoshis},0),byStatus:{},recent:e.slice(-5)};return e.forEach(function(r){var i=r.status||"local";t.byStatus[i]||(t.byStatus[i]={count:0,value:0}),t.byStatus[i].count++,t.byStatus[i].value+=r.satoshis}),t};Ei.prototype.completeFlow=function(e,t){var r=this.createFromP2PKH(e),i=this.save(r.covenantUtxo);t&&t(r.transaction,"creation");var n=this.createSpendingTx(i),o=this.validate(n,i);return t&&o.valid&&t(n,"spending"),{creationTx:r.transaction,spendingTx:n,covenantUtxo:i,validation:o,success:o.valid}};Ei.prototype._ensureStorageDir=function(){ea.existsSync(this.storageDir)||ea.mkdirSync(this.storageDir,{recursive:!0})};Ei.reconstructP2pkhScript=function(e){return Ha.buildPublicKeyHashOut(e).toHex()};VN.exports=Ei});var uo=R((Iae,ZN)=>{"use strict";p();var g9=ai(),m9=Ge(),v9=At(),y9=Ur(),WN=Ze(),xae=Dt();function Ee(e,t){if(!(this instanceof Ee))return new Ee(e,t);this.preimage=l.Buffer.isBuffer(e)?e:l.Buffer.from(e,"hex"),this.options=t||{},this.strategy=this.options.strategy||"DYNAMIC",this.fields=null,this.sighashInfo=null,this.options.deferExtraction||this._extractFields()}Ee.LEFT_FIXED_LENGTH=104;Ee.RIGHT_FIXED_LENGTH=52;Ee.MIN_PREIMAGE_LENGTH=Ee.LEFT_FIXED_LENGTH+1+Ee.RIGHT_FIXED_LENGTH;Ee.prototype.extract=function(e){return this.strategy=e||this.strategy,this._extractFields(),this.fields};Ee.prototype.getSighashInfo=function(){return this.fields||this._extractFields(),this.sighashInfo};Ee.prototype.getField=function(e){return this.fields||this._extractFields(),this.fields[e]};Ee.prototype.extractField=function(e,t){t=t||{},this.fields||this._extractFields();var r=this._parsePreimageStructure(),i=this._generateBidirectionalASM(e,r,t.includeComments),n=this._extractSpecificField(e,r),o=this._interpretField(e,n,r);return{field:e,value:n?n.toString("hex"):null,buffer:n,asm:i,interpretation:o,strategy:this._getExtractionStrategy(e),structure:r._structure}};Ee.prototype.generateASM=function(e,t){var r=this._parsePreimageStructure();return this._generateBidirectionalASM(e,r,t)};Ee.prototype.extractFields=function(e){var t={};return e.forEach(function(r){t[r]=this.extractField(r)}.bind(this)),t};Ee.prototype.validate=function(){var e=[],t=[];if(this.preimage.length<Ee.MIN_PREIMAGE_LENGTH)return e.push("Preimage too short: "+this.preimage.length+" bytes (BIP-143 preimage requires at least "+Ee.MIN_PREIMAGE_LENGTH+")"),{valid:!1,errors:e,warnings:t,sighashInfo:this.sighashInfo};this.fields||this._extractFields();var r=["version","hashPrevouts","hashSequence","outpoint","scriptCode","amount","sequence","hashOutputs","locktime","sighash"];return r.forEach(function(i){this.fields[i]||e.push("Missing required field: "+i)}.bind(this)),this.sighashInfo.hasZeroHashes&&t.push("Zero hashes detected - check SIGHASH flags: "+this.sighashInfo.zeroFields.join(", ")),{valid:e.length===0,errors:e,warnings:t,sighashInfo:this.sighashInfo}};Ee.prototype.toObject=function(){return this.fields||this._extractFields(),{preimage:this.preimage.toString("hex"),length:this.preimage.length,strategy:this.strategy,fields:{version:this.fields.version?this.fields.version.toString("hex"):null,hashPrevouts:this.fields.hashPrevouts?this.fields.hashPrevouts.toString("hex"):null,hashSequence:this.fields.hashSequence?this.fields.hashSequence.toString("hex"):null,outpoint:this.fields.outpoint?this.fields.outpoint.toString("hex"):null,scriptCode:this.fields.scriptCode?this.fields.scriptCode.toString("hex"):null,scriptCodeLength:this.fields.scriptCodeLength,amount:this.fields.amount?this.fields.amount.toString("hex"):null,sequence:this.fields.sequence?this.fields.sequence.toString("hex"):null,hashOutputs:this.fields.hashOutputs?this.fields.hashOutputs.toString("hex"):null,locktime:this.fields.locktime?this.fields.locktime.toString("hex"):null,sighash:this.fields.sighash?this.fields.sighash.toString("hex"):null},sighashInfo:this.sighashInfo,validation:this.validate()}};Ee.prototype._extractFields=function(){if(this.fields={},this.sighashInfo={flag:null,hasZeroHashes:!1,zeroFields:[],warnings:[]},this.preimage.length<Ee.MIN_PREIMAGE_LENGTH)throw new Error("Preimage too short: "+this.preimage.length+" bytes (BIP-143 preimage requires at least "+Ee.MIN_PREIMAGE_LENGTH+")");try{this.strategy==="LEFT"||this.strategy==="DYNAMIC"?this._extractFromLeft():this.strategy==="RIGHT"&&this._extractFromRight(),this._analyzeSighash()}catch(e){if(this.strategy==="DYNAMIC")try{this.strategy="RIGHT",this._extractFromRight(),this._analyzeSighash()}catch{throw new Error("Failed to extract preimage fields with any strategy: "+e.message)}else throw e}};Ee.prototype._extractFromLeft=function(){var e=0;this.fields.version=this.preimage.slice(e,e+4),e+=4,this.fields.hashPrevouts=this.preimage.slice(e,e+32),e+=32,this.fields.hashSequence=this.preimage.slice(e,e+32),e+=32,this.fields.outpoint=this.preimage.slice(e,e+36),e+=36;var t=Ee.decodeCompactSize(this.preimage,e);this.fields.scriptCodeLength=t.value,e=t.nextOffset,this.fields.scriptCode=this.preimage.slice(e,e+this.fields.scriptCodeLength),e+=this.fields.scriptCodeLength,this.fields.amount=this.preimage.slice(e,e+8),e+=8,this.fields.sequence=this.preimage.slice(e,e+4),e+=4,this.fields.hashOutputs=this.preimage.slice(e,e+32),e+=32,this.fields.locktime=this.preimage.slice(e,e+4),e+=4,this.fields.sighash=this.preimage.slice(e,e+4)};Ee.prototype._extractFromRight=function(){var e=this.preimage.length,t=e;t-=4,this.fields.sighash=this.preimage.slice(t,t+4),t-=4,this.fields.locktime=this.preimage.slice(t,t+4),t-=32,this.fields.hashOutputs=this.preimage.slice(t,t+32),t-=4,this.fields.sequence=this.preimage.slice(t,t+4),t-=8,this.fields.amount=this.preimage.slice(t,t+8);var r=104,i=Ee.decodeCompactSize(this.preimage,r);this.fields.scriptCodeLength=i.value,this.fields.scriptCode=this.preimage.slice(i.nextOffset,i.nextOffset+this.fields.scriptCodeLength),this.fields.version=this.preimage.slice(0,4),this.fields.hashPrevouts=this.preimage.slice(4,36),this.fields.hashSequence=this.preimage.slice(36,68),this.fields.outpoint=this.preimage.slice(68,104)};Ee.prototype._analyzeSighash=function(){if(this.fields.sighash){var e=this.fields.sighash.readUInt32LE(0);this.sighashInfo.flag=e;var t=e&31,r=(e&128)!==0,i=(e&64)!==0,n=l.Buffer.alloc(32);r&&this.fields.hashPrevouts.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashPrevouts"),this.sighashInfo.warnings.push("ANYONECANPAY flag detected - hashPrevouts is zero")),t===2&&this.fields.hashSequence.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashSequence"),this.sighashInfo.warnings.push("SIGHASH_NONE flag detected - hashSequence is zero")),(t===2||t===3)&&this.fields.hashOutputs.equals(n)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashOutputs"),this.sighashInfo.warnings.push("SIGHASH_NONE/SINGLE flag detected - hashOutputs is zero"));var o=[];t===1?o.push("ALL"):t===2?o.push("NONE"):t===3&&o.push("SINGLE"),r&&o.push("ANYONECANPAY"),i&&o.push("FORKID"),this.sighashInfo.flagName=o.join(" | ")}};Ee.prototype._parsePreimageStructure=function(){for(var e=this.preimage,t=0,r={},i=[{name:"nVersion",len:4},{name:"hashPrevouts",len:32},{name:"hashSequence",len:32},{name:"outpoint_txid",len:32},{name:"outpoint_vout",len:4}],n=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],o=0;o<i.length;o++){var a=i[o];r[a.name]=e.slice(t,t+a.len).toString("hex"),t+=a.len}var s=Ee.decodeCompactSize(e,t);r.scriptLen=s.value,r.scriptLenSize=s.bytes,r.scriptLenRaw=e.slice(t,t+s.bytes).toString("hex"),t+=s.bytes,r.scriptCode=e.slice(t,t+r.scriptLen).toString("hex"),t+=r.scriptLen;for(var u=0;u<n.length;u++){var c=n[u];r[c.name]=e.slice(t,t+c.len).toString("hex"),t+=c.len}var f=i.reduce(function(m,y){return m+y.len},0),d=n.reduce(function(m,y){return m+y.len},0);return r._structure={leftFixed:f,scriptLenVarint:s.bytes,scriptCode:r.scriptLen,rightFixed:d,totalCalculated:f+s.bytes+r.scriptLen+d,totalActual:e.length},r};Ee.prototype._generateBidirectionalASM=function(e,t,r){var i=["value","nSequence","hashOutputs","nLocktime","sighashType"],n=["nVersion","hashPrevouts","hashSequence","outpoint_txid","outpoint_vout"];if(i.includes(e))return this._generateRightExtractionASM(e,r);if(n.includes(e))return this._generateLeftExtractionASM(e,r);if(e==="scriptCode")return this._generateDynamicExtractionASM(t,r);if(e==="scriptLen")return this._generateScriptLenExtractionASM(t,r);throw new Error("Unknown field: "+e)};Ee.prototype._generateRightExtractionASM=function(e,t){for(var r=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],i=0,n=0,o=!1,a=0;a<r.length;a++){var s=r[a];if(s.name===e){n=s.len,o=!0;break}i+=s.len}if(!o)throw new Error("Field not found in RIGHT fields: "+e);var u=52,c=u-i,f=[];return t?(f.push("# \u{1F504} Extract "+e+" from RIGHT side (bidirectional strategy)"),f.push("OP_SIZE # Push preimage size: [preimage, size]")):f.push("OP_SIZE"),t?f=f.concat([c+" OP_SUB # Calculate split point: [preimage, split_point]","OP_SPLIT # Split: [left_part, right_part]","OP_NIP # Drop left (OP_SPLIT leaves right on top): [right_part]",n+" OP_SPLIT # Extract field: ["+e+", remaining]","OP_DROP # Clean up: ["+e+"]","# \u2705 Result: "+e+" is now on top of stack"]):f=f.concat([c+" OP_SUB","OP_SPLIT","OP_NIP",n+" OP_SPLIT","OP_DROP"]),f.join(`
|
|
71
71
|
`)};Ee.prototype._generateLeftExtractionASM=function(e,t){var r=[{name:"nVersion",len:4,offset:0},{name:"hashPrevouts",len:32,offset:4},{name:"hashSequence",len:32,offset:36},{name:"outpoint_txid",len:32,offset:68},{name:"outpoint_vout",len:4,offset:100}],i=r.find(function(o){return o.name===e});if(!i)throw new Error("Field not found in LEFT fields: "+e);var n=[];return t?n=["# \u{1F504} Extract "+e+" from LEFT side (bidirectional strategy)",i.offset+" OP_SPLIT # Skip to field: [prefix, remainder]","OP_NIP # Drop prefix (OP_SPLIT leaves remainder on top): [remainder]",i.len+" OP_SPLIT # Extract field: ["+e+", suffix]","OP_DROP # Clean up: ["+e+"]","# \u2705 Result: "+e+" is now on top of stack"]:n=[i.offset+" OP_SPLIT","OP_NIP",i.len+" OP_SPLIT","OP_DROP"],n.join(`
|
|
72
72
|
`)};Ee.prototype._generateDynamicExtractionASM=function(e,t){var r=104+e.scriptLenSize;return["# \u{1F3AF} Extract scriptCode DYNAMICALLY with CompactSize varint support",r+" OP_SPLIT # Skip left zone + scriptLen varint: [left_zone, remainder]","OP_NIP # Drop left (OP_SPLIT leaves remainder on top): [remainder]",e.scriptLen+" OP_SPLIT # Extract scriptCode: [scriptCode, right_zone]","OP_DROP # Clean up: [scriptCode]","# \u2705 Result: scriptCode extracted with "+e.scriptLenSize+"-byte varint awareness"].join(`
|