@paimaexample/explorer 0.3.130 → 0.4.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.
@@ -11,7 +11,7 @@ var L4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var q4=L4((export
11
11
  *
12
12
  * @author Feross Aboukhadijeh <https://feross.org>
13
13
  * @license MIT
14
- */var hasRequiredBuffer$1;function requireBuffer$1(){return hasRequiredBuffer$1||(hasRequiredBuffer$1=1,(function(e){var t=requireBase64Js(),r=requireIeee754(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;var o=2147483647;e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var ei=new Uint8Array(1),Gr={foo:function(){return 42}};return Object.setPrototypeOf(Gr,Uint8Array.prototype),Object.setPrototypeOf(ei,Gr),ei.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(ei){if(ei>o)throw new RangeError('The value "'+ei+'" is invalid for option "size"');var Gr=new Uint8Array(ei);return Object.setPrototypeOf(Gr,a.prototype),Gr}function a(ei,Gr,ti){if(typeof ei=="number"){if(typeof Gr=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(ei)}return s(ei,Gr,ti)}a.poolSize=8192;function s(ei,Gr,ti){if(typeof ei=="string")return p(ei,Gr);if(ArrayBuffer.isView(ei))return y(ei);if(ei==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ei);if(ci(ei,ArrayBuffer)||ei&&ci(ei.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ci(ei,SharedArrayBuffer)||ei&&ci(ei.buffer,SharedArrayBuffer)))return b(ei,Gr,ti);if(typeof ei=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var fi=ei.valueOf&&ei.valueOf();if(fi!=null&&fi!==ei)return a.from(fi,Gr,ti);var bi=w(ei);if(bi)return bi;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ei[Symbol.toPrimitive]=="function")return a.from(ei[Symbol.toPrimitive]("string"),Gr,ti);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ei)}a.from=function(ei,Gr,ti){return s(ei,Gr,ti)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function f(ei){if(typeof ei!="number")throw new TypeError('"size" argument must be of type number');if(ei<0)throw new RangeError('The value "'+ei+'" is invalid for option "size"')}function c(ei,Gr,ti){return f(ei),ei<=0?u(ei):Gr!==void 0?typeof ti=="string"?u(ei).fill(Gr,ti):u(ei).fill(Gr):u(ei)}a.alloc=function(ei,Gr,ti){return c(ei,Gr,ti)};function d(ei){return f(ei),u(ei<0?0:S(ei)|0)}a.allocUnsafe=function(ei){return d(ei)},a.allocUnsafeSlow=function(ei){return d(ei)};function p(ei,Gr){if((typeof Gr!="string"||Gr==="")&&(Gr="utf8"),!a.isEncoding(Gr))throw new TypeError("Unknown encoding: "+Gr);var ti=B(ei,Gr)|0,fi=u(ti),bi=fi.write(ei,Gr);return bi!==ti&&(fi=fi.slice(0,bi)),fi}function h(ei){for(var Gr=ei.length<0?0:S(ei.length)|0,ti=u(Gr),fi=0;fi<Gr;fi+=1)ti[fi]=ei[fi]&255;return ti}function y(ei){if(ci(ei,Uint8Array)){var Gr=new Uint8Array(ei);return b(Gr.buffer,Gr.byteOffset,Gr.byteLength)}return h(ei)}function b(ei,Gr,ti){if(Gr<0||ei.byteLength<Gr)throw new RangeError('"offset" is outside of buffer bounds');if(ei.byteLength<Gr+(ti||0))throw new RangeError('"length" is outside of buffer bounds');var fi;return Gr===void 0&&ti===void 0?fi=new Uint8Array(ei):ti===void 0?fi=new Uint8Array(ei,Gr):fi=new Uint8Array(ei,Gr,ti),Object.setPrototypeOf(fi,a.prototype),fi}function w(ei){if(a.isBuffer(ei)){var Gr=S(ei.length)|0,ti=u(Gr);return ti.length===0||ei.copy(ti,0,0,Gr),ti}if(ei.length!==void 0)return typeof ei.length!="number"||mi(ei.length)?u(0):h(ei);if(ei.type==="Buffer"&&Array.isArray(ei.data))return h(ei.data)}function S(ei){if(ei>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return ei|0}function E(ei){return+ei!=ei&&(ei=0),a.alloc(+ei)}a.isBuffer=function(Gr){return Gr!=null&&Gr._isBuffer===!0&&Gr!==a.prototype},a.compare=function(Gr,ti){if(ci(Gr,Uint8Array)&&(Gr=a.from(Gr,Gr.offset,Gr.byteLength)),ci(ti,Uint8Array)&&(ti=a.from(ti,ti.offset,ti.byteLength)),!a.isBuffer(Gr)||!a.isBuffer(ti))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Gr===ti)return 0;for(var fi=Gr.length,bi=ti.length,Ai=0,Bi=Math.min(fi,bi);Ai<Bi;++Ai)if(Gr[Ai]!==ti[Ai]){fi=Gr[Ai],bi=ti[Ai];break}return fi<bi?-1:bi<fi?1:0},a.isEncoding=function(Gr){switch(String(Gr).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(Gr,ti){if(!Array.isArray(Gr))throw new TypeError('"list" argument must be an Array of Buffers');if(Gr.length===0)return a.alloc(0);var fi;if(ti===void 0)for(ti=0,fi=0;fi<Gr.length;++fi)ti+=Gr[fi].length;var bi=a.allocUnsafe(ti),Ai=0;for(fi=0;fi<Gr.length;++fi){var Bi=Gr[fi];if(ci(Bi,Uint8Array))Ai+Bi.length>bi.length?a.from(Bi).copy(bi,Ai):Uint8Array.prototype.set.call(bi,Bi,Ai);else if(a.isBuffer(Bi))Bi.copy(bi,Ai);else throw new TypeError('"list" argument must be an Array of Buffers');Ai+=Bi.length}return bi};function B(ei,Gr){if(a.isBuffer(ei))return ei.length;if(ArrayBuffer.isView(ei)||ci(ei,ArrayBuffer))return ei.byteLength;if(typeof ei!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ei);var ti=ei.length,fi=arguments.length>2&&arguments[2]===!0;if(!fi&&ti===0)return 0;for(var bi=!1;;)switch(Gr){case"ascii":case"latin1":case"binary":return ti;case"utf8":case"utf-8":return ri(ei).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ti*2;case"hex":return ti>>>1;case"base64":return ar(ei).length;default:if(bi)return fi?-1:ri(ei).length;Gr=(""+Gr).toLowerCase(),bi=!0}}a.byteLength=B;function ae(ei,Gr,ti){var fi=!1;if((Gr===void 0||Gr<0)&&(Gr=0),Gr>this.length||((ti===void 0||ti>this.length)&&(ti=this.length),ti<=0)||(ti>>>=0,Gr>>>=0,ti<=Gr))return"";for(ei||(ei="utf8");;)switch(ei){case"hex":return L(this,Gr,ti);case"utf8":case"utf-8":return se(this,Gr,ti);case"ascii":return ue(this,Gr,ti);case"latin1":case"binary":return bt(this,Gr,ti);case"base64":return Ze(this,Gr,ti);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,Gr,ti);default:if(fi)throw new TypeError("Unknown encoding: "+ei);ei=(ei+"").toLowerCase(),fi=!0}}a.prototype._isBuffer=!0;function W(ei,Gr,ti){var fi=ei[Gr];ei[Gr]=ei[ti],ei[ti]=fi}a.prototype.swap16=function(){var Gr=this.length;if(Gr%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ti=0;ti<Gr;ti+=2)W(this,ti,ti+1);return this},a.prototype.swap32=function(){var Gr=this.length;if(Gr%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ti=0;ti<Gr;ti+=4)W(this,ti,ti+3),W(this,ti+1,ti+2);return this},a.prototype.swap64=function(){var Gr=this.length;if(Gr%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ti=0;ti<Gr;ti+=8)W(this,ti,ti+7),W(this,ti+1,ti+6),W(this,ti+2,ti+5),W(this,ti+3,ti+4);return this},a.prototype.toString=function(){var Gr=this.length;return Gr===0?"":arguments.length===0?se(this,0,Gr):ae.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(Gr){if(!a.isBuffer(Gr))throw new TypeError("Argument must be a Buffer");return this===Gr?!0:a.compare(this,Gr)===0},a.prototype.inspect=function(){var Gr="",ti=e.INSPECT_MAX_BYTES;return Gr=this.toString("hex",0,ti).replace(/(.{2})/g,"$1 ").trim(),this.length>ti&&(Gr+=" ... "),"<Buffer "+Gr+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(Gr,ti,fi,bi,Ai){if(ci(Gr,Uint8Array)&&(Gr=a.from(Gr,Gr.offset,Gr.byteLength)),!a.isBuffer(Gr))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Gr);if(ti===void 0&&(ti=0),fi===void 0&&(fi=Gr?Gr.length:0),bi===void 0&&(bi=0),Ai===void 0&&(Ai=this.length),ti<0||fi>Gr.length||bi<0||Ai>this.length)throw new RangeError("out of range index");if(bi>=Ai&&ti>=fi)return 0;if(bi>=Ai)return-1;if(ti>=fi)return 1;if(ti>>>=0,fi>>>=0,bi>>>=0,Ai>>>=0,this===Gr)return 0;for(var Bi=Ai-bi,qi=fi-ti,vn=Math.min(Bi,qi),di=this.slice(bi,Ai),rr=Gr.slice(ti,fi),on=0;on<vn;++on)if(di[on]!==rr[on]){Bi=di[on],qi=rr[on];break}return Bi<qi?-1:qi<Bi?1:0};function J(ei,Gr,ti,fi,bi){if(ei.length===0)return-1;if(typeof ti=="string"?(fi=ti,ti=0):ti>2147483647?ti=2147483647:ti<-2147483648&&(ti=-2147483648),ti=+ti,mi(ti)&&(ti=bi?0:ei.length-1),ti<0&&(ti=ei.length+ti),ti>=ei.length){if(bi)return-1;ti=ei.length-1}else if(ti<0)if(bi)ti=0;else return-1;if(typeof Gr=="string"&&(Gr=a.from(Gr,fi)),a.isBuffer(Gr))return Gr.length===0?-1:ve(ei,Gr,ti,fi,bi);if(typeof Gr=="number")return Gr=Gr&255,typeof Uint8Array.prototype.indexOf=="function"?bi?Uint8Array.prototype.indexOf.call(ei,Gr,ti):Uint8Array.prototype.lastIndexOf.call(ei,Gr,ti):ve(ei,[Gr],ti,fi,bi);throw new TypeError("val must be string, number or Buffer")}function ve(ei,Gr,ti,fi,bi){var Ai=1,Bi=ei.length,qi=Gr.length;if(fi!==void 0&&(fi=String(fi).toLowerCase(),fi==="ucs2"||fi==="ucs-2"||fi==="utf16le"||fi==="utf-16le")){if(ei.length<2||Gr.length<2)return-1;Ai=2,Bi/=2,qi/=2,ti/=2}function vn(vi,Ei){return Ai===1?vi[Ei]:vi.readUInt16BE(Ei*Ai)}var di;if(bi){var rr=-1;for(di=ti;di<Bi;di++)if(vn(ei,di)===vn(Gr,rr===-1?0:di-rr)){if(rr===-1&&(rr=di),di-rr+1===qi)return rr*Ai}else rr!==-1&&(di-=di-rr),rr=-1}else for(ti+qi>Bi&&(ti=Bi-qi),di=ti;di>=0;di--){for(var on=!0,si=0;si<qi;si++)if(vn(ei,di+si)!==vn(Gr,si)){on=!1;break}if(on)return di}return-1}a.prototype.includes=function(Gr,ti,fi){return this.indexOf(Gr,ti,fi)!==-1},a.prototype.indexOf=function(Gr,ti,fi){return J(this,Gr,ti,fi,!0)},a.prototype.lastIndexOf=function(Gr,ti,fi){return J(this,Gr,ti,fi,!1)};function Qe(ei,Gr,ti,fi){ti=Number(ti)||0;var bi=ei.length-ti;fi?(fi=Number(fi),fi>bi&&(fi=bi)):fi=bi;var Ai=Gr.length;fi>Ai/2&&(fi=Ai/2);for(var Bi=0;Bi<fi;++Bi){var qi=parseInt(Gr.substr(Bi*2,2),16);if(mi(qi))return Bi;ei[ti+Bi]=qi}return Bi}function kt(ei,Gr,ti,fi){return jr(ri(Gr,ei.length-ti),ei,ti,fi)}function nr(ei,Gr,ti,fi){return jr(ui(Gr),ei,ti,fi)}function sr(ei,Gr,ti,fi){return jr(ar(Gr),ei,ti,fi)}function ce(ei,Gr,ti,fi){return jr(lr(Gr,ei.length-ti),ei,ti,fi)}a.prototype.write=function(Gr,ti,fi,bi){if(ti===void 0)bi="utf8",fi=this.length,ti=0;else if(fi===void 0&&typeof ti=="string")bi=ti,fi=this.length,ti=0;else if(isFinite(ti))ti=ti>>>0,isFinite(fi)?(fi=fi>>>0,bi===void 0&&(bi="utf8")):(bi=fi,fi=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ai=this.length-ti;if((fi===void 0||fi>Ai)&&(fi=Ai),Gr.length>0&&(fi<0||ti<0)||ti>this.length)throw new RangeError("Attempt to write outside buffer bounds");bi||(bi="utf8");for(var Bi=!1;;)switch(bi){case"hex":return Qe(this,Gr,ti,fi);case"utf8":case"utf-8":return kt(this,Gr,ti,fi);case"ascii":case"latin1":case"binary":return nr(this,Gr,ti,fi);case"base64":return sr(this,Gr,ti,fi);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,Gr,ti,fi);default:if(Bi)throw new TypeError("Unknown encoding: "+bi);bi=(""+bi).toLowerCase(),Bi=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ze(ei,Gr,ti){return Gr===0&&ti===ei.length?t.fromByteArray(ei):t.fromByteArray(ei.slice(Gr,ti))}function se(ei,Gr,ti){ti=Math.min(ei.length,ti);for(var fi=[],bi=Gr;bi<ti;){var Ai=ei[bi],Bi=null,qi=Ai>239?4:Ai>223?3:Ai>191?2:1;if(bi+qi<=ti){var vn,di,rr,on;switch(qi){case 1:Ai<128&&(Bi=Ai);break;case 2:vn=ei[bi+1],(vn&192)===128&&(on=(Ai&31)<<6|vn&63,on>127&&(Bi=on));break;case 3:vn=ei[bi+1],di=ei[bi+2],(vn&192)===128&&(di&192)===128&&(on=(Ai&15)<<12|(vn&63)<<6|di&63,on>2047&&(on<55296||on>57343)&&(Bi=on));break;case 4:vn=ei[bi+1],di=ei[bi+2],rr=ei[bi+3],(vn&192)===128&&(di&192)===128&&(rr&192)===128&&(on=(Ai&15)<<18|(vn&63)<<12|(di&63)<<6|rr&63,on>65535&&on<1114112&&(Bi=on))}}Bi===null?(Bi=65533,qi=1):Bi>65535&&(Bi-=65536,fi.push(Bi>>>10&1023|55296),Bi=56320|Bi&1023),fi.push(Bi),bi+=qi}return ur(fi)}var vt=4096;function ur(ei){var Gr=ei.length;if(Gr<=vt)return String.fromCharCode.apply(String,ei);for(var ti="",fi=0;fi<Gr;)ti+=String.fromCharCode.apply(String,ei.slice(fi,fi+=vt));return ti}function ue(ei,Gr,ti){var fi="";ti=Math.min(ei.length,ti);for(var bi=Gr;bi<ti;++bi)fi+=String.fromCharCode(ei[bi]&127);return fi}function bt(ei,Gr,ti){var fi="";ti=Math.min(ei.length,ti);for(var bi=Gr;bi<ti;++bi)fi+=String.fromCharCode(ei[bi]);return fi}function L(ei,Gr,ti){var fi=ei.length;(!Gr||Gr<0)&&(Gr=0),(!ti||ti<0||ti>fi)&&(ti=fi);for(var bi="",Ai=Gr;Ai<ti;++Ai)bi+=pi[ei[Ai]];return bi}function _(ei,Gr,ti){for(var fi=ei.slice(Gr,ti),bi="",Ai=0;Ai<fi.length-1;Ai+=2)bi+=String.fromCharCode(fi[Ai]+fi[Ai+1]*256);return bi}a.prototype.slice=function(Gr,ti){var fi=this.length;Gr=~~Gr,ti=ti===void 0?fi:~~ti,Gr<0?(Gr+=fi,Gr<0&&(Gr=0)):Gr>fi&&(Gr=fi),ti<0?(ti+=fi,ti<0&&(ti=0)):ti>fi&&(ti=fi),ti<Gr&&(ti=Gr);var bi=this.subarray(Gr,ti);return Object.setPrototypeOf(bi,a.prototype),bi};function F(ei,Gr,ti){if(ei%1!==0||ei<0)throw new RangeError("offset is not uint");if(ei+Gr>ti)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=this[Gr],Ai=1,Bi=0;++Bi<ti&&(Ai*=256);)bi+=this[Gr+Bi]*Ai;return bi},a.prototype.readUintBE=a.prototype.readUIntBE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=this[Gr+--ti],Ai=1;ti>0&&(Ai*=256);)bi+=this[Gr+--ti]*Ai;return bi},a.prototype.readUint8=a.prototype.readUInt8=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,1,this.length),this[Gr]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,2,this.length),this[Gr]|this[Gr+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,2,this.length),this[Gr]<<8|this[Gr+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),(this[Gr]|this[Gr+1]<<8|this[Gr+2]<<16)+this[Gr+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),this[Gr]*16777216+(this[Gr+1]<<16|this[Gr+2]<<8|this[Gr+3])},a.prototype.readIntLE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=this[Gr],Ai=1,Bi=0;++Bi<ti&&(Ai*=256);)bi+=this[Gr+Bi]*Ai;return Ai*=128,bi>=Ai&&(bi-=Math.pow(2,8*ti)),bi},a.prototype.readIntBE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=ti,Ai=1,Bi=this[Gr+--bi];bi>0&&(Ai*=256);)Bi+=this[Gr+--bi]*Ai;return Ai*=128,Bi>=Ai&&(Bi-=Math.pow(2,8*ti)),Bi},a.prototype.readInt8=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,1,this.length),this[Gr]&128?(255-this[Gr]+1)*-1:this[Gr]},a.prototype.readInt16LE=function(Gr,ti){Gr=Gr>>>0,ti||F(Gr,2,this.length);var fi=this[Gr]|this[Gr+1]<<8;return fi&32768?fi|4294901760:fi},a.prototype.readInt16BE=function(Gr,ti){Gr=Gr>>>0,ti||F(Gr,2,this.length);var fi=this[Gr+1]|this[Gr]<<8;return fi&32768?fi|4294901760:fi},a.prototype.readInt32LE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),this[Gr]|this[Gr+1]<<8|this[Gr+2]<<16|this[Gr+3]<<24},a.prototype.readInt32BE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),this[Gr]<<24|this[Gr+1]<<16|this[Gr+2]<<8|this[Gr+3]},a.prototype.readFloatLE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),r.read(this,Gr,!0,23,4)},a.prototype.readFloatBE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),r.read(this,Gr,!1,23,4)},a.prototype.readDoubleLE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,8,this.length),r.read(this,Gr,!0,52,8)},a.prototype.readDoubleBE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,8,this.length),r.read(this,Gr,!1,52,8)};function k(ei,Gr,ti,fi,bi,Ai){if(!a.isBuffer(ei))throw new TypeError('"buffer" argument must be a Buffer instance');if(Gr>bi||Gr<Ai)throw new RangeError('"value" argument is out of bounds');if(ti+fi>ei.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,fi=fi>>>0,!bi){var Ai=Math.pow(2,8*fi)-1;k(this,Gr,ti,fi,Ai,0)}var Bi=1,qi=0;for(this[ti]=Gr&255;++qi<fi&&(Bi*=256);)this[ti+qi]=Gr/Bi&255;return ti+fi},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,fi=fi>>>0,!bi){var Ai=Math.pow(2,8*fi)-1;k(this,Gr,ti,fi,Ai,0)}var Bi=fi-1,qi=1;for(this[ti+Bi]=Gr&255;--Bi>=0&&(qi*=256);)this[ti+Bi]=Gr/qi&255;return ti+fi},a.prototype.writeUint8=a.prototype.writeUInt8=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,1,255,0),this[ti]=Gr&255,ti+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,65535,0),this[ti]=Gr&255,this[ti+1]=Gr>>>8,ti+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,65535,0),this[ti]=Gr>>>8,this[ti+1]=Gr&255,ti+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,4294967295,0),this[ti+3]=Gr>>>24,this[ti+2]=Gr>>>16,this[ti+1]=Gr>>>8,this[ti]=Gr&255,ti+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,4294967295,0),this[ti]=Gr>>>24,this[ti+1]=Gr>>>16,this[ti+2]=Gr>>>8,this[ti+3]=Gr&255,ti+4},a.prototype.writeIntLE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,!bi){var Ai=Math.pow(2,8*fi-1);k(this,Gr,ti,fi,Ai-1,-Ai)}var Bi=0,qi=1,vn=0;for(this[ti]=Gr&255;++Bi<fi&&(qi*=256);)Gr<0&&vn===0&&this[ti+Bi-1]!==0&&(vn=1),this[ti+Bi]=(Gr/qi>>0)-vn&255;return ti+fi},a.prototype.writeIntBE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,!bi){var Ai=Math.pow(2,8*fi-1);k(this,Gr,ti,fi,Ai-1,-Ai)}var Bi=fi-1,qi=1,vn=0;for(this[ti+Bi]=Gr&255;--Bi>=0&&(qi*=256);)Gr<0&&vn===0&&this[ti+Bi+1]!==0&&(vn=1),this[ti+Bi]=(Gr/qi>>0)-vn&255;return ti+fi},a.prototype.writeInt8=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,1,127,-128),Gr<0&&(Gr=255+Gr+1),this[ti]=Gr&255,ti+1},a.prototype.writeInt16LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,32767,-32768),this[ti]=Gr&255,this[ti+1]=Gr>>>8,ti+2},a.prototype.writeInt16BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,32767,-32768),this[ti]=Gr>>>8,this[ti+1]=Gr&255,ti+2},a.prototype.writeInt32LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,2147483647,-2147483648),this[ti]=Gr&255,this[ti+1]=Gr>>>8,this[ti+2]=Gr>>>16,this[ti+3]=Gr>>>24,ti+4},a.prototype.writeInt32BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,2147483647,-2147483648),Gr<0&&(Gr=4294967295+Gr+1),this[ti]=Gr>>>24,this[ti+1]=Gr>>>16,this[ti+2]=Gr>>>8,this[ti+3]=Gr&255,ti+4};function Ye(ei,Gr,ti,fi,bi,Ai){if(ti+fi>ei.length)throw new RangeError("Index out of range");if(ti<0)throw new RangeError("Index out of range")}function rn(ei,Gr,ti,fi,bi){return Gr=+Gr,ti=ti>>>0,bi||Ye(ei,Gr,ti,4),r.write(ei,Gr,ti,fi,23,4),ti+4}a.prototype.writeFloatLE=function(Gr,ti,fi){return rn(this,Gr,ti,!0,fi)},a.prototype.writeFloatBE=function(Gr,ti,fi){return rn(this,Gr,ti,!1,fi)};function ii(ei,Gr,ti,fi,bi){return Gr=+Gr,ti=ti>>>0,bi||Ye(ei,Gr,ti,8),r.write(ei,Gr,ti,fi,52,8),ti+8}a.prototype.writeDoubleLE=function(Gr,ti,fi){return ii(this,Gr,ti,!0,fi)},a.prototype.writeDoubleBE=function(Gr,ti,fi){return ii(this,Gr,ti,!1,fi)},a.prototype.copy=function(Gr,ti,fi,bi){if(!a.isBuffer(Gr))throw new TypeError("argument should be a Buffer");if(fi||(fi=0),!bi&&bi!==0&&(bi=this.length),ti>=Gr.length&&(ti=Gr.length),ti||(ti=0),bi>0&&bi<fi&&(bi=fi),bi===fi||Gr.length===0||this.length===0)return 0;if(ti<0)throw new RangeError("targetStart out of bounds");if(fi<0||fi>=this.length)throw new RangeError("Index out of range");if(bi<0)throw new RangeError("sourceEnd out of bounds");bi>this.length&&(bi=this.length),Gr.length-ti<bi-fi&&(bi=Gr.length-ti+fi);var Ai=bi-fi;return this===Gr&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ti,fi,bi):Uint8Array.prototype.set.call(Gr,this.subarray(fi,bi),ti),Ai},a.prototype.fill=function(Gr,ti,fi,bi){if(typeof Gr=="string"){if(typeof ti=="string"?(bi=ti,ti=0,fi=this.length):typeof fi=="string"&&(bi=fi,fi=this.length),bi!==void 0&&typeof bi!="string")throw new TypeError("encoding must be a string");if(typeof bi=="string"&&!a.isEncoding(bi))throw new TypeError("Unknown encoding: "+bi);if(Gr.length===1){var Ai=Gr.charCodeAt(0);(bi==="utf8"&&Ai<128||bi==="latin1")&&(Gr=Ai)}}else typeof Gr=="number"?Gr=Gr&255:typeof Gr=="boolean"&&(Gr=Number(Gr));if(ti<0||this.length<ti||this.length<fi)throw new RangeError("Out of range index");if(fi<=ti)return this;ti=ti>>>0,fi=fi===void 0?this.length:fi>>>0,Gr||(Gr=0);var Bi;if(typeof Gr=="number")for(Bi=ti;Bi<fi;++Bi)this[Bi]=Gr;else{var qi=a.isBuffer(Gr)?Gr:a.from(Gr,bi),vn=qi.length;if(vn===0)throw new TypeError('The value "'+Gr+'" is invalid for argument "value"');for(Bi=0;Bi<fi-ti;++Bi)this[Bi+ti]=qi[Bi%vn]}return this};var ai=/[^+/0-9A-Za-z-_]/g;function ni(ei){if(ei=ei.split("=")[0],ei=ei.trim().replace(ai,""),ei.length<2)return"";for(;ei.length%4!==0;)ei=ei+"=";return ei}function ri(ei,Gr){Gr=Gr||1/0;for(var ti,fi=ei.length,bi=null,Ai=[],Bi=0;Bi<fi;++Bi){if(ti=ei.charCodeAt(Bi),ti>55295&&ti<57344){if(!bi){if(ti>56319){(Gr-=3)>-1&&Ai.push(239,191,189);continue}else if(Bi+1===fi){(Gr-=3)>-1&&Ai.push(239,191,189);continue}bi=ti;continue}if(ti<56320){(Gr-=3)>-1&&Ai.push(239,191,189),bi=ti;continue}ti=(bi-55296<<10|ti-56320)+65536}else bi&&(Gr-=3)>-1&&Ai.push(239,191,189);if(bi=null,ti<128){if((Gr-=1)<0)break;Ai.push(ti)}else if(ti<2048){if((Gr-=2)<0)break;Ai.push(ti>>6|192,ti&63|128)}else if(ti<65536){if((Gr-=3)<0)break;Ai.push(ti>>12|224,ti>>6&63|128,ti&63|128)}else if(ti<1114112){if((Gr-=4)<0)break;Ai.push(ti>>18|240,ti>>12&63|128,ti>>6&63|128,ti&63|128)}else throw new Error("Invalid code point")}return Ai}function ui(ei){for(var Gr=[],ti=0;ti<ei.length;++ti)Gr.push(ei.charCodeAt(ti)&255);return Gr}function lr(ei,Gr){for(var ti,fi,bi,Ai=[],Bi=0;Bi<ei.length&&!((Gr-=2)<0);++Bi)ti=ei.charCodeAt(Bi),fi=ti>>8,bi=ti%256,Ai.push(bi),Ai.push(fi);return Ai}function ar(ei){return t.toByteArray(ni(ei))}function jr(ei,Gr,ti,fi){for(var bi=0;bi<fi&&!(bi+ti>=Gr.length||bi>=ei.length);++bi)Gr[bi+ti]=ei[bi];return bi}function ci(ei,Gr){return ei instanceof Gr||ei!=null&&ei.constructor!=null&&ei.constructor.name!=null&&ei.constructor.name===Gr.name}function mi(ei){return ei!==ei}var pi=(function(){for(var ei="0123456789abcdef",Gr=new Array(256),ti=0;ti<16;++ti)for(var fi=ti*16,bi=0;bi<16;++bi)Gr[fi+bi]=ei[ti]+ei[bi];return Gr})()})(buffer$2)),buffer$2}var bufferExports=requireBuffer$1(),process$1={exports:{}},hasRequiredProcess;function requireProcess(){return hasRequiredProcess||(hasRequiredProcess=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={exports:{}},n=r.exports={},o,i;function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=u}catch{o=u}try{typeof clearTimeout=="function"?i=clearTimeout:i=a}catch{i=a}})();function s(L){if(o===setTimeout)return setTimeout(L,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(L,0);try{return o(L,0)}catch{try{return o.call(null,L,0)}catch{return o.call(this,L,0)}}}function f(L){if(i===clearTimeout)return clearTimeout(L);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(L);try{return i(L)}catch{try{return i.call(null,L)}catch{return i.call(this,L)}}}var c=[],d=!1,p,h=-1;function y(){!d||!p||(d=!1,p.length?c=p.concat(c):h=-1,c.length&&b())}function b(){if(!d){var L=s(y);d=!0;for(var _=c.length;_;){for(p=c,c=[];++h<_;)p&&p[h].run();h=-1,_=c.length}p=null,d=!1,f(L)}}n.nextTick=function(L){var _=new Array(arguments.length-1);if(arguments.length>1)for(var F=1;F<arguments.length;F++)_[F-1]=arguments[F];c.push(new w(L,_)),c.length===1&&!d&&s(b)};function w(L,_){this.fun=L,this.array=_}w.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function S(){}n.on=S,n.addListener=S,n.once=S,n.off=S,n.removeListener=S,n.removeAllListeners=S,n.emit=S,n.prependListener=S,n.prependOnceListener=S,n.listeners=function(L){return[]},n.binding=function(L){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(L){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};function E(){}var B=r.exports.browser,ae=E,W=r.exports.binding,J=E,ve=1,Qe={},kt=E,nr=E,sr=E,ce=E,Ze=E,se="browser",vt="browser",ur="browser",ue=[],bt={nextTick:r.exports.nextTick,title:r.exports.title,browser:B,env:r.exports.env,argv:r.exports.argv,version:r.exports.version,versions:r.exports.versions,on:r.exports.on,addListener:r.exports.addListener,once:r.exports.once,off:r.exports.off,removeListener:r.exports.removeListener,removeAllListeners:r.exports.removeAllListeners,emit:r.exports.emit,emitWarning:ae,prependListener:r.exports.prependListener,prependOnceListener:r.exports.prependOnceListener,listeners:r.exports.listeners,binding:W,cwd:r.exports.cwd,chdir:r.exports.chdir,umask:r.exports.umask,exit:J,pid:ve,features:Qe,kill:kt,dlopen:nr,uptime:sr,memoryUsage:ce,uvCounters:Ze,platform:se,arch:vt,execPath:ur,execArgv:ue};t.addListener=r.exports.addListener,t.arch=vt,t.argv=r.exports.argv,t.binding=W,t.browser=B,t.chdir=r.exports.chdir,t.cwd=r.exports.cwd,t.default=bt,t.dlopen=nr,t.emit=r.exports.emit,t.emitWarning=ae,t.env=r.exports.env,t.execArgv=ue,t.execPath=ur,t.exit=J,t.features=Qe,t.kill=kt,t.listeners=r.exports.listeners,t.memoryUsage=ce,t.nextTick=r.exports.nextTick,t.off=r.exports.off,t.on=r.exports.on,t.once=r.exports.once,t.pid=ve,t.platform=se,t.prependListener=r.exports.prependListener,t.prependOnceListener=r.exports.prependOnceListener,t.removeAllListeners=r.exports.removeAllListeners,t.removeListener=r.exports.removeListener,t.title=r.exports.title,t.umask=r.exports.umask,t.uptime=sr,t.uvCounters=Ze,t.version=r.exports.version,t.versions=r.exports.versions,t=e.exports=bt})(process$1,process$1.exports)),process$1.exports}var processExports=requireProcess();const process=getDefaultExportFromCjs(processExports);var _globalThis=(function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r})(Object),_global=_globalThis,react_production={},hasRequiredReact_production;function requireReact_production(){if(hasRequiredReact_production)return react_production;hasRequiredReact_production=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),u=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function h(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function S(F,k,Ye){this.props=F,this.context=k,this.refs=w,this.updater=Ye||y}S.prototype.isReactComponent={},S.prototype.setState=function(F,k){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,k,"setState")},S.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function E(){}E.prototype=S.prototype;function B(F,k,Ye){this.props=F,this.context=k,this.refs=w,this.updater=Ye||y}var ae=B.prototype=new E;ae.constructor=B,b(ae,S.prototype),ae.isPureReactComponent=!0;var W=Array.isArray;function J(){}var ve={H:null,A:null,T:null,S:null},Qe=Object.prototype.hasOwnProperty;function kt(F,k,Ye){var rn=Ye.ref;return{$$typeof:e,type:F,key:k,ref:rn!==void 0?rn:null,props:Ye}}function nr(F,k){return kt(F.type,k,F.props)}function sr(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function ce(F){var k={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(Ye){return k[Ye]})}var Ze=/\/+/g;function se(F,k){return typeof F=="object"&&F!==null&&F.key!=null?ce(""+F.key):k.toString(36)}function vt(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(J,J):(F.status="pending",F.then(function(k){F.status==="pending"&&(F.status="fulfilled",F.value=k)},function(k){F.status==="pending"&&(F.status="rejected",F.reason=k)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function ur(F,k,Ye,rn,ii){var ai=typeof F;(ai==="undefined"||ai==="boolean")&&(F=null);var ni=!1;if(F===null)ni=!0;else switch(ai){case"bigint":case"string":case"number":ni=!0;break;case"object":switch(F.$$typeof){case e:case t:ni=!0;break;case c:return ni=F._init,ur(ni(F._payload),k,Ye,rn,ii)}}if(ni)return ii=ii(F),ni=rn===""?"."+se(F,0):rn,W(ii)?(Ye="",ni!=null&&(Ye=ni.replace(Ze,"$&/")+"/"),ur(ii,k,Ye,"",function(lr){return lr})):ii!=null&&(sr(ii)&&(ii=nr(ii,Ye+(ii.key==null||F&&F.key===ii.key?"":(""+ii.key).replace(Ze,"$&/")+"/")+ni)),k.push(ii)),1;ni=0;var ri=rn===""?".":rn+":";if(W(F))for(var ui=0;ui<F.length;ui++)rn=F[ui],ai=ri+se(rn,ui),ni+=ur(rn,k,Ye,ai,ii);else if(ui=h(F),typeof ui=="function")for(F=ui.call(F),ui=0;!(rn=F.next()).done;)rn=rn.value,ai=ri+se(rn,ui++),ni+=ur(rn,k,Ye,ai,ii);else if(ai==="object"){if(typeof F.then=="function")return ur(vt(F),k,Ye,rn,ii);throw k=String(F),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return ni}function ue(F,k,Ye){if(F==null)return F;var rn=[],ii=0;return ur(F,rn,"","",function(ai){return k.call(Ye,ai,ii++)}),rn}function bt(F){if(F._status===-1){var k=F._result;k=k(),k.then(function(Ye){(F._status===0||F._status===-1)&&(F._status=1,F._result=Ye)},function(Ye){(F._status===0||F._status===-1)&&(F._status=2,F._result=Ye)}),F._status===-1&&(F._status=0,F._result=k)}if(F._status===1)return F._result.default;throw F._result}var L=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},_={map:ue,forEach:function(F,k,Ye){ue(F,function(){k.apply(this,arguments)},Ye)},count:function(F){var k=0;return ue(F,function(){k++}),k},toArray:function(F){return ue(F,function(k){return k})||[]},only:function(F){if(!sr(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return react_production.Activity=d,react_production.Children=_,react_production.Component=S,react_production.Fragment=r,react_production.Profiler=o,react_production.PureComponent=B,react_production.StrictMode=n,react_production.Suspense=s,react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ve,react_production.__COMPILER_RUNTIME={__proto__:null,c:function(F){return ve.H.useMemoCache(F)}},react_production.cache=function(F){return function(){return F.apply(null,arguments)}},react_production.cacheSignal=function(){return null},react_production.cloneElement=function(F,k,Ye){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var rn=b({},F.props),ii=F.key;if(k!=null)for(ai in k.key!==void 0&&(ii=""+k.key),k)!Qe.call(k,ai)||ai==="key"||ai==="__self"||ai==="__source"||ai==="ref"&&k.ref===void 0||(rn[ai]=k[ai]);var ai=arguments.length-2;if(ai===1)rn.children=Ye;else if(1<ai){for(var ni=Array(ai),ri=0;ri<ai;ri++)ni[ri]=arguments[ri+2];rn.children=ni}return kt(F.type,ii,rn)},react_production.createContext=function(F){return F={$$typeof:u,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:i,_context:F},F},react_production.createElement=function(F,k,Ye){var rn,ii={},ai=null;if(k!=null)for(rn in k.key!==void 0&&(ai=""+k.key),k)Qe.call(k,rn)&&rn!=="key"&&rn!=="__self"&&rn!=="__source"&&(ii[rn]=k[rn]);var ni=arguments.length-2;if(ni===1)ii.children=Ye;else if(1<ni){for(var ri=Array(ni),ui=0;ui<ni;ui++)ri[ui]=arguments[ui+2];ii.children=ri}if(F&&F.defaultProps)for(rn in ni=F.defaultProps,ni)ii[rn]===void 0&&(ii[rn]=ni[rn]);return kt(F,ai,ii)},react_production.createRef=function(){return{current:null}},react_production.forwardRef=function(F){return{$$typeof:a,render:F}},react_production.isValidElement=sr,react_production.lazy=function(F){return{$$typeof:c,_payload:{_status:-1,_result:F},_init:bt}},react_production.memo=function(F,k){return{$$typeof:f,type:F,compare:k===void 0?null:k}},react_production.startTransition=function(F){var k=ve.T,Ye={};ve.T=Ye;try{var rn=F(),ii=ve.S;ii!==null&&ii(Ye,rn),typeof rn=="object"&&rn!==null&&typeof rn.then=="function"&&rn.then(J,L)}catch(ai){L(ai)}finally{k!==null&&Ye.types!==null&&(k.types=Ye.types),ve.T=k}},react_production.unstable_useCacheRefresh=function(){return ve.H.useCacheRefresh()},react_production.use=function(F){return ve.H.use(F)},react_production.useActionState=function(F,k,Ye){return ve.H.useActionState(F,k,Ye)},react_production.useCallback=function(F,k){return ve.H.useCallback(F,k)},react_production.useContext=function(F){return ve.H.useContext(F)},react_production.useDebugValue=function(){},react_production.useDeferredValue=function(F,k){return ve.H.useDeferredValue(F,k)},react_production.useEffect=function(F,k){return ve.H.useEffect(F,k)},react_production.useEffectEvent=function(F){return ve.H.useEffectEvent(F)},react_production.useId=function(){return ve.H.useId()},react_production.useImperativeHandle=function(F,k,Ye){return ve.H.useImperativeHandle(F,k,Ye)},react_production.useInsertionEffect=function(F,k){return ve.H.useInsertionEffect(F,k)},react_production.useLayoutEffect=function(F,k){return ve.H.useLayoutEffect(F,k)},react_production.useMemo=function(F,k){return ve.H.useMemo(F,k)},react_production.useOptimistic=function(F,k){return ve.H.useOptimistic(F,k)},react_production.useReducer=function(F,k,Ye){return ve.H.useReducer(F,k,Ye)},react_production.useRef=function(F){return ve.H.useRef(F)},react_production.useState=function(F){return ve.H.useState(F)},react_production.useSyncExternalStore=function(F,k,Ye){return ve.H.useSyncExternalStore(F,k,Ye)},react_production.useTransition=function(){return ve.H.useTransition()},react_production.version="19.2.3",react_production}var hasRequiredReact;function requireReact(){return hasRequiredReact||(hasRequiredReact=1,react.exports=requireReact_production()),react.exports}var reactExports=requireReact(),client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};/**
14
+ */var hasRequiredBuffer$1;function requireBuffer$1(){return hasRequiredBuffer$1||(hasRequiredBuffer$1=1,(function(e){var t=requireBase64Js(),r=requireIeee754(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;var o=2147483647;e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var ei=new Uint8Array(1),Gr={foo:function(){return 42}};return Object.setPrototypeOf(Gr,Uint8Array.prototype),Object.setPrototypeOf(ei,Gr),ei.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(ei){if(ei>o)throw new RangeError('The value "'+ei+'" is invalid for option "size"');var Gr=new Uint8Array(ei);return Object.setPrototypeOf(Gr,a.prototype),Gr}function a(ei,Gr,ti){if(typeof ei=="number"){if(typeof Gr=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(ei)}return s(ei,Gr,ti)}a.poolSize=8192;function s(ei,Gr,ti){if(typeof ei=="string")return p(ei,Gr);if(ArrayBuffer.isView(ei))return y(ei);if(ei==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ei);if(ci(ei,ArrayBuffer)||ei&&ci(ei.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ci(ei,SharedArrayBuffer)||ei&&ci(ei.buffer,SharedArrayBuffer)))return b(ei,Gr,ti);if(typeof ei=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var fi=ei.valueOf&&ei.valueOf();if(fi!=null&&fi!==ei)return a.from(fi,Gr,ti);var bi=w(ei);if(bi)return bi;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ei[Symbol.toPrimitive]=="function")return a.from(ei[Symbol.toPrimitive]("string"),Gr,ti);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ei)}a.from=function(ei,Gr,ti){return s(ei,Gr,ti)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function f(ei){if(typeof ei!="number")throw new TypeError('"size" argument must be of type number');if(ei<0)throw new RangeError('The value "'+ei+'" is invalid for option "size"')}function c(ei,Gr,ti){return f(ei),ei<=0?u(ei):Gr!==void 0?typeof ti=="string"?u(ei).fill(Gr,ti):u(ei).fill(Gr):u(ei)}a.alloc=function(ei,Gr,ti){return c(ei,Gr,ti)};function d(ei){return f(ei),u(ei<0?0:S(ei)|0)}a.allocUnsafe=function(ei){return d(ei)},a.allocUnsafeSlow=function(ei){return d(ei)};function p(ei,Gr){if((typeof Gr!="string"||Gr==="")&&(Gr="utf8"),!a.isEncoding(Gr))throw new TypeError("Unknown encoding: "+Gr);var ti=B(ei,Gr)|0,fi=u(ti),bi=fi.write(ei,Gr);return bi!==ti&&(fi=fi.slice(0,bi)),fi}function h(ei){for(var Gr=ei.length<0?0:S(ei.length)|0,ti=u(Gr),fi=0;fi<Gr;fi+=1)ti[fi]=ei[fi]&255;return ti}function y(ei){if(ci(ei,Uint8Array)){var Gr=new Uint8Array(ei);return b(Gr.buffer,Gr.byteOffset,Gr.byteLength)}return h(ei)}function b(ei,Gr,ti){if(Gr<0||ei.byteLength<Gr)throw new RangeError('"offset" is outside of buffer bounds');if(ei.byteLength<Gr+(ti||0))throw new RangeError('"length" is outside of buffer bounds');var fi;return Gr===void 0&&ti===void 0?fi=new Uint8Array(ei):ti===void 0?fi=new Uint8Array(ei,Gr):fi=new Uint8Array(ei,Gr,ti),Object.setPrototypeOf(fi,a.prototype),fi}function w(ei){if(a.isBuffer(ei)){var Gr=S(ei.length)|0,ti=u(Gr);return ti.length===0||ei.copy(ti,0,0,Gr),ti}if(ei.length!==void 0)return typeof ei.length!="number"||mi(ei.length)?u(0):h(ei);if(ei.type==="Buffer"&&Array.isArray(ei.data))return h(ei.data)}function S(ei){if(ei>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return ei|0}function E(ei){return+ei!=ei&&(ei=0),a.alloc(+ei)}a.isBuffer=function(Gr){return Gr!=null&&Gr._isBuffer===!0&&Gr!==a.prototype},a.compare=function(Gr,ti){if(ci(Gr,Uint8Array)&&(Gr=a.from(Gr,Gr.offset,Gr.byteLength)),ci(ti,Uint8Array)&&(ti=a.from(ti,ti.offset,ti.byteLength)),!a.isBuffer(Gr)||!a.isBuffer(ti))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Gr===ti)return 0;for(var fi=Gr.length,bi=ti.length,Ai=0,Bi=Math.min(fi,bi);Ai<Bi;++Ai)if(Gr[Ai]!==ti[Ai]){fi=Gr[Ai],bi=ti[Ai];break}return fi<bi?-1:bi<fi?1:0},a.isEncoding=function(Gr){switch(String(Gr).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(Gr,ti){if(!Array.isArray(Gr))throw new TypeError('"list" argument must be an Array of Buffers');if(Gr.length===0)return a.alloc(0);var fi;if(ti===void 0)for(ti=0,fi=0;fi<Gr.length;++fi)ti+=Gr[fi].length;var bi=a.allocUnsafe(ti),Ai=0;for(fi=0;fi<Gr.length;++fi){var Bi=Gr[fi];if(ci(Bi,Uint8Array))Ai+Bi.length>bi.length?a.from(Bi).copy(bi,Ai):Uint8Array.prototype.set.call(bi,Bi,Ai);else if(a.isBuffer(Bi))Bi.copy(bi,Ai);else throw new TypeError('"list" argument must be an Array of Buffers');Ai+=Bi.length}return bi};function B(ei,Gr){if(a.isBuffer(ei))return ei.length;if(ArrayBuffer.isView(ei)||ci(ei,ArrayBuffer))return ei.byteLength;if(typeof ei!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ei);var ti=ei.length,fi=arguments.length>2&&arguments[2]===!0;if(!fi&&ti===0)return 0;for(var bi=!1;;)switch(Gr){case"ascii":case"latin1":case"binary":return ti;case"utf8":case"utf-8":return ri(ei).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ti*2;case"hex":return ti>>>1;case"base64":return ar(ei).length;default:if(bi)return fi?-1:ri(ei).length;Gr=(""+Gr).toLowerCase(),bi=!0}}a.byteLength=B;function ae(ei,Gr,ti){var fi=!1;if((Gr===void 0||Gr<0)&&(Gr=0),Gr>this.length||((ti===void 0||ti>this.length)&&(ti=this.length),ti<=0)||(ti>>>=0,Gr>>>=0,ti<=Gr))return"";for(ei||(ei="utf8");;)switch(ei){case"hex":return L(this,Gr,ti);case"utf8":case"utf-8":return se(this,Gr,ti);case"ascii":return ue(this,Gr,ti);case"latin1":case"binary":return bt(this,Gr,ti);case"base64":return Ze(this,Gr,ti);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,Gr,ti);default:if(fi)throw new TypeError("Unknown encoding: "+ei);ei=(ei+"").toLowerCase(),fi=!0}}a.prototype._isBuffer=!0;function W(ei,Gr,ti){var fi=ei[Gr];ei[Gr]=ei[ti],ei[ti]=fi}a.prototype.swap16=function(){var Gr=this.length;if(Gr%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ti=0;ti<Gr;ti+=2)W(this,ti,ti+1);return this},a.prototype.swap32=function(){var Gr=this.length;if(Gr%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ti=0;ti<Gr;ti+=4)W(this,ti,ti+3),W(this,ti+1,ti+2);return this},a.prototype.swap64=function(){var Gr=this.length;if(Gr%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ti=0;ti<Gr;ti+=8)W(this,ti,ti+7),W(this,ti+1,ti+6),W(this,ti+2,ti+5),W(this,ti+3,ti+4);return this},a.prototype.toString=function(){var Gr=this.length;return Gr===0?"":arguments.length===0?se(this,0,Gr):ae.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(Gr){if(!a.isBuffer(Gr))throw new TypeError("Argument must be a Buffer");return this===Gr?!0:a.compare(this,Gr)===0},a.prototype.inspect=function(){var Gr="",ti=e.INSPECT_MAX_BYTES;return Gr=this.toString("hex",0,ti).replace(/(.{2})/g,"$1 ").trim(),this.length>ti&&(Gr+=" ... "),"<Buffer "+Gr+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(Gr,ti,fi,bi,Ai){if(ci(Gr,Uint8Array)&&(Gr=a.from(Gr,Gr.offset,Gr.byteLength)),!a.isBuffer(Gr))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Gr);if(ti===void 0&&(ti=0),fi===void 0&&(fi=Gr?Gr.length:0),bi===void 0&&(bi=0),Ai===void 0&&(Ai=this.length),ti<0||fi>Gr.length||bi<0||Ai>this.length)throw new RangeError("out of range index");if(bi>=Ai&&ti>=fi)return 0;if(bi>=Ai)return-1;if(ti>=fi)return 1;if(ti>>>=0,fi>>>=0,bi>>>=0,Ai>>>=0,this===Gr)return 0;for(var Bi=Ai-bi,qi=fi-ti,vn=Math.min(Bi,qi),di=this.slice(bi,Ai),rr=Gr.slice(ti,fi),on=0;on<vn;++on)if(di[on]!==rr[on]){Bi=di[on],qi=rr[on];break}return Bi<qi?-1:qi<Bi?1:0};function J(ei,Gr,ti,fi,bi){if(ei.length===0)return-1;if(typeof ti=="string"?(fi=ti,ti=0):ti>2147483647?ti=2147483647:ti<-2147483648&&(ti=-2147483648),ti=+ti,mi(ti)&&(ti=bi?0:ei.length-1),ti<0&&(ti=ei.length+ti),ti>=ei.length){if(bi)return-1;ti=ei.length-1}else if(ti<0)if(bi)ti=0;else return-1;if(typeof Gr=="string"&&(Gr=a.from(Gr,fi)),a.isBuffer(Gr))return Gr.length===0?-1:ve(ei,Gr,ti,fi,bi);if(typeof Gr=="number")return Gr=Gr&255,typeof Uint8Array.prototype.indexOf=="function"?bi?Uint8Array.prototype.indexOf.call(ei,Gr,ti):Uint8Array.prototype.lastIndexOf.call(ei,Gr,ti):ve(ei,[Gr],ti,fi,bi);throw new TypeError("val must be string, number or Buffer")}function ve(ei,Gr,ti,fi,bi){var Ai=1,Bi=ei.length,qi=Gr.length;if(fi!==void 0&&(fi=String(fi).toLowerCase(),fi==="ucs2"||fi==="ucs-2"||fi==="utf16le"||fi==="utf-16le")){if(ei.length<2||Gr.length<2)return-1;Ai=2,Bi/=2,qi/=2,ti/=2}function vn(vi,Ei){return Ai===1?vi[Ei]:vi.readUInt16BE(Ei*Ai)}var di;if(bi){var rr=-1;for(di=ti;di<Bi;di++)if(vn(ei,di)===vn(Gr,rr===-1?0:di-rr)){if(rr===-1&&(rr=di),di-rr+1===qi)return rr*Ai}else rr!==-1&&(di-=di-rr),rr=-1}else for(ti+qi>Bi&&(ti=Bi-qi),di=ti;di>=0;di--){for(var on=!0,si=0;si<qi;si++)if(vn(ei,di+si)!==vn(Gr,si)){on=!1;break}if(on)return di}return-1}a.prototype.includes=function(Gr,ti,fi){return this.indexOf(Gr,ti,fi)!==-1},a.prototype.indexOf=function(Gr,ti,fi){return J(this,Gr,ti,fi,!0)},a.prototype.lastIndexOf=function(Gr,ti,fi){return J(this,Gr,ti,fi,!1)};function Qe(ei,Gr,ti,fi){ti=Number(ti)||0;var bi=ei.length-ti;fi?(fi=Number(fi),fi>bi&&(fi=bi)):fi=bi;var Ai=Gr.length;fi>Ai/2&&(fi=Ai/2);for(var Bi=0;Bi<fi;++Bi){var qi=parseInt(Gr.substr(Bi*2,2),16);if(mi(qi))return Bi;ei[ti+Bi]=qi}return Bi}function kt(ei,Gr,ti,fi){return jr(ri(Gr,ei.length-ti),ei,ti,fi)}function nr(ei,Gr,ti,fi){return jr(ui(Gr),ei,ti,fi)}function sr(ei,Gr,ti,fi){return jr(ar(Gr),ei,ti,fi)}function ce(ei,Gr,ti,fi){return jr(lr(Gr,ei.length-ti),ei,ti,fi)}a.prototype.write=function(Gr,ti,fi,bi){if(ti===void 0)bi="utf8",fi=this.length,ti=0;else if(fi===void 0&&typeof ti=="string")bi=ti,fi=this.length,ti=0;else if(isFinite(ti))ti=ti>>>0,isFinite(fi)?(fi=fi>>>0,bi===void 0&&(bi="utf8")):(bi=fi,fi=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ai=this.length-ti;if((fi===void 0||fi>Ai)&&(fi=Ai),Gr.length>0&&(fi<0||ti<0)||ti>this.length)throw new RangeError("Attempt to write outside buffer bounds");bi||(bi="utf8");for(var Bi=!1;;)switch(bi){case"hex":return Qe(this,Gr,ti,fi);case"utf8":case"utf-8":return kt(this,Gr,ti,fi);case"ascii":case"latin1":case"binary":return nr(this,Gr,ti,fi);case"base64":return sr(this,Gr,ti,fi);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,Gr,ti,fi);default:if(Bi)throw new TypeError("Unknown encoding: "+bi);bi=(""+bi).toLowerCase(),Bi=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ze(ei,Gr,ti){return Gr===0&&ti===ei.length?t.fromByteArray(ei):t.fromByteArray(ei.slice(Gr,ti))}function se(ei,Gr,ti){ti=Math.min(ei.length,ti);for(var fi=[],bi=Gr;bi<ti;){var Ai=ei[bi],Bi=null,qi=Ai>239?4:Ai>223?3:Ai>191?2:1;if(bi+qi<=ti){var vn,di,rr,on;switch(qi){case 1:Ai<128&&(Bi=Ai);break;case 2:vn=ei[bi+1],(vn&192)===128&&(on=(Ai&31)<<6|vn&63,on>127&&(Bi=on));break;case 3:vn=ei[bi+1],di=ei[bi+2],(vn&192)===128&&(di&192)===128&&(on=(Ai&15)<<12|(vn&63)<<6|di&63,on>2047&&(on<55296||on>57343)&&(Bi=on));break;case 4:vn=ei[bi+1],di=ei[bi+2],rr=ei[bi+3],(vn&192)===128&&(di&192)===128&&(rr&192)===128&&(on=(Ai&15)<<18|(vn&63)<<12|(di&63)<<6|rr&63,on>65535&&on<1114112&&(Bi=on))}}Bi===null?(Bi=65533,qi=1):Bi>65535&&(Bi-=65536,fi.push(Bi>>>10&1023|55296),Bi=56320|Bi&1023),fi.push(Bi),bi+=qi}return ur(fi)}var vt=4096;function ur(ei){var Gr=ei.length;if(Gr<=vt)return String.fromCharCode.apply(String,ei);for(var ti="",fi=0;fi<Gr;)ti+=String.fromCharCode.apply(String,ei.slice(fi,fi+=vt));return ti}function ue(ei,Gr,ti){var fi="";ti=Math.min(ei.length,ti);for(var bi=Gr;bi<ti;++bi)fi+=String.fromCharCode(ei[bi]&127);return fi}function bt(ei,Gr,ti){var fi="";ti=Math.min(ei.length,ti);for(var bi=Gr;bi<ti;++bi)fi+=String.fromCharCode(ei[bi]);return fi}function L(ei,Gr,ti){var fi=ei.length;(!Gr||Gr<0)&&(Gr=0),(!ti||ti<0||ti>fi)&&(ti=fi);for(var bi="",Ai=Gr;Ai<ti;++Ai)bi+=pi[ei[Ai]];return bi}function _(ei,Gr,ti){for(var fi=ei.slice(Gr,ti),bi="",Ai=0;Ai<fi.length-1;Ai+=2)bi+=String.fromCharCode(fi[Ai]+fi[Ai+1]*256);return bi}a.prototype.slice=function(Gr,ti){var fi=this.length;Gr=~~Gr,ti=ti===void 0?fi:~~ti,Gr<0?(Gr+=fi,Gr<0&&(Gr=0)):Gr>fi&&(Gr=fi),ti<0?(ti+=fi,ti<0&&(ti=0)):ti>fi&&(ti=fi),ti<Gr&&(ti=Gr);var bi=this.subarray(Gr,ti);return Object.setPrototypeOf(bi,a.prototype),bi};function F(ei,Gr,ti){if(ei%1!==0||ei<0)throw new RangeError("offset is not uint");if(ei+Gr>ti)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=this[Gr],Ai=1,Bi=0;++Bi<ti&&(Ai*=256);)bi+=this[Gr+Bi]*Ai;return bi},a.prototype.readUintBE=a.prototype.readUIntBE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=this[Gr+--ti],Ai=1;ti>0&&(Ai*=256);)bi+=this[Gr+--ti]*Ai;return bi},a.prototype.readUint8=a.prototype.readUInt8=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,1,this.length),this[Gr]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,2,this.length),this[Gr]|this[Gr+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,2,this.length),this[Gr]<<8|this[Gr+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),(this[Gr]|this[Gr+1]<<8|this[Gr+2]<<16)+this[Gr+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),this[Gr]*16777216+(this[Gr+1]<<16|this[Gr+2]<<8|this[Gr+3])},a.prototype.readIntLE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=this[Gr],Ai=1,Bi=0;++Bi<ti&&(Ai*=256);)bi+=this[Gr+Bi]*Ai;return Ai*=128,bi>=Ai&&(bi-=Math.pow(2,8*ti)),bi},a.prototype.readIntBE=function(Gr,ti,fi){Gr=Gr>>>0,ti=ti>>>0,fi||F(Gr,ti,this.length);for(var bi=ti,Ai=1,Bi=this[Gr+--bi];bi>0&&(Ai*=256);)Bi+=this[Gr+--bi]*Ai;return Ai*=128,Bi>=Ai&&(Bi-=Math.pow(2,8*ti)),Bi},a.prototype.readInt8=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,1,this.length),this[Gr]&128?(255-this[Gr]+1)*-1:this[Gr]},a.prototype.readInt16LE=function(Gr,ti){Gr=Gr>>>0,ti||F(Gr,2,this.length);var fi=this[Gr]|this[Gr+1]<<8;return fi&32768?fi|4294901760:fi},a.prototype.readInt16BE=function(Gr,ti){Gr=Gr>>>0,ti||F(Gr,2,this.length);var fi=this[Gr+1]|this[Gr]<<8;return fi&32768?fi|4294901760:fi},a.prototype.readInt32LE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),this[Gr]|this[Gr+1]<<8|this[Gr+2]<<16|this[Gr+3]<<24},a.prototype.readInt32BE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),this[Gr]<<24|this[Gr+1]<<16|this[Gr+2]<<8|this[Gr+3]},a.prototype.readFloatLE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),r.read(this,Gr,!0,23,4)},a.prototype.readFloatBE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,4,this.length),r.read(this,Gr,!1,23,4)},a.prototype.readDoubleLE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,8,this.length),r.read(this,Gr,!0,52,8)},a.prototype.readDoubleBE=function(Gr,ti){return Gr=Gr>>>0,ti||F(Gr,8,this.length),r.read(this,Gr,!1,52,8)};function k(ei,Gr,ti,fi,bi,Ai){if(!a.isBuffer(ei))throw new TypeError('"buffer" argument must be a Buffer instance');if(Gr>bi||Gr<Ai)throw new RangeError('"value" argument is out of bounds');if(ti+fi>ei.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,fi=fi>>>0,!bi){var Ai=Math.pow(2,8*fi)-1;k(this,Gr,ti,fi,Ai,0)}var Bi=1,qi=0;for(this[ti]=Gr&255;++qi<fi&&(Bi*=256);)this[ti+qi]=Gr/Bi&255;return ti+fi},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,fi=fi>>>0,!bi){var Ai=Math.pow(2,8*fi)-1;k(this,Gr,ti,fi,Ai,0)}var Bi=fi-1,qi=1;for(this[ti+Bi]=Gr&255;--Bi>=0&&(qi*=256);)this[ti+Bi]=Gr/qi&255;return ti+fi},a.prototype.writeUint8=a.prototype.writeUInt8=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,1,255,0),this[ti]=Gr&255,ti+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,65535,0),this[ti]=Gr&255,this[ti+1]=Gr>>>8,ti+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,65535,0),this[ti]=Gr>>>8,this[ti+1]=Gr&255,ti+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,4294967295,0),this[ti+3]=Gr>>>24,this[ti+2]=Gr>>>16,this[ti+1]=Gr>>>8,this[ti]=Gr&255,ti+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,4294967295,0),this[ti]=Gr>>>24,this[ti+1]=Gr>>>16,this[ti+2]=Gr>>>8,this[ti+3]=Gr&255,ti+4},a.prototype.writeIntLE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,!bi){var Ai=Math.pow(2,8*fi-1);k(this,Gr,ti,fi,Ai-1,-Ai)}var Bi=0,qi=1,vn=0;for(this[ti]=Gr&255;++Bi<fi&&(qi*=256);)Gr<0&&vn===0&&this[ti+Bi-1]!==0&&(vn=1),this[ti+Bi]=(Gr/qi>>0)-vn&255;return ti+fi},a.prototype.writeIntBE=function(Gr,ti,fi,bi){if(Gr=+Gr,ti=ti>>>0,!bi){var Ai=Math.pow(2,8*fi-1);k(this,Gr,ti,fi,Ai-1,-Ai)}var Bi=fi-1,qi=1,vn=0;for(this[ti+Bi]=Gr&255;--Bi>=0&&(qi*=256);)Gr<0&&vn===0&&this[ti+Bi+1]!==0&&(vn=1),this[ti+Bi]=(Gr/qi>>0)-vn&255;return ti+fi},a.prototype.writeInt8=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,1,127,-128),Gr<0&&(Gr=255+Gr+1),this[ti]=Gr&255,ti+1},a.prototype.writeInt16LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,32767,-32768),this[ti]=Gr&255,this[ti+1]=Gr>>>8,ti+2},a.prototype.writeInt16BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,2,32767,-32768),this[ti]=Gr>>>8,this[ti+1]=Gr&255,ti+2},a.prototype.writeInt32LE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,2147483647,-2147483648),this[ti]=Gr&255,this[ti+1]=Gr>>>8,this[ti+2]=Gr>>>16,this[ti+3]=Gr>>>24,ti+4},a.prototype.writeInt32BE=function(Gr,ti,fi){return Gr=+Gr,ti=ti>>>0,fi||k(this,Gr,ti,4,2147483647,-2147483648),Gr<0&&(Gr=4294967295+Gr+1),this[ti]=Gr>>>24,this[ti+1]=Gr>>>16,this[ti+2]=Gr>>>8,this[ti+3]=Gr&255,ti+4};function Ye(ei,Gr,ti,fi,bi,Ai){if(ti+fi>ei.length)throw new RangeError("Index out of range");if(ti<0)throw new RangeError("Index out of range")}function rn(ei,Gr,ti,fi,bi){return Gr=+Gr,ti=ti>>>0,bi||Ye(ei,Gr,ti,4),r.write(ei,Gr,ti,fi,23,4),ti+4}a.prototype.writeFloatLE=function(Gr,ti,fi){return rn(this,Gr,ti,!0,fi)},a.prototype.writeFloatBE=function(Gr,ti,fi){return rn(this,Gr,ti,!1,fi)};function ii(ei,Gr,ti,fi,bi){return Gr=+Gr,ti=ti>>>0,bi||Ye(ei,Gr,ti,8),r.write(ei,Gr,ti,fi,52,8),ti+8}a.prototype.writeDoubleLE=function(Gr,ti,fi){return ii(this,Gr,ti,!0,fi)},a.prototype.writeDoubleBE=function(Gr,ti,fi){return ii(this,Gr,ti,!1,fi)},a.prototype.copy=function(Gr,ti,fi,bi){if(!a.isBuffer(Gr))throw new TypeError("argument should be a Buffer");if(fi||(fi=0),!bi&&bi!==0&&(bi=this.length),ti>=Gr.length&&(ti=Gr.length),ti||(ti=0),bi>0&&bi<fi&&(bi=fi),bi===fi||Gr.length===0||this.length===0)return 0;if(ti<0)throw new RangeError("targetStart out of bounds");if(fi<0||fi>=this.length)throw new RangeError("Index out of range");if(bi<0)throw new RangeError("sourceEnd out of bounds");bi>this.length&&(bi=this.length),Gr.length-ti<bi-fi&&(bi=Gr.length-ti+fi);var Ai=bi-fi;return this===Gr&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ti,fi,bi):Uint8Array.prototype.set.call(Gr,this.subarray(fi,bi),ti),Ai},a.prototype.fill=function(Gr,ti,fi,bi){if(typeof Gr=="string"){if(typeof ti=="string"?(bi=ti,ti=0,fi=this.length):typeof fi=="string"&&(bi=fi,fi=this.length),bi!==void 0&&typeof bi!="string")throw new TypeError("encoding must be a string");if(typeof bi=="string"&&!a.isEncoding(bi))throw new TypeError("Unknown encoding: "+bi);if(Gr.length===1){var Ai=Gr.charCodeAt(0);(bi==="utf8"&&Ai<128||bi==="latin1")&&(Gr=Ai)}}else typeof Gr=="number"?Gr=Gr&255:typeof Gr=="boolean"&&(Gr=Number(Gr));if(ti<0||this.length<ti||this.length<fi)throw new RangeError("Out of range index");if(fi<=ti)return this;ti=ti>>>0,fi=fi===void 0?this.length:fi>>>0,Gr||(Gr=0);var Bi;if(typeof Gr=="number")for(Bi=ti;Bi<fi;++Bi)this[Bi]=Gr;else{var qi=a.isBuffer(Gr)?Gr:a.from(Gr,bi),vn=qi.length;if(vn===0)throw new TypeError('The value "'+Gr+'" is invalid for argument "value"');for(Bi=0;Bi<fi-ti;++Bi)this[Bi+ti]=qi[Bi%vn]}return this};var ai=/[^+/0-9A-Za-z-_]/g;function ni(ei){if(ei=ei.split("=")[0],ei=ei.trim().replace(ai,""),ei.length<2)return"";for(;ei.length%4!==0;)ei=ei+"=";return ei}function ri(ei,Gr){Gr=Gr||1/0;for(var ti,fi=ei.length,bi=null,Ai=[],Bi=0;Bi<fi;++Bi){if(ti=ei.charCodeAt(Bi),ti>55295&&ti<57344){if(!bi){if(ti>56319){(Gr-=3)>-1&&Ai.push(239,191,189);continue}else if(Bi+1===fi){(Gr-=3)>-1&&Ai.push(239,191,189);continue}bi=ti;continue}if(ti<56320){(Gr-=3)>-1&&Ai.push(239,191,189),bi=ti;continue}ti=(bi-55296<<10|ti-56320)+65536}else bi&&(Gr-=3)>-1&&Ai.push(239,191,189);if(bi=null,ti<128){if((Gr-=1)<0)break;Ai.push(ti)}else if(ti<2048){if((Gr-=2)<0)break;Ai.push(ti>>6|192,ti&63|128)}else if(ti<65536){if((Gr-=3)<0)break;Ai.push(ti>>12|224,ti>>6&63|128,ti&63|128)}else if(ti<1114112){if((Gr-=4)<0)break;Ai.push(ti>>18|240,ti>>12&63|128,ti>>6&63|128,ti&63|128)}else throw new Error("Invalid code point")}return Ai}function ui(ei){for(var Gr=[],ti=0;ti<ei.length;++ti)Gr.push(ei.charCodeAt(ti)&255);return Gr}function lr(ei,Gr){for(var ti,fi,bi,Ai=[],Bi=0;Bi<ei.length&&!((Gr-=2)<0);++Bi)ti=ei.charCodeAt(Bi),fi=ti>>8,bi=ti%256,Ai.push(bi),Ai.push(fi);return Ai}function ar(ei){return t.toByteArray(ni(ei))}function jr(ei,Gr,ti,fi){for(var bi=0;bi<fi&&!(bi+ti>=Gr.length||bi>=ei.length);++bi)Gr[bi+ti]=ei[bi];return bi}function ci(ei,Gr){return ei instanceof Gr||ei!=null&&ei.constructor!=null&&ei.constructor.name!=null&&ei.constructor.name===Gr.name}function mi(ei){return ei!==ei}var pi=(function(){for(var ei="0123456789abcdef",Gr=new Array(256),ti=0;ti<16;++ti)for(var fi=ti*16,bi=0;bi<16;++bi)Gr[fi+bi]=ei[ti]+ei[bi];return Gr})()})(buffer$2)),buffer$2}var bufferExports=requireBuffer$1(),process$1={exports:{}},hasRequiredProcess;function requireProcess(){return hasRequiredProcess||(hasRequiredProcess=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={exports:{}},n=r.exports={},o,i;function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=u}catch{o=u}try{typeof clearTimeout=="function"?i=clearTimeout:i=a}catch{i=a}})();function s(L){if(o===setTimeout)return setTimeout(L,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(L,0);try{return o(L,0)}catch{try{return o.call(null,L,0)}catch{return o.call(this,L,0)}}}function f(L){if(i===clearTimeout)return clearTimeout(L);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(L);try{return i(L)}catch{try{return i.call(null,L)}catch{return i.call(this,L)}}}var c=[],d=!1,p,h=-1;function y(){!d||!p||(d=!1,p.length?c=p.concat(c):h=-1,c.length&&b())}function b(){if(!d){var L=s(y);d=!0;for(var _=c.length;_;){for(p=c,c=[];++h<_;)p&&p[h].run();h=-1,_=c.length}p=null,d=!1,f(L)}}n.nextTick=function(L){var _=new Array(arguments.length-1);if(arguments.length>1)for(var F=1;F<arguments.length;F++)_[F-1]=arguments[F];c.push(new w(L,_)),c.length===1&&!d&&s(b)};function w(L,_){this.fun=L,this.array=_}w.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function S(){}n.on=S,n.addListener=S,n.once=S,n.off=S,n.removeListener=S,n.removeAllListeners=S,n.emit=S,n.prependListener=S,n.prependOnceListener=S,n.listeners=function(L){return[]},n.binding=function(L){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(L){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};function E(){}var B=r.exports.browser,ae=E,W=r.exports.binding,J=E,ve=1,Qe={},kt=E,nr=E,sr=E,ce=E,Ze=E,se="browser",vt="browser",ur="browser",ue=[],bt={nextTick:r.exports.nextTick,title:r.exports.title,browser:B,env:r.exports.env,argv:r.exports.argv,version:r.exports.version,versions:r.exports.versions,on:r.exports.on,addListener:r.exports.addListener,once:r.exports.once,off:r.exports.off,removeListener:r.exports.removeListener,removeAllListeners:r.exports.removeAllListeners,emit:r.exports.emit,emitWarning:ae,prependListener:r.exports.prependListener,prependOnceListener:r.exports.prependOnceListener,listeners:r.exports.listeners,binding:W,cwd:r.exports.cwd,chdir:r.exports.chdir,umask:r.exports.umask,exit:J,pid:ve,features:Qe,kill:kt,dlopen:nr,uptime:sr,memoryUsage:ce,uvCounters:Ze,platform:se,arch:vt,execPath:ur,execArgv:ue};t.addListener=r.exports.addListener,t.arch=vt,t.argv=r.exports.argv,t.binding=W,t.browser=B,t.chdir=r.exports.chdir,t.cwd=r.exports.cwd,t.default=bt,t.dlopen=nr,t.emit=r.exports.emit,t.emitWarning=ae,t.env=r.exports.env,t.execArgv=ue,t.execPath=ur,t.exit=J,t.features=Qe,t.kill=kt,t.listeners=r.exports.listeners,t.memoryUsage=ce,t.nextTick=r.exports.nextTick,t.off=r.exports.off,t.on=r.exports.on,t.once=r.exports.once,t.pid=ve,t.platform=se,t.prependListener=r.exports.prependListener,t.prependOnceListener=r.exports.prependOnceListener,t.removeAllListeners=r.exports.removeAllListeners,t.removeListener=r.exports.removeListener,t.title=r.exports.title,t.umask=r.exports.umask,t.uptime=sr,t.uvCounters=Ze,t.version=r.exports.version,t.versions=r.exports.versions,t=e.exports=bt})(process$1,process$1.exports)),process$1.exports}var processExports=requireProcess();const process=getDefaultExportFromCjs(processExports);var _globalThis=(function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r})(Object),_global=_globalThis,react_production={},hasRequiredReact_production;function requireReact_production(){if(hasRequiredReact_production)return react_production;hasRequiredReact_production=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),u=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function h(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function S(F,k,Ye){this.props=F,this.context=k,this.refs=w,this.updater=Ye||y}S.prototype.isReactComponent={},S.prototype.setState=function(F,k){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,k,"setState")},S.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function E(){}E.prototype=S.prototype;function B(F,k,Ye){this.props=F,this.context=k,this.refs=w,this.updater=Ye||y}var ae=B.prototype=new E;ae.constructor=B,b(ae,S.prototype),ae.isPureReactComponent=!0;var W=Array.isArray;function J(){}var ve={H:null,A:null,T:null,S:null},Qe=Object.prototype.hasOwnProperty;function kt(F,k,Ye){var rn=Ye.ref;return{$$typeof:e,type:F,key:k,ref:rn!==void 0?rn:null,props:Ye}}function nr(F,k){return kt(F.type,k,F.props)}function sr(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function ce(F){var k={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(Ye){return k[Ye]})}var Ze=/\/+/g;function se(F,k){return typeof F=="object"&&F!==null&&F.key!=null?ce(""+F.key):k.toString(36)}function vt(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(J,J):(F.status="pending",F.then(function(k){F.status==="pending"&&(F.status="fulfilled",F.value=k)},function(k){F.status==="pending"&&(F.status="rejected",F.reason=k)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function ur(F,k,Ye,rn,ii){var ai=typeof F;(ai==="undefined"||ai==="boolean")&&(F=null);var ni=!1;if(F===null)ni=!0;else switch(ai){case"bigint":case"string":case"number":ni=!0;break;case"object":switch(F.$$typeof){case e:case t:ni=!0;break;case c:return ni=F._init,ur(ni(F._payload),k,Ye,rn,ii)}}if(ni)return ii=ii(F),ni=rn===""?"."+se(F,0):rn,W(ii)?(Ye="",ni!=null&&(Ye=ni.replace(Ze,"$&/")+"/"),ur(ii,k,Ye,"",function(lr){return lr})):ii!=null&&(sr(ii)&&(ii=nr(ii,Ye+(ii.key==null||F&&F.key===ii.key?"":(""+ii.key).replace(Ze,"$&/")+"/")+ni)),k.push(ii)),1;ni=0;var ri=rn===""?".":rn+":";if(W(F))for(var ui=0;ui<F.length;ui++)rn=F[ui],ai=ri+se(rn,ui),ni+=ur(rn,k,Ye,ai,ii);else if(ui=h(F),typeof ui=="function")for(F=ui.call(F),ui=0;!(rn=F.next()).done;)rn=rn.value,ai=ri+se(rn,ui++),ni+=ur(rn,k,Ye,ai,ii);else if(ai==="object"){if(typeof F.then=="function")return ur(vt(F),k,Ye,rn,ii);throw k=String(F),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return ni}function ue(F,k,Ye){if(F==null)return F;var rn=[],ii=0;return ur(F,rn,"","",function(ai){return k.call(Ye,ai,ii++)}),rn}function bt(F){if(F._status===-1){var k=F._result;k=k(),k.then(function(Ye){(F._status===0||F._status===-1)&&(F._status=1,F._result=Ye)},function(Ye){(F._status===0||F._status===-1)&&(F._status=2,F._result=Ye)}),F._status===-1&&(F._status=0,F._result=k)}if(F._status===1)return F._result.default;throw F._result}var L=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},_={map:ue,forEach:function(F,k,Ye){ue(F,function(){k.apply(this,arguments)},Ye)},count:function(F){var k=0;return ue(F,function(){k++}),k},toArray:function(F){return ue(F,function(k){return k})||[]},only:function(F){if(!sr(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return react_production.Activity=d,react_production.Children=_,react_production.Component=S,react_production.Fragment=r,react_production.Profiler=o,react_production.PureComponent=B,react_production.StrictMode=n,react_production.Suspense=s,react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ve,react_production.__COMPILER_RUNTIME={__proto__:null,c:function(F){return ve.H.useMemoCache(F)}},react_production.cache=function(F){return function(){return F.apply(null,arguments)}},react_production.cacheSignal=function(){return null},react_production.cloneElement=function(F,k,Ye){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var rn=b({},F.props),ii=F.key;if(k!=null)for(ai in k.key!==void 0&&(ii=""+k.key),k)!Qe.call(k,ai)||ai==="key"||ai==="__self"||ai==="__source"||ai==="ref"&&k.ref===void 0||(rn[ai]=k[ai]);var ai=arguments.length-2;if(ai===1)rn.children=Ye;else if(1<ai){for(var ni=Array(ai),ri=0;ri<ai;ri++)ni[ri]=arguments[ri+2];rn.children=ni}return kt(F.type,ii,rn)},react_production.createContext=function(F){return F={$$typeof:u,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:i,_context:F},F},react_production.createElement=function(F,k,Ye){var rn,ii={},ai=null;if(k!=null)for(rn in k.key!==void 0&&(ai=""+k.key),k)Qe.call(k,rn)&&rn!=="key"&&rn!=="__self"&&rn!=="__source"&&(ii[rn]=k[rn]);var ni=arguments.length-2;if(ni===1)ii.children=Ye;else if(1<ni){for(var ri=Array(ni),ui=0;ui<ni;ui++)ri[ui]=arguments[ui+2];ii.children=ri}if(F&&F.defaultProps)for(rn in ni=F.defaultProps,ni)ii[rn]===void 0&&(ii[rn]=ni[rn]);return kt(F,ai,ii)},react_production.createRef=function(){return{current:null}},react_production.forwardRef=function(F){return{$$typeof:a,render:F}},react_production.isValidElement=sr,react_production.lazy=function(F){return{$$typeof:c,_payload:{_status:-1,_result:F},_init:bt}},react_production.memo=function(F,k){return{$$typeof:f,type:F,compare:k===void 0?null:k}},react_production.startTransition=function(F){var k=ve.T,Ye={};ve.T=Ye;try{var rn=F(),ii=ve.S;ii!==null&&ii(Ye,rn),typeof rn=="object"&&rn!==null&&typeof rn.then=="function"&&rn.then(J,L)}catch(ai){L(ai)}finally{k!==null&&Ye.types!==null&&(k.types=Ye.types),ve.T=k}},react_production.unstable_useCacheRefresh=function(){return ve.H.useCacheRefresh()},react_production.use=function(F){return ve.H.use(F)},react_production.useActionState=function(F,k,Ye){return ve.H.useActionState(F,k,Ye)},react_production.useCallback=function(F,k){return ve.H.useCallback(F,k)},react_production.useContext=function(F){return ve.H.useContext(F)},react_production.useDebugValue=function(){},react_production.useDeferredValue=function(F,k){return ve.H.useDeferredValue(F,k)},react_production.useEffect=function(F,k){return ve.H.useEffect(F,k)},react_production.useEffectEvent=function(F){return ve.H.useEffectEvent(F)},react_production.useId=function(){return ve.H.useId()},react_production.useImperativeHandle=function(F,k,Ye){return ve.H.useImperativeHandle(F,k,Ye)},react_production.useInsertionEffect=function(F,k){return ve.H.useInsertionEffect(F,k)},react_production.useLayoutEffect=function(F,k){return ve.H.useLayoutEffect(F,k)},react_production.useMemo=function(F,k){return ve.H.useMemo(F,k)},react_production.useOptimistic=function(F,k){return ve.H.useOptimistic(F,k)},react_production.useReducer=function(F,k,Ye){return ve.H.useReducer(F,k,Ye)},react_production.useRef=function(F){return ve.H.useRef(F)},react_production.useState=function(F){return ve.H.useState(F)},react_production.useSyncExternalStore=function(F,k,Ye){return ve.H.useSyncExternalStore(F,k,Ye)},react_production.useTransition=function(){return ve.H.useTransition()},react_production.version="19.2.4",react_production}var hasRequiredReact;function requireReact(){return hasRequiredReact||(hasRequiredReact=1,react.exports=requireReact_production()),react.exports}var reactExports=requireReact(),client={exports:{}},reactDomClient_production={},scheduler={exports:{}},scheduler_production={};/**
15
15
  * @license React
16
16
  * scheduler.production.js
17
17
  *
@@ -27,7 +27,7 @@ var L4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var q4=L4((export
27
27
  *
28
28
  * This source code is licensed under the MIT license found in the
29
29
  * LICENSE file in the root directory of this source tree.
30
- */var hasRequiredReactDom_production;function requireReactDom_production(){if(hasRequiredReactDom_production)return reactDom_production;hasRequiredReactDom_production=1;var e=requireReact();function t(s){var f="https://react.dev/errors/"+s;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)f+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function i(s,f,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:d==null?null:""+d,children:s,containerInfo:f,implementation:c}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(s,f){if(s==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,reactDom_production.createPortal=function(s,f){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(s,f,null,c)},reactDom_production.flushSync=function(s){var f=u.T,c=n.p;try{if(u.T=null,n.p=2,s)return s()}finally{u.T=f,n.p=c,n.d.f()}},reactDom_production.preconnect=function(s,f){typeof s=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,n.d.C(s,f))},reactDom_production.prefetchDNS=function(s){typeof s=="string"&&n.d.D(s)},reactDom_production.preinit=function(s,f){if(typeof s=="string"&&f&&typeof f.as=="string"){var c=f.as,d=a(c,f.crossOrigin),p=typeof f.integrity=="string"?f.integrity:void 0,h=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;c==="style"?n.d.S(s,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:p,fetchPriority:h}):c==="script"&&n.d.X(s,{crossOrigin:d,integrity:p,fetchPriority:h,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},reactDom_production.preinitModule=function(s,f){if(typeof s=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var c=a(f.as,f.crossOrigin);n.d.M(s,{crossOrigin:c,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&n.d.M(s)},reactDom_production.preload=function(s,f){if(typeof s=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var c=f.as,d=a(c,f.crossOrigin);n.d.L(s,c,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},reactDom_production.preloadModule=function(s,f){if(typeof s=="string")if(f){var c=a(f.as,f.crossOrigin);n.d.m(s,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:c,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else n.d.m(s)},reactDom_production.requestFormReset=function(s){n.d.r(s)},reactDom_production.unstable_batchedUpdates=function(s,f){return s(f)},reactDom_production.useFormState=function(s,f,c){return u.H.useFormState(s,f,c)},reactDom_production.useFormStatus=function(){return u.H.useHostTransitionStatus()},reactDom_production.version="19.2.3",reactDom_production}var hasRequiredReactDom;function requireReactDom(){if(hasRequiredReactDom)return reactDom.exports;hasRequiredReactDom=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),reactDom.exports=requireReactDom_production(),reactDom.exports}var hasRequiredReactDomClient_production;function requireReactDomClient_production(){if(hasRequiredReactDomClient_production)return reactDomClient_production;hasRequiredReactDomClient_production=1;var e=requireScheduler(),t=requireReact(),r=requireReactDom();function n(l){var m="https://react.dev/errors/"+l;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var ie=2;ie<arguments.length;ie++)m+="&args[]="+encodeURIComponent(arguments[ie])}return"Minified React error #"+l+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function i(l){var m=l,ie=l;if(l.alternate)for(;m.return;)m=m.return;else{l=m;do m=l,(m.flags&4098)!==0&&(ie=m.return),l=m.return;while(l)}return m.tag===3?ie:null}function u(l){if(l.tag===13){var m=l.memoizedState;if(m===null&&(l=l.alternate,l!==null&&(m=l.memoizedState)),m!==null)return m.dehydrated}return null}function a(l){if(l.tag===31){var m=l.memoizedState;if(m===null&&(l=l.alternate,l!==null&&(m=l.memoizedState)),m!==null)return m.dehydrated}return null}function s(l){if(i(l)!==l)throw Error(n(188))}function f(l){var m=l.alternate;if(!m){if(m=i(l),m===null)throw Error(n(188));return m!==l?null:l}for(var ie=l,ir=m;;){var oi=ie.return;if(oi===null)break;var li=oi.alternate;if(li===null){if(ir=oi.return,ir!==null){ie=ir;continue}break}if(oi.child===li.child){for(li=oi.child;li;){if(li===ie)return s(oi),l;if(li===ir)return s(oi),m;li=li.sibling}throw Error(n(188))}if(ie.return!==ir.return)ie=oi,ir=li;else{for(var Ti=!1,Ki=oi.child;Ki;){if(Ki===ie){Ti=!0,ie=oi,ir=li;break}if(Ki===ir){Ti=!0,ir=oi,ie=li;break}Ki=Ki.sibling}if(!Ti){for(Ki=li.child;Ki;){if(Ki===ie){Ti=!0,ie=li,ir=oi;break}if(Ki===ir){Ti=!0,ir=li,ie=oi;break}Ki=Ki.sibling}if(!Ti)throw Error(n(189))}}if(ie.alternate!==ir)throw Error(n(190))}if(ie.tag!==3)throw Error(n(188));return ie.stateNode.current===ie?l:m}function c(l){var m=l.tag;if(m===5||m===26||m===27||m===6)return l;for(l=l.child;l!==null;){if(m=c(l),m!==null)return m;l=l.sibling}return null}var d=Object.assign,p=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),B=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ve=Symbol.for("react.memo"),Qe=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),nr=Symbol.for("react.memo_cache_sentinel"),sr=Symbol.iterator;function ce(l){return l===null||typeof l!="object"?null:(l=sr&&l[sr]||l["@@iterator"],typeof l=="function"?l:null)}var Ze=Symbol.for("react.client.reference");function se(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Ze?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case b:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case W:return"Suspense";case J:return"SuspenseList";case kt:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case y:return"Portal";case B:return l.displayName||"Context";case E:return(l._context.displayName||"Context")+".Consumer";case ae:var m=l.render;return l=l.displayName,l||(l=m.displayName||m.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case ve:return m=l.displayName||null,m!==null?m:se(l.type)||"Memo";case Qe:m=l._payload,l=l._init;try{return se(l(m))}catch{}}return null}var vt=Array.isArray,ur=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bt={pending:!1,data:null,method:null,action:null},L=[],_=-1;function F(l){return{current:l}}function k(l){0>_||(l.current=L[_],L[_]=null,_--)}function Ye(l,m){_++,L[_]=l.current,l.current=m}var rn=F(null),ii=F(null),ai=F(null),ni=F(null);function ri(l,m){switch(Ye(ai,m),Ye(ii,l),Ye(rn,null),m.nodeType){case 9:case 11:l=(l=m.documentElement)&&(l=l.namespaceURI)?r8(l):0;break;default:if(l=m.tagName,m=m.namespaceURI)m=r8(m),l=n8(m,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}k(rn),Ye(rn,l)}function ui(){k(rn),k(ii),k(ai)}function lr(l){l.memoizedState!==null&&Ye(ni,l);var m=rn.current,ie=n8(m,l.type);m!==ie&&(Ye(ii,l),Ye(rn,ie))}function ar(l){ii.current===l&&(k(rn),k(ii)),ni.current===l&&(k(ni),Gb._currentValue=bt)}var jr,ci;function mi(l){if(jr===void 0)try{throw Error()}catch(ie){var m=ie.stack.trim().match(/\n( *(at )?)/);jr=m&&m[1]||"",ci=-1<ie.stack.indexOf(`
30
+ */var hasRequiredReactDom_production;function requireReactDom_production(){if(hasRequiredReactDom_production)return reactDom_production;hasRequiredReactDom_production=1;var e=requireReact();function t(s){var f="https://react.dev/errors/"+s;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)f+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function i(s,f,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:d==null?null:""+d,children:s,containerInfo:f,implementation:c}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(s,f){if(s==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,reactDom_production.createPortal=function(s,f){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(s,f,null,c)},reactDom_production.flushSync=function(s){var f=u.T,c=n.p;try{if(u.T=null,n.p=2,s)return s()}finally{u.T=f,n.p=c,n.d.f()}},reactDom_production.preconnect=function(s,f){typeof s=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,n.d.C(s,f))},reactDom_production.prefetchDNS=function(s){typeof s=="string"&&n.d.D(s)},reactDom_production.preinit=function(s,f){if(typeof s=="string"&&f&&typeof f.as=="string"){var c=f.as,d=a(c,f.crossOrigin),p=typeof f.integrity=="string"?f.integrity:void 0,h=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;c==="style"?n.d.S(s,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:p,fetchPriority:h}):c==="script"&&n.d.X(s,{crossOrigin:d,integrity:p,fetchPriority:h,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},reactDom_production.preinitModule=function(s,f){if(typeof s=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var c=a(f.as,f.crossOrigin);n.d.M(s,{crossOrigin:c,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&n.d.M(s)},reactDom_production.preload=function(s,f){if(typeof s=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var c=f.as,d=a(c,f.crossOrigin);n.d.L(s,c,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},reactDom_production.preloadModule=function(s,f){if(typeof s=="string")if(f){var c=a(f.as,f.crossOrigin);n.d.m(s,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:c,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else n.d.m(s)},reactDom_production.requestFormReset=function(s){n.d.r(s)},reactDom_production.unstable_batchedUpdates=function(s,f){return s(f)},reactDom_production.useFormState=function(s,f,c){return u.H.useFormState(s,f,c)},reactDom_production.useFormStatus=function(){return u.H.useHostTransitionStatus()},reactDom_production.version="19.2.4",reactDom_production}var hasRequiredReactDom;function requireReactDom(){if(hasRequiredReactDom)return reactDom.exports;hasRequiredReactDom=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),reactDom.exports=requireReactDom_production(),reactDom.exports}var hasRequiredReactDomClient_production;function requireReactDomClient_production(){if(hasRequiredReactDomClient_production)return reactDomClient_production;hasRequiredReactDomClient_production=1;var e=requireScheduler(),t=requireReact(),r=requireReactDom();function n(l){var m="https://react.dev/errors/"+l;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var ie=2;ie<arguments.length;ie++)m+="&args[]="+encodeURIComponent(arguments[ie])}return"Minified React error #"+l+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function i(l){var m=l,ie=l;if(l.alternate)for(;m.return;)m=m.return;else{l=m;do m=l,(m.flags&4098)!==0&&(ie=m.return),l=m.return;while(l)}return m.tag===3?ie:null}function u(l){if(l.tag===13){var m=l.memoizedState;if(m===null&&(l=l.alternate,l!==null&&(m=l.memoizedState)),m!==null)return m.dehydrated}return null}function a(l){if(l.tag===31){var m=l.memoizedState;if(m===null&&(l=l.alternate,l!==null&&(m=l.memoizedState)),m!==null)return m.dehydrated}return null}function s(l){if(i(l)!==l)throw Error(n(188))}function f(l){var m=l.alternate;if(!m){if(m=i(l),m===null)throw Error(n(188));return m!==l?null:l}for(var ie=l,ir=m;;){var oi=ie.return;if(oi===null)break;var li=oi.alternate;if(li===null){if(ir=oi.return,ir!==null){ie=ir;continue}break}if(oi.child===li.child){for(li=oi.child;li;){if(li===ie)return s(oi),l;if(li===ir)return s(oi),m;li=li.sibling}throw Error(n(188))}if(ie.return!==ir.return)ie=oi,ir=li;else{for(var Ti=!1,Ki=oi.child;Ki;){if(Ki===ie){Ti=!0,ie=oi,ir=li;break}if(Ki===ir){Ti=!0,ir=oi,ie=li;break}Ki=Ki.sibling}if(!Ti){for(Ki=li.child;Ki;){if(Ki===ie){Ti=!0,ie=li,ir=oi;break}if(Ki===ir){Ti=!0,ir=li,ie=oi;break}Ki=Ki.sibling}if(!Ti)throw Error(n(189))}}if(ie.alternate!==ir)throw Error(n(190))}if(ie.tag!==3)throw Error(n(188));return ie.stateNode.current===ie?l:m}function c(l){var m=l.tag;if(m===5||m===26||m===27||m===6)return l;for(l=l.child;l!==null;){if(m=c(l),m!==null)return m;l=l.sibling}return null}var d=Object.assign,p=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),B=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ve=Symbol.for("react.memo"),Qe=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),nr=Symbol.for("react.memo_cache_sentinel"),sr=Symbol.iterator;function ce(l){return l===null||typeof l!="object"?null:(l=sr&&l[sr]||l["@@iterator"],typeof l=="function"?l:null)}var Ze=Symbol.for("react.client.reference");function se(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Ze?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case b:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case W:return"Suspense";case J:return"SuspenseList";case kt:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case y:return"Portal";case B:return l.displayName||"Context";case E:return(l._context.displayName||"Context")+".Consumer";case ae:var m=l.render;return l=l.displayName,l||(l=m.displayName||m.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case ve:return m=l.displayName||null,m!==null?m:se(l.type)||"Memo";case Qe:m=l._payload,l=l._init;try{return se(l(m))}catch{}}return null}var vt=Array.isArray,ur=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,bt={pending:!1,data:null,method:null,action:null},L=[],_=-1;function F(l){return{current:l}}function k(l){0>_||(l.current=L[_],L[_]=null,_--)}function Ye(l,m){_++,L[_]=l.current,l.current=m}var rn=F(null),ii=F(null),ai=F(null),ni=F(null);function ri(l,m){switch(Ye(ai,m),Ye(ii,l),Ye(rn,null),m.nodeType){case 9:case 11:l=(l=m.documentElement)&&(l=l.namespaceURI)?r8(l):0;break;default:if(l=m.tagName,m=m.namespaceURI)m=r8(m),l=n8(m,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}k(rn),Ye(rn,l)}function ui(){k(rn),k(ii),k(ai)}function lr(l){l.memoizedState!==null&&Ye(ni,l);var m=rn.current,ie=n8(m,l.type);m!==ie&&(Ye(ii,l),Ye(rn,ie))}function ar(l){ii.current===l&&(k(rn),k(ii)),ni.current===l&&(k(ni),Gb._currentValue=bt)}var jr,ci;function mi(l){if(jr===void 0)try{throw Error()}catch(ie){var m=ie.stack.trim().match(/\n( *(at )?)/);jr=m&&m[1]||"",ci=-1<ie.stack.indexOf(`
31
31
  at`)?" (<anonymous>)":-1<ie.stack.indexOf("@")?"@unknown:0:0":""}return`
32
32
  `+jr+l+ci}var pi=!1;function ei(l,m){if(!l||pi)return"";pi=!0;var ie=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var ir={DetermineComponentFrameRoot:function(){try{if(m){var Vo=function(){throw Error()};if(Object.defineProperty(Vo.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Vo,[])}catch(Bo){var So=Bo}Reflect.construct(l,[],Vo)}else{try{Vo.call()}catch(Bo){So=Bo}l.call(Vo.prototype)}}else{try{throw Error()}catch(Bo){So=Bo}(Vo=l())&&typeof Vo.catch=="function"&&Vo.catch(function(){})}}catch(Bo){if(Bo&&So&&typeof Bo.stack=="string")return[Bo.stack,So.stack]}return[null,null]}};ir.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var oi=Object.getOwnPropertyDescriptor(ir.DetermineComponentFrameRoot,"name");oi&&oi.configurable&&Object.defineProperty(ir.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var li=ir.DetermineComponentFrameRoot(),Ti=li[0],Ki=li[1];if(Ti&&Ki){var to=Ti.split(`
33
33
  `),go=Ki.split(`
@@ -35,15 +35,15 @@ var L4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var q4=L4((export
35
35
  `+to[ir].replace(" at new "," at ");return l.displayName&&ko.includes("<anonymous>")&&(ko=ko.replace("<anonymous>",l.displayName)),ko}while(1<=ir&&0<=oi);break}}}finally{pi=!1,Error.prepareStackTrace=ie}return(ie=l?l.displayName||l.name:"")?mi(ie):""}function Gr(l,m){switch(l.tag){case 26:case 27:case 5:return mi(l.type);case 16:return mi("Lazy");case 13:return l.child!==m&&m!==null?mi("Suspense Fallback"):mi("Suspense");case 19:return mi("SuspenseList");case 0:case 15:return ei(l.type,!1);case 11:return ei(l.type.render,!1);case 1:return ei(l.type,!0);case 31:return mi("Activity");default:return""}}function ti(l){try{var m="",ie=null;do m+=Gr(l,ie),ie=l,l=l.return;while(l);return m}catch(ir){return`
36
36
  Error generating stack: `+ir.message+`
37
37
  `+ir.stack}}var fi=Object.prototype.hasOwnProperty,bi=e.unstable_scheduleCallback,Ai=e.unstable_cancelCallback,Bi=e.unstable_shouldYield,qi=e.unstable_requestPaint,vn=e.unstable_now,di=e.unstable_getCurrentPriorityLevel,rr=e.unstable_ImmediatePriority,on=e.unstable_UserBlockingPriority,si=e.unstable_NormalPriority,vi=e.unstable_LowPriority,Ei=e.unstable_IdlePriority,Mi=e.log,Di=e.unstable_setDisableYieldValue,Ii=null,Ci=null;function Vi(l){if(typeof Mi=="function"&&Di(l),Ci&&typeof Ci.setStrictMode=="function")try{Ci.setStrictMode(Ii,l)}catch{}}var Hi=Math.clz32?Math.clz32:co,Ji=Math.log,no=Math.LN2;function co(l){return l>>>=0,l===0?32:31-(Ji(l)/no|0)|0}var Fo=256,Io=262144,Ro=4194304;function Oo(l){var m=l&42;if(m!==0)return m;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function To(l,m,ie){var ir=l.pendingLanes;if(ir===0)return 0;var oi=0,li=l.suspendedLanes,Ti=l.pingedLanes;l=l.warmLanes;var Ki=ir&134217727;return Ki!==0?(ir=Ki&~li,ir!==0?oi=Oo(ir):(Ti&=Ki,Ti!==0?oi=Oo(Ti):ie||(ie=Ki&~l,ie!==0&&(oi=Oo(ie))))):(Ki=ir&~li,Ki!==0?oi=Oo(Ki):Ti!==0?oi=Oo(Ti):ie||(ie=ir&~l,ie!==0&&(oi=Oo(ie)))),oi===0?0:m!==0&&m!==oi&&(m&li)===0&&(li=oi&-oi,ie=m&-m,li>=ie||li===32&&(ie&4194048)!==0)?m:oi}function Po(l,m){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&m)===0}function ia(l,m){switch(l){case 1:case 2:case 4:case 8:case 64:return m+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return m+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jo(){var l=Ro;return Ro<<=1,(Ro&62914560)===0&&(Ro=4194304),l}function ea(l){for(var m=[],ie=0;31>ie;ie++)m.push(l);return m}function zi(l,m){l.pendingLanes|=m,m!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Gi(l,m,ie,ir,oi,li){var Ti=l.pendingLanes;l.pendingLanes=ie,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=ie,l.entangledLanes&=ie,l.errorRecoveryDisabledLanes&=ie,l.shellSuspendCounter=0;var Ki=l.entanglements,to=l.expirationTimes,go=l.hiddenUpdates;for(ie=Ti&~ie;0<ie;){var ko=31-Hi(ie),Vo=1<<ko;Ki[ko]=0,to[ko]=-1;var So=go[ko];if(So!==null)for(go[ko]=null,ko=0;ko<So.length;ko++){var Bo=So[ko];Bo!==null&&(Bo.lane&=-536870913)}ie&=~Vo}ir!==0&&uo(l,ir,0),li!==0&&oi===0&&l.tag!==0&&(l.suspendedLanes|=li&~(Ti&~m))}function uo(l,m,ie){l.pendingLanes|=m,l.suspendedLanes&=~m;var ir=31-Hi(m);l.entangledLanes|=m,l.entanglements[ir]=l.entanglements[ir]|1073741824|ie&261930}function wo(l,m){var ie=l.entangledLanes|=m;for(l=l.entanglements;ie;){var ir=31-Hi(ie),oi=1<<ir;oi&m|l[ir]&m&&(l[ir]|=m),ie&=~oi}}function xi(l,m){var ie=m&-m;return ie=(ie&42)!==0?1:Fi(ie),(ie&(l.suspendedLanes|m))!==0?0:ie}function Fi(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Ui(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function gi(){var l=ue.p;return l!==0?l:(l=window.event,l===void 0?32:T8(l.type))}function Li(l,m){var ie=ue.p;try{return ue.p=l,m()}finally{ue.p=ie}}var Qi=Math.random().toString(36).slice(2),Wi="__reactFiber$"+Qi,io="__reactProps$"+Qi,lo="__reactContainer$"+Qi,Ao="__reactEvents$"+Qi,_o="__reactListeners$"+Qi,ca="__reactHandles$"+Qi,Co="__reactResources$"+Qi,$o="__reactMarker$"+Qi;function ta(l){delete l[Wi],delete l[io],delete l[Ao],delete l[_o],delete l[ca]}function sa(l){var m=l[Wi];if(m)return m;for(var ie=l.parentNode;ie;){if(m=ie[lo]||ie[Wi]){if(ie=m.alternate,m.child!==null||ie!==null&&ie.child!==null)for(l=l8(l);l!==null;){if(ie=l[Wi])return ie;l=l8(l)}return m}l=ie,ie=l.parentNode}return null}function ga(l){if(l=l[Wi]||l[lo]){var m=l.tag;if(m===5||m===6||m===13||m===31||m===26||m===27||m===3)return l}return null}function ya(l){var m=l.tag;if(m===5||m===26||m===27||m===6)return l.stateNode;throw Error(n(33))}function ma(l){var m=l[Co];return m||(m=l[Co]={hoistableStyles:new Map,hoistableScripts:new Map}),m}function fa(l){l[$o]=!0}var ra=new Set,ha={};function Wo(l,m){na(l,m),na(l+"Capture",m)}function na(l,m){for(ha[l]=m,l=0;l<m.length;l++)ra.add(m[l])}var la=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yo={},ho={};function yo(l){return fi.call(ho,l)?!0:fi.call(Yo,l)?!1:la.test(l)?ho[l]=!0:(Yo[l]=!0,!1)}function No(l,m,ie){if(yo(m))if(ie===null)l.removeAttribute(m);else{switch(typeof ie){case"undefined":case"function":case"symbol":l.removeAttribute(m);return;case"boolean":var ir=m.toLowerCase().slice(0,5);if(ir!=="data-"&&ir!=="aria-"){l.removeAttribute(m);return}}l.setAttribute(m,""+ie)}}function vo(l,m,ie){if(ie===null)l.removeAttribute(m);else{switch(typeof ie){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(m);return}l.setAttribute(m,""+ie)}}function bo(l,m,ie,ir){if(ir===null)l.removeAttribute(ie);else{switch(typeof ir){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(ie);return}l.setAttributeNS(m,ie,""+ir)}}function Uo(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Aa(l){var m=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(m==="checkbox"||m==="radio")}function Ua(l,m,ie){var ir=Object.getOwnPropertyDescriptor(l.constructor.prototype,m);if(!l.hasOwnProperty(m)&&typeof ir<"u"&&typeof ir.get=="function"&&typeof ir.set=="function"){var oi=ir.get,li=ir.set;return Object.defineProperty(l,m,{configurable:!0,get:function(){return oi.call(this)},set:function(Ti){ie=""+Ti,li.call(this,Ti)}}),Object.defineProperty(l,m,{enumerable:ir.enumerable}),{getValue:function(){return ie},setValue:function(Ti){ie=""+Ti},stopTracking:function(){l._valueTracker=null,delete l[m]}}}}function Fa(l){if(!l._valueTracker){var m=Aa(l)?"checked":"value";l._valueTracker=Ua(l,m,""+l[m])}}function qa(l){if(!l)return!1;var m=l._valueTracker;if(!m)return!0;var ie=m.getValue(),ir="";return l&&(ir=Aa(l)?l.checked?"true":"false":l.value),l=ir,l!==ie?(m.setValue(l),!0):!1}function Yi(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Xa=/[\n"\\]/g;function ka(l){return l.replace(Xa,function(m){return"\\"+m.charCodeAt(0).toString(16)+" "})}function Qa(l,m,ie,ir,oi,li,Ti,Ki){l.name="",Ti!=null&&typeof Ti!="function"&&typeof Ti!="symbol"&&typeof Ti!="boolean"?l.type=Ti:l.removeAttribute("type"),m!=null?Ti==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+Uo(m)):l.value!==""+Uo(m)&&(l.value=""+Uo(m)):Ti!=="submit"&&Ti!=="reset"||l.removeAttribute("value"),m!=null?Na(l,Ti,Uo(m)):ie!=null?Na(l,Ti,Uo(ie)):ir!=null&&l.removeAttribute("value"),oi==null&&li!=null&&(l.defaultChecked=!!li),oi!=null&&(l.checked=oi&&typeof oi!="function"&&typeof oi!="symbol"),Ki!=null&&typeof Ki!="function"&&typeof Ki!="symbol"&&typeof Ki!="boolean"?l.name=""+Uo(Ki):l.removeAttribute("name")}function za(l,m,ie,ir,oi,li,Ti,Ki){if(li!=null&&typeof li!="function"&&typeof li!="symbol"&&typeof li!="boolean"&&(l.type=li),m!=null||ie!=null){if(!(li!=="submit"&&li!=="reset"||m!=null)){Fa(l);return}ie=ie!=null?""+Uo(ie):"",m=m!=null?""+Uo(m):ie,Ki||m===l.value||(l.value=m),l.defaultValue=m}ir=ir??oi,ir=typeof ir!="function"&&typeof ir!="symbol"&&!!ir,l.checked=Ki?l.checked:!!ir,l.defaultChecked=!!ir,Ti!=null&&typeof Ti!="function"&&typeof Ti!="symbol"&&typeof Ti!="boolean"&&(l.name=Ti),Fa(l)}function Na(l,m,ie){m==="number"&&Yi(l.ownerDocument)===l||l.defaultValue===""+ie||(l.defaultValue=""+ie)}function Wa(l,m,ie,ir){if(l=l.options,m){m={};for(var oi=0;oi<ie.length;oi++)m["$"+ie[oi]]=!0;for(ie=0;ie<l.length;ie++)oi=m.hasOwnProperty("$"+l[ie].value),l[ie].selected!==oi&&(l[ie].selected=oi),oi&&ir&&(l[ie].defaultSelected=!0)}else{for(ie=""+Uo(ie),m=null,oi=0;oi<l.length;oi++){if(l[oi].value===ie){l[oi].selected=!0,ir&&(l[oi].defaultSelected=!0);return}m!==null||l[oi].disabled||(m=l[oi])}m!==null&&(m.selected=!0)}}function Ms(l,m,ie){if(m!=null&&(m=""+Uo(m),m!==l.value&&(l.value=m),ie==null)){l.defaultValue!==m&&(l.defaultValue=m);return}l.defaultValue=ie!=null?""+Uo(ie):""}function ss(l,m,ie,ir){if(m==null){if(ir!=null){if(ie!=null)throw Error(n(92));if(vt(ir)){if(1<ir.length)throw Error(n(93));ir=ir[0]}ie=ir}ie==null&&(ie=""),m=ie}ie=Uo(m),l.defaultValue=ie,ir=l.textContent,ir===ie&&ir!==""&&ir!==null&&(l.value=ir),Fa(l)}function ys(l,m){if(m){var ie=l.firstChild;if(ie&&ie===l.lastChild&&ie.nodeType===3){ie.nodeValue=m;return}}l.textContent=m}var Bs=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ss(l,m,ie){var ir=m.indexOf("--")===0;ie==null||typeof ie=="boolean"||ie===""?ir?l.setProperty(m,""):m==="float"?l.cssFloat="":l[m]="":ir?l.setProperty(m,ie):typeof ie!="number"||ie===0||Bs.has(m)?m==="float"?l.cssFloat=ie:l[m]=(""+ie).trim():l[m]=ie+"px"}function rs(l,m,ie){if(m!=null&&typeof m!="object")throw Error(n(62));if(l=l.style,ie!=null){for(var ir in ie)!ie.hasOwnProperty(ir)||m!=null&&m.hasOwnProperty(ir)||(ir.indexOf("--")===0?l.setProperty(ir,""):ir==="float"?l.cssFloat="":l[ir]="");for(var oi in m)ir=m[oi],m.hasOwnProperty(oi)&&ie[oi]!==ir&&Ss(l,oi,ir)}else for(var li in m)m.hasOwnProperty(li)&&Ss(l,li,m[li])}function Zs(l){if(l.indexOf("-")===-1)return!1;switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vs=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),uu=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Z0(l){return uu.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function mu(){}var Ah=null;function G0(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ws=null,Tf=null;function Xp(l){var m=ga(l);if(m&&(l=m.stateNode)){var ie=l[io]||null;e:switch(l=m.stateNode,m.type){case"input":if(Qa(l,ie.value,ie.defaultValue,ie.defaultValue,ie.checked,ie.defaultChecked,ie.type,ie.name),m=ie.name,ie.type==="radio"&&m!=null){for(ie=l;ie.parentNode;)ie=ie.parentNode;for(ie=ie.querySelectorAll('input[name="'+ka(""+m)+'"][type="radio"]'),m=0;m<ie.length;m++){var ir=ie[m];if(ir!==l&&ir.form===l.form){var oi=ir[io]||null;if(!oi)throw Error(n(90));Qa(ir,oi.value,oi.defaultValue,oi.defaultValue,oi.checked,oi.defaultChecked,oi.type,oi.name)}}for(m=0;m<ie.length;m++)ir=ie[m],ir.form===l.form&&qa(ir)}break e;case"textarea":Ms(l,ie.value,ie.defaultValue);break e;case"select":m=ie.value,m!=null&&Wa(l,!!ie.multiple,m,!1)}}}var _m=!1;function Wp(l,m,ie){if(_m)return l(m,ie);_m=!0;try{var ir=l(m);return ir}finally{if(_m=!1,(ws!==null||Tf!==null)&&(i6(),ws&&(m=ws,l=Tf,Tf=ws=null,Xp(m),l)))for(m=0;m<l.length;m++)Xp(l[m])}}function $0(l,m){var ie=l.stateNode;if(ie===null)return null;var ir=ie[io]||null;if(ir===null)return null;ie=ir[m];e:switch(m){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(ir=!ir.disabled)||(l=l.type,ir=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!ir;break e;default:l=!1}if(l)return null;if(ie&&typeof ie!="function")throw Error(n(231,m,typeof ie));return ie}var Zl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=!1;if(Zl)try{var Gl={};Object.defineProperty(Gl,"passive",{get:function(){Sh=!0}}),window.addEventListener("test",Gl,Gl),window.removeEventListener("test",Gl,Gl)}catch{Sh=!1}var _d=null,Yp=null,X0=null;function Qp(){if(X0)return X0;var l,m=Yp,ie=m.length,ir,oi="value"in _d?_d.value:_d.textContent,li=oi.length;for(l=0;l<ie&&m[l]===oi[l];l++);var Ti=ie-l;for(ir=1;ir<=Ti&&m[ie-ir]===oi[li-ir];ir++);return X0=oi.slice(l,1<ir?1-ir:void 0)}function Ih(l){var m=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&m===13&&(l=13)):l=m,l===10&&(l=13),32<=l||l===13?l:0}function W0(){return!0}function Jp(){return!1}function gu(l){function m(ie,ir,oi,li,Ti){this._reactName=ie,this._targetInst=oi,this.type=ir,this.nativeEvent=li,this.target=Ti,this.currentTarget=null;for(var Ki in l)l.hasOwnProperty(Ki)&&(ie=l[Ki],this[Ki]=ie?ie(li):li[Ki]);return this.isDefaultPrevented=(li.defaultPrevented!=null?li.defaultPrevented:li.returnValue===!1)?W0:Jp,this.isPropagationStopped=Jp,this}return d(m.prototype,{preventDefault:function(){this.defaultPrevented=!0;var ie=this.nativeEvent;ie&&(ie.preventDefault?ie.preventDefault():typeof ie.returnValue!="unknown"&&(ie.returnValue=!1),this.isDefaultPrevented=W0)},stopPropagation:function(){var ie=this.nativeEvent;ie&&(ie.stopPropagation?ie.stopPropagation():typeof ie.cancelBubble!="unknown"&&(ie.cancelBubble=!0),this.isPropagationStopped=W0)},persist:function(){},isPersistent:W0}),m}var Td={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bu=gu(Td),Jd=d({},Td,{view:0,detail:0}),Q0=gu(Jd),z1,K1,J0,ey=d({},Jd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qo,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==J0&&(J0&&l.type==="mousemove"?(z1=l.screenX-J0.screenX,K1=l.screenY-J0.screenY):K1=z1=0,J0=l),z1)},movementY:function(l){return"movementY"in l?l.movementY:K1}}),r3=gu(ey),T6=d({},ey,{dataTransfer:0}),_h=gu(T6),Tm=d({},Jd,{relatedTarget:0}),ty=gu(Tm),Rd=d({},Td,{animationName:0,elapsedTime:0,pseudoElement:0}),ry=gu(Rd),R6=d({},Td,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Th=gu(R6),Wf=d({},Td,{data:0}),Rm=gu(Wf),M6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oy={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Eo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zo(l){var m=this.nativeEvent;return m.getModifierState?m.getModifierState(l):(l=Eo[l])?!!m[l]:!1}function qo(){return Zo}var pa=d({},Jd,{key:function(l){if(l.key){var m=M6[l.key]||l.key;if(m!=="Unidentified")return m}return l.type==="keypress"?(l=Ih(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?oy[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qo,charCode:function(l){return l.type==="keypress"?Ih(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Ih(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Ha=gu(pa),ns=d({},ey,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gs=gu(ns),$l=d({},Jd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qo}),Os=gu($l),Mm=d({},Td,{propertyName:0,elapsedTime:0,pseudoElement:0}),B6=gu(Mm),Df=d({},ey,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),ay=gu(Df),O6=d({},Td,{newState:0,oldState:0}),Rh=gu(O6),fy=[9,13,27,32],Mh=Zl&&"CompositionEvent"in window,fs=null;Zl&&"documentMode"in document&&(fs=document.documentMode);var C6=Zl&&"TextEvent"in window&&!fs,Bm=Zl&&(!Mh||fs&&8<fs&&11>=fs),ep=" ",n3=!1;function i3(l,m){switch(l){case"keyup":return fy.indexOf(m.keyCode)!==-1;case"keydown":return m.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function o3(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var cd=!1;function Md(l,m){switch(l){case"compositionend":return o3(m);case"keypress":return m.which!==32?null:(n3=!0,ep);case"textInput":return l=m.data,l===ep&&n3?null:l;default:return null}}function ly(l,m){if(cd)return l==="compositionend"||!Mh&&i3(l,m)?(l=Qp(),X0=Yp=_d=null,cd=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(m.ctrlKey||m.altKey||m.metaKey)||m.ctrlKey&&m.altKey){if(m.char&&1<m.char.length)return m.char;if(m.which)return String.fromCharCode(m.which)}return null;case"compositionend":return Bm&&m.locale!=="ko"?null:m.data;default:return null}}var a3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tp(l){var m=l&&l.nodeName&&l.nodeName.toLowerCase();return m==="input"?!!a3[l.type]:m==="textarea"}function Om(l,m,ie,ir){ws?Tf?Tf.push(ir):Tf=[ir]:ws=ir,m=l6(m,"onChange"),0<m.length&&(ie=new bu("onChange","change",null,ie,ir),l.push({event:ie,listeners:m}))}var Bh=null,Bd=null;function s3(l){Wv(l,0)}function Od(l){var m=ya(l);if(qa(m))return l}function Cd(l,m){if(l==="change")return m}var rp=!1;if(Zl){var Cm;if(Zl){var Fm="oninput"in document;if(!Fm){var u3=document.createElement("div");u3.setAttribute("oninput","return;"),Fm=typeof u3.oninput=="function"}Cm=Fm}else Cm=!1;rp=Cm&&(!document.documentMode||9<document.documentMode)}function np(){Bh&&(Bh.detachEvent("onpropertychange",ip),Bd=Bh=null)}function ip(l){if(l.propertyName==="value"&&Od(Bd)){var m=[];Om(m,Bd,l,G0(l)),Wp(s3,m)}}function Pm(l,m,ie){l==="focusin"?(np(),Bh=m,Bd=ie,Bh.attachEvent("onpropertychange",ip)):l==="focusout"&&np()}function F6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Od(Bd)}function f3(l,m){if(l==="click")return Od(m)}function P6(l,m){if(l==="input"||l==="change")return Od(m)}function k6(l,m){return l===m&&(l!==0||1/l===1/m)||l!==l&&m!==m}var ps=typeof Object.is=="function"?Object.is:k6;function $s(l,m){if(ps(l,m))return!0;if(typeof l!="object"||l===null||typeof m!="object"||m===null)return!1;var ie=Object.keys(l),ir=Object.keys(m);if(ie.length!==ir.length)return!1;for(ir=0;ir<ie.length;ir++){var oi=ie[ir];if(!fi.call(m,oi)||!ps(l[oi],m[oi]))return!1}return!0}function c3(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function l3(l,m){var ie=c3(l);l=0;for(var ir;ie;){if(ie.nodeType===3){if(ir=l+ie.textContent.length,l<=m&&ir>=m)return{node:ie,offset:m-l};l=ir}e:{for(;ie;){if(ie.nextSibling){ie=ie.nextSibling;break e}ie=ie.parentNode}ie=void 0}ie=c3(ie)}}function km(l,m){return l&&m?l===m?!0:l&&l.nodeType===3?!1:m&&m.nodeType===3?km(l,m.parentNode):"contains"in l?l.contains(m):l.compareDocumentPosition?!!(l.compareDocumentPosition(m)&16):!1:!1}function d3(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var m=Yi(l.document);m instanceof l.HTMLIFrameElement;){try{var ie=typeof m.contentWindow.location.href=="string"}catch{ie=!1}if(ie)l=m.contentWindow;else break;m=Yi(l.document)}return m}function op(l){var m=l&&l.nodeName&&l.nodeName.toLowerCase();return m&&(m==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||m==="textarea"||l.contentEditable==="true")}var ap=Zl&&"documentMode"in document&&11>=document.documentMode,Fd=null,Pd=null,ld=null,eh=!1;function sp(l,m,ie){var ir=ie.window===ie?ie.document:ie.nodeType===9?ie:ie.ownerDocument;eh||Fd==null||Fd!==Yi(ir)||(ir=Fd,"selectionStart"in ir&&op(ir)?ir={start:ir.selectionStart,end:ir.selectionEnd}:(ir=(ir.ownerDocument&&ir.ownerDocument.defaultView||window).getSelection(),ir={anchorNode:ir.anchorNode,anchorOffset:ir.anchorOffset,focusNode:ir.focusNode,focusOffset:ir.focusOffset}),ld&&$s(ld,ir)||(ld=ir,ir=l6(Pd,"onSelect"),0<ir.length&&(m=new bu("onSelect","select",null,m,ie),l.push({event:m,listeners:ir}),m.target=Fd)))}function Uf(l,m){var ie={};return ie[l.toLowerCase()]=m.toLowerCase(),ie["Webkit"+l]="webkit"+m,ie["Moz"+l]="moz"+m,ie}var Oh={animationend:Uf("Animation","AnimationEnd"),animationiteration:Uf("Animation","AnimationIteration"),animationstart:Uf("Animation","AnimationStart"),transitionrun:Uf("Transition","TransitionRun"),transitionstart:Uf("Transition","TransitionStart"),transitioncancel:Uf("Transition","TransitionCancel"),transitionend:Uf("Transition","TransitionEnd")},Nm={},h3={};Zl&&(h3=document.createElement("div").style,"AnimationEvent"in window||(delete Oh.animationend.animation,delete Oh.animationiteration.animation,delete Oh.animationstart.animation),"TransitionEvent"in window||delete Oh.transitionend.transition);function th(l){if(Nm[l])return Nm[l];if(!Oh[l])return l;var m=Oh[l],ie;for(ie in m)if(m.hasOwnProperty(ie)&&ie in h3)return Nm[l]=m[ie];return l}var p3=th("animationend"),up=th("animationiteration"),Ch=th("animationstart"),y3=th("transitionrun"),Zi=th("transitionstart"),Fh=th("transitioncancel"),fp=th("transitionend"),Rf=new Map,Ja="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ja.push("scrollEnd");function du(l,m){Rf.set(l,m),Wo(m,[l])}var jf=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(m))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Xs=[],Lf=0,Mf=0;function cp(){for(var l=Lf,m=Mf=Lf=0;m<l;){var ie=Xs[m];Xs[m++]=null;var ir=Xs[m];Xs[m++]=null;var oi=Xs[m];Xs[m++]=null;var li=Xs[m];if(Xs[m++]=null,ir!==null&&oi!==null){var Ti=ir.pending;Ti===null?oi.next=oi:(oi.next=Ti.next,Ti.next=oi),ir.pending=oi}li!==0&&py(ie,oi,li)}}function lp(l,m,ie,ir){Xs[Lf++]=l,Xs[Lf++]=m,Xs[Lf++]=ie,Xs[Lf++]=ir,Mf|=ir,l.lanes|=ir,l=l.alternate,l!==null&&(l.lanes|=ir)}function Dm(l,m,ie,ir){return lp(l,m,ie,ir),kd(l)}function rh(l,m){return lp(l,null,null,m),kd(l)}function py(l,m,ie){l.lanes|=ie;var ir=l.alternate;ir!==null&&(ir.lanes|=ie);for(var oi=!1,li=l.return;li!==null;)li.childLanes|=ie,ir=li.alternate,ir!==null&&(ir.childLanes|=ie),li.tag===22&&(l=li.stateNode,l===null||l._visibility&1||(oi=!0)),l=li,li=li.return;return l.tag===3?(li=l.stateNode,oi&&m!==null&&(oi=31-Hi(ie),l=li.hiddenUpdates,ir=l[oi],ir===null?l[oi]=[m]:ir.push(m),m.lane=ie|536870912),li):null}function kd(l){if(50<jb)throw jb=0,G6=null,Error(n(185));for(var m=l.return;m!==null;)l=m,m=l.return;return l.tag===3?l.stateNode:null}var dd={};function N6(l,m,ie,ir){this.tag=l,this.key=ie,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ir,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ju(l,m,ie,ir){return new N6(l,m,ie,ir)}function Yf(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Qf(l,m){var ie=l.alternate;return ie===null?(ie=ju(l.tag,m,l.key,l.mode),ie.elementType=l.elementType,ie.type=l.type,ie.stateNode=l.stateNode,ie.alternate=l,l.alternate=ie):(ie.pendingProps=m,ie.type=l.type,ie.flags=0,ie.subtreeFlags=0,ie.deletions=null),ie.flags=l.flags&65011712,ie.childLanes=l.childLanes,ie.lanes=l.lanes,ie.child=l.child,ie.memoizedProps=l.memoizedProps,ie.memoizedState=l.memoizedState,ie.updateQueue=l.updateQueue,m=l.dependencies,ie.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},ie.sibling=l.sibling,ie.index=l.index,ie.ref=l.ref,ie.refCleanup=l.refCleanup,ie}function Nd(l,m){l.flags&=65011714;var ie=l.alternate;return ie===null?(l.childLanes=0,l.lanes=m,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=ie.childLanes,l.lanes=ie.lanes,l.child=ie.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=ie.memoizedProps,l.memoizedState=ie.memoizedState,l.updateQueue=ie.updateQueue,l.type=ie.type,m=ie.dependencies,l.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext}),l}function Iu(l,m,ie,ir,oi,li){var Ti=0;if(ir=l,typeof l=="function")Yf(l)&&(Ti=1);else if(typeof l=="string")Ti=R4(l,ie,rn.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case kt:return l=ju(31,ie,m,oi),l.elementType=kt,l.lanes=li,l;case b:return Dd(ie.children,oi,li,m);case w:Ti=8,oi|=24;break;case S:return l=ju(12,ie,m,oi|2),l.elementType=S,l.lanes=li,l;case W:return l=ju(13,ie,m,oi),l.elementType=W,l.lanes=li,l;case J:return l=ju(19,ie,m,oi),l.elementType=J,l.lanes=li,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case B:Ti=10;break e;case E:Ti=9;break e;case ae:Ti=11;break e;case ve:Ti=14;break e;case Qe:Ti=16,ir=null;break e}Ti=29,ie=Error(n(130,l===null?"null":typeof l,"")),ir=null}return m=ju(Ti,ie,m,oi),m.elementType=l,m.type=ir,m.lanes=li,m}function Dd(l,m,ie,ir){return l=ju(7,l,ir,m),l.lanes=ie,l}function yy(l,m,ie){return l=ju(6,l,null,m),l.lanes=ie,l}function Ph(l){var m=ju(18,null,null,0);return m.stateNode=l,m}function Xl(l,m,ie){return m=ju(4,l.children!==null?l.children:[],l.key,m),m.lanes=ie,m.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},m}var Um=new WeakMap;function qf(l,m){if(typeof l=="object"&&l!==null){var ie=Um.get(l);return ie!==void 0?ie:(m={value:l,source:m,stack:ti(m)},Um.set(l,m),m)}return{value:l,source:m,stack:ti(m)}}var hd=[],nh=0,Ws=null,ih=0,Of=[],zs=0,Yl=null,Cf=1,vu="";function Jl(l,m){hd[nh++]=ih,hd[nh++]=Ws,Ws=l,ih=m}function xu(l,m,ie){Of[zs++]=Cf,Of[zs++]=vu,Of[zs++]=Yl,Yl=l;var ir=Cf;l=vu;var oi=32-Hi(ir)-1;ir&=~(1<<oi),ie+=1;var li=32-Hi(m)+oi;if(30<li){var Ti=oi-oi%5;li=(ir&(1<<Ti)-1).toString(32),ir>>=Ti,oi-=Ti,Cf=1<<32-Hi(m)+oi|ie<<oi|ir,vu=li+l}else Cf=1<<li|ie<<oi|ir,vu=l}function dp(l){l.return!==null&&(Jl(l,1),xu(l,1,0))}function jm(l){for(;l===Ws;)Ws=hd[--nh],hd[nh]=null,ih=hd[--nh],hd[nh]=null;for(;l===Yl;)Yl=Of[--zs],Of[zs]=null,vu=Of[--zs],Of[zs]=null,Cf=Of[--zs],Of[zs]=null}function m3(l,m){Of[zs++]=Cf,Of[zs++]=vu,Of[zs++]=Yl,Cf=m.id,vu=m.overflow,Yl=l}var nu=null,xs=null,es=!1,zf=null,Lu=!1,my=Error(n(519));function pd(l){var m=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jd(qf(m,l)),my}function by(l){var m=l.stateNode,ie=l.type,ir=l.memoizedProps;switch(m[Wi]=l,m[io]=ir,ie){case"dialog":ts("cancel",m),ts("close",m);break;case"iframe":case"object":case"embed":ts("load",m);break;case"video":case"audio":for(ie=0;ie<qb.length;ie++)ts(qb[ie],m);break;case"source":ts("error",m);break;case"img":case"image":case"link":ts("error",m),ts("load",m);break;case"details":ts("toggle",m);break;case"input":ts("invalid",m),za(m,ir.value,ir.defaultValue,ir.checked,ir.defaultChecked,ir.type,ir.name,!0);break;case"select":ts("invalid",m);break;case"textarea":ts("invalid",m),ss(m,ir.value,ir.defaultValue,ir.children)}ie=ir.children,typeof ie!="string"&&typeof ie!="number"&&typeof ie!="bigint"||m.textContent===""+ie||ir.suppressHydrationWarning===!0||e8(m.textContent,ie)?(ir.popover!=null&&(ts("beforetoggle",m),ts("toggle",m)),ir.onScroll!=null&&ts("scroll",m),ir.onScrollEnd!=null&&ts("scrollend",m),ir.onClick!=null&&(m.onclick=mu),m=!0):m=!1,m||pd(l,!0)}function wy(l){for(nu=l.return;nu;)switch(nu.tag){case 5:case 31:case 13:Lu=!1;return;case 27:case 3:Lu=!0;return;default:nu=nu.return}}function oh(l){if(l!==nu)return!1;if(!es)return wy(l),es=!0,!1;var m=l.tag,ie;if((ie=m!==3&&m!==27)&&((ie=m===5)&&(ie=l.type,ie=!(ie!=="form"&&ie!=="button")||uv(l.type,l.memoizedProps)),ie=!ie),ie&&xs&&pd(l),wy(l),m===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));xs=c8(l)}else if(m===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));xs=c8(l)}else m===27?(m=xs,N0(l.type)?(l=hv,hv=null,xs=l):xs=m):xs=nu?sd(l.stateNode.nextSibling):null;return!0}function Ud(){xs=nu=null,es=!1}function _y(){var l=zf;return l!==null&&(qs===null?qs=l:qs.push.apply(qs,l),zf=null),l}function jd(l){zf===null?zf=[l]:zf.push(l)}var Ry=F(null),Ld=null,ed=null;function td(l,m,ie){Ye(Ry,m._currentValue),m._currentValue=ie}function rd(l){l._currentValue=Ry.current,k(Ry)}function hp(l,m,ie){for(;l!==null;){var ir=l.alternate;if((l.childLanes&m)!==m?(l.childLanes|=m,ir!==null&&(ir.childLanes|=m)):ir!==null&&(ir.childLanes&m)!==m&&(ir.childLanes|=m),l===ie)break;l=l.return}}function pp(l,m,ie,ir){var oi=l.child;for(oi!==null&&(oi.return=l);oi!==null;){var li=oi.dependencies;if(li!==null){var Ti=oi.child;li=li.firstContext;e:for(;li!==null;){var Ki=li;li=oi;for(var to=0;to<m.length;to++)if(Ki.context===m[to]){li.lanes|=ie,Ki=li.alternate,Ki!==null&&(Ki.lanes|=ie),hp(li.return,ie,l),ir||(Ti=null);break e}li=Ki.next}}else if(oi.tag===18){if(Ti=oi.return,Ti===null)throw Error(n(341));Ti.lanes|=ie,li=Ti.alternate,li!==null&&(li.lanes|=ie),hp(Ti,ie,l),Ti=null}else Ti=oi.child;if(Ti!==null)Ti.return=oi;else for(Ti=oi;Ti!==null;){if(Ti===l){Ti=null;break}if(oi=Ti.sibling,oi!==null){oi.return=Ti.return,Ti=oi;break}Ti=Ti.return}oi=Ti}}function Va(l,m,ie,ir){l=null;for(var oi=m,li=!1;oi!==null;){if(!li){if((oi.flags&524288)!==0)li=!0;else if((oi.flags&262144)!==0)break}if(oi.tag===10){var Ti=oi.alternate;if(Ti===null)throw Error(n(387));if(Ti=Ti.memoizedProps,Ti!==null){var Ki=oi.type;ps(oi.pendingProps.value,Ti.value)||(l!==null?l.push(Ki):l=[Ki])}}else if(oi===ni.current){if(Ti=oi.alternate,Ti===null)throw Error(n(387));Ti.memoizedState.memoizedState!==oi.memoizedState.memoizedState&&(l!==null?l.push(Gb):l=[Gb])}oi=oi.return}l!==null&&pp(m,l,ie,ir),m.flags|=262144}function By(l){for(l=l.firstContext;l!==null;){if(!ps(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function ah(l){Ld=l,ed=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Hs(l){return g3(Ld,l)}function yp(l,m){return Ld===null&&ah(l),g3(l,m)}function g3(l,m){var ie=m._currentValue;if(m={context:m,memoizedValue:ie,next:null},ed===null){if(l===null)throw Error(n(308));ed=m,l.dependencies={lanes:0,firstContext:m},l.flags|=524288}else ed=ed.next=m;return ie}var D6=typeof AbortController<"u"?AbortController:function(){var l=[],m=this.signal={aborted:!1,addEventListener:function(ie,ir){l.push(ir)}};this.abort=function(){m.aborted=!0,l.forEach(function(ie){return ie()})}},Hf=e.unstable_scheduleCallback,U6=e.unstable_NormalPriority,Ns={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mp(){return{controller:new D6,data:new Map,refCount:0}}function kh(l){l.refCount--,l.refCount===0&&Hf(U6,function(){l.controller.abort()})}var Nh=null,_u=0,Ff=0,qd=null;function b3(l,m){if(Nh===null){var ie=Nh=[];_u=0,Ff=J6(),qd={status:"pending",value:void 0,then:function(ir){ie.push(ir)}}}return _u++,m.then(bp,bp),m}function bp(){if(--_u===0&&Nh!==null){qd!==null&&(qd.status="fulfilled");var l=Nh;Nh=null,Ff=0,qd=null;for(var m=0;m<l.length;m++)(0,l[m])()}}function v3(l,m){var ie=[],ir={status:"pending",value:null,reason:null,then:function(oi){ie.push(oi)}};return l.then(function(){ir.status="fulfilled",ir.value=m;for(var oi=0;oi<ie.length;oi++)(0,ie[oi])(m)},function(oi){for(ir.status="rejected",ir.reason=oi,oi=0;oi<ie.length;oi++)(0,ie[oi])(void 0)}),ir}var Oy=ur.S;ur.S=function(l,m){$p=vn(),typeof m=="object"&&m!==null&&typeof m.then=="function"&&b3(l,m),Oy!==null&&Oy(l,m)};var zd=F(null);function vp(){var l=zd.current;return l!==null?l:Lo.pooledCache}function Dh(l,m){m===null?Ye(zd,zd.current):Ye(zd,m.pool)}function yd(){var l=vp();return l===null?null:{parent:Ns._currentValue,pool:l}}var Uh=Error(n(460)),nd=Error(n(474)),wp=Error(n(542)),xp={then:function(){}};function Fy(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Lm(l,m,ie){switch(ie=l[ie],ie===void 0?l.push(m):ie!==m&&(m.then(mu,mu),m=ie),m.status){case"fulfilled":return m.value;case"rejected":throw l=m.reason,Tu(l),l;default:if(typeof m.status=="string")m.then(mu,mu);else{if(l=Lo,l!==null&&100<l.shellSuspendCounter)throw Error(n(482));l=m,l.status="pending",l.then(function(ir){if(m.status==="pending"){var oi=m;oi.status="fulfilled",oi.value=ir}},function(ir){if(m.status==="pending"){var oi=m;oi.status="rejected",oi.reason=ir}})}switch(m.status){case"fulfilled":return m.value;case"rejected":throw l=m.reason,Tu(l),l}throw Vd=m,Uh}}function Hd(l){try{var m=l._init;return m(l._payload)}catch(ie){throw ie!==null&&typeof ie=="object"&&typeof ie.then=="function"?(Vd=ie,Uh):ie}}var Vd=null;function qm(){if(Vd===null)throw Error(n(459));var l=Vd;return Vd=null,l}function Tu(l){if(l===Uh||l===wp)throw Error(n(483))}var Bu=null,Kd=0;function md(l){var m=Kd;return Kd+=1,Bu===null&&(Bu=[]),Lm(Bu,l,m)}function jh(l,m){m=m.props.ref,l.ref=m!==void 0?m:null}function Ep(l,m){throw m.$$typeof===p?Error(n(525)):(l=Object.prototype.toString.call(m),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":l)))}function zm(l){function m(fo,ao){if(l){var mo=fo.deletions;mo===null?(fo.deletions=[ao],fo.flags|=16):mo.push(ao)}}function ie(fo,ao){if(!l)return null;for(;ao!==null;)m(fo,ao),ao=ao.sibling;return null}function ir(fo){for(var ao=new Map;fo!==null;)fo.key!==null?ao.set(fo.key,fo):ao.set(fo.index,fo),fo=fo.sibling;return ao}function oi(fo,ao){return fo=Qf(fo,ao),fo.index=0,fo.sibling=null,fo}function li(fo,ao,mo){return fo.index=mo,l?(mo=fo.alternate,mo!==null?(mo=mo.index,mo<ao?(fo.flags|=67108866,ao):mo):(fo.flags|=67108866,ao)):(fo.flags|=1048576,ao)}function Ti(fo){return l&&fo.alternate===null&&(fo.flags|=67108866),fo}function Ki(fo,ao,mo,Do){return ao===null||ao.tag!==6?(ao=yy(mo,fo.mode,Do),ao.return=fo,ao):(ao=oi(ao,mo),ao.return=fo,ao)}function to(fo,ao,mo,Do){var Ma=mo.type;return Ma===b?ko(fo,ao,mo.props.children,Do,mo.key):ao!==null&&(ao.elementType===Ma||typeof Ma=="object"&&Ma!==null&&Ma.$$typeof===Qe&&Hd(Ma)===ao.type)?(ao=oi(ao,mo.props),jh(ao,mo),ao.return=fo,ao):(ao=Iu(mo.type,mo.key,mo.props,null,fo.mode,Do),jh(ao,mo),ao.return=fo,ao)}function go(fo,ao,mo,Do){return ao===null||ao.tag!==4||ao.stateNode.containerInfo!==mo.containerInfo||ao.stateNode.implementation!==mo.implementation?(ao=Xl(mo,fo.mode,Do),ao.return=fo,ao):(ao=oi(ao,mo.children||[]),ao.return=fo,ao)}function ko(fo,ao,mo,Do,Ma){return ao===null||ao.tag!==7?(ao=Dd(mo,fo.mode,Do,Ma),ao.return=fo,ao):(ao=oi(ao,mo),ao.return=fo,ao)}function Vo(fo,ao,mo){if(typeof ao=="string"&&ao!==""||typeof ao=="number"||typeof ao=="bigint")return ao=yy(""+ao,fo.mode,mo),ao.return=fo,ao;if(typeof ao=="object"&&ao!==null){switch(ao.$$typeof){case h:return mo=Iu(ao.type,ao.key,ao.props,null,fo.mode,mo),jh(mo,ao),mo.return=fo,mo;case y:return ao=Xl(ao,fo.mode,mo),ao.return=fo,ao;case Qe:return ao=Hd(ao),Vo(fo,ao,mo)}if(vt(ao)||ce(ao))return ao=Dd(ao,fo.mode,mo,null),ao.return=fo,ao;if(typeof ao.then=="function")return Vo(fo,md(ao),mo);if(ao.$$typeof===B)return Vo(fo,yp(fo,ao),mo);Ep(fo,ao)}return null}function So(fo,ao,mo,Do){var Ma=ao!==null?ao.key:null;if(typeof mo=="string"&&mo!==""||typeof mo=="number"||typeof mo=="bigint")return Ma!==null?null:Ki(fo,ao,""+mo,Do);if(typeof mo=="object"&&mo!==null){switch(mo.$$typeof){case h:return mo.key===Ma?to(fo,ao,mo,Do):null;case y:return mo.key===Ma?go(fo,ao,mo,Do):null;case Qe:return mo=Hd(mo),So(fo,ao,mo,Do)}if(vt(mo)||ce(mo))return Ma!==null?null:ko(fo,ao,mo,Do,null);if(typeof mo.then=="function")return So(fo,ao,md(mo),Do);if(mo.$$typeof===B)return So(fo,ao,yp(fo,mo),Do);Ep(fo,mo)}return null}function Bo(fo,ao,mo,Do,Ma){if(typeof Do=="string"&&Do!==""||typeof Do=="number"||typeof Do=="bigint")return fo=fo.get(mo)||null,Ki(ao,fo,""+Do,Ma);if(typeof Do=="object"&&Do!==null){switch(Do.$$typeof){case h:return fo=fo.get(Do.key===null?mo:Do.key)||null,to(ao,fo,Do,Ma);case y:return fo=fo.get(Do.key===null?mo:Do.key)||null,go(ao,fo,Do,Ma);case Qe:return Do=Hd(Do),Bo(fo,ao,mo,Do,Ma)}if(vt(Do)||ce(Do))return fo=fo.get(mo)||null,ko(ao,fo,Do,Ma,null);if(typeof Do.then=="function")return Bo(fo,ao,mo,md(Do),Ma);if(Do.$$typeof===B)return Bo(fo,ao,mo,yp(ao,Do),Ma);Ep(ao,Do)}return null}function Ia(fo,ao,mo,Do){for(var Ma=null,gs=null,Ra=ao,Ya=ao=0,os=null;Ra!==null&&Ya<mo.length;Ya++){Ra.index>Ya?(os=Ra,Ra=null):os=Ra.sibling;var bs=So(fo,Ra,mo[Ya],Do);if(bs===null){Ra===null&&(Ra=os);break}l&&Ra&&bs.alternate===null&&m(fo,Ra),ao=li(bs,ao,Ya),gs===null?Ma=bs:gs.sibling=bs,gs=bs,Ra=os}if(Ya===mo.length)return ie(fo,Ra),es&&Jl(fo,Ya),Ma;if(Ra===null){for(;Ya<mo.length;Ya++)Ra=Vo(fo,mo[Ya],Do),Ra!==null&&(ao=li(Ra,ao,Ya),gs===null?Ma=Ra:gs.sibling=Ra,gs=Ra);return es&&Jl(fo,Ya),Ma}for(Ra=ir(Ra);Ya<mo.length;Ya++)os=Bo(Ra,fo,Ya,mo[Ya],Do),os!==null&&(l&&os.alternate!==null&&Ra.delete(os.key===null?Ya:os.key),ao=li(os,ao,Ya),gs===null?Ma=os:gs.sibling=os,gs=os);return l&&Ra.forEach(function(K0){return m(fo,K0)}),es&&Jl(fo,Ya),Ma}function Da(fo,ao,mo,Do){if(mo==null)throw Error(n(151));for(var Ma=null,gs=null,Ra=ao,Ya=ao=0,os=null,bs=mo.next();Ra!==null&&!bs.done;Ya++,bs=mo.next()){Ra.index>Ya?(os=Ra,Ra=null):os=Ra.sibling;var K0=So(fo,Ra,bs.value,Do);if(K0===null){Ra===null&&(Ra=os);break}l&&Ra&&K0.alternate===null&&m(fo,Ra),ao=li(K0,ao,Ya),gs===null?Ma=K0:gs.sibling=K0,gs=K0,Ra=os}if(bs.done)return ie(fo,Ra),es&&Jl(fo,Ya),Ma;if(Ra===null){for(;!bs.done;Ya++,bs=mo.next())bs=Vo(fo,bs.value,Do),bs!==null&&(ao=li(bs,ao,Ya),gs===null?Ma=bs:gs.sibling=bs,gs=bs);return es&&Jl(fo,Ya),Ma}for(Ra=ir(Ra);!bs.done;Ya++,bs=mo.next())bs=Bo(Ra,fo,Ya,bs.value,Do),bs!==null&&(l&&bs.alternate!==null&&Ra.delete(bs.key===null?Ya:bs.key),ao=li(bs,ao,Ya),gs===null?Ma=bs:gs.sibling=bs,gs=bs);return l&&Ra.forEach(function(j4){return m(fo,j4)}),es&&Jl(fo,Ya),Ma}function Rs(fo,ao,mo,Do){if(typeof mo=="object"&&mo!==null&&mo.type===b&&mo.key===null&&(mo=mo.props.children),typeof mo=="object"&&mo!==null){switch(mo.$$typeof){case h:e:{for(var Ma=mo.key;ao!==null;){if(ao.key===Ma){if(Ma=mo.type,Ma===b){if(ao.tag===7){ie(fo,ao.sibling),Do=oi(ao,mo.props.children),Do.return=fo,fo=Do;break e}}else if(ao.elementType===Ma||typeof Ma=="object"&&Ma!==null&&Ma.$$typeof===Qe&&Hd(Ma)===ao.type){ie(fo,ao.sibling),Do=oi(ao,mo.props),jh(Do,mo),Do.return=fo,fo=Do;break e}ie(fo,ao);break}else m(fo,ao);ao=ao.sibling}mo.type===b?(Do=Dd(mo.props.children,fo.mode,Do,mo.key),Do.return=fo,fo=Do):(Do=Iu(mo.type,mo.key,mo.props,null,fo.mode,Do),jh(Do,mo),Do.return=fo,fo=Do)}return Ti(fo);case y:e:{for(Ma=mo.key;ao!==null;){if(ao.key===Ma)if(ao.tag===4&&ao.stateNode.containerInfo===mo.containerInfo&&ao.stateNode.implementation===mo.implementation){ie(fo,ao.sibling),Do=oi(ao,mo.children||[]),Do.return=fo,fo=Do;break e}else{ie(fo,ao);break}else m(fo,ao);ao=ao.sibling}Do=Xl(mo,fo.mode,Do),Do.return=fo,fo=Do}return Ti(fo);case Qe:return mo=Hd(mo),Rs(fo,ao,mo,Do)}if(vt(mo))return Ia(fo,ao,mo,Do);if(ce(mo)){if(Ma=ce(mo),typeof Ma!="function")throw Error(n(150));return mo=Ma.call(mo),Da(fo,ao,mo,Do)}if(typeof mo.then=="function")return Rs(fo,ao,md(mo),Do);if(mo.$$typeof===B)return Rs(fo,ao,yp(fo,mo),Do);Ep(fo,mo)}return typeof mo=="string"&&mo!==""||typeof mo=="number"||typeof mo=="bigint"?(mo=""+mo,ao!==null&&ao.tag===6?(ie(fo,ao.sibling),Do=oi(ao,mo),Do.return=fo,fo=Do):(ie(fo,ao),Do=yy(mo,fo.mode,Do),Do.return=fo,fo=Do),Ti(fo)):ie(fo,ao)}return function(fo,ao,mo,Do){try{Kd=0;var Ma=Rs(fo,ao,mo,Do);return Bu=null,Ma}catch(Ra){if(Ra===Uh||Ra===wp)throw Ra;var gs=ju(29,Ra,null,fo.mode);return gs.lanes=Do,gs.return=fo,gs}finally{}}}var Vf=zm(!0),qh=zm(!1),gd=!1;function ky(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vh(l,m){l=l.updateQueue,m.updateQueue===l&&(m.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function bd(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Jf(l,m,ie){var ir=l.updateQueue;if(ir===null)return null;if(ir=ir.shared,(Mo&2)!==0){var oi=ir.pending;return oi===null?m.next=m:(m.next=oi.next,oi.next=m),ir.pending=m,m=kd(l),py(l,null,ie),m}return lp(l,ir,m,ie),kd(l)}function sh(l,m,ie){if(m=m.updateQueue,m!==null&&(m=m.shared,(ie&4194048)!==0)){var ir=m.lanes;ir&=l.pendingLanes,ie|=ir,m.lanes=ie,wo(l,ie)}}function Kh(l,m){var ie=l.updateQueue,ir=l.alternate;if(ir!==null&&(ir=ir.updateQueue,ie===ir)){var oi=null,li=null;if(ie=ie.firstBaseUpdate,ie!==null){do{var Ti={lane:ie.lane,tag:ie.tag,payload:ie.payload,callback:null,next:null};li===null?oi=li=Ti:li=li.next=Ti,ie=ie.next}while(ie!==null);li===null?oi=li=m:li=li.next=m}else oi=li=m;ie={baseState:ir.baseState,firstBaseUpdate:oi,lastBaseUpdate:li,shared:ir.shared,callbacks:ir.callbacks},l.updateQueue=ie;return}l=ie.lastBaseUpdate,l===null?ie.firstBaseUpdate=m:l.next=m,ie.lastBaseUpdate=m}var Ny=!1;function Zd(){if(Ny){var l=qd;if(l!==null)throw l}}function Zh(l,m,ie,ir){Ny=!1;var oi=l.updateQueue;gd=!1;var li=oi.firstBaseUpdate,Ti=oi.lastBaseUpdate,Ki=oi.shared.pending;if(Ki!==null){oi.shared.pending=null;var to=Ki,go=to.next;to.next=null,Ti===null?li=go:Ti.next=go,Ti=to;var ko=l.alternate;ko!==null&&(ko=ko.updateQueue,Ki=ko.lastBaseUpdate,Ki!==Ti&&(Ki===null?ko.firstBaseUpdate=go:Ki.next=go,ko.lastBaseUpdate=to))}if(li!==null){var Vo=oi.baseState;Ti=0,ko=go=to=null,Ki=li;do{var So=Ki.lane&-536870913,Bo=So!==Ki.lane;if(Bo?(Go&So)===So:(ir&So)===So){So!==0&&So===Ff&&(Ny=!0),ko!==null&&(ko=ko.next={lane:0,tag:Ki.tag,payload:Ki.payload,callback:null,next:null});e:{var Ia=l,Da=Ki;So=m;var Rs=ie;switch(Da.tag){case 1:if(Ia=Da.payload,typeof Ia=="function"){Vo=Ia.call(Rs,Vo,So);break e}Vo=Ia;break e;case 3:Ia.flags=Ia.flags&-65537|128;case 0:if(Ia=Da.payload,So=typeof Ia=="function"?Ia.call(Rs,Vo,So):Ia,So==null)break e;Vo=d({},Vo,So);break e;case 2:gd=!0}}So=Ki.callback,So!==null&&(l.flags|=64,Bo&&(l.flags|=8192),Bo=oi.callbacks,Bo===null?oi.callbacks=[So]:Bo.push(So))}else Bo={lane:So,tag:Ki.tag,payload:Ki.payload,callback:Ki.callback,next:null},ko===null?(go=ko=Bo,to=Vo):ko=ko.next=Bo,Ti|=So;if(Ki=Ki.next,Ki===null){if(Ki=oi.shared.pending,Ki===null)break;Bo=Ki,Ki=Bo.next,Bo.next=null,oi.lastBaseUpdate=Bo,oi.shared.pending=null}}while(!0);ko===null&&(to=Vo),oi.baseState=to,oi.firstBaseUpdate=go,oi.lastBaseUpdate=ko,li===null&&(oi.shared.lanes=0),pu|=Ti,l.lanes=Ti,l.memoizedState=Vo}}function Uy(l,m){if(typeof l!="function")throw Error(n(191,l));l.call(m)}function w3(l,m){var ie=l.callbacks;if(ie!==null)for(l.callbacks=null,l=0;l<ie.length;l++)Uy(ie[l],m)}var uh=F(null),Kf=F(0);function Hm(l,m){l=Es,Ye(Kf,l),Ye(uh,m),Es=l|m.baseLanes}function qy(){Ye(Kf,Es),Ye(uh,uh.current)}function Vm(){Es=Kf.current,k(uh),k(Kf)}var qu=F(null),Ys=null;function id(l){var m=l.alternate;Ye(ba,ba.current&1),Ye(qu,l),Ys===null&&(m===null||uh.current!==null||m.memoizedState!==null)&&(Ys=l)}function Ap(l){Ye(ba,ba.current),Ye(qu,l),Ys===null&&(Ys=l)}function $y(l){l.tag===22?(Ye(ba,ba.current),Ye(qu,l),Ys===null&&(Ys=l)):tc()}function tc(){Ye(ba,ba.current),Ye(qu,qu.current)}function cu(l){k(qu),Ys===l&&(Ys=null),k(ba)}var ba=F(0);function fh(l){for(var m=l;m!==null;){if(m.tag===13){var ie=m.memoizedState;if(ie!==null&&(ie=ie.dehydrated,ie===null||lv(ie)||dv(ie)))return m}else if(m.tag===19&&(m.memoizedProps.revealOrder==="forwards"||m.memoizedProps.revealOrder==="backwards"||m.memoizedProps.revealOrder==="unstable_legacy-backwards"||m.memoizedProps.revealOrder==="together")){if((m.flags&128)!==0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===l)break;for(;m.sibling===null;){if(m.return===null||m.return===l)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var rc=0,ja=null,ms=null,Vs=null,iu=!1,ch=!1,Gd=!1,Yy=0,Pf=0,Qs=null,Km=0;function Ps(){throw Error(n(321))}function Zm(l,m){if(m===null)return!1;for(var ie=0;ie<m.length&&ie<l.length;ie++)if(!ps(l[ie],m[ie]))return!1;return!0}function lh(l,m,ie,ir,oi,li){return rc=li,ja=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,ur.H=l===null||l.memoizedState===null?Ig:_g,Gd=!1,li=ie(ir,oi),Gd=!1,ch&&(li=$m(m,ie,ir,oi)),Gm(l),li}function Gm(l){ur.H=ph;var m=ms!==null&&ms.next!==null;if(rc=0,Vs=ms=ja=null,iu=!1,Pf=0,Qs=null,m)throw Error(n(300));l===null||Ks||(l=l.dependencies,l!==null&&By(l)&&(Ks=!0))}function $m(l,m,ie,ir){ja=l;var oi=0;do{if(ch&&(Qs=null),Pf=0,ch=!1,25<=oi)throw Error(n(301));if(oi+=1,Vs=ms=null,l.updateQueue!=null){var li=l.updateQueue;li.lastEffect=null,li.events=null,li.stores=null,li.memoCache!=null&&(li.memoCache.index=0)}ur.H=Gf,li=m(ie,ir)}while(ch);return li}function x3(){var l=ur.H,m=l.useState()[0];return m=typeof m.then=="function"?$h(m):m,l=l.useState()[0],(ms!==null?ms.memoizedState:null)!==l&&(ja.flags|=1024),m}function em(){var l=Yy!==0;return Yy=0,l}function Xm(l,m,ie){m.updateQueue=l.updateQueue,m.flags&=-2053,l.lanes&=~ie}function Sp(l){if(iu){for(l=l.memoizedState;l!==null;){var m=l.queue;m!==null&&(m.pending=null),l=l.next}iu=!1}rc=0,Vs=ms=ja=null,ch=!1,Pf=Yy=0,Qs=null}function Eu(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vs===null?ja.memoizedState=Vs=l:Vs=Vs.next=l,Vs}function Cs(){if(ms===null){var l=ja.alternate;l=l!==null?l.memoizedState:null}else l=ms.next;var m=Vs===null?ja.memoizedState:Vs.next;if(m!==null)Vs=m,ms=l;else{if(l===null)throw ja.alternate===null?Error(n(467)):Error(n(310));ms=l,l={memoizedState:ms.memoizedState,baseState:ms.baseState,baseQueue:ms.baseQueue,queue:ms.queue,next:null},Vs===null?ja.memoizedState=Vs=l:Vs=Vs.next=l}return Vs}function Gh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $h(l){var m=Pf;return Pf+=1,Qs===null&&(Qs=[]),l=Lm(Qs,l,m),m=ja,(Vs===null?m.memoizedState:Vs.next)===null&&(m=m.alternate,ur.H=m===null||m.memoizedState===null?Ig:_g),l}function Ip(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return $h(l);if(l.$$typeof===B)return Hs(l)}throw Error(n(438,String(l)))}function Xh(l){var m=null,ie=ja.updateQueue;if(ie!==null&&(m=ie.memoCache),m==null){var ir=ja.alternate;ir!==null&&(ir=ir.updateQueue,ir!==null&&(ir=ir.memoCache,ir!=null&&(m={data:ir.data.map(function(oi){return oi.slice()}),index:0})))}if(m==null&&(m={data:[],index:0}),ie===null&&(ie=Gh(),ja.updateQueue=ie),ie.memoCache=m,ie=m.data[m.index],ie===void 0)for(ie=m.data[m.index]=Array(l),ir=0;ir<l;ir++)ie[ir]=nr;return m.index++,ie}function nc(l,m){return typeof m=="function"?m(l):m}function Wh(l){var m=Cs();return tm(m,ms,l)}function tm(l,m,ie){var ir=l.queue;if(ir===null)throw Error(n(311));ir.lastRenderedReducer=ie;var oi=l.baseQueue,li=ir.pending;if(li!==null){if(oi!==null){var Ti=oi.next;oi.next=li.next,li.next=Ti}m.baseQueue=oi=li,ir.pending=null}if(li=l.baseState,oi===null)l.memoizedState=li;else{m=oi.next;var Ki=Ti=null,to=null,go=m,ko=!1;do{var Vo=go.lane&-536870913;if(Vo!==go.lane?(Go&Vo)===Vo:(rc&Vo)===Vo){var So=go.revertLane;if(So===0)to!==null&&(to=to.next={lane:0,revertLane:0,gesture:null,action:go.action,hasEagerState:go.hasEagerState,eagerState:go.eagerState,next:null}),Vo===Ff&&(ko=!0);else if((rc&So)===So){go=go.next,So===Ff&&(ko=!0);continue}else Vo={lane:0,revertLane:go.revertLane,gesture:null,action:go.action,hasEagerState:go.hasEagerState,eagerState:go.eagerState,next:null},to===null?(Ki=to=Vo,Ti=li):to=to.next=Vo,ja.lanes|=So,pu|=So;Vo=go.action,Gd&&ie(li,Vo),li=go.hasEagerState?go.eagerState:ie(li,Vo)}else So={lane:Vo,revertLane:go.revertLane,gesture:go.gesture,action:go.action,hasEagerState:go.hasEagerState,eagerState:go.eagerState,next:null},to===null?(Ki=to=So,Ti=li):to=to.next=So,ja.lanes|=Vo,pu|=Vo;go=go.next}while(go!==null&&go!==m);if(to===null?Ti=li:to.next=Ki,!ps(li,l.memoizedState)&&(Ks=!0,ko&&(ie=qd,ie!==null)))throw ie;l.memoizedState=li,l.baseState=Ti,l.baseQueue=to,ir.lastRenderedState=li}return oi===null&&(ir.lanes=0),[l.memoizedState,ir.dispatch]}function Zf(l){var m=Cs(),ie=m.queue;if(ie===null)throw Error(n(311));ie.lastRenderedReducer=l;var ir=ie.dispatch,oi=ie.pending,li=m.memoizedState;if(oi!==null){ie.pending=null;var Ti=oi=oi.next;do li=l(li,Ti.action),Ti=Ti.next;while(Ti!==oi);ps(li,m.memoizedState)||(Ks=!0),m.memoizedState=li,m.baseQueue===null&&(m.baseState=li),ie.lastRenderedState=li}return[li,ir]}function $d(l,m,ie){var ir=ja,oi=Cs(),li=es;if(li){if(ie===void 0)throw Error(n(407));ie=ie()}else ie=m();var Ti=!ps((ms||oi).memoizedState,ie);if(Ti&&(oi.memoizedState=ie,Ks=!0),oi=oi.queue,ag(A3.bind(null,ir,oi,l),[l]),oi.getSnapshot!==m||Ti||Vs!==null&&Vs.memoizedState.tag&1){if(ir.flags|=2048,Xd(9,{destroy:void 0},E3.bind(null,ir,oi,ie,m),null),Lo===null)throw Error(n(349));li||(rc&127)!==0||Wm(ir,m,ie)}return ie}function Wm(l,m,ie){l.flags|=16384,l={getSnapshot:m,value:ie},m=ja.updateQueue,m===null?(m=Gh(),ja.updateQueue=m,m.stores=[l]):(ie=m.stores,ie===null?m.stores=[l]:ie.push(l))}function E3(l,m,ie,ir){m.value=ie,m.getSnapshot=ir,S3(m)&&Ym(l)}function A3(l,m,ie){return ie(function(){S3(m)&&Ym(l)})}function S3(l){var m=l.getSnapshot;l=l.value;try{var ie=m();return!ps(l,ie)}catch{return!0}}function Ym(l){var m=rh(l,2);m!==null&&Xf(m,l,2)}function rm(l){var m=Eu();if(typeof l=="function"){var ie=l;if(l=ie(),Gd){Vi(!0);try{ie()}finally{Vi(!1)}}}return m.memoizedState=m.baseState=l,m.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nc,lastRenderedState:l},m}function Qm(l,m,ie,ir){return l.baseState=ie,tm(l,ms,typeof ir=="function"?ir:nc)}function I3(l,m,ie,ir,oi){if(hh(l))throw Error(n(485));if(l=m.action,l!==null){var li={payload:oi,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Ti){li.listeners.push(Ti)}};ur.T!==null?ie(!0):li.isTransition=!1,ir(li),ie=m.pending,ie===null?(li.next=m.pending=li,_3(m,li)):(li.next=ie.next,m.pending=ie.next=li)}}function _3(l,m){var ie=m.action,ir=m.payload,oi=l.state;if(m.isTransition){var li=ur.T,Ti={};ur.T=Ti;try{var Ki=ie(oi,ir),to=ur.S;to!==null&&to(Ti,Ki),T3(l,m,Ki)}catch(go){Hu(l,m,go)}finally{li!==null&&Ti.types!==null&&(li.types=Ti.types),ur.T=li}}else try{li=ie(oi,ir),T3(l,m,li)}catch(go){Hu(l,m,go)}}function T3(l,m,ie){ie!==null&&typeof ie=="object"&&typeof ie.then=="function"?ie.then(function(ir){R3(l,m,ir)},function(ir){return Hu(l,m,ir)}):R3(l,m,ie)}function R3(l,m,ie){m.status="fulfilled",m.value=ie,M3(m),l.state=ie,m=l.pending,m!==null&&(ie=m.next,ie===m?l.pending=null:(ie=ie.next,m.next=ie,_3(l,ie)))}function Hu(l,m,ie){var ir=l.pending;if(l.pending=null,ir!==null){ir=ir.next;do m.status="rejected",m.reason=ie,M3(m),m=m.next;while(m!==ir)}l.action=null}function M3(l){l=l.listeners;for(var m=0;m<l.length;m++)(0,l[m])()}function Jm(l,m){return m}function B3(l,m){if(es){var ie=Lo.formState;if(ie!==null){e:{var ir=ja;if(es){if(xs){t:{for(var oi=xs,li=Lu;oi.nodeType!==8;){if(!li){oi=null;break t}if(oi=sd(oi.nextSibling),oi===null){oi=null;break t}}li=oi.data,oi=li==="F!"||li==="F"?oi:null}if(oi){xs=sd(oi.nextSibling),ir=oi.data==="F!";break e}}pd(ir)}ir=!1}ir&&(m=ie[0])}}return ie=Eu(),ie.memoizedState=ie.baseState=m,ir={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jm,lastRenderedState:m},ie.queue=ir,ie=Ag.bind(null,ja,ir),ir.dispatch=ie,ir=rm(!1),li=Sg.bind(null,ja,!1,ir.queue),ir=Eu(),oi={state:m,dispatch:null,action:l,pending:null},ir.queue=oi,ie=I3.bind(null,ja,oi,li,ie),oi.dispatch=ie,ir.memoizedState=l,[m,ie,!1]}function nm(l){var m=Cs();return O3(m,ms,l)}function O3(l,m,ie){if(m=tm(l,m,Jm)[0],l=Wh(nc)[0],typeof m=="object"&&m!==null&&typeof m.then=="function")try{var ir=$h(m)}catch(Ti){throw Ti===Uh?wp:Ti}else ir=m;m=Cs();var oi=m.queue,li=oi.dispatch;return ie!==m.memoizedState&&(ja.flags|=2048,Xd(9,{destroy:void 0},j6.bind(null,oi,ie),null)),[ir,li,l]}function j6(l,m){l.action=m}function C3(l){var m=Cs(),ie=ms;if(ie!==null)return O3(m,ie,l);Cs(),m=m.memoizedState,ie=Cs();var ir=ie.queue.dispatch;return ie.memoizedState=l,[m,ir,!1]}function Xd(l,m,ie,ir){return l={tag:l,create:ie,deps:ir,inst:m,next:null},m=ja.updateQueue,m===null&&(m=Gh(),ja.updateQueue=m),ie=m.lastEffect,ie===null?m.lastEffect=l.next=l:(ir=ie.next,ie.next=l,l.next=ir,m.lastEffect=l),l}function ng(){return Cs().memoizedState}function im(l,m,ie,ir){var oi=Eu();ja.flags|=l,oi.memoizedState=Xd(1|m,{destroy:void 0},ie,ir===void 0?null:ir)}function om(l,m,ie,ir){var oi=Cs();ir=ir===void 0?null:ir;var li=oi.memoizedState.inst;ms!==null&&ir!==null&&Zm(ir,ms.memoizedState.deps)?oi.memoizedState=Xd(m,li,ie,ir):(ja.flags|=l,oi.memoizedState=Xd(1|m,li,ie,ir))}function F3(l,m){im(8390656,8,l,m)}function ag(l,m){om(2048,8,l,m)}function L6(l){ja.flags|=4;var m=ja.updateQueue;if(m===null)m=Gh(),ja.updateQueue=m,m.events=[l];else{var ie=m.events;ie===null?m.events=[l]:ie.push(l)}}function P3(l){var m=Cs().memoizedState;return L6({ref:m,nextImpl:l}),function(){if((Mo&2)!==0)throw Error(n(440));return m.impl.apply(void 0,arguments)}}function ug(l,m){return om(4,2,l,m)}function _p(l,m){return om(4,4,l,m)}function k3(l,m){if(typeof m=="function"){l=l();var ie=m(l);return function(){typeof ie=="function"?ie():m(null)}}if(m!=null)return l=l(),m.current=l,function(){m.current=null}}function N3(l,m,ie){ie=ie!=null?ie.concat([l]):null,om(4,4,k3.bind(null,m,l),ie)}function cg(){}function D3(l,m){var ie=Cs();m=m===void 0?null:m;var ir=ie.memoizedState;return m!==null&&Zm(m,ir[1])?ir[0]:(ie.memoizedState=[l,m],l)}function pg(l,m){var ie=Cs();m=m===void 0?null:m;var ir=ie.memoizedState;if(m!==null&&Zm(m,ir[1]))return ir[0];if(ir=l(),Gd){Vi(!0);try{l()}finally{Vi(!1)}}return ie.memoizedState=[ir,m],ir}function am(l,m,ie){return ie===void 0||(rc&1073741824)!==0&&(Go&261930)===0?l.memoizedState=m:(l.memoizedState=ie,l=_v(),ja.lanes|=l,pu|=l,ie)}function U3(l,m,ie,ir){return ps(ie,m)?ie:uh.current!==null?(l=am(l,ie,ir),ps(l,m)||(Ks=!0),l):(rc&42)===0||(rc&1073741824)!==0&&(Go&261930)===0?(Ks=!0,l.memoizedState=ie):(l=_v(),ja.lanes|=l,pu|=l,m)}function j3(l,m,ie,ir,oi){var li=ue.p;ue.p=li!==0&&8>li?li:8;var Ti=ur.T,Ki={};ur.T=Ki,Sg(l,!1,m,ie);try{var to=oi(),go=ur.S;if(go!==null&&go(Ki,to),to!==null&&typeof to=="object"&&typeof to.then=="function"){var ko=v3(to,ir);Mp(l,m,ko,Hl(l))}else Mp(l,m,ir,Hl(l))}catch(Vo){Mp(l,m,{then:function(){},status:"rejected",reason:Vo},Hl())}finally{ue.p=li,Ti!==null&&Ki.types!==null&&(Ti.types=Ki.types),ur.T=Ti}}function q6(){}function Yh(l,m,ie,ir){if(l.tag!==5)throw Error(n(476));var oi=L3(l).queue;j3(l,oi,m,bt,ie===null?q6:function(){return q3(l),ie(ir)})}function L3(l){var m=l.memoizedState;if(m!==null)return m;m={memoizedState:bt,baseState:bt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nc,lastRenderedState:bt},next:null};var ie={};return m.next={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nc,lastRenderedState:ie},next:null},l.memoizedState=m,l=l.alternate,l!==null&&(l.memoizedState=m),m}function q3(l){var m=L3(l);m.next===null&&(m=l.alternate.memoizedState),Mp(l,m.next.queue,{},Hl())}function Qh(){return Hs(Gb)}function gg(){return Cs().memoizedState}function wg(){return Cs().memoizedState}function xg(l){for(var m=l.return;m!==null;){switch(m.tag){case 24:case 3:var ie=Hl();l=bd(ie);var ir=Jf(m,l,ie);ir!==null&&(Xf(ir,m,ie),sh(ir,m,ie)),m={cache:mp()},l.payload=m;return}m=m.return}}function z3(l,m,ie){var ir=Hl();ie={lane:ir,revertLane:0,gesture:null,action:ie,hasEagerState:!1,eagerState:null,next:null},hh(l)?Op(m,ie):(ie=Dm(l,m,ie,ir),ie!==null&&(Xf(ie,l,ir),H3(ie,m,ir)))}function Ag(l,m,ie){var ir=Hl();Mp(l,m,ie,ir)}function Mp(l,m,ie,ir){var oi={lane:ir,revertLane:0,gesture:null,action:ie,hasEagerState:!1,eagerState:null,next:null};if(hh(l))Op(m,oi);else{var li=l.alternate;if(l.lanes===0&&(li===null||li.lanes===0)&&(li=m.lastRenderedReducer,li!==null))try{var Ti=m.lastRenderedState,Ki=li(Ti,ie);if(oi.hasEagerState=!0,oi.eagerState=Ki,ps(Ki,Ti))return lp(l,m,oi,0),Lo===null&&cp(),!1}catch{}finally{}if(ie=Dm(l,m,oi,ir),ie!==null)return Xf(ie,l,ir),H3(ie,m,ir),!0}return!1}function Sg(l,m,ie,ir){if(ir={lane:2,revertLane:J6(),gesture:null,action:ir,hasEagerState:!1,eagerState:null,next:null},hh(l)){if(m)throw Error(n(479))}else m=Dm(l,ie,ir,2),m!==null&&Xf(m,l,2)}function hh(l){var m=l.alternate;return l===ja||m!==null&&m===ja}function Op(l,m){ch=iu=!0;var ie=l.pending;ie===null?m.next=m:(m.next=ie.next,ie.next=m),l.pending=m}function H3(l,m,ie){if((ie&4194048)!==0){var ir=m.lanes;ir&=l.pendingLanes,ie|=ir,m.lanes=ie,wo(l,ie)}}var ph={readContext:Hs,use:Ip,useCallback:Ps,useContext:Ps,useEffect:Ps,useImperativeHandle:Ps,useLayoutEffect:Ps,useInsertionEffect:Ps,useMemo:Ps,useReducer:Ps,useRef:Ps,useState:Ps,useDebugValue:Ps,useDeferredValue:Ps,useTransition:Ps,useSyncExternalStore:Ps,useId:Ps,useHostTransitionStatus:Ps,useFormState:Ps,useActionState:Ps,useOptimistic:Ps,useMemoCache:Ps,useCacheRefresh:Ps};ph.useEffectEvent=Ps;var Ig={readContext:Hs,use:Ip,useCallback:function(l,m){return Eu().memoizedState=[l,m===void 0?null:m],l},useContext:Hs,useEffect:F3,useImperativeHandle:function(l,m,ie){ie=ie!=null?ie.concat([l]):null,im(4194308,4,k3.bind(null,m,l),ie)},useLayoutEffect:function(l,m){return im(4194308,4,l,m)},useInsertionEffect:function(l,m){im(4,2,l,m)},useMemo:function(l,m){var ie=Eu();m=m===void 0?null:m;var ir=l();if(Gd){Vi(!0);try{l()}finally{Vi(!1)}}return ie.memoizedState=[ir,m],ir},useReducer:function(l,m,ie){var ir=Eu();if(ie!==void 0){var oi=ie(m);if(Gd){Vi(!0);try{ie(m)}finally{Vi(!1)}}}else oi=m;return ir.memoizedState=ir.baseState=oi,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:oi},ir.queue=l,l=l.dispatch=z3.bind(null,ja,l),[ir.memoizedState,l]},useRef:function(l){var m=Eu();return l={current:l},m.memoizedState=l},useState:function(l){l=rm(l);var m=l.queue,ie=Ag.bind(null,ja,m);return m.dispatch=ie,[l.memoizedState,ie]},useDebugValue:cg,useDeferredValue:function(l,m){var ie=Eu();return am(ie,l,m)},useTransition:function(){var l=rm(!1);return l=j3.bind(null,ja,l.queue,!0,!1),Eu().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,m,ie){var ir=ja,oi=Eu();if(es){if(ie===void 0)throw Error(n(407));ie=ie()}else{if(ie=m(),Lo===null)throw Error(n(349));(Go&127)!==0||Wm(ir,m,ie)}oi.memoizedState=ie;var li={value:ie,getSnapshot:m};return oi.queue=li,F3(A3.bind(null,ir,li,l),[l]),ir.flags|=2048,Xd(9,{destroy:void 0},E3.bind(null,ir,li,ie,m),null),ie},useId:function(){var l=Eu(),m=Lo.identifierPrefix;if(es){var ie=vu,ir=Cf;ie=(ir&~(1<<32-Hi(ir)-1)).toString(32)+ie,m="_"+m+"R_"+ie,ie=Yy++,0<ie&&(m+="H"+ie.toString(32)),m+="_"}else ie=Km++,m="_"+m+"r_"+ie.toString(32)+"_";return l.memoizedState=m},useHostTransitionStatus:Qh,useFormState:B3,useActionState:B3,useOptimistic:function(l){var m=Eu();m.memoizedState=m.baseState=l;var ie={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return m.queue=ie,m=Sg.bind(null,ja,!0,ie),ie.dispatch=m,[l,m]},useMemoCache:Xh,useCacheRefresh:function(){return Eu().memoizedState=xg.bind(null,ja)},useEffectEvent:function(l){var m=Eu(),ie={impl:l};return m.memoizedState=ie,function(){if((Mo&2)!==0)throw Error(n(440));return ie.impl.apply(void 0,arguments)}}},_g={readContext:Hs,use:Ip,useCallback:D3,useContext:Hs,useEffect:ag,useImperativeHandle:N3,useInsertionEffect:ug,useLayoutEffect:_p,useMemo:pg,useReducer:Wh,useRef:ng,useState:function(){return Wh(nc)},useDebugValue:cg,useDeferredValue:function(l,m){var ie=Cs();return U3(ie,ms.memoizedState,l,m)},useTransition:function(){var l=Wh(nc)[0],m=Cs().memoizedState;return[typeof l=="boolean"?l:$h(l),m]},useSyncExternalStore:$d,useId:gg,useHostTransitionStatus:Qh,useFormState:nm,useActionState:nm,useOptimistic:function(l,m){var ie=Cs();return Qm(ie,ms,l,m)},useMemoCache:Xh,useCacheRefresh:wg};_g.useEffectEvent=P3;var Gf={readContext:Hs,use:Ip,useCallback:D3,useContext:Hs,useEffect:ag,useImperativeHandle:N3,useInsertionEffect:ug,useLayoutEffect:_p,useMemo:pg,useReducer:Zf,useRef:ng,useState:function(){return Zf(nc)},useDebugValue:cg,useDeferredValue:function(l,m){var ie=Cs();return ms===null?am(ie,l,m):U3(ie,ms.memoizedState,l,m)},useTransition:function(){var l=Zf(nc)[0],m=Cs().memoizedState;return[typeof l=="boolean"?l:$h(l),m]},useSyncExternalStore:$d,useId:gg,useHostTransitionStatus:Qh,useFormState:C3,useActionState:C3,useOptimistic:function(l,m){var ie=Cs();return ms!==null?Qm(ie,ms,l,m):(ie.baseState=l,[l,ie.queue.dispatch])},useMemoCache:Xh,useCacheRefresh:wg};Gf.useEffectEvent=P3;function Tg(l,m,ie,ir){m=l.memoizedState,ie=ie(ir,m),ie=ie==null?m:d({},m,ie),l.memoizedState=ie,l.lanes===0&&(l.updateQueue.baseState=ie)}var Rg={enqueueSetState:function(l,m,ie){l=l._reactInternals;var ir=Hl(),oi=bd(ir);oi.payload=m,ie!=null&&(oi.callback=ie),m=Jf(l,oi,ir),m!==null&&(Xf(m,l,ir),sh(m,l,ir))},enqueueReplaceState:function(l,m,ie){l=l._reactInternals;var ir=Hl(),oi=bd(ir);oi.tag=1,oi.payload=m,ie!=null&&(oi.callback=ie),m=Jf(l,oi,ir),m!==null&&(Xf(m,l,ir),sh(m,l,ir))},enqueueForceUpdate:function(l,m){l=l._reactInternals;var ie=Hl(),ir=bd(ie);ir.tag=2,m!=null&&(ir.callback=m),m=Jf(l,ir,ie),m!==null&&(Xf(m,l,ie),sh(m,l,ie))}};function Yd(l,m,ie,ir,oi,li,Ti){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(ir,li,Ti):m.prototype&&m.prototype.isPureReactComponent?!$s(ie,ir)||!$s(oi,li):!0}function Ka(l,m,ie,ir){l=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(ie,ir),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(ie,ir),m.state!==l&&Rg.enqueueReplaceState(m,m.state,null)}function yh(l,m){var ie=m;if("ref"in m){ie={};for(var ir in m)ir!=="ref"&&(ie[ir]=m[ir])}if(l=l.defaultProps){ie===m&&(ie=d({},ie));for(var oi in l)ie[oi]===void 0&&(ie[oi]=l[oi])}return ie}function Cu(l){jf(l)}function js(l){console.error(l)}function vd(l){jf(l)}function sm(l,m){try{var ie=l.onUncaughtError;ie(m.value,{componentStack:m.stack})}catch(ir){setTimeout(function(){throw ir})}}function um(l,m,ie){try{var ir=l.onCaughtError;ir(ie.value,{componentStack:ie.stack,errorBoundary:m.tag===1?m.stateNode:null})}catch(oi){setTimeout(function(){throw oi})}}function Ml(l,m,ie){return ie=bd(ie),ie.tag=3,ie.payload={element:null},ie.callback=function(){sm(l,m)},ie}function Mg(l){return l=bd(l),l.tag=3,l}function Cp(l,m,ie,ir){var oi=ie.type.getDerivedStateFromError;if(typeof oi=="function"){var li=ir.value;l.payload=function(){return oi(li)},l.callback=function(){um(m,ie,ir)}}var Ti=ie.stateNode;Ti!==null&&typeof Ti.componentDidCatch=="function"&&(l.callback=function(){um(m,ie,ir),typeof oi!="function"&&(Dl===null?Dl=new Set([this]):Dl.add(this));var Ki=ir.stack;this.componentDidCatch(ir.value,{componentStack:Ki!==null?Ki:""})})}function Ds(l,m,ie,ir,oi){if(ie.flags|=32768,ir!==null&&typeof ir=="object"&&typeof ir.then=="function"){if(m=ie.alternate,m!==null&&Va(m,ie,oi,!0),ie=qu.current,ie!==null){switch(ie.tag){case 31:case 13:return Ys===null?o6():ie.alternate===null&&is===0&&(is=3),ie.flags&=-257,ie.flags|=65536,ie.lanes=oi,ir===xp?ie.flags|=16384:(m=ie.updateQueue,m===null?ie.updateQueue=new Set([ir]):m.add(ir),W6(l,ir,oi)),!1;case 22:return ie.flags|=65536,ir===xp?ie.flags|=16384:(m=ie.updateQueue,m===null?(m={transitions:null,markerInstances:null,retryQueue:new Set([ir])},ie.updateQueue=m):(ie=m.retryQueue,ie===null?m.retryQueue=new Set([ir]):ie.add(ir)),W6(l,ir,oi)),!1}throw Error(n(435,ie.tag))}return W6(l,ir,oi),o6(),!1}if(es)return m=qu.current,m!==null?((m.flags&65536)===0&&(m.flags|=256),m.flags|=65536,m.lanes=oi,ir!==my&&(l=Error(n(422),{cause:ir}),jd(qf(l,ie)))):(ir!==my&&(m=Error(n(423),{cause:ir}),jd(qf(m,ie))),l=l.current.alternate,l.flags|=65536,oi&=-oi,l.lanes|=oi,ir=qf(ir,ie),oi=Ml(l.stateNode,ir,oi),Kh(l,oi),is!==4&&(is=2)),!1;var li=Error(n(520),{cause:ir});if(li=qf(li,ie),Nl===null?Nl=[li]:Nl.push(li),is!==4&&(is=2),m===null)return!0;ir=qf(ir,ie),ie=m;do{switch(ie.tag){case 3:return ie.flags|=65536,l=oi&-oi,ie.lanes|=l,l=Ml(ie.stateNode,ir,l),Kh(ie,l),!1;case 1:if(m=ie.type,li=ie.stateNode,(ie.flags&128)===0&&(typeof m.getDerivedStateFromError=="function"||li!==null&&typeof li.componentDidCatch=="function"&&(Dl===null||!Dl.has(li))))return ie.flags|=65536,oi&=-oi,ie.lanes|=oi,oi=Mg(oi),Cp(oi,l,ie,ir),Kh(ie,oi),!1}ie=ie.return}while(ie!==null);return!1}var ks=Error(n(461)),Ks=!1;function lu(l,m,ie,ir){m.child=l===null?qh(m,null,ie,ir):Vf(m,l.child,ie,ir)}function Jh(l,m,ie,ir,oi){ie=ie.render;var li=m.ref;if("ref"in ir){var Ti={};for(var Ki in ir)Ki!=="ref"&&(Ti[Ki]=ir[Ki])}else Ti=ir;return ah(m),ir=lh(l,m,ie,Ti,li,oi),Ki=em(),l!==null&&!Ks?(Xm(l,m,oi),wd(l,m,oi)):(es&&Ki&&dp(m),m.flags|=1,lu(l,m,ir,oi),m.child)}function fm(l,m,ie,ir,oi){if(l===null){var li=ie.type;return typeof li=="function"&&!Yf(li)&&li.defaultProps===void 0&&ie.compare===null?(m.tag=15,m.type=li,Bg(l,m,li,ir,oi)):(l=Iu(ie.type,null,ir,m,m.mode,oi),l.ref=m.ref,l.return=m,m.child=l)}if(li=l.child,!Bb(l,oi)){var Ti=li.memoizedProps;if(ie=ie.compare,ie=ie!==null?ie:$s,ie(Ti,ir)&&l.ref===m.ref)return wd(l,m,oi)}return m.flags|=1,l=Qf(li,ir),l.ref=m.ref,l.return=m,m.child=l}function Bg(l,m,ie,ir,oi){if(l!==null){var li=l.memoizedProps;if($s(li,ir)&&l.ref===m.ref)if(Ks=!1,m.pendingProps=ir=li,Bb(l,oi))(l.flags&131072)!==0&&(Ks=!0);else return m.lanes=l.lanes,wd(l,m,oi)}return $a(l,m,ie,ir,oi)}function Pp(l,m,ie,ir){var oi=ir.children,li=l!==null?l.memoizedState:null;if(l===null&&m.stateNode===null&&(m.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),ir.mode==="hidden"){if((m.flags&128)!==0){if(li=li!==null?li.baseLanes|ie:ie,l!==null){for(ir=m.child=l.child,oi=0;ir!==null;)oi=oi|ir.lanes|ir.childLanes,ir=ir.sibling;ir=oi&~li}else ir=0,m.child=null;return mh(l,m,li,ie,ir)}if((ie&536870912)!==0)m.memoizedState={baseLanes:0,cachePool:null},l!==null&&Dh(m,li!==null?li.cachePool:null),li!==null?Hm(m,li):qy(),$y(m);else return ir=m.lanes=536870912,mh(l,m,li!==null?li.baseLanes|ie:ie,ie,ir)}else li!==null?(Dh(m,li.cachePool),Hm(m,li),tc(),m.memoizedState=null):(l!==null&&Dh(m,null),qy(),tc());return lu(l,m,oi,ie),m.child}function hu(l,m){return l!==null&&l.tag===22||m.stateNode!==null||(m.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.sibling}function mh(l,m,ie,ir,oi){var li=vp();return li=li===null?null:{parent:Ns._currentValue,pool:li},m.memoizedState={baseLanes:ie,cachePool:li},l!==null&&Dh(m,null),qy(),$y(m),l!==null&&Va(l,m,ir,!0),m.childLanes=oi,null}function cm(l,m){return m=dm({mode:m.mode,children:m.children},l.mode),m.ref=l.ref,l.child=m,m.return=l,m}function V3(l,m,ie){return Vf(m,l.child,null,ie),l=cm(m,m.pendingProps),l.flags|=2,cu(m),m.memoizedState=null,l}function K3(l,m,ie){var ir=m.pendingProps,oi=(m.flags&128)!==0;if(m.flags&=-129,l===null){if(es){if(ir.mode==="hidden")return l=cm(m,ir),m.lanes=536870912,hu(null,l);if(Ap(m),(l=xs)?(l=f8(l,Lu),l=l!==null&&l.data==="&"?l:null,l!==null&&(m.memoizedState={dehydrated:l,treeContext:Yl!==null?{id:Cf,overflow:vu}:null,retryLane:536870912,hydrationErrors:null},ie=Ph(l),ie.return=m,m.child=ie,nu=m,xs=null)):l=null,l===null)throw pd(m);return m.lanes=536870912,null}return cm(m,ir)}var li=l.memoizedState;if(li!==null){var Ti=li.dehydrated;if(Ap(m),oi)if(m.flags&256)m.flags&=-257,m=V3(l,m,ie);else if(m.memoizedState!==null)m.child=l.child,m.flags|=128,m=null;else throw Error(n(558));else if(Ks||Va(l,m,ie,!1),oi=(ie&l.childLanes)!==0,Ks||oi){if(ir=Lo,ir!==null&&(Ti=xi(ir,ie),Ti!==0&&Ti!==li.retryLane))throw li.retryLane=Ti,rh(l,Ti),Xf(ir,l,Ti),ks;o6(),m=V3(l,m,ie)}else l=li.treeContext,xs=sd(Ti.nextSibling),nu=m,es=!0,zf=null,Lu=!1,l!==null&&m3(m,l),m=cm(m,ir),m.flags|=4096;return m}return l=Qf(l.child,{mode:ir.mode,children:ir.children}),l.ref=m.ref,m.child=l,l.return=m,l}function $f(l,m){var ie=m.ref;if(ie===null)l!==null&&l.ref!==null&&(m.flags|=4194816);else{if(typeof ie!="function"&&typeof ie!="object")throw Error(n(284));(l===null||l.ref!==ie)&&(m.flags|=4194816)}}function $a(l,m,ie,ir,oi){return ah(m),ie=lh(l,m,ie,ir,void 0,oi),ir=em(),l!==null&&!Ks?(Xm(l,m,oi),wd(l,m,oi)):(es&&ir&&dp(m),m.flags|=1,lu(l,m,ie,oi),m.child)}function Cg(l,m,ie,ir,oi,li){return ah(m),m.updateQueue=null,ie=$m(m,ir,ie,oi),Gm(l),ir=em(),l!==null&&!Ks?(Xm(l,m,li),wd(l,m,li)):(es&&ir&&dp(m),m.flags|=1,lu(l,m,ie,li),m.child)}function kf(l,m,ie,ir,oi){if(ah(m),m.stateNode===null){var li=dd,Ti=ie.contextType;typeof Ti=="object"&&Ti!==null&&(li=Hs(Ti)),li=new ie(ir,li),m.memoizedState=li.state!==null&&li.state!==void 0?li.state:null,li.updater=Rg,m.stateNode=li,li._reactInternals=m,li=m.stateNode,li.props=ir,li.state=m.memoizedState,li.refs={},ky(m),Ti=ie.contextType,li.context=typeof Ti=="object"&&Ti!==null?Hs(Ti):dd,li.state=m.memoizedState,Ti=ie.getDerivedStateFromProps,typeof Ti=="function"&&(Tg(m,ie,Ti,ir),li.state=m.memoizedState),typeof ie.getDerivedStateFromProps=="function"||typeof li.getSnapshotBeforeUpdate=="function"||typeof li.UNSAFE_componentWillMount!="function"&&typeof li.componentWillMount!="function"||(Ti=li.state,typeof li.componentWillMount=="function"&&li.componentWillMount(),typeof li.UNSAFE_componentWillMount=="function"&&li.UNSAFE_componentWillMount(),Ti!==li.state&&Rg.enqueueReplaceState(li,li.state,null),Zh(m,ir,li,oi),Zd(),li.state=m.memoizedState),typeof li.componentDidMount=="function"&&(m.flags|=4194308),ir=!0}else if(l===null){li=m.stateNode;var Ki=m.memoizedProps,to=yh(ie,Ki);li.props=to;var go=li.context,ko=ie.contextType;Ti=dd,typeof ko=="object"&&ko!==null&&(Ti=Hs(ko));var Vo=ie.getDerivedStateFromProps;ko=typeof Vo=="function"||typeof li.getSnapshotBeforeUpdate=="function",Ki=m.pendingProps!==Ki,ko||typeof li.UNSAFE_componentWillReceiveProps!="function"&&typeof li.componentWillReceiveProps!="function"||(Ki||go!==Ti)&&Ka(m,li,ir,Ti),gd=!1;var So=m.memoizedState;li.state=So,Zh(m,ir,li,oi),Zd(),go=m.memoizedState,Ki||So!==go||gd?(typeof Vo=="function"&&(Tg(m,ie,Vo,ir),go=m.memoizedState),(to=gd||Yd(m,ie,to,ir,So,go,Ti))?(ko||typeof li.UNSAFE_componentWillMount!="function"&&typeof li.componentWillMount!="function"||(typeof li.componentWillMount=="function"&&li.componentWillMount(),typeof li.UNSAFE_componentWillMount=="function"&&li.UNSAFE_componentWillMount()),typeof li.componentDidMount=="function"&&(m.flags|=4194308)):(typeof li.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=ir,m.memoizedState=go),li.props=ir,li.state=go,li.context=Ti,ir=to):(typeof li.componentDidMount=="function"&&(m.flags|=4194308),ir=!1)}else{li=m.stateNode,Vh(l,m),Ti=m.memoizedProps,ko=yh(ie,Ti),li.props=ko,Vo=m.pendingProps,So=li.context,go=ie.contextType,to=dd,typeof go=="object"&&go!==null&&(to=Hs(go)),Ki=ie.getDerivedStateFromProps,(go=typeof Ki=="function"||typeof li.getSnapshotBeforeUpdate=="function")||typeof li.UNSAFE_componentWillReceiveProps!="function"&&typeof li.componentWillReceiveProps!="function"||(Ti!==Vo||So!==to)&&Ka(m,li,ir,to),gd=!1,So=m.memoizedState,li.state=So,Zh(m,ir,li,oi),Zd();var Bo=m.memoizedState;Ti!==Vo||So!==Bo||gd||l!==null&&l.dependencies!==null&&By(l.dependencies)?(typeof Ki=="function"&&(Tg(m,ie,Ki,ir),Bo=m.memoizedState),(ko=gd||Yd(m,ie,ko,ir,So,Bo,to)||l!==null&&l.dependencies!==null&&By(l.dependencies))?(go||typeof li.UNSAFE_componentWillUpdate!="function"&&typeof li.componentWillUpdate!="function"||(typeof li.componentWillUpdate=="function"&&li.componentWillUpdate(ir,Bo,to),typeof li.UNSAFE_componentWillUpdate=="function"&&li.UNSAFE_componentWillUpdate(ir,Bo,to)),typeof li.componentDidUpdate=="function"&&(m.flags|=4),typeof li.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof li.componentDidUpdate!="function"||Ti===l.memoizedProps&&So===l.memoizedState||(m.flags|=4),typeof li.getSnapshotBeforeUpdate!="function"||Ti===l.memoizedProps&&So===l.memoizedState||(m.flags|=1024),m.memoizedProps=ir,m.memoizedState=Bo),li.props=ir,li.state=Bo,li.context=to,ir=ko):(typeof li.componentDidUpdate!="function"||Ti===l.memoizedProps&&So===l.memoizedState||(m.flags|=4),typeof li.getSnapshotBeforeUpdate!="function"||Ti===l.memoizedProps&&So===l.memoizedState||(m.flags|=1024),ir=!1)}return li=ir,$f(l,m),ir=(m.flags&128)!==0,li||ir?(li=m.stateNode,ie=ir&&typeof ie.getDerivedStateFromError!="function"?null:li.render(),m.flags|=1,l!==null&&ir?(m.child=Vf(m,l.child,null,oi),m.child=Vf(m,null,ie,oi)):lu(l,m,ie,oi),m.memoizedState=li.state,l=m.child):l=wd(l,m,oi),l}function Pg(l,m,ie,ir){return Ud(),m.flags|=256,lu(l,m,ie,ir),m.child}var ds={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kg(l){return{baseLanes:l,cachePool:yd()}}function lm(l,m,ie){return l=l!==null?l.childLanes&~ie:0,m&&(l|=tu),l}function Np(l,m,ie){var ir=m.pendingProps,oi=!1,li=(m.flags&128)!==0,Ti;if((Ti=li)||(Ti=l!==null&&l.memoizedState===null?!1:(ba.current&2)!==0),Ti&&(oi=!0,m.flags&=-129),Ti=(m.flags&32)!==0,m.flags&=-33,l===null){if(es){if(oi?id(m):tc(),(l=xs)?(l=f8(l,Lu),l=l!==null&&l.data!=="&"?l:null,l!==null&&(m.memoizedState={dehydrated:l,treeContext:Yl!==null?{id:Cf,overflow:vu}:null,retryLane:536870912,hydrationErrors:null},ie=Ph(l),ie.return=m,m.child=ie,nu=m,xs=null)):l=null,l===null)throw pd(m);return dv(l)?m.lanes=32:m.lanes=536870912,null}var Ki=ir.children;return ir=ir.fallback,oi?(tc(),oi=m.mode,Ki=dm({mode:"hidden",children:Ki},oi),ir=Dd(ir,oi,ie,null),Ki.return=m,ir.return=m,Ki.sibling=ir,m.child=Ki,ir=m.child,ir.memoizedState=kg(ie),ir.childLanes=lm(l,Ti,ie),m.memoizedState=ds,hu(null,ir)):(id(m),xb(m,Ki))}var to=l.memoizedState;if(to!==null&&(Ki=to.dehydrated,Ki!==null)){if(li)m.flags&256?(id(m),m.flags&=-257,m=Rb(l,m,ie)):m.memoizedState!==null?(tc(),m.child=l.child,m.flags|=128,m=null):(tc(),Ki=ir.fallback,oi=m.mode,ir=dm({mode:"visible",children:ir.children},oi),Ki=Dd(Ki,oi,ie,null),Ki.flags|=2,ir.return=m,Ki.return=m,ir.sibling=Ki,m.child=ir,Vf(m,l.child,null,ie),ir=m.child,ir.memoizedState=kg(ie),ir.childLanes=lm(l,Ti,ie),m.memoizedState=ds,m=hu(null,ir));else if(id(m),dv(Ki)){if(Ti=Ki.nextSibling&&Ki.nextSibling.dataset,Ti)var go=Ti.dgst;Ti=go,ir=Error(n(419)),ir.stack="",ir.digest=Ti,jd({value:ir,source:null,stack:null}),m=Rb(l,m,ie)}else if(Ks||Va(l,m,ie,!1),Ti=(ie&l.childLanes)!==0,Ks||Ti){if(Ti=Lo,Ti!==null&&(ir=xi(Ti,ie),ir!==0&&ir!==to.retryLane))throw to.retryLane=ir,rh(l,ir),Xf(Ti,l,ir),ks;lv(Ki)||o6(),m=Rb(l,m,ie)}else lv(Ki)?(m.flags|=192,m.child=l.child,m=null):(l=to.treeContext,xs=sd(Ki.nextSibling),nu=m,es=!0,zf=null,Lu=!1,l!==null&&m3(m,l),m=xb(m,ir.children),m.flags|=4096);return m}return oi?(tc(),Ki=ir.fallback,oi=m.mode,to=l.child,go=to.sibling,ir=Qf(to,{mode:"hidden",children:ir.children}),ir.subtreeFlags=to.subtreeFlags&65011712,go!==null?Ki=Qf(go,Ki):(Ki=Dd(Ki,oi,ie,null),Ki.flags|=2),Ki.return=m,ir.return=m,ir.sibling=Ki,m.child=ir,hu(null,ir),ir=m.child,Ki=l.child.memoizedState,Ki===null?Ki=kg(ie):(oi=Ki.cachePool,oi!==null?(to=Ns._currentValue,oi=oi.parent!==to?{parent:to,pool:to}:oi):oi=yd(),Ki={baseLanes:Ki.baseLanes|ie,cachePool:oi}),ir.memoizedState=Ki,ir.childLanes=lm(l,Ti,ie),m.memoizedState=ds,hu(l.child,ir)):(id(m),ie=l.child,l=ie.sibling,ie=Qf(ie,{mode:"visible",children:ir.children}),ie.return=m,ie.sibling=null,l!==null&&(Ti=m.deletions,Ti===null?(m.deletions=[l],m.flags|=16):Ti.push(l)),m.child=ie,m.memoizedState=null,ie)}function xb(l,m){return m=dm({mode:"visible",children:m},l.mode),m.return=l,l.child=m}function dm(l,m){return l=ju(22,l,null,m),l.lanes=0,l}function Rb(l,m,ie){return Vf(m,l.child,null,ie),l=xb(m,m.pendingProps.children),l.flags|=2,m.memoizedState=null,l}function Z3(l,m,ie){l.lanes|=m;var ir=l.alternate;ir!==null&&(ir.lanes|=m),hp(l.return,m,ie)}function Dp(l,m,ie,ir,oi,li){var Ti=l.memoizedState;Ti===null?l.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:ir,tail:ie,tailMode:oi,treeForkCount:li}:(Ti.isBackwards=m,Ti.rendering=null,Ti.renderingStartTime=0,Ti.last=ir,Ti.tail=ie,Ti.tailMode=oi,Ti.treeForkCount=li)}function hm(l,m,ie){var ir=m.pendingProps,oi=ir.revealOrder,li=ir.tail;ir=ir.children;var Ti=ba.current,Ki=(Ti&2)!==0;if(Ki?(Ti=Ti&1|2,m.flags|=128):Ti&=1,Ye(ba,Ti),lu(l,m,ir,ie),ir=es?ih:0,!Ki&&l!==null&&(l.flags&128)!==0)e:for(l=m.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Z3(l,ie,m);else if(l.tag===19)Z3(l,ie,m);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===m)break e;for(;l.sibling===null;){if(l.return===null||l.return===m)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(oi){case"forwards":for(ie=m.child,oi=null;ie!==null;)l=ie.alternate,l!==null&&fh(l)===null&&(oi=ie),ie=ie.sibling;ie=oi,ie===null?(oi=m.child,m.child=null):(oi=ie.sibling,ie.sibling=null),Dp(m,!1,oi,ie,li,ir);break;case"backwards":case"unstable_legacy-backwards":for(ie=null,oi=m.child,m.child=null;oi!==null;){if(l=oi.alternate,l!==null&&fh(l)===null){m.child=oi;break}l=oi.sibling,oi.sibling=ie,ie=oi,oi=l}Dp(m,!0,ie,null,li,ir);break;case"together":Dp(m,!1,null,null,void 0,ir);break;default:m.memoizedState=null}return m.child}function wd(l,m,ie){if(l!==null&&(m.dependencies=l.dependencies),pu|=m.lanes,(ie&m.childLanes)===0)if(l!==null){if(Va(l,m,ie,!1),(ie&m.childLanes)===0)return null}else return null;if(l!==null&&m.child!==l.child)throw Error(n(153));if(m.child!==null){for(l=m.child,ie=Qf(l,l.pendingProps),m.child=ie,ie.return=m;l.sibling!==null;)l=l.sibling,ie=ie.sibling=Qf(l,l.pendingProps),ie.return=m;ie.sibling=null}return m.child}function Bb(l,m){return(l.lanes&m)!==0?!0:(l=l.dependencies,!!(l!==null&&By(l)))}function z6(l,m,ie){switch(m.tag){case 3:ri(m,m.stateNode.containerInfo),td(m,Ns,l.memoizedState.cache),Ud();break;case 27:case 5:lr(m);break;case 4:ri(m,m.stateNode.containerInfo);break;case 10:td(m,m.type,m.memoizedProps.value);break;case 31:if(m.memoizedState!==null)return m.flags|=128,Ap(m),null;break;case 13:var ir=m.memoizedState;if(ir!==null)return ir.dehydrated!==null?(id(m),m.flags|=128,null):(ie&m.child.childLanes)!==0?Np(l,m,ie):(id(m),l=wd(l,m,ie),l!==null?l.sibling:null);id(m);break;case 19:var oi=(l.flags&128)!==0;if(ir=(ie&m.childLanes)!==0,ir||(Va(l,m,ie,!1),ir=(ie&m.childLanes)!==0),oi){if(ir)return hm(l,m,ie);m.flags|=128}if(oi=m.memoizedState,oi!==null&&(oi.rendering=null,oi.tail=null,oi.lastEffect=null),Ye(ba,ba.current),ir)break;return null;case 22:return m.lanes=0,Pp(l,m,ie,m.pendingProps);case 24:td(m,Ns,l.memoizedState.cache)}return wd(l,m,ie)}function su(l,m,ie){if(l!==null)if(l.memoizedProps!==m.pendingProps)Ks=!0;else{if(!Bb(l,ie)&&(m.flags&128)===0)return Ks=!1,z6(l,m,ie);Ks=(l.flags&131072)!==0}else Ks=!1,es&&(m.flags&1048576)!==0&&xu(m,ih,m.index);switch(m.lanes=0,m.tag){case 16:e:{var ir=m.pendingProps;if(l=Hd(m.elementType),m.type=l,typeof l=="function")Yf(l)?(ir=yh(l,ir),m.tag=1,m=kf(null,m,l,ir,ie)):(m.tag=0,m=$a(null,m,l,ir,ie));else{if(l!=null){var oi=l.$$typeof;if(oi===ae){m.tag=11,m=Jh(null,m,l,ir,ie);break e}else if(oi===ve){m.tag=14,m=fm(null,m,l,ir,ie);break e}}throw m=se(l)||l,Error(n(306,m,""))}}return m;case 0:return $a(l,m,m.type,m.pendingProps,ie);case 1:return ir=m.type,oi=yh(ir,m.pendingProps),kf(l,m,ir,oi,ie);case 3:e:{if(ri(m,m.stateNode.containerInfo),l===null)throw Error(n(387));ir=m.pendingProps;var li=m.memoizedState;oi=li.element,Vh(l,m),Zh(m,ir,null,ie);var Ti=m.memoizedState;if(ir=Ti.cache,td(m,Ns,ir),ir!==li.cache&&pp(m,[Ns],ie,!0),Zd(),ir=Ti.element,li.isDehydrated)if(li={element:ir,isDehydrated:!1,cache:Ti.cache},m.updateQueue.baseState=li,m.memoizedState=li,m.flags&256){m=Pg(l,m,ir,ie);break e}else if(ir!==oi){oi=qf(Error(n(424)),m),jd(oi),m=Pg(l,m,ir,ie);break e}else{switch(l=m.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(xs=sd(l.firstChild),nu=m,es=!0,zf=null,Lu=!0,ie=qh(m,null,ir,ie),m.child=ie;ie;)ie.flags=ie.flags&-3|4096,ie=ie.sibling}else{if(Ud(),ir===oi){m=wd(l,m,ie);break e}lu(l,m,ir,ie)}m=m.child}return m;case 26:return $f(l,m),l===null?(ie=y8(m.type,null,m.pendingProps,null))?m.memoizedState=ie:es||(ie=m.type,l=m.pendingProps,ir=d6(ai.current).createElement(ie),ir[Wi]=m,ir[io]=l,Uu(ir,ie,l),fa(ir),m.stateNode=ir):m.memoizedState=y8(m.type,l.memoizedProps,m.pendingProps,l.memoizedState),null;case 27:return lr(m),l===null&&es&&(ir=m.stateNode=d8(m.type,m.pendingProps,ai.current),nu=m,Lu=!0,oi=xs,N0(m.type)?(hv=oi,xs=sd(ir.firstChild)):xs=oi),lu(l,m,m.pendingProps.children,ie),$f(l,m),l===null&&(m.flags|=4194304),m.child;case 5:return l===null&&es&&((oi=ir=xs)&&(ir=y4(ir,m.type,m.pendingProps,Lu),ir!==null?(m.stateNode=ir,nu=m,xs=sd(ir.firstChild),Lu=!1,oi=!0):oi=!1),oi||pd(m)),lr(m),oi=m.type,li=m.pendingProps,Ti=l!==null?l.memoizedProps:null,ir=li.children,uv(oi,li)?ir=null:Ti!==null&&uv(oi,Ti)&&(m.flags|=32),m.memoizedState!==null&&(oi=lh(l,m,x3,null,null,ie),Gb._currentValue=oi),$f(l,m),lu(l,m,ir,ie),m.child;case 6:return l===null&&es&&((l=ie=xs)&&(ie=m4(ie,m.pendingProps,Lu),ie!==null?(m.stateNode=ie,nu=m,xs=null,l=!0):l=!1),l||pd(m)),null;case 13:return Np(l,m,ie);case 4:return ri(m,m.stateNode.containerInfo),ir=m.pendingProps,l===null?m.child=Vf(m,null,ir,ie):lu(l,m,ir,ie),m.child;case 11:return Jh(l,m,m.type,m.pendingProps,ie);case 7:return lu(l,m,m.pendingProps,ie),m.child;case 8:return lu(l,m,m.pendingProps.children,ie),m.child;case 12:return lu(l,m,m.pendingProps.children,ie),m.child;case 10:return ir=m.pendingProps,td(m,m.type,ir.value),lu(l,m,ir.children,ie),m.child;case 9:return oi=m.type._context,ir=m.pendingProps.children,ah(m),oi=Hs(oi),ir=ir(oi),m.flags|=1,lu(l,m,ir,ie),m.child;case 14:return fm(l,m,m.type,m.pendingProps,ie);case 15:return Bg(l,m,m.type,m.pendingProps,ie);case 19:return hm(l,m,ie);case 31:return K3(l,m,ie);case 22:return Pp(l,m,ie,m.pendingProps);case 24:return ah(m),ir=Hs(Ns),l===null?(oi=vp(),oi===null&&(oi=Lo,li=mp(),oi.pooledCache=li,li.refCount++,li!==null&&(oi.pooledCacheLanes|=ie),oi=li),m.memoizedState={parent:ir,cache:oi},ky(m),td(m,Ns,oi)):((l.lanes&ie)!==0&&(Vh(l,m),Zh(m,null,null,ie),Zd()),oi=l.memoizedState,li=m.memoizedState,oi.parent!==ir?(oi={parent:ir,cache:ir},m.memoizedState=oi,m.lanes===0&&(m.memoizedState=m.updateQueue.baseState=oi),td(m,Ns,ir)):(ir=li.cache,td(m,Ns,ir),ir!==oi.cache&&pp(m,[Ns],ie,!0))),lu(l,m,m.pendingProps.children,ie),m.child;case 29:throw m.pendingProps}throw Error(n(156,m.tag))}function Ls(l){l.flags|=4}function Ob(l,m,ie,ir,oi){if((m=(l.mode&32)!==0)&&(m=!1),m){if(l.flags|=16777216,(oi&335544128)===oi)if(l.stateNode.complete)l.flags|=8192;else if(Bv())l.flags|=8192;else throw Vd=xp,nd}else l.flags&=-16777217}function Cb(l,m){if(m.type!=="stylesheet"||(m.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!w8(m))if(Bv())l.flags|=8192;else throw Vd=xp,nd}function pm(l,m){m!==null&&(l.flags|=4),l.flags&16384&&(m=l.tag!==22?Jo():536870912,l.lanes|=m,ad|=m)}function jp(l,m){if(!es)switch(l.tailMode){case"hidden":m=l.tail;for(var ie=null;m!==null;)m.alternate!==null&&(ie=m),m=m.sibling;ie===null?l.tail=null:ie.sibling=null;break;case"collapsed":ie=l.tail;for(var ir=null;ie!==null;)ie.alternate!==null&&(ir=ie),ie=ie.sibling;ir===null?m||l.tail===null?l.tail=null:l.tail.sibling=null:ir.sibling=null}}function Is(l){var m=l.alternate!==null&&l.alternate.child===l.child,ie=0,ir=0;if(m)for(var oi=l.child;oi!==null;)ie|=oi.lanes|oi.childLanes,ir|=oi.subtreeFlags&65011712,ir|=oi.flags&65011712,oi.return=l,oi=oi.sibling;else for(oi=l.child;oi!==null;)ie|=oi.lanes|oi.childLanes,ir|=oi.subtreeFlags,ir|=oi.flags,oi.return=l,oi=oi.sibling;return l.subtreeFlags|=ir,l.childLanes=ie,m}function G3(l,m,ie){var ir=m.pendingProps;switch(jm(m),m.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Is(m),null;case 1:return Is(m),null;case 3:return ie=m.stateNode,ir=null,l!==null&&(ir=l.memoizedState.cache),m.memoizedState.cache!==ir&&(m.flags|=2048),rd(Ns),ui(),ie.pendingContext&&(ie.context=ie.pendingContext,ie.pendingContext=null),(l===null||l.child===null)&&(oh(m)?Ls(m):l===null||l.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,_y())),Is(m),null;case 26:var oi=m.type,li=m.memoizedState;return l===null?(Ls(m),li!==null?(Is(m),Cb(m,li)):(Is(m),Ob(m,oi,null,ir,ie))):li?li!==l.memoizedState?(Ls(m),Is(m),Cb(m,li)):(Is(m),m.flags&=-16777217):(l=l.memoizedProps,l!==ir&&Ls(m),Is(m),Ob(m,oi,l,ir,ie)),null;case 27:if(ar(m),ie=ai.current,oi=m.type,l!==null&&m.stateNode!=null)l.memoizedProps!==ir&&Ls(m);else{if(!ir){if(m.stateNode===null)throw Error(n(166));return Is(m),null}l=rn.current,oh(m)?by(m):(l=d8(oi,ir,ie),m.stateNode=l,Ls(m))}return Is(m),null;case 5:if(ar(m),oi=m.type,l!==null&&m.stateNode!=null)l.memoizedProps!==ir&&Ls(m);else{if(!ir){if(m.stateNode===null)throw Error(n(166));return Is(m),null}if(li=rn.current,oh(m))by(m);else{var Ti=d6(ai.current);switch(li){case 1:li=Ti.createElementNS("http://www.w3.org/2000/svg",oi);break;case 2:li=Ti.createElementNS("http://www.w3.org/1998/Math/MathML",oi);break;default:switch(oi){case"svg":li=Ti.createElementNS("http://www.w3.org/2000/svg",oi);break;case"math":li=Ti.createElementNS("http://www.w3.org/1998/Math/MathML",oi);break;case"script":li=Ti.createElement("div"),li.innerHTML="<script><\/script>",li=li.removeChild(li.firstChild);break;case"select":li=typeof ir.is=="string"?Ti.createElement("select",{is:ir.is}):Ti.createElement("select"),ir.multiple?li.multiple=!0:ir.size&&(li.size=ir.size);break;default:li=typeof ir.is=="string"?Ti.createElement(oi,{is:ir.is}):Ti.createElement(oi)}}li[Wi]=m,li[io]=ir;e:for(Ti=m.child;Ti!==null;){if(Ti.tag===5||Ti.tag===6)li.appendChild(Ti.stateNode);else if(Ti.tag!==4&&Ti.tag!==27&&Ti.child!==null){Ti.child.return=Ti,Ti=Ti.child;continue}if(Ti===m)break e;for(;Ti.sibling===null;){if(Ti.return===null||Ti.return===m)break e;Ti=Ti.return}Ti.sibling.return=Ti.return,Ti=Ti.sibling}m.stateNode=li;e:switch(Uu(li,oi,ir),oi){case"button":case"input":case"select":case"textarea":ir=!!ir.autoFocus;break e;case"img":ir=!0;break e;default:ir=!1}ir&&Ls(m)}}return Is(m),Ob(m,m.type,l===null?null:l.memoizedProps,m.pendingProps,ie),null;case 6:if(l&&m.stateNode!=null)l.memoizedProps!==ir&&Ls(m);else{if(typeof ir!="string"&&m.stateNode===null)throw Error(n(166));if(l=ai.current,oh(m)){if(l=m.stateNode,ie=m.memoizedProps,ir=null,oi=nu,oi!==null)switch(oi.tag){case 27:case 5:ir=oi.memoizedProps}l[Wi]=m,l=!!(l.nodeValue===ie||ir!==null&&ir.suppressHydrationWarning===!0||e8(l.nodeValue,ie)),l||pd(m,!0)}else l=d6(l).createTextNode(ir),l[Wi]=m,m.stateNode=l}return Is(m),null;case 31:if(ie=m.memoizedState,l===null||l.memoizedState!==null){if(ir=oh(m),ie!==null){if(l===null){if(!ir)throw Error(n(318));if(l=m.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(557));l[Wi]=m}else Ud(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;Is(m),l=!1}else ie=_y(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=ie),l=!0;if(!l)return m.flags&256?(cu(m),m):(cu(m),null);if((m.flags&128)!==0)throw Error(n(558))}return Is(m),null;case 13:if(ir=m.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(oi=oh(m),ir!==null&&ir.dehydrated!==null){if(l===null){if(!oi)throw Error(n(318));if(oi=m.memoizedState,oi=oi!==null?oi.dehydrated:null,!oi)throw Error(n(317));oi[Wi]=m}else Ud(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;Is(m),oi=!1}else oi=_y(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=oi),oi=!0;if(!oi)return m.flags&256?(cu(m),m):(cu(m),null)}return cu(m),(m.flags&128)!==0?(m.lanes=ie,m):(ie=ir!==null,l=l!==null&&l.memoizedState!==null,ie&&(ir=m.child,oi=null,ir.alternate!==null&&ir.alternate.memoizedState!==null&&ir.alternate.memoizedState.cachePool!==null&&(oi=ir.alternate.memoizedState.cachePool.pool),li=null,ir.memoizedState!==null&&ir.memoizedState.cachePool!==null&&(li=ir.memoizedState.cachePool.pool),li!==oi&&(ir.flags|=2048)),ie!==l&&ie&&(m.child.flags|=8192),pm(m,m.updateQueue),Is(m),null);case 4:return ui(),l===null&&nv(m.stateNode.containerInfo),Is(m),null;case 10:return rd(m.type),Is(m),null;case 19:if(k(ba),ir=m.memoizedState,ir===null)return Is(m),null;if(oi=(m.flags&128)!==0,li=ir.rendering,li===null)if(oi)jp(ir,!1);else{if(is!==0||l!==null&&(l.flags&128)!==0)for(l=m.child;l!==null;){if(li=fh(l),li!==null){for(m.flags|=128,jp(ir,!1),l=li.updateQueue,m.updateQueue=l,pm(m,l),m.subtreeFlags=0,l=ie,ie=m.child;ie!==null;)Nd(ie,l),ie=ie.sibling;return Ye(ba,ba.current&1|2),es&&Jl(m,ir.treeForkCount),m.child}l=l.sibling}ir.tail!==null&&vn()>R0&&(m.flags|=128,oi=!0,jp(ir,!1),m.lanes=4194304)}else{if(!oi)if(l=fh(li),l!==null){if(m.flags|=128,oi=!0,l=l.updateQueue,m.updateQueue=l,pm(m,l),jp(ir,!0),ir.tail===null&&ir.tailMode==="hidden"&&!li.alternate&&!es)return Is(m),null}else 2*vn()-ir.renderingStartTime>R0&&ie!==536870912&&(m.flags|=128,oi=!0,jp(ir,!1),m.lanes=4194304);ir.isBackwards?(li.sibling=m.child,m.child=li):(l=ir.last,l!==null?l.sibling=li:m.child=li,ir.last=li)}return ir.tail!==null?(l=ir.tail,ir.rendering=l,ir.tail=l.sibling,ir.renderingStartTime=vn(),l.sibling=null,ie=ba.current,Ye(ba,oi?ie&1|2:ie&1),es&&Jl(m,ir.treeForkCount),l):(Is(m),null);case 22:case 23:return cu(m),Vm(),ir=m.memoizedState!==null,l!==null?l.memoizedState!==null!==ir&&(m.flags|=8192):ir&&(m.flags|=8192),ir?(ie&536870912)!==0&&(m.flags&128)===0&&(Is(m),m.subtreeFlags&6&&(m.flags|=8192)):Is(m),ie=m.updateQueue,ie!==null&&pm(m,ie.retryQueue),ie=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(ie=l.memoizedState.cachePool.pool),ir=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(ir=m.memoizedState.cachePool.pool),ir!==ie&&(m.flags|=2048),l!==null&&k(zd),null;case 24:return ie=null,l!==null&&(ie=l.memoizedState.cache),m.memoizedState.cache!==ie&&(m.flags|=2048),rd(Ns),Is(m),null;case 25:return null;case 30:return null}throw Error(n(156,m.tag))}function $3(l,m){switch(jm(m),m.tag){case 1:return l=m.flags,l&65536?(m.flags=l&-65537|128,m):null;case 3:return rd(Ns),ui(),l=m.flags,(l&65536)!==0&&(l&128)===0?(m.flags=l&-65537|128,m):null;case 26:case 27:case 5:return ar(m),null;case 31:if(m.memoizedState!==null){if(cu(m),m.alternate===null)throw Error(n(340));Ud()}return l=m.flags,l&65536?(m.flags=l&-65537|128,m):null;case 13:if(cu(m),l=m.memoizedState,l!==null&&l.dehydrated!==null){if(m.alternate===null)throw Error(n(340));Ud()}return l=m.flags,l&65536?(m.flags=l&-65537|128,m):null;case 19:return k(ba),null;case 4:return ui(),null;case 10:return rd(m.type),null;case 22:case 23:return cu(m),Vm(),l!==null&&k(zd),l=m.flags,l&65536?(m.flags=l&-65537|128,m):null;case 24:return rd(Ns),null;case 25:return null;default:return null}}function gh(l,m){switch(jm(m),m.tag){case 3:rd(Ns),ui();break;case 26:case 27:case 5:ar(m);break;case 4:ui();break;case 31:m.memoizedState!==null&&cu(m);break;case 13:cu(m);break;case 19:k(ba);break;case 10:rd(m.type);break;case 22:case 23:cu(m),Vm(),l!==null&&k(zd);break;case 24:rd(Ns)}}function Lp(l,m){try{var ie=m.updateQueue,ir=ie!==null?ie.lastEffect:null;if(ir!==null){var oi=ir.next;ie=oi;do{if((ie.tag&l)===l){ir=void 0;var li=ie.create,Ti=ie.inst;ir=li(),Ti.destroy=ir}ie=ie.next}while(ie!==oi)}}catch(Ki){As(m,m.return,Ki)}}function xd(l,m,ie){try{var ir=m.updateQueue,oi=ir!==null?ir.lastEffect:null;if(oi!==null){var li=oi.next;ir=li;do{if((ir.tag&l)===l){var Ti=ir.inst,Ki=Ti.destroy;if(Ki!==void 0){Ti.destroy=void 0,oi=m;var to=ie,go=Ki;try{go()}catch(ko){As(oi,to,ko)}}}ir=ir.next}while(ir!==li)}}catch(ko){As(m,m.return,ko)}}function Fb(l){var m=l.updateQueue;if(m!==null){var ie=l.stateNode;try{w3(m,ie)}catch(ir){As(l,l.return,ir)}}}function X3(l,m,ie){ie.props=yh(l.type,l.memoizedProps),ie.state=l.memoizedState;try{ie.componentWillUnmount()}catch(ir){As(l,m,ir)}}function zp(l,m){try{var ie=l.ref;if(ie!==null){switch(l.tag){case 26:case 27:case 5:var ir=l.stateNode;break;case 30:ir=l.stateNode;break;default:ir=l.stateNode}typeof ie=="function"?l.refCleanup=ie(ir):ie.current=ir}}catch(oi){As(l,m,oi)}}function od(l,m){var ie=l.ref,ir=l.refCleanup;if(ie!==null)if(typeof ir=="function")try{ir()}catch(oi){As(l,m,oi)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof ie=="function")try{ie(null)}catch(oi){As(l,m,oi)}else ie.current=null}function W3(l){var m=l.type,ie=l.memoizedProps,ir=l.stateNode;try{e:switch(m){case"button":case"input":case"select":case"textarea":ie.autoFocus&&ir.focus();break e;case"img":ie.src?ir.src=ie.src:ie.srcSet&&(ir.srcset=ie.srcSet)}}catch(oi){As(l,l.return,oi)}}function Pb(l,m,ie){try{var ir=l.stateNode;f4(ir,l.type,ie,m),ir[io]=m}catch(oi){As(l,l.return,oi)}}function Y3(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&N0(l.type)||l.tag===4}function Hp(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Y3(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&N0(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function ym(l,m,ie){var ir=l.tag;if(ir===5||ir===6)l=l.stateNode,m?(ie.nodeType===9?ie.body:ie.nodeName==="HTML"?ie.ownerDocument.body:ie).insertBefore(l,m):(m=ie.nodeType===9?ie.body:ie.nodeName==="HTML"?ie.ownerDocument.body:ie,m.appendChild(l),ie=ie._reactRootContainer,ie!=null||m.onclick!==null||(m.onclick=mu));else if(ir!==4&&(ir===27&&N0(l.type)&&(ie=l.stateNode,m=null),l=l.child,l!==null))for(ym(l,m,ie),l=l.sibling;l!==null;)ym(l,m,ie),l=l.sibling}function Kp(l,m,ie){var ir=l.tag;if(ir===5||ir===6)l=l.stateNode,m?ie.insertBefore(l,m):ie.appendChild(l);else if(ir!==4&&(ir===27&&N0(l.type)&&(ie=l.stateNode),l=l.child,l!==null))for(Kp(l,m,ie),l=l.sibling;l!==null;)Kp(l,m,ie),l=l.sibling}function Q3(l){var m=l.stateNode,ie=l.memoizedProps;try{for(var ir=l.type,oi=m.attributes;oi.length;)m.removeAttributeNode(oi[0]);Uu(m,ir,ie),m[Wi]=l,m[io]=ie}catch(li){As(l,l.return,li)}}var Bl=!1,Js=!1,kb=!1,Fu=typeof WeakSet=="function"?WeakSet:Set,eu=null;function H6(l,m){if(l=l.containerInfo,av=v6,l=d3(l),op(l)){if("selectionStart"in l)var ie={start:l.selectionStart,end:l.selectionEnd};else e:{ie=(ie=l.ownerDocument)&&ie.defaultView||window;var ir=ie.getSelection&&ie.getSelection();if(ir&&ir.rangeCount!==0){ie=ir.anchorNode;var oi=ir.anchorOffset,li=ir.focusNode;ir=ir.focusOffset;try{ie.nodeType,li.nodeType}catch{ie=null;break e}var Ti=0,Ki=-1,to=-1,go=0,ko=0,Vo=l,So=null;t:for(;;){for(var Bo;Vo!==ie||oi!==0&&Vo.nodeType!==3||(Ki=Ti+oi),Vo!==li||ir!==0&&Vo.nodeType!==3||(to=Ti+ir),Vo.nodeType===3&&(Ti+=Vo.nodeValue.length),(Bo=Vo.firstChild)!==null;)So=Vo,Vo=Bo;for(;;){if(Vo===l)break t;if(So===ie&&++go===oi&&(Ki=Ti),So===li&&++ko===ir&&(to=Ti),(Bo=Vo.nextSibling)!==null)break;Vo=So,So=Vo.parentNode}Vo=Bo}ie=Ki===-1||to===-1?null:{start:Ki,end:to}}else ie=null}ie=ie||{start:0,end:0}}else ie=null;for(sv={focusedElem:l,selectionRange:ie},v6=!1,eu=m;eu!==null;)if(m=eu,l=m.child,(m.subtreeFlags&1028)!==0&&l!==null)l.return=m,eu=l;else for(;eu!==null;){switch(m=eu,li=m.alternate,l=m.flags,m.tag){case 0:if((l&4)!==0&&(l=m.updateQueue,l=l!==null?l.events:null,l!==null))for(ie=0;ie<l.length;ie++)oi=l[ie],oi.ref.impl=oi.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&li!==null){l=void 0,ie=m,oi=li.memoizedProps,li=li.memoizedState,ir=ie.stateNode;try{var Ia=yh(ie.type,oi);l=ir.getSnapshotBeforeUpdate(Ia,li),ir.__reactInternalSnapshotBeforeUpdate=l}catch(Da){As(ie,ie.return,Da)}}break;case 3:if((l&1024)!==0){if(l=m.stateNode.containerInfo,ie=l.nodeType,ie===9)cv(l);else if(ie===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":cv(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(n(163))}if(l=m.sibling,l!==null){l.return=m.return,eu=l;break}eu=m.return}}function J3(l,m,ie){var ir=ie.flags;switch(ie.tag){case 0:case 11:case 15:Ad(l,ie),ir&4&&Lp(5,ie);break;case 1:if(Ad(l,ie),ir&4)if(l=ie.stateNode,m===null)try{l.componentDidMount()}catch(Ti){As(ie,ie.return,Ti)}else{var oi=yh(ie.type,m.memoizedProps);m=m.memoizedState;try{l.componentDidUpdate(oi,m,l.__reactInternalSnapshotBeforeUpdate)}catch(Ti){As(ie,ie.return,Ti)}}ir&64&&Fb(ie),ir&512&&zp(ie,ie.return);break;case 3:if(Ad(l,ie),ir&64&&(l=ie.updateQueue,l!==null)){if(m=null,ie.child!==null)switch(ie.child.tag){case 27:case 5:m=ie.child.stateNode;break;case 1:m=ie.child.stateNode}try{w3(l,m)}catch(Ti){As(ie,ie.return,Ti)}}break;case 27:m===null&&ir&4&&Q3(ie);case 26:case 5:Ad(l,ie),m===null&&ir&4&&W3(ie),ir&512&&zp(ie,ie.return);break;case 12:Ad(l,ie);break;case 31:Ad(l,ie),ir&4&&Db(l,ie);break;case 13:Ad(l,ie),ir&4&&t6(l,ie),ir&64&&(l=ie.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(ie=Y8.bind(null,ie),g4(l,ie))));break;case 22:if(ir=ie.memoizedState!==null||Bl,!ir){m=m!==null&&m.memoizedState!==null||Js,oi=Bl;var li=Js;Bl=ir,(Js=m)&&!li?Sd(l,ie,(ie.subtreeFlags&8772)!==0):Ad(l,ie),Bl=oi,Js=li}break;case 30:break;default:Ad(l,ie)}}function mm(l){var m=l.alternate;m!==null&&(l.alternate=null,mm(m)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(m=l.stateNode,m!==null&&ta(m)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var _s=null,$u=!1;function Ed(l,m,ie){for(ie=ie.child;ie!==null;)e6(l,m,ie),ie=ie.sibling}function e6(l,m,ie){if(Ci&&typeof Ci.onCommitFiberUnmount=="function")try{Ci.onCommitFiberUnmount(Ii,ie)}catch{}switch(ie.tag){case 26:Js||od(ie,m),Ed(l,m,ie),ie.memoizedState?ie.memoizedState.count--:ie.stateNode&&(ie=ie.stateNode,ie.parentNode.removeChild(ie));break;case 27:Js||od(ie,m);var ir=_s,oi=$u;N0(ie.type)&&(_s=ie.stateNode,$u=!1),Ed(l,m,ie),Hb(ie.stateNode),_s=ir,$u=oi;break;case 5:Js||od(ie,m);case 6:if(ir=_s,oi=$u,_s=null,Ed(l,m,ie),_s=ir,$u=oi,_s!==null)if($u)try{(_s.nodeType===9?_s.body:_s.nodeName==="HTML"?_s.ownerDocument.body:_s).removeChild(ie.stateNode)}catch(li){As(ie,m,li)}else try{_s.removeChild(ie.stateNode)}catch(li){As(ie,m,li)}break;case 18:_s!==null&&($u?(l=_s,a8(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,ie.stateNode),Sm(l)):a8(_s,ie.stateNode));break;case 4:ir=_s,oi=$u,_s=ie.stateNode.containerInfo,$u=!0,Ed(l,m,ie),_s=ir,$u=oi;break;case 0:case 11:case 14:case 15:xd(2,ie,m),Js||xd(4,ie,m),Ed(l,m,ie);break;case 1:Js||(od(ie,m),ir=ie.stateNode,typeof ir.componentWillUnmount=="function"&&X3(ie,m,ir)),Ed(l,m,ie);break;case 21:Ed(l,m,ie);break;case 22:Js=(ir=Js)||ie.memoizedState!==null,Ed(l,m,ie),Js=ir;break;default:Ed(l,m,ie)}}function Db(l,m){if(m.memoizedState===null&&(l=m.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Sm(l)}catch(ie){As(m,m.return,ie)}}}function t6(l,m){if(m.memoizedState===null&&(l=m.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Sm(l)}catch(ie){As(m,m.return,ie)}}function V6(l){switch(l.tag){case 31:case 13:case 19:var m=l.stateNode;return m===null&&(m=l.stateNode=new Fu),m;case 22:return l=l.stateNode,m=l._retryCache,m===null&&(m=l._retryCache=new Fu),m;default:throw Error(n(435,l.tag))}}function _0(l,m){var ie=V6(l);m.forEach(function(ir){if(!ie.has(ir)){ie.add(ir);var oi=Q8.bind(null,l,ir);ir.then(oi,oi)}})}function Su(l,m){var ie=m.deletions;if(ie!==null)for(var ir=0;ir<ie.length;ir++){var oi=ie[ir],li=l,Ti=m,Ki=Ti;e:for(;Ki!==null;){switch(Ki.tag){case 27:if(N0(Ki.type)){_s=Ki.stateNode,$u=!1;break e}break;case 5:_s=Ki.stateNode,$u=!1;break e;case 3:case 4:_s=Ki.stateNode.containerInfo,$u=!0;break e}Ki=Ki.return}if(_s===null)throw Error(n(160));e6(li,Ti,oi),_s=null,$u=!1,li=oi.alternate,li!==null&&(li.return=null),oi.return=null}if(m.subtreeFlags&13886)for(m=m.child;m!==null;)r6(m,l),m=m.sibling}var Nf=null;function r6(l,m){var ie=l.alternate,ir=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:Su(m,l),Wu(l),ir&4&&(xd(3,l,l.return),Lp(3,l),xd(5,l,l.return));break;case 1:Su(m,l),Wu(l),ir&512&&(Js||ie===null||od(ie,ie.return)),ir&64&&Bl&&(l=l.updateQueue,l!==null&&(ir=l.callbacks,ir!==null&&(ie=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=ie===null?ir:ie.concat(ir))));break;case 26:var oi=Nf;if(Su(m,l),Wu(l),ir&512&&(Js||ie===null||od(ie,ie.return)),ir&4){var li=ie!==null?ie.memoizedState:null;if(ir=l.memoizedState,ie===null)if(ir===null)if(l.stateNode===null){e:{ir=l.type,ie=l.memoizedProps,oi=oi.ownerDocument||oi;t:switch(ir){case"title":li=oi.getElementsByTagName("title")[0],(!li||li[$o]||li[Wi]||li.namespaceURI==="http://www.w3.org/2000/svg"||li.hasAttribute("itemprop"))&&(li=oi.createElement(ir),oi.head.insertBefore(li,oi.querySelector("head > title"))),Uu(li,ir,ie),li[Wi]=l,fa(li),ir=li;break e;case"link":var Ti=b8("link","href",oi).get(ir+(ie.href||""));if(Ti){for(var Ki=0;Ki<Ti.length;Ki++)if(li=Ti[Ki],li.getAttribute("href")===(ie.href==null||ie.href===""?null:ie.href)&&li.getAttribute("rel")===(ie.rel==null?null:ie.rel)&&li.getAttribute("title")===(ie.title==null?null:ie.title)&&li.getAttribute("crossorigin")===(ie.crossOrigin==null?null:ie.crossOrigin)){Ti.splice(Ki,1);break t}}li=oi.createElement(ir),Uu(li,ir,ie),oi.head.appendChild(li);break;case"meta":if(Ti=b8("meta","content",oi).get(ir+(ie.content||""))){for(Ki=0;Ki<Ti.length;Ki++)if(li=Ti[Ki],li.getAttribute("content")===(ie.content==null?null:""+ie.content)&&li.getAttribute("name")===(ie.name==null?null:ie.name)&&li.getAttribute("property")===(ie.property==null?null:ie.property)&&li.getAttribute("http-equiv")===(ie.httpEquiv==null?null:ie.httpEquiv)&&li.getAttribute("charset")===(ie.charSet==null?null:ie.charSet)){Ti.splice(Ki,1);break t}}li=oi.createElement(ir),Uu(li,ir,ie),oi.head.appendChild(li);break;default:throw Error(n(468,ir))}li[Wi]=l,fa(li),ir=li}l.stateNode=ir}else v8(oi,l.type,l.stateNode);else l.stateNode=g8(oi,ir,l.memoizedProps);else li!==ir?(li===null?ie.stateNode!==null&&(ie=ie.stateNode,ie.parentNode.removeChild(ie)):li.count--,ir===null?v8(oi,l.type,l.stateNode):g8(oi,ir,l.memoizedProps)):ir===null&&l.stateNode!==null&&Pb(l,l.memoizedProps,ie.memoizedProps)}break;case 27:Su(m,l),Wu(l),ir&512&&(Js||ie===null||od(ie,ie.return)),ie!==null&&ir&4&&Pb(l,l.memoizedProps,ie.memoizedProps);break;case 5:if(Su(m,l),Wu(l),ir&512&&(Js||ie===null||od(ie,ie.return)),l.flags&32){oi=l.stateNode;try{ys(oi,"")}catch(Ia){As(l,l.return,Ia)}}ir&4&&l.stateNode!=null&&(oi=l.memoizedProps,Pb(l,oi,ie!==null?ie.memoizedProps:oi)),ir&1024&&(kb=!0);break;case 6:if(Su(m,l),Wu(l),ir&4){if(l.stateNode===null)throw Error(n(162));ir=l.memoizedProps,ie=l.stateNode;try{ie.nodeValue=ir}catch(Ia){As(l,l.return,Ia)}}break;case 3:if(y6=null,oi=Nf,Nf=h6(m.containerInfo),Su(m,l),Nf=oi,Wu(l),ir&4&&ie!==null&&ie.memoizedState.isDehydrated)try{Sm(m.containerInfo)}catch(Ia){As(l,l.return,Ia)}kb&&(kb=!1,n6(l));break;case 4:ir=Nf,Nf=h6(l.stateNode.containerInfo),Su(m,l),Wu(l),Nf=ir;break;case 12:Su(m,l),Wu(l);break;case 31:Su(m,l),Wu(l),ir&4&&(ir=l.updateQueue,ir!==null&&(l.updateQueue=null,_0(l,ir)));break;case 13:Su(m,l),Wu(l),l.child.flags&8192&&l.memoizedState!==null!=(ie!==null&&ie.memoizedState!==null)&&(Zp=vn()),ir&4&&(ir=l.updateQueue,ir!==null&&(l.updateQueue=null,_0(l,ir)));break;case 22:oi=l.memoizedState!==null;var to=ie!==null&&ie.memoizedState!==null,go=Bl,ko=Js;if(Bl=go||oi,Js=ko||to,Su(m,l),Js=ko,Bl=go,Wu(l),ir&8192)e:for(m=l.stateNode,m._visibility=oi?m._visibility&-2:m._visibility|1,oi&&(ie===null||to||Bl||Js||bh(l)),ie=null,m=l;;){if(m.tag===5||m.tag===26){if(ie===null){to=ie=m;try{if(li=to.stateNode,oi)Ti=li.style,typeof Ti.setProperty=="function"?Ti.setProperty("display","none","important"):Ti.display="none";else{Ki=to.stateNode;var Vo=to.memoizedProps.style,So=Vo!=null&&Vo.hasOwnProperty("display")?Vo.display:null;Ki.style.display=So==null||typeof So=="boolean"?"":(""+So).trim()}}catch(Ia){As(to,to.return,Ia)}}}else if(m.tag===6){if(ie===null){to=m;try{to.stateNode.nodeValue=oi?"":to.memoizedProps}catch(Ia){As(to,to.return,Ia)}}}else if(m.tag===18){if(ie===null){to=m;try{var Bo=to.stateNode;oi?s8(Bo,!0):s8(to.stateNode,!1)}catch(Ia){As(to,to.return,Ia)}}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===l)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===l)break e;for(;m.sibling===null;){if(m.return===null||m.return===l)break e;ie===m&&(ie=null),m=m.return}ie===m&&(ie=null),m.sibling.return=m.return,m=m.sibling}ir&4&&(ir=l.updateQueue,ir!==null&&(ie=ir.retryQueue,ie!==null&&(ir.retryQueue=null,_0(l,ie))));break;case 19:Su(m,l),Wu(l),ir&4&&(ir=l.updateQueue,ir!==null&&(l.updateQueue=null,_0(l,ir)));break;case 30:break;case 21:break;default:Su(m,l),Wu(l)}}function Wu(l){var m=l.flags;if(m&2){try{for(var ie,ir=l.return;ir!==null;){if(Y3(ir)){ie=ir;break}ir=ir.return}if(ie==null)throw Error(n(160));switch(ie.tag){case 27:var oi=ie.stateNode,li=Hp(l);Kp(l,li,oi);break;case 5:var Ti=ie.stateNode;ie.flags&32&&(ys(Ti,""),ie.flags&=-33);var Ki=Hp(l);Kp(l,Ki,Ti);break;case 3:case 4:var to=ie.stateNode.containerInfo,go=Hp(l);ym(l,go,to);break;default:throw Error(n(161))}}catch(ko){As(l,l.return,ko)}l.flags&=-3}m&4096&&(l.flags&=-4097)}function n6(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var m=l;n6(m),m.tag===5&&m.flags&1024&&m.stateNode.reset(),l=l.sibling}}function Ad(l,m){if(m.subtreeFlags&8772)for(m=m.child;m!==null;)J3(l,m.alternate,m),m=m.sibling}function bh(l){for(l=l.child;l!==null;){var m=l;switch(m.tag){case 0:case 11:case 14:case 15:xd(4,m,m.return),bh(m);break;case 1:od(m,m.return);var ie=m.stateNode;typeof ie.componentWillUnmount=="function"&&X3(m,m.return,ie),bh(m);break;case 27:Hb(m.stateNode);case 26:case 5:od(m,m.return),bh(m);break;case 22:m.memoizedState===null&&bh(m);break;case 30:bh(m);break;default:bh(m)}l=l.sibling}}function Sd(l,m,ie){for(ie=ie&&(m.subtreeFlags&8772)!==0,m=m.child;m!==null;){var ir=m.alternate,oi=l,li=m,Ti=li.flags;switch(li.tag){case 0:case 11:case 15:Sd(oi,li,ie),Lp(4,li);break;case 1:if(Sd(oi,li,ie),ir=li,oi=ir.stateNode,typeof oi.componentDidMount=="function")try{oi.componentDidMount()}catch(go){As(ir,ir.return,go)}if(ir=li,oi=ir.updateQueue,oi!==null){var Ki=ir.stateNode;try{var to=oi.shared.hiddenCallbacks;if(to!==null)for(oi.shared.hiddenCallbacks=null,oi=0;oi<to.length;oi++)Uy(to[oi],Ki)}catch(go){As(ir,ir.return,go)}}ie&&Ti&64&&Fb(li),zp(li,li.return);break;case 27:Q3(li);case 26:case 5:Sd(oi,li,ie),ie&&ir===null&&Ti&4&&W3(li),zp(li,li.return);break;case 12:Sd(oi,li,ie);break;case 31:Sd(oi,li,ie),ie&&Ti&4&&Db(oi,li);break;case 13:Sd(oi,li,ie),ie&&Ti&4&&t6(oi,li);break;case 22:li.memoizedState===null&&Sd(oi,li,ie),zp(li,li.return);break;case 30:break;default:Sd(oi,li,ie)}m=m.sibling}}function Ub(l,m){var ie=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(ie=l.memoizedState.cachePool.pool),l=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(l=m.memoizedState.cachePool.pool),l!==ie&&(l!=null&&l.refCount++,ie!=null&&kh(ie))}function Xe(l,m){l=null,m.alternate!==null&&(l=m.alternate.memoizedState.cache),m=m.memoizedState.cache,m!==l&&(m.refCount++,l!=null&&kh(l))}function qr(l,m,ie,ir){if(m.subtreeFlags&10256)for(m=m.child;m!==null;)hi(l,m,ie,ir),m=m.sibling}function hi(l,m,ie,ir){var oi=m.flags;switch(m.tag){case 0:case 11:case 15:qr(l,m,ie,ir),oi&2048&&Lp(9,m);break;case 1:qr(l,m,ie,ir);break;case 3:qr(l,m,ie,ir),oi&2048&&(l=null,m.alternate!==null&&(l=m.alternate.memoizedState.cache),m=m.memoizedState.cache,m!==l&&(m.refCount++,l!=null&&kh(l)));break;case 12:if(oi&2048){qr(l,m,ie,ir),l=m.stateNode;try{var li=m.memoizedProps,Ti=li.id,Ki=li.onPostCommit;typeof Ki=="function"&&Ki(Ti,m.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(to){As(m,m.return,to)}}else qr(l,m,ie,ir);break;case 31:qr(l,m,ie,ir);break;case 13:qr(l,m,ie,ir);break;case 23:break;case 22:li=m.stateNode,Ti=m.alternate,m.memoizedState!==null?li._visibility&2?qr(l,m,ie,ir):ji(l,m):li._visibility&2?qr(l,m,ie,ir):(li._visibility|=2,Si(l,m,ie,ir,(m.subtreeFlags&10256)!==0||!1)),oi&2048&&Ub(Ti,m);break;case 24:qr(l,m,ie,ir),oi&2048&&Xe(m.alternate,m);break;default:qr(l,m,ie,ir)}}function Si(l,m,ie,ir,oi){for(oi=oi&&((m.subtreeFlags&10256)!==0||!1),m=m.child;m!==null;){var li=l,Ti=m,Ki=ie,to=ir,go=Ti.flags;switch(Ti.tag){case 0:case 11:case 15:Si(li,Ti,Ki,to,oi),Lp(8,Ti);break;case 23:break;case 22:var ko=Ti.stateNode;Ti.memoizedState!==null?ko._visibility&2?Si(li,Ti,Ki,to,oi):ji(li,Ti):(ko._visibility|=2,Si(li,Ti,Ki,to,oi)),oi&&go&2048&&Ub(Ti.alternate,Ti);break;case 24:Si(li,Ti,Ki,to,oi),oi&&go&2048&&Xe(Ti.alternate,Ti);break;default:Si(li,Ti,Ki,to,oi)}m=m.sibling}}function ji(l,m){if(m.subtreeFlags&10256)for(m=m.child;m!==null;){var ie=l,ir=m,oi=ir.flags;switch(ir.tag){case 22:ji(ie,ir),oi&2048&&Ub(ir.alternate,ir);break;case 24:ji(ie,ir),oi&2048&&Xe(ir.alternate,ir);break;default:ji(ie,ir)}m=m.sibling}}var Xi=8192;function eo(l,m,ie){if(l.subtreeFlags&Xi)for(l=l.child;l!==null;)oo(l,m,ie),l=l.sibling}function oo(l,m,ie){switch(l.tag){case 26:eo(l,m,ie),l.flags&Xi&&l.memoizedState!==null&&M4(ie,Nf,l.memoizedState,l.memoizedProps);break;case 5:eo(l,m,ie);break;case 3:case 4:var ir=Nf;Nf=h6(l.stateNode.containerInfo),eo(l,m,ie),Nf=ir;break;case 22:l.memoizedState===null&&(ir=l.alternate,ir!==null&&ir.memoizedState!==null?(ir=Xi,Xi=16777216,eo(l,m,ie),Xi=ir):eo(l,m,ie));break;default:eo(l,m,ie)}}function po(l){var m=l.alternate;if(m!==null&&(l=m.child,l!==null)){m.child=null;do m=l.sibling,l.sibling=null,l=m;while(l!==null)}}function jo(l){var m=l.deletions;if((l.flags&16)!==0){if(m!==null)for(var ie=0;ie<m.length;ie++){var ir=m[ie];eu=ir,va(ir,l)}po(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Ho(l),l=l.sibling}function Ho(l){switch(l.tag){case 0:case 11:case 15:jo(l),l.flags&2048&&xd(9,l,l.return);break;case 3:jo(l);break;case 12:jo(l);break;case 22:var m=l.stateNode;l.memoizedState!==null&&m._visibility&2&&(l.return===null||l.return.tag!==13)?(m._visibility&=-3,Xo(l)):jo(l);break;default:jo(l)}}function Xo(l){var m=l.deletions;if((l.flags&16)!==0){if(m!==null)for(var ie=0;ie<m.length;ie++){var ir=m[ie];eu=ir,va(ir,l)}po(l)}for(l=l.child;l!==null;){switch(m=l,m.tag){case 0:case 11:case 15:xd(8,m,m.return),Xo(m);break;case 22:ie=m.stateNode,ie._visibility&2&&(ie._visibility&=-3,Xo(m));break;default:Xo(m)}l=l.sibling}}function va(l,m){for(;eu!==null;){var ie=eu;switch(ie.tag){case 0:case 11:case 15:xd(8,ie,m);break;case 23:case 22:if(ie.memoizedState!==null&&ie.memoizedState.cachePool!==null){var ir=ie.memoizedState.cachePool.pool;ir!=null&&ir.refCount++}break;case 24:kh(ie.memoizedState.cache)}if(ir=ie.child,ir!==null)ir.return=ie,eu=ir;else e:for(ie=l;eu!==null;){ir=eu;var oi=ir.sibling,li=ir.return;if(mm(ir),ir===ie){eu=null;break e}if(oi!==null){oi.return=li,eu=oi;break e}eu=li}}}var xa={getCacheForType:function(l){var m=Hs(Ns),ie=m.data.get(l);return ie===void 0&&(ie=l(),m.data.set(l,ie)),ie},cacheSignal:function(){return Hs(Ns).controller.signal}},Oa=typeof WeakMap=="function"?WeakMap:Map,Mo=0,Lo=null,ua=null,Go=0,da=0,Ta=null,Ga=!1,_a=!1,Ca=!1,Es=0,is=0,pu=0,Fs=0,Fl=0,tu=0,ad=0,Nl=null,qs=null,gm=!1,Zp=0,$p=0,R0=1/0,vh=null,Dl=null,ru=0,zl=null,Id=null,wh=0,K6=0,Z6=null,Iv=null,jb=0,G6=null;function Hl(){return(Mo&2)!==0&&Go!==0?Go&-Go:ur.T!==null?J6():gi()}function _v(){if(tu===0)if((Go&536870912)===0||es){var l=Io;Io<<=1,(Io&3932160)===0&&(Io=262144),tu=l}else tu=536870912;return l=qu.current,l!==null&&(l.flags|=32),tu}function Xf(l,m,ie){(l===Lo&&(da===2||da===9)||l.cancelPendingCommit!==null)&&(bm(l,0),M0(l,Go,tu,!1)),zi(l,ie),((Mo&2)===0||l!==Lo)&&(l===Lo&&((Mo&2)===0&&(Fs|=ie),is===4&&M0(l,Go,tu,!1)),Qd(l))}function Tv(l,m,ie){if((Mo&6)!==0)throw Error(n(327));var ir=!ie&&(m&127)===0&&(m&l.expiredLanes)===0||Po(l,m),oi=ir?$8(l,m):X6(l,m,!0),li=ir;do{if(oi===0){_a&&!ir&&M0(l,m,0,!1);break}else{if(ie=l.current.alternate,li&&!Z8(ie)){oi=X6(l,m,!1),li=!1;continue}if(oi===2){if(li=m,l.errorRecoveryDisabledLanes&li)var Ti=0;else Ti=l.pendingLanes&-536870913,Ti=Ti!==0?Ti:Ti&536870912?536870912:0;if(Ti!==0){m=Ti;e:{var Ki=l;oi=Nl;var to=Ki.current.memoizedState.isDehydrated;if(to&&(bm(Ki,Ti).flags|=256),Ti=X6(Ki,Ti,!1),Ti!==2){if(Ca&&!to){Ki.errorRecoveryDisabledLanes|=li,Fs|=li,oi=4;break e}li=qs,qs=oi,li!==null&&(qs===null?qs=li:qs.push.apply(qs,li))}oi=Ti}if(li=!1,oi!==2)continue}}if(oi===1){bm(l,0),M0(l,m,0,!0);break}e:{switch(ir=l,li=oi,li){case 0:case 1:throw Error(n(345));case 4:if((m&4194048)!==m)break;case 6:M0(ir,m,tu,!Ga);break e;case 2:qs=null;break;case 3:case 5:break;default:throw Error(n(329))}if((m&62914560)===m&&(oi=Zp+300-vn(),10<oi)){if(M0(ir,m,tu,!Ga),To(ir,0,!0)!==0)break e;wh=m,ir.timeoutHandle=i8(Rv.bind(null,ir,ie,qs,vh,gm,m,tu,Fs,ad,Ga,li,"Throttled",-0,0),oi);break e}Rv(ir,ie,qs,vh,gm,m,tu,Fs,ad,Ga,li,null,-0,0)}}break}while(!0);Qd(l)}function Rv(l,m,ie,ir,oi,li,Ti,Ki,to,go,ko,Vo,So,Bo){if(l.timeoutHandle=-1,Vo=m.subtreeFlags,Vo&8192||(Vo&16785408)===16785408){Vo={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mu},oo(m,li,Vo);var Ia=(li&62914560)===li?Zp-vn():(li&4194048)===li?$p-vn():0;if(Ia=B4(Vo,Ia),Ia!==null){wh=li,l.cancelPendingCommit=Ia(Nv.bind(null,l,m,li,ie,ir,oi,Ti,Ki,to,ko,Vo,null,So,Bo)),M0(l,li,Ti,!go);return}}Nv(l,m,li,ie,ir,oi,Ti,Ki,to)}function Z8(l){for(var m=l;;){var ie=m.tag;if((ie===0||ie===11||ie===15)&&m.flags&16384&&(ie=m.updateQueue,ie!==null&&(ie=ie.stores,ie!==null)))for(var ir=0;ir<ie.length;ir++){var oi=ie[ir],li=oi.getSnapshot;oi=oi.value;try{if(!ps(li(),oi))return!1}catch{return!1}}if(ie=m.child,m.subtreeFlags&16384&&ie!==null)ie.return=m,m=ie;else{if(m===l)break;for(;m.sibling===null;){if(m.return===null||m.return===l)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function M0(l,m,ie,ir){m&=~Fl,m&=~Fs,l.suspendedLanes|=m,l.pingedLanes&=~m,ir&&(l.warmLanes|=m),ir=l.expirationTimes;for(var oi=m;0<oi;){var li=31-Hi(oi),Ti=1<<li;ir[li]=-1,oi&=~Ti}ie!==0&&uo(l,ie,m)}function i6(){return(Mo&6)===0?(Lb(0),!1):!0}function $6(){if(ua!==null){if(da===0)var l=ua.return;else l=ua,ed=Ld=null,Sp(l),Bu=null,Kd=0,l=ua;for(;l!==null;)gh(l.alternate,l),l=l.return;ua=null}}function bm(l,m){var ie=l.timeoutHandle;ie!==-1&&(l.timeoutHandle=-1,d4(ie)),ie=l.cancelPendingCommit,ie!==null&&(l.cancelPendingCommit=null,ie()),wh=0,$6(),Lo=l,ua=ie=Qf(l.current,null),Go=m,da=0,Ta=null,Ga=!1,_a=Po(l,m),Ca=!1,ad=tu=Fl=Fs=pu=is=0,qs=Nl=null,gm=!1,(m&8)!==0&&(m|=m&32);var ir=l.entangledLanes;if(ir!==0)for(l=l.entanglements,ir&=m;0<ir;){var oi=31-Hi(ir),li=1<<oi;m|=l[oi],ir&=~li}return Es=m,cp(),ie}function Mv(l,m){ja=null,ur.H=ph,m===Uh||m===wp?(m=qm(),da=3):m===nd?(m=qm(),da=4):da=m===ks?8:m!==null&&typeof m=="object"&&typeof m.then=="function"?6:1,Ta=m,ua===null&&(is=1,sm(l,qf(m,l.current)))}function Bv(){var l=qu.current;return l===null?!0:(Go&4194048)===Go?Ys===null:(Go&62914560)===Go||(Go&536870912)!==0?l===Ys:!1}function Ov(){var l=ur.H;return ur.H=ph,l===null?ph:l}function Cv(){var l=ur.A;return ur.A=xa,l}function o6(){is=4,Ga||(Go&4194048)!==Go&&qu.current!==null||(_a=!0),(pu&134217727)===0&&(Fs&134217727)===0||Lo===null||M0(Lo,Go,tu,!1)}function X6(l,m,ie){var ir=Mo;Mo|=2;var oi=Ov(),li=Cv();(Lo!==l||Go!==m)&&(vh=null,bm(l,m)),m=!1;var Ti=is;e:do try{if(da!==0&&ua!==null){var Ki=ua,to=Ta;switch(da){case 8:$6(),Ti=6;break e;case 3:case 2:case 9:case 6:qu.current===null&&(m=!0);var go=da;if(da=0,Ta=null,vm(l,Ki,to,go),ie&&_a){Ti=0;break e}break;default:go=da,da=0,Ta=null,vm(l,Ki,to,go)}}G8(),Ti=is;break}catch(ko){Mv(l,ko)}while(!0);return m&&l.shellSuspendCounter++,ed=Ld=null,Mo=ir,ur.H=oi,ur.A=li,ua===null&&(Lo=null,Go=0,cp()),Ti}function G8(){for(;ua!==null;)Fv(ua)}function $8(l,m){var ie=Mo;Mo|=2;var ir=Ov(),oi=Cv();Lo!==l||Go!==m?(vh=null,R0=vn()+500,bm(l,m)):_a=Po(l,m);e:do try{if(da!==0&&ua!==null){m=ua;var li=Ta;t:switch(da){case 1:da=0,Ta=null,vm(l,m,li,1);break;case 2:case 9:if(Fy(li)){da=0,Ta=null,Pv(m);break}m=function(){da!==2&&da!==9||Lo!==l||(da=7),Qd(l)},li.then(m,m);break e;case 3:da=7;break e;case 4:da=5;break e;case 7:Fy(li)?(da=0,Ta=null,Pv(m)):(da=0,Ta=null,vm(l,m,li,7));break;case 5:var Ti=null;switch(ua.tag){case 26:Ti=ua.memoizedState;case 5:case 27:var Ki=ua;if(Ti?w8(Ti):Ki.stateNode.complete){da=0,Ta=null;var to=Ki.sibling;if(to!==null)ua=to;else{var go=Ki.return;go!==null?(ua=go,a6(go)):ua=null}break t}}da=0,Ta=null,vm(l,m,li,5);break;case 6:da=0,Ta=null,vm(l,m,li,6);break;case 8:$6(),is=6;break e;default:throw Error(n(462))}}X8();break}catch(ko){Mv(l,ko)}while(!0);return ed=Ld=null,ur.H=ir,ur.A=oi,Mo=ie,ua!==null?0:(Lo=null,Go=0,cp(),is)}function X8(){for(;ua!==null&&!Bi();)Fv(ua)}function Fv(l){var m=su(l.alternate,l,Es);l.memoizedProps=l.pendingProps,m===null?a6(l):ua=m}function Pv(l){var m=l,ie=m.alternate;switch(m.tag){case 15:case 0:m=Cg(ie,m,m.pendingProps,m.type,void 0,Go);break;case 11:m=Cg(ie,m,m.pendingProps,m.type.render,m.ref,Go);break;case 5:Sp(m);default:gh(ie,m),m=ua=Nd(m,Es),m=su(ie,m,Es)}l.memoizedProps=l.pendingProps,m===null?a6(l):ua=m}function vm(l,m,ie,ir){ed=Ld=null,Sp(m),Bu=null,Kd=0;var oi=m.return;try{if(Ds(l,oi,m,ie,Go)){is=1,sm(l,qf(ie,l.current)),ua=null;return}}catch(li){if(oi!==null)throw ua=oi,li;is=1,sm(l,qf(ie,l.current)),ua=null;return}m.flags&32768?(es||ir===1?l=!0:_a||(Go&536870912)!==0?l=!1:(Ga=l=!0,(ir===2||ir===9||ir===3||ir===6)&&(ir=qu.current,ir!==null&&ir.tag===13&&(ir.flags|=16384))),kv(m,l)):a6(m)}function a6(l){var m=l;do{if((m.flags&32768)!==0){kv(m,Ga);return}l=m.return;var ie=G3(m.alternate,m,Es);if(ie!==null){ua=ie;return}if(m=m.sibling,m!==null){ua=m;return}ua=m=l}while(m!==null);is===0&&(is=5)}function kv(l,m){do{var ie=$3(l.alternate,l);if(ie!==null){ie.flags&=32767,ua=ie;return}if(ie=l.return,ie!==null&&(ie.flags|=32768,ie.subtreeFlags=0,ie.deletions=null),!m&&(l=l.sibling,l!==null)){ua=l;return}ua=l=ie}while(l!==null);is=6,ua=null}function Nv(l,m,ie,ir,oi,li,Ti,Ki,to){l.cancelPendingCommit=null;do s6();while(ru!==0);if((Mo&6)!==0)throw Error(n(327));if(m!==null){if(m===l.current)throw Error(n(177));if(li=m.lanes|m.childLanes,li|=Mf,Gi(l,ie,li,Ti,Ki,to),l===Lo&&(ua=Lo=null,Go=0),Id=m,zl=l,wh=ie,K6=li,Z6=oi,Iv=ir,(m.subtreeFlags&10256)!==0||(m.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,J8(si,function(){return qv(),null})):(l.callbackNode=null,l.callbackPriority=0),ir=(m.flags&13878)!==0,(m.subtreeFlags&13878)!==0||ir){ir=ur.T,ur.T=null,oi=ue.p,ue.p=2,Ti=Mo,Mo|=4;try{H6(l,m,ie)}finally{Mo=Ti,ue.p=oi,ur.T=ir}}ru=1,Dv(),Uv(),jv()}}function Dv(){if(ru===1){ru=0;var l=zl,m=Id,ie=(m.flags&13878)!==0;if((m.subtreeFlags&13878)!==0||ie){ie=ur.T,ur.T=null;var ir=ue.p;ue.p=2;var oi=Mo;Mo|=4;try{r6(m,l);var li=sv,Ti=d3(l.containerInfo),Ki=li.focusedElem,to=li.selectionRange;if(Ti!==Ki&&Ki&&Ki.ownerDocument&&km(Ki.ownerDocument.documentElement,Ki)){if(to!==null&&op(Ki)){var go=to.start,ko=to.end;if(ko===void 0&&(ko=go),"selectionStart"in Ki)Ki.selectionStart=go,Ki.selectionEnd=Math.min(ko,Ki.value.length);else{var Vo=Ki.ownerDocument||document,So=Vo&&Vo.defaultView||window;if(So.getSelection){var Bo=So.getSelection(),Ia=Ki.textContent.length,Da=Math.min(to.start,Ia),Rs=to.end===void 0?Da:Math.min(to.end,Ia);!Bo.extend&&Da>Rs&&(Ti=Rs,Rs=Da,Da=Ti);var fo=l3(Ki,Da),ao=l3(Ki,Rs);if(fo&&ao&&(Bo.rangeCount!==1||Bo.anchorNode!==fo.node||Bo.anchorOffset!==fo.offset||Bo.focusNode!==ao.node||Bo.focusOffset!==ao.offset)){var mo=Vo.createRange();mo.setStart(fo.node,fo.offset),Bo.removeAllRanges(),Da>Rs?(Bo.addRange(mo),Bo.extend(ao.node,ao.offset)):(mo.setEnd(ao.node,ao.offset),Bo.addRange(mo))}}}}for(Vo=[],Bo=Ki;Bo=Bo.parentNode;)Bo.nodeType===1&&Vo.push({element:Bo,left:Bo.scrollLeft,top:Bo.scrollTop});for(typeof Ki.focus=="function"&&Ki.focus(),Ki=0;Ki<Vo.length;Ki++){var Do=Vo[Ki];Do.element.scrollLeft=Do.left,Do.element.scrollTop=Do.top}}v6=!!av,sv=av=null}finally{Mo=oi,ue.p=ir,ur.T=ie}}l.current=m,ru=2}}function Uv(){if(ru===2){ru=0;var l=zl,m=Id,ie=(m.flags&8772)!==0;if((m.subtreeFlags&8772)!==0||ie){ie=ur.T,ur.T=null;var ir=ue.p;ue.p=2;var oi=Mo;Mo|=4;try{J3(l,m.alternate,m)}finally{Mo=oi,ue.p=ir,ur.T=ie}}ru=3}}function jv(){if(ru===4||ru===3){ru=0,qi();var l=zl,m=Id,ie=wh,ir=Iv;(m.subtreeFlags&10256)!==0||(m.flags&10256)!==0?ru=5:(ru=0,Id=zl=null,Lv(l,l.pendingLanes));var oi=l.pendingLanes;if(oi===0&&(Dl=null),Ui(ie),m=m.stateNode,Ci&&typeof Ci.onCommitFiberRoot=="function")try{Ci.onCommitFiberRoot(Ii,m,void 0,(m.current.flags&128)===128)}catch{}if(ir!==null){m=ur.T,oi=ue.p,ue.p=2,ur.T=null;try{for(var li=l.onRecoverableError,Ti=0;Ti<ir.length;Ti++){var Ki=ir[Ti];li(Ki.value,{componentStack:Ki.stack})}}finally{ur.T=m,ue.p=oi}}(wh&3)!==0&&s6(),Qd(l),oi=l.pendingLanes,(ie&261930)!==0&&(oi&42)!==0?l===G6?jb++:(jb=0,G6=l):jb=0,Lb(0)}}function Lv(l,m){(l.pooledCacheLanes&=m)===0&&(m=l.pooledCache,m!=null&&(l.pooledCache=null,kh(m)))}function s6(){return Dv(),Uv(),jv(),qv()}function qv(){if(ru!==5)return!1;var l=zl,m=K6;K6=0;var ie=Ui(wh),ir=ur.T,oi=ue.p;try{ue.p=32>ie?32:ie,ur.T=null,ie=Z6,Z6=null;var li=zl,Ti=wh;if(ru=0,Id=zl=null,wh=0,(Mo&6)!==0)throw Error(n(331));var Ki=Mo;if(Mo|=4,Ho(li.current),hi(li,li.current,Ti,ie),Mo=Ki,Lb(0,!1),Ci&&typeof Ci.onPostCommitFiberRoot=="function")try{Ci.onPostCommitFiberRoot(Ii,li)}catch{}return!0}finally{ue.p=oi,ur.T=ir,Lv(l,m)}}function zv(l,m,ie){m=qf(ie,m),m=Ml(l.stateNode,m,2),l=Jf(l,m,2),l!==null&&(zi(l,2),Qd(l))}function As(l,m,ie){if(l.tag===3)zv(l,l,ie);else for(;m!==null;){if(m.tag===3){zv(m,l,ie);break}else if(m.tag===1){var ir=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof ir.componentDidCatch=="function"&&(Dl===null||!Dl.has(ir))){l=qf(ie,l),ie=Mg(2),ir=Jf(m,ie,2),ir!==null&&(Cp(ie,ir,m,l),zi(ir,2),Qd(ir));break}}m=m.return}}function W6(l,m,ie){var ir=l.pingCache;if(ir===null){ir=l.pingCache=new Oa;var oi=new Set;ir.set(m,oi)}else oi=ir.get(m),oi===void 0&&(oi=new Set,ir.set(m,oi));oi.has(ie)||(Ca=!0,oi.add(ie),l=W8.bind(null,l,m,ie),m.then(l,l))}function W8(l,m,ie){var ir=l.pingCache;ir!==null&&ir.delete(m),l.pingedLanes|=l.suspendedLanes&ie,l.warmLanes&=~ie,Lo===l&&(Go&ie)===ie&&(is===4||is===3&&(Go&62914560)===Go&&300>vn()-Zp?(Mo&2)===0&&bm(l,0):Fl|=ie,ad===Go&&(ad=0)),Qd(l)}function Hv(l,m){m===0&&(m=Jo()),l=rh(l,m),l!==null&&(zi(l,m),Qd(l))}function Y8(l){var m=l.memoizedState,ie=0;m!==null&&(ie=m.retryLane),Hv(l,ie)}function Q8(l,m){var ie=0;switch(l.tag){case 31:case 13:var ir=l.stateNode,oi=l.memoizedState;oi!==null&&(ie=oi.retryLane);break;case 19:ir=l.stateNode;break;case 22:ir=l.stateNode._retryCache;break;default:throw Error(n(314))}ir!==null&&ir.delete(m),Hv(l,ie)}function J8(l,m){return bi(l,m)}var u6=null,wm=null,Y6=!1,f6=!1,Q6=!1,O0=0;function Qd(l){l!==wm&&l.next===null&&(wm===null?u6=wm=l:wm=wm.next=l),f6=!0,Y6||(Y6=!0,t4())}function Lb(l,m){if(!Q6&&f6){Q6=!0;do for(var ie=!1,ir=u6;ir!==null;){if(l!==0){var oi=ir.pendingLanes;if(oi===0)var li=0;else{var Ti=ir.suspendedLanes,Ki=ir.pingedLanes;li=(1<<31-Hi(42|l)+1)-1,li&=oi&~(Ti&~Ki),li=li&201326741?li&201326741|1:li?li|2:0}li!==0&&(ie=!0,Gv(ir,li))}else li=Go,li=To(ir,ir===Lo?li:0,ir.cancelPendingCommit!==null||ir.timeoutHandle!==-1),(li&3)===0||Po(ir,li)||(ie=!0,Gv(ir,li));ir=ir.next}while(ie);Q6=!1}}function e4(){Vv()}function Vv(){f6=Y6=!1;var l=0;O0!==0&&l4()&&(l=O0);for(var m=vn(),ie=null,ir=u6;ir!==null;){var oi=ir.next,li=Kv(ir,m);li===0?(ir.next=null,ie===null?u6=oi:ie.next=oi,oi===null&&(wm=ie)):(ie=ir,(l!==0||(li&3)!==0)&&(f6=!0)),ir=oi}ru!==0&&ru!==5||Lb(l),O0!==0&&(O0=0)}function Kv(l,m){for(var ie=l.suspendedLanes,ir=l.pingedLanes,oi=l.expirationTimes,li=l.pendingLanes&-62914561;0<li;){var Ti=31-Hi(li),Ki=1<<Ti,to=oi[Ti];to===-1?((Ki&ie)===0||(Ki&ir)!==0)&&(oi[Ti]=ia(Ki,m)):to<=m&&(l.expiredLanes|=Ki),li&=~Ki}if(m=Lo,ie=Go,ie=To(l,l===m?ie:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),ir=l.callbackNode,ie===0||l===m&&(da===2||da===9)||l.cancelPendingCommit!==null)return ir!==null&&ir!==null&&Ai(ir),l.callbackNode=null,l.callbackPriority=0;if((ie&3)===0||Po(l,ie)){if(m=ie&-ie,m===l.callbackPriority)return m;switch(ir!==null&&Ai(ir),Ui(ie)){case 2:case 8:ie=on;break;case 32:ie=si;break;case 268435456:ie=Ei;break;default:ie=si}return ir=Zv.bind(null,l),ie=bi(ie,ir),l.callbackPriority=m,l.callbackNode=ie,m}return ir!==null&&ir!==null&&Ai(ir),l.callbackPriority=2,l.callbackNode=null,2}function Zv(l,m){if(ru!==0&&ru!==5)return l.callbackNode=null,l.callbackPriority=0,null;var ie=l.callbackNode;if(s6()&&l.callbackNode!==ie)return null;var ir=Go;return ir=To(l,l===Lo?ir:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),ir===0?null:(Tv(l,ir,m),Kv(l,vn()),l.callbackNode!=null&&l.callbackNode===ie?Zv.bind(null,l):null)}function Gv(l,m){if(s6())return null;Tv(l,m,!0)}function t4(){h4(function(){(Mo&6)!==0?bi(rr,e4):Vv()})}function J6(){if(O0===0){var l=Ff;l===0&&(l=Fo,Fo<<=1,(Fo&261888)===0&&(Fo=256)),O0=l}return O0}function $v(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:Z0(""+l)}function Xv(l,m){var ie=m.ownerDocument.createElement("input");return ie.name=m.name,ie.value=m.value,l.id&&ie.setAttribute("form",l.id),m.parentNode.insertBefore(ie,m),l=new FormData(l),ie.parentNode.removeChild(ie),l}function r4(l,m,ie,ir,oi){if(m==="submit"&&ie&&ie.stateNode===oi){var li=$v((oi[io]||null).action),Ti=ir.submitter;Ti&&(m=(m=Ti[io]||null)?$v(m.formAction):Ti.getAttribute("formAction"),m!==null&&(li=m,Ti=null));var Ki=new bu("action","action",null,ir,oi);l.push({event:Ki,listeners:[{instance:null,listener:function(){if(ir.defaultPrevented){if(O0!==0){var to=Ti?Xv(oi,Ti):new FormData(oi);Yh(ie,{pending:!0,data:to,method:oi.method,action:li},null,to)}}else typeof li=="function"&&(Ki.preventDefault(),to=Ti?Xv(oi,Ti):new FormData(oi),Yh(ie,{pending:!0,data:to,method:oi.method,action:li},li,to))},currentTarget:oi}]})}}for(var ev=0;ev<Ja.length;ev++){var tv=Ja[ev],n4=tv.toLowerCase(),i4=tv[0].toUpperCase()+tv.slice(1);du(n4,"on"+i4)}du(p3,"onAnimationEnd"),du(up,"onAnimationIteration"),du(Ch,"onAnimationStart"),du("dblclick","onDoubleClick"),du("focusin","onFocus"),du("focusout","onBlur"),du(y3,"onTransitionRun"),du(Zi,"onTransitionStart"),du(Fh,"onTransitionCancel"),du(fp,"onTransitionEnd"),na("onMouseEnter",["mouseout","mouseover"]),na("onMouseLeave",["mouseout","mouseover"]),na("onPointerEnter",["pointerout","pointerover"]),na("onPointerLeave",["pointerout","pointerover"]),Wo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qb="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),o4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qb));function Wv(l,m){m=(m&4)!==0;for(var ie=0;ie<l.length;ie++){var ir=l[ie],oi=ir.event;ir=ir.listeners;e:{var li=void 0;if(m)for(var Ti=ir.length-1;0<=Ti;Ti--){var Ki=ir[Ti],to=Ki.instance,go=Ki.currentTarget;if(Ki=Ki.listener,to!==li&&oi.isPropagationStopped())break e;li=Ki,oi.currentTarget=go;try{li(oi)}catch(ko){jf(ko)}oi.currentTarget=null,li=to}else for(Ti=0;Ti<ir.length;Ti++){if(Ki=ir[Ti],to=Ki.instance,go=Ki.currentTarget,Ki=Ki.listener,to!==li&&oi.isPropagationStopped())break e;li=Ki,oi.currentTarget=go;try{li(oi)}catch(ko){jf(ko)}oi.currentTarget=null,li=to}}}}function ts(l,m){var ie=m[Ao];ie===void 0&&(ie=m[Ao]=new Set);var ir=l+"__bubble";ie.has(ir)||(Yv(m,l,2,!1),ie.add(ir))}function rv(l,m,ie){var ir=0;m&&(ir|=4),Yv(ie,l,ir,m)}var c6="_reactListening"+Math.random().toString(36).slice(2);function nv(l){if(!l[c6]){l[c6]=!0,ra.forEach(function(ie){ie!=="selectionchange"&&(o4.has(ie)||rv(ie,!1,l),rv(ie,!0,l))});var m=l.nodeType===9?l:l.ownerDocument;m===null||m[c6]||(m[c6]=!0,rv("selectionchange",!1,m))}}function Yv(l,m,ie,ir){switch(T8(m)){case 2:var oi=F4;break;case 8:oi=P4;break;default:oi=bv}ie=oi.bind(null,m,ie,l),oi=void 0,!Sh||m!=="touchstart"&&m!=="touchmove"&&m!=="wheel"||(oi=!0),ir?oi!==void 0?l.addEventListener(m,ie,{capture:!0,passive:oi}):l.addEventListener(m,ie,!0):oi!==void 0?l.addEventListener(m,ie,{passive:oi}):l.addEventListener(m,ie,!1)}function iv(l,m,ie,ir,oi){var li=ir;if((m&1)===0&&(m&2)===0&&ir!==null)e:for(;;){if(ir===null)return;var Ti=ir.tag;if(Ti===3||Ti===4){var Ki=ir.stateNode.containerInfo;if(Ki===oi)break;if(Ti===4)for(Ti=ir.return;Ti!==null;){var to=Ti.tag;if((to===3||to===4)&&Ti.stateNode.containerInfo===oi)return;Ti=Ti.return}for(;Ki!==null;){if(Ti=sa(Ki),Ti===null)return;if(to=Ti.tag,to===5||to===6||to===26||to===27){ir=li=Ti;continue e}Ki=Ki.parentNode}}ir=ir.return}Wp(function(){var go=li,ko=G0(ie),Vo=[];e:{var So=Rf.get(l);if(So!==void 0){var Bo=bu,Ia=l;switch(l){case"keypress":if(Ih(ie)===0)break e;case"keydown":case"keyup":Bo=Ha;break;case"focusin":Ia="focus",Bo=ty;break;case"focusout":Ia="blur",Bo=ty;break;case"beforeblur":case"afterblur":Bo=ty;break;case"click":if(ie.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Bo=r3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Bo=_h;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Bo=Os;break;case p3:case up:case Ch:Bo=ry;break;case fp:Bo=B6;break;case"scroll":case"scrollend":Bo=Q0;break;case"wheel":Bo=ay;break;case"copy":case"cut":case"paste":Bo=Th;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Bo=Gs;break;case"toggle":case"beforetoggle":Bo=Rh}var Da=(m&4)!==0,Rs=!Da&&(l==="scroll"||l==="scrollend"),fo=Da?So!==null?So+"Capture":null:So;Da=[];for(var ao=go,mo;ao!==null;){var Do=ao;if(mo=Do.stateNode,Do=Do.tag,Do!==5&&Do!==26&&Do!==27||mo===null||fo===null||(Do=$0(ao,fo),Do!=null&&Da.push(zb(ao,Do,mo))),Rs)break;ao=ao.return}0<Da.length&&(So=new Bo(So,Ia,null,ie,ko),Vo.push({event:So,listeners:Da}))}}if((m&7)===0){e:{if(So=l==="mouseover"||l==="pointerover",Bo=l==="mouseout"||l==="pointerout",So&&ie!==Ah&&(Ia=ie.relatedTarget||ie.fromElement)&&(sa(Ia)||Ia[lo]))break e;if((Bo||So)&&(So=ko.window===ko?ko:(So=ko.ownerDocument)?So.defaultView||So.parentWindow:window,Bo?(Ia=ie.relatedTarget||ie.toElement,Bo=go,Ia=Ia?sa(Ia):null,Ia!==null&&(Rs=i(Ia),Da=Ia.tag,Ia!==Rs||Da!==5&&Da!==27&&Da!==6)&&(Ia=null)):(Bo=null,Ia=go),Bo!==Ia)){if(Da=r3,Do="onMouseLeave",fo="onMouseEnter",ao="mouse",(l==="pointerout"||l==="pointerover")&&(Da=Gs,Do="onPointerLeave",fo="onPointerEnter",ao="pointer"),Rs=Bo==null?So:ya(Bo),mo=Ia==null?So:ya(Ia),So=new Da(Do,ao+"leave",Bo,ie,ko),So.target=Rs,So.relatedTarget=mo,Do=null,sa(ko)===go&&(Da=new Da(fo,ao+"enter",Ia,ie,ko),Da.target=mo,Da.relatedTarget=Rs,Do=Da),Rs=Do,Bo&&Ia)t:{for(Da=a4,fo=Bo,ao=Ia,mo=0,Do=fo;Do;Do=Da(Do))mo++;Do=0;for(var Ma=ao;Ma;Ma=Da(Ma))Do++;for(;0<mo-Do;)fo=Da(fo),mo--;for(;0<Do-mo;)ao=Da(ao),Do--;for(;mo--;){if(fo===ao||ao!==null&&fo===ao.alternate){Da=fo;break t}fo=Da(fo),ao=Da(ao)}Da=null}else Da=null;Bo!==null&&Qv(Vo,So,Bo,Da,!1),Ia!==null&&Rs!==null&&Qv(Vo,Rs,Ia,Da,!0)}}e:{if(So=go?ya(go):window,Bo=So.nodeName&&So.nodeName.toLowerCase(),Bo==="select"||Bo==="input"&&So.type==="file")var gs=Cd;else if(tp(So))if(rp)gs=P6;else{gs=F6;var Ra=Pm}else Bo=So.nodeName,!Bo||Bo.toLowerCase()!=="input"||So.type!=="checkbox"&&So.type!=="radio"?go&&Zs(go.elementType)&&(gs=Cd):gs=f3;if(gs&&(gs=gs(l,go))){Om(Vo,gs,ie,ko);break e}Ra&&Ra(l,So,go),l==="focusout"&&go&&So.type==="number"&&go.memoizedProps.value!=null&&Na(So,"number",So.value)}switch(Ra=go?ya(go):window,l){case"focusin":(tp(Ra)||Ra.contentEditable==="true")&&(Fd=Ra,Pd=go,ld=null);break;case"focusout":ld=Pd=Fd=null;break;case"mousedown":eh=!0;break;case"contextmenu":case"mouseup":case"dragend":eh=!1,sp(Vo,ie,ko);break;case"selectionchange":if(ap)break;case"keydown":case"keyup":sp(Vo,ie,ko)}var Ya;if(Mh)e:{switch(l){case"compositionstart":var os="onCompositionStart";break e;case"compositionend":os="onCompositionEnd";break e;case"compositionupdate":os="onCompositionUpdate";break e}os=void 0}else cd?i3(l,ie)&&(os="onCompositionEnd"):l==="keydown"&&ie.keyCode===229&&(os="onCompositionStart");os&&(Bm&&ie.locale!=="ko"&&(cd||os!=="onCompositionStart"?os==="onCompositionEnd"&&cd&&(Ya=Qp()):(_d=ko,Yp="value"in _d?_d.value:_d.textContent,cd=!0)),Ra=l6(go,os),0<Ra.length&&(os=new Rm(os,l,null,ie,ko),Vo.push({event:os,listeners:Ra}),Ya?os.data=Ya:(Ya=o3(ie),Ya!==null&&(os.data=Ya)))),(Ya=C6?Md(l,ie):ly(l,ie))&&(os=l6(go,"onBeforeInput"),0<os.length&&(Ra=new Rm("onBeforeInput","beforeinput",null,ie,ko),Vo.push({event:Ra,listeners:os}),Ra.data=Ya)),r4(Vo,l,go,ie,ko)}Wv(Vo,m)})}function zb(l,m,ie){return{instance:l,listener:m,currentTarget:ie}}function l6(l,m){for(var ie=m+"Capture",ir=[];l!==null;){var oi=l,li=oi.stateNode;if(oi=oi.tag,oi!==5&&oi!==26&&oi!==27||li===null||(oi=$0(l,ie),oi!=null&&ir.unshift(zb(l,oi,li)),oi=$0(l,m),oi!=null&&ir.push(zb(l,oi,li))),l.tag===3)return ir;l=l.return}return[]}function a4(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function Qv(l,m,ie,ir,oi){for(var li=m._reactName,Ti=[];ie!==null&&ie!==ir;){var Ki=ie,to=Ki.alternate,go=Ki.stateNode;if(Ki=Ki.tag,to!==null&&to===ir)break;Ki!==5&&Ki!==26&&Ki!==27||go===null||(to=go,oi?(go=$0(ie,li),go!=null&&Ti.unshift(zb(ie,go,to))):oi||(go=$0(ie,li),go!=null&&Ti.push(zb(ie,go,to)))),ie=ie.return}Ti.length!==0&&l.push({event:m,listeners:Ti})}var s4=/\r\n?/g,u4=/\u0000|\uFFFD/g;function Jv(l){return(typeof l=="string"?l:""+l).replace(s4,`
38
- `).replace(u4,"")}function e8(l,m){return m=Jv(m),Jv(l)===m}function Ts(l,m,ie,ir,oi,li){switch(ie){case"children":typeof ir=="string"?m==="body"||m==="textarea"&&ir===""||ys(l,ir):(typeof ir=="number"||typeof ir=="bigint")&&m!=="body"&&ys(l,""+ir);break;case"className":vo(l,"class",ir);break;case"tabIndex":vo(l,"tabindex",ir);break;case"dir":case"role":case"viewBox":case"width":case"height":vo(l,ie,ir);break;case"style":rs(l,ir,li);break;case"data":if(m!=="object"){vo(l,"data",ir);break}case"src":case"href":if(ir===""&&(m!=="a"||ie!=="href")){l.removeAttribute(ie);break}if(ir==null||typeof ir=="function"||typeof ir=="symbol"||typeof ir=="boolean"){l.removeAttribute(ie);break}ir=Z0(""+ir),l.setAttribute(ie,ir);break;case"action":case"formAction":if(typeof ir=="function"){l.setAttribute(ie,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof li=="function"&&(ie==="formAction"?(m!=="input"&&Ts(l,m,"name",oi.name,oi,null),Ts(l,m,"formEncType",oi.formEncType,oi,null),Ts(l,m,"formMethod",oi.formMethod,oi,null),Ts(l,m,"formTarget",oi.formTarget,oi,null)):(Ts(l,m,"encType",oi.encType,oi,null),Ts(l,m,"method",oi.method,oi,null),Ts(l,m,"target",oi.target,oi,null)));if(ir==null||typeof ir=="symbol"||typeof ir=="boolean"){l.removeAttribute(ie);break}ir=Z0(""+ir),l.setAttribute(ie,ir);break;case"onClick":ir!=null&&(l.onclick=mu);break;case"onScroll":ir!=null&&ts("scroll",l);break;case"onScrollEnd":ir!=null&&ts("scrollend",l);break;case"dangerouslySetInnerHTML":if(ir!=null){if(typeof ir!="object"||!("__html"in ir))throw Error(n(61));if(ie=ir.__html,ie!=null){if(oi.children!=null)throw Error(n(60));l.innerHTML=ie}}break;case"multiple":l.multiple=ir&&typeof ir!="function"&&typeof ir!="symbol";break;case"muted":l.muted=ir&&typeof ir!="function"&&typeof ir!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(ir==null||typeof ir=="function"||typeof ir=="boolean"||typeof ir=="symbol"){l.removeAttribute("xlink:href");break}ie=Z0(""+ir),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ie);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":ir!=null&&typeof ir!="function"&&typeof ir!="symbol"?l.setAttribute(ie,""+ir):l.removeAttribute(ie);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":ir&&typeof ir!="function"&&typeof ir!="symbol"?l.setAttribute(ie,""):l.removeAttribute(ie);break;case"capture":case"download":ir===!0?l.setAttribute(ie,""):ir!==!1&&ir!=null&&typeof ir!="function"&&typeof ir!="symbol"?l.setAttribute(ie,ir):l.removeAttribute(ie);break;case"cols":case"rows":case"size":case"span":ir!=null&&typeof ir!="function"&&typeof ir!="symbol"&&!isNaN(ir)&&1<=ir?l.setAttribute(ie,ir):l.removeAttribute(ie);break;case"rowSpan":case"start":ir==null||typeof ir=="function"||typeof ir=="symbol"||isNaN(ir)?l.removeAttribute(ie):l.setAttribute(ie,ir);break;case"popover":ts("beforetoggle",l),ts("toggle",l),No(l,"popover",ir);break;case"xlinkActuate":bo(l,"http://www.w3.org/1999/xlink","xlink:actuate",ir);break;case"xlinkArcrole":bo(l,"http://www.w3.org/1999/xlink","xlink:arcrole",ir);break;case"xlinkRole":bo(l,"http://www.w3.org/1999/xlink","xlink:role",ir);break;case"xlinkShow":bo(l,"http://www.w3.org/1999/xlink","xlink:show",ir);break;case"xlinkTitle":bo(l,"http://www.w3.org/1999/xlink","xlink:title",ir);break;case"xlinkType":bo(l,"http://www.w3.org/1999/xlink","xlink:type",ir);break;case"xmlBase":bo(l,"http://www.w3.org/XML/1998/namespace","xml:base",ir);break;case"xmlLang":bo(l,"http://www.w3.org/XML/1998/namespace","xml:lang",ir);break;case"xmlSpace":bo(l,"http://www.w3.org/XML/1998/namespace","xml:space",ir);break;case"is":No(l,"is",ir);break;case"innerText":case"textContent":break;default:(!(2<ie.length)||ie[0]!=="o"&&ie[0]!=="O"||ie[1]!=="n"&&ie[1]!=="N")&&(ie=vs.get(ie)||ie,No(l,ie,ir))}}function ov(l,m,ie,ir,oi,li){switch(ie){case"style":rs(l,ir,li);break;case"dangerouslySetInnerHTML":if(ir!=null){if(typeof ir!="object"||!("__html"in ir))throw Error(n(61));if(ie=ir.__html,ie!=null){if(oi.children!=null)throw Error(n(60));l.innerHTML=ie}}break;case"children":typeof ir=="string"?ys(l,ir):(typeof ir=="number"||typeof ir=="bigint")&&ys(l,""+ir);break;case"onScroll":ir!=null&&ts("scroll",l);break;case"onScrollEnd":ir!=null&&ts("scrollend",l);break;case"onClick":ir!=null&&(l.onclick=mu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ha.hasOwnProperty(ie))e:{if(ie[0]==="o"&&ie[1]==="n"&&(oi=ie.endsWith("Capture"),m=ie.slice(2,oi?ie.length-7:void 0),li=l[io]||null,li=li!=null?li[ie]:null,typeof li=="function"&&l.removeEventListener(m,li,oi),typeof ir=="function")){typeof li!="function"&&li!==null&&(ie in l?l[ie]=null:l.hasAttribute(ie)&&l.removeAttribute(ie)),l.addEventListener(m,ir,oi);break e}ie in l?l[ie]=ir:ir===!0?l.setAttribute(ie,""):No(l,ie,ir)}}}function Uu(l,m,ie){switch(m){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ts("error",l),ts("load",l);var ir=!1,oi=!1,li;for(li in ie)if(ie.hasOwnProperty(li)){var Ti=ie[li];if(Ti!=null)switch(li){case"src":ir=!0;break;case"srcSet":oi=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,m));default:Ts(l,m,li,Ti,ie,null)}}oi&&Ts(l,m,"srcSet",ie.srcSet,ie,null),ir&&Ts(l,m,"src",ie.src,ie,null);return;case"input":ts("invalid",l);var Ki=li=Ti=oi=null,to=null,go=null;for(ir in ie)if(ie.hasOwnProperty(ir)){var ko=ie[ir];if(ko!=null)switch(ir){case"name":oi=ko;break;case"type":Ti=ko;break;case"checked":to=ko;break;case"defaultChecked":go=ko;break;case"value":li=ko;break;case"defaultValue":Ki=ko;break;case"children":case"dangerouslySetInnerHTML":if(ko!=null)throw Error(n(137,m));break;default:Ts(l,m,ir,ko,ie,null)}}za(l,li,Ki,to,go,Ti,oi,!1);return;case"select":ts("invalid",l),ir=Ti=li=null;for(oi in ie)if(ie.hasOwnProperty(oi)&&(Ki=ie[oi],Ki!=null))switch(oi){case"value":li=Ki;break;case"defaultValue":Ti=Ki;break;case"multiple":ir=Ki;default:Ts(l,m,oi,Ki,ie,null)}m=li,ie=Ti,l.multiple=!!ir,m!=null?Wa(l,!!ir,m,!1):ie!=null&&Wa(l,!!ir,ie,!0);return;case"textarea":ts("invalid",l),li=oi=ir=null;for(Ti in ie)if(ie.hasOwnProperty(Ti)&&(Ki=ie[Ti],Ki!=null))switch(Ti){case"value":ir=Ki;break;case"defaultValue":oi=Ki;break;case"children":li=Ki;break;case"dangerouslySetInnerHTML":if(Ki!=null)throw Error(n(91));break;default:Ts(l,m,Ti,Ki,ie,null)}ss(l,ir,oi,li);return;case"option":for(to in ie)if(ie.hasOwnProperty(to)&&(ir=ie[to],ir!=null))switch(to){case"selected":l.selected=ir&&typeof ir!="function"&&typeof ir!="symbol";break;default:Ts(l,m,to,ir,ie,null)}return;case"dialog":ts("beforetoggle",l),ts("toggle",l),ts("cancel",l),ts("close",l);break;case"iframe":case"object":ts("load",l);break;case"video":case"audio":for(ir=0;ir<qb.length;ir++)ts(qb[ir],l);break;case"image":ts("error",l),ts("load",l);break;case"details":ts("toggle",l);break;case"embed":case"source":case"link":ts("error",l),ts("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(go in ie)if(ie.hasOwnProperty(go)&&(ir=ie[go],ir!=null))switch(go){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,m));default:Ts(l,m,go,ir,ie,null)}return;default:if(Zs(m)){for(ko in ie)ie.hasOwnProperty(ko)&&(ir=ie[ko],ir!==void 0&&ov(l,m,ko,ir,ie,void 0));return}}for(Ki in ie)ie.hasOwnProperty(Ki)&&(ir=ie[Ki],ir!=null&&Ts(l,m,Ki,ir,ie,null))}function f4(l,m,ie,ir){switch(m){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var oi=null,li=null,Ti=null,Ki=null,to=null,go=null,ko=null;for(Bo in ie){var Vo=ie[Bo];if(ie.hasOwnProperty(Bo)&&Vo!=null)switch(Bo){case"checked":break;case"value":break;case"defaultValue":to=Vo;default:ir.hasOwnProperty(Bo)||Ts(l,m,Bo,null,ir,Vo)}}for(var So in ir){var Bo=ir[So];if(Vo=ie[So],ir.hasOwnProperty(So)&&(Bo!=null||Vo!=null))switch(So){case"type":li=Bo;break;case"name":oi=Bo;break;case"checked":go=Bo;break;case"defaultChecked":ko=Bo;break;case"value":Ti=Bo;break;case"defaultValue":Ki=Bo;break;case"children":case"dangerouslySetInnerHTML":if(Bo!=null)throw Error(n(137,m));break;default:Bo!==Vo&&Ts(l,m,So,Bo,ir,Vo)}}Qa(l,Ti,Ki,to,go,ko,li,oi);return;case"select":Bo=Ti=Ki=So=null;for(li in ie)if(to=ie[li],ie.hasOwnProperty(li)&&to!=null)switch(li){case"value":break;case"multiple":Bo=to;default:ir.hasOwnProperty(li)||Ts(l,m,li,null,ir,to)}for(oi in ir)if(li=ir[oi],to=ie[oi],ir.hasOwnProperty(oi)&&(li!=null||to!=null))switch(oi){case"value":So=li;break;case"defaultValue":Ki=li;break;case"multiple":Ti=li;default:li!==to&&Ts(l,m,oi,li,ir,to)}m=Ki,ie=Ti,ir=Bo,So!=null?Wa(l,!!ie,So,!1):!!ir!=!!ie&&(m!=null?Wa(l,!!ie,m,!0):Wa(l,!!ie,ie?[]:"",!1));return;case"textarea":Bo=So=null;for(Ki in ie)if(oi=ie[Ki],ie.hasOwnProperty(Ki)&&oi!=null&&!ir.hasOwnProperty(Ki))switch(Ki){case"value":break;case"children":break;default:Ts(l,m,Ki,null,ir,oi)}for(Ti in ir)if(oi=ir[Ti],li=ie[Ti],ir.hasOwnProperty(Ti)&&(oi!=null||li!=null))switch(Ti){case"value":So=oi;break;case"defaultValue":Bo=oi;break;case"children":break;case"dangerouslySetInnerHTML":if(oi!=null)throw Error(n(91));break;default:oi!==li&&Ts(l,m,Ti,oi,ir,li)}Ms(l,So,Bo);return;case"option":for(var Ia in ie)if(So=ie[Ia],ie.hasOwnProperty(Ia)&&So!=null&&!ir.hasOwnProperty(Ia))switch(Ia){case"selected":l.selected=!1;break;default:Ts(l,m,Ia,null,ir,So)}for(to in ir)if(So=ir[to],Bo=ie[to],ir.hasOwnProperty(to)&&So!==Bo&&(So!=null||Bo!=null))switch(to){case"selected":l.selected=So&&typeof So!="function"&&typeof So!="symbol";break;default:Ts(l,m,to,So,ir,Bo)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Da in ie)So=ie[Da],ie.hasOwnProperty(Da)&&So!=null&&!ir.hasOwnProperty(Da)&&Ts(l,m,Da,null,ir,So);for(go in ir)if(So=ir[go],Bo=ie[go],ir.hasOwnProperty(go)&&So!==Bo&&(So!=null||Bo!=null))switch(go){case"children":case"dangerouslySetInnerHTML":if(So!=null)throw Error(n(137,m));break;default:Ts(l,m,go,So,ir,Bo)}return;default:if(Zs(m)){for(var Rs in ie)So=ie[Rs],ie.hasOwnProperty(Rs)&&So!==void 0&&!ir.hasOwnProperty(Rs)&&ov(l,m,Rs,void 0,ir,So);for(ko in ir)So=ir[ko],Bo=ie[ko],!ir.hasOwnProperty(ko)||So===Bo||So===void 0&&Bo===void 0||ov(l,m,ko,So,ir,Bo);return}}for(var fo in ie)So=ie[fo],ie.hasOwnProperty(fo)&&So!=null&&!ir.hasOwnProperty(fo)&&Ts(l,m,fo,null,ir,So);for(Vo in ir)So=ir[Vo],Bo=ie[Vo],!ir.hasOwnProperty(Vo)||So===Bo||So==null&&Bo==null||Ts(l,m,Vo,So,ir,Bo)}function t8(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c4(){if(typeof performance.getEntriesByType=="function"){for(var l=0,m=0,ie=performance.getEntriesByType("resource"),ir=0;ir<ie.length;ir++){var oi=ie[ir],li=oi.transferSize,Ti=oi.initiatorType,Ki=oi.duration;if(li&&Ki&&t8(Ti)){for(Ti=0,Ki=oi.responseEnd,ir+=1;ir<ie.length;ir++){var to=ie[ir],go=to.startTime;if(go>Ki)break;var ko=to.transferSize,Vo=to.initiatorType;ko&&t8(Vo)&&(to=to.responseEnd,Ti+=ko*(to<Ki?1:(Ki-go)/(to-go)))}if(--ir,m+=8*(li+Ti)/(oi.duration/1e3),l++,10<l)break}}if(0<l)return m/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var av=null,sv=null;function d6(l){return l.nodeType===9?l:l.ownerDocument}function r8(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function n8(l,m){if(l===0)switch(m){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&m==="foreignObject"?0:l}function uv(l,m){return l==="textarea"||l==="noscript"||typeof m.children=="string"||typeof m.children=="number"||typeof m.children=="bigint"||typeof m.dangerouslySetInnerHTML=="object"&&m.dangerouslySetInnerHTML!==null&&m.dangerouslySetInnerHTML.__html!=null}var fv=null;function l4(){var l=window.event;return l&&l.type==="popstate"?l===fv?!1:(fv=l,!0):(fv=null,!1)}var i8=typeof setTimeout=="function"?setTimeout:void 0,d4=typeof clearTimeout=="function"?clearTimeout:void 0,o8=typeof Promise=="function"?Promise:void 0,h4=typeof queueMicrotask=="function"?queueMicrotask:typeof o8<"u"?function(l){return o8.resolve(null).then(l).catch(p4)}:i8;function p4(l){setTimeout(function(){throw l})}function N0(l){return l==="head"}function a8(l,m){var ie=m,ir=0;do{var oi=ie.nextSibling;if(l.removeChild(ie),oi&&oi.nodeType===8)if(ie=oi.data,ie==="/$"||ie==="/&"){if(ir===0){l.removeChild(oi),Sm(m);return}ir--}else if(ie==="$"||ie==="$?"||ie==="$~"||ie==="$!"||ie==="&")ir++;else if(ie==="html")Hb(l.ownerDocument.documentElement);else if(ie==="head"){ie=l.ownerDocument.head,Hb(ie);for(var li=ie.firstChild;li;){var Ti=li.nextSibling,Ki=li.nodeName;li[$o]||Ki==="SCRIPT"||Ki==="STYLE"||Ki==="LINK"&&li.rel.toLowerCase()==="stylesheet"||ie.removeChild(li),li=Ti}}else ie==="body"&&Hb(l.ownerDocument.body);ie=oi}while(ie);Sm(m)}function s8(l,m){var ie=l;l=0;do{var ir=ie.nextSibling;if(ie.nodeType===1?m?(ie._stashedDisplay=ie.style.display,ie.style.display="none"):(ie.style.display=ie._stashedDisplay||"",ie.getAttribute("style")===""&&ie.removeAttribute("style")):ie.nodeType===3&&(m?(ie._stashedText=ie.nodeValue,ie.nodeValue=""):ie.nodeValue=ie._stashedText||""),ir&&ir.nodeType===8)if(ie=ir.data,ie==="/$"){if(l===0)break;l--}else ie!=="$"&&ie!=="$?"&&ie!=="$~"&&ie!=="$!"||l++;ie=ir}while(ie)}function cv(l){var m=l.firstChild;for(m&&m.nodeType===10&&(m=m.nextSibling);m;){var ie=m;switch(m=m.nextSibling,ie.nodeName){case"HTML":case"HEAD":case"BODY":cv(ie),ta(ie);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(ie.rel.toLowerCase()==="stylesheet")continue}l.removeChild(ie)}}function y4(l,m,ie,ir){for(;l.nodeType===1;){var oi=ie;if(l.nodeName.toLowerCase()!==m.toLowerCase()){if(!ir&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(ir){if(!l[$o])switch(m){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(li=l.getAttribute("rel"),li==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(li!==oi.rel||l.getAttribute("href")!==(oi.href==null||oi.href===""?null:oi.href)||l.getAttribute("crossorigin")!==(oi.crossOrigin==null?null:oi.crossOrigin)||l.getAttribute("title")!==(oi.title==null?null:oi.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(li=l.getAttribute("src"),(li!==(oi.src==null?null:oi.src)||l.getAttribute("type")!==(oi.type==null?null:oi.type)||l.getAttribute("crossorigin")!==(oi.crossOrigin==null?null:oi.crossOrigin))&&li&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(m==="input"&&l.type==="hidden"){var li=oi.name==null?null:""+oi.name;if(oi.type==="hidden"&&l.getAttribute("name")===li)return l}else return l;if(l=sd(l.nextSibling),l===null)break}return null}function m4(l,m,ie){if(m==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!ie||(l=sd(l.nextSibling),l===null))return null;return l}function f8(l,m){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!m||(l=sd(l.nextSibling),l===null))return null;return l}function lv(l){return l.data==="$?"||l.data==="$~"}function dv(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function g4(l,m){var ie=l.ownerDocument;if(l.data==="$~")l._reactRetry=m;else if(l.data!=="$?"||ie.readyState!=="loading")m();else{var ir=function(){m(),ie.removeEventListener("DOMContentLoaded",ir)};ie.addEventListener("DOMContentLoaded",ir),l._reactRetry=ir}}function sd(l){for(;l!=null;l=l.nextSibling){var m=l.nodeType;if(m===1||m===3)break;if(m===8){if(m=l.data,m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"||m==="F!"||m==="F")break;if(m==="/$"||m==="/&")return null}}return l}var hv=null;function c8(l){l=l.nextSibling;for(var m=0;l;){if(l.nodeType===8){var ie=l.data;if(ie==="/$"||ie==="/&"){if(m===0)return sd(l.nextSibling);m--}else ie!=="$"&&ie!=="$!"&&ie!=="$?"&&ie!=="$~"&&ie!=="&"||m++}l=l.nextSibling}return null}function l8(l){l=l.previousSibling;for(var m=0;l;){if(l.nodeType===8){var ie=l.data;if(ie==="$"||ie==="$!"||ie==="$?"||ie==="$~"||ie==="&"){if(m===0)return l;m--}else ie!=="/$"&&ie!=="/&"||m++}l=l.previousSibling}return null}function d8(l,m,ie){switch(m=d6(ie),l){case"html":if(l=m.documentElement,!l)throw Error(n(452));return l;case"head":if(l=m.head,!l)throw Error(n(453));return l;case"body":if(l=m.body,!l)throw Error(n(454));return l;default:throw Error(n(451))}}function Hb(l){for(var m=l.attributes;m.length;)l.removeAttributeNode(m[0]);ta(l)}var ud=new Map,h8=new Set;function h6(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var xh=ue.d;ue.d={f:b4,r:v4,D:w4,C:x4,L:E4,m:A4,X:I4,S:S4,M:_4};function b4(){var l=xh.f(),m=i6();return l||m}function v4(l){var m=ga(l);m!==null&&m.tag===5&&m.type==="form"?q3(m):xh.r(l)}var xm=typeof document>"u"?null:document;function p8(l,m,ie){var ir=xm;if(ir&&typeof m=="string"&&m){var oi=ka(m);oi='link[rel="'+l+'"][href="'+oi+'"]',typeof ie=="string"&&(oi+='[crossorigin="'+ie+'"]'),h8.has(oi)||(h8.add(oi),l={rel:l,crossOrigin:ie,href:m},ir.querySelector(oi)===null&&(m=ir.createElement("link"),Uu(m,"link",l),fa(m),ir.head.appendChild(m)))}}function w4(l){xh.D(l),p8("dns-prefetch",l,null)}function x4(l,m){xh.C(l,m),p8("preconnect",l,m)}function E4(l,m,ie){xh.L(l,m,ie);var ir=xm;if(ir&&l&&m){var oi='link[rel="preload"][as="'+ka(m)+'"]';m==="image"&&ie&&ie.imageSrcSet?(oi+='[imagesrcset="'+ka(ie.imageSrcSet)+'"]',typeof ie.imageSizes=="string"&&(oi+='[imagesizes="'+ka(ie.imageSizes)+'"]')):oi+='[href="'+ka(l)+'"]';var li=oi;switch(m){case"style":li=Em(l);break;case"script":li=Am(l)}ud.has(li)||(l=d({rel:"preload",href:m==="image"&&ie&&ie.imageSrcSet?void 0:l,as:m},ie),ud.set(li,l),ir.querySelector(oi)!==null||m==="style"&&ir.querySelector(Vb(li))||m==="script"&&ir.querySelector(Kb(li))||(m=ir.createElement("link"),Uu(m,"link",l),fa(m),ir.head.appendChild(m)))}}function A4(l,m){xh.m(l,m);var ie=xm;if(ie&&l){var ir=m&&typeof m.as=="string"?m.as:"script",oi='link[rel="modulepreload"][as="'+ka(ir)+'"][href="'+ka(l)+'"]',li=oi;switch(ir){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":li=Am(l)}if(!ud.has(li)&&(l=d({rel:"modulepreload",href:l},m),ud.set(li,l),ie.querySelector(oi)===null)){switch(ir){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(ie.querySelector(Kb(li)))return}ir=ie.createElement("link"),Uu(ir,"link",l),fa(ir),ie.head.appendChild(ir)}}}function S4(l,m,ie){xh.S(l,m,ie);var ir=xm;if(ir&&l){var oi=ma(ir).hoistableStyles,li=Em(l);m=m||"default";var Ti=oi.get(li);if(!Ti){var Ki={loading:0,preload:null};if(Ti=ir.querySelector(Vb(li)))Ki.loading=5;else{l=d({rel:"stylesheet",href:l,"data-precedence":m},ie),(ie=ud.get(li))&&pv(l,ie);var to=Ti=ir.createElement("link");fa(to),Uu(to,"link",l),to._p=new Promise(function(go,ko){to.onload=go,to.onerror=ko}),to.addEventListener("load",function(){Ki.loading|=1}),to.addEventListener("error",function(){Ki.loading|=2}),Ki.loading|=4,p6(Ti,m,ir)}Ti={type:"stylesheet",instance:Ti,count:1,state:Ki},oi.set(li,Ti)}}}function I4(l,m){xh.X(l,m);var ie=xm;if(ie&&l){var ir=ma(ie).hoistableScripts,oi=Am(l),li=ir.get(oi);li||(li=ie.querySelector(Kb(oi)),li||(l=d({src:l,async:!0},m),(m=ud.get(oi))&&yv(l,m),li=ie.createElement("script"),fa(li),Uu(li,"link",l),ie.head.appendChild(li)),li={type:"script",instance:li,count:1,state:null},ir.set(oi,li))}}function _4(l,m){xh.M(l,m);var ie=xm;if(ie&&l){var ir=ma(ie).hoistableScripts,oi=Am(l),li=ir.get(oi);li||(li=ie.querySelector(Kb(oi)),li||(l=d({src:l,async:!0,type:"module"},m),(m=ud.get(oi))&&yv(l,m),li=ie.createElement("script"),fa(li),Uu(li,"link",l),ie.head.appendChild(li)),li={type:"script",instance:li,count:1,state:null},ir.set(oi,li))}}function y8(l,m,ie,ir){var oi=(oi=ai.current)?h6(oi):null;if(!oi)throw Error(n(446));switch(l){case"meta":case"title":return null;case"style":return typeof ie.precedence=="string"&&typeof ie.href=="string"?(m=Em(ie.href),ie=ma(oi).hoistableStyles,ir=ie.get(m),ir||(ir={type:"style",instance:null,count:0,state:null},ie.set(m,ir)),ir):{type:"void",instance:null,count:0,state:null};case"link":if(ie.rel==="stylesheet"&&typeof ie.href=="string"&&typeof ie.precedence=="string"){l=Em(ie.href);var li=ma(oi).hoistableStyles,Ti=li.get(l);if(Ti||(oi=oi.ownerDocument||oi,Ti={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},li.set(l,Ti),(li=oi.querySelector(Vb(l)))&&!li._p&&(Ti.instance=li,Ti.state.loading=5),ud.has(l)||(ie={rel:"preload",as:"style",href:ie.href,crossOrigin:ie.crossOrigin,integrity:ie.integrity,media:ie.media,hrefLang:ie.hrefLang,referrerPolicy:ie.referrerPolicy},ud.set(l,ie),li||T4(oi,l,ie,Ti.state))),m&&ir===null)throw Error(n(528,""));return Ti}if(m&&ir!==null)throw Error(n(529,""));return null;case"script":return m=ie.async,ie=ie.src,typeof ie=="string"&&m&&typeof m!="function"&&typeof m!="symbol"?(m=Am(ie),ie=ma(oi).hoistableScripts,ir=ie.get(m),ir||(ir={type:"script",instance:null,count:0,state:null},ie.set(m,ir)),ir):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,l))}}function Em(l){return'href="'+ka(l)+'"'}function Vb(l){return'link[rel="stylesheet"]['+l+"]"}function m8(l){return d({},l,{"data-precedence":l.precedence,precedence:null})}function T4(l,m,ie,ir){l.querySelector('link[rel="preload"][as="style"]['+m+"]")?ir.loading=1:(m=l.createElement("link"),ir.preload=m,m.addEventListener("load",function(){return ir.loading|=1}),m.addEventListener("error",function(){return ir.loading|=2}),Uu(m,"link",ie),fa(m),l.head.appendChild(m))}function Am(l){return'[src="'+ka(l)+'"]'}function Kb(l){return"script[async]"+l}function g8(l,m,ie){if(m.count++,m.instance===null)switch(m.type){case"style":var ir=l.querySelector('style[data-href~="'+ka(ie.href)+'"]');if(ir)return m.instance=ir,fa(ir),ir;var oi=d({},ie,{"data-href":ie.href,"data-precedence":ie.precedence,href:null,precedence:null});return ir=(l.ownerDocument||l).createElement("style"),fa(ir),Uu(ir,"style",oi),p6(ir,ie.precedence,l),m.instance=ir;case"stylesheet":oi=Em(ie.href);var li=l.querySelector(Vb(oi));if(li)return m.state.loading|=4,m.instance=li,fa(li),li;ir=m8(ie),(oi=ud.get(oi))&&pv(ir,oi),li=(l.ownerDocument||l).createElement("link"),fa(li);var Ti=li;return Ti._p=new Promise(function(Ki,to){Ti.onload=Ki,Ti.onerror=to}),Uu(li,"link",ir),m.state.loading|=4,p6(li,ie.precedence,l),m.instance=li;case"script":return li=Am(ie.src),(oi=l.querySelector(Kb(li)))?(m.instance=oi,fa(oi),oi):(ir=ie,(oi=ud.get(li))&&(ir=d({},ie),yv(ir,oi)),l=l.ownerDocument||l,oi=l.createElement("script"),fa(oi),Uu(oi,"link",ir),l.head.appendChild(oi),m.instance=oi);case"void":return null;default:throw Error(n(443,m.type))}else m.type==="stylesheet"&&(m.state.loading&4)===0&&(ir=m.instance,m.state.loading|=4,p6(ir,ie.precedence,l));return m.instance}function p6(l,m,ie){for(var ir=ie.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),oi=ir.length?ir[ir.length-1]:null,li=oi,Ti=0;Ti<ir.length;Ti++){var Ki=ir[Ti];if(Ki.dataset.precedence===m)li=Ki;else if(li!==oi)break}li?li.parentNode.insertBefore(l,li.nextSibling):(m=ie.nodeType===9?ie.head:ie,m.insertBefore(l,m.firstChild))}function pv(l,m){l.crossOrigin==null&&(l.crossOrigin=m.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=m.referrerPolicy),l.title==null&&(l.title=m.title)}function yv(l,m){l.crossOrigin==null&&(l.crossOrigin=m.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=m.referrerPolicy),l.integrity==null&&(l.integrity=m.integrity)}var y6=null;function b8(l,m,ie){if(y6===null){var ir=new Map,oi=y6=new Map;oi.set(ie,ir)}else oi=y6,ir=oi.get(ie),ir||(ir=new Map,oi.set(ie,ir));if(ir.has(l))return ir;for(ir.set(l,null),ie=ie.getElementsByTagName(l),oi=0;oi<ie.length;oi++){var li=ie[oi];if(!(li[$o]||li[Wi]||l==="link"&&li.getAttribute("rel")==="stylesheet")&&li.namespaceURI!=="http://www.w3.org/2000/svg"){var Ti=li.getAttribute(m)||"";Ti=l+Ti;var Ki=ir.get(Ti);Ki?Ki.push(li):ir.set(Ti,[li])}}return ir}function v8(l,m,ie){l=l.ownerDocument||l,l.head.insertBefore(ie,m==="title"?l.querySelector("head > title"):null)}function R4(l,m,ie){if(ie===1||m.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof m.precedence!="string"||typeof m.href!="string"||m.href==="")break;return!0;case"link":if(typeof m.rel!="string"||typeof m.href!="string"||m.href===""||m.onLoad||m.onError)break;switch(m.rel){case"stylesheet":return l=m.disabled,typeof m.precedence=="string"&&l==null;default:return!0}case"script":if(m.async&&typeof m.async!="function"&&typeof m.async!="symbol"&&!m.onLoad&&!m.onError&&m.src&&typeof m.src=="string")return!0}return!1}function w8(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function M4(l,m,ie,ir){if(ie.type==="stylesheet"&&(typeof ir.media!="string"||matchMedia(ir.media).matches!==!1)&&(ie.state.loading&4)===0){if(ie.instance===null){var oi=Em(ir.href),li=m.querySelector(Vb(oi));if(li){m=li._p,m!==null&&typeof m=="object"&&typeof m.then=="function"&&(l.count++,l=m6.bind(l),m.then(l,l)),ie.state.loading|=4,ie.instance=li,fa(li);return}li=m.ownerDocument||m,ir=m8(ir),(oi=ud.get(oi))&&pv(ir,oi),li=li.createElement("link"),fa(li);var Ti=li;Ti._p=new Promise(function(Ki,to){Ti.onload=Ki,Ti.onerror=to}),Uu(li,"link",ir),ie.instance=li}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(ie,m),(m=ie.state.preload)&&(ie.state.loading&3)===0&&(l.count++,ie=m6.bind(l),m.addEventListener("load",ie),m.addEventListener("error",ie))}}var mv=0;function B4(l,m){return l.stylesheets&&l.count===0&&b6(l,l.stylesheets),0<l.count||0<l.imgCount?function(ie){var ir=setTimeout(function(){if(l.stylesheets&&b6(l,l.stylesheets),l.unsuspend){var li=l.unsuspend;l.unsuspend=null,li()}},6e4+m);0<l.imgBytes&&mv===0&&(mv=62500*c4());var oi=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&b6(l,l.stylesheets),l.unsuspend)){var li=l.unsuspend;l.unsuspend=null,li()}},(l.imgBytes>mv?50:800)+m);return l.unsuspend=ie,function(){l.unsuspend=null,clearTimeout(ir),clearTimeout(oi)}}:null}function m6(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)b6(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var g6=null;function b6(l,m){l.stylesheets=null,l.unsuspend!==null&&(l.count++,g6=new Map,m.forEach(O4,l),g6=null,m6.call(l))}function O4(l,m){if(!(m.state.loading&4)){var ie=g6.get(l);if(ie)var ir=ie.get(null);else{ie=new Map,g6.set(l,ie);for(var oi=l.querySelectorAll("link[data-precedence],style[data-precedence]"),li=0;li<oi.length;li++){var Ti=oi[li];(Ti.nodeName==="LINK"||Ti.getAttribute("media")!=="not all")&&(ie.set(Ti.dataset.precedence,Ti),ir=Ti)}ir&&ie.set(null,ir)}oi=m.instance,Ti=oi.getAttribute("data-precedence"),li=ie.get(Ti)||ir,li===ir&&ie.set(null,oi),ie.set(Ti,oi),this.count++,ir=m6.bind(this),oi.addEventListener("load",ir),oi.addEventListener("error",ir),li?li.parentNode.insertBefore(oi,li.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(oi,l.firstChild)),m.state.loading|=4}}var Gb={$$typeof:B,Provider:null,Consumer:null,_currentValue:bt,_currentValue2:bt,_threadCount:0};function C4(l,m,ie,ir,oi,li,Ti,Ki,to){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.hiddenUpdates=ea(null),this.identifierPrefix=ir,this.onUncaughtError=oi,this.onCaughtError=li,this.onRecoverableError=Ti,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=to,this.incompleteTransitions=new Map}function x8(l,m,ie,ir,oi,li,Ti,Ki,to,go,ko,Vo){return l=new C4(l,m,ie,Ti,to,go,ko,Vo,Ki),m=1,li===!0&&(m|=24),li=ju(3,null,null,m),l.current=li,li.stateNode=l,m=mp(),m.refCount++,l.pooledCache=m,m.refCount++,li.memoizedState={element:ir,isDehydrated:ie,cache:m},ky(li),l}function E8(l){return l?(l=dd,l):dd}function A8(l,m,ie,ir,oi,li){oi=E8(oi),ir.context===null?ir.context=oi:ir.pendingContext=oi,ir=bd(m),ir.payload={element:ie},li=li===void 0?null:li,li!==null&&(ir.callback=li),ie=Jf(l,ir,m),ie!==null&&(Xf(ie,l,m),sh(ie,l,m))}function S8(l,m){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var ie=l.retryLane;l.retryLane=ie!==0&&ie<m?ie:m}}function gv(l,m){S8(l,m),(l=l.alternate)&&S8(l,m)}function I8(l){if(l.tag===13||l.tag===31){var m=rh(l,67108864);m!==null&&Xf(m,l,67108864),gv(l,67108864)}}function _8(l){if(l.tag===13||l.tag===31){var m=Hl();m=Fi(m);var ie=rh(l,m);ie!==null&&Xf(ie,l,m),gv(l,m)}}var v6=!0;function F4(l,m,ie,ir){var oi=ur.T;ur.T=null;var li=ue.p;try{ue.p=2,bv(l,m,ie,ir)}finally{ue.p=li,ur.T=oi}}function P4(l,m,ie,ir){var oi=ur.T;ur.T=null;var li=ue.p;try{ue.p=8,bv(l,m,ie,ir)}finally{ue.p=li,ur.T=oi}}function bv(l,m,ie,ir){if(v6){var oi=vv(ir);if(oi===null)iv(l,m,ir,w6,ie),R8(l,ir);else if(N4(oi,l,m,ie,ir))ir.stopPropagation();else if(R8(l,ir),m&4&&-1<k4.indexOf(l)){for(;oi!==null;){var li=ga(oi);if(li!==null)switch(li.tag){case 3:if(li=li.stateNode,li.current.memoizedState.isDehydrated){var Ti=Oo(li.pendingLanes);if(Ti!==0){var Ki=li;for(Ki.pendingLanes|=2,Ki.entangledLanes|=2;Ti;){var to=1<<31-Hi(Ti);Ki.entanglements[1]|=to,Ti&=~to}Qd(li),(Mo&6)===0&&(R0=vn()+500,Lb(0))}}break;case 31:case 13:Ki=rh(li,2),Ki!==null&&Xf(Ki,li,2),i6(),gv(li,2)}if(li=vv(ir),li===null&&iv(l,m,ir,w6,ie),li===oi)break;oi=li}oi!==null&&ir.stopPropagation()}else iv(l,m,ir,null,ie)}}function vv(l){return l=G0(l),wv(l)}var w6=null;function wv(l){if(w6=null,l=sa(l),l!==null){var m=i(l);if(m===null)l=null;else{var ie=m.tag;if(ie===13){if(l=u(m),l!==null)return l;l=null}else if(ie===31){if(l=a(m),l!==null)return l;l=null}else if(ie===3){if(m.stateNode.current.memoizedState.isDehydrated)return m.tag===3?m.stateNode.containerInfo:null;l=null}else m!==l&&(l=null)}}return w6=l,null}function T8(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(di()){case rr:return 2;case on:return 8;case si:case vi:return 32;case Ei:return 268435456;default:return 32}default:return 32}}var xv=!1,D0=null,q0=null,z0=null,$b=new Map,Qb=new Map,V0=[],k4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function R8(l,m){switch(l){case"focusin":case"focusout":D0=null;break;case"dragenter":case"dragleave":q0=null;break;case"mouseover":case"mouseout":z0=null;break;case"pointerover":case"pointerout":$b.delete(m.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qb.delete(m.pointerId)}}function e3(l,m,ie,ir,oi,li){return l===null||l.nativeEvent!==li?(l={blockedOn:m,domEventName:ie,eventSystemFlags:ir,nativeEvent:li,targetContainers:[oi]},m!==null&&(m=ga(m),m!==null&&I8(m)),l):(l.eventSystemFlags|=ir,m=l.targetContainers,oi!==null&&m.indexOf(oi)===-1&&m.push(oi),l)}function N4(l,m,ie,ir,oi){switch(m){case"focusin":return D0=e3(D0,l,m,ie,ir,oi),!0;case"dragenter":return q0=e3(q0,l,m,ie,ir,oi),!0;case"mouseover":return z0=e3(z0,l,m,ie,ir,oi),!0;case"pointerover":var li=oi.pointerId;return $b.set(li,e3($b.get(li)||null,l,m,ie,ir,oi)),!0;case"gotpointercapture":return li=oi.pointerId,Qb.set(li,e3(Qb.get(li)||null,l,m,ie,ir,oi)),!0}return!1}function M8(l){var m=sa(l.target);if(m!==null){var ie=i(m);if(ie!==null){if(m=ie.tag,m===13){if(m=u(ie),m!==null){l.blockedOn=m,Li(l.priority,function(){_8(ie)});return}}else if(m===31){if(m=a(ie),m!==null){l.blockedOn=m,Li(l.priority,function(){_8(ie)});return}}else if(m===3&&ie.stateNode.current.memoizedState.isDehydrated){l.blockedOn=ie.tag===3?ie.stateNode.containerInfo:null;return}}}l.blockedOn=null}function x6(l){if(l.blockedOn!==null)return!1;for(var m=l.targetContainers;0<m.length;){var ie=vv(l.nativeEvent);if(ie===null){ie=l.nativeEvent;var ir=new ie.constructor(ie.type,ie);Ah=ir,ie.target.dispatchEvent(ir),Ah=null}else return m=ga(ie),m!==null&&I8(m),l.blockedOn=ie,!1;m.shift()}return!0}function B8(l,m,ie){x6(l)&&ie.delete(m)}function D4(){xv=!1,D0!==null&&x6(D0)&&(D0=null),q0!==null&&x6(q0)&&(q0=null),z0!==null&&x6(z0)&&(z0=null),$b.forEach(B8),Qb.forEach(B8)}function E6(l,m){l.blockedOn===m&&(l.blockedOn=null,xv||(xv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,D4)))}var A6=null;function O8(l){A6!==l&&(A6=l,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){A6===l&&(A6=null);for(var m=0;m<l.length;m+=3){var ie=l[m],ir=l[m+1],oi=l[m+2];if(typeof ir!="function"){if(wv(ir||ie)===null)continue;break}var li=ga(ie);li!==null&&(l.splice(m,3),m-=3,Yh(li,{pending:!0,data:oi,method:ie.method,action:ir},ir,oi))}}))}function Sm(l){function m(to){return E6(to,l)}D0!==null&&E6(D0,l),q0!==null&&E6(q0,l),z0!==null&&E6(z0,l),$b.forEach(m),Qb.forEach(m);for(var ie=0;ie<V0.length;ie++){var ir=V0[ie];ir.blockedOn===l&&(ir.blockedOn=null)}for(;0<V0.length&&(ie=V0[0],ie.blockedOn===null);)M8(ie),ie.blockedOn===null&&V0.shift();if(ie=(l.ownerDocument||l).$$reactFormReplay,ie!=null)for(ir=0;ir<ie.length;ir+=3){var oi=ie[ir],li=ie[ir+1],Ti=oi[io]||null;if(typeof li=="function")Ti||O8(ie);else if(Ti){var Ki=null;if(li&&li.hasAttribute("formAction")){if(oi=li,Ti=li[io]||null)Ki=Ti.formAction;else if(wv(oi)!==null)continue}else Ki=Ti.action;typeof Ki=="function"?ie[ir+1]=Ki:(ie.splice(ir,3),ir-=3),O8(ie)}}}function C8(){function l(li){li.canIntercept&&li.info==="react-transition"&&li.intercept({handler:function(){return new Promise(function(Ti){return oi=Ti})},focusReset:"manual",scroll:"manual"})}function m(){oi!==null&&(oi(),oi=null),ir||setTimeout(ie,20)}function ie(){if(!ir&&!navigation.transition){var li=navigation.currentEntry;li&&li.url!=null&&navigation.navigate(li.url,{state:li.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var ir=!1,oi=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",m),navigation.addEventListener("navigateerror",m),setTimeout(ie,100),function(){ir=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",m),navigation.removeEventListener("navigateerror",m),oi!==null&&(oi(),oi=null)}}}function Ev(l){this._internalRoot=l}S6.prototype.render=Ev.prototype.render=function(l){var m=this._internalRoot;if(m===null)throw Error(n(409));var ie=m.current,ir=Hl();A8(ie,ir,l,m,null,null)},S6.prototype.unmount=Ev.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var m=l.containerInfo;A8(l.current,2,null,l,null,null),i6(),m[lo]=null}};function S6(l){this._internalRoot=l}S6.prototype.unstable_scheduleHydration=function(l){if(l){var m=gi();l={blockedOn:null,target:l,priority:m};for(var ie=0;ie<V0.length&&m!==0&&m<V0[ie].priority;ie++);V0.splice(ie,0,l),ie===0&&M8(l)}};var F8=t.version;if(F8!=="19.2.3")throw Error(n(527,F8,"19.2.3"));ue.findDOMNode=function(l){var m=l._reactInternals;if(m===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=f(m),l=l!==null?c(l):null,l=l===null?null:l.stateNode,l};var U4={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:ur,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var I6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!I6.isDisabled&&I6.supportsFiber)try{Ii=I6.inject(U4),Ci=I6}catch{}}return reactDomClient_production.createRoot=function(l,m){if(!o(l))throw Error(n(299));var ie=!1,ir="",oi=Cu,li=js,Ti=vd;return m!=null&&(m.unstable_strictMode===!0&&(ie=!0),m.identifierPrefix!==void 0&&(ir=m.identifierPrefix),m.onUncaughtError!==void 0&&(oi=m.onUncaughtError),m.onCaughtError!==void 0&&(li=m.onCaughtError),m.onRecoverableError!==void 0&&(Ti=m.onRecoverableError)),m=x8(l,1,!1,null,null,ie,ir,null,oi,li,Ti,C8),l[lo]=m.current,nv(l),new Ev(m)},reactDomClient_production.hydrateRoot=function(l,m,ie){if(!o(l))throw Error(n(299));var ir=!1,oi="",li=Cu,Ti=js,Ki=vd,to=null;return ie!=null&&(ie.unstable_strictMode===!0&&(ir=!0),ie.identifierPrefix!==void 0&&(oi=ie.identifierPrefix),ie.onUncaughtError!==void 0&&(li=ie.onUncaughtError),ie.onCaughtError!==void 0&&(Ti=ie.onCaughtError),ie.onRecoverableError!==void 0&&(Ki=ie.onRecoverableError),ie.formState!==void 0&&(to=ie.formState)),m=x8(l,1,!0,m,ie??null,ir,oi,to,li,Ti,Ki,C8),m.context=E8(null),ie=m.current,ir=Hl(),ir=Fi(ir),oi=bd(ir),oi.callback=null,Jf(ie,oi,ir),ie=ir,m.current.lanes=ie,zi(m,ie),Qd(m),l[lo]=m.current,nv(l),new S6(m)},reactDomClient_production.version="19.2.3",reactDomClient_production}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client.exports;hasRequiredClient=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),client.exports=requireReactDomClient_production(),client.exports}var clientExports=requireClient(),reactDomExports=requireReactDom();function Modal({isOpen:e,onClose:t,title:r,children:n,className:o,url:i}){reactExports.useEffect(()=>{if(e){const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}}},[e]);const u=()=>{i&&(globalThis?.open?.(i,"_blank","noopener,noreferrer"),t())};if(!e)return null;const a=jsxRuntimeExports.jsx("div",{className:"modal-overlay",onClick:t,children:jsxRuntimeExports.jsxs("div",{className:`modal-content ${o}`,onClick:s=>s.stopPropagation(),children:[jsxRuntimeExports.jsxs("div",{className:"modal-header",children:[jsxRuntimeExports.jsx("h2",{className:"modal-title",children:r}),jsxRuntimeExports.jsxs("div",{className:"modal-header-actions",children:[i&&jsxRuntimeExports.jsx("button",{className:"modal-open-new-window",onClick:u,"aria-label":"Open in new window",title:"Open in new window",type:"button",children:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),jsxRuntimeExports.jsx("polyline",{points:"15 3 21 3 21 9"}),jsxRuntimeExports.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}),jsxRuntimeExports.jsx("button",{className:"modal-close",onClick:t,type:"button",children:"×"})]})]}),jsxRuntimeExports.jsx("div",{className:"modal-body",children:n})]})});return typeof document<"u"&&document.body?reactDomExports.createPortal(a,document.body):a}const crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes$4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function anumber$1(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function abytes$1(e,...t){if(!isBytes$4(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ahash(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");anumber$1(e.outputLen),anumber$1(e.blockLen)}function aexists(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 aoutput(e,t){abytes$1(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function u32$2(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function clean(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function createView(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function rotr(e,t){return e<<32-t|e>>>t}const isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function byteSwap$1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const swap8IfBE=isLE$1?e=>e:e=>byteSwap$1(e);function byteSwap32$1(e){for(let t=0;t<e.length;t++)e[t]=byteSwap$1(e[t]);return e}const swap32IfBE=isLE$1?e=>e:byteSwap32$1,hasHexBuiltin$1=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",hexes$2=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bytesToHex$4(e){if(abytes$1(e),hasHexBuiltin$1)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=hexes$2[e[r]];return t}const asciis$1={_0:48,_9:57,A:65,F:70,a:97,f:102};function asciiToBase16$1(e){if(e>=asciis$1._0&&e<=asciis$1._9)return e-asciis$1._0;if(e>=asciis$1.A&&e<=asciis$1.F)return e-(asciis$1.A-10);if(e>=asciis$1.a&&e<=asciis$1.f)return e-(asciis$1.a-10)}function hexToBytes$2(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(hasHexBuiltin$1)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const u=asciiToBase16$1(e.charCodeAt(i)),a=asciiToBase16$1(e.charCodeAt(i+1));if(u===void 0||a===void 0){const s=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+i)}n[o]=u*16+a}return n}function utf8ToBytes$1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function toBytes$2(e){return typeof e=="string"&&(e=utf8ToBytes$1(e)),abytes$1(e),e}function concatBytes$2(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];abytes$1(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}let Hash$2=class{};function createHasher(e){const t=n=>e().update(toBytes$2(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function createOptHasher(e){const t=(n,o)=>e(o).update(toBytes$2(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function randomBytes(e=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(e));if(crypto$2&&typeof crypto$2.randomBytes=="function")return Uint8Array.from(crypto$2.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$b=BigInt(0),_1n$c=BigInt(1);function _abool2(e,t=""){if(typeof e!="boolean"){const r=t&&`"${t}"`;throw new Error(r+"expected boolean, got type="+typeof e)}return e}function _abytes2(e,t,r=""){const n=isBytes$4(e),o=e?.length,i=t!==void 0;if(!n||i&&o!==t){const u=r&&`"${r}" `,a=i?` of length ${t}`:"",s=n?`length=${o}`:`type=${typeof e}`;throw new Error(u+"expected Uint8Array"+a+", got "+s)}return e}function numberToHexUnpadded$1(e){const t=e.toString(16);return t.length&1?"0"+t:t}function hexToNumber$3(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?_0n$b:BigInt("0x"+e)}function bytesToNumberBE$1(e){return hexToNumber$3(bytesToHex$4(e))}function bytesToNumberLE$1(e){return abytes$1(e),hexToNumber$3(bytesToHex$4(Uint8Array.from(e).reverse()))}function numberToBytesBE$1(e,t){return hexToBytes$2(e.toString(16).padStart(t*2,"0"))}function numberToBytesLE$1(e,t){return numberToBytesBE$1(e,t).reverse()}function ensureBytes$1(e,t,r){let n;if(typeof t=="string")try{n=hexToBytes$2(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(isBytes$4(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function copyBytes(e){return Uint8Array.from(e)}const isPosBig$1=e=>typeof e=="bigint"&&_0n$b<=e;function inRange$1(e,t,r){return isPosBig$1(e)&&isPosBig$1(t)&&isPosBig$1(r)&&t<=e&&e<r}function aInRange$1(e,t,r,n){if(!inRange$1(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function bitLen$1(e){let t;for(t=0;e>_0n$b;e>>=_1n$c,t+=1);return t}const bitMask$1=e=>(_1n$c<<BigInt(e))-_1n$c;function createHmacDrbg$1(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");const n=h=>new Uint8Array(h),o=h=>Uint8Array.of(h);let i=n(e),u=n(e),a=0;const s=()=>{i.fill(1),u.fill(0),a=0},f=(...h)=>r(u,i,...h),c=(h=n(0))=>{u=f(o(0),h),i=f(),h.length!==0&&(u=f(o(1),h),i=f())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const y=[];for(;h<t;){i=f();const b=i.slice();y.push(b),h+=i.length}return concatBytes$2(...y)};return(h,y)=>{s(),c(h);let b;for(;!(b=y(d()));)c();return s(),b}}function _validateObject(e,t,r={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function n(o,i,u){const a=e[o];if(u&&a===void 0)return;const s=typeof a;if(s!==i||a===null)throw new Error(`param "${o}" is invalid: expected ${i}, got ${s}`)}Object.entries(t).forEach(([o,i])=>n(o,i,!1)),Object.entries(r).forEach(([o,i])=>n(o,i,!0))}function memoized$1(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$a=BigInt(0),_1n$b=BigInt(1),_2n$8=BigInt(2),_3n$3=BigInt(3),_4n$3=BigInt(4),_5n$2=BigInt(5),_7n$2=BigInt(7),_8n$3=BigInt(8),_9n=BigInt(9),_16n=BigInt(16);function mod$1(e,t){const r=e%t;return r>=_0n$a?r:t+r}function pow2$1(e,t,r){let n=e;for(;t-- >_0n$a;)n*=n,n%=r;return n}function invert$1(e,t){if(e===_0n$a)throw new Error("invert: expected non-zero number");if(t<=_0n$a)throw new Error("invert: expected positive modulus, got "+t);let r=mod$1(e,t),n=t,o=_0n$a,i=_1n$b;for(;r!==_0n$a;){const a=n/r,s=n%r,f=o-i*a;n=r,r=s,o=i,i=f}if(n!==_1n$b)throw new Error("invert: does not exist");return mod$1(o,t)}function assertIsSquare(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function sqrt3mod4$1(e,t){const r=(e.ORDER+_1n$b)/_4n$3,n=e.pow(t,r);return assertIsSquare(e,n,t),n}function sqrt5mod8$1(e,t){const r=(e.ORDER-_5n$2)/_8n$3,n=e.mul(t,_2n$8),o=e.pow(n,r),i=e.mul(t,o),u=e.mul(e.mul(i,_2n$8),o),a=e.mul(i,e.sub(u,e.ONE));return assertIsSquare(e,a,t),a}function sqrt9mod16(e){const t=Field$1(e),r=tonelliShanks$1(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),u=(e+_7n$2)/_16n;return(a,s)=>{let f=a.pow(s,u),c=a.mul(f,n);const d=a.mul(f,o),p=a.mul(f,i),h=a.eql(a.sqr(c),s),y=a.eql(a.sqr(d),s);f=a.cmov(f,c,h),c=a.cmov(p,d,y);const b=a.eql(a.sqr(c),s),w=a.cmov(f,c,b);return assertIsSquare(a,w,s),w}}function tonelliShanks$1(e){if(e<_3n$3)throw new Error("sqrt is not defined for small field");let t=e-_1n$b,r=0;for(;t%_2n$8===_0n$a;)t/=_2n$8,r++;let n=_2n$8;const o=Field$1(e);for(;FpLegendre$1(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return sqrt3mod4$1;let i=o.pow(n,t);const u=(t+_1n$b)/_2n$8;return function(s,f){if(s.is0(f))return f;if(FpLegendre$1(s,f)!==1)throw new Error("Cannot find square root");let c=r,d=s.mul(s.ONE,i),p=s.pow(f,t),h=s.pow(f,u);for(;!s.eql(p,s.ONE);){if(s.is0(p))return s.ZERO;let y=1,b=s.sqr(p);for(;!s.eql(b,s.ONE);)if(y++,b=s.sqr(b),y===c)throw new Error("Cannot find square root");const w=_1n$b<<BigInt(c-y-1),S=s.pow(d,w);c=y,d=s.sqr(S),p=s.mul(p,d),h=s.mul(h,S)}return h}}function FpSqrt$1(e){return e%_4n$3===_3n$3?sqrt3mod4$1:e%_8n$3===_5n$2?sqrt5mod8$1:e%_16n===_9n?sqrt9mod16(e):tonelliShanks$1(e)}const isNegativeLE=(e,t)=>(mod$1(e,t)&_1n$b)===_1n$b,FIELD_FIELDS$1=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField$1(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=FIELD_FIELDS$1.reduce((n,o)=>(n[o]="function",n),t);return _validateObject(e,r),e}function FpPow$1(e,t,r){if(r<_0n$a)throw new Error("invalid exponent, negatives unsupported");if(r===_0n$a)return e.ONE;if(r===_1n$b)return t;let n=e.ONE,o=t;for(;r>_0n$a;)r&_1n$b&&(n=e.mul(n,o)),o=e.sqr(o),r>>=_1n$b;return n}function FpInvertBatch$1(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((u,a,s)=>e.is0(a)?u:(n[s]=u,e.mul(u,a)),e.ONE),i=e.inv(o);return t.reduceRight((u,a,s)=>e.is0(a)?u:(n[s]=e.mul(u,n[s]),e.mul(u,a)),i),n}function FpLegendre$1(e,t){const r=(e.ORDER-_1n$b)/_2n$8,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),u=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!u)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function nLength$1(e,t){t!==void 0&&anumber$1(t);const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Field$1(e,t,r=!1,n={}){if(e<=_0n$a)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,u=!1,a;if(typeof t=="object"&&t!=null){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const p=t;p.BITS&&(o=p.BITS),p.sqrt&&(i=p.sqrt),typeof p.isLE=="boolean"&&(r=p.isLE),typeof p.modFromBytes=="boolean"&&(u=p.modFromBytes),a=p.allowedLengths}else typeof t=="number"&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:s,nByteLength:f}=nLength$1(e,o);if(f>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const d=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:f,MASK:bitMask$1(s),ZERO:_0n$a,ONE:_1n$b,allowedLengths:a,create:p=>mod$1(p,e),isValid:p=>{if(typeof p!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof p);return _0n$a<=p&&p<e},is0:p=>p===_0n$a,isValidNot0:p=>!d.is0(p)&&d.isValid(p),isOdd:p=>(p&_1n$b)===_1n$b,neg:p=>mod$1(-p,e),eql:(p,h)=>p===h,sqr:p=>mod$1(p*p,e),add:(p,h)=>mod$1(p+h,e),sub:(p,h)=>mod$1(p-h,e),mul:(p,h)=>mod$1(p*h,e),pow:(p,h)=>FpPow$1(d,p,h),div:(p,h)=>mod$1(p*invert$1(h,e),e),sqrN:p=>p*p,addN:(p,h)=>p+h,subN:(p,h)=>p-h,mulN:(p,h)=>p*h,inv:p=>invert$1(p,e),sqrt:i||(p=>(c||(c=FpSqrt$1(e)),c(d,p))),toBytes:p=>r?numberToBytesLE$1(p,f):numberToBytesBE$1(p,f),fromBytes:(p,h=!0)=>{if(a){if(!a.includes(p.length)||p.length>f)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+p.length);const b=new Uint8Array(f);b.set(p,r?0:b.length-p.length),p=b}if(p.length!==f)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+p.length);let y=r?bytesToNumberLE$1(p):bytesToNumberBE$1(p);if(u&&(y=mod$1(y,e)),!h&&!d.isValid(y))throw new Error("invalid field element: outside of range 0..ORDER");return y},invertBatch:p=>FpInvertBatch$1(d,p),cmov:(p,h,y)=>y?h:p});return Object.freeze(d)}function getFieldBytesLength$1(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function getMinHashLength$1(e){const t=getFieldBytesLength$1(e);return t+Math.ceil(t/2)}function mapHashToField$1(e,t,r=!1){const n=e.length,o=getFieldBytesLength$1(t),i=getMinHashLength$1(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const u=r?bytesToNumberLE$1(e):bytesToNumberBE$1(e),a=mod$1(u,t-_1n$b)+_1n$b;return r?numberToBytesLE$1(a,o):numberToBytesBE$1(a,o)}function setBigUint64(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),u=Number(r>>o&i),a=Number(r&i),s=n?4:0,f=n?0:4;e.setUint32(t+s,u,n),e.setUint32(t+f,a,n)}function Chi(e,t,r){return e&t^~e&r}function Maj(e,t,r){return e&t^e&r^t&r}class HashMD extends Hash$2{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=createView(this.buffer)}update(t){aexists(this),t=toBytes$2(t),abytes$1(t);const{view:r,buffer:n,blockLen:o}=this,i=t.length;for(let u=0;u<i;){const a=Math.min(o-this.pos,i-u);if(a===o){const s=createView(t);for(;o<=i-u;u+=o)this.process(s,u);continue}n.set(t.subarray(u,u+a),this.pos),this.pos+=a,u+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){aexists(this),aoutput(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:u}=this;r[u++]=128,clean(this.buffer.subarray(u)),this.padOffset>o-u&&(this.process(n,0),u=0);for(let d=u;d<o;d++)r[d]=0;setBigUint64(n,o-8,BigInt(this.length*8),i),this.process(n,0);const a=createView(t),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=s/4,c=this.get();if(f>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)a.setUint32(4*d,c[d],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:u,pos:a}=this;return t.destroyed=u,t.finished=i,t.length=o,t.pos=a,o%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),U32_MASK64$1=BigInt(2**32-1),_32n$1=BigInt(32);function fromBig$1(e,t=!1){return t?{h:Number(e&U32_MASK64$1),l:Number(e>>_32n$1&U32_MASK64$1)}:{h:Number(e>>_32n$1&U32_MASK64$1)|0,l:Number(e&U32_MASK64$1)|0}}function split$1(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:u,l:a}=fromBig$1(e[i],t);[n[i],o[i]]=[u,a]}return[n,o]}const shrSH=(e,t,r)=>e>>>r,shrSL=(e,t,r)=>e<<32-r|t>>>r,rotrSH=(e,t,r)=>e>>>r|t<<32-r,rotrSL=(e,t,r)=>e<<32-r|t>>>r,rotrBH=(e,t,r)=>e<<64-r|t>>>r-32,rotrBL=(e,t,r)=>e>>>r-32|t<<64-r,rotr32H=(e,t)=>t,rotr32L=(e,t)=>e,rotlSH$1=(e,t,r)=>e<<r|t>>>32-r,rotlSL$1=(e,t,r)=>t<<r|e>>>32-r,rotlBH$1=(e,t,r)=>t<<r-32|e>>>64-r,rotlBL$1=(e,t,r)=>e<<r-32|t>>>64-r;function add(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}const add3L=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5L=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),add5H=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,SHA256_K=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]),SHA256_W=new Uint32Array(64);class SHA256 extends HashMD{constructor(t=32){super(64,t,8,!1),this.A=SHA256_IV[0]|0,this.B=SHA256_IV[1]|0,this.C=SHA256_IV[2]|0,this.D=SHA256_IV[3]|0,this.E=SHA256_IV[4]|0,this.F=SHA256_IV[5]|0,this.G=SHA256_IV[6]|0,this.H=SHA256_IV[7]|0}get(){const{A:t,B:r,C:n,D:o,E:i,F:u,G:a,H:s}=this;return[t,r,n,o,i,u,a,s]}set(t,r,n,o,i,u,a,s){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=u|0,this.G=a|0,this.H=s|0}process(t,r){for(let d=0;d<16;d++,r+=4)SHA256_W[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){const p=SHA256_W[d-15],h=SHA256_W[d-2],y=rotr(p,7)^rotr(p,18)^p>>>3,b=rotr(h,17)^rotr(h,19)^h>>>10;SHA256_W[d]=b+SHA256_W[d-7]+y+SHA256_W[d-16]|0}let{A:n,B:o,C:i,D:u,E:a,F:s,G:f,H:c}=this;for(let d=0;d<64;d++){const p=rotr(a,6)^rotr(a,11)^rotr(a,25),h=c+p+Chi(a,s,f)+SHA256_K[d]+SHA256_W[d]|0,b=(rotr(n,2)^rotr(n,13)^rotr(n,22))+Maj(n,o,i)|0;c=f,f=s,s=a,a=u+h|0,u=i,i=o,o=n,n=h+b|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,u=u+this.D|0,a=a+this.E|0,s=s+this.F|0,f=f+this.G|0,c=c+this.H|0,this.set(n,o,i,u,a,s,f,c)}roundClean(){clean(SHA256_W)}destroy(){this.set(0,0,0,0,0,0,0,0),clean(this.buffer)}}const K512=split$1(["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))),SHA512_Kh=K512[0],SHA512_Kl=K512[1],SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=SHA512_IV[0]|0,this.Al=SHA512_IV[1]|0,this.Bh=SHA512_IV[2]|0,this.Bl=SHA512_IV[3]|0,this.Ch=SHA512_IV[4]|0,this.Cl=SHA512_IV[5]|0,this.Dh=SHA512_IV[6]|0,this.Dl=SHA512_IV[7]|0,this.Eh=SHA512_IV[8]|0,this.El=SHA512_IV[9]|0,this.Fh=SHA512_IV[10]|0,this.Fl=SHA512_IV[11]|0,this.Gh=SHA512_IV[12]|0,this.Gl=SHA512_IV[13]|0,this.Hh=SHA512_IV[14]|0,this.Hl=SHA512_IV[15]|0}get(){const{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:u,Dh:a,Dl:s,Eh:f,El:c,Fh:d,Fl:p,Gh:h,Gl:y,Hh:b,Hl:w}=this;return[t,r,n,o,i,u,a,s,f,c,d,p,h,y,b,w]}set(t,r,n,o,i,u,a,s,f,c,d,p,h,y,b,w){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=u|0,this.Dh=a|0,this.Dl=s|0,this.Eh=f|0,this.El=c|0,this.Fh=d|0,this.Fl=p|0,this.Gh=h|0,this.Gl=y|0,this.Hh=b|0,this.Hl=w|0}process(t,r){for(let B=0;B<16;B++,r+=4)SHA512_W_H[B]=t.getUint32(r),SHA512_W_L[B]=t.getUint32(r+=4);for(let B=16;B<80;B++){const ae=SHA512_W_H[B-15]|0,W=SHA512_W_L[B-15]|0,J=rotrSH(ae,W,1)^rotrSH(ae,W,8)^shrSH(ae,W,7),ve=rotrSL(ae,W,1)^rotrSL(ae,W,8)^shrSL(ae,W,7),Qe=SHA512_W_H[B-2]|0,kt=SHA512_W_L[B-2]|0,nr=rotrSH(Qe,kt,19)^rotrBH(Qe,kt,61)^shrSH(Qe,kt,6),sr=rotrSL(Qe,kt,19)^rotrBL(Qe,kt,61)^shrSL(Qe,kt,6),ce=add4L(ve,sr,SHA512_W_L[B-7],SHA512_W_L[B-16]),Ze=add4H(ce,J,nr,SHA512_W_H[B-7],SHA512_W_H[B-16]);SHA512_W_H[B]=Ze|0,SHA512_W_L[B]=ce|0}let{Ah:n,Al:o,Bh:i,Bl:u,Ch:a,Cl:s,Dh:f,Dl:c,Eh:d,El:p,Fh:h,Fl:y,Gh:b,Gl:w,Hh:S,Hl:E}=this;for(let B=0;B<80;B++){const ae=rotrSH(d,p,14)^rotrSH(d,p,18)^rotrBH(d,p,41),W=rotrSL(d,p,14)^rotrSL(d,p,18)^rotrBL(d,p,41),J=d&h^~d&b,ve=p&y^~p&w,Qe=add5L(E,W,ve,SHA512_Kl[B],SHA512_W_L[B]),kt=add5H(Qe,S,ae,J,SHA512_Kh[B],SHA512_W_H[B]),nr=Qe|0,sr=rotrSH(n,o,28)^rotrBH(n,o,34)^rotrBH(n,o,39),ce=rotrSL(n,o,28)^rotrBL(n,o,34)^rotrBL(n,o,39),Ze=n&i^n&a^i&a,se=o&u^o&s^u&s;S=b|0,E=w|0,b=h|0,w=y|0,h=d|0,y=p|0,{h:d,l:p}=add(f|0,c|0,kt|0,nr|0),f=a|0,c=s|0,a=i|0,s=u|0,i=n|0,u=o|0;const vt=add3L(nr,ce,se);n=add3H(vt,kt,sr,Ze),o=vt|0}({h:n,l:o}=add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:u}=add(this.Bh|0,this.Bl|0,i|0,u|0),{h:a,l:s}=add(this.Ch|0,this.Cl|0,a|0,s|0),{h:f,l:c}=add(this.Dh|0,this.Dl|0,f|0,c|0),{h:d,l:p}=add(this.Eh|0,this.El|0,d|0,p|0),{h,l:y}=add(this.Fh|0,this.Fl|0,h|0,y|0),{h:b,l:w}=add(this.Gh|0,this.Gl|0,b|0,w|0),{h:S,l:E}=add(this.Hh|0,this.Hl|0,S|0,E|0),this.set(n,o,i,u,a,s,f,c,d,p,h,y,b,w,S,E)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){clean(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha256$4=createHasher(()=>new SHA256),sha512$6=createHasher(()=>new SHA512);class HMAC extends Hash$2{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,ahash(t);const n=toBytes$2(r);if(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;const o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?t.create().update(n).digest():n);for(let u=0;u<i.length;u++)i[u]^=54;this.iHash.update(i),this.oHash=t.create();for(let u=0;u<i.length;u++)i[u]^=106;this.oHash.update(i),clean(i)}update(t){return aexists(this),this.iHash.update(t),this}digestInto(t){aexists(this),abytes$1(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:o,destroyed:i,blockLen:u,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=i,t.blockLen=u,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hmac$1=(e,t,r)=>new HMAC(e,t).update(r).digest();hmac$1.create=(e,t)=>new HMAC(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$9=BigInt(0),_1n$a=BigInt(1);function negateCt(e,t){const r=t.negate();return e?r:t}function normalizeZ(e,t){const r=FpInvertBatch$1(e.Fp,t.map(n=>n.Z));return t.map((n,o)=>e.fromAffine(n.toAffine(r[o])))}function validateW$1(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function calcWOpts$1(e,t){validateW$1(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=bitMask$1(e),u=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:u}}function calcOffsets$1(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:u}=r;let a=Number(e&o),s=e>>u;a>n&&(a-=i,s+=_1n$a);const f=t*n,c=f+Math.abs(a)-1,d=a===0,p=a<0,h=t%2!==0;return{nextN:s,offset:c,isZero:d,isNeg:p,isNegF:h,offsetF:f}}function validateMSMPoints$1(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function validateMSMScalars$1(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const pointPrecomputes$1=new WeakMap,pointWindowSizes$1=new WeakMap;function getW$1(e){return pointWindowSizes$1.get(e)||1}function assert0(e){if(e!==_0n$9)throw new Error("invalid wNAF")}let wNAF$1=class{constructor(t,r){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,n=this.ZERO){let o=t;for(;r>_0n$9;)r&_1n$a&&(n=n.add(o)),o=o.double(),r>>=_1n$a;return n}precomputeWindow(t,r){const{windows:n,windowSize:o}=calcWOpts$1(r,this.bits),i=[];let u=t,a=u;for(let s=0;s<n;s++){a=u,i.push(a);for(let f=1;f<o;f++)a=a.add(u),i.push(a);u=a.double()}return i}wNAF(t,r,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let o=this.ZERO,i=this.BASE;const u=calcWOpts$1(t,this.bits);for(let a=0;a<u.windows;a++){const{nextN:s,offset:f,isZero:c,isNeg:d,isNegF:p,offsetF:h}=calcOffsets$1(n,a,u);n=s,c?i=i.add(negateCt(p,r[h])):o=o.add(negateCt(d,r[f]))}return assert0(n),{p:o,f:i}}wNAFUnsafe(t,r,n,o=this.ZERO){const i=calcWOpts$1(t,this.bits);for(let u=0;u<i.windows&&n!==_0n$9;u++){const{nextN:a,offset:s,isZero:f,isNeg:c}=calcOffsets$1(n,u,i);if(n=a,!f){const d=r[s];o=o.add(c?d.negate():d)}}return assert0(n),o}getPrecomputes(t,r,n){let o=pointPrecomputes$1.get(r);return o||(o=this.precomputeWindow(r,t),t!==1&&(typeof n=="function"&&(o=n(o)),pointPrecomputes$1.set(r,o))),o}cached(t,r,n){const o=getW$1(t);return this.wNAF(o,this.getPrecomputes(o,t,n),r)}unsafe(t,r,n,o){const i=getW$1(t);return i===1?this._unsafeLadder(t,r,o):this.wNAFUnsafe(i,this.getPrecomputes(i,t,n),r,o)}createCache(t,r){validateW$1(r,this.bits),pointWindowSizes$1.set(t,r),pointPrecomputes$1.delete(t)}hasCache(t){return getW$1(t)!==1}};function mulEndoUnsafe(e,t,r,n){let o=t,i=e.ZERO,u=e.ZERO;for(;r>_0n$9||n>_0n$9;)r&_1n$a&&(i=i.add(o)),n&_1n$a&&(u=u.add(o)),o=o.double(),r>>=_1n$a,n>>=_1n$a;return{p1:i,p2:u}}function pippenger$1(e,t,r,n){validateMSMPoints$1(r,e),validateMSMScalars$1(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const u=e.ZERO,a=bitLen$1(BigInt(o));let s=1;a>12?s=a-3:a>4?s=a-2:a>0&&(s=2);const f=bitMask$1(s),c=new Array(Number(f)+1).fill(u),d=Math.floor((t.BITS-1)/s)*s;let p=u;for(let h=d;h>=0;h-=s){c.fill(u);for(let b=0;b<i;b++){const w=n[b],S=Number(w>>BigInt(h)&f);c[S]=c[S].add(r[b])}let y=u;for(let b=c.length-1,w=u;b>0;b--)w=w.add(c[b]),y=y.add(w);if(p=p.add(y),h!==0)for(let b=0;b<s;b++)p=p.double()}return p}function createField(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return validateField$1(t),t}else return Field$1(e,{isLE:r})}function _createCurveFields(e,t,r={},n){if(n===void 0&&(n=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const s of["p","n","h"]){const f=t[s];if(!(typeof f=="bigint"&&f>_0n$9))throw new Error(`CURVE.${s} must be positive bigint`)}const o=createField(t.p,r.Fp,n),i=createField(t.n,r.Fn,n),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const s of a)if(!o.isValid(t[s]))throw new Error(`CURVE.${s} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const divNearest$1=(e,t)=>(e+(e>=0?t:-t)/_2n$7)/t;function _splitEndoScalar(e,t,r){const[[n,o],[i,u]]=t,a=divNearest$1(u*e,r),s=divNearest$1(-o*e,r);let f=e-a*n-s*i,c=-a*o-s*u;const d=f<_0n$8,p=c<_0n$8;d&&(f=-f),p&&(c=-c);const h=bitMask$1(Math.ceil(bitLen$1(r)/2))+_1n$9;if(f<_0n$8||f>=h||c<_0n$8||c>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:f,k2neg:p,k2:c}}function validateSigFormat(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function validateSigOpts(e,t){const r={};for(let n of Object.keys(t))r[n]=e[n]===void 0?t[n]:e[n];return _abool2(r.lowS,"lowS"),_abool2(r.prehash,"prehash"),r.format!==void 0&&validateSigFormat(r.format),r}let DERErr$1=class extends Error{constructor(t=""){super(t)}};const DER$1={Err:DERErr$1,_tlv:{encode:(e,t)=>{const{Err:r}=DER$1;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=numberToHexUnpadded$1(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?numberToHexUnpadded$1(o.length/2|128):"";return numberToHexUnpadded$1(e)+i+o+t},decode(e,t){const{Err:r}=DER$1;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++],i=!!(o&128);let u=0;if(!i)u=o;else{const s=o&127;if(!s)throw new r("tlv.decode(long): indefinite length not supported");if(s>4)throw new r("tlv.decode(long): byte length is too big");const f=t.subarray(n,n+s);if(f.length!==s)throw new r("tlv.decode: length bytes not complete");if(f[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const c of f)u=u<<8|c;if(n+=s,u<128)throw new r("tlv.decode(long): not minimal encoding")}const a=t.subarray(n,n+u);if(a.length!==u)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+u)}}},_int:{encode(e){const{Err:t}=DER$1;if(e<_0n$8)throw new t("integer: negative integers are not allowed");let r=numberToHexUnpadded$1(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){const{Err:t}=DER$1;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bytesToNumberBE$1(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=DER$1,o=ensureBytes$1("signature",e),{v:i,l:u}=n.decode(48,o);if(u.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:s}=n.decode(2,i),{v:f,l:c}=n.decode(2,s);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(f)}},hexFromSig(e){const{_tlv:t,_int:r}=DER$1,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),i=n+o;return t.encode(48,i)}},_0n$8=BigInt(0),_1n$9=BigInt(1),_2n$7=BigInt(2),_3n$2=BigInt(3),_4n$2=BigInt(4);function _normFnElement(e,t){const{BYTES:r}=e;let n;if(typeof t=="bigint")n=t;else{let o=ensureBytes$1("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function weierstrassN(e,t={}){const r=_createCurveFields("weierstrass",e,t),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:u,n:a}=i;_validateObject(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:s}=t;if(s&&(!n.is0(i.a)||typeof s.beta!="bigint"||!Array.isArray(s.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const f=getWLengths(n,o);function c(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(ce,Ze,se){const{x:vt,y:ur}=Ze.toAffine(),ue=n.toBytes(vt);if(_abool2(se,"isCompressed"),se){c();const bt=!n.isOdd(ur);return concatBytes$2(pprefix(bt),ue)}else return concatBytes$2(Uint8Array.of(4),ue,n.toBytes(ur))}function p(ce){_abytes2(ce,void 0,"Point");const{publicKey:Ze,publicKeyUncompressed:se}=f,vt=ce.length,ur=ce[0],ue=ce.subarray(1);if(vt===Ze&&(ur===2||ur===3)){const bt=n.fromBytes(ue);if(!n.isValid(bt))throw new Error("bad point: is not on curve, wrong x");const L=b(bt);let _;try{_=n.sqrt(L)}catch(Ye){const rn=Ye instanceof Error?": "+Ye.message:"";throw new Error("bad point: is not on curve, sqrt error"+rn)}c();const F=n.isOdd(_);return(ur&1)===1!==F&&(_=n.neg(_)),{x:bt,y:_}}else if(vt===se&&ur===4){const bt=n.BYTES,L=n.fromBytes(ue.subarray(0,bt)),_=n.fromBytes(ue.subarray(bt,bt*2));if(!w(L,_))throw new Error("bad point: is not on curve");return{x:L,y:_}}else throw new Error(`bad point: got length ${vt}, expected compressed=${Ze} or uncompressed=${se}`)}const h=t.toBytes||d,y=t.fromBytes||p;function b(ce){const Ze=n.sqr(ce),se=n.mul(Ze,ce);return n.add(n.add(se,n.mul(ce,i.a)),i.b)}function w(ce,Ze){const se=n.sqr(Ze),vt=b(ce);return n.eql(se,vt)}if(!w(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const S=n.mul(n.pow(i.a,_3n$2),_4n$2),E=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(S,E)))throw new Error("bad curve params: a or b");function B(ce,Ze,se=!1){if(!n.isValid(Ze)||se&&n.is0(Ze))throw new Error(`bad point coordinate ${ce}`);return Ze}function ae(ce){if(!(ce instanceof kt))throw new Error("ProjectivePoint expected")}function W(ce){if(!s||!s.basises)throw new Error("no endo");return _splitEndoScalar(ce,s.basises,o.ORDER)}const J=memoized$1((ce,Ze)=>{const{X:se,Y:vt,Z:ur}=ce;if(n.eql(ur,n.ONE))return{x:se,y:vt};const ue=ce.is0();Ze==null&&(Ze=ue?n.ONE:n.inv(ur));const bt=n.mul(se,Ze),L=n.mul(vt,Ze),_=n.mul(ur,Ze);if(ue)return{x:n.ZERO,y:n.ZERO};if(!n.eql(_,n.ONE))throw new Error("invZ was invalid");return{x:bt,y:L}}),ve=memoized$1(ce=>{if(ce.is0()){if(t.allowInfinityPoint&&!n.is0(ce.Y))return;throw new Error("bad point: ZERO")}const{x:Ze,y:se}=ce.toAffine();if(!n.isValid(Ze)||!n.isValid(se))throw new Error("bad point: x or y not field elements");if(!w(Ze,se))throw new Error("bad point: equation left != right");if(!ce.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function Qe(ce,Ze,se,vt,ur){return se=new kt(n.mul(se.X,ce),se.Y,se.Z),Ze=negateCt(vt,Ze),se=negateCt(ur,se),Ze.add(se)}class kt{constructor(Ze,se,vt){this.X=B("x",Ze),this.Y=B("y",se,!0),this.Z=B("z",vt),Object.freeze(this)}static CURVE(){return i}static fromAffine(Ze){const{x:se,y:vt}=Ze||{};if(!Ze||!n.isValid(se)||!n.isValid(vt))throw new Error("invalid affine point");if(Ze instanceof kt)throw new Error("projective point not allowed");return n.is0(se)&&n.is0(vt)?kt.ZERO:new kt(se,vt,n.ONE)}static fromBytes(Ze){const se=kt.fromAffine(y(_abytes2(Ze,void 0,"point")));return se.assertValidity(),se}static fromHex(Ze){return kt.fromBytes(ensureBytes$1("pointHex",Ze))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(Ze=8,se=!0){return sr.createCache(this,Ze),se||this.multiply(_3n$2),this}assertValidity(){ve(this)}hasEvenY(){const{y:Ze}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(Ze)}equals(Ze){ae(Ze);const{X:se,Y:vt,Z:ur}=this,{X:ue,Y:bt,Z:L}=Ze,_=n.eql(n.mul(se,L),n.mul(ue,ur)),F=n.eql(n.mul(vt,L),n.mul(bt,ur));return _&&F}negate(){return new kt(this.X,n.neg(this.Y),this.Z)}double(){const{a:Ze,b:se}=i,vt=n.mul(se,_3n$2),{X:ur,Y:ue,Z:bt}=this;let L=n.ZERO,_=n.ZERO,F=n.ZERO,k=n.mul(ur,ur),Ye=n.mul(ue,ue),rn=n.mul(bt,bt),ii=n.mul(ur,ue);return ii=n.add(ii,ii),F=n.mul(ur,bt),F=n.add(F,F),L=n.mul(Ze,F),_=n.mul(vt,rn),_=n.add(L,_),L=n.sub(Ye,_),_=n.add(Ye,_),_=n.mul(L,_),L=n.mul(ii,L),F=n.mul(vt,F),rn=n.mul(Ze,rn),ii=n.sub(k,rn),ii=n.mul(Ze,ii),ii=n.add(ii,F),F=n.add(k,k),k=n.add(F,k),k=n.add(k,rn),k=n.mul(k,ii),_=n.add(_,k),rn=n.mul(ue,bt),rn=n.add(rn,rn),k=n.mul(rn,ii),L=n.sub(L,k),F=n.mul(rn,Ye),F=n.add(F,F),F=n.add(F,F),new kt(L,_,F)}add(Ze){ae(Ze);const{X:se,Y:vt,Z:ur}=this,{X:ue,Y:bt,Z:L}=Ze;let _=n.ZERO,F=n.ZERO,k=n.ZERO;const Ye=i.a,rn=n.mul(i.b,_3n$2);let ii=n.mul(se,ue),ai=n.mul(vt,bt),ni=n.mul(ur,L),ri=n.add(se,vt),ui=n.add(ue,bt);ri=n.mul(ri,ui),ui=n.add(ii,ai),ri=n.sub(ri,ui),ui=n.add(se,ur);let lr=n.add(ue,L);return ui=n.mul(ui,lr),lr=n.add(ii,ni),ui=n.sub(ui,lr),lr=n.add(vt,ur),_=n.add(bt,L),lr=n.mul(lr,_),_=n.add(ai,ni),lr=n.sub(lr,_),k=n.mul(Ye,ui),_=n.mul(rn,ni),k=n.add(_,k),_=n.sub(ai,k),k=n.add(ai,k),F=n.mul(_,k),ai=n.add(ii,ii),ai=n.add(ai,ii),ni=n.mul(Ye,ni),ui=n.mul(rn,ui),ai=n.add(ai,ni),ni=n.sub(ii,ni),ni=n.mul(Ye,ni),ui=n.add(ui,ni),ii=n.mul(ai,ui),F=n.add(F,ii),ii=n.mul(lr,ui),_=n.mul(ri,_),_=n.sub(_,ii),ii=n.mul(ri,ai),k=n.mul(lr,k),k=n.add(k,ii),new kt(_,F,k)}subtract(Ze){return this.add(Ze.negate())}is0(){return this.equals(kt.ZERO)}multiply(Ze){const{endo:se}=t;if(!o.isValidNot0(Ze))throw new Error("invalid scalar: out of range");let vt,ur;const ue=bt=>sr.cached(this,bt,L=>normalizeZ(kt,L));if(se){const{k1neg:bt,k1:L,k2neg:_,k2:F}=W(Ze),{p:k,f:Ye}=ue(L),{p:rn,f:ii}=ue(F);ur=Ye.add(ii),vt=Qe(se.beta,k,rn,bt,_)}else{const{p:bt,f:L}=ue(Ze);vt=bt,ur=L}return normalizeZ(kt,[vt,ur])[0]}multiplyUnsafe(Ze){const{endo:se}=t,vt=this;if(!o.isValid(Ze))throw new Error("invalid scalar: out of range");if(Ze===_0n$8||vt.is0())return kt.ZERO;if(Ze===_1n$9)return vt;if(sr.hasCache(this))return this.multiply(Ze);if(se){const{k1neg:ur,k1:ue,k2neg:bt,k2:L}=W(Ze),{p1:_,p2:F}=mulEndoUnsafe(kt,vt,ue,L);return Qe(se.beta,_,F,ur,bt)}else return sr.unsafe(vt,Ze)}multiplyAndAddUnsafe(Ze,se,vt){const ur=this.multiplyUnsafe(se).add(Ze.multiplyUnsafe(vt));return ur.is0()?void 0:ur}toAffine(Ze){return J(this,Ze)}isTorsionFree(){const{isTorsionFree:Ze}=t;return u===_1n$9?!0:Ze?Ze(kt,this):sr.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:Ze}=t;return u===_1n$9?this:Ze?Ze(kt,this):this.multiplyUnsafe(u)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}toBytes(Ze=!0){return _abool2(Ze,"isCompressed"),this.assertValidity(),h(kt,this,Ze)}toHex(Ze=!0){return bytesToHex$4(this.toBytes(Ze))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(Ze=!0){return this.toBytes(Ze)}_setWindowSize(Ze){this.precompute(Ze)}static normalizeZ(Ze){return normalizeZ(kt,Ze)}static msm(Ze,se){return pippenger$1(kt,o,Ze,se)}static fromPrivateKey(Ze){return kt.BASE.multiply(_normFnElement(o,Ze))}}kt.BASE=new kt(i.Gx,i.Gy,n.ONE),kt.ZERO=new kt(n.ZERO,n.ONE,n.ZERO),kt.Fp=n,kt.Fn=o;const nr=o.BITS,sr=new wNAF$1(kt,t.endo?Math.ceil(nr/2):nr);return kt.BASE.precompute(8),kt}function pprefix(e){return Uint8Array.of(e?2:3)}function getWLengths(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function ecdh(e,t={}){const{Fn:r}=e,n=t.randomBytes||randomBytes,o=Object.assign(getWLengths(e.Fp,r),{seed:getMinHashLength$1(r.ORDER)});function i(h){try{return!!_normFnElement(r,h)}catch{return!1}}function u(h,y){const{publicKey:b,publicKeyUncompressed:w}=o;try{const S=h.length;return y===!0&&S!==b||y===!1&&S!==w?!1:!!e.fromBytes(h)}catch{return!1}}function a(h=n(o.seed)){return mapHashToField$1(_abytes2(h,o.seed,"seed"),r.ORDER)}function s(h,y=!0){return e.BASE.multiply(_normFnElement(r,h)).toBytes(y)}function f(h){const y=a(h);return{secretKey:y,publicKey:s(y)}}function c(h){if(typeof h=="bigint")return!1;if(h instanceof e)return!0;const{secretKey:y,publicKey:b,publicKeyUncompressed:w}=o;if(r.allowedLengths||y===b)return;const S=ensureBytes$1("key",h).length;return S===b||S===w}function d(h,y,b=!0){if(c(h)===!0)throw new Error("first arg must be private key");if(c(y)===!1)throw new Error("second arg must be public key");const w=_normFnElement(r,h);return e.fromHex(y).multiply(w).toBytes(b)}return Object.freeze({getPublicKey:s,getSharedSecret:d,keygen:f,Point:e,utils:{isValidSecretKey:i,isValidPublicKey:u,randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:h=>_normFnElement(r,h),precompute(h=8,y=e.BASE){return y.precompute(h,!1)}},lengths:o})}function ecdsa(e,t,r={}){ahash(t),_validateObject(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||randomBytes,o=r.hmac||((se,...vt)=>hmac$1(t,se,concatBytes$2(...vt))),{Fp:i,Fn:u}=e,{ORDER:a,BITS:s}=u,{keygen:f,getPublicKey:c,getSharedSecret:d,utils:p,lengths:h}=ecdh(e,r),y={prehash:!1,lowS:typeof r.lowS=="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},b="compact";function w(se){const vt=a>>_1n$9;return se>vt}function S(se,vt){if(!u.isValidNot0(vt))throw new Error(`invalid signature ${se}: out of range 1..Point.Fn.ORDER`);return vt}function E(se,vt){validateSigFormat(vt);const ur=h.signature,ue=vt==="compact"?ur:vt==="recovered"?ur+1:void 0;return _abytes2(se,ue,`${vt} signature`)}class B{constructor(vt,ur,ue){this.r=S("r",vt),this.s=S("s",ur),ue!=null&&(this.recovery=ue),Object.freeze(this)}static fromBytes(vt,ur=b){E(vt,ur);let ue;if(ur==="der"){const{r:F,s:k}=DER$1.toSig(_abytes2(vt));return new B(F,k)}ur==="recovered"&&(ue=vt[0],ur="compact",vt=vt.subarray(1));const bt=u.BYTES,L=vt.subarray(0,bt),_=vt.subarray(bt,bt*2);return new B(u.fromBytes(L),u.fromBytes(_),ue)}static fromHex(vt,ur){return this.fromBytes(hexToBytes$2(vt),ur)}addRecoveryBit(vt){return new B(this.r,this.s,vt)}recoverPublicKey(vt){const ur=i.ORDER,{r:ue,s:bt,recovery:L}=this;if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");if(a*_2n$7<ur&&L>1)throw new Error("recovery id is ambiguous for h>1 curve");const F=L===2||L===3?ue+a:ue;if(!i.isValid(F))throw new Error("recovery id 2 or 3 invalid");const k=i.toBytes(F),Ye=e.fromBytes(concatBytes$2(pprefix((L&1)===0),k)),rn=u.inv(F),ii=W(ensureBytes$1("msgHash",vt)),ai=u.create(-ii*rn),ni=u.create(bt*rn),ri=e.BASE.multiplyUnsafe(ai).add(Ye.multiplyUnsafe(ni));if(ri.is0())throw new Error("point at infinify");return ri.assertValidity(),ri}hasHighS(){return w(this.s)}toBytes(vt=b){if(validateSigFormat(vt),vt==="der")return hexToBytes$2(DER$1.hexFromSig(this));const ur=u.toBytes(this.r),ue=u.toBytes(this.s);if(vt==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return concatBytes$2(Uint8Array.of(this.recovery),ur,ue)}return concatBytes$2(ur,ue)}toHex(vt){return bytesToHex$4(this.toBytes(vt))}assertValidity(){}static fromCompact(vt){return B.fromBytes(ensureBytes$1("sig",vt),"compact")}static fromDER(vt){return B.fromBytes(ensureBytes$1("sig",vt),"der")}normalizeS(){return this.hasHighS()?new B(this.r,u.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return bytesToHex$4(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return bytesToHex$4(this.toBytes("compact"))}}const ae=r.bits2int||function(vt){if(vt.length>8192)throw new Error("input is too large");const ur=bytesToNumberBE$1(vt),ue=vt.length*8-s;return ue>0?ur>>BigInt(ue):ur},W=r.bits2int_modN||function(vt){return u.create(ae(vt))},J=bitMask$1(s);function ve(se){return aInRange$1("num < 2^"+s,se,_0n$8,J),u.toBytes(se)}function Qe(se,vt){return _abytes2(se,void 0,"message"),vt?_abytes2(t(se),void 0,"prehashed message"):se}function kt(se,vt,ur){if(["recovered","canonical"].some(ai=>ai in ur))throw new Error("sign() legacy options not supported");const{lowS:ue,prehash:bt,extraEntropy:L}=validateSigOpts(ur,y);se=Qe(se,bt);const _=W(se),F=_normFnElement(u,vt),k=[ve(F),ve(_)];if(L!=null&&L!==!1){const ai=L===!0?n(h.secretKey):L;k.push(ensureBytes$1("extraEntropy",ai))}const Ye=concatBytes$2(...k),rn=_;function ii(ai){const ni=ae(ai);if(!u.isValidNot0(ni))return;const ri=u.inv(ni),ui=e.BASE.multiply(ni).toAffine(),lr=u.create(ui.x);if(lr===_0n$8)return;const ar=u.create(ri*u.create(rn+lr*F));if(ar===_0n$8)return;let jr=(ui.x===lr?0:2)|Number(ui.y&_1n$9),ci=ar;return ue&&w(ar)&&(ci=u.neg(ar),jr^=1),new B(lr,ci,jr)}return{seed:Ye,k2sig:ii}}function nr(se,vt,ur={}){se=ensureBytes$1("message",se);const{seed:ue,k2sig:bt}=kt(se,vt,ur);return createHmacDrbg$1(t.outputLen,u.BYTES,o)(ue,bt)}function sr(se){let vt;const ur=typeof se=="string"||isBytes$4(se),ue=!ur&&se!==null&&typeof se=="object"&&typeof se.r=="bigint"&&typeof se.s=="bigint";if(!ur&&!ue)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(ue)vt=new B(se.r,se.s);else if(ur){try{vt=B.fromBytes(ensureBytes$1("sig",se),"der")}catch(bt){if(!(bt instanceof DER$1.Err))throw bt}if(!vt)try{vt=B.fromBytes(ensureBytes$1("sig",se),"compact")}catch{return!1}}return vt||!1}function ce(se,vt,ur,ue={}){const{lowS:bt,prehash:L,format:_}=validateSigOpts(ue,y);if(ur=ensureBytes$1("publicKey",ur),vt=Qe(ensureBytes$1("message",vt),L),"strict"in ue)throw new Error("options.strict was renamed to lowS");const F=_===void 0?sr(se):B.fromBytes(ensureBytes$1("sig",se),_);if(F===!1)return!1;try{const k=e.fromBytes(ur);if(bt&&F.hasHighS())return!1;const{r:Ye,s:rn}=F,ii=W(vt),ai=u.inv(rn),ni=u.create(ii*ai),ri=u.create(Ye*ai),ui=e.BASE.multiplyUnsafe(ni).add(k.multiplyUnsafe(ri));return ui.is0()?!1:u.create(ui.x)===Ye}catch{return!1}}function Ze(se,vt,ur={}){const{prehash:ue}=validateSigOpts(ur,y);return vt=Qe(vt,ue),B.fromBytes(se,"recovered").recoverPublicKey(vt).toBytes()}return Object.freeze({keygen:f,getPublicKey:c,getSharedSecret:d,utils:p,lengths:h,Point:e,sign:nr,verify:ce,recoverPublicKey:Ze,Signature:B,hash:t})}function _weierstrass_legacy_opts_to_new(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(u=>Math.ceil(u/2)))):void 0;const o=Field$1(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),i={Fp:r,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:i}}function _ecdsa_legacy_opts_to_new(e){const{CURVE:t,curveOpts:r}=_weierstrass_legacy_opts_to_new(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function _ecdsa_new_output_to_legacy(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,nLength$1(r.Fn.ORDER,r.Fn.BITS))})}function weierstrass$1(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=_ecdsa_legacy_opts_to_new(e),i=weierstrassN(t,r),u=ecdsa(i,n,o);return _ecdsa_new_output_to_legacy(e,u)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function createCurve$1(e,t){const r=n=>weierstrass$1({...e,hash:n});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1_CURVE={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},secp256k1_ENDO={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},_2n$6=BigInt(2);function sqrtMod$1(e){const t=secp256k1_CURVE.p,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),u=BigInt(23),a=BigInt(44),s=BigInt(88),f=e*e*e%t,c=f*f*e%t,d=pow2$1(c,r,t)*c%t,p=pow2$1(d,r,t)*c%t,h=pow2$1(p,_2n$6,t)*f%t,y=pow2$1(h,o,t)*h%t,b=pow2$1(y,i,t)*y%t,w=pow2$1(b,a,t)*b%t,S=pow2$1(w,s,t)*w%t,E=pow2$1(S,a,t)*b%t,B=pow2$1(E,r,t)*c%t,ae=pow2$1(B,u,t)*y%t,W=pow2$1(ae,n,t)*f%t,J=pow2$1(W,_2n$6,t);if(!Fpk1$1.eql(Fpk1$1.sqr(J),e))throw new Error("Cannot find square root");return J}const Fpk1$1=Field$1(secp256k1_CURVE.p,{sqrt:sqrtMod$1}),secp256k1$3=createCurve$1({...secp256k1_CURVE,Fp:Fpk1$1,lowS:!0,endo:secp256k1_ENDO},sha256$4);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes$3(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function isArrayOf(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(r=>typeof r=="string"):t.every(r=>Number.isSafeInteger(r)):!1}function astr(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function anumber(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function aArr(e){if(!Array.isArray(e))throw new Error("array expected")}function astrArr(e,t){if(!isArrayOf(!0,t))throw new Error(`${e}: array of strings expected`)}function anumArr(e,t){if(!isArrayOf(!1,t))throw new Error(`${e}: array of numbers expected`)}function chain(...e){const t=i=>i,r=(i,u)=>a=>i(u(a)),n=e.map(i=>i.encode).reduceRight(r,t),o=e.map(i=>i.decode).reduce(r,t);return{encode:n,decode:o}}function alphabet(e){const t=typeof e=="string"?e.split(""):e,r=t.length;astrArr("alphabet",t);const n=new Map(t.map((o,i)=>[o,i]));return{encode:o=>(aArr(o),o.map(i=>{if(!Number.isSafeInteger(i)||i<0||i>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${e}`);return t[i]})),decode:o=>(aArr(o),o.map(i=>{astr("alphabet.decode",i);const u=n.get(i);if(u===void 0)throw new Error(`Unknown letter: "${i}". Allowed: ${e}`);return u}))}}function join(e=""){return astr("join",e),{encode:t=>(astrArr("join.decode",t),t.join(e)),decode:t=>(astr("join.decode",t),t.split(e))}}function convertRadix(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(aArr(e),!e.length)return[];let n=0;const o=[],i=Array.from(e,a=>{if(anumber(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),u=i.length;for(;;){let a=0,s=!0;for(let f=n;f<u;f++){const c=i[f],d=t*a,p=d+c;if(!Number.isSafeInteger(p)||d/t!==a||p-c!==d)throw new Error("convertRadix: carry overflow");const h=p/r;a=p%r;const y=Math.floor(h);if(i[f]=y,!Number.isSafeInteger(y)||y*r+a!==p)throw new Error("convertRadix: carry overflow");if(s)y?s=!1:n=f;else continue}if(o.push(a),s)break}for(let a=0;a<e.length-1&&e[a]===0;a++)o.push(0);return o.reverse()}function radix(e){anumber(e);const t=2**8;return{encode:r=>{if(!isBytes$3(r))throw new Error("radix.encode input should be Uint8Array");return convertRadix(Array.from(r),t,e)},decode:r=>(anumArr("radix.decode",r),Uint8Array.from(convertRadix(r,e,t)))}}const genBase58=e=>chain(radix(58),alphabet(e),join("")),base58=genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),version$2="2.37.3";let errorConfig={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${version$2}`};class BaseError extends Error{constructor(t,r={}){const n=r.cause instanceof BaseError?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof BaseError&&r.cause.docsPath||r.docsPath,i=errorConfig.getDocsUrl?.({...r,docsPath:o}),u=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...errorConfig.version?[`Version: ${errorConfig.version}`]:[]].join(`
39
- `);super(u,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=version$2}walk(t){return walk(this,t)}}function walk(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?walk(e.cause,t):t?null:e}class IntegerOutOfRangeError extends BaseError{constructor({max:t,min:r,signed:n,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class InvalidBytesBooleanError extends BaseError{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class SizeOverflowError extends BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function isHex$1(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function size$1(e){return isHex$1(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function trim(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let o=0;o<r.length-1&&r[t==="left"?o:r.length-o-1].toString()==="0";o++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}class SliceOffsetOutOfBoundsError extends BaseError{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}class InvalidBytesLengthError extends BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}function pad(e,{dir:t,size:r=32}={}){return typeof e=="string"?padHex(e,{dir:t,size:r}):padBytes(e,{dir:t,size:r})}function padHex(e,{dir:t,size:r=32}={}){if(r===null)return e;const n=e.replace("0x","");if(n.length>r*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function padBytes(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new SizeExceedsPaddingSizeError({size:e.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let o=0;o<r;o++){const i=t==="right";n[i?o:r-o-1]=e[i?o:e.length-o-1]}return n}const hexes$1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function toHex(e,t={}){return typeof e=="number"||typeof e=="bigint"?numberToHex$1(e,t):typeof e=="string"?stringToHex(e,t):typeof e=="boolean"?boolToHex(e,t):bytesToHex$3(e,t)}function boolToHex(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(assertSize(r,{size:t.size}),pad(r,{size:t.size})):r}function bytesToHex$3(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=hexes$1[e[o]];const n=`0x${r}`;return typeof t.size=="number"?(assertSize(n,{size:t.size}),pad(n,{dir:"right",size:t.size})):n}function numberToHex$1(e,t={}){const{signed:r,size:n}=t,o=BigInt(e);let i;n?r?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const u=typeof i=="bigint"&&r?-i-1n:0;if(i&&o>i||o<u){const s=typeof e=="bigint"?"n":"";throw new IntegerOutOfRangeError({max:i?`${i}${s}`:void 0,min:`${u}${s}`,signed:r,size:n,value:`${e}${s}`})}const a=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?pad(a,{size:n}):a}const encoder$2=new TextEncoder;function stringToHex(e,t={}){const r=encoder$2.encode(e);return bytesToHex$3(r,t)}const encoder$1=new TextEncoder;function toBytes$1(e,t={}){return typeof e=="number"||typeof e=="bigint"?numberToBytes(e,t):typeof e=="boolean"?boolToBytes(e,t):isHex$1(e)?hexToBytes$1(e,t):stringToBytes(e,t)}function boolToBytes(e,t={}){const r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(assertSize(r,{size:t.size}),pad(r,{size:t.size})):r}const charCodeMap$1={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16$1(e){if(e>=charCodeMap$1.zero&&e<=charCodeMap$1.nine)return e-charCodeMap$1.zero;if(e>=charCodeMap$1.A&&e<=charCodeMap$1.F)return e-(charCodeMap$1.A-10);if(e>=charCodeMap$1.a&&e<=charCodeMap$1.f)return e-(charCodeMap$1.a-10)}function hexToBytes$1(e,t={}){let r=e;t.size&&(assertSize(r,{size:t.size}),r=pad(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const o=n.length/2,i=new Uint8Array(o);for(let u=0,a=0;u<o;u++){const s=charCodeToBase16$1(n.charCodeAt(a++)),f=charCodeToBase16$1(n.charCodeAt(a++));if(s===void 0||f===void 0)throw new BaseError(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);i[u]=s*16+f}return i}function numberToBytes(e,t){const r=numberToHex$1(e,t);return hexToBytes$1(r)}function stringToBytes(e,t={}){const r=encoder$1.encode(e);return typeof t.size=="number"?(assertSize(r,{size:t.size}),pad(r,{dir:"right",size:t.size})):r}function assertSize(e,{size:t}){if(size$1(e)>t)throw new SizeOverflowError({givenSize:size$1(e),maxSize:t})}function hexToBigInt(e,t={}){const{signed:r}=t;t.size&&assertSize(e,{size:t.size});const n=BigInt(e);if(!r)return n;const o=(e.length-2)/2,i=(1n<<BigInt(o)*8n-1n)-1n;return n<=i?n:n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function hexToNumber$2(e,t={}){return Number(hexToBigInt(e,t))}async function getTransactionCount(e,{address:t,blockTag:r="latest",blockNumber:n}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof n=="bigint"?numberToHex$1(n):r]},{dedupe:!!n});return hexToNumber$2(o)}class LruMap extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$7=BigInt(0),_1n$8=BigInt(1);function isBytes$2(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function abytes(e){if(!isBytes$2(e))throw new Error("Uint8Array expected")}function abool(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function numberToHexUnpadded(e){const t=e.toString(16);return t.length&1?"0"+t:t}function hexToNumber$1(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?_0n$7:BigInt("0x"+e)}const hasHexBuiltin=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",hexes=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bytesToHex$2(e){if(abytes(e),hasHexBuiltin)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=hexes[e[r]];return t}const asciis={_0:48,_9:57,A:65,F:70,a:97,f:102};function asciiToBase16(e){if(e>=asciis._0&&e<=asciis._9)return e-asciis._0;if(e>=asciis.A&&e<=asciis.F)return e-(asciis.A-10);if(e>=asciis.a&&e<=asciis.f)return e-(asciis.a-10)}function hexToBytes(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(hasHexBuiltin)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const u=asciiToBase16(e.charCodeAt(i)),a=asciiToBase16(e.charCodeAt(i+1));if(u===void 0||a===void 0){const s=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+i)}n[o]=u*16+a}return n}function bytesToNumberBE(e){return hexToNumber$1(bytesToHex$2(e))}function bytesToNumberLE(e){return abytes(e),hexToNumber$1(bytesToHex$2(Uint8Array.from(e).reverse()))}function numberToBytesBE(e,t){return hexToBytes(e.toString(16).padStart(t*2,"0"))}function numberToBytesLE(e,t){return numberToBytesBE(e,t).reverse()}function ensureBytes(e,t,r){let n;if(typeof t=="string")try{n=hexToBytes(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(isBytes$2(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function concatBytes$1(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];abytes(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}const isPosBig=e=>typeof e=="bigint"&&_0n$7<=e;function inRange(e,t,r){return isPosBig(e)&&isPosBig(t)&&isPosBig(r)&&t<=e&&e<r}function aInRange(e,t,r,n){if(!inRange(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function bitLen(e){let t;for(t=0;e>_0n$7;e>>=_1n$8,t+=1);return t}const bitMask=e=>(_1n$8<<BigInt(e))-_1n$8,u8n=e=>new Uint8Array(e),u8fr=e=>Uint8Array.from(e);function createHmacDrbg(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=u8n(e),o=u8n(e),i=0;const u=()=>{n.fill(1),o.fill(0),i=0},a=(...d)=>r(o,n,...d),s=(d=u8n(0))=>{o=a(u8fr([0]),d),n=a(),d.length!==0&&(o=a(u8fr([1]),d),n=a())},f=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const p=[];for(;d<t;){n=a();const h=n.slice();p.push(h),d+=n.length}return concatBytes$1(...p)};return(d,p)=>{u(),s(d);let h;for(;!(h=p(f()));)s();return u(),h}}const validatorFns={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||isBytes$2(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function validateObject(e,t,r={}){const n=(o,i,u)=>{const a=validatorFns[i];if(typeof a!="function")throw new Error("invalid validator function");const s=e[o];if(!(u&&s===void 0)&&!a(s,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+s)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}function memoized(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$7=BigInt(1),_2n$5=BigInt(2),_3n$1=BigInt(3),_4n$1=BigInt(4),_5n$1=BigInt(5),_8n$2=BigInt(8);function mod(e,t){const r=e%t;return r>=_0n$6?r:t+r}function pow2(e,t,r){let n=e;for(;t-- >_0n$6;)n*=n,n%=r;return n}function invert(e,t){if(e===_0n$6)throw new Error("invert: expected non-zero number");if(t<=_0n$6)throw new Error("invert: expected positive modulus, got "+t);let r=mod(e,t),n=t,o=_0n$6,i=_1n$7;for(;r!==_0n$6;){const a=n/r,s=n%r,f=o-i*a;n=r,r=s,o=i,i=f}if(n!==_1n$7)throw new Error("invert: does not exist");return mod(o,t)}function sqrt3mod4(e,t){const r=(e.ORDER+_1n$7)/_4n$1,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function sqrt5mod8(e,t){const r=(e.ORDER-_5n$1)/_8n$2,n=e.mul(t,_2n$5),o=e.pow(n,r),i=e.mul(t,o),u=e.mul(e.mul(i,_2n$5),o),a=e.mul(i,e.sub(u,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function tonelliShanks(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-_1n$7,r=0;for(;t%_2n$5===_0n$6;)t/=_2n$5,r++;let n=_2n$5;const o=Field(e);for(;FpLegendre(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return sqrt3mod4;let i=o.pow(n,t);const u=(t+_1n$7)/_2n$5;return function(s,f){if(s.is0(f))return f;if(FpLegendre(s,f)!==1)throw new Error("Cannot find square root");let c=r,d=s.mul(s.ONE,i),p=s.pow(f,t),h=s.pow(f,u);for(;!s.eql(p,s.ONE);){if(s.is0(p))return s.ZERO;let y=1,b=s.sqr(p);for(;!s.eql(b,s.ONE);)if(y++,b=s.sqr(b),y===c)throw new Error("Cannot find square root");const w=_1n$7<<BigInt(c-y-1),S=s.pow(d,w);c=y,d=s.sqr(S),p=s.mul(p,d),h=s.mul(h,S)}return h}}function FpSqrt(e){return e%_4n$1===_3n$1?sqrt3mod4:e%_8n$2===_5n$1?sqrt5mod8:tonelliShanks(e)}const FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=FIELD_FIELDS.reduce((n,o)=>(n[o]="function",n),t);return validateObject(e,r)}function FpPow(e,t,r){if(r<_0n$6)throw new Error("invalid exponent, negatives unsupported");if(r===_0n$6)return e.ONE;if(r===_1n$7)return t;let n=e.ONE,o=t;for(;r>_0n$6;)r&_1n$7&&(n=e.mul(n,o)),o=e.sqr(o),r>>=_1n$7;return n}function FpInvertBatch(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((u,a,s)=>e.is0(a)?u:(n[s]=u,e.mul(u,a)),e.ONE),i=e.inv(o);return t.reduceRight((u,a,s)=>e.is0(a)?u:(n[s]=e.mul(u,n[s]),e.mul(u,a)),i),n}function FpLegendre(e,t){const r=(e.ORDER-_1n$7)/_2n$5,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),u=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!u)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function nLength(e,t){t!==void 0&&anumber$1(t);const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Field(e,t,r=!1,n={}){if(e<=_0n$6)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=nLength(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:bitMask(o),ZERO:_0n$6,ONE:_1n$7,create:s=>mod(s,e),isValid:s=>{if(typeof s!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof s);return _0n$6<=s&&s<e},is0:s=>s===_0n$6,isOdd:s=>(s&_1n$7)===_1n$7,neg:s=>mod(-s,e),eql:(s,f)=>s===f,sqr:s=>mod(s*s,e),add:(s,f)=>mod(s+f,e),sub:(s,f)=>mod(s-f,e),mul:(s,f)=>mod(s*f,e),pow:(s,f)=>FpPow(a,s,f),div:(s,f)=>mod(s*invert(f,e),e),sqrN:s=>s*s,addN:(s,f)=>s+f,subN:(s,f)=>s-f,mulN:(s,f)=>s*f,inv:s=>invert(s,e),sqrt:n.sqrt||(s=>(u||(u=FpSqrt(e)),u(a,s))),toBytes:s=>r?numberToBytesLE(s,i):numberToBytesBE(s,i),fromBytes:s=>{if(s.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+s.length);return r?bytesToNumberLE(s):bytesToNumberBE(s)},invertBatch:s=>FpInvertBatch(a,s),cmov:(s,f,c)=>c?f:s});return Object.freeze(a)}function getFieldBytesLength(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function getMinHashLength(e){const t=getFieldBytesLength(e);return t+Math.ceil(t/2)}function mapHashToField(e,t,r=!1){const n=e.length,o=getFieldBytesLength(t),i=getMinHashLength(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const u=r?bytesToNumberLE(e):bytesToNumberBE(e),a=mod(u,t-_1n$7)+_1n$7;return r?numberToBytesLE(a,o):numberToBytesBE(a,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$6=BigInt(1);function constTimeNegate(e,t){const r=t.negate();return e?r:t}function validateW(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function calcWOpts(e,t){validateW(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=bitMask(e),u=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:u}}function calcOffsets(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:u}=r;let a=Number(e&o),s=e>>u;a>n&&(a-=i,s+=_1n$6);const f=t*n,c=f+Math.abs(a)-1,d=a===0,p=a<0,h=t%2!==0;return{nextN:s,offset:c,isZero:d,isNeg:p,isNegF:h,offsetF:f}}function validateMSMPoints(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function validateMSMScalars(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const pointPrecomputes=new WeakMap,pointWindowSizes=new WeakMap;function getW(e){return pointWindowSizes.get(e)||1}function wNAF(e,t){return{constTimeNegate,hasPrecomputes(r){return getW(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>_0n$5;)n&_1n$6&&(o=o.add(i)),i=i.double(),n>>=_1n$6;return o},precomputeWindow(r,n){const{windows:o,windowSize:i}=calcWOpts(n,t),u=[];let a=r,s=a;for(let f=0;f<o;f++){s=a,u.push(s);for(let c=1;c<i;c++)s=s.add(a),u.push(s);a=s.double()}return u},wNAF(r,n,o){let i=e.ZERO,u=e.BASE;const a=calcWOpts(r,t);for(let s=0;s<a.windows;s++){const{nextN:f,offset:c,isZero:d,isNeg:p,isNegF:h,offsetF:y}=calcOffsets(o,s,a);o=f,d?u=u.add(constTimeNegate(h,n[y])):i=i.add(constTimeNegate(p,n[c]))}return{p:i,f:u}},wNAFUnsafe(r,n,o,i=e.ZERO){const u=calcWOpts(r,t);for(let a=0;a<u.windows&&o!==_0n$5;a++){const{nextN:s,offset:f,isZero:c,isNeg:d}=calcOffsets(o,a,u);if(o=s,!c){const p=n[f];i=i.add(d?p.negate():p)}}return i},getPrecomputes(r,n,o){let i=pointPrecomputes.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&pointPrecomputes.set(n,o(i))),i},wNAFCached(r,n,o){const i=getW(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){const u=getW(r);return u===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(u,this.getPrecomputes(u,r,o),n,i)},setWindowSize(r,n){validateW(n,t),pointWindowSizes.set(r,n),pointPrecomputes.delete(r)}}}function pippenger(e,t,r,n){validateMSMPoints(r,e),validateMSMScalars(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const u=e.ZERO,a=bitLen(BigInt(o));let s=1;a>12?s=a-3:a>4?s=a-2:a>0&&(s=2);const f=bitMask(s),c=new Array(Number(f)+1).fill(u),d=Math.floor((t.BITS-1)/s)*s;let p=u;for(let h=d;h>=0;h-=s){c.fill(u);for(let b=0;b<i;b++){const w=n[b],S=Number(w>>BigInt(h)&f);c[S]=c[S].add(r[b])}let y=u;for(let b=c.length-1,w=u;b>0;b--)w=w.add(c[b]),y=y.add(w);if(p=p.add(y),h!==0)for(let b=0;b<s;b++)p=p.double()}return p}function validateBasic(e){return validateField(e.Fp),validateObject(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validateSigVerOpts(e){e.lowS!==void 0&&abool("lowS",e.lowS),e.prehash!==void 0&&abool("prehash",e.prehash)}function validatePointOpts(e){const t=validateBasic(e);validateObject(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class DERErr extends Error{constructor(t=""){super(t)}}const DER={Err:DERErr,_tlv:{encode:(e,t)=>{const{Err:r}=DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=numberToHexUnpadded(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?numberToHexUnpadded(o.length/2|128):"";return numberToHexUnpadded(e)+i+o+t},decode(e,t){const{Err:r}=DER;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++],i=!!(o&128);let u=0;if(!i)u=o;else{const s=o&127;if(!s)throw new r("tlv.decode(long): indefinite length not supported");if(s>4)throw new r("tlv.decode(long): byte length is too big");const f=t.subarray(n,n+s);if(f.length!==s)throw new r("tlv.decode: length bytes not complete");if(f[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const c of f)u=u<<8|c;if(n+=s,u<128)throw new r("tlv.decode(long): not minimal encoding")}const a=t.subarray(n,n+u);if(a.length!==u)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+u)}}},_int:{encode(e){const{Err:t}=DER;if(e<_0n$4)throw new t("integer: negative integers are not allowed");let r=numberToHexUnpadded(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){const{Err:t}=DER;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bytesToNumberBE(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=DER,o=ensureBytes("signature",e),{v:i,l:u}=n.decode(48,o);if(u.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:s}=n.decode(2,i),{v:f,l:c}=n.decode(2,s);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(f)}},hexFromSig(e){const{_tlv:t,_int:r}=DER,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),i=n+o;return t.encode(48,i)}};function numToSizedHex(e,t){return bytesToHex$2(numberToBytesBE(e,t))}const _0n$4=BigInt(0),_1n$5=BigInt(1);BigInt(2);const _3n=BigInt(3),_4n=BigInt(4);function weierstrassPoints(e){const t=validatePointOpts(e),{Fp:r}=t,n=Field(t.n,t.nBitLength),o=t.toBytes||((B,ae,W)=>{const J=ae.toAffine();return concatBytes$1(Uint8Array.from([4]),r.toBytes(J.x),r.toBytes(J.y))}),i=t.fromBytes||(B=>{const ae=B.subarray(1),W=r.fromBytes(ae.subarray(0,r.BYTES)),J=r.fromBytes(ae.subarray(r.BYTES,2*r.BYTES));return{x:W,y:J}});function u(B){const{a:ae,b:W}=t,J=r.sqr(B),ve=r.mul(J,B);return r.add(r.add(ve,r.mul(B,ae)),W)}function a(B,ae){const W=r.sqr(ae),J=u(B);return r.eql(W,J)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const s=r.mul(r.pow(t.a,_3n),_4n),f=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(s,f)))throw new Error("bad curve params: a or b");function c(B){return inRange(B,_1n$5,t.n)}function d(B){const{allowedPrivateKeyLengths:ae,nByteLength:W,wrapPrivateKey:J,n:ve}=t;if(ae&&typeof B!="bigint"){if(isBytes$2(B)&&(B=bytesToHex$2(B)),typeof B!="string"||!ae.includes(B.length))throw new Error("invalid private key");B=B.padStart(W*2,"0")}let Qe;try{Qe=typeof B=="bigint"?B:bytesToNumberBE(ensureBytes("private key",B,W))}catch{throw new Error("invalid private key, expected hex or "+W+" bytes, got "+typeof B)}return J&&(Qe=mod(Qe,ve)),aInRange("private key",Qe,_1n$5,ve),Qe}function p(B){if(!(B instanceof b))throw new Error("ProjectivePoint expected")}const h=memoized((B,ae)=>{const{px:W,py:J,pz:ve}=B;if(r.eql(ve,r.ONE))return{x:W,y:J};const Qe=B.is0();ae==null&&(ae=Qe?r.ONE:r.inv(ve));const kt=r.mul(W,ae),nr=r.mul(J,ae),sr=r.mul(ve,ae);if(Qe)return{x:r.ZERO,y:r.ZERO};if(!r.eql(sr,r.ONE))throw new Error("invZ was invalid");return{x:kt,y:nr}}),y=memoized(B=>{if(B.is0()){if(t.allowInfinityPoint&&!r.is0(B.py))return;throw new Error("bad point: ZERO")}const{x:ae,y:W}=B.toAffine();if(!r.isValid(ae)||!r.isValid(W))throw new Error("bad point: x or y not FE");if(!a(ae,W))throw new Error("bad point: equation left != right");if(!B.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class b{constructor(ae,W,J){if(ae==null||!r.isValid(ae))throw new Error("x required");if(W==null||!r.isValid(W)||r.is0(W))throw new Error("y required");if(J==null||!r.isValid(J))throw new Error("z required");this.px=ae,this.py=W,this.pz=J,Object.freeze(this)}static fromAffine(ae){const{x:W,y:J}=ae||{};if(!ae||!r.isValid(W)||!r.isValid(J))throw new Error("invalid affine point");if(ae instanceof b)throw new Error("projective point not allowed");const ve=Qe=>r.eql(Qe,r.ZERO);return ve(W)&&ve(J)?b.ZERO:new b(W,J,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ae){const W=FpInvertBatch(r,ae.map(J=>J.pz));return ae.map((J,ve)=>J.toAffine(W[ve])).map(b.fromAffine)}static fromHex(ae){const W=b.fromAffine(i(ensureBytes("pointHex",ae)));return W.assertValidity(),W}static fromPrivateKey(ae){return b.BASE.multiply(d(ae))}static msm(ae,W){return pippenger(b,n,ae,W)}_setWindowSize(ae){E.setWindowSize(this,ae)}assertValidity(){y(this)}hasEvenY(){const{y:ae}=this.toAffine();if(r.isOdd)return!r.isOdd(ae);throw new Error("Field doesn't support isOdd")}equals(ae){p(ae);const{px:W,py:J,pz:ve}=this,{px:Qe,py:kt,pz:nr}=ae,sr=r.eql(r.mul(W,nr),r.mul(Qe,ve)),ce=r.eql(r.mul(J,nr),r.mul(kt,ve));return sr&&ce}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:ae,b:W}=t,J=r.mul(W,_3n),{px:ve,py:Qe,pz:kt}=this;let nr=r.ZERO,sr=r.ZERO,ce=r.ZERO,Ze=r.mul(ve,ve),se=r.mul(Qe,Qe),vt=r.mul(kt,kt),ur=r.mul(ve,Qe);return ur=r.add(ur,ur),ce=r.mul(ve,kt),ce=r.add(ce,ce),nr=r.mul(ae,ce),sr=r.mul(J,vt),sr=r.add(nr,sr),nr=r.sub(se,sr),sr=r.add(se,sr),sr=r.mul(nr,sr),nr=r.mul(ur,nr),ce=r.mul(J,ce),vt=r.mul(ae,vt),ur=r.sub(Ze,vt),ur=r.mul(ae,ur),ur=r.add(ur,ce),ce=r.add(Ze,Ze),Ze=r.add(ce,Ze),Ze=r.add(Ze,vt),Ze=r.mul(Ze,ur),sr=r.add(sr,Ze),vt=r.mul(Qe,kt),vt=r.add(vt,vt),Ze=r.mul(vt,ur),nr=r.sub(nr,Ze),ce=r.mul(vt,se),ce=r.add(ce,ce),ce=r.add(ce,ce),new b(nr,sr,ce)}add(ae){p(ae);const{px:W,py:J,pz:ve}=this,{px:Qe,py:kt,pz:nr}=ae;let sr=r.ZERO,ce=r.ZERO,Ze=r.ZERO;const se=t.a,vt=r.mul(t.b,_3n);let ur=r.mul(W,Qe),ue=r.mul(J,kt),bt=r.mul(ve,nr),L=r.add(W,J),_=r.add(Qe,kt);L=r.mul(L,_),_=r.add(ur,ue),L=r.sub(L,_),_=r.add(W,ve);let F=r.add(Qe,nr);return _=r.mul(_,F),F=r.add(ur,bt),_=r.sub(_,F),F=r.add(J,ve),sr=r.add(kt,nr),F=r.mul(F,sr),sr=r.add(ue,bt),F=r.sub(F,sr),Ze=r.mul(se,_),sr=r.mul(vt,bt),Ze=r.add(sr,Ze),sr=r.sub(ue,Ze),Ze=r.add(ue,Ze),ce=r.mul(sr,Ze),ue=r.add(ur,ur),ue=r.add(ue,ur),bt=r.mul(se,bt),_=r.mul(vt,_),ue=r.add(ue,bt),bt=r.sub(ur,bt),bt=r.mul(se,bt),_=r.add(_,bt),ur=r.mul(ue,_),ce=r.add(ce,ur),ur=r.mul(F,_),sr=r.mul(L,sr),sr=r.sub(sr,ur),ur=r.mul(L,ue),Ze=r.mul(F,Ze),Ze=r.add(Ze,ur),new b(sr,ce,Ze)}subtract(ae){return this.add(ae.negate())}is0(){return this.equals(b.ZERO)}wNAF(ae){return E.wNAFCached(this,ae,b.normalizeZ)}multiplyUnsafe(ae){const{endo:W,n:J}=t;aInRange("scalar",ae,_0n$4,J);const ve=b.ZERO;if(ae===_0n$4)return ve;if(this.is0()||ae===_1n$5)return this;if(!W||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,ae,b.normalizeZ);let{k1neg:Qe,k1:kt,k2neg:nr,k2:sr}=W.splitScalar(ae),ce=ve,Ze=ve,se=this;for(;kt>_0n$4||sr>_0n$4;)kt&_1n$5&&(ce=ce.add(se)),sr&_1n$5&&(Ze=Ze.add(se)),se=se.double(),kt>>=_1n$5,sr>>=_1n$5;return Qe&&(ce=ce.negate()),nr&&(Ze=Ze.negate()),Ze=new b(r.mul(Ze.px,W.beta),Ze.py,Ze.pz),ce.add(Ze)}multiply(ae){const{endo:W,n:J}=t;aInRange("scalar",ae,_1n$5,J);let ve,Qe;if(W){const{k1neg:kt,k1:nr,k2neg:sr,k2:ce}=W.splitScalar(ae);let{p:Ze,f:se}=this.wNAF(nr),{p:vt,f:ur}=this.wNAF(ce);Ze=E.constTimeNegate(kt,Ze),vt=E.constTimeNegate(sr,vt),vt=new b(r.mul(vt.px,W.beta),vt.py,vt.pz),ve=Ze.add(vt),Qe=se.add(ur)}else{const{p:kt,f:nr}=this.wNAF(ae);ve=kt,Qe=nr}return b.normalizeZ([ve,Qe])[0]}multiplyAndAddUnsafe(ae,W,J){const ve=b.BASE,Qe=(nr,sr)=>sr===_0n$4||sr===_1n$5||!nr.equals(ve)?nr.multiplyUnsafe(sr):nr.multiply(sr),kt=Qe(this,W).add(Qe(ae,J));return kt.is0()?void 0:kt}toAffine(ae){return h(this,ae)}isTorsionFree(){const{h:ae,isTorsionFree:W}=t;if(ae===_1n$5)return!0;if(W)return W(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ae,clearCofactor:W}=t;return ae===_1n$5?this:W?W(b,this):this.multiplyUnsafe(t.h)}toRawBytes(ae=!0){return abool("isCompressed",ae),this.assertValidity(),o(b,this,ae)}toHex(ae=!0){return abool("isCompressed",ae),bytesToHex$2(this.toRawBytes(ae))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const{endo:w,nBitLength:S}=t,E=wNAF(b,w?Math.ceil(S/2):S);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:d,weierstrassEquation:u,isWithinCurveOrder:c}}function validateOpts(e){const t=validateBasic(e);return validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function weierstrass(e){const t=validateOpts(e),{Fp:r,n,nByteLength:o,nBitLength:i}=t,u=r.BYTES+1,a=2*r.BYTES+1;function s(vt){return mod(vt,n)}function f(vt){return invert(vt,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:h}=weierstrassPoints({...t,toBytes(vt,ur,ue){const bt=ur.toAffine(),L=r.toBytes(bt.x),_=concatBytes$1;return abool("isCompressed",ue),ue?_(Uint8Array.from([ur.hasEvenY()?2:3]),L):_(Uint8Array.from([4]),L,r.toBytes(bt.y))},fromBytes(vt){const ur=vt.length,ue=vt[0],bt=vt.subarray(1);if(ur===u&&(ue===2||ue===3)){const L=bytesToNumberBE(bt);if(!inRange(L,_1n$5,r.ORDER))throw new Error("Point is not on curve");const _=p(L);let F;try{F=r.sqrt(_)}catch(rn){const ii=rn instanceof Error?": "+rn.message:"";throw new Error("Point is not on curve"+ii)}const k=(F&_1n$5)===_1n$5;return(ue&1)===1!==k&&(F=r.neg(F)),{x:L,y:F}}else if(ur===a&&ue===4){const L=r.fromBytes(bt.subarray(0,r.BYTES)),_=r.fromBytes(bt.subarray(r.BYTES,2*r.BYTES));return{x:L,y:_}}else{const L=u,_=a;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+_+", got "+ur)}}});function y(vt){const ur=n>>_1n$5;return vt>ur}function b(vt){return y(vt)?s(-vt):vt}const w=(vt,ur,ue)=>bytesToNumberBE(vt.slice(ur,ue));class S{constructor(ur,ue,bt){aInRange("r",ur,_1n$5,n),aInRange("s",ue,_1n$5,n),this.r=ur,this.s=ue,bt!=null&&(this.recovery=bt),Object.freeze(this)}static fromCompact(ur){const ue=o;return ur=ensureBytes("compactSignature",ur,ue*2),new S(w(ur,0,ue),w(ur,ue,2*ue))}static fromDER(ur){const{r:ue,s:bt}=DER.toSig(ensureBytes("DER",ur));return new S(ue,bt)}assertValidity(){}addRecoveryBit(ur){return new S(this.r,this.s,ur)}recoverPublicKey(ur){const{r:ue,s:bt,recovery:L}=this,_=ve(ensureBytes("msgHash",ur));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const F=L===2||L===3?ue+t.n:ue;if(F>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const k=(L&1)===0?"02":"03",Ye=c.fromHex(k+numToSizedHex(F,r.BYTES)),rn=f(F),ii=s(-_*rn),ai=s(bt*rn),ni=c.BASE.multiplyAndAddUnsafe(Ye,ii,ai);if(!ni)throw new Error("point at infinify");return ni.assertValidity(),ni}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig(this)}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){const ur=o;return numToSizedHex(this.r,ur)+numToSizedHex(this.s,ur)}}const E={isValidPrivateKey(vt){try{return d(vt),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const vt=getMinHashLength(t.n);return mapHashToField(t.randomBytes(vt),t.n)},precompute(vt=8,ur=c.BASE){return ur._setWindowSize(vt),ur.multiply(BigInt(3)),ur}};function B(vt,ur=!0){return c.fromPrivateKey(vt).toRawBytes(ur)}function ae(vt){if(typeof vt=="bigint")return!1;if(vt instanceof c)return!0;const ue=ensureBytes("key",vt).length,bt=r.BYTES,L=bt+1,_=2*bt+1;if(!(t.allowedPrivateKeyLengths||o===L))return ue===L||ue===_}function W(vt,ur,ue=!0){if(ae(vt)===!0)throw new Error("first arg must be private key");if(ae(ur)===!1)throw new Error("second arg must be public key");return c.fromHex(ur).multiply(d(vt)).toRawBytes(ue)}const J=t.bits2int||function(vt){if(vt.length>8192)throw new Error("input is too large");const ur=bytesToNumberBE(vt),ue=vt.length*8-i;return ue>0?ur>>BigInt(ue):ur},ve=t.bits2int_modN||function(vt){return s(J(vt))},Qe=bitMask(i);function kt(vt){return aInRange("num < 2^"+i,vt,_0n$4,Qe),numberToBytesBE(vt,o)}function nr(vt,ur,ue=sr){if(["recovered","canonical"].some(ui=>ui in ue))throw new Error("sign() legacy options not supported");const{hash:bt,randomBytes:L}=t;let{lowS:_,prehash:F,extraEntropy:k}=ue;_==null&&(_=!0),vt=ensureBytes("msgHash",vt),validateSigVerOpts(ue),F&&(vt=ensureBytes("prehashed msgHash",bt(vt)));const Ye=ve(vt),rn=d(ur),ii=[kt(rn),kt(Ye)];if(k!=null&&k!==!1){const ui=k===!0?L(r.BYTES):k;ii.push(ensureBytes("extraEntropy",ui))}const ai=concatBytes$1(...ii),ni=Ye;function ri(ui){const lr=J(ui);if(!h(lr))return;const ar=f(lr),jr=c.BASE.multiply(lr).toAffine(),ci=s(jr.x);if(ci===_0n$4)return;const mi=s(ar*s(ni+ci*rn));if(mi===_0n$4)return;let pi=(jr.x===ci?0:2)|Number(jr.y&_1n$5),ei=mi;return _&&y(mi)&&(ei=b(mi),pi^=1),new S(ci,ei,pi)}return{seed:ai,k2sig:ri}}const sr={lowS:t.lowS,prehash:!1},ce={lowS:t.lowS,prehash:!1};function Ze(vt,ur,ue=sr){const{seed:bt,k2sig:L}=nr(vt,ur,ue),_=t;return createHmacDrbg(_.hash.outputLen,_.nByteLength,_.hmac)(bt,L)}c.BASE._setWindowSize(8);function se(vt,ur,ue,bt=ce){const L=vt;ur=ensureBytes("msgHash",ur),ue=ensureBytes("publicKey",ue);const{lowS:_,prehash:F,format:k}=bt;if(validateSigVerOpts(bt),"strict"in bt)throw new Error("options.strict was renamed to lowS");if(k!==void 0&&k!=="compact"&&k!=="der")throw new Error("format must be compact or der");const Ye=typeof L=="string"||isBytes$2(L),rn=!Ye&&!k&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!Ye&&!rn)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ii,ai;try{if(rn&&(ii=new S(L.r,L.s)),Ye){try{k!=="compact"&&(ii=S.fromDER(L))}catch(pi){if(!(pi instanceof DER.Err))throw pi}!ii&&k!=="der"&&(ii=S.fromCompact(L))}ai=c.fromHex(ue)}catch{return!1}if(!ii||_&&ii.hasHighS())return!1;F&&(ur=t.hash(ur));const{r:ni,s:ri}=ii,ui=ve(ur),lr=f(ri),ar=s(ui*lr),jr=s(ni*lr),ci=c.BASE.multiplyAndAddUnsafe(ai,ar,jr)?.toAffine();return ci?s(ci.x)===ni:!1}return{CURVE:t,getPublicKey:B,getSharedSecret:W,sign:Ze,verify:se,ProjectivePoint:c,Signature:S,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(e){return{hash:e,hmac:(t,...r)=>hmac$1(e,t,concatBytes$2(...r)),randomBytes}}function createCurve(e,t){const r=n=>weierstrass({...e,...getHash(n)});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_0n$3=BigInt(0),_1n$4=BigInt(1),_2n$4=BigInt(2),divNearest=(e,t)=>(e+t/_2n$4)/t;function sqrtMod(e){const t=secp256k1P,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),u=BigInt(23),a=BigInt(44),s=BigInt(88),f=e*e*e%t,c=f*f*e%t,d=pow2(c,r,t)*c%t,p=pow2(d,r,t)*c%t,h=pow2(p,_2n$4,t)*f%t,y=pow2(h,o,t)*h%t,b=pow2(y,i,t)*y%t,w=pow2(b,a,t)*b%t,S=pow2(w,s,t)*w%t,E=pow2(S,a,t)*b%t,B=pow2(E,r,t)*c%t,ae=pow2(B,u,t)*y%t,W=pow2(ae,n,t)*f%t,J=pow2(W,_2n$4,t);if(!Fpk1.eql(Fpk1.sqr(J),e))throw new Error("Cannot find square root");return J}const Fpk1=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1$1=createCurve({a:_0n$3,b:BigInt(7),Fp:Fpk1,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=secp256k1N,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-_1n$4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,u=BigInt("0x100000000000000000000000000000000"),a=divNearest(i*e,t),s=divNearest(-n*e,t);let f=mod(e-a*r-s*o,t),c=mod(-a*n-s*i,t);const d=f>u,p=c>u;if(d&&(f=t-f),p&&(c=t-c),f>u||c>u)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:f,k2neg:p,k2:c}}}},sha256$4),secp256k1$2=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:secp256k1$1},Symbol.toStringTag,{value:"Module"}));function serializeSignature({r:e,s:t,to:r="hex",v:n,yParity:o}){const i=(()=>{if(o===0||o===1)return o;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),u=`0x${new secp256k1$1.Signature(hexToBigInt(e),hexToBigInt(t)).toCompactHex()}${i===0?"1b":"1c"}`;return r==="hex"?u:hexToBytes$1(u)}function generatePrivateKey(){return toHex(secp256k1$1.utils.randomPrivateKey())}class InvalidAddressError extends BaseError{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$3=BigInt(2),_7n$1=BigInt(7),_256n$1=BigInt(256),_0x71n$1=BigInt(113),SHA3_PI$1=[],SHA3_ROTL$1=[],_SHA3_IOTA$1=[];for(let e=0,t=_1n$3,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],SHA3_PI$1.push(2*(5*n+r)),SHA3_ROTL$1.push((e+1)*(e+2)/2%64);let o=_0n$2;for(let i=0;i<7;i++)t=(t<<_1n$3^(t>>_7n$1)*_0x71n$1)%_256n$1,t&_2n$3&&(o^=_1n$3<<(_1n$3<<BigInt(i))-_1n$3);_SHA3_IOTA$1.push(o)}const IOTAS=split$1(_SHA3_IOTA$1,!0),SHA3_IOTA_H$1=IOTAS[0],SHA3_IOTA_L$1=IOTAS[1],rotlH$1=(e,t,r)=>r>32?rotlBH$1(e,t,r):rotlSH$1(e,t,r),rotlL$1=(e,t,r)=>r>32?rotlBL$1(e,t,r):rotlSL$1(e,t,r);function keccakP$1(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let u=0;u<10;u++)r[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){const a=(u+8)%10,s=(u+2)%10,f=r[s],c=r[s+1],d=rotlH$1(f,c,1)^r[a],p=rotlL$1(f,c,1)^r[a+1];for(let h=0;h<50;h+=10)e[u+h]^=d,e[u+h+1]^=p}let o=e[2],i=e[3];for(let u=0;u<24;u++){const a=SHA3_ROTL$1[u],s=rotlH$1(o,i,a),f=rotlL$1(o,i,a),c=SHA3_PI$1[u];o=e[c],i=e[c+1],e[c]=s,e[c+1]=f}for(let u=0;u<50;u+=10){for(let a=0;a<10;a++)r[a]=e[u+a];for(let a=0;a<10;a++)e[u+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=SHA3_IOTA_H$1[n],e[1]^=SHA3_IOTA_L$1[n]}clean(r)}let Keccak$1=class P8 extends Hash$2{constructor(t,r,n,o=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,anumber$1(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=u32$2(this.state)}clone(){return this._cloneInto()}keccak(){swap32IfBE(this.state32),keccakP$1(this.state32,this.rounds),swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){aexists(this),t=toBytes$2(t),abytes$1(t);const{blockLen:r,state:n}=this,o=t.length;for(let i=0;i<o;){const u=Math.min(r-this.pos,o-i);for(let a=0;a<u;a++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){aexists(this,!1),abytes$1(t),this.finish();const r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const u=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+u),o),this.posOut+=u,o+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return anumber$1(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,clean(this.state)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:u}=this;return t||(t=new P8(r,n,o,u,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=u,t.destroyed=this.destroyed,t}};const gen$1=(e,t,r)=>createHasher(()=>new Keccak$1(t,e,r)),keccak_256$3=gen$1(1,136,256/8),keccak_512=gen$1(1,72,512/8);function keccak256$2(e,t){const r=t||"hex",n=keccak_256$3(isHex$1(e,{strict:!1})?toBytes$1(e):e);return r==="bytes"?n:toHex(n)}const checksumAddressCache=new LruMap(8192);function checksumAddress(e,t){if(checksumAddressCache.has(`${e}.${t}`))return checksumAddressCache.get(`${e}.${t}`);const r=e.substring(2).toLowerCase(),n=keccak256$2(stringToBytes(r),"bytes"),o=r.split("");for(let u=0;u<40;u+=2)n[u>>1]>>4>=8&&o[u]&&(o[u]=o[u].toUpperCase()),(n[u>>1]&15)>=8&&o[u+1]&&(o[u+1]=o[u+1].toUpperCase());const i=`0x${o.join("")}`;return checksumAddressCache.set(`${e}.${t}`,i),i}function getAddress(e,t){if(!isAddress$1(e,{strict:!1}))throw new InvalidAddressError({address:e});return checksumAddress(e,t)}const addressRegex=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap(8192);function isAddress$1(e,t){const{strict:r=!0}=t??{},n=`${e}.${r}`;if(isAddressCache.has(n))return isAddressCache.get(n);const o=addressRegex.test(e)?e.toLowerCase()===e?!0:r?checksumAddress(e)===e:!0:!1;return isAddressCache.set(n,o),o}function toAccount(e){if(typeof e=="string"){if(!isAddress$1(e,{strict:!1}))throw new InvalidAddressError({address:e});return{address:e,type:"json-rpc"}}if(!isAddress$1(e.address,{strict:!1}))throw new InvalidAddressError({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}function publicKeyToAddress(e){const t=keccak256$2(`0x${e.substring(4)}`).substring(26);return checksumAddress(`0x${t}`)}let extraEntropy=!1;async function sign$3({hash:e,privateKey:t,to:r="object"}){const{r:n,s:o,recovery:i}=secp256k1$1.sign(e.slice(2),t.slice(2),{lowS:!0,extraEntropy:isHex$1(extraEntropy,{strict:!1})?hexToBytes$1(extraEntropy):extraEntropy}),u={r:numberToHex$1(n,{size:32}),s:numberToHex$1(o,{size:32}),v:i?28n:27n,yParity:i};return r==="bytes"||r==="hex"?serializeSignature({...u,to:r}):u}function concat(e){return typeof e[0]=="string"?concatHex(e):concatBytes(e)}function concatBytes(e){let t=0;for(const o of e)t+=o.length;const r=new Uint8Array(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return r}function concatHex(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}class NegativeOffsetError extends BaseError{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const staticCursor={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new NegativeOffsetError({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new NegativeOffsetError({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function createCursor(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(staticCursor);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}function toRlp(e,t="hex"){const r=getEncodable(e),n=createCursor(new Uint8Array(r.length));return r.encode(n),t==="hex"?bytesToHex$3(n.bytes):n.bytes}function getEncodable(e){return Array.isArray(e)?getEncodableList(e.map(t=>getEncodable(t))):getEncodableBytes(e)}function getEncodableList(e){const t=e.reduce((o,i)=>o+i.length,0),r=getSizeOfLength(t);return{length:t<=55?1+t:1+r+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+r),r===1?o.pushUint8(t):r===2?o.pushUint16(t):r===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:i}of e)i(o)}}}function getEncodableBytes(e){const t=typeof e=="string"?hexToBytes$1(e):e,r=getSizeOfLength(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+r),r===1?o.pushUint8(t.length):r===2?o.pushUint16(t.length):r===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function getSizeOfLength(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new BaseError("Length is too large.")}function hashAuthorization(e){const{chainId:t,nonce:r,to:n}=e,o=e.contractAddress??e.address,i=keccak256$2(concatHex(["0x05",toRlp([t?numberToHex$1(t):"0x",o,r?numberToHex$1(r):"0x"])]));return n==="bytes"?hexToBytes$1(i):i}async function signAuthorization$1(e){const{chainId:t,nonce:r,privateKey:n,to:o="object"}=e,i=e.contractAddress??e.address,u=await sign$3({hash:hashAuthorization({address:i,chainId:t,nonce:r}),privateKey:n,to:o});return o==="object"?{address:i,chainId:t,nonce:r,...u}:u}const presignMessagePrefix=`Ethereum Signed Message:
38
+ `).replace(u4,"")}function e8(l,m){return m=Jv(m),Jv(l)===m}function Ts(l,m,ie,ir,oi,li){switch(ie){case"children":typeof ir=="string"?m==="body"||m==="textarea"&&ir===""||ys(l,ir):(typeof ir=="number"||typeof ir=="bigint")&&m!=="body"&&ys(l,""+ir);break;case"className":vo(l,"class",ir);break;case"tabIndex":vo(l,"tabindex",ir);break;case"dir":case"role":case"viewBox":case"width":case"height":vo(l,ie,ir);break;case"style":rs(l,ir,li);break;case"data":if(m!=="object"){vo(l,"data",ir);break}case"src":case"href":if(ir===""&&(m!=="a"||ie!=="href")){l.removeAttribute(ie);break}if(ir==null||typeof ir=="function"||typeof ir=="symbol"||typeof ir=="boolean"){l.removeAttribute(ie);break}ir=Z0(""+ir),l.setAttribute(ie,ir);break;case"action":case"formAction":if(typeof ir=="function"){l.setAttribute(ie,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof li=="function"&&(ie==="formAction"?(m!=="input"&&Ts(l,m,"name",oi.name,oi,null),Ts(l,m,"formEncType",oi.formEncType,oi,null),Ts(l,m,"formMethod",oi.formMethod,oi,null),Ts(l,m,"formTarget",oi.formTarget,oi,null)):(Ts(l,m,"encType",oi.encType,oi,null),Ts(l,m,"method",oi.method,oi,null),Ts(l,m,"target",oi.target,oi,null)));if(ir==null||typeof ir=="symbol"||typeof ir=="boolean"){l.removeAttribute(ie);break}ir=Z0(""+ir),l.setAttribute(ie,ir);break;case"onClick":ir!=null&&(l.onclick=mu);break;case"onScroll":ir!=null&&ts("scroll",l);break;case"onScrollEnd":ir!=null&&ts("scrollend",l);break;case"dangerouslySetInnerHTML":if(ir!=null){if(typeof ir!="object"||!("__html"in ir))throw Error(n(61));if(ie=ir.__html,ie!=null){if(oi.children!=null)throw Error(n(60));l.innerHTML=ie}}break;case"multiple":l.multiple=ir&&typeof ir!="function"&&typeof ir!="symbol";break;case"muted":l.muted=ir&&typeof ir!="function"&&typeof ir!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(ir==null||typeof ir=="function"||typeof ir=="boolean"||typeof ir=="symbol"){l.removeAttribute("xlink:href");break}ie=Z0(""+ir),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ie);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":ir!=null&&typeof ir!="function"&&typeof ir!="symbol"?l.setAttribute(ie,""+ir):l.removeAttribute(ie);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":ir&&typeof ir!="function"&&typeof ir!="symbol"?l.setAttribute(ie,""):l.removeAttribute(ie);break;case"capture":case"download":ir===!0?l.setAttribute(ie,""):ir!==!1&&ir!=null&&typeof ir!="function"&&typeof ir!="symbol"?l.setAttribute(ie,ir):l.removeAttribute(ie);break;case"cols":case"rows":case"size":case"span":ir!=null&&typeof ir!="function"&&typeof ir!="symbol"&&!isNaN(ir)&&1<=ir?l.setAttribute(ie,ir):l.removeAttribute(ie);break;case"rowSpan":case"start":ir==null||typeof ir=="function"||typeof ir=="symbol"||isNaN(ir)?l.removeAttribute(ie):l.setAttribute(ie,ir);break;case"popover":ts("beforetoggle",l),ts("toggle",l),No(l,"popover",ir);break;case"xlinkActuate":bo(l,"http://www.w3.org/1999/xlink","xlink:actuate",ir);break;case"xlinkArcrole":bo(l,"http://www.w3.org/1999/xlink","xlink:arcrole",ir);break;case"xlinkRole":bo(l,"http://www.w3.org/1999/xlink","xlink:role",ir);break;case"xlinkShow":bo(l,"http://www.w3.org/1999/xlink","xlink:show",ir);break;case"xlinkTitle":bo(l,"http://www.w3.org/1999/xlink","xlink:title",ir);break;case"xlinkType":bo(l,"http://www.w3.org/1999/xlink","xlink:type",ir);break;case"xmlBase":bo(l,"http://www.w3.org/XML/1998/namespace","xml:base",ir);break;case"xmlLang":bo(l,"http://www.w3.org/XML/1998/namespace","xml:lang",ir);break;case"xmlSpace":bo(l,"http://www.w3.org/XML/1998/namespace","xml:space",ir);break;case"is":No(l,"is",ir);break;case"innerText":case"textContent":break;default:(!(2<ie.length)||ie[0]!=="o"&&ie[0]!=="O"||ie[1]!=="n"&&ie[1]!=="N")&&(ie=vs.get(ie)||ie,No(l,ie,ir))}}function ov(l,m,ie,ir,oi,li){switch(ie){case"style":rs(l,ir,li);break;case"dangerouslySetInnerHTML":if(ir!=null){if(typeof ir!="object"||!("__html"in ir))throw Error(n(61));if(ie=ir.__html,ie!=null){if(oi.children!=null)throw Error(n(60));l.innerHTML=ie}}break;case"children":typeof ir=="string"?ys(l,ir):(typeof ir=="number"||typeof ir=="bigint")&&ys(l,""+ir);break;case"onScroll":ir!=null&&ts("scroll",l);break;case"onScrollEnd":ir!=null&&ts("scrollend",l);break;case"onClick":ir!=null&&(l.onclick=mu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ha.hasOwnProperty(ie))e:{if(ie[0]==="o"&&ie[1]==="n"&&(oi=ie.endsWith("Capture"),m=ie.slice(2,oi?ie.length-7:void 0),li=l[io]||null,li=li!=null?li[ie]:null,typeof li=="function"&&l.removeEventListener(m,li,oi),typeof ir=="function")){typeof li!="function"&&li!==null&&(ie in l?l[ie]=null:l.hasAttribute(ie)&&l.removeAttribute(ie)),l.addEventListener(m,ir,oi);break e}ie in l?l[ie]=ir:ir===!0?l.setAttribute(ie,""):No(l,ie,ir)}}}function Uu(l,m,ie){switch(m){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ts("error",l),ts("load",l);var ir=!1,oi=!1,li;for(li in ie)if(ie.hasOwnProperty(li)){var Ti=ie[li];if(Ti!=null)switch(li){case"src":ir=!0;break;case"srcSet":oi=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,m));default:Ts(l,m,li,Ti,ie,null)}}oi&&Ts(l,m,"srcSet",ie.srcSet,ie,null),ir&&Ts(l,m,"src",ie.src,ie,null);return;case"input":ts("invalid",l);var Ki=li=Ti=oi=null,to=null,go=null;for(ir in ie)if(ie.hasOwnProperty(ir)){var ko=ie[ir];if(ko!=null)switch(ir){case"name":oi=ko;break;case"type":Ti=ko;break;case"checked":to=ko;break;case"defaultChecked":go=ko;break;case"value":li=ko;break;case"defaultValue":Ki=ko;break;case"children":case"dangerouslySetInnerHTML":if(ko!=null)throw Error(n(137,m));break;default:Ts(l,m,ir,ko,ie,null)}}za(l,li,Ki,to,go,Ti,oi,!1);return;case"select":ts("invalid",l),ir=Ti=li=null;for(oi in ie)if(ie.hasOwnProperty(oi)&&(Ki=ie[oi],Ki!=null))switch(oi){case"value":li=Ki;break;case"defaultValue":Ti=Ki;break;case"multiple":ir=Ki;default:Ts(l,m,oi,Ki,ie,null)}m=li,ie=Ti,l.multiple=!!ir,m!=null?Wa(l,!!ir,m,!1):ie!=null&&Wa(l,!!ir,ie,!0);return;case"textarea":ts("invalid",l),li=oi=ir=null;for(Ti in ie)if(ie.hasOwnProperty(Ti)&&(Ki=ie[Ti],Ki!=null))switch(Ti){case"value":ir=Ki;break;case"defaultValue":oi=Ki;break;case"children":li=Ki;break;case"dangerouslySetInnerHTML":if(Ki!=null)throw Error(n(91));break;default:Ts(l,m,Ti,Ki,ie,null)}ss(l,ir,oi,li);return;case"option":for(to in ie)if(ie.hasOwnProperty(to)&&(ir=ie[to],ir!=null))switch(to){case"selected":l.selected=ir&&typeof ir!="function"&&typeof ir!="symbol";break;default:Ts(l,m,to,ir,ie,null)}return;case"dialog":ts("beforetoggle",l),ts("toggle",l),ts("cancel",l),ts("close",l);break;case"iframe":case"object":ts("load",l);break;case"video":case"audio":for(ir=0;ir<qb.length;ir++)ts(qb[ir],l);break;case"image":ts("error",l),ts("load",l);break;case"details":ts("toggle",l);break;case"embed":case"source":case"link":ts("error",l),ts("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(go in ie)if(ie.hasOwnProperty(go)&&(ir=ie[go],ir!=null))switch(go){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,m));default:Ts(l,m,go,ir,ie,null)}return;default:if(Zs(m)){for(ko in ie)ie.hasOwnProperty(ko)&&(ir=ie[ko],ir!==void 0&&ov(l,m,ko,ir,ie,void 0));return}}for(Ki in ie)ie.hasOwnProperty(Ki)&&(ir=ie[Ki],ir!=null&&Ts(l,m,Ki,ir,ie,null))}function f4(l,m,ie,ir){switch(m){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var oi=null,li=null,Ti=null,Ki=null,to=null,go=null,ko=null;for(Bo in ie){var Vo=ie[Bo];if(ie.hasOwnProperty(Bo)&&Vo!=null)switch(Bo){case"checked":break;case"value":break;case"defaultValue":to=Vo;default:ir.hasOwnProperty(Bo)||Ts(l,m,Bo,null,ir,Vo)}}for(var So in ir){var Bo=ir[So];if(Vo=ie[So],ir.hasOwnProperty(So)&&(Bo!=null||Vo!=null))switch(So){case"type":li=Bo;break;case"name":oi=Bo;break;case"checked":go=Bo;break;case"defaultChecked":ko=Bo;break;case"value":Ti=Bo;break;case"defaultValue":Ki=Bo;break;case"children":case"dangerouslySetInnerHTML":if(Bo!=null)throw Error(n(137,m));break;default:Bo!==Vo&&Ts(l,m,So,Bo,ir,Vo)}}Qa(l,Ti,Ki,to,go,ko,li,oi);return;case"select":Bo=Ti=Ki=So=null;for(li in ie)if(to=ie[li],ie.hasOwnProperty(li)&&to!=null)switch(li){case"value":break;case"multiple":Bo=to;default:ir.hasOwnProperty(li)||Ts(l,m,li,null,ir,to)}for(oi in ir)if(li=ir[oi],to=ie[oi],ir.hasOwnProperty(oi)&&(li!=null||to!=null))switch(oi){case"value":So=li;break;case"defaultValue":Ki=li;break;case"multiple":Ti=li;default:li!==to&&Ts(l,m,oi,li,ir,to)}m=Ki,ie=Ti,ir=Bo,So!=null?Wa(l,!!ie,So,!1):!!ir!=!!ie&&(m!=null?Wa(l,!!ie,m,!0):Wa(l,!!ie,ie?[]:"",!1));return;case"textarea":Bo=So=null;for(Ki in ie)if(oi=ie[Ki],ie.hasOwnProperty(Ki)&&oi!=null&&!ir.hasOwnProperty(Ki))switch(Ki){case"value":break;case"children":break;default:Ts(l,m,Ki,null,ir,oi)}for(Ti in ir)if(oi=ir[Ti],li=ie[Ti],ir.hasOwnProperty(Ti)&&(oi!=null||li!=null))switch(Ti){case"value":So=oi;break;case"defaultValue":Bo=oi;break;case"children":break;case"dangerouslySetInnerHTML":if(oi!=null)throw Error(n(91));break;default:oi!==li&&Ts(l,m,Ti,oi,ir,li)}Ms(l,So,Bo);return;case"option":for(var Ia in ie)if(So=ie[Ia],ie.hasOwnProperty(Ia)&&So!=null&&!ir.hasOwnProperty(Ia))switch(Ia){case"selected":l.selected=!1;break;default:Ts(l,m,Ia,null,ir,So)}for(to in ir)if(So=ir[to],Bo=ie[to],ir.hasOwnProperty(to)&&So!==Bo&&(So!=null||Bo!=null))switch(to){case"selected":l.selected=So&&typeof So!="function"&&typeof So!="symbol";break;default:Ts(l,m,to,So,ir,Bo)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Da in ie)So=ie[Da],ie.hasOwnProperty(Da)&&So!=null&&!ir.hasOwnProperty(Da)&&Ts(l,m,Da,null,ir,So);for(go in ir)if(So=ir[go],Bo=ie[go],ir.hasOwnProperty(go)&&So!==Bo&&(So!=null||Bo!=null))switch(go){case"children":case"dangerouslySetInnerHTML":if(So!=null)throw Error(n(137,m));break;default:Ts(l,m,go,So,ir,Bo)}return;default:if(Zs(m)){for(var Rs in ie)So=ie[Rs],ie.hasOwnProperty(Rs)&&So!==void 0&&!ir.hasOwnProperty(Rs)&&ov(l,m,Rs,void 0,ir,So);for(ko in ir)So=ir[ko],Bo=ie[ko],!ir.hasOwnProperty(ko)||So===Bo||So===void 0&&Bo===void 0||ov(l,m,ko,So,ir,Bo);return}}for(var fo in ie)So=ie[fo],ie.hasOwnProperty(fo)&&So!=null&&!ir.hasOwnProperty(fo)&&Ts(l,m,fo,null,ir,So);for(Vo in ir)So=ir[Vo],Bo=ie[Vo],!ir.hasOwnProperty(Vo)||So===Bo||So==null&&Bo==null||Ts(l,m,Vo,So,ir,Bo)}function t8(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c4(){if(typeof performance.getEntriesByType=="function"){for(var l=0,m=0,ie=performance.getEntriesByType("resource"),ir=0;ir<ie.length;ir++){var oi=ie[ir],li=oi.transferSize,Ti=oi.initiatorType,Ki=oi.duration;if(li&&Ki&&t8(Ti)){for(Ti=0,Ki=oi.responseEnd,ir+=1;ir<ie.length;ir++){var to=ie[ir],go=to.startTime;if(go>Ki)break;var ko=to.transferSize,Vo=to.initiatorType;ko&&t8(Vo)&&(to=to.responseEnd,Ti+=ko*(to<Ki?1:(Ki-go)/(to-go)))}if(--ir,m+=8*(li+Ti)/(oi.duration/1e3),l++,10<l)break}}if(0<l)return m/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var av=null,sv=null;function d6(l){return l.nodeType===9?l:l.ownerDocument}function r8(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function n8(l,m){if(l===0)switch(m){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&m==="foreignObject"?0:l}function uv(l,m){return l==="textarea"||l==="noscript"||typeof m.children=="string"||typeof m.children=="number"||typeof m.children=="bigint"||typeof m.dangerouslySetInnerHTML=="object"&&m.dangerouslySetInnerHTML!==null&&m.dangerouslySetInnerHTML.__html!=null}var fv=null;function l4(){var l=window.event;return l&&l.type==="popstate"?l===fv?!1:(fv=l,!0):(fv=null,!1)}var i8=typeof setTimeout=="function"?setTimeout:void 0,d4=typeof clearTimeout=="function"?clearTimeout:void 0,o8=typeof Promise=="function"?Promise:void 0,h4=typeof queueMicrotask=="function"?queueMicrotask:typeof o8<"u"?function(l){return o8.resolve(null).then(l).catch(p4)}:i8;function p4(l){setTimeout(function(){throw l})}function N0(l){return l==="head"}function a8(l,m){var ie=m,ir=0;do{var oi=ie.nextSibling;if(l.removeChild(ie),oi&&oi.nodeType===8)if(ie=oi.data,ie==="/$"||ie==="/&"){if(ir===0){l.removeChild(oi),Sm(m);return}ir--}else if(ie==="$"||ie==="$?"||ie==="$~"||ie==="$!"||ie==="&")ir++;else if(ie==="html")Hb(l.ownerDocument.documentElement);else if(ie==="head"){ie=l.ownerDocument.head,Hb(ie);for(var li=ie.firstChild;li;){var Ti=li.nextSibling,Ki=li.nodeName;li[$o]||Ki==="SCRIPT"||Ki==="STYLE"||Ki==="LINK"&&li.rel.toLowerCase()==="stylesheet"||ie.removeChild(li),li=Ti}}else ie==="body"&&Hb(l.ownerDocument.body);ie=oi}while(ie);Sm(m)}function s8(l,m){var ie=l;l=0;do{var ir=ie.nextSibling;if(ie.nodeType===1?m?(ie._stashedDisplay=ie.style.display,ie.style.display="none"):(ie.style.display=ie._stashedDisplay||"",ie.getAttribute("style")===""&&ie.removeAttribute("style")):ie.nodeType===3&&(m?(ie._stashedText=ie.nodeValue,ie.nodeValue=""):ie.nodeValue=ie._stashedText||""),ir&&ir.nodeType===8)if(ie=ir.data,ie==="/$"){if(l===0)break;l--}else ie!=="$"&&ie!=="$?"&&ie!=="$~"&&ie!=="$!"||l++;ie=ir}while(ie)}function cv(l){var m=l.firstChild;for(m&&m.nodeType===10&&(m=m.nextSibling);m;){var ie=m;switch(m=m.nextSibling,ie.nodeName){case"HTML":case"HEAD":case"BODY":cv(ie),ta(ie);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(ie.rel.toLowerCase()==="stylesheet")continue}l.removeChild(ie)}}function y4(l,m,ie,ir){for(;l.nodeType===1;){var oi=ie;if(l.nodeName.toLowerCase()!==m.toLowerCase()){if(!ir&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(ir){if(!l[$o])switch(m){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(li=l.getAttribute("rel"),li==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(li!==oi.rel||l.getAttribute("href")!==(oi.href==null||oi.href===""?null:oi.href)||l.getAttribute("crossorigin")!==(oi.crossOrigin==null?null:oi.crossOrigin)||l.getAttribute("title")!==(oi.title==null?null:oi.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(li=l.getAttribute("src"),(li!==(oi.src==null?null:oi.src)||l.getAttribute("type")!==(oi.type==null?null:oi.type)||l.getAttribute("crossorigin")!==(oi.crossOrigin==null?null:oi.crossOrigin))&&li&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(m==="input"&&l.type==="hidden"){var li=oi.name==null?null:""+oi.name;if(oi.type==="hidden"&&l.getAttribute("name")===li)return l}else return l;if(l=sd(l.nextSibling),l===null)break}return null}function m4(l,m,ie){if(m==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!ie||(l=sd(l.nextSibling),l===null))return null;return l}function f8(l,m){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!m||(l=sd(l.nextSibling),l===null))return null;return l}function lv(l){return l.data==="$?"||l.data==="$~"}function dv(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function g4(l,m){var ie=l.ownerDocument;if(l.data==="$~")l._reactRetry=m;else if(l.data!=="$?"||ie.readyState!=="loading")m();else{var ir=function(){m(),ie.removeEventListener("DOMContentLoaded",ir)};ie.addEventListener("DOMContentLoaded",ir),l._reactRetry=ir}}function sd(l){for(;l!=null;l=l.nextSibling){var m=l.nodeType;if(m===1||m===3)break;if(m===8){if(m=l.data,m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"||m==="F!"||m==="F")break;if(m==="/$"||m==="/&")return null}}return l}var hv=null;function c8(l){l=l.nextSibling;for(var m=0;l;){if(l.nodeType===8){var ie=l.data;if(ie==="/$"||ie==="/&"){if(m===0)return sd(l.nextSibling);m--}else ie!=="$"&&ie!=="$!"&&ie!=="$?"&&ie!=="$~"&&ie!=="&"||m++}l=l.nextSibling}return null}function l8(l){l=l.previousSibling;for(var m=0;l;){if(l.nodeType===8){var ie=l.data;if(ie==="$"||ie==="$!"||ie==="$?"||ie==="$~"||ie==="&"){if(m===0)return l;m--}else ie!=="/$"&&ie!=="/&"||m++}l=l.previousSibling}return null}function d8(l,m,ie){switch(m=d6(ie),l){case"html":if(l=m.documentElement,!l)throw Error(n(452));return l;case"head":if(l=m.head,!l)throw Error(n(453));return l;case"body":if(l=m.body,!l)throw Error(n(454));return l;default:throw Error(n(451))}}function Hb(l){for(var m=l.attributes;m.length;)l.removeAttributeNode(m[0]);ta(l)}var ud=new Map,h8=new Set;function h6(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var xh=ue.d;ue.d={f:b4,r:v4,D:w4,C:x4,L:E4,m:A4,X:I4,S:S4,M:_4};function b4(){var l=xh.f(),m=i6();return l||m}function v4(l){var m=ga(l);m!==null&&m.tag===5&&m.type==="form"?q3(m):xh.r(l)}var xm=typeof document>"u"?null:document;function p8(l,m,ie){var ir=xm;if(ir&&typeof m=="string"&&m){var oi=ka(m);oi='link[rel="'+l+'"][href="'+oi+'"]',typeof ie=="string"&&(oi+='[crossorigin="'+ie+'"]'),h8.has(oi)||(h8.add(oi),l={rel:l,crossOrigin:ie,href:m},ir.querySelector(oi)===null&&(m=ir.createElement("link"),Uu(m,"link",l),fa(m),ir.head.appendChild(m)))}}function w4(l){xh.D(l),p8("dns-prefetch",l,null)}function x4(l,m){xh.C(l,m),p8("preconnect",l,m)}function E4(l,m,ie){xh.L(l,m,ie);var ir=xm;if(ir&&l&&m){var oi='link[rel="preload"][as="'+ka(m)+'"]';m==="image"&&ie&&ie.imageSrcSet?(oi+='[imagesrcset="'+ka(ie.imageSrcSet)+'"]',typeof ie.imageSizes=="string"&&(oi+='[imagesizes="'+ka(ie.imageSizes)+'"]')):oi+='[href="'+ka(l)+'"]';var li=oi;switch(m){case"style":li=Em(l);break;case"script":li=Am(l)}ud.has(li)||(l=d({rel:"preload",href:m==="image"&&ie&&ie.imageSrcSet?void 0:l,as:m},ie),ud.set(li,l),ir.querySelector(oi)!==null||m==="style"&&ir.querySelector(Vb(li))||m==="script"&&ir.querySelector(Kb(li))||(m=ir.createElement("link"),Uu(m,"link",l),fa(m),ir.head.appendChild(m)))}}function A4(l,m){xh.m(l,m);var ie=xm;if(ie&&l){var ir=m&&typeof m.as=="string"?m.as:"script",oi='link[rel="modulepreload"][as="'+ka(ir)+'"][href="'+ka(l)+'"]',li=oi;switch(ir){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":li=Am(l)}if(!ud.has(li)&&(l=d({rel:"modulepreload",href:l},m),ud.set(li,l),ie.querySelector(oi)===null)){switch(ir){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(ie.querySelector(Kb(li)))return}ir=ie.createElement("link"),Uu(ir,"link",l),fa(ir),ie.head.appendChild(ir)}}}function S4(l,m,ie){xh.S(l,m,ie);var ir=xm;if(ir&&l){var oi=ma(ir).hoistableStyles,li=Em(l);m=m||"default";var Ti=oi.get(li);if(!Ti){var Ki={loading:0,preload:null};if(Ti=ir.querySelector(Vb(li)))Ki.loading=5;else{l=d({rel:"stylesheet",href:l,"data-precedence":m},ie),(ie=ud.get(li))&&pv(l,ie);var to=Ti=ir.createElement("link");fa(to),Uu(to,"link",l),to._p=new Promise(function(go,ko){to.onload=go,to.onerror=ko}),to.addEventListener("load",function(){Ki.loading|=1}),to.addEventListener("error",function(){Ki.loading|=2}),Ki.loading|=4,p6(Ti,m,ir)}Ti={type:"stylesheet",instance:Ti,count:1,state:Ki},oi.set(li,Ti)}}}function I4(l,m){xh.X(l,m);var ie=xm;if(ie&&l){var ir=ma(ie).hoistableScripts,oi=Am(l),li=ir.get(oi);li||(li=ie.querySelector(Kb(oi)),li||(l=d({src:l,async:!0},m),(m=ud.get(oi))&&yv(l,m),li=ie.createElement("script"),fa(li),Uu(li,"link",l),ie.head.appendChild(li)),li={type:"script",instance:li,count:1,state:null},ir.set(oi,li))}}function _4(l,m){xh.M(l,m);var ie=xm;if(ie&&l){var ir=ma(ie).hoistableScripts,oi=Am(l),li=ir.get(oi);li||(li=ie.querySelector(Kb(oi)),li||(l=d({src:l,async:!0,type:"module"},m),(m=ud.get(oi))&&yv(l,m),li=ie.createElement("script"),fa(li),Uu(li,"link",l),ie.head.appendChild(li)),li={type:"script",instance:li,count:1,state:null},ir.set(oi,li))}}function y8(l,m,ie,ir){var oi=(oi=ai.current)?h6(oi):null;if(!oi)throw Error(n(446));switch(l){case"meta":case"title":return null;case"style":return typeof ie.precedence=="string"&&typeof ie.href=="string"?(m=Em(ie.href),ie=ma(oi).hoistableStyles,ir=ie.get(m),ir||(ir={type:"style",instance:null,count:0,state:null},ie.set(m,ir)),ir):{type:"void",instance:null,count:0,state:null};case"link":if(ie.rel==="stylesheet"&&typeof ie.href=="string"&&typeof ie.precedence=="string"){l=Em(ie.href);var li=ma(oi).hoistableStyles,Ti=li.get(l);if(Ti||(oi=oi.ownerDocument||oi,Ti={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},li.set(l,Ti),(li=oi.querySelector(Vb(l)))&&!li._p&&(Ti.instance=li,Ti.state.loading=5),ud.has(l)||(ie={rel:"preload",as:"style",href:ie.href,crossOrigin:ie.crossOrigin,integrity:ie.integrity,media:ie.media,hrefLang:ie.hrefLang,referrerPolicy:ie.referrerPolicy},ud.set(l,ie),li||T4(oi,l,ie,Ti.state))),m&&ir===null)throw Error(n(528,""));return Ti}if(m&&ir!==null)throw Error(n(529,""));return null;case"script":return m=ie.async,ie=ie.src,typeof ie=="string"&&m&&typeof m!="function"&&typeof m!="symbol"?(m=Am(ie),ie=ma(oi).hoistableScripts,ir=ie.get(m),ir||(ir={type:"script",instance:null,count:0,state:null},ie.set(m,ir)),ir):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,l))}}function Em(l){return'href="'+ka(l)+'"'}function Vb(l){return'link[rel="stylesheet"]['+l+"]"}function m8(l){return d({},l,{"data-precedence":l.precedence,precedence:null})}function T4(l,m,ie,ir){l.querySelector('link[rel="preload"][as="style"]['+m+"]")?ir.loading=1:(m=l.createElement("link"),ir.preload=m,m.addEventListener("load",function(){return ir.loading|=1}),m.addEventListener("error",function(){return ir.loading|=2}),Uu(m,"link",ie),fa(m),l.head.appendChild(m))}function Am(l){return'[src="'+ka(l)+'"]'}function Kb(l){return"script[async]"+l}function g8(l,m,ie){if(m.count++,m.instance===null)switch(m.type){case"style":var ir=l.querySelector('style[data-href~="'+ka(ie.href)+'"]');if(ir)return m.instance=ir,fa(ir),ir;var oi=d({},ie,{"data-href":ie.href,"data-precedence":ie.precedence,href:null,precedence:null});return ir=(l.ownerDocument||l).createElement("style"),fa(ir),Uu(ir,"style",oi),p6(ir,ie.precedence,l),m.instance=ir;case"stylesheet":oi=Em(ie.href);var li=l.querySelector(Vb(oi));if(li)return m.state.loading|=4,m.instance=li,fa(li),li;ir=m8(ie),(oi=ud.get(oi))&&pv(ir,oi),li=(l.ownerDocument||l).createElement("link"),fa(li);var Ti=li;return Ti._p=new Promise(function(Ki,to){Ti.onload=Ki,Ti.onerror=to}),Uu(li,"link",ir),m.state.loading|=4,p6(li,ie.precedence,l),m.instance=li;case"script":return li=Am(ie.src),(oi=l.querySelector(Kb(li)))?(m.instance=oi,fa(oi),oi):(ir=ie,(oi=ud.get(li))&&(ir=d({},ie),yv(ir,oi)),l=l.ownerDocument||l,oi=l.createElement("script"),fa(oi),Uu(oi,"link",ir),l.head.appendChild(oi),m.instance=oi);case"void":return null;default:throw Error(n(443,m.type))}else m.type==="stylesheet"&&(m.state.loading&4)===0&&(ir=m.instance,m.state.loading|=4,p6(ir,ie.precedence,l));return m.instance}function p6(l,m,ie){for(var ir=ie.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),oi=ir.length?ir[ir.length-1]:null,li=oi,Ti=0;Ti<ir.length;Ti++){var Ki=ir[Ti];if(Ki.dataset.precedence===m)li=Ki;else if(li!==oi)break}li?li.parentNode.insertBefore(l,li.nextSibling):(m=ie.nodeType===9?ie.head:ie,m.insertBefore(l,m.firstChild))}function pv(l,m){l.crossOrigin==null&&(l.crossOrigin=m.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=m.referrerPolicy),l.title==null&&(l.title=m.title)}function yv(l,m){l.crossOrigin==null&&(l.crossOrigin=m.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=m.referrerPolicy),l.integrity==null&&(l.integrity=m.integrity)}var y6=null;function b8(l,m,ie){if(y6===null){var ir=new Map,oi=y6=new Map;oi.set(ie,ir)}else oi=y6,ir=oi.get(ie),ir||(ir=new Map,oi.set(ie,ir));if(ir.has(l))return ir;for(ir.set(l,null),ie=ie.getElementsByTagName(l),oi=0;oi<ie.length;oi++){var li=ie[oi];if(!(li[$o]||li[Wi]||l==="link"&&li.getAttribute("rel")==="stylesheet")&&li.namespaceURI!=="http://www.w3.org/2000/svg"){var Ti=li.getAttribute(m)||"";Ti=l+Ti;var Ki=ir.get(Ti);Ki?Ki.push(li):ir.set(Ti,[li])}}return ir}function v8(l,m,ie){l=l.ownerDocument||l,l.head.insertBefore(ie,m==="title"?l.querySelector("head > title"):null)}function R4(l,m,ie){if(ie===1||m.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof m.precedence!="string"||typeof m.href!="string"||m.href==="")break;return!0;case"link":if(typeof m.rel!="string"||typeof m.href!="string"||m.href===""||m.onLoad||m.onError)break;switch(m.rel){case"stylesheet":return l=m.disabled,typeof m.precedence=="string"&&l==null;default:return!0}case"script":if(m.async&&typeof m.async!="function"&&typeof m.async!="symbol"&&!m.onLoad&&!m.onError&&m.src&&typeof m.src=="string")return!0}return!1}function w8(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function M4(l,m,ie,ir){if(ie.type==="stylesheet"&&(typeof ir.media!="string"||matchMedia(ir.media).matches!==!1)&&(ie.state.loading&4)===0){if(ie.instance===null){var oi=Em(ir.href),li=m.querySelector(Vb(oi));if(li){m=li._p,m!==null&&typeof m=="object"&&typeof m.then=="function"&&(l.count++,l=m6.bind(l),m.then(l,l)),ie.state.loading|=4,ie.instance=li,fa(li);return}li=m.ownerDocument||m,ir=m8(ir),(oi=ud.get(oi))&&pv(ir,oi),li=li.createElement("link"),fa(li);var Ti=li;Ti._p=new Promise(function(Ki,to){Ti.onload=Ki,Ti.onerror=to}),Uu(li,"link",ir),ie.instance=li}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(ie,m),(m=ie.state.preload)&&(ie.state.loading&3)===0&&(l.count++,ie=m6.bind(l),m.addEventListener("load",ie),m.addEventListener("error",ie))}}var mv=0;function B4(l,m){return l.stylesheets&&l.count===0&&b6(l,l.stylesheets),0<l.count||0<l.imgCount?function(ie){var ir=setTimeout(function(){if(l.stylesheets&&b6(l,l.stylesheets),l.unsuspend){var li=l.unsuspend;l.unsuspend=null,li()}},6e4+m);0<l.imgBytes&&mv===0&&(mv=62500*c4());var oi=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&b6(l,l.stylesheets),l.unsuspend)){var li=l.unsuspend;l.unsuspend=null,li()}},(l.imgBytes>mv?50:800)+m);return l.unsuspend=ie,function(){l.unsuspend=null,clearTimeout(ir),clearTimeout(oi)}}:null}function m6(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)b6(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var g6=null;function b6(l,m){l.stylesheets=null,l.unsuspend!==null&&(l.count++,g6=new Map,m.forEach(O4,l),g6=null,m6.call(l))}function O4(l,m){if(!(m.state.loading&4)){var ie=g6.get(l);if(ie)var ir=ie.get(null);else{ie=new Map,g6.set(l,ie);for(var oi=l.querySelectorAll("link[data-precedence],style[data-precedence]"),li=0;li<oi.length;li++){var Ti=oi[li];(Ti.nodeName==="LINK"||Ti.getAttribute("media")!=="not all")&&(ie.set(Ti.dataset.precedence,Ti),ir=Ti)}ir&&ie.set(null,ir)}oi=m.instance,Ti=oi.getAttribute("data-precedence"),li=ie.get(Ti)||ir,li===ir&&ie.set(null,oi),ie.set(Ti,oi),this.count++,ir=m6.bind(this),oi.addEventListener("load",ir),oi.addEventListener("error",ir),li?li.parentNode.insertBefore(oi,li.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(oi,l.firstChild)),m.state.loading|=4}}var Gb={$$typeof:B,Provider:null,Consumer:null,_currentValue:bt,_currentValue2:bt,_threadCount:0};function C4(l,m,ie,ir,oi,li,Ti,Ki,to){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.hiddenUpdates=ea(null),this.identifierPrefix=ir,this.onUncaughtError=oi,this.onCaughtError=li,this.onRecoverableError=Ti,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=to,this.incompleteTransitions=new Map}function x8(l,m,ie,ir,oi,li,Ti,Ki,to,go,ko,Vo){return l=new C4(l,m,ie,Ti,to,go,ko,Vo,Ki),m=1,li===!0&&(m|=24),li=ju(3,null,null,m),l.current=li,li.stateNode=l,m=mp(),m.refCount++,l.pooledCache=m,m.refCount++,li.memoizedState={element:ir,isDehydrated:ie,cache:m},ky(li),l}function E8(l){return l?(l=dd,l):dd}function A8(l,m,ie,ir,oi,li){oi=E8(oi),ir.context===null?ir.context=oi:ir.pendingContext=oi,ir=bd(m),ir.payload={element:ie},li=li===void 0?null:li,li!==null&&(ir.callback=li),ie=Jf(l,ir,m),ie!==null&&(Xf(ie,l,m),sh(ie,l,m))}function S8(l,m){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var ie=l.retryLane;l.retryLane=ie!==0&&ie<m?ie:m}}function gv(l,m){S8(l,m),(l=l.alternate)&&S8(l,m)}function I8(l){if(l.tag===13||l.tag===31){var m=rh(l,67108864);m!==null&&Xf(m,l,67108864),gv(l,67108864)}}function _8(l){if(l.tag===13||l.tag===31){var m=Hl();m=Fi(m);var ie=rh(l,m);ie!==null&&Xf(ie,l,m),gv(l,m)}}var v6=!0;function F4(l,m,ie,ir){var oi=ur.T;ur.T=null;var li=ue.p;try{ue.p=2,bv(l,m,ie,ir)}finally{ue.p=li,ur.T=oi}}function P4(l,m,ie,ir){var oi=ur.T;ur.T=null;var li=ue.p;try{ue.p=8,bv(l,m,ie,ir)}finally{ue.p=li,ur.T=oi}}function bv(l,m,ie,ir){if(v6){var oi=vv(ir);if(oi===null)iv(l,m,ir,w6,ie),R8(l,ir);else if(N4(oi,l,m,ie,ir))ir.stopPropagation();else if(R8(l,ir),m&4&&-1<k4.indexOf(l)){for(;oi!==null;){var li=ga(oi);if(li!==null)switch(li.tag){case 3:if(li=li.stateNode,li.current.memoizedState.isDehydrated){var Ti=Oo(li.pendingLanes);if(Ti!==0){var Ki=li;for(Ki.pendingLanes|=2,Ki.entangledLanes|=2;Ti;){var to=1<<31-Hi(Ti);Ki.entanglements[1]|=to,Ti&=~to}Qd(li),(Mo&6)===0&&(R0=vn()+500,Lb(0))}}break;case 31:case 13:Ki=rh(li,2),Ki!==null&&Xf(Ki,li,2),i6(),gv(li,2)}if(li=vv(ir),li===null&&iv(l,m,ir,w6,ie),li===oi)break;oi=li}oi!==null&&ir.stopPropagation()}else iv(l,m,ir,null,ie)}}function vv(l){return l=G0(l),wv(l)}var w6=null;function wv(l){if(w6=null,l=sa(l),l!==null){var m=i(l);if(m===null)l=null;else{var ie=m.tag;if(ie===13){if(l=u(m),l!==null)return l;l=null}else if(ie===31){if(l=a(m),l!==null)return l;l=null}else if(ie===3){if(m.stateNode.current.memoizedState.isDehydrated)return m.tag===3?m.stateNode.containerInfo:null;l=null}else m!==l&&(l=null)}}return w6=l,null}function T8(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(di()){case rr:return 2;case on:return 8;case si:case vi:return 32;case Ei:return 268435456;default:return 32}default:return 32}}var xv=!1,D0=null,q0=null,z0=null,$b=new Map,Qb=new Map,V0=[],k4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function R8(l,m){switch(l){case"focusin":case"focusout":D0=null;break;case"dragenter":case"dragleave":q0=null;break;case"mouseover":case"mouseout":z0=null;break;case"pointerover":case"pointerout":$b.delete(m.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qb.delete(m.pointerId)}}function e3(l,m,ie,ir,oi,li){return l===null||l.nativeEvent!==li?(l={blockedOn:m,domEventName:ie,eventSystemFlags:ir,nativeEvent:li,targetContainers:[oi]},m!==null&&(m=ga(m),m!==null&&I8(m)),l):(l.eventSystemFlags|=ir,m=l.targetContainers,oi!==null&&m.indexOf(oi)===-1&&m.push(oi),l)}function N4(l,m,ie,ir,oi){switch(m){case"focusin":return D0=e3(D0,l,m,ie,ir,oi),!0;case"dragenter":return q0=e3(q0,l,m,ie,ir,oi),!0;case"mouseover":return z0=e3(z0,l,m,ie,ir,oi),!0;case"pointerover":var li=oi.pointerId;return $b.set(li,e3($b.get(li)||null,l,m,ie,ir,oi)),!0;case"gotpointercapture":return li=oi.pointerId,Qb.set(li,e3(Qb.get(li)||null,l,m,ie,ir,oi)),!0}return!1}function M8(l){var m=sa(l.target);if(m!==null){var ie=i(m);if(ie!==null){if(m=ie.tag,m===13){if(m=u(ie),m!==null){l.blockedOn=m,Li(l.priority,function(){_8(ie)});return}}else if(m===31){if(m=a(ie),m!==null){l.blockedOn=m,Li(l.priority,function(){_8(ie)});return}}else if(m===3&&ie.stateNode.current.memoizedState.isDehydrated){l.blockedOn=ie.tag===3?ie.stateNode.containerInfo:null;return}}}l.blockedOn=null}function x6(l){if(l.blockedOn!==null)return!1;for(var m=l.targetContainers;0<m.length;){var ie=vv(l.nativeEvent);if(ie===null){ie=l.nativeEvent;var ir=new ie.constructor(ie.type,ie);Ah=ir,ie.target.dispatchEvent(ir),Ah=null}else return m=ga(ie),m!==null&&I8(m),l.blockedOn=ie,!1;m.shift()}return!0}function B8(l,m,ie){x6(l)&&ie.delete(m)}function D4(){xv=!1,D0!==null&&x6(D0)&&(D0=null),q0!==null&&x6(q0)&&(q0=null),z0!==null&&x6(z0)&&(z0=null),$b.forEach(B8),Qb.forEach(B8)}function E6(l,m){l.blockedOn===m&&(l.blockedOn=null,xv||(xv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,D4)))}var A6=null;function O8(l){A6!==l&&(A6=l,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){A6===l&&(A6=null);for(var m=0;m<l.length;m+=3){var ie=l[m],ir=l[m+1],oi=l[m+2];if(typeof ir!="function"){if(wv(ir||ie)===null)continue;break}var li=ga(ie);li!==null&&(l.splice(m,3),m-=3,Yh(li,{pending:!0,data:oi,method:ie.method,action:ir},ir,oi))}}))}function Sm(l){function m(to){return E6(to,l)}D0!==null&&E6(D0,l),q0!==null&&E6(q0,l),z0!==null&&E6(z0,l),$b.forEach(m),Qb.forEach(m);for(var ie=0;ie<V0.length;ie++){var ir=V0[ie];ir.blockedOn===l&&(ir.blockedOn=null)}for(;0<V0.length&&(ie=V0[0],ie.blockedOn===null);)M8(ie),ie.blockedOn===null&&V0.shift();if(ie=(l.ownerDocument||l).$$reactFormReplay,ie!=null)for(ir=0;ir<ie.length;ir+=3){var oi=ie[ir],li=ie[ir+1],Ti=oi[io]||null;if(typeof li=="function")Ti||O8(ie);else if(Ti){var Ki=null;if(li&&li.hasAttribute("formAction")){if(oi=li,Ti=li[io]||null)Ki=Ti.formAction;else if(wv(oi)!==null)continue}else Ki=Ti.action;typeof Ki=="function"?ie[ir+1]=Ki:(ie.splice(ir,3),ir-=3),O8(ie)}}}function C8(){function l(li){li.canIntercept&&li.info==="react-transition"&&li.intercept({handler:function(){return new Promise(function(Ti){return oi=Ti})},focusReset:"manual",scroll:"manual"})}function m(){oi!==null&&(oi(),oi=null),ir||setTimeout(ie,20)}function ie(){if(!ir&&!navigation.transition){var li=navigation.currentEntry;li&&li.url!=null&&navigation.navigate(li.url,{state:li.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var ir=!1,oi=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",m),navigation.addEventListener("navigateerror",m),setTimeout(ie,100),function(){ir=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",m),navigation.removeEventListener("navigateerror",m),oi!==null&&(oi(),oi=null)}}}function Ev(l){this._internalRoot=l}S6.prototype.render=Ev.prototype.render=function(l){var m=this._internalRoot;if(m===null)throw Error(n(409));var ie=m.current,ir=Hl();A8(ie,ir,l,m,null,null)},S6.prototype.unmount=Ev.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var m=l.containerInfo;A8(l.current,2,null,l,null,null),i6(),m[lo]=null}};function S6(l){this._internalRoot=l}S6.prototype.unstable_scheduleHydration=function(l){if(l){var m=gi();l={blockedOn:null,target:l,priority:m};for(var ie=0;ie<V0.length&&m!==0&&m<V0[ie].priority;ie++);V0.splice(ie,0,l),ie===0&&M8(l)}};var F8=t.version;if(F8!=="19.2.4")throw Error(n(527,F8,"19.2.4"));ue.findDOMNode=function(l){var m=l._reactInternals;if(m===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=f(m),l=l!==null?c(l):null,l=l===null?null:l.stateNode,l};var U4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:ur,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var I6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!I6.isDisabled&&I6.supportsFiber)try{Ii=I6.inject(U4),Ci=I6}catch{}}return reactDomClient_production.createRoot=function(l,m){if(!o(l))throw Error(n(299));var ie=!1,ir="",oi=Cu,li=js,Ti=vd;return m!=null&&(m.unstable_strictMode===!0&&(ie=!0),m.identifierPrefix!==void 0&&(ir=m.identifierPrefix),m.onUncaughtError!==void 0&&(oi=m.onUncaughtError),m.onCaughtError!==void 0&&(li=m.onCaughtError),m.onRecoverableError!==void 0&&(Ti=m.onRecoverableError)),m=x8(l,1,!1,null,null,ie,ir,null,oi,li,Ti,C8),l[lo]=m.current,nv(l),new Ev(m)},reactDomClient_production.hydrateRoot=function(l,m,ie){if(!o(l))throw Error(n(299));var ir=!1,oi="",li=Cu,Ti=js,Ki=vd,to=null;return ie!=null&&(ie.unstable_strictMode===!0&&(ir=!0),ie.identifierPrefix!==void 0&&(oi=ie.identifierPrefix),ie.onUncaughtError!==void 0&&(li=ie.onUncaughtError),ie.onCaughtError!==void 0&&(Ti=ie.onCaughtError),ie.onRecoverableError!==void 0&&(Ki=ie.onRecoverableError),ie.formState!==void 0&&(to=ie.formState)),m=x8(l,1,!0,m,ie??null,ir,oi,to,li,Ti,Ki,C8),m.context=E8(null),ie=m.current,ir=Hl(),ir=Fi(ir),oi=bd(ir),oi.callback=null,Jf(ie,oi,ir),ie=ir,m.current.lanes=ie,zi(m,ie),Qd(m),l[lo]=m.current,nv(l),new S6(m)},reactDomClient_production.version="19.2.4",reactDomClient_production}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client.exports;hasRequiredClient=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),client.exports=requireReactDomClient_production(),client.exports}var clientExports=requireClient(),reactDomExports=requireReactDom();function Modal({isOpen:e,onClose:t,title:r,children:n,className:o,url:i}){reactExports.useEffect(()=>{if(e){const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}}},[e]);const u=()=>{i&&(globalThis?.open?.(i,"_blank","noopener,noreferrer"),t())};if(!e)return null;const a=jsxRuntimeExports.jsx("div",{className:"modal-overlay",onClick:t,children:jsxRuntimeExports.jsxs("div",{className:`modal-content ${o}`,onClick:s=>s.stopPropagation(),children:[jsxRuntimeExports.jsxs("div",{className:"modal-header",children:[jsxRuntimeExports.jsx("h2",{className:"modal-title",children:r}),jsxRuntimeExports.jsxs("div",{className:"modal-header-actions",children:[i&&jsxRuntimeExports.jsx("button",{className:"modal-open-new-window",onClick:u,"aria-label":"Open in new window",title:"Open in new window",type:"button",children:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),jsxRuntimeExports.jsx("polyline",{points:"15 3 21 3 21 9"}),jsxRuntimeExports.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}),jsxRuntimeExports.jsx("button",{className:"modal-close",onClick:t,type:"button",children:"×"})]})]}),jsxRuntimeExports.jsx("div",{className:"modal-body",children:n})]})});return typeof document<"u"&&document.body?reactDomExports.createPortal(a,document.body):a}const crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes$4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function anumber$1(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function abytes$1(e,...t){if(!isBytes$4(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ahash(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");anumber$1(e.outputLen),anumber$1(e.blockLen)}function aexists(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 aoutput(e,t){abytes$1(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function u32$2(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function clean(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function createView(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function rotr(e,t){return e<<32-t|e>>>t}const isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function byteSwap$1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const swap8IfBE=isLE$1?e=>e:e=>byteSwap$1(e);function byteSwap32$1(e){for(let t=0;t<e.length;t++)e[t]=byteSwap$1(e[t]);return e}const swap32IfBE=isLE$1?e=>e:byteSwap32$1,hasHexBuiltin$1=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",hexes$2=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bytesToHex$4(e){if(abytes$1(e),hasHexBuiltin$1)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=hexes$2[e[r]];return t}const asciis$1={_0:48,_9:57,A:65,F:70,a:97,f:102};function asciiToBase16$1(e){if(e>=asciis$1._0&&e<=asciis$1._9)return e-asciis$1._0;if(e>=asciis$1.A&&e<=asciis$1.F)return e-(asciis$1.A-10);if(e>=asciis$1.a&&e<=asciis$1.f)return e-(asciis$1.a-10)}function hexToBytes$2(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(hasHexBuiltin$1)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const u=asciiToBase16$1(e.charCodeAt(i)),a=asciiToBase16$1(e.charCodeAt(i+1));if(u===void 0||a===void 0){const s=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+i)}n[o]=u*16+a}return n}function utf8ToBytes$1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function toBytes$2(e){return typeof e=="string"&&(e=utf8ToBytes$1(e)),abytes$1(e),e}function concatBytes$2(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];abytes$1(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}let Hash$2=class{};function createHasher(e){const t=n=>e().update(toBytes$2(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function createOptHasher(e){const t=(n,o)=>e(o).update(toBytes$2(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function randomBytes(e=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(e));if(crypto$2&&typeof crypto$2.randomBytes=="function")return Uint8Array.from(crypto$2.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$b=BigInt(0),_1n$c=BigInt(1);function _abool2(e,t=""){if(typeof e!="boolean"){const r=t&&`"${t}"`;throw new Error(r+"expected boolean, got type="+typeof e)}return e}function _abytes2(e,t,r=""){const n=isBytes$4(e),o=e?.length,i=t!==void 0;if(!n||i&&o!==t){const u=r&&`"${r}" `,a=i?` of length ${t}`:"",s=n?`length=${o}`:`type=${typeof e}`;throw new Error(u+"expected Uint8Array"+a+", got "+s)}return e}function numberToHexUnpadded$1(e){const t=e.toString(16);return t.length&1?"0"+t:t}function hexToNumber$3(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?_0n$b:BigInt("0x"+e)}function bytesToNumberBE$1(e){return hexToNumber$3(bytesToHex$4(e))}function bytesToNumberLE$1(e){return abytes$1(e),hexToNumber$3(bytesToHex$4(Uint8Array.from(e).reverse()))}function numberToBytesBE$1(e,t){return hexToBytes$2(e.toString(16).padStart(t*2,"0"))}function numberToBytesLE$1(e,t){return numberToBytesBE$1(e,t).reverse()}function ensureBytes$1(e,t,r){let n;if(typeof t=="string")try{n=hexToBytes$2(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(isBytes$4(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function copyBytes(e){return Uint8Array.from(e)}const isPosBig$1=e=>typeof e=="bigint"&&_0n$b<=e;function inRange$1(e,t,r){return isPosBig$1(e)&&isPosBig$1(t)&&isPosBig$1(r)&&t<=e&&e<r}function aInRange$1(e,t,r,n){if(!inRange$1(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function bitLen$1(e){let t;for(t=0;e>_0n$b;e>>=_1n$c,t+=1);return t}const bitMask$1=e=>(_1n$c<<BigInt(e))-_1n$c;function createHmacDrbg$1(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");const n=h=>new Uint8Array(h),o=h=>Uint8Array.of(h);let i=n(e),u=n(e),a=0;const s=()=>{i.fill(1),u.fill(0),a=0},f=(...h)=>r(u,i,...h),c=(h=n(0))=>{u=f(o(0),h),i=f(),h.length!==0&&(u=f(o(1),h),i=f())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const y=[];for(;h<t;){i=f();const b=i.slice();y.push(b),h+=i.length}return concatBytes$2(...y)};return(h,y)=>{s(),c(h);let b;for(;!(b=y(d()));)c();return s(),b}}function _validateObject(e,t,r={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function n(o,i,u){const a=e[o];if(u&&a===void 0)return;const s=typeof a;if(s!==i||a===null)throw new Error(`param "${o}" is invalid: expected ${i}, got ${s}`)}Object.entries(t).forEach(([o,i])=>n(o,i,!1)),Object.entries(r).forEach(([o,i])=>n(o,i,!0))}function memoized$1(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$a=BigInt(0),_1n$b=BigInt(1),_2n$8=BigInt(2),_3n$3=BigInt(3),_4n$3=BigInt(4),_5n$2=BigInt(5),_7n$2=BigInt(7),_8n$3=BigInt(8),_9n=BigInt(9),_16n=BigInt(16);function mod$1(e,t){const r=e%t;return r>=_0n$a?r:t+r}function pow2$1(e,t,r){let n=e;for(;t-- >_0n$a;)n*=n,n%=r;return n}function invert$1(e,t){if(e===_0n$a)throw new Error("invert: expected non-zero number");if(t<=_0n$a)throw new Error("invert: expected positive modulus, got "+t);let r=mod$1(e,t),n=t,o=_0n$a,i=_1n$b;for(;r!==_0n$a;){const a=n/r,s=n%r,f=o-i*a;n=r,r=s,o=i,i=f}if(n!==_1n$b)throw new Error("invert: does not exist");return mod$1(o,t)}function assertIsSquare(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function sqrt3mod4$1(e,t){const r=(e.ORDER+_1n$b)/_4n$3,n=e.pow(t,r);return assertIsSquare(e,n,t),n}function sqrt5mod8$1(e,t){const r=(e.ORDER-_5n$2)/_8n$3,n=e.mul(t,_2n$8),o=e.pow(n,r),i=e.mul(t,o),u=e.mul(e.mul(i,_2n$8),o),a=e.mul(i,e.sub(u,e.ONE));return assertIsSquare(e,a,t),a}function sqrt9mod16(e){const t=Field$1(e),r=tonelliShanks$1(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),u=(e+_7n$2)/_16n;return(a,s)=>{let f=a.pow(s,u),c=a.mul(f,n);const d=a.mul(f,o),p=a.mul(f,i),h=a.eql(a.sqr(c),s),y=a.eql(a.sqr(d),s);f=a.cmov(f,c,h),c=a.cmov(p,d,y);const b=a.eql(a.sqr(c),s),w=a.cmov(f,c,b);return assertIsSquare(a,w,s),w}}function tonelliShanks$1(e){if(e<_3n$3)throw new Error("sqrt is not defined for small field");let t=e-_1n$b,r=0;for(;t%_2n$8===_0n$a;)t/=_2n$8,r++;let n=_2n$8;const o=Field$1(e);for(;FpLegendre$1(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return sqrt3mod4$1;let i=o.pow(n,t);const u=(t+_1n$b)/_2n$8;return function(s,f){if(s.is0(f))return f;if(FpLegendre$1(s,f)!==1)throw new Error("Cannot find square root");let c=r,d=s.mul(s.ONE,i),p=s.pow(f,t),h=s.pow(f,u);for(;!s.eql(p,s.ONE);){if(s.is0(p))return s.ZERO;let y=1,b=s.sqr(p);for(;!s.eql(b,s.ONE);)if(y++,b=s.sqr(b),y===c)throw new Error("Cannot find square root");const w=_1n$b<<BigInt(c-y-1),S=s.pow(d,w);c=y,d=s.sqr(S),p=s.mul(p,d),h=s.mul(h,S)}return h}}function FpSqrt$1(e){return e%_4n$3===_3n$3?sqrt3mod4$1:e%_8n$3===_5n$2?sqrt5mod8$1:e%_16n===_9n?sqrt9mod16(e):tonelliShanks$1(e)}const isNegativeLE=(e,t)=>(mod$1(e,t)&_1n$b)===_1n$b,FIELD_FIELDS$1=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField$1(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=FIELD_FIELDS$1.reduce((n,o)=>(n[o]="function",n),t);return _validateObject(e,r),e}function FpPow$1(e,t,r){if(r<_0n$a)throw new Error("invalid exponent, negatives unsupported");if(r===_0n$a)return e.ONE;if(r===_1n$b)return t;let n=e.ONE,o=t;for(;r>_0n$a;)r&_1n$b&&(n=e.mul(n,o)),o=e.sqr(o),r>>=_1n$b;return n}function FpInvertBatch$1(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((u,a,s)=>e.is0(a)?u:(n[s]=u,e.mul(u,a)),e.ONE),i=e.inv(o);return t.reduceRight((u,a,s)=>e.is0(a)?u:(n[s]=e.mul(u,n[s]),e.mul(u,a)),i),n}function FpLegendre$1(e,t){const r=(e.ORDER-_1n$b)/_2n$8,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),u=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!u)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function nLength$1(e,t){t!==void 0&&anumber$1(t);const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Field$1(e,t,r=!1,n={}){if(e<=_0n$a)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,u=!1,a;if(typeof t=="object"&&t!=null){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const p=t;p.BITS&&(o=p.BITS),p.sqrt&&(i=p.sqrt),typeof p.isLE=="boolean"&&(r=p.isLE),typeof p.modFromBytes=="boolean"&&(u=p.modFromBytes),a=p.allowedLengths}else typeof t=="number"&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:s,nByteLength:f}=nLength$1(e,o);if(f>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const d=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:f,MASK:bitMask$1(s),ZERO:_0n$a,ONE:_1n$b,allowedLengths:a,create:p=>mod$1(p,e),isValid:p=>{if(typeof p!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof p);return _0n$a<=p&&p<e},is0:p=>p===_0n$a,isValidNot0:p=>!d.is0(p)&&d.isValid(p),isOdd:p=>(p&_1n$b)===_1n$b,neg:p=>mod$1(-p,e),eql:(p,h)=>p===h,sqr:p=>mod$1(p*p,e),add:(p,h)=>mod$1(p+h,e),sub:(p,h)=>mod$1(p-h,e),mul:(p,h)=>mod$1(p*h,e),pow:(p,h)=>FpPow$1(d,p,h),div:(p,h)=>mod$1(p*invert$1(h,e),e),sqrN:p=>p*p,addN:(p,h)=>p+h,subN:(p,h)=>p-h,mulN:(p,h)=>p*h,inv:p=>invert$1(p,e),sqrt:i||(p=>(c||(c=FpSqrt$1(e)),c(d,p))),toBytes:p=>r?numberToBytesLE$1(p,f):numberToBytesBE$1(p,f),fromBytes:(p,h=!0)=>{if(a){if(!a.includes(p.length)||p.length>f)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+p.length);const b=new Uint8Array(f);b.set(p,r?0:b.length-p.length),p=b}if(p.length!==f)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+p.length);let y=r?bytesToNumberLE$1(p):bytesToNumberBE$1(p);if(u&&(y=mod$1(y,e)),!h&&!d.isValid(y))throw new Error("invalid field element: outside of range 0..ORDER");return y},invertBatch:p=>FpInvertBatch$1(d,p),cmov:(p,h,y)=>y?h:p});return Object.freeze(d)}function getFieldBytesLength$1(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function getMinHashLength$1(e){const t=getFieldBytesLength$1(e);return t+Math.ceil(t/2)}function mapHashToField$1(e,t,r=!1){const n=e.length,o=getFieldBytesLength$1(t),i=getMinHashLength$1(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const u=r?bytesToNumberLE$1(e):bytesToNumberBE$1(e),a=mod$1(u,t-_1n$b)+_1n$b;return r?numberToBytesLE$1(a,o):numberToBytesBE$1(a,o)}function setBigUint64(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),u=Number(r>>o&i),a=Number(r&i),s=n?4:0,f=n?0:4;e.setUint32(t+s,u,n),e.setUint32(t+f,a,n)}function Chi(e,t,r){return e&t^~e&r}function Maj(e,t,r){return e&t^e&r^t&r}class HashMD extends Hash$2{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=createView(this.buffer)}update(t){aexists(this),t=toBytes$2(t),abytes$1(t);const{view:r,buffer:n,blockLen:o}=this,i=t.length;for(let u=0;u<i;){const a=Math.min(o-this.pos,i-u);if(a===o){const s=createView(t);for(;o<=i-u;u+=o)this.process(s,u);continue}n.set(t.subarray(u,u+a),this.pos),this.pos+=a,u+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){aexists(this),aoutput(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:u}=this;r[u++]=128,clean(this.buffer.subarray(u)),this.padOffset>o-u&&(this.process(n,0),u=0);for(let d=u;d<o;d++)r[d]=0;setBigUint64(n,o-8,BigInt(this.length*8),i),this.process(n,0);const a=createView(t),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=s/4,c=this.get();if(f>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)a.setUint32(4*d,c[d],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:u,pos:a}=this;return t.destroyed=u,t.finished=i,t.length=o,t.pos=a,o%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),U32_MASK64$1=BigInt(2**32-1),_32n$1=BigInt(32);function fromBig$1(e,t=!1){return t?{h:Number(e&U32_MASK64$1),l:Number(e>>_32n$1&U32_MASK64$1)}:{h:Number(e>>_32n$1&U32_MASK64$1)|0,l:Number(e&U32_MASK64$1)|0}}function split$1(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:u,l:a}=fromBig$1(e[i],t);[n[i],o[i]]=[u,a]}return[n,o]}const shrSH=(e,t,r)=>e>>>r,shrSL=(e,t,r)=>e<<32-r|t>>>r,rotrSH=(e,t,r)=>e>>>r|t<<32-r,rotrSL=(e,t,r)=>e<<32-r|t>>>r,rotrBH=(e,t,r)=>e<<64-r|t>>>r-32,rotrBL=(e,t,r)=>e>>>r-32|t<<64-r,rotr32H=(e,t)=>t,rotr32L=(e,t)=>e,rotlSH$1=(e,t,r)=>e<<r|t>>>32-r,rotlSL$1=(e,t,r)=>t<<r|e>>>32-r,rotlBH$1=(e,t,r)=>t<<r-32|e>>>64-r,rotlBL$1=(e,t,r)=>e<<r-32|t>>>64-r;function add(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}const add3L=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5L=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),add5H=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,SHA256_K=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]),SHA256_W=new Uint32Array(64);class SHA256 extends HashMD{constructor(t=32){super(64,t,8,!1),this.A=SHA256_IV[0]|0,this.B=SHA256_IV[1]|0,this.C=SHA256_IV[2]|0,this.D=SHA256_IV[3]|0,this.E=SHA256_IV[4]|0,this.F=SHA256_IV[5]|0,this.G=SHA256_IV[6]|0,this.H=SHA256_IV[7]|0}get(){const{A:t,B:r,C:n,D:o,E:i,F:u,G:a,H:s}=this;return[t,r,n,o,i,u,a,s]}set(t,r,n,o,i,u,a,s){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=u|0,this.G=a|0,this.H=s|0}process(t,r){for(let d=0;d<16;d++,r+=4)SHA256_W[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){const p=SHA256_W[d-15],h=SHA256_W[d-2],y=rotr(p,7)^rotr(p,18)^p>>>3,b=rotr(h,17)^rotr(h,19)^h>>>10;SHA256_W[d]=b+SHA256_W[d-7]+y+SHA256_W[d-16]|0}let{A:n,B:o,C:i,D:u,E:a,F:s,G:f,H:c}=this;for(let d=0;d<64;d++){const p=rotr(a,6)^rotr(a,11)^rotr(a,25),h=c+p+Chi(a,s,f)+SHA256_K[d]+SHA256_W[d]|0,b=(rotr(n,2)^rotr(n,13)^rotr(n,22))+Maj(n,o,i)|0;c=f,f=s,s=a,a=u+h|0,u=i,i=o,o=n,n=h+b|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,u=u+this.D|0,a=a+this.E|0,s=s+this.F|0,f=f+this.G|0,c=c+this.H|0,this.set(n,o,i,u,a,s,f,c)}roundClean(){clean(SHA256_W)}destroy(){this.set(0,0,0,0,0,0,0,0),clean(this.buffer)}}const K512=split$1(["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))),SHA512_Kh=K512[0],SHA512_Kl=K512[1],SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=SHA512_IV[0]|0,this.Al=SHA512_IV[1]|0,this.Bh=SHA512_IV[2]|0,this.Bl=SHA512_IV[3]|0,this.Ch=SHA512_IV[4]|0,this.Cl=SHA512_IV[5]|0,this.Dh=SHA512_IV[6]|0,this.Dl=SHA512_IV[7]|0,this.Eh=SHA512_IV[8]|0,this.El=SHA512_IV[9]|0,this.Fh=SHA512_IV[10]|0,this.Fl=SHA512_IV[11]|0,this.Gh=SHA512_IV[12]|0,this.Gl=SHA512_IV[13]|0,this.Hh=SHA512_IV[14]|0,this.Hl=SHA512_IV[15]|0}get(){const{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:u,Dh:a,Dl:s,Eh:f,El:c,Fh:d,Fl:p,Gh:h,Gl:y,Hh:b,Hl:w}=this;return[t,r,n,o,i,u,a,s,f,c,d,p,h,y,b,w]}set(t,r,n,o,i,u,a,s,f,c,d,p,h,y,b,w){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=u|0,this.Dh=a|0,this.Dl=s|0,this.Eh=f|0,this.El=c|0,this.Fh=d|0,this.Fl=p|0,this.Gh=h|0,this.Gl=y|0,this.Hh=b|0,this.Hl=w|0}process(t,r){for(let B=0;B<16;B++,r+=4)SHA512_W_H[B]=t.getUint32(r),SHA512_W_L[B]=t.getUint32(r+=4);for(let B=16;B<80;B++){const ae=SHA512_W_H[B-15]|0,W=SHA512_W_L[B-15]|0,J=rotrSH(ae,W,1)^rotrSH(ae,W,8)^shrSH(ae,W,7),ve=rotrSL(ae,W,1)^rotrSL(ae,W,8)^shrSL(ae,W,7),Qe=SHA512_W_H[B-2]|0,kt=SHA512_W_L[B-2]|0,nr=rotrSH(Qe,kt,19)^rotrBH(Qe,kt,61)^shrSH(Qe,kt,6),sr=rotrSL(Qe,kt,19)^rotrBL(Qe,kt,61)^shrSL(Qe,kt,6),ce=add4L(ve,sr,SHA512_W_L[B-7],SHA512_W_L[B-16]),Ze=add4H(ce,J,nr,SHA512_W_H[B-7],SHA512_W_H[B-16]);SHA512_W_H[B]=Ze|0,SHA512_W_L[B]=ce|0}let{Ah:n,Al:o,Bh:i,Bl:u,Ch:a,Cl:s,Dh:f,Dl:c,Eh:d,El:p,Fh:h,Fl:y,Gh:b,Gl:w,Hh:S,Hl:E}=this;for(let B=0;B<80;B++){const ae=rotrSH(d,p,14)^rotrSH(d,p,18)^rotrBH(d,p,41),W=rotrSL(d,p,14)^rotrSL(d,p,18)^rotrBL(d,p,41),J=d&h^~d&b,ve=p&y^~p&w,Qe=add5L(E,W,ve,SHA512_Kl[B],SHA512_W_L[B]),kt=add5H(Qe,S,ae,J,SHA512_Kh[B],SHA512_W_H[B]),nr=Qe|0,sr=rotrSH(n,o,28)^rotrBH(n,o,34)^rotrBH(n,o,39),ce=rotrSL(n,o,28)^rotrBL(n,o,34)^rotrBL(n,o,39),Ze=n&i^n&a^i&a,se=o&u^o&s^u&s;S=b|0,E=w|0,b=h|0,w=y|0,h=d|0,y=p|0,{h:d,l:p}=add(f|0,c|0,kt|0,nr|0),f=a|0,c=s|0,a=i|0,s=u|0,i=n|0,u=o|0;const vt=add3L(nr,ce,se);n=add3H(vt,kt,sr,Ze),o=vt|0}({h:n,l:o}=add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:u}=add(this.Bh|0,this.Bl|0,i|0,u|0),{h:a,l:s}=add(this.Ch|0,this.Cl|0,a|0,s|0),{h:f,l:c}=add(this.Dh|0,this.Dl|0,f|0,c|0),{h:d,l:p}=add(this.Eh|0,this.El|0,d|0,p|0),{h,l:y}=add(this.Fh|0,this.Fl|0,h|0,y|0),{h:b,l:w}=add(this.Gh|0,this.Gl|0,b|0,w|0),{h:S,l:E}=add(this.Hh|0,this.Hl|0,S|0,E|0),this.set(n,o,i,u,a,s,f,c,d,p,h,y,b,w,S,E)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){clean(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha256$4=createHasher(()=>new SHA256),sha512$6=createHasher(()=>new SHA512);class HMAC extends Hash$2{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,ahash(t);const n=toBytes$2(r);if(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;const o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?t.create().update(n).digest():n);for(let u=0;u<i.length;u++)i[u]^=54;this.iHash.update(i),this.oHash=t.create();for(let u=0;u<i.length;u++)i[u]^=106;this.oHash.update(i),clean(i)}update(t){return aexists(this),this.iHash.update(t),this}digestInto(t){aexists(this),abytes$1(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:o,destroyed:i,blockLen:u,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=i,t.blockLen=u,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hmac$1=(e,t,r)=>new HMAC(e,t).update(r).digest();hmac$1.create=(e,t)=>new HMAC(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$9=BigInt(0),_1n$a=BigInt(1);function negateCt(e,t){const r=t.negate();return e?r:t}function normalizeZ(e,t){const r=FpInvertBatch$1(e.Fp,t.map(n=>n.Z));return t.map((n,o)=>e.fromAffine(n.toAffine(r[o])))}function validateW$1(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function calcWOpts$1(e,t){validateW$1(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=bitMask$1(e),u=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:u}}function calcOffsets$1(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:u}=r;let a=Number(e&o),s=e>>u;a>n&&(a-=i,s+=_1n$a);const f=t*n,c=f+Math.abs(a)-1,d=a===0,p=a<0,h=t%2!==0;return{nextN:s,offset:c,isZero:d,isNeg:p,isNegF:h,offsetF:f}}function validateMSMPoints$1(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function validateMSMScalars$1(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const pointPrecomputes$1=new WeakMap,pointWindowSizes$1=new WeakMap;function getW$1(e){return pointWindowSizes$1.get(e)||1}function assert0(e){if(e!==_0n$9)throw new Error("invalid wNAF")}let wNAF$1=class{constructor(t,r){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,n=this.ZERO){let o=t;for(;r>_0n$9;)r&_1n$a&&(n=n.add(o)),o=o.double(),r>>=_1n$a;return n}precomputeWindow(t,r){const{windows:n,windowSize:o}=calcWOpts$1(r,this.bits),i=[];let u=t,a=u;for(let s=0;s<n;s++){a=u,i.push(a);for(let f=1;f<o;f++)a=a.add(u),i.push(a);u=a.double()}return i}wNAF(t,r,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let o=this.ZERO,i=this.BASE;const u=calcWOpts$1(t,this.bits);for(let a=0;a<u.windows;a++){const{nextN:s,offset:f,isZero:c,isNeg:d,isNegF:p,offsetF:h}=calcOffsets$1(n,a,u);n=s,c?i=i.add(negateCt(p,r[h])):o=o.add(negateCt(d,r[f]))}return assert0(n),{p:o,f:i}}wNAFUnsafe(t,r,n,o=this.ZERO){const i=calcWOpts$1(t,this.bits);for(let u=0;u<i.windows&&n!==_0n$9;u++){const{nextN:a,offset:s,isZero:f,isNeg:c}=calcOffsets$1(n,u,i);if(n=a,!f){const d=r[s];o=o.add(c?d.negate():d)}}return assert0(n),o}getPrecomputes(t,r,n){let o=pointPrecomputes$1.get(r);return o||(o=this.precomputeWindow(r,t),t!==1&&(typeof n=="function"&&(o=n(o)),pointPrecomputes$1.set(r,o))),o}cached(t,r,n){const o=getW$1(t);return this.wNAF(o,this.getPrecomputes(o,t,n),r)}unsafe(t,r,n,o){const i=getW$1(t);return i===1?this._unsafeLadder(t,r,o):this.wNAFUnsafe(i,this.getPrecomputes(i,t,n),r,o)}createCache(t,r){validateW$1(r,this.bits),pointWindowSizes$1.set(t,r),pointPrecomputes$1.delete(t)}hasCache(t){return getW$1(t)!==1}};function mulEndoUnsafe(e,t,r,n){let o=t,i=e.ZERO,u=e.ZERO;for(;r>_0n$9||n>_0n$9;)r&_1n$a&&(i=i.add(o)),n&_1n$a&&(u=u.add(o)),o=o.double(),r>>=_1n$a,n>>=_1n$a;return{p1:i,p2:u}}function pippenger$1(e,t,r,n){validateMSMPoints$1(r,e),validateMSMScalars$1(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const u=e.ZERO,a=bitLen$1(BigInt(o));let s=1;a>12?s=a-3:a>4?s=a-2:a>0&&(s=2);const f=bitMask$1(s),c=new Array(Number(f)+1).fill(u),d=Math.floor((t.BITS-1)/s)*s;let p=u;for(let h=d;h>=0;h-=s){c.fill(u);for(let b=0;b<i;b++){const w=n[b],S=Number(w>>BigInt(h)&f);c[S]=c[S].add(r[b])}let y=u;for(let b=c.length-1,w=u;b>0;b--)w=w.add(c[b]),y=y.add(w);if(p=p.add(y),h!==0)for(let b=0;b<s;b++)p=p.double()}return p}function createField(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return validateField$1(t),t}else return Field$1(e,{isLE:r})}function _createCurveFields(e,t,r={},n){if(n===void 0&&(n=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const s of["p","n","h"]){const f=t[s];if(!(typeof f=="bigint"&&f>_0n$9))throw new Error(`CURVE.${s} must be positive bigint`)}const o=createField(t.p,r.Fp,n),i=createField(t.n,r.Fn,n),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const s of a)if(!o.isValid(t[s]))throw new Error(`CURVE.${s} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const divNearest$1=(e,t)=>(e+(e>=0?t:-t)/_2n$7)/t;function _splitEndoScalar(e,t,r){const[[n,o],[i,u]]=t,a=divNearest$1(u*e,r),s=divNearest$1(-o*e,r);let f=e-a*n-s*i,c=-a*o-s*u;const d=f<_0n$8,p=c<_0n$8;d&&(f=-f),p&&(c=-c);const h=bitMask$1(Math.ceil(bitLen$1(r)/2))+_1n$9;if(f<_0n$8||f>=h||c<_0n$8||c>=h)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:f,k2neg:p,k2:c}}function validateSigFormat(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function validateSigOpts(e,t){const r={};for(let n of Object.keys(t))r[n]=e[n]===void 0?t[n]:e[n];return _abool2(r.lowS,"lowS"),_abool2(r.prehash,"prehash"),r.format!==void 0&&validateSigFormat(r.format),r}let DERErr$1=class extends Error{constructor(t=""){super(t)}};const DER$1={Err:DERErr$1,_tlv:{encode:(e,t)=>{const{Err:r}=DER$1;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=numberToHexUnpadded$1(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?numberToHexUnpadded$1(o.length/2|128):"";return numberToHexUnpadded$1(e)+i+o+t},decode(e,t){const{Err:r}=DER$1;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++],i=!!(o&128);let u=0;if(!i)u=o;else{const s=o&127;if(!s)throw new r("tlv.decode(long): indefinite length not supported");if(s>4)throw new r("tlv.decode(long): byte length is too big");const f=t.subarray(n,n+s);if(f.length!==s)throw new r("tlv.decode: length bytes not complete");if(f[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const c of f)u=u<<8|c;if(n+=s,u<128)throw new r("tlv.decode(long): not minimal encoding")}const a=t.subarray(n,n+u);if(a.length!==u)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+u)}}},_int:{encode(e){const{Err:t}=DER$1;if(e<_0n$8)throw new t("integer: negative integers are not allowed");let r=numberToHexUnpadded$1(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){const{Err:t}=DER$1;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bytesToNumberBE$1(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=DER$1,o=ensureBytes$1("signature",e),{v:i,l:u}=n.decode(48,o);if(u.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:s}=n.decode(2,i),{v:f,l:c}=n.decode(2,s);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(f)}},hexFromSig(e){const{_tlv:t,_int:r}=DER$1,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),i=n+o;return t.encode(48,i)}},_0n$8=BigInt(0),_1n$9=BigInt(1),_2n$7=BigInt(2),_3n$2=BigInt(3),_4n$2=BigInt(4);function _normFnElement(e,t){const{BYTES:r}=e;let n;if(typeof t=="bigint")n=t;else{let o=ensureBytes$1("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function weierstrassN(e,t={}){const r=_createCurveFields("weierstrass",e,t),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:u,n:a}=i;_validateObject(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:s}=t;if(s&&(!n.is0(i.a)||typeof s.beta!="bigint"||!Array.isArray(s.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const f=getWLengths(n,o);function c(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(ce,Ze,se){const{x:vt,y:ur}=Ze.toAffine(),ue=n.toBytes(vt);if(_abool2(se,"isCompressed"),se){c();const bt=!n.isOdd(ur);return concatBytes$2(pprefix(bt),ue)}else return concatBytes$2(Uint8Array.of(4),ue,n.toBytes(ur))}function p(ce){_abytes2(ce,void 0,"Point");const{publicKey:Ze,publicKeyUncompressed:se}=f,vt=ce.length,ur=ce[0],ue=ce.subarray(1);if(vt===Ze&&(ur===2||ur===3)){const bt=n.fromBytes(ue);if(!n.isValid(bt))throw new Error("bad point: is not on curve, wrong x");const L=b(bt);let _;try{_=n.sqrt(L)}catch(Ye){const rn=Ye instanceof Error?": "+Ye.message:"";throw new Error("bad point: is not on curve, sqrt error"+rn)}c();const F=n.isOdd(_);return(ur&1)===1!==F&&(_=n.neg(_)),{x:bt,y:_}}else if(vt===se&&ur===4){const bt=n.BYTES,L=n.fromBytes(ue.subarray(0,bt)),_=n.fromBytes(ue.subarray(bt,bt*2));if(!w(L,_))throw new Error("bad point: is not on curve");return{x:L,y:_}}else throw new Error(`bad point: got length ${vt}, expected compressed=${Ze} or uncompressed=${se}`)}const h=t.toBytes||d,y=t.fromBytes||p;function b(ce){const Ze=n.sqr(ce),se=n.mul(Ze,ce);return n.add(n.add(se,n.mul(ce,i.a)),i.b)}function w(ce,Ze){const se=n.sqr(Ze),vt=b(ce);return n.eql(se,vt)}if(!w(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const S=n.mul(n.pow(i.a,_3n$2),_4n$2),E=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(S,E)))throw new Error("bad curve params: a or b");function B(ce,Ze,se=!1){if(!n.isValid(Ze)||se&&n.is0(Ze))throw new Error(`bad point coordinate ${ce}`);return Ze}function ae(ce){if(!(ce instanceof kt))throw new Error("ProjectivePoint expected")}function W(ce){if(!s||!s.basises)throw new Error("no endo");return _splitEndoScalar(ce,s.basises,o.ORDER)}const J=memoized$1((ce,Ze)=>{const{X:se,Y:vt,Z:ur}=ce;if(n.eql(ur,n.ONE))return{x:se,y:vt};const ue=ce.is0();Ze==null&&(Ze=ue?n.ONE:n.inv(ur));const bt=n.mul(se,Ze),L=n.mul(vt,Ze),_=n.mul(ur,Ze);if(ue)return{x:n.ZERO,y:n.ZERO};if(!n.eql(_,n.ONE))throw new Error("invZ was invalid");return{x:bt,y:L}}),ve=memoized$1(ce=>{if(ce.is0()){if(t.allowInfinityPoint&&!n.is0(ce.Y))return;throw new Error("bad point: ZERO")}const{x:Ze,y:se}=ce.toAffine();if(!n.isValid(Ze)||!n.isValid(se))throw new Error("bad point: x or y not field elements");if(!w(Ze,se))throw new Error("bad point: equation left != right");if(!ce.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function Qe(ce,Ze,se,vt,ur){return se=new kt(n.mul(se.X,ce),se.Y,se.Z),Ze=negateCt(vt,Ze),se=negateCt(ur,se),Ze.add(se)}class kt{constructor(Ze,se,vt){this.X=B("x",Ze),this.Y=B("y",se,!0),this.Z=B("z",vt),Object.freeze(this)}static CURVE(){return i}static fromAffine(Ze){const{x:se,y:vt}=Ze||{};if(!Ze||!n.isValid(se)||!n.isValid(vt))throw new Error("invalid affine point");if(Ze instanceof kt)throw new Error("projective point not allowed");return n.is0(se)&&n.is0(vt)?kt.ZERO:new kt(se,vt,n.ONE)}static fromBytes(Ze){const se=kt.fromAffine(y(_abytes2(Ze,void 0,"point")));return se.assertValidity(),se}static fromHex(Ze){return kt.fromBytes(ensureBytes$1("pointHex",Ze))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(Ze=8,se=!0){return sr.createCache(this,Ze),se||this.multiply(_3n$2),this}assertValidity(){ve(this)}hasEvenY(){const{y:Ze}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(Ze)}equals(Ze){ae(Ze);const{X:se,Y:vt,Z:ur}=this,{X:ue,Y:bt,Z:L}=Ze,_=n.eql(n.mul(se,L),n.mul(ue,ur)),F=n.eql(n.mul(vt,L),n.mul(bt,ur));return _&&F}negate(){return new kt(this.X,n.neg(this.Y),this.Z)}double(){const{a:Ze,b:se}=i,vt=n.mul(se,_3n$2),{X:ur,Y:ue,Z:bt}=this;let L=n.ZERO,_=n.ZERO,F=n.ZERO,k=n.mul(ur,ur),Ye=n.mul(ue,ue),rn=n.mul(bt,bt),ii=n.mul(ur,ue);return ii=n.add(ii,ii),F=n.mul(ur,bt),F=n.add(F,F),L=n.mul(Ze,F),_=n.mul(vt,rn),_=n.add(L,_),L=n.sub(Ye,_),_=n.add(Ye,_),_=n.mul(L,_),L=n.mul(ii,L),F=n.mul(vt,F),rn=n.mul(Ze,rn),ii=n.sub(k,rn),ii=n.mul(Ze,ii),ii=n.add(ii,F),F=n.add(k,k),k=n.add(F,k),k=n.add(k,rn),k=n.mul(k,ii),_=n.add(_,k),rn=n.mul(ue,bt),rn=n.add(rn,rn),k=n.mul(rn,ii),L=n.sub(L,k),F=n.mul(rn,Ye),F=n.add(F,F),F=n.add(F,F),new kt(L,_,F)}add(Ze){ae(Ze);const{X:se,Y:vt,Z:ur}=this,{X:ue,Y:bt,Z:L}=Ze;let _=n.ZERO,F=n.ZERO,k=n.ZERO;const Ye=i.a,rn=n.mul(i.b,_3n$2);let ii=n.mul(se,ue),ai=n.mul(vt,bt),ni=n.mul(ur,L),ri=n.add(se,vt),ui=n.add(ue,bt);ri=n.mul(ri,ui),ui=n.add(ii,ai),ri=n.sub(ri,ui),ui=n.add(se,ur);let lr=n.add(ue,L);return ui=n.mul(ui,lr),lr=n.add(ii,ni),ui=n.sub(ui,lr),lr=n.add(vt,ur),_=n.add(bt,L),lr=n.mul(lr,_),_=n.add(ai,ni),lr=n.sub(lr,_),k=n.mul(Ye,ui),_=n.mul(rn,ni),k=n.add(_,k),_=n.sub(ai,k),k=n.add(ai,k),F=n.mul(_,k),ai=n.add(ii,ii),ai=n.add(ai,ii),ni=n.mul(Ye,ni),ui=n.mul(rn,ui),ai=n.add(ai,ni),ni=n.sub(ii,ni),ni=n.mul(Ye,ni),ui=n.add(ui,ni),ii=n.mul(ai,ui),F=n.add(F,ii),ii=n.mul(lr,ui),_=n.mul(ri,_),_=n.sub(_,ii),ii=n.mul(ri,ai),k=n.mul(lr,k),k=n.add(k,ii),new kt(_,F,k)}subtract(Ze){return this.add(Ze.negate())}is0(){return this.equals(kt.ZERO)}multiply(Ze){const{endo:se}=t;if(!o.isValidNot0(Ze))throw new Error("invalid scalar: out of range");let vt,ur;const ue=bt=>sr.cached(this,bt,L=>normalizeZ(kt,L));if(se){const{k1neg:bt,k1:L,k2neg:_,k2:F}=W(Ze),{p:k,f:Ye}=ue(L),{p:rn,f:ii}=ue(F);ur=Ye.add(ii),vt=Qe(se.beta,k,rn,bt,_)}else{const{p:bt,f:L}=ue(Ze);vt=bt,ur=L}return normalizeZ(kt,[vt,ur])[0]}multiplyUnsafe(Ze){const{endo:se}=t,vt=this;if(!o.isValid(Ze))throw new Error("invalid scalar: out of range");if(Ze===_0n$8||vt.is0())return kt.ZERO;if(Ze===_1n$9)return vt;if(sr.hasCache(this))return this.multiply(Ze);if(se){const{k1neg:ur,k1:ue,k2neg:bt,k2:L}=W(Ze),{p1:_,p2:F}=mulEndoUnsafe(kt,vt,ue,L);return Qe(se.beta,_,F,ur,bt)}else return sr.unsafe(vt,Ze)}multiplyAndAddUnsafe(Ze,se,vt){const ur=this.multiplyUnsafe(se).add(Ze.multiplyUnsafe(vt));return ur.is0()?void 0:ur}toAffine(Ze){return J(this,Ze)}isTorsionFree(){const{isTorsionFree:Ze}=t;return u===_1n$9?!0:Ze?Ze(kt,this):sr.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:Ze}=t;return u===_1n$9?this:Ze?Ze(kt,this):this.multiplyUnsafe(u)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}toBytes(Ze=!0){return _abool2(Ze,"isCompressed"),this.assertValidity(),h(kt,this,Ze)}toHex(Ze=!0){return bytesToHex$4(this.toBytes(Ze))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(Ze=!0){return this.toBytes(Ze)}_setWindowSize(Ze){this.precompute(Ze)}static normalizeZ(Ze){return normalizeZ(kt,Ze)}static msm(Ze,se){return pippenger$1(kt,o,Ze,se)}static fromPrivateKey(Ze){return kt.BASE.multiply(_normFnElement(o,Ze))}}kt.BASE=new kt(i.Gx,i.Gy,n.ONE),kt.ZERO=new kt(n.ZERO,n.ONE,n.ZERO),kt.Fp=n,kt.Fn=o;const nr=o.BITS,sr=new wNAF$1(kt,t.endo?Math.ceil(nr/2):nr);return kt.BASE.precompute(8),kt}function pprefix(e){return Uint8Array.of(e?2:3)}function getWLengths(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function ecdh(e,t={}){const{Fn:r}=e,n=t.randomBytes||randomBytes,o=Object.assign(getWLengths(e.Fp,r),{seed:getMinHashLength$1(r.ORDER)});function i(h){try{return!!_normFnElement(r,h)}catch{return!1}}function u(h,y){const{publicKey:b,publicKeyUncompressed:w}=o;try{const S=h.length;return y===!0&&S!==b||y===!1&&S!==w?!1:!!e.fromBytes(h)}catch{return!1}}function a(h=n(o.seed)){return mapHashToField$1(_abytes2(h,o.seed,"seed"),r.ORDER)}function s(h,y=!0){return e.BASE.multiply(_normFnElement(r,h)).toBytes(y)}function f(h){const y=a(h);return{secretKey:y,publicKey:s(y)}}function c(h){if(typeof h=="bigint")return!1;if(h instanceof e)return!0;const{secretKey:y,publicKey:b,publicKeyUncompressed:w}=o;if(r.allowedLengths||y===b)return;const S=ensureBytes$1("key",h).length;return S===b||S===w}function d(h,y,b=!0){if(c(h)===!0)throw new Error("first arg must be private key");if(c(y)===!1)throw new Error("second arg must be public key");const w=_normFnElement(r,h);return e.fromHex(y).multiply(w).toBytes(b)}return Object.freeze({getPublicKey:s,getSharedSecret:d,keygen:f,Point:e,utils:{isValidSecretKey:i,isValidPublicKey:u,randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:h=>_normFnElement(r,h),precompute(h=8,y=e.BASE){return y.precompute(h,!1)}},lengths:o})}function ecdsa(e,t,r={}){ahash(t),_validateObject(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||randomBytes,o=r.hmac||((se,...vt)=>hmac$1(t,se,concatBytes$2(...vt))),{Fp:i,Fn:u}=e,{ORDER:a,BITS:s}=u,{keygen:f,getPublicKey:c,getSharedSecret:d,utils:p,lengths:h}=ecdh(e,r),y={prehash:!1,lowS:typeof r.lowS=="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},b="compact";function w(se){const vt=a>>_1n$9;return se>vt}function S(se,vt){if(!u.isValidNot0(vt))throw new Error(`invalid signature ${se}: out of range 1..Point.Fn.ORDER`);return vt}function E(se,vt){validateSigFormat(vt);const ur=h.signature,ue=vt==="compact"?ur:vt==="recovered"?ur+1:void 0;return _abytes2(se,ue,`${vt} signature`)}class B{constructor(vt,ur,ue){this.r=S("r",vt),this.s=S("s",ur),ue!=null&&(this.recovery=ue),Object.freeze(this)}static fromBytes(vt,ur=b){E(vt,ur);let ue;if(ur==="der"){const{r:F,s:k}=DER$1.toSig(_abytes2(vt));return new B(F,k)}ur==="recovered"&&(ue=vt[0],ur="compact",vt=vt.subarray(1));const bt=u.BYTES,L=vt.subarray(0,bt),_=vt.subarray(bt,bt*2);return new B(u.fromBytes(L),u.fromBytes(_),ue)}static fromHex(vt,ur){return this.fromBytes(hexToBytes$2(vt),ur)}addRecoveryBit(vt){return new B(this.r,this.s,vt)}recoverPublicKey(vt){const ur=i.ORDER,{r:ue,s:bt,recovery:L}=this;if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");if(a*_2n$7<ur&&L>1)throw new Error("recovery id is ambiguous for h>1 curve");const F=L===2||L===3?ue+a:ue;if(!i.isValid(F))throw new Error("recovery id 2 or 3 invalid");const k=i.toBytes(F),Ye=e.fromBytes(concatBytes$2(pprefix((L&1)===0),k)),rn=u.inv(F),ii=W(ensureBytes$1("msgHash",vt)),ai=u.create(-ii*rn),ni=u.create(bt*rn),ri=e.BASE.multiplyUnsafe(ai).add(Ye.multiplyUnsafe(ni));if(ri.is0())throw new Error("point at infinify");return ri.assertValidity(),ri}hasHighS(){return w(this.s)}toBytes(vt=b){if(validateSigFormat(vt),vt==="der")return hexToBytes$2(DER$1.hexFromSig(this));const ur=u.toBytes(this.r),ue=u.toBytes(this.s);if(vt==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return concatBytes$2(Uint8Array.of(this.recovery),ur,ue)}return concatBytes$2(ur,ue)}toHex(vt){return bytesToHex$4(this.toBytes(vt))}assertValidity(){}static fromCompact(vt){return B.fromBytes(ensureBytes$1("sig",vt),"compact")}static fromDER(vt){return B.fromBytes(ensureBytes$1("sig",vt),"der")}normalizeS(){return this.hasHighS()?new B(this.r,u.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return bytesToHex$4(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return bytesToHex$4(this.toBytes("compact"))}}const ae=r.bits2int||function(vt){if(vt.length>8192)throw new Error("input is too large");const ur=bytesToNumberBE$1(vt),ue=vt.length*8-s;return ue>0?ur>>BigInt(ue):ur},W=r.bits2int_modN||function(vt){return u.create(ae(vt))},J=bitMask$1(s);function ve(se){return aInRange$1("num < 2^"+s,se,_0n$8,J),u.toBytes(se)}function Qe(se,vt){return _abytes2(se,void 0,"message"),vt?_abytes2(t(se),void 0,"prehashed message"):se}function kt(se,vt,ur){if(["recovered","canonical"].some(ai=>ai in ur))throw new Error("sign() legacy options not supported");const{lowS:ue,prehash:bt,extraEntropy:L}=validateSigOpts(ur,y);se=Qe(se,bt);const _=W(se),F=_normFnElement(u,vt),k=[ve(F),ve(_)];if(L!=null&&L!==!1){const ai=L===!0?n(h.secretKey):L;k.push(ensureBytes$1("extraEntropy",ai))}const Ye=concatBytes$2(...k),rn=_;function ii(ai){const ni=ae(ai);if(!u.isValidNot0(ni))return;const ri=u.inv(ni),ui=e.BASE.multiply(ni).toAffine(),lr=u.create(ui.x);if(lr===_0n$8)return;const ar=u.create(ri*u.create(rn+lr*F));if(ar===_0n$8)return;let jr=(ui.x===lr?0:2)|Number(ui.y&_1n$9),ci=ar;return ue&&w(ar)&&(ci=u.neg(ar),jr^=1),new B(lr,ci,jr)}return{seed:Ye,k2sig:ii}}function nr(se,vt,ur={}){se=ensureBytes$1("message",se);const{seed:ue,k2sig:bt}=kt(se,vt,ur);return createHmacDrbg$1(t.outputLen,u.BYTES,o)(ue,bt)}function sr(se){let vt;const ur=typeof se=="string"||isBytes$4(se),ue=!ur&&se!==null&&typeof se=="object"&&typeof se.r=="bigint"&&typeof se.s=="bigint";if(!ur&&!ue)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(ue)vt=new B(se.r,se.s);else if(ur){try{vt=B.fromBytes(ensureBytes$1("sig",se),"der")}catch(bt){if(!(bt instanceof DER$1.Err))throw bt}if(!vt)try{vt=B.fromBytes(ensureBytes$1("sig",se),"compact")}catch{return!1}}return vt||!1}function ce(se,vt,ur,ue={}){const{lowS:bt,prehash:L,format:_}=validateSigOpts(ue,y);if(ur=ensureBytes$1("publicKey",ur),vt=Qe(ensureBytes$1("message",vt),L),"strict"in ue)throw new Error("options.strict was renamed to lowS");const F=_===void 0?sr(se):B.fromBytes(ensureBytes$1("sig",se),_);if(F===!1)return!1;try{const k=e.fromBytes(ur);if(bt&&F.hasHighS())return!1;const{r:Ye,s:rn}=F,ii=W(vt),ai=u.inv(rn),ni=u.create(ii*ai),ri=u.create(Ye*ai),ui=e.BASE.multiplyUnsafe(ni).add(k.multiplyUnsafe(ri));return ui.is0()?!1:u.create(ui.x)===Ye}catch{return!1}}function Ze(se,vt,ur={}){const{prehash:ue}=validateSigOpts(ur,y);return vt=Qe(vt,ue),B.fromBytes(se,"recovered").recoverPublicKey(vt).toBytes()}return Object.freeze({keygen:f,getPublicKey:c,getSharedSecret:d,utils:p,lengths:h,Point:e,sign:nr,verify:ce,recoverPublicKey:Ze,Signature:B,hash:t})}function _weierstrass_legacy_opts_to_new(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(u=>Math.ceil(u/2)))):void 0;const o=Field$1(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),i={Fp:r,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:i}}function _ecdsa_legacy_opts_to_new(e){const{CURVE:t,curveOpts:r}=_weierstrass_legacy_opts_to_new(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function _ecdsa_new_output_to_legacy(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,nLength$1(r.Fn.ORDER,r.Fn.BITS))})}function weierstrass$1(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=_ecdsa_legacy_opts_to_new(e),i=weierstrassN(t,r),u=ecdsa(i,n,o);return _ecdsa_new_output_to_legacy(e,u)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function createCurve$1(e,t){const r=n=>weierstrass$1({...e,hash:n});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1_CURVE={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},secp256k1_ENDO={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},_2n$6=BigInt(2);function sqrtMod$1(e){const t=secp256k1_CURVE.p,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),u=BigInt(23),a=BigInt(44),s=BigInt(88),f=e*e*e%t,c=f*f*e%t,d=pow2$1(c,r,t)*c%t,p=pow2$1(d,r,t)*c%t,h=pow2$1(p,_2n$6,t)*f%t,y=pow2$1(h,o,t)*h%t,b=pow2$1(y,i,t)*y%t,w=pow2$1(b,a,t)*b%t,S=pow2$1(w,s,t)*w%t,E=pow2$1(S,a,t)*b%t,B=pow2$1(E,r,t)*c%t,ae=pow2$1(B,u,t)*y%t,W=pow2$1(ae,n,t)*f%t,J=pow2$1(W,_2n$6,t);if(!Fpk1$1.eql(Fpk1$1.sqr(J),e))throw new Error("Cannot find square root");return J}const Fpk1$1=Field$1(secp256k1_CURVE.p,{sqrt:sqrtMod$1}),secp256k1$3=createCurve$1({...secp256k1_CURVE,Fp:Fpk1$1,lowS:!0,endo:secp256k1_ENDO},sha256$4);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes$3(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function isArrayOf(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(r=>typeof r=="string"):t.every(r=>Number.isSafeInteger(r)):!1}function astr(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function anumber(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function aArr(e){if(!Array.isArray(e))throw new Error("array expected")}function astrArr(e,t){if(!isArrayOf(!0,t))throw new Error(`${e}: array of strings expected`)}function anumArr(e,t){if(!isArrayOf(!1,t))throw new Error(`${e}: array of numbers expected`)}function chain(...e){const t=i=>i,r=(i,u)=>a=>i(u(a)),n=e.map(i=>i.encode).reduceRight(r,t),o=e.map(i=>i.decode).reduce(r,t);return{encode:n,decode:o}}function alphabet(e){const t=typeof e=="string"?e.split(""):e,r=t.length;astrArr("alphabet",t);const n=new Map(t.map((o,i)=>[o,i]));return{encode:o=>(aArr(o),o.map(i=>{if(!Number.isSafeInteger(i)||i<0||i>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${e}`);return t[i]})),decode:o=>(aArr(o),o.map(i=>{astr("alphabet.decode",i);const u=n.get(i);if(u===void 0)throw new Error(`Unknown letter: "${i}". Allowed: ${e}`);return u}))}}function join(e=""){return astr("join",e),{encode:t=>(astrArr("join.decode",t),t.join(e)),decode:t=>(astr("join.decode",t),t.split(e))}}function convertRadix(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(aArr(e),!e.length)return[];let n=0;const o=[],i=Array.from(e,a=>{if(anumber(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),u=i.length;for(;;){let a=0,s=!0;for(let f=n;f<u;f++){const c=i[f],d=t*a,p=d+c;if(!Number.isSafeInteger(p)||d/t!==a||p-c!==d)throw new Error("convertRadix: carry overflow");const h=p/r;a=p%r;const y=Math.floor(h);if(i[f]=y,!Number.isSafeInteger(y)||y*r+a!==p)throw new Error("convertRadix: carry overflow");if(s)y?s=!1:n=f;else continue}if(o.push(a),s)break}for(let a=0;a<e.length-1&&e[a]===0;a++)o.push(0);return o.reverse()}function radix(e){anumber(e);const t=2**8;return{encode:r=>{if(!isBytes$3(r))throw new Error("radix.encode input should be Uint8Array");return convertRadix(Array.from(r),t,e)},decode:r=>(anumArr("radix.decode",r),Uint8Array.from(convertRadix(r,e,t)))}}const genBase58=e=>chain(radix(58),alphabet(e),join("")),base58=genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),version$2="2.37.3";let errorConfig={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${version$2}`};class BaseError extends Error{constructor(t,r={}){const n=r.cause instanceof BaseError?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof BaseError&&r.cause.docsPath||r.docsPath,i=errorConfig.getDocsUrl?.({...r,docsPath:o}),u=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...errorConfig.version?[`Version: ${errorConfig.version}`]:[]].join(`
39
+ `);super(u,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=version$2}walk(t){return walk(this,t)}}function walk(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?walk(e.cause,t):t?null:e}class IntegerOutOfRangeError extends BaseError{constructor({max:t,min:r,signed:n,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class InvalidBytesBooleanError extends BaseError{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class SizeOverflowError extends BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function isHex$1(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function size$1(e){return isHex$1(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function trim(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let o=0;o<r.length-1&&r[t==="left"?o:r.length-o-1].toString()==="0";o++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}class SliceOffsetOutOfBoundsError extends BaseError{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}class InvalidBytesLengthError extends BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}function pad(e,{dir:t,size:r=32}={}){return typeof e=="string"?padHex(e,{dir:t,size:r}):padBytes(e,{dir:t,size:r})}function padHex(e,{dir:t,size:r=32}={}){if(r===null)return e;const n=e.replace("0x","");if(n.length>r*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function padBytes(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new SizeExceedsPaddingSizeError({size:e.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let o=0;o<r;o++){const i=t==="right";n[i?o:r-o-1]=e[i?o:e.length-o-1]}return n}const hexes$1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function toHex(e,t={}){return typeof e=="number"||typeof e=="bigint"?numberToHex(e,t):typeof e=="string"?stringToHex(e,t):typeof e=="boolean"?boolToHex(e,t):bytesToHex$3(e,t)}function boolToHex(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(assertSize(r,{size:t.size}),pad(r,{size:t.size})):r}function bytesToHex$3(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=hexes$1[e[o]];const n=`0x${r}`;return typeof t.size=="number"?(assertSize(n,{size:t.size}),pad(n,{dir:"right",size:t.size})):n}function numberToHex(e,t={}){const{signed:r,size:n}=t,o=BigInt(e);let i;n?r?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const u=typeof i=="bigint"&&r?-i-1n:0;if(i&&o>i||o<u){const s=typeof e=="bigint"?"n":"";throw new IntegerOutOfRangeError({max:i?`${i}${s}`:void 0,min:`${u}${s}`,signed:r,size:n,value:`${e}${s}`})}const a=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?pad(a,{size:n}):a}const encoder$2=new TextEncoder;function stringToHex(e,t={}){const r=encoder$2.encode(e);return bytesToHex$3(r,t)}const encoder$1=new TextEncoder;function toBytes$1(e,t={}){return typeof e=="number"||typeof e=="bigint"?numberToBytes(e,t):typeof e=="boolean"?boolToBytes(e,t):isHex$1(e)?hexToBytes$1(e,t):stringToBytes(e,t)}function boolToBytes(e,t={}){const r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(assertSize(r,{size:t.size}),pad(r,{size:t.size})):r}const charCodeMap$1={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16$1(e){if(e>=charCodeMap$1.zero&&e<=charCodeMap$1.nine)return e-charCodeMap$1.zero;if(e>=charCodeMap$1.A&&e<=charCodeMap$1.F)return e-(charCodeMap$1.A-10);if(e>=charCodeMap$1.a&&e<=charCodeMap$1.f)return e-(charCodeMap$1.a-10)}function hexToBytes$1(e,t={}){let r=e;t.size&&(assertSize(r,{size:t.size}),r=pad(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const o=n.length/2,i=new Uint8Array(o);for(let u=0,a=0;u<o;u++){const s=charCodeToBase16$1(n.charCodeAt(a++)),f=charCodeToBase16$1(n.charCodeAt(a++));if(s===void 0||f===void 0)throw new BaseError(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);i[u]=s*16+f}return i}function numberToBytes(e,t){const r=numberToHex(e,t);return hexToBytes$1(r)}function stringToBytes(e,t={}){const r=encoder$1.encode(e);return typeof t.size=="number"?(assertSize(r,{size:t.size}),pad(r,{dir:"right",size:t.size})):r}function assertSize(e,{size:t}){if(size$1(e)>t)throw new SizeOverflowError({givenSize:size$1(e),maxSize:t})}function hexToBigInt(e,t={}){const{signed:r}=t;t.size&&assertSize(e,{size:t.size});const n=BigInt(e);if(!r)return n;const o=(e.length-2)/2,i=(1n<<BigInt(o)*8n-1n)-1n;return n<=i?n:n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function hexToNumber$2(e,t={}){return Number(hexToBigInt(e,t))}async function getTransactionCount(e,{address:t,blockTag:r="latest",blockNumber:n}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof n=="bigint"?numberToHex(n):r]},{dedupe:!!n});return hexToNumber$2(o)}class LruMap extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$7=BigInt(0),_1n$8=BigInt(1);function isBytes$2(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function abytes(e){if(!isBytes$2(e))throw new Error("Uint8Array expected")}function abool(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function numberToHexUnpadded(e){const t=e.toString(16);return t.length&1?"0"+t:t}function hexToNumber$1(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?_0n$7:BigInt("0x"+e)}const hasHexBuiltin=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",hexes=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bytesToHex$2(e){if(abytes(e),hasHexBuiltin)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=hexes[e[r]];return t}const asciis={_0:48,_9:57,A:65,F:70,a:97,f:102};function asciiToBase16(e){if(e>=asciis._0&&e<=asciis._9)return e-asciis._0;if(e>=asciis.A&&e<=asciis.F)return e-(asciis.A-10);if(e>=asciis.a&&e<=asciis.f)return e-(asciis.a-10)}function hexToBytes(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(hasHexBuiltin)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const u=asciiToBase16(e.charCodeAt(i)),a=asciiToBase16(e.charCodeAt(i+1));if(u===void 0||a===void 0){const s=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+i)}n[o]=u*16+a}return n}function bytesToNumberBE(e){return hexToNumber$1(bytesToHex$2(e))}function bytesToNumberLE(e){return abytes(e),hexToNumber$1(bytesToHex$2(Uint8Array.from(e).reverse()))}function numberToBytesBE(e,t){return hexToBytes(e.toString(16).padStart(t*2,"0"))}function numberToBytesLE(e,t){return numberToBytesBE(e,t).reverse()}function ensureBytes(e,t,r){let n;if(typeof t=="string")try{n=hexToBytes(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(isBytes$2(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function concatBytes$1(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];abytes(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}const isPosBig=e=>typeof e=="bigint"&&_0n$7<=e;function inRange(e,t,r){return isPosBig(e)&&isPosBig(t)&&isPosBig(r)&&t<=e&&e<r}function aInRange(e,t,r,n){if(!inRange(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function bitLen(e){let t;for(t=0;e>_0n$7;e>>=_1n$8,t+=1);return t}const bitMask=e=>(_1n$8<<BigInt(e))-_1n$8,u8n=e=>new Uint8Array(e),u8fr=e=>Uint8Array.from(e);function createHmacDrbg(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=u8n(e),o=u8n(e),i=0;const u=()=>{n.fill(1),o.fill(0),i=0},a=(...d)=>r(o,n,...d),s=(d=u8n(0))=>{o=a(u8fr([0]),d),n=a(),d.length!==0&&(o=a(u8fr([1]),d),n=a())},f=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const p=[];for(;d<t;){n=a();const h=n.slice();p.push(h),d+=n.length}return concatBytes$1(...p)};return(d,p)=>{u(),s(d);let h;for(;!(h=p(f()));)s();return u(),h}}const validatorFns={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||isBytes$2(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function validateObject(e,t,r={}){const n=(o,i,u)=>{const a=validatorFns[i];if(typeof a!="function")throw new Error("invalid validator function");const s=e[o];if(!(u&&s===void 0)&&!a(s,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+s)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}function memoized(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$7=BigInt(1),_2n$5=BigInt(2),_3n$1=BigInt(3),_4n$1=BigInt(4),_5n$1=BigInt(5),_8n$2=BigInt(8);function mod(e,t){const r=e%t;return r>=_0n$6?r:t+r}function pow2(e,t,r){let n=e;for(;t-- >_0n$6;)n*=n,n%=r;return n}function invert(e,t){if(e===_0n$6)throw new Error("invert: expected non-zero number");if(t<=_0n$6)throw new Error("invert: expected positive modulus, got "+t);let r=mod(e,t),n=t,o=_0n$6,i=_1n$7;for(;r!==_0n$6;){const a=n/r,s=n%r,f=o-i*a;n=r,r=s,o=i,i=f}if(n!==_1n$7)throw new Error("invert: does not exist");return mod(o,t)}function sqrt3mod4(e,t){const r=(e.ORDER+_1n$7)/_4n$1,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function sqrt5mod8(e,t){const r=(e.ORDER-_5n$1)/_8n$2,n=e.mul(t,_2n$5),o=e.pow(n,r),i=e.mul(t,o),u=e.mul(e.mul(i,_2n$5),o),a=e.mul(i,e.sub(u,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function tonelliShanks(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-_1n$7,r=0;for(;t%_2n$5===_0n$6;)t/=_2n$5,r++;let n=_2n$5;const o=Field(e);for(;FpLegendre(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return sqrt3mod4;let i=o.pow(n,t);const u=(t+_1n$7)/_2n$5;return function(s,f){if(s.is0(f))return f;if(FpLegendre(s,f)!==1)throw new Error("Cannot find square root");let c=r,d=s.mul(s.ONE,i),p=s.pow(f,t),h=s.pow(f,u);for(;!s.eql(p,s.ONE);){if(s.is0(p))return s.ZERO;let y=1,b=s.sqr(p);for(;!s.eql(b,s.ONE);)if(y++,b=s.sqr(b),y===c)throw new Error("Cannot find square root");const w=_1n$7<<BigInt(c-y-1),S=s.pow(d,w);c=y,d=s.sqr(S),p=s.mul(p,d),h=s.mul(h,S)}return h}}function FpSqrt(e){return e%_4n$1===_3n$1?sqrt3mod4:e%_8n$2===_5n$1?sqrt5mod8:tonelliShanks(e)}const FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=FIELD_FIELDS.reduce((n,o)=>(n[o]="function",n),t);return validateObject(e,r)}function FpPow(e,t,r){if(r<_0n$6)throw new Error("invalid exponent, negatives unsupported");if(r===_0n$6)return e.ONE;if(r===_1n$7)return t;let n=e.ONE,o=t;for(;r>_0n$6;)r&_1n$7&&(n=e.mul(n,o)),o=e.sqr(o),r>>=_1n$7;return n}function FpInvertBatch(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((u,a,s)=>e.is0(a)?u:(n[s]=u,e.mul(u,a)),e.ONE),i=e.inv(o);return t.reduceRight((u,a,s)=>e.is0(a)?u:(n[s]=e.mul(u,n[s]),e.mul(u,a)),i),n}function FpLegendre(e,t){const r=(e.ORDER-_1n$7)/_2n$5,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),u=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!u)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function nLength(e,t){t!==void 0&&anumber$1(t);const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Field(e,t,r=!1,n={}){if(e<=_0n$6)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=nLength(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:bitMask(o),ZERO:_0n$6,ONE:_1n$7,create:s=>mod(s,e),isValid:s=>{if(typeof s!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof s);return _0n$6<=s&&s<e},is0:s=>s===_0n$6,isOdd:s=>(s&_1n$7)===_1n$7,neg:s=>mod(-s,e),eql:(s,f)=>s===f,sqr:s=>mod(s*s,e),add:(s,f)=>mod(s+f,e),sub:(s,f)=>mod(s-f,e),mul:(s,f)=>mod(s*f,e),pow:(s,f)=>FpPow(a,s,f),div:(s,f)=>mod(s*invert(f,e),e),sqrN:s=>s*s,addN:(s,f)=>s+f,subN:(s,f)=>s-f,mulN:(s,f)=>s*f,inv:s=>invert(s,e),sqrt:n.sqrt||(s=>(u||(u=FpSqrt(e)),u(a,s))),toBytes:s=>r?numberToBytesLE(s,i):numberToBytesBE(s,i),fromBytes:s=>{if(s.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+s.length);return r?bytesToNumberLE(s):bytesToNumberBE(s)},invertBatch:s=>FpInvertBatch(a,s),cmov:(s,f,c)=>c?f:s});return Object.freeze(a)}function getFieldBytesLength(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function getMinHashLength(e){const t=getFieldBytesLength(e);return t+Math.ceil(t/2)}function mapHashToField(e,t,r=!1){const n=e.length,o=getFieldBytesLength(t),i=getMinHashLength(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const u=r?bytesToNumberLE(e):bytesToNumberBE(e),a=mod(u,t-_1n$7)+_1n$7;return r?numberToBytesLE(a,o):numberToBytesBE(a,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$6=BigInt(1);function constTimeNegate(e,t){const r=t.negate();return e?r:t}function validateW(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function calcWOpts(e,t){validateW(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=bitMask(e),u=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:u}}function calcOffsets(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:u}=r;let a=Number(e&o),s=e>>u;a>n&&(a-=i,s+=_1n$6);const f=t*n,c=f+Math.abs(a)-1,d=a===0,p=a<0,h=t%2!==0;return{nextN:s,offset:c,isZero:d,isNeg:p,isNegF:h,offsetF:f}}function validateMSMPoints(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function validateMSMScalars(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const pointPrecomputes=new WeakMap,pointWindowSizes=new WeakMap;function getW(e){return pointWindowSizes.get(e)||1}function wNAF(e,t){return{constTimeNegate,hasPrecomputes(r){return getW(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>_0n$5;)n&_1n$6&&(o=o.add(i)),i=i.double(),n>>=_1n$6;return o},precomputeWindow(r,n){const{windows:o,windowSize:i}=calcWOpts(n,t),u=[];let a=r,s=a;for(let f=0;f<o;f++){s=a,u.push(s);for(let c=1;c<i;c++)s=s.add(a),u.push(s);a=s.double()}return u},wNAF(r,n,o){let i=e.ZERO,u=e.BASE;const a=calcWOpts(r,t);for(let s=0;s<a.windows;s++){const{nextN:f,offset:c,isZero:d,isNeg:p,isNegF:h,offsetF:y}=calcOffsets(o,s,a);o=f,d?u=u.add(constTimeNegate(h,n[y])):i=i.add(constTimeNegate(p,n[c]))}return{p:i,f:u}},wNAFUnsafe(r,n,o,i=e.ZERO){const u=calcWOpts(r,t);for(let a=0;a<u.windows&&o!==_0n$5;a++){const{nextN:s,offset:f,isZero:c,isNeg:d}=calcOffsets(o,a,u);if(o=s,!c){const p=n[f];i=i.add(d?p.negate():p)}}return i},getPrecomputes(r,n,o){let i=pointPrecomputes.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&pointPrecomputes.set(n,o(i))),i},wNAFCached(r,n,o){const i=getW(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){const u=getW(r);return u===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(u,this.getPrecomputes(u,r,o),n,i)},setWindowSize(r,n){validateW(n,t),pointWindowSizes.set(r,n),pointPrecomputes.delete(r)}}}function pippenger(e,t,r,n){validateMSMPoints(r,e),validateMSMScalars(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const u=e.ZERO,a=bitLen(BigInt(o));let s=1;a>12?s=a-3:a>4?s=a-2:a>0&&(s=2);const f=bitMask(s),c=new Array(Number(f)+1).fill(u),d=Math.floor((t.BITS-1)/s)*s;let p=u;for(let h=d;h>=0;h-=s){c.fill(u);for(let b=0;b<i;b++){const w=n[b],S=Number(w>>BigInt(h)&f);c[S]=c[S].add(r[b])}let y=u;for(let b=c.length-1,w=u;b>0;b--)w=w.add(c[b]),y=y.add(w);if(p=p.add(y),h!==0)for(let b=0;b<s;b++)p=p.double()}return p}function validateBasic(e){return validateField(e.Fp),validateObject(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validateSigVerOpts(e){e.lowS!==void 0&&abool("lowS",e.lowS),e.prehash!==void 0&&abool("prehash",e.prehash)}function validatePointOpts(e){const t=validateBasic(e);validateObject(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class DERErr extends Error{constructor(t=""){super(t)}}const DER={Err:DERErr,_tlv:{encode:(e,t)=>{const{Err:r}=DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=numberToHexUnpadded(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?numberToHexUnpadded(o.length/2|128):"";return numberToHexUnpadded(e)+i+o+t},decode(e,t){const{Err:r}=DER;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++],i=!!(o&128);let u=0;if(!i)u=o;else{const s=o&127;if(!s)throw new r("tlv.decode(long): indefinite length not supported");if(s>4)throw new r("tlv.decode(long): byte length is too big");const f=t.subarray(n,n+s);if(f.length!==s)throw new r("tlv.decode: length bytes not complete");if(f[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const c of f)u=u<<8|c;if(n+=s,u<128)throw new r("tlv.decode(long): not minimal encoding")}const a=t.subarray(n,n+u);if(a.length!==u)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+u)}}},_int:{encode(e){const{Err:t}=DER;if(e<_0n$4)throw new t("integer: negative integers are not allowed");let r=numberToHexUnpadded(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){const{Err:t}=DER;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return bytesToNumberBE(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=DER,o=ensureBytes("signature",e),{v:i,l:u}=n.decode(48,o);if(u.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:s}=n.decode(2,i),{v:f,l:c}=n.decode(2,s);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(f)}},hexFromSig(e){const{_tlv:t,_int:r}=DER,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),i=n+o;return t.encode(48,i)}};function numToSizedHex(e,t){return bytesToHex$2(numberToBytesBE(e,t))}const _0n$4=BigInt(0),_1n$5=BigInt(1);BigInt(2);const _3n=BigInt(3),_4n=BigInt(4);function weierstrassPoints(e){const t=validatePointOpts(e),{Fp:r}=t,n=Field(t.n,t.nBitLength),o=t.toBytes||((B,ae,W)=>{const J=ae.toAffine();return concatBytes$1(Uint8Array.from([4]),r.toBytes(J.x),r.toBytes(J.y))}),i=t.fromBytes||(B=>{const ae=B.subarray(1),W=r.fromBytes(ae.subarray(0,r.BYTES)),J=r.fromBytes(ae.subarray(r.BYTES,2*r.BYTES));return{x:W,y:J}});function u(B){const{a:ae,b:W}=t,J=r.sqr(B),ve=r.mul(J,B);return r.add(r.add(ve,r.mul(B,ae)),W)}function a(B,ae){const W=r.sqr(ae),J=u(B);return r.eql(W,J)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const s=r.mul(r.pow(t.a,_3n),_4n),f=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(s,f)))throw new Error("bad curve params: a or b");function c(B){return inRange(B,_1n$5,t.n)}function d(B){const{allowedPrivateKeyLengths:ae,nByteLength:W,wrapPrivateKey:J,n:ve}=t;if(ae&&typeof B!="bigint"){if(isBytes$2(B)&&(B=bytesToHex$2(B)),typeof B!="string"||!ae.includes(B.length))throw new Error("invalid private key");B=B.padStart(W*2,"0")}let Qe;try{Qe=typeof B=="bigint"?B:bytesToNumberBE(ensureBytes("private key",B,W))}catch{throw new Error("invalid private key, expected hex or "+W+" bytes, got "+typeof B)}return J&&(Qe=mod(Qe,ve)),aInRange("private key",Qe,_1n$5,ve),Qe}function p(B){if(!(B instanceof b))throw new Error("ProjectivePoint expected")}const h=memoized((B,ae)=>{const{px:W,py:J,pz:ve}=B;if(r.eql(ve,r.ONE))return{x:W,y:J};const Qe=B.is0();ae==null&&(ae=Qe?r.ONE:r.inv(ve));const kt=r.mul(W,ae),nr=r.mul(J,ae),sr=r.mul(ve,ae);if(Qe)return{x:r.ZERO,y:r.ZERO};if(!r.eql(sr,r.ONE))throw new Error("invZ was invalid");return{x:kt,y:nr}}),y=memoized(B=>{if(B.is0()){if(t.allowInfinityPoint&&!r.is0(B.py))return;throw new Error("bad point: ZERO")}const{x:ae,y:W}=B.toAffine();if(!r.isValid(ae)||!r.isValid(W))throw new Error("bad point: x or y not FE");if(!a(ae,W))throw new Error("bad point: equation left != right");if(!B.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class b{constructor(ae,W,J){if(ae==null||!r.isValid(ae))throw new Error("x required");if(W==null||!r.isValid(W)||r.is0(W))throw new Error("y required");if(J==null||!r.isValid(J))throw new Error("z required");this.px=ae,this.py=W,this.pz=J,Object.freeze(this)}static fromAffine(ae){const{x:W,y:J}=ae||{};if(!ae||!r.isValid(W)||!r.isValid(J))throw new Error("invalid affine point");if(ae instanceof b)throw new Error("projective point not allowed");const ve=Qe=>r.eql(Qe,r.ZERO);return ve(W)&&ve(J)?b.ZERO:new b(W,J,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ae){const W=FpInvertBatch(r,ae.map(J=>J.pz));return ae.map((J,ve)=>J.toAffine(W[ve])).map(b.fromAffine)}static fromHex(ae){const W=b.fromAffine(i(ensureBytes("pointHex",ae)));return W.assertValidity(),W}static fromPrivateKey(ae){return b.BASE.multiply(d(ae))}static msm(ae,W){return pippenger(b,n,ae,W)}_setWindowSize(ae){E.setWindowSize(this,ae)}assertValidity(){y(this)}hasEvenY(){const{y:ae}=this.toAffine();if(r.isOdd)return!r.isOdd(ae);throw new Error("Field doesn't support isOdd")}equals(ae){p(ae);const{px:W,py:J,pz:ve}=this,{px:Qe,py:kt,pz:nr}=ae,sr=r.eql(r.mul(W,nr),r.mul(Qe,ve)),ce=r.eql(r.mul(J,nr),r.mul(kt,ve));return sr&&ce}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:ae,b:W}=t,J=r.mul(W,_3n),{px:ve,py:Qe,pz:kt}=this;let nr=r.ZERO,sr=r.ZERO,ce=r.ZERO,Ze=r.mul(ve,ve),se=r.mul(Qe,Qe),vt=r.mul(kt,kt),ur=r.mul(ve,Qe);return ur=r.add(ur,ur),ce=r.mul(ve,kt),ce=r.add(ce,ce),nr=r.mul(ae,ce),sr=r.mul(J,vt),sr=r.add(nr,sr),nr=r.sub(se,sr),sr=r.add(se,sr),sr=r.mul(nr,sr),nr=r.mul(ur,nr),ce=r.mul(J,ce),vt=r.mul(ae,vt),ur=r.sub(Ze,vt),ur=r.mul(ae,ur),ur=r.add(ur,ce),ce=r.add(Ze,Ze),Ze=r.add(ce,Ze),Ze=r.add(Ze,vt),Ze=r.mul(Ze,ur),sr=r.add(sr,Ze),vt=r.mul(Qe,kt),vt=r.add(vt,vt),Ze=r.mul(vt,ur),nr=r.sub(nr,Ze),ce=r.mul(vt,se),ce=r.add(ce,ce),ce=r.add(ce,ce),new b(nr,sr,ce)}add(ae){p(ae);const{px:W,py:J,pz:ve}=this,{px:Qe,py:kt,pz:nr}=ae;let sr=r.ZERO,ce=r.ZERO,Ze=r.ZERO;const se=t.a,vt=r.mul(t.b,_3n);let ur=r.mul(W,Qe),ue=r.mul(J,kt),bt=r.mul(ve,nr),L=r.add(W,J),_=r.add(Qe,kt);L=r.mul(L,_),_=r.add(ur,ue),L=r.sub(L,_),_=r.add(W,ve);let F=r.add(Qe,nr);return _=r.mul(_,F),F=r.add(ur,bt),_=r.sub(_,F),F=r.add(J,ve),sr=r.add(kt,nr),F=r.mul(F,sr),sr=r.add(ue,bt),F=r.sub(F,sr),Ze=r.mul(se,_),sr=r.mul(vt,bt),Ze=r.add(sr,Ze),sr=r.sub(ue,Ze),Ze=r.add(ue,Ze),ce=r.mul(sr,Ze),ue=r.add(ur,ur),ue=r.add(ue,ur),bt=r.mul(se,bt),_=r.mul(vt,_),ue=r.add(ue,bt),bt=r.sub(ur,bt),bt=r.mul(se,bt),_=r.add(_,bt),ur=r.mul(ue,_),ce=r.add(ce,ur),ur=r.mul(F,_),sr=r.mul(L,sr),sr=r.sub(sr,ur),ur=r.mul(L,ue),Ze=r.mul(F,Ze),Ze=r.add(Ze,ur),new b(sr,ce,Ze)}subtract(ae){return this.add(ae.negate())}is0(){return this.equals(b.ZERO)}wNAF(ae){return E.wNAFCached(this,ae,b.normalizeZ)}multiplyUnsafe(ae){const{endo:W,n:J}=t;aInRange("scalar",ae,_0n$4,J);const ve=b.ZERO;if(ae===_0n$4)return ve;if(this.is0()||ae===_1n$5)return this;if(!W||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,ae,b.normalizeZ);let{k1neg:Qe,k1:kt,k2neg:nr,k2:sr}=W.splitScalar(ae),ce=ve,Ze=ve,se=this;for(;kt>_0n$4||sr>_0n$4;)kt&_1n$5&&(ce=ce.add(se)),sr&_1n$5&&(Ze=Ze.add(se)),se=se.double(),kt>>=_1n$5,sr>>=_1n$5;return Qe&&(ce=ce.negate()),nr&&(Ze=Ze.negate()),Ze=new b(r.mul(Ze.px,W.beta),Ze.py,Ze.pz),ce.add(Ze)}multiply(ae){const{endo:W,n:J}=t;aInRange("scalar",ae,_1n$5,J);let ve,Qe;if(W){const{k1neg:kt,k1:nr,k2neg:sr,k2:ce}=W.splitScalar(ae);let{p:Ze,f:se}=this.wNAF(nr),{p:vt,f:ur}=this.wNAF(ce);Ze=E.constTimeNegate(kt,Ze),vt=E.constTimeNegate(sr,vt),vt=new b(r.mul(vt.px,W.beta),vt.py,vt.pz),ve=Ze.add(vt),Qe=se.add(ur)}else{const{p:kt,f:nr}=this.wNAF(ae);ve=kt,Qe=nr}return b.normalizeZ([ve,Qe])[0]}multiplyAndAddUnsafe(ae,W,J){const ve=b.BASE,Qe=(nr,sr)=>sr===_0n$4||sr===_1n$5||!nr.equals(ve)?nr.multiplyUnsafe(sr):nr.multiply(sr),kt=Qe(this,W).add(Qe(ae,J));return kt.is0()?void 0:kt}toAffine(ae){return h(this,ae)}isTorsionFree(){const{h:ae,isTorsionFree:W}=t;if(ae===_1n$5)return!0;if(W)return W(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ae,clearCofactor:W}=t;return ae===_1n$5?this:W?W(b,this):this.multiplyUnsafe(t.h)}toRawBytes(ae=!0){return abool("isCompressed",ae),this.assertValidity(),o(b,this,ae)}toHex(ae=!0){return abool("isCompressed",ae),bytesToHex$2(this.toRawBytes(ae))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const{endo:w,nBitLength:S}=t,E=wNAF(b,w?Math.ceil(S/2):S);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:d,weierstrassEquation:u,isWithinCurveOrder:c}}function validateOpts(e){const t=validateBasic(e);return validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function weierstrass(e){const t=validateOpts(e),{Fp:r,n,nByteLength:o,nBitLength:i}=t,u=r.BYTES+1,a=2*r.BYTES+1;function s(vt){return mod(vt,n)}function f(vt){return invert(vt,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:h}=weierstrassPoints({...t,toBytes(vt,ur,ue){const bt=ur.toAffine(),L=r.toBytes(bt.x),_=concatBytes$1;return abool("isCompressed",ue),ue?_(Uint8Array.from([ur.hasEvenY()?2:3]),L):_(Uint8Array.from([4]),L,r.toBytes(bt.y))},fromBytes(vt){const ur=vt.length,ue=vt[0],bt=vt.subarray(1);if(ur===u&&(ue===2||ue===3)){const L=bytesToNumberBE(bt);if(!inRange(L,_1n$5,r.ORDER))throw new Error("Point is not on curve");const _=p(L);let F;try{F=r.sqrt(_)}catch(rn){const ii=rn instanceof Error?": "+rn.message:"";throw new Error("Point is not on curve"+ii)}const k=(F&_1n$5)===_1n$5;return(ue&1)===1!==k&&(F=r.neg(F)),{x:L,y:F}}else if(ur===a&&ue===4){const L=r.fromBytes(bt.subarray(0,r.BYTES)),_=r.fromBytes(bt.subarray(r.BYTES,2*r.BYTES));return{x:L,y:_}}else{const L=u,_=a;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+_+", got "+ur)}}});function y(vt){const ur=n>>_1n$5;return vt>ur}function b(vt){return y(vt)?s(-vt):vt}const w=(vt,ur,ue)=>bytesToNumberBE(vt.slice(ur,ue));class S{constructor(ur,ue,bt){aInRange("r",ur,_1n$5,n),aInRange("s",ue,_1n$5,n),this.r=ur,this.s=ue,bt!=null&&(this.recovery=bt),Object.freeze(this)}static fromCompact(ur){const ue=o;return ur=ensureBytes("compactSignature",ur,ue*2),new S(w(ur,0,ue),w(ur,ue,2*ue))}static fromDER(ur){const{r:ue,s:bt}=DER.toSig(ensureBytes("DER",ur));return new S(ue,bt)}assertValidity(){}addRecoveryBit(ur){return new S(this.r,this.s,ur)}recoverPublicKey(ur){const{r:ue,s:bt,recovery:L}=this,_=ve(ensureBytes("msgHash",ur));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const F=L===2||L===3?ue+t.n:ue;if(F>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const k=(L&1)===0?"02":"03",Ye=c.fromHex(k+numToSizedHex(F,r.BYTES)),rn=f(F),ii=s(-_*rn),ai=s(bt*rn),ni=c.BASE.multiplyAndAddUnsafe(Ye,ii,ai);if(!ni)throw new Error("point at infinify");return ni.assertValidity(),ni}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig(this)}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){const ur=o;return numToSizedHex(this.r,ur)+numToSizedHex(this.s,ur)}}const E={isValidPrivateKey(vt){try{return d(vt),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const vt=getMinHashLength(t.n);return mapHashToField(t.randomBytes(vt),t.n)},precompute(vt=8,ur=c.BASE){return ur._setWindowSize(vt),ur.multiply(BigInt(3)),ur}};function B(vt,ur=!0){return c.fromPrivateKey(vt).toRawBytes(ur)}function ae(vt){if(typeof vt=="bigint")return!1;if(vt instanceof c)return!0;const ue=ensureBytes("key",vt).length,bt=r.BYTES,L=bt+1,_=2*bt+1;if(!(t.allowedPrivateKeyLengths||o===L))return ue===L||ue===_}function W(vt,ur,ue=!0){if(ae(vt)===!0)throw new Error("first arg must be private key");if(ae(ur)===!1)throw new Error("second arg must be public key");return c.fromHex(ur).multiply(d(vt)).toRawBytes(ue)}const J=t.bits2int||function(vt){if(vt.length>8192)throw new Error("input is too large");const ur=bytesToNumberBE(vt),ue=vt.length*8-i;return ue>0?ur>>BigInt(ue):ur},ve=t.bits2int_modN||function(vt){return s(J(vt))},Qe=bitMask(i);function kt(vt){return aInRange("num < 2^"+i,vt,_0n$4,Qe),numberToBytesBE(vt,o)}function nr(vt,ur,ue=sr){if(["recovered","canonical"].some(ui=>ui in ue))throw new Error("sign() legacy options not supported");const{hash:bt,randomBytes:L}=t;let{lowS:_,prehash:F,extraEntropy:k}=ue;_==null&&(_=!0),vt=ensureBytes("msgHash",vt),validateSigVerOpts(ue),F&&(vt=ensureBytes("prehashed msgHash",bt(vt)));const Ye=ve(vt),rn=d(ur),ii=[kt(rn),kt(Ye)];if(k!=null&&k!==!1){const ui=k===!0?L(r.BYTES):k;ii.push(ensureBytes("extraEntropy",ui))}const ai=concatBytes$1(...ii),ni=Ye;function ri(ui){const lr=J(ui);if(!h(lr))return;const ar=f(lr),jr=c.BASE.multiply(lr).toAffine(),ci=s(jr.x);if(ci===_0n$4)return;const mi=s(ar*s(ni+ci*rn));if(mi===_0n$4)return;let pi=(jr.x===ci?0:2)|Number(jr.y&_1n$5),ei=mi;return _&&y(mi)&&(ei=b(mi),pi^=1),new S(ci,ei,pi)}return{seed:ai,k2sig:ri}}const sr={lowS:t.lowS,prehash:!1},ce={lowS:t.lowS,prehash:!1};function Ze(vt,ur,ue=sr){const{seed:bt,k2sig:L}=nr(vt,ur,ue),_=t;return createHmacDrbg(_.hash.outputLen,_.nByteLength,_.hmac)(bt,L)}c.BASE._setWindowSize(8);function se(vt,ur,ue,bt=ce){const L=vt;ur=ensureBytes("msgHash",ur),ue=ensureBytes("publicKey",ue);const{lowS:_,prehash:F,format:k}=bt;if(validateSigVerOpts(bt),"strict"in bt)throw new Error("options.strict was renamed to lowS");if(k!==void 0&&k!=="compact"&&k!=="der")throw new Error("format must be compact or der");const Ye=typeof L=="string"||isBytes$2(L),rn=!Ye&&!k&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!Ye&&!rn)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ii,ai;try{if(rn&&(ii=new S(L.r,L.s)),Ye){try{k!=="compact"&&(ii=S.fromDER(L))}catch(pi){if(!(pi instanceof DER.Err))throw pi}!ii&&k!=="der"&&(ii=S.fromCompact(L))}ai=c.fromHex(ue)}catch{return!1}if(!ii||_&&ii.hasHighS())return!1;F&&(ur=t.hash(ur));const{r:ni,s:ri}=ii,ui=ve(ur),lr=f(ri),ar=s(ui*lr),jr=s(ni*lr),ci=c.BASE.multiplyAndAddUnsafe(ai,ar,jr)?.toAffine();return ci?s(ci.x)===ni:!1}return{CURVE:t,getPublicKey:B,getSharedSecret:W,sign:Ze,verify:se,ProjectivePoint:c,Signature:S,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(e){return{hash:e,hmac:(t,...r)=>hmac$1(e,t,concatBytes$2(...r)),randomBytes}}function createCurve(e,t){const r=n=>weierstrass({...e,...getHash(n)});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_0n$3=BigInt(0),_1n$4=BigInt(1),_2n$4=BigInt(2),divNearest=(e,t)=>(e+t/_2n$4)/t;function sqrtMod(e){const t=secp256k1P,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),u=BigInt(23),a=BigInt(44),s=BigInt(88),f=e*e*e%t,c=f*f*e%t,d=pow2(c,r,t)*c%t,p=pow2(d,r,t)*c%t,h=pow2(p,_2n$4,t)*f%t,y=pow2(h,o,t)*h%t,b=pow2(y,i,t)*y%t,w=pow2(b,a,t)*b%t,S=pow2(w,s,t)*w%t,E=pow2(S,a,t)*b%t,B=pow2(E,r,t)*c%t,ae=pow2(B,u,t)*y%t,W=pow2(ae,n,t)*f%t,J=pow2(W,_2n$4,t);if(!Fpk1.eql(Fpk1.sqr(J),e))throw new Error("Cannot find square root");return J}const Fpk1=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1$1=createCurve({a:_0n$3,b:BigInt(7),Fp:Fpk1,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=secp256k1N,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-_1n$4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,u=BigInt("0x100000000000000000000000000000000"),a=divNearest(i*e,t),s=divNearest(-n*e,t);let f=mod(e-a*r-s*o,t),c=mod(-a*n-s*i,t);const d=f>u,p=c>u;if(d&&(f=t-f),p&&(c=t-c),f>u||c>u)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:f,k2neg:p,k2:c}}}},sha256$4),secp256k1$2=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:secp256k1$1},Symbol.toStringTag,{value:"Module"}));function serializeSignature({r:e,s:t,to:r="hex",v:n,yParity:o}){const i=(()=>{if(o===0||o===1)return o;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),u=`0x${new secp256k1$1.Signature(hexToBigInt(e),hexToBigInt(t)).toCompactHex()}${i===0?"1b":"1c"}`;return r==="hex"?u:hexToBytes$1(u)}function generatePrivateKey(){return toHex(secp256k1$1.utils.randomPrivateKey())}class InvalidAddressError extends BaseError{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$3=BigInt(2),_7n$1=BigInt(7),_256n$1=BigInt(256),_0x71n$1=BigInt(113),SHA3_PI$1=[],SHA3_ROTL$1=[],_SHA3_IOTA$1=[];for(let e=0,t=_1n$3,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],SHA3_PI$1.push(2*(5*n+r)),SHA3_ROTL$1.push((e+1)*(e+2)/2%64);let o=_0n$2;for(let i=0;i<7;i++)t=(t<<_1n$3^(t>>_7n$1)*_0x71n$1)%_256n$1,t&_2n$3&&(o^=_1n$3<<(_1n$3<<BigInt(i))-_1n$3);_SHA3_IOTA$1.push(o)}const IOTAS=split$1(_SHA3_IOTA$1,!0),SHA3_IOTA_H$1=IOTAS[0],SHA3_IOTA_L$1=IOTAS[1],rotlH$1=(e,t,r)=>r>32?rotlBH$1(e,t,r):rotlSH$1(e,t,r),rotlL$1=(e,t,r)=>r>32?rotlBL$1(e,t,r):rotlSL$1(e,t,r);function keccakP$1(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let u=0;u<10;u++)r[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){const a=(u+8)%10,s=(u+2)%10,f=r[s],c=r[s+1],d=rotlH$1(f,c,1)^r[a],p=rotlL$1(f,c,1)^r[a+1];for(let h=0;h<50;h+=10)e[u+h]^=d,e[u+h+1]^=p}let o=e[2],i=e[3];for(let u=0;u<24;u++){const a=SHA3_ROTL$1[u],s=rotlH$1(o,i,a),f=rotlL$1(o,i,a),c=SHA3_PI$1[u];o=e[c],i=e[c+1],e[c]=s,e[c+1]=f}for(let u=0;u<50;u+=10){for(let a=0;a<10;a++)r[a]=e[u+a];for(let a=0;a<10;a++)e[u+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=SHA3_IOTA_H$1[n],e[1]^=SHA3_IOTA_L$1[n]}clean(r)}let Keccak$1=class P8 extends Hash$2{constructor(t,r,n,o=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,anumber$1(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=u32$2(this.state)}clone(){return this._cloneInto()}keccak(){swap32IfBE(this.state32),keccakP$1(this.state32,this.rounds),swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){aexists(this),t=toBytes$2(t),abytes$1(t);const{blockLen:r,state:n}=this,o=t.length;for(let i=0;i<o;){const u=Math.min(r-this.pos,o-i);for(let a=0;a<u;a++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){aexists(this,!1),abytes$1(t),this.finish();const r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const u=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+u),o),this.posOut+=u,o+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return anumber$1(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,clean(this.state)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:u}=this;return t||(t=new P8(r,n,o,u,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=u,t.destroyed=this.destroyed,t}};const gen$1=(e,t,r)=>createHasher(()=>new Keccak$1(t,e,r)),keccak_256$3=gen$1(1,136,256/8),keccak_512=gen$1(1,72,512/8);function keccak256$2(e,t){const r=t||"hex",n=keccak_256$3(isHex$1(e,{strict:!1})?toBytes$1(e):e);return r==="bytes"?n:toHex(n)}const checksumAddressCache=new LruMap(8192);function checksumAddress(e,t){if(checksumAddressCache.has(`${e}.${t}`))return checksumAddressCache.get(`${e}.${t}`);const r=e.substring(2).toLowerCase(),n=keccak256$2(stringToBytes(r),"bytes"),o=r.split("");for(let u=0;u<40;u+=2)n[u>>1]>>4>=8&&o[u]&&(o[u]=o[u].toUpperCase()),(n[u>>1]&15)>=8&&o[u+1]&&(o[u+1]=o[u+1].toUpperCase());const i=`0x${o.join("")}`;return checksumAddressCache.set(`${e}.${t}`,i),i}function getAddress(e,t){if(!isAddress$1(e,{strict:!1}))throw new InvalidAddressError({address:e});return checksumAddress(e,t)}const addressRegex=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap(8192);function isAddress$1(e,t){const{strict:r=!0}=t??{},n=`${e}.${r}`;if(isAddressCache.has(n))return isAddressCache.get(n);const o=addressRegex.test(e)?e.toLowerCase()===e?!0:r?checksumAddress(e)===e:!0:!1;return isAddressCache.set(n,o),o}function toAccount(e){if(typeof e=="string"){if(!isAddress$1(e,{strict:!1}))throw new InvalidAddressError({address:e});return{address:e,type:"json-rpc"}}if(!isAddress$1(e.address,{strict:!1}))throw new InvalidAddressError({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}function publicKeyToAddress(e){const t=keccak256$2(`0x${e.substring(4)}`).substring(26);return checksumAddress(`0x${t}`)}let extraEntropy=!1;async function sign$3({hash:e,privateKey:t,to:r="object"}){const{r:n,s:o,recovery:i}=secp256k1$1.sign(e.slice(2),t.slice(2),{lowS:!0,extraEntropy:isHex$1(extraEntropy,{strict:!1})?hexToBytes$1(extraEntropy):extraEntropy}),u={r:numberToHex(n,{size:32}),s:numberToHex(o,{size:32}),v:i?28n:27n,yParity:i};return r==="bytes"||r==="hex"?serializeSignature({...u,to:r}):u}function concat(e){return typeof e[0]=="string"?concatHex(e):concatBytes(e)}function concatBytes(e){let t=0;for(const o of e)t+=o.length;const r=new Uint8Array(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return r}function concatHex(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}class NegativeOffsetError extends BaseError{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const staticCursor={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new NegativeOffsetError({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new NegativeOffsetError({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function createCursor(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(staticCursor);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}function toRlp(e,t="hex"){const r=getEncodable(e),n=createCursor(new Uint8Array(r.length));return r.encode(n),t==="hex"?bytesToHex$3(n.bytes):n.bytes}function getEncodable(e){return Array.isArray(e)?getEncodableList(e.map(t=>getEncodable(t))):getEncodableBytes(e)}function getEncodableList(e){const t=e.reduce((o,i)=>o+i.length,0),r=getSizeOfLength(t);return{length:t<=55?1+t:1+r+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+r),r===1?o.pushUint8(t):r===2?o.pushUint16(t):r===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:i}of e)i(o)}}}function getEncodableBytes(e){const t=typeof e=="string"?hexToBytes$1(e):e,r=getSizeOfLength(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+r),r===1?o.pushUint8(t.length):r===2?o.pushUint16(t.length):r===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function getSizeOfLength(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new BaseError("Length is too large.")}function hashAuthorization(e){const{chainId:t,nonce:r,to:n}=e,o=e.contractAddress??e.address,i=keccak256$2(concatHex(["0x05",toRlp([t?numberToHex(t):"0x",o,r?numberToHex(r):"0x"])]));return n==="bytes"?hexToBytes$1(i):i}async function signAuthorization$1(e){const{chainId:t,nonce:r,privateKey:n,to:o="object"}=e,i=e.contractAddress??e.address,u=await sign$3({hash:hashAuthorization({address:i,chainId:t,nonce:r}),privateKey:n,to:o});return o==="object"?{address:i,chainId:t,nonce:r,...u}:u}const presignMessagePrefix=`Ethereum Signed Message:
40
40
  `;function toPrefixedMessage(e){const t=typeof e=="string"?stringToHex(e):typeof e.raw=="string"?e.raw:bytesToHex$3(e.raw),r=stringToHex(`${presignMessagePrefix}${size$1(t)}`);return concat([r,t])}function hashMessage(e,t){return keccak256$2(toPrefixedMessage(e),t)}async function signMessage$1({message:e,privateKey:t}){return await sign$3({hash:hashMessage(e),privateKey:t,to:"hex"})}const etherUnits={gwei:9,wei:18},gweiUnits={ether:-9,wei:9};function formatUnits(e,t){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[o,i]=[r.slice(0,r.length-t),r.slice(r.length-t)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${i?`.${i}`:""}`}function formatEther(e,t="wei"){return formatUnits(e,etherUnits[t])}function formatGwei(e,t="wei"){return formatUnits(e,gweiUnits[t])}function prettyPrint(e){const t=Object.entries(e).map(([n,o])=>o===void 0||o===!1?null:[n,o]).filter(Boolean),r=t.reduce((n,[o])=>Math.max(n,o.length),0);return t.map(([n,o])=>` ${`${n}:`.padEnd(r+1)} ${o}`).join(`
41
41
  `)}class FeeConflictError extends BaseError{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
42
42
  `),{name:"FeeConflictError"})}}class InvalidLegacyVError extends BaseError{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class InvalidSerializableTransactionError extends BaseError{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",prettyPrint(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class InvalidStorageKeySizeError extends BaseError{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class TransactionExecutionError extends BaseError{constructor(t,{account:r,docsPath:n,chain:o,data:i,gas:u,gasPrice:a,maxFeePerGas:s,maxPriorityFeePerGas:f,nonce:c,to:d,value:p}){const h=prettyPrint({chain:o&&`${o?.name} (id: ${o?.id})`,from:r?.address,to:d,value:typeof p<"u"&&`${formatEther(p)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:u,gasPrice:typeof a<"u"&&`${formatGwei(a)} gwei`,maxFeePerGas:typeof s<"u"&&`${formatGwei(s)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${formatGwei(f)} gwei`,nonce:c});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function serializeAuthorizationList(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const{chainId:n,nonce:o,...i}=r,u=r.address;t.push([n?toHex(n):"0x",u,o?toHex(o):"0x",...toYParitySignatureArray({},i)])}return t}function blobsToCommitments(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(i=>hexToBytes$1(i)):e.blobs,o=[];for(const i of n)o.push(Uint8Array.from(t.blobToKzgCommitment(i)));return r==="bytes"?o:o.map(i=>bytesToHex$3(i))}function blobsToProofs(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(u=>hexToBytes$1(u)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(u=>hexToBytes$1(u)):e.commitments,i=[];for(let u=0;u<n.length;u++){const a=n[u],s=o[u];i.push(Uint8Array.from(t.computeBlobKzgProof(a,s)))}return r==="bytes"?i:i.map(u=>bytesToHex$3(u))}const sha256$3=sha256$4;function sha256$2(e,t){return sha256$3(isHex$1(e,{strict:!1})?toBytes$1(e):e)}function commitmentToVersionedHash(e){const{commitment:t,version:r=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),o=sha256$2(t);return o.set([r],0),n==="bytes"?o:bytesToHex$3(o)}function commitmentsToVersionedHashes(e){const{commitments:t,version:r}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),o=[];for(const i of t)o.push(commitmentToVersionedHash({commitment:i,to:n,version:r}));return o}const blobsPerTransaction=6,bytesPerFieldElement=32,fieldElementsPerBlob=4096,bytesPerBlob=bytesPerFieldElement*fieldElementsPerBlob,maxBytesPerTransaction=bytesPerBlob*blobsPerTransaction-1-1*fieldElementsPerBlob*blobsPerTransaction,versionedHashVersionKzg=1;class BlobSizeTooLargeError extends BaseError{constructor({maxSize:t,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class EmptyBlobError extends BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class InvalidVersionedHashSizeError extends BaseError{constructor({hash:t,size:r}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class InvalidVersionedHashVersionError extends BaseError{constructor({hash:t,version:r}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${versionedHashVersionKzg}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function toBlobs(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),r=typeof e.data=="string"?hexToBytes$1(e.data):e.data,n=size$1(r);if(!n)throw new EmptyBlobError;if(n>maxBytesPerTransaction)throw new BlobSizeTooLargeError({maxSize:maxBytesPerTransaction,size:n});const o=[];let i=!0,u=0;for(;i;){const a=createCursor(new Uint8Array(bytesPerBlob));let s=0;for(;s<fieldElementsPerBlob;){const f=r.slice(u,u+(bytesPerFieldElement-1));if(a.pushByte(0),a.pushBytes(f),f.length<31){a.pushByte(128),i=!1;break}s++,u+=31}o.push(a)}return t==="bytes"?o.map(a=>a.bytes):o.map(a=>bytesToHex$3(a.bytes))}function toBlobSidecars(e){const{data:t,kzg:r,to:n}=e,o=e.blobs??toBlobs({data:t,to:n}),i=e.commitments??blobsToCommitments({blobs:o,kzg:r,to:n}),u=e.proofs??blobsToProofs({blobs:o,commitments:i,kzg:r,to:n}),a=[];for(let s=0;s<o.length;s++)a.push({blob:o[s],commitment:i[s],proof:u[s]});return a}const maxUint256=2n**256n-1n;class ChainMismatchError extends BaseError{constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class ChainNotFoundError extends BaseError{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
43
43
  `),{name:"ChainNotFoundError"})}}class InvalidChainIdError extends BaseError{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class ExecutionRevertedError extends BaseError{constructor({cause:t,message:r}={}){const n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(ExecutionRevertedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ExecutionRevertedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class FeeCapTooHighError extends BaseError{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${formatGwei(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(FeeCapTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class FeeCapTooLowError extends BaseError{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${formatGwei(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(FeeCapTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class NonceTooHighError extends BaseError{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(NonceTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class NonceTooLowError extends BaseError{constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
44
44
  `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(NonceTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class NonceMaxValueError extends BaseError{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(NonceMaxValueError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class InsufficientFundsError extends BaseError{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
45
45
  `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(InsufficientFundsError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class IntrinsicGasTooHighError extends BaseError{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(IntrinsicGasTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IntrinsicGasTooLowError extends BaseError{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IntrinsicGasTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TransactionTypeNotSupportedError extends BaseError{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TransactionTypeNotSupportedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class TipAboveFeeCapError extends BaseError{constructor({cause:t,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${formatGwei(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${formatGwei(n)} gwei`:""}).`].join(`
46
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class UnknownNodeError extends BaseError{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function slice(e,t,r,{strict:n}={}){return isHex$1(e,{strict:!1})?sliceHex(e,t,r,{strict:n}):sliceBytes(e,t,r,{strict:n})}function assertStartOffset(e,t){if(typeof t=="number"&&t>0&&t>size$1(e)-1)throw new SliceOffsetOutOfBoundsError({offset:t,position:"start",size:size$1(e)})}function assertEndOffset(e,t,r){if(typeof t=="number"&&typeof r=="number"&&size$1(e)!==r-t)throw new SliceOffsetOutOfBoundsError({offset:r,position:"end",size:size$1(e)})}function sliceBytes(e,t,r,{strict:n}={}){assertStartOffset(e,t);const o=e.slice(t,r);return n&&assertEndOffset(o,t,r),o}function sliceHex(e,t,r,{strict:n}={}){assertStartOffset(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&assertEndOffset(o,t,r),o}function assertTransactionEIP7702(e){const{authorizationList:t}=e;if(t)for(const r of t){const{chainId:n}=r,o=r.address;if(!isAddress$1(o))throw new InvalidAddressError({address:o});if(n<0)throw new InvalidChainIdError({chainId:n})}assertTransactionEIP1559(e)}function assertTransactionEIP4844(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new EmptyBlobError;for(const r of t){const n=size$1(r),o=hexToNumber$2(slice(r,0,1));if(n!==32)throw new InvalidVersionedHashSizeError({hash:r,size:n});if(o!==versionedHashVersionKzg)throw new InvalidVersionedHashVersionError({hash:r,version:o})}}assertTransactionEIP1559(e)}function assertTransactionEIP1559(e){const{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:o}=e;if(t<=0)throw new InvalidChainIdError({chainId:t});if(o&&!isAddress$1(o))throw new InvalidAddressError({address:o});if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n});if(r&&n&&r>n)throw new TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:r})}function assertTransactionEIP2930(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=e;if(t<=0)throw new InvalidChainIdError({chainId:t});if(i&&!isAddress$1(i))throw new InvalidAddressError({address:i});if(r||o)throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n})}function assertTransactionLegacy(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=e;if(i&&!isAddress$1(i))throw new InvalidAddressError({address:i});if(typeof t<"u"&&t<=0)throw new InvalidChainIdError({chainId:t});if(r||o)throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n})}function getTransactionType(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError({transaction:e})}function serializeAccessList(e){if(!e||e.length===0)return[];const t=[];for(let r=0;r<e.length;r++){const{address:n,storageKeys:o}=e[r];for(let i=0;i<o.length;i++)if(o[i].length-2!==64)throw new InvalidStorageKeySizeError({storageKey:o[i]});if(!isAddress$1(n,{strict:!1}))throw new InvalidAddressError({address:n});t.push([n,o])}return t}function serializeTransaction(e,t){const r=getTransactionType(e);return r==="eip1559"?serializeTransactionEIP1559(e,t):r==="eip2930"?serializeTransactionEIP2930(e,t):r==="eip4844"?serializeTransactionEIP4844(e,t):r==="eip7702"?serializeTransactionEIP7702(e,t):serializeTransactionLegacy(e,t)}function serializeTransactionEIP7702(e,t){const{authorizationList:r,chainId:n,gas:o,nonce:i,to:u,value:a,maxFeePerGas:s,maxPriorityFeePerGas:f,accessList:c,data:d}=e;assertTransactionEIP7702(e);const p=serializeAccessList(c),h=serializeAuthorizationList(r);return concatHex(["0x04",toRlp([numberToHex$1(n),i?numberToHex$1(i):"0x",f?numberToHex$1(f):"0x",s?numberToHex$1(s):"0x",o?numberToHex$1(o):"0x",u??"0x",a?numberToHex$1(a):"0x",d??"0x",p,h,...toYParitySignatureArray(e,t)])])}function serializeTransactionEIP4844(e,t){const{chainId:r,gas:n,nonce:o,to:i,value:u,maxFeePerBlobGas:a,maxFeePerGas:s,maxPriorityFeePerGas:f,accessList:c,data:d}=e;assertTransactionEIP4844(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs&&(typeof p>"u"||typeof h>"u")){const B=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(J=>bytesToHex$3(J)),ae=e.kzg,W=blobsToCommitments({blobs:B,kzg:ae});if(typeof p>"u"&&(p=commitmentsToVersionedHashes({commitments:W})),typeof h>"u"){const J=blobsToProofs({blobs:B,commitments:W,kzg:ae});h=toBlobSidecars({blobs:B,commitments:W,proofs:J})}}const y=serializeAccessList(c),b=[numberToHex$1(r),o?numberToHex$1(o):"0x",f?numberToHex$1(f):"0x",s?numberToHex$1(s):"0x",n?numberToHex$1(n):"0x",i??"0x",u?numberToHex$1(u):"0x",d??"0x",y,a?numberToHex$1(a):"0x",p??[],...toYParitySignatureArray(e,t)],w=[],S=[],E=[];if(h)for(let B=0;B<h.length;B++){const{blob:ae,commitment:W,proof:J}=h[B];w.push(ae),S.push(W),E.push(J)}return concatHex(["0x03",toRlp(h?[b,w,S,E]:b)])}function serializeTransactionEIP1559(e,t){const{chainId:r,gas:n,nonce:o,to:i,value:u,maxFeePerGas:a,maxPriorityFeePerGas:s,accessList:f,data:c}=e;assertTransactionEIP1559(e);const d=serializeAccessList(f),p=[numberToHex$1(r),o?numberToHex$1(o):"0x",s?numberToHex$1(s):"0x",a?numberToHex$1(a):"0x",n?numberToHex$1(n):"0x",i??"0x",u?numberToHex$1(u):"0x",c??"0x",d,...toYParitySignatureArray(e,t)];return concatHex(["0x02",toRlp(p)])}function serializeTransactionEIP2930(e,t){const{chainId:r,gas:n,data:o,nonce:i,to:u,value:a,accessList:s,gasPrice:f}=e;assertTransactionEIP2930(e);const c=serializeAccessList(s),d=[numberToHex$1(r),i?numberToHex$1(i):"0x",f?numberToHex$1(f):"0x",n?numberToHex$1(n):"0x",u??"0x",a?numberToHex$1(a):"0x",o??"0x",c,...toYParitySignatureArray(e,t)];return concatHex(["0x01",toRlp(d)])}function serializeTransactionLegacy(e,t){const{chainId:r=0,gas:n,data:o,nonce:i,to:u,value:a,gasPrice:s}=e;assertTransactionLegacy(e);let f=[i?numberToHex$1(i):"0x",s?numberToHex$1(s):"0x",n?numberToHex$1(n):"0x",u??"0x",a?numberToHex$1(a):"0x",o??"0x"];if(t){const c=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);const h=27n+(t.v===27n?0n:1n);if(t.v!==h)throw new InvalidLegacyVError({v:t.v});return h})(),d=trim(t.r),p=trim(t.s);f=[...f,numberToHex$1(c),d==="0x00"?"0x":d,p==="0x00"?"0x":p]}else r>0&&(f=[...f,numberToHex$1(r),"0x","0x"]);return toRlp(f)}function toYParitySignatureArray(e,t){const r=t??e,{v:n,yParity:o}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof o>"u")return[];const i=trim(r.r),u=trim(r.s);return[typeof o=="number"?o?numberToHex$1(1):"0x":n===0n?"0x":n===1n?numberToHex$1(1):n===27n?"0x":numberToHex$1(1),i==="0x00"?"0x":i,u==="0x00"?"0x":u]}async function signTransaction$1(e){const{privateKey:t,transaction:r,serializer:n=serializeTransaction}=e,o=r.type==="eip4844"?{...r,sidecars:!1}:r,i=await sign$3({hash:keccak256$2(n(o)),privateKey:t});return n(r,i)}function formatAbiItem$1(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new InvalidDefinitionTypeError(e.type);return`${e.name}(${formatAbiParams(e.inputs,{includeName:t})})`}function formatAbiParams(e,{includeName:t=!1}={}){return e?e.map(r=>formatAbiParam(r,{includeName:t})).join(t?", ":","):""}function formatAbiParam(e,{includeName:t}){return e.type.startsWith("tuple")?`(${formatAbiParams(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class AbiConstructorNotFoundError extends BaseError{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
46
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class UnknownNodeError extends BaseError{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function slice(e,t,r,{strict:n}={}){return isHex$1(e,{strict:!1})?sliceHex(e,t,r,{strict:n}):sliceBytes(e,t,r,{strict:n})}function assertStartOffset(e,t){if(typeof t=="number"&&t>0&&t>size$1(e)-1)throw new SliceOffsetOutOfBoundsError({offset:t,position:"start",size:size$1(e)})}function assertEndOffset(e,t,r){if(typeof t=="number"&&typeof r=="number"&&size$1(e)!==r-t)throw new SliceOffsetOutOfBoundsError({offset:r,position:"end",size:size$1(e)})}function sliceBytes(e,t,r,{strict:n}={}){assertStartOffset(e,t);const o=e.slice(t,r);return n&&assertEndOffset(o,t,r),o}function sliceHex(e,t,r,{strict:n}={}){assertStartOffset(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&assertEndOffset(o,t,r),o}function assertTransactionEIP7702(e){const{authorizationList:t}=e;if(t)for(const r of t){const{chainId:n}=r,o=r.address;if(!isAddress$1(o))throw new InvalidAddressError({address:o});if(n<0)throw new InvalidChainIdError({chainId:n})}assertTransactionEIP1559(e)}function assertTransactionEIP4844(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new EmptyBlobError;for(const r of t){const n=size$1(r),o=hexToNumber$2(slice(r,0,1));if(n!==32)throw new InvalidVersionedHashSizeError({hash:r,size:n});if(o!==versionedHashVersionKzg)throw new InvalidVersionedHashVersionError({hash:r,version:o})}}assertTransactionEIP1559(e)}function assertTransactionEIP1559(e){const{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:o}=e;if(t<=0)throw new InvalidChainIdError({chainId:t});if(o&&!isAddress$1(o))throw new InvalidAddressError({address:o});if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n});if(r&&n&&r>n)throw new TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:r})}function assertTransactionEIP2930(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=e;if(t<=0)throw new InvalidChainIdError({chainId:t});if(i&&!isAddress$1(i))throw new InvalidAddressError({address:i});if(r||o)throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n})}function assertTransactionLegacy(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=e;if(i&&!isAddress$1(i))throw new InvalidAddressError({address:i});if(typeof t<"u"&&t<=0)throw new InvalidChainIdError({chainId:t});if(r||o)throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n})}function getTransactionType(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError({transaction:e})}function serializeAccessList(e){if(!e||e.length===0)return[];const t=[];for(let r=0;r<e.length;r++){const{address:n,storageKeys:o}=e[r];for(let i=0;i<o.length;i++)if(o[i].length-2!==64)throw new InvalidStorageKeySizeError({storageKey:o[i]});if(!isAddress$1(n,{strict:!1}))throw new InvalidAddressError({address:n});t.push([n,o])}return t}function serializeTransaction(e,t){const r=getTransactionType(e);return r==="eip1559"?serializeTransactionEIP1559(e,t):r==="eip2930"?serializeTransactionEIP2930(e,t):r==="eip4844"?serializeTransactionEIP4844(e,t):r==="eip7702"?serializeTransactionEIP7702(e,t):serializeTransactionLegacy(e,t)}function serializeTransactionEIP7702(e,t){const{authorizationList:r,chainId:n,gas:o,nonce:i,to:u,value:a,maxFeePerGas:s,maxPriorityFeePerGas:f,accessList:c,data:d}=e;assertTransactionEIP7702(e);const p=serializeAccessList(c),h=serializeAuthorizationList(r);return concatHex(["0x04",toRlp([numberToHex(n),i?numberToHex(i):"0x",f?numberToHex(f):"0x",s?numberToHex(s):"0x",o?numberToHex(o):"0x",u??"0x",a?numberToHex(a):"0x",d??"0x",p,h,...toYParitySignatureArray(e,t)])])}function serializeTransactionEIP4844(e,t){const{chainId:r,gas:n,nonce:o,to:i,value:u,maxFeePerBlobGas:a,maxFeePerGas:s,maxPriorityFeePerGas:f,accessList:c,data:d}=e;assertTransactionEIP4844(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs&&(typeof p>"u"||typeof h>"u")){const B=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(J=>bytesToHex$3(J)),ae=e.kzg,W=blobsToCommitments({blobs:B,kzg:ae});if(typeof p>"u"&&(p=commitmentsToVersionedHashes({commitments:W})),typeof h>"u"){const J=blobsToProofs({blobs:B,commitments:W,kzg:ae});h=toBlobSidecars({blobs:B,commitments:W,proofs:J})}}const y=serializeAccessList(c),b=[numberToHex(r),o?numberToHex(o):"0x",f?numberToHex(f):"0x",s?numberToHex(s):"0x",n?numberToHex(n):"0x",i??"0x",u?numberToHex(u):"0x",d??"0x",y,a?numberToHex(a):"0x",p??[],...toYParitySignatureArray(e,t)],w=[],S=[],E=[];if(h)for(let B=0;B<h.length;B++){const{blob:ae,commitment:W,proof:J}=h[B];w.push(ae),S.push(W),E.push(J)}return concatHex(["0x03",toRlp(h?[b,w,S,E]:b)])}function serializeTransactionEIP1559(e,t){const{chainId:r,gas:n,nonce:o,to:i,value:u,maxFeePerGas:a,maxPriorityFeePerGas:s,accessList:f,data:c}=e;assertTransactionEIP1559(e);const d=serializeAccessList(f),p=[numberToHex(r),o?numberToHex(o):"0x",s?numberToHex(s):"0x",a?numberToHex(a):"0x",n?numberToHex(n):"0x",i??"0x",u?numberToHex(u):"0x",c??"0x",d,...toYParitySignatureArray(e,t)];return concatHex(["0x02",toRlp(p)])}function serializeTransactionEIP2930(e,t){const{chainId:r,gas:n,data:o,nonce:i,to:u,value:a,accessList:s,gasPrice:f}=e;assertTransactionEIP2930(e);const c=serializeAccessList(s),d=[numberToHex(r),i?numberToHex(i):"0x",f?numberToHex(f):"0x",n?numberToHex(n):"0x",u??"0x",a?numberToHex(a):"0x",o??"0x",c,...toYParitySignatureArray(e,t)];return concatHex(["0x01",toRlp(d)])}function serializeTransactionLegacy(e,t){const{chainId:r=0,gas:n,data:o,nonce:i,to:u,value:a,gasPrice:s}=e;assertTransactionLegacy(e);let f=[i?numberToHex(i):"0x",s?numberToHex(s):"0x",n?numberToHex(n):"0x",u??"0x",a?numberToHex(a):"0x",o??"0x"];if(t){const c=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);const h=27n+(t.v===27n?0n:1n);if(t.v!==h)throw new InvalidLegacyVError({v:t.v});return h})(),d=trim(t.r),p=trim(t.s);f=[...f,numberToHex(c),d==="0x00"?"0x":d,p==="0x00"?"0x":p]}else r>0&&(f=[...f,numberToHex(r),"0x","0x"]);return toRlp(f)}function toYParitySignatureArray(e,t){const r=t??e,{v:n,yParity:o}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof o>"u")return[];const i=trim(r.r),u=trim(r.s);return[typeof o=="number"?o?numberToHex(1):"0x":n===0n?"0x":n===1n?numberToHex(1):n===27n?"0x":numberToHex(1),i==="0x00"?"0x":i,u==="0x00"?"0x":u]}async function signTransaction$1(e){const{privateKey:t,transaction:r,serializer:n=serializeTransaction}=e,o=r.type==="eip4844"?{...r,sidecars:!1}:r,i=await sign$3({hash:keccak256$2(n(o)),privateKey:t});return n(r,i)}function formatAbiItem$1(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new InvalidDefinitionTypeError(e.type);return`${e.name}(${formatAbiParams(e.inputs,{includeName:t})})`}function formatAbiParams(e,{includeName:t=!1}={}){return e?e.map(r=>formatAbiParam(r,{includeName:t})).join(t?", ":","):""}function formatAbiParam(e,{includeName:t}){return e.type.startsWith("tuple")?`(${formatAbiParams(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class AbiConstructorNotFoundError extends BaseError{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
47
47
  `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class AbiConstructorParamsNotFoundError extends BaseError{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
48
48
  `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class AbiDecodingDataSizeTooSmallError extends BaseError{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
49
49
  `),{metaMessages:[`Params: (${formatAbiParams(r,{includeName:!0})})`,`Data: ${t} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=r,this.size=n}}class AbiDecodingZeroDataError extends BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class AbiEncodingArrayLengthMismatchError extends BaseError{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(`
@@ -54,11 +54,11 @@ Error generating stack: `+ir.message+`
54
54
  `),{docsPath:r,name:"InvalidAbiEncodingType"})}}class InvalidAbiDecodingTypeError extends BaseError{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
55
55
  `),{docsPath:r,name:"InvalidAbiDecodingType"})}}class InvalidArrayError extends BaseError{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
56
56
  `),{name:"InvalidArrayError"})}}class InvalidDefinitionTypeError extends BaseError{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
57
- `),{name:"InvalidDefinitionTypeError"})}}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function encodeAbiParameters(e,t){if(e.length!==t.length)throw new AbiEncodingLengthMismatchError({expectedLength:e.length,givenLength:t.length});const r=prepareParams({params:e,values:t}),n=encodeParams(r);return n.length===0?"0x":n}function prepareParams({params:e,values:t}){const r=[];for(let n=0;n<e.length;n++)r.push(prepareParam({param:e[n],value:t[n]}));return r}function prepareParam({param:e,value:t}){const r=getArrayComponents(e.type);if(r){const[n,o]=r;return encodeArray(t,{length:n,param:{...e,type:o}})}if(e.type==="tuple")return encodeTuple(t,{param:e});if(e.type==="address")return encodeAddress(t);if(e.type==="bool")return encodeBool(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,o="256"]=integerRegex.exec(e.type)??[];return encodeNumber(t,{signed:n,size:Number(o)})}if(e.type.startsWith("bytes"))return encodeBytes(t,{param:e});if(e.type==="string")return encodeString(t);throw new InvalidAbiEncodingTypeError(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function encodeParams(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:u,encoded:a}=e[i];u?t+=32:t+=size$1(a)}const r=[],n=[];let o=0;for(let i=0;i<e.length;i++){const{dynamic:u,encoded:a}=e[i];u?(r.push(numberToHex$1(t+o,{size:32})),n.push(a),o+=size$1(a)):r.push(a)}return concat([...r,...n])}function encodeAddress(e){if(!isAddress$1(e))throw new InvalidAddressError({address:e});return{dynamic:!1,encoded:padHex(e.toLowerCase())}}function encodeArray(e,{length:t,param:r}){const n=t===null;if(!Array.isArray(e))throw new InvalidArrayError(e);if(!n&&e.length!==t)throw new AbiEncodingArrayLengthMismatchError({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let o=!1;const i=[];for(let u=0;u<e.length;u++){const a=prepareParam({param:r,value:e[u]});a.dynamic&&(o=!0),i.push(a)}if(n||o){const u=encodeParams(i);if(n){const a=numberToHex$1(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?concat([a,u]):a}}if(o)return{dynamic:!0,encoded:u}}return{dynamic:!1,encoded:concat(i.map(({encoded:u})=>u))}}function encodeBytes(e,{param:t}){const[,r]=t.type.split("bytes"),n=size$1(e);if(!r){let o=e;return n%32!==0&&(o=padHex(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:concat([padHex(numberToHex$1(n,{size:32})),o])}}if(n!==Number.parseInt(r,10))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:padHex(e,{dir:"right"})}}function encodeBool(e){if(typeof e!="boolean")throw new BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(e))}}function encodeNumber(e,{signed:t,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new IntegerOutOfRangeError({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:numberToHex$1(e,{size:32,signed:t})}}function encodeString(e){const t=stringToHex(e),r=Math.ceil(size$1(t)/32),n=[];for(let o=0;o<r;o++)n.push(padHex(slice(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:concat([padHex(numberToHex$1(size$1(t),{size:32})),...n])}}function encodeTuple(e,{param:t}){let r=!1;const n=[];for(let o=0;o<t.components.length;o++){const i=t.components[o],u=Array.isArray(e)?o:i.name,a=prepareParam({param:i,value:e[u]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?encodeParams(n):concat(n.map(({encoded:o})=>o))}}function getArrayComponents(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const stringify$1=(e,t,r)=>JSON.stringify(e,(n,o)=>typeof o=="bigint"?o.toString():o,r);class InvalidDomainError extends BaseError{constructor({domain:t}){super(`Invalid domain "${stringify$1(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class InvalidPrimaryTypeError extends BaseError{constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class InvalidStructTypeError extends BaseError{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function serializeTypedData(e){const{domain:t,message:r,primaryType:n,types:o}=e,i=(s,f)=>{const c={...f};for(const d of s){const{name:p,type:h}=d;h==="address"&&(c[p]=c[p].toLowerCase())}return c},u=o.EIP712Domain?t?i(o.EIP712Domain,t):{}:{},a=(()=>{if(n!=="EIP712Domain")return i(o[n],r)})();return stringify$1({domain:u,message:a,primaryType:n,types:o})}function validateTypedData(e){const{domain:t,message:r,primaryType:n,types:o}=e,i=(u,a)=>{for(const s of u){const{name:f,type:c}=s,d=a[f],p=c.match(integerRegex);if(p&&(typeof d=="number"||typeof d=="bigint")){const[b,w,S]=p;numberToHex$1(d,{signed:w==="int",size:Number.parseInt(S,10)/8})}if(c==="address"&&typeof d=="string"&&!isAddress$1(d))throw new InvalidAddressError({address:d});const h=c.match(bytesRegex);if(h){const[b,w]=h;if(w&&size$1(d)!==Number.parseInt(w,10))throw new BytesSizeMismatchError({expectedSize:Number.parseInt(w,10),givenSize:size$1(d)})}const y=o[c];y&&(validateReference(c),i(y,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new InvalidDomainError({domain:t});i(o.EIP712Domain,t)}if(n!=="EIP712Domain")if(o[n])i(o[n],r);else throw new InvalidPrimaryTypeError({primaryType:n,types:o})}function getTypesForEIP712Domain({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId=="number"||typeof e?.chainId=="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function validateReference(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new InvalidStructTypeError({type:e})}function hashTypedData(e){const{domain:t={},message:r,primaryType:n}=e,o={EIP712Domain:getTypesForEIP712Domain({domain:t}),...e.types};validateTypedData({domain:t,message:r,primaryType:n,types:o});const i=["0x1901"];return t&&i.push(hashDomain({domain:t,types:o})),n!=="EIP712Domain"&&i.push(hashStruct({data:r,primaryType:n,types:o})),keccak256$2(concat(i))}function hashDomain({domain:e,types:t}){return hashStruct({data:e,primaryType:"EIP712Domain",types:t})}function hashStruct({data:e,primaryType:t,types:r}){const n=encodeData({data:e,primaryType:t,types:r});return keccak256$2(n)}function encodeData({data:e,primaryType:t,types:r}){const n=[{type:"bytes32"}],o=[hashType({primaryType:t,types:r})];for(const i of r[t]){const[u,a]=encodeField({types:r,name:i.name,type:i.type,value:e[i.name]});n.push(u),o.push(a)}return encodeAbiParameters(n,o)}function hashType({primaryType:e,types:t}){const r=toHex(encodeType({primaryType:e,types:t}));return keccak256$2(r)}function encodeType({primaryType:e,types:t}){let r="";const n=findTypeDependencies({primaryType:e,types:t});n.delete(e);const o=[e,...Array.from(n).sort()];for(const i of o)r+=`${i}(${t[i].map(({name:u,type:a})=>`${a} ${u}`).join(",")})`;return r}function findTypeDependencies({primaryType:e,types:t},r=new Set){const o=e.match(/^\w*/u)?.[0];if(r.has(o)||t[o]===void 0)return r;r.add(o);for(const i of t[o])findTypeDependencies({primaryType:i.type,types:t},r);return r}function encodeField({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},keccak256$2(encodeData({data:n,primaryType:r,types:e}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},keccak256$2(n)];if(r==="string")return[{type:"bytes32"},keccak256$2(toHex(n))];if(r.lastIndexOf("]")===r.length-1){const o=r.slice(0,r.lastIndexOf("[")),i=n.map(u=>encodeField({name:t,type:o,types:e,value:u}));return[{type:"bytes32"},keccak256$2(encodeAbiParameters(i.map(([u])=>u),i.map(([,u])=>u)))]}return[{type:r},n]}async function signTypedData$1(e){const{privateKey:t,...r}=e;return await sign$3({hash:hashTypedData(r),privateKey:t,to:"hex"})}function privateKeyToAccount(e,t={}){const{nonceManager:r}=t,n=toHex(secp256k1$1.getPublicKey(e.slice(2),!1)),o=publicKeyToAddress(n);return{...toAccount({address:o,nonceManager:r,async sign({hash:u}){return sign$3({hash:u,privateKey:e,to:"hex"})},async signAuthorization(u){return signAuthorization$1({...u,privateKey:e})},async signMessage({message:u}){return signMessage$1({message:u,privateKey:e})},async signTransaction(u,{serializer:a}={}){return signTransaction$1({privateKey:e,transaction:u,serializer:a})},async signTypedData(u){return signTypedData$1({...u,privateKey:e})}}),publicKey:n,source:"privateKey"}}function parseAccount(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}function execTyped(e,t){return e.exec(t)?.groups}const tupleRegex=/^tuple(?<array>(\[(\d*)\])*)$/;function formatAbiParameter(e){let t=e.type;if(tupleRegex.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let o=0;o<r;o++){const i=e.components[o];t+=formatAbiParameter(i),o<r-1&&(t+=", ")}const n=execTyped(tupleRegex,e.type);return t+=`)${n?.array??""}`,formatAbiParameter({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function formatAbiParameters(e){let t="";const r=e.length;for(let n=0;n<r;n++){const o=e[n];t+=formatAbiParameter(o),n!==r-1&&(t+=", ")}return t}function formatAbiItem(e){return e.type==="function"?`function ${e.name}(${formatAbiParameters(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${formatAbiParameters(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${formatAbiParameters(e.inputs)})`:e.type==="error"?`error ${e.name}(${formatAbiParameters(e.inputs)})`:e.type==="constructor"?`constructor(${formatAbiParameters(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function getAction(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const o=e[r];return typeof o=="function"?o:i=>t(e,i)}const hash$3=e=>keccak256$2(toBytes$1(e));function hashSignature(e){return hash$3(e)}function normalizeSignature(e){let t=!0,r="",n=0,o="",i=!1;for(let u=0;u<e.length;u++){const a=e[u];if(["(",")",","].includes(a)&&(t=!0),a==="("&&n++,a===")"&&n--,!!t){if(n===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){e[u-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}o+=a,r+=a}}if(!i)throw new BaseError("Unable to normalize signature.");return o}const toSignature=e=>{const t=typeof e=="string"?e:formatAbiItem(e);return normalizeSignature(t)};function toSignatureHash(e){return hashSignature(toSignature(e))}const toEventSelector=toSignatureHash,toFunctionSelector=e=>slice(toSignatureHash(e),0,4);function getAbiItem(e){const{abi:t,args:r=[],name:n}=e,o=isHex$1(n,{strict:!1}),i=t.filter(a=>o?a.type==="function"?toFunctionSelector(a)===n:a.type==="event"?toEventSelector(a)===n:!1:"name"in a&&a.name===n);if(i.length===0)return;if(i.length===1)return i[0];let u;for(const a of i){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((f,c)=>{const d="inputs"in a&&a.inputs[c];return d?isArgOfType(f,d):!1})){if(u&&"inputs"in u&&u.inputs){const f=getAmbiguousTypes(a.inputs,u.inputs,r);if(f)throw new AbiItemAmbiguityError({abiItem:a,type:f[0]},{abiItem:u,type:f[1]})}u=a}}return u||i[0]}function isArgOfType(e,t){const r=typeof e,n=t.type;switch(n){case"address":return isAddress$1(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>isArgOfType(Object.values(e)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>isArgOfType(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(e,t,r){for(const n in e){const o=e[n],i=t[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return getAmbiguousTypes(o.components,i.components,r[n]);const u=[o.type,i.type];if(u.includes("address")&&u.includes("bytes20")?!0:u.includes("address")&&u.includes("string")?isAddress$1(r[n],{strict:!1}):u.includes("address")&&u.includes("bytes")?isAddress$1(r[n],{strict:!1}):!1)return u}}const docsPath$1="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(e){const{abi:t,args:r,functionName:n}=e;let o=t[0];if(n){const i=getAbiItem({abi:t,args:r,name:n});if(!i)throw new AbiFunctionNotFoundError(n,{docsPath:docsPath$1});o=i}if(o.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$1});return{abi:[o],functionName:toFunctionSelector(formatAbiItem$1(o))}}function encodeFunctionData(e){const{args:t}=e,{abi:r,functionName:n}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:prepareEncodeFunctionData(e),o=r[0],i=n,u="inputs"in o&&o.inputs?encodeAbiParameters(o.inputs,t??[]):void 0;return concatHex([i,u??"0x"])}const panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function bytesToBigInt(e,t={}){typeof t.size<"u"&&assertSize(e,{size:t.size});const r=bytesToHex$3(e,t);return hexToBigInt(r,t)}function bytesToBool(e,t={}){let r=e;if(typeof t.size<"u"&&(assertSize(r,{size:t.size}),r=trim(r)),r.length>1||r[0]>1)throw new InvalidBytesBooleanError(r);return!!r[0]}function bytesToNumber(e,t={}){typeof t.size<"u"&&assertSize(e,{size:t.size});const r=bytesToHex$3(e,t);return hexToNumber$2(r,t)}function bytesToString$1(e,t={}){let r=e;return typeof t.size<"u"&&(assertSize(r,{size:t.size}),r=trim(r,{dir:"right"})),new TextDecoder().decode(r)}function decodeAbiParameters(e,t){const r=typeof t=="string"?hexToBytes$1(t):t,n=createCursor(r);if(size$1(r)===0&&e.length>0)throw new AbiDecodingZeroDataError;if(size$1(t)&&size$1(t)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof t=="string"?t:bytesToHex$3(t),params:e,size:size$1(t)});let o=0;const i=[];for(let u=0;u<e.length;++u){const a=e[u];n.setPosition(o);const[s,f]=decodeParameter(n,a,{staticPosition:0});o+=f,i.push(s)}return i}function decodeParameter(e,t,{staticPosition:r}){const n=getArrayComponents(t.type);if(n){const[o,i]=n;return decodeArray(e,{...t,type:i},{length:o,staticPosition:r})}if(t.type==="tuple")return decodeTuple(e,t,{staticPosition:r});if(t.type==="address")return decodeAddress$1(e);if(t.type==="bool")return decodeBool(e);if(t.type.startsWith("bytes"))return decodeBytes(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return decodeNumber(e,t);if(t.type==="string")return decodeString(e,{staticPosition:r});throw new InvalidAbiDecodingTypeError(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const sizeOfLength=32,sizeOfOffset=32;function decodeAddress$1(e){const t=e.readBytes(32);return[checksumAddress(bytesToHex$3(sliceBytes(t,-20))),32]}function decodeArray(e,t,{length:r,staticPosition:n}){if(!r){const u=bytesToNumber(e.readBytes(sizeOfOffset)),a=n+u,s=a+sizeOfLength;e.setPosition(a);const f=bytesToNumber(e.readBytes(sizeOfLength)),c=hasDynamicChild(t);let d=0;const p=[];for(let h=0;h<f;++h){e.setPosition(s+(c?h*32:d));const[y,b]=decodeParameter(e,t,{staticPosition:s});d+=b,p.push(y)}return e.setPosition(n+32),[p,32]}if(hasDynamicChild(t)){const u=bytesToNumber(e.readBytes(sizeOfOffset)),a=n+u,s=[];for(let f=0;f<r;++f){e.setPosition(a+f*32);const[c]=decodeParameter(e,t,{staticPosition:a});s.push(c)}return e.setPosition(n+32),[s,32]}let o=0;const i=[];for(let u=0;u<r;++u){const[a,s]=decodeParameter(e,t,{staticPosition:n+o});o+=s,i.push(a)}return[i,o]}function decodeBool(e){return[bytesToBool(e.readBytes(32),{size:32}),32]}function decodeBytes(e,t,{staticPosition:r}){const[n,o]=t.type.split("bytes");if(!o){const u=bytesToNumber(e.readBytes(32));e.setPosition(r+u);const a=bytesToNumber(e.readBytes(32));if(a===0)return e.setPosition(r+32),["0x",32];const s=e.readBytes(a);return e.setPosition(r+32),[bytesToHex$3(s),32]}return[bytesToHex$3(e.readBytes(Number.parseInt(o,10),32)),32]}function decodeNumber(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[n>48?bytesToBigInt(o,{signed:r}):bytesToNumber(o,{signed:r}),32]}function decodeTuple(e,t,{staticPosition:r}){const n=t.components.length===0||t.components.some(({name:u})=>!u),o=n?[]:{};let i=0;if(hasDynamicChild(t)){const u=bytesToNumber(e.readBytes(sizeOfOffset)),a=r+u;for(let s=0;s<t.components.length;++s){const f=t.components[s];e.setPosition(a+i);const[c,d]=decodeParameter(e,f,{staticPosition:a});i+=d,o[n?s:f?.name]=c}return e.setPosition(r+32),[o,32]}for(let u=0;u<t.components.length;++u){const a=t.components[u],[s,f]=decodeParameter(e,a,{staticPosition:r});o[n?u:a?.name]=s,i+=f}return[o,i]}function decodeString(e,{staticPosition:t}){const r=bytesToNumber(e.readBytes(32)),n=t+r;e.setPosition(n);const o=bytesToNumber(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const i=e.readBytes(o,32),u=bytesToString$1(trim(i));return e.setPosition(t+32),[u,32]}function hasDynamicChild(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(hasDynamicChild);const r=getArrayComponents(e.type);return!!(r&&hasDynamicChild({...e,type:r[1]}))}function decodeErrorResult(e){const{abi:t,data:r}=e,n=slice(r,0,4);if(n==="0x")throw new AbiDecodingZeroDataError;const i=[...t||[],solidityError,solidityPanic].find(u=>u.type==="error"&&n===toFunctionSelector(formatAbiItem$1(u)));if(!i)throw new AbiErrorSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?decodeAbiParameters(i.inputs,slice(r,4)):void 0,errorName:i.name}}function formatAbiItemWithArgs({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((o,i)=>`${n&&o.name?`${o.name}: `:""}${typeof t[i]=="object"?stringify$1(t[i]):t[i]}`).join(", ")})`}class AccountStateConflictError extends BaseError{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}const getContractAddress=e=>e,getUrl=e=>e;class ContractFunctionExecutionError extends BaseError{constructor(t,{abi:r,args:n,contractAddress:o,docsPath:i,functionName:u,sender:a}){const s=getAbiItem({abi:r,args:n,name:u}),f=s?formatAbiItemWithArgs({abiItem:s,args:n,includeFunctionName:!1,includeName:!1}):void 0,c=s?formatAbiItem$1(s,{includeName:!0}):void 0,d=prettyPrint({address:o&&getContractAddress(o),function:c,args:f&&f!=="()"&&`${[...Array(u?.length??0).keys()].map(()=>" ").join("")}${f}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${u}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=t,this.contractAddress=o,this.functionName=u,this.sender=a}}class ContractFunctionRevertedError extends BaseError{constructor({abi:t,data:r,functionName:n,message:o}){let i,u,a,s;if(r&&r!=="0x")try{u=decodeErrorResult({abi:t,data:r});const{abiItem:c,errorName:d,args:p}=u;if(d==="Error")s=p[0];else if(d==="Panic"){const[h]=p;s=panicReasons[h]}else{const h=c?formatAbiItem$1(c,{includeName:!0}):void 0,y=c&&p?formatAbiItemWithArgs({abiItem:c,args:p,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",y&&y!=="()"?` ${[...Array(d?.length??0).keys()].map(()=>" ").join("")}${y}`:""]}}catch(c){i=c}else o&&(s=o);let f;i instanceof AbiErrorSignatureNotFoundError&&(f=i.signature,a=[`Unable to decode signature "${f}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${f}.`]),super(s&&s!=="execution reverted"||f?[`The contract function "${n}" reverted with the following ${f?"signature":"reason"}:`,s||f].join(`
57
+ `),{name:"InvalidDefinitionTypeError"})}}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function encodeAbiParameters(e,t){if(e.length!==t.length)throw new AbiEncodingLengthMismatchError({expectedLength:e.length,givenLength:t.length});const r=prepareParams({params:e,values:t}),n=encodeParams(r);return n.length===0?"0x":n}function prepareParams({params:e,values:t}){const r=[];for(let n=0;n<e.length;n++)r.push(prepareParam({param:e[n],value:t[n]}));return r}function prepareParam({param:e,value:t}){const r=getArrayComponents(e.type);if(r){const[n,o]=r;return encodeArray(t,{length:n,param:{...e,type:o}})}if(e.type==="tuple")return encodeTuple(t,{param:e});if(e.type==="address")return encodeAddress(t);if(e.type==="bool")return encodeBool(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,o="256"]=integerRegex.exec(e.type)??[];return encodeNumber(t,{signed:n,size:Number(o)})}if(e.type.startsWith("bytes"))return encodeBytes(t,{param:e});if(e.type==="string")return encodeString(t);throw new InvalidAbiEncodingTypeError(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function encodeParams(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:u,encoded:a}=e[i];u?t+=32:t+=size$1(a)}const r=[],n=[];let o=0;for(let i=0;i<e.length;i++){const{dynamic:u,encoded:a}=e[i];u?(r.push(numberToHex(t+o,{size:32})),n.push(a),o+=size$1(a)):r.push(a)}return concat([...r,...n])}function encodeAddress(e){if(!isAddress$1(e))throw new InvalidAddressError({address:e});return{dynamic:!1,encoded:padHex(e.toLowerCase())}}function encodeArray(e,{length:t,param:r}){const n=t===null;if(!Array.isArray(e))throw new InvalidArrayError(e);if(!n&&e.length!==t)throw new AbiEncodingArrayLengthMismatchError({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let o=!1;const i=[];for(let u=0;u<e.length;u++){const a=prepareParam({param:r,value:e[u]});a.dynamic&&(o=!0),i.push(a)}if(n||o){const u=encodeParams(i);if(n){const a=numberToHex(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?concat([a,u]):a}}if(o)return{dynamic:!0,encoded:u}}return{dynamic:!1,encoded:concat(i.map(({encoded:u})=>u))}}function encodeBytes(e,{param:t}){const[,r]=t.type.split("bytes"),n=size$1(e);if(!r){let o=e;return n%32!==0&&(o=padHex(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:concat([padHex(numberToHex(n,{size:32})),o])}}if(n!==Number.parseInt(r,10))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:padHex(e,{dir:"right"})}}function encodeBool(e){if(typeof e!="boolean")throw new BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(e))}}function encodeNumber(e,{signed:t,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new IntegerOutOfRangeError({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:numberToHex(e,{size:32,signed:t})}}function encodeString(e){const t=stringToHex(e),r=Math.ceil(size$1(t)/32),n=[];for(let o=0;o<r;o++)n.push(padHex(slice(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:concat([padHex(numberToHex(size$1(t),{size:32})),...n])}}function encodeTuple(e,{param:t}){let r=!1;const n=[];for(let o=0;o<t.components.length;o++){const i=t.components[o],u=Array.isArray(e)?o:i.name,a=prepareParam({param:i,value:e[u]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?encodeParams(n):concat(n.map(({encoded:o})=>o))}}function getArrayComponents(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const stringify$1=(e,t,r)=>JSON.stringify(e,(n,o)=>typeof o=="bigint"?o.toString():o,r);class InvalidDomainError extends BaseError{constructor({domain:t}){super(`Invalid domain "${stringify$1(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class InvalidPrimaryTypeError extends BaseError{constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class InvalidStructTypeError extends BaseError{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function serializeTypedData(e){const{domain:t,message:r,primaryType:n,types:o}=e,i=(s,f)=>{const c={...f};for(const d of s){const{name:p,type:h}=d;h==="address"&&(c[p]=c[p].toLowerCase())}return c},u=o.EIP712Domain?t?i(o.EIP712Domain,t):{}:{},a=(()=>{if(n!=="EIP712Domain")return i(o[n],r)})();return stringify$1({domain:u,message:a,primaryType:n,types:o})}function validateTypedData(e){const{domain:t,message:r,primaryType:n,types:o}=e,i=(u,a)=>{for(const s of u){const{name:f,type:c}=s,d=a[f],p=c.match(integerRegex);if(p&&(typeof d=="number"||typeof d=="bigint")){const[b,w,S]=p;numberToHex(d,{signed:w==="int",size:Number.parseInt(S,10)/8})}if(c==="address"&&typeof d=="string"&&!isAddress$1(d))throw new InvalidAddressError({address:d});const h=c.match(bytesRegex);if(h){const[b,w]=h;if(w&&size$1(d)!==Number.parseInt(w,10))throw new BytesSizeMismatchError({expectedSize:Number.parseInt(w,10),givenSize:size$1(d)})}const y=o[c];y&&(validateReference(c),i(y,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new InvalidDomainError({domain:t});i(o.EIP712Domain,t)}if(n!=="EIP712Domain")if(o[n])i(o[n],r);else throw new InvalidPrimaryTypeError({primaryType:n,types:o})}function getTypesForEIP712Domain({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId=="number"||typeof e?.chainId=="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function validateReference(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new InvalidStructTypeError({type:e})}function hashTypedData(e){const{domain:t={},message:r,primaryType:n}=e,o={EIP712Domain:getTypesForEIP712Domain({domain:t}),...e.types};validateTypedData({domain:t,message:r,primaryType:n,types:o});const i=["0x1901"];return t&&i.push(hashDomain({domain:t,types:o})),n!=="EIP712Domain"&&i.push(hashStruct({data:r,primaryType:n,types:o})),keccak256$2(concat(i))}function hashDomain({domain:e,types:t}){return hashStruct({data:e,primaryType:"EIP712Domain",types:t})}function hashStruct({data:e,primaryType:t,types:r}){const n=encodeData({data:e,primaryType:t,types:r});return keccak256$2(n)}function encodeData({data:e,primaryType:t,types:r}){const n=[{type:"bytes32"}],o=[hashType({primaryType:t,types:r})];for(const i of r[t]){const[u,a]=encodeField({types:r,name:i.name,type:i.type,value:e[i.name]});n.push(u),o.push(a)}return encodeAbiParameters(n,o)}function hashType({primaryType:e,types:t}){const r=toHex(encodeType({primaryType:e,types:t}));return keccak256$2(r)}function encodeType({primaryType:e,types:t}){let r="";const n=findTypeDependencies({primaryType:e,types:t});n.delete(e);const o=[e,...Array.from(n).sort()];for(const i of o)r+=`${i}(${t[i].map(({name:u,type:a})=>`${a} ${u}`).join(",")})`;return r}function findTypeDependencies({primaryType:e,types:t},r=new Set){const o=e.match(/^\w*/u)?.[0];if(r.has(o)||t[o]===void 0)return r;r.add(o);for(const i of t[o])findTypeDependencies({primaryType:i.type,types:t},r);return r}function encodeField({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},keccak256$2(encodeData({data:n,primaryType:r,types:e}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},keccak256$2(n)];if(r==="string")return[{type:"bytes32"},keccak256$2(toHex(n))];if(r.lastIndexOf("]")===r.length-1){const o=r.slice(0,r.lastIndexOf("[")),i=n.map(u=>encodeField({name:t,type:o,types:e,value:u}));return[{type:"bytes32"},keccak256$2(encodeAbiParameters(i.map(([u])=>u),i.map(([,u])=>u)))]}return[{type:r},n]}async function signTypedData$1(e){const{privateKey:t,...r}=e;return await sign$3({hash:hashTypedData(r),privateKey:t,to:"hex"})}function privateKeyToAccount(e,t={}){const{nonceManager:r}=t,n=toHex(secp256k1$1.getPublicKey(e.slice(2),!1)),o=publicKeyToAddress(n);return{...toAccount({address:o,nonceManager:r,async sign({hash:u}){return sign$3({hash:u,privateKey:e,to:"hex"})},async signAuthorization(u){return signAuthorization$1({...u,privateKey:e})},async signMessage({message:u}){return signMessage$1({message:u,privateKey:e})},async signTransaction(u,{serializer:a}={}){return signTransaction$1({privateKey:e,transaction:u,serializer:a})},async signTypedData(u){return signTypedData$1({...u,privateKey:e})}}),publicKey:n,source:"privateKey"}}function parseAccount(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}function execTyped(e,t){return e.exec(t)?.groups}const tupleRegex=/^tuple(?<array>(\[(\d*)\])*)$/;function formatAbiParameter(e){let t=e.type;if(tupleRegex.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let o=0;o<r;o++){const i=e.components[o];t+=formatAbiParameter(i),o<r-1&&(t+=", ")}const n=execTyped(tupleRegex,e.type);return t+=`)${n?.array??""}`,formatAbiParameter({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function formatAbiParameters(e){let t="";const r=e.length;for(let n=0;n<r;n++){const o=e[n];t+=formatAbiParameter(o),n!==r-1&&(t+=", ")}return t}function formatAbiItem(e){return e.type==="function"?`function ${e.name}(${formatAbiParameters(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${formatAbiParameters(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${formatAbiParameters(e.inputs)})`:e.type==="error"?`error ${e.name}(${formatAbiParameters(e.inputs)})`:e.type==="constructor"?`constructor(${formatAbiParameters(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function getAction(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const o=e[r];return typeof o=="function"?o:i=>t(e,i)}const hash$3=e=>keccak256$2(toBytes$1(e));function hashSignature(e){return hash$3(e)}function normalizeSignature(e){let t=!0,r="",n=0,o="",i=!1;for(let u=0;u<e.length;u++){const a=e[u];if(["(",")",","].includes(a)&&(t=!0),a==="("&&n++,a===")"&&n--,!!t){if(n===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){e[u-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}o+=a,r+=a}}if(!i)throw new BaseError("Unable to normalize signature.");return o}const toSignature=e=>{const t=typeof e=="string"?e:formatAbiItem(e);return normalizeSignature(t)};function toSignatureHash(e){return hashSignature(toSignature(e))}const toEventSelector=toSignatureHash,toFunctionSelector=e=>slice(toSignatureHash(e),0,4);function getAbiItem(e){const{abi:t,args:r=[],name:n}=e,o=isHex$1(n,{strict:!1}),i=t.filter(a=>o?a.type==="function"?toFunctionSelector(a)===n:a.type==="event"?toEventSelector(a)===n:!1:"name"in a&&a.name===n);if(i.length===0)return;if(i.length===1)return i[0];let u;for(const a of i){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((f,c)=>{const d="inputs"in a&&a.inputs[c];return d?isArgOfType(f,d):!1})){if(u&&"inputs"in u&&u.inputs){const f=getAmbiguousTypes(a.inputs,u.inputs,r);if(f)throw new AbiItemAmbiguityError({abiItem:a,type:f[0]},{abiItem:u,type:f[1]})}u=a}}return u||i[0]}function isArgOfType(e,t){const r=typeof e,n=t.type;switch(n){case"address":return isAddress$1(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>isArgOfType(Object.values(e)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>isArgOfType(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(e,t,r){for(const n in e){const o=e[n],i=t[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return getAmbiguousTypes(o.components,i.components,r[n]);const u=[o.type,i.type];if(u.includes("address")&&u.includes("bytes20")?!0:u.includes("address")&&u.includes("string")?isAddress$1(r[n],{strict:!1}):u.includes("address")&&u.includes("bytes")?isAddress$1(r[n],{strict:!1}):!1)return u}}const docsPath$1="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(e){const{abi:t,args:r,functionName:n}=e;let o=t[0];if(n){const i=getAbiItem({abi:t,args:r,name:n});if(!i)throw new AbiFunctionNotFoundError(n,{docsPath:docsPath$1});o=i}if(o.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$1});return{abi:[o],functionName:toFunctionSelector(formatAbiItem$1(o))}}function encodeFunctionData(e){const{args:t}=e,{abi:r,functionName:n}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:prepareEncodeFunctionData(e),o=r[0],i=n,u="inputs"in o&&o.inputs?encodeAbiParameters(o.inputs,t??[]):void 0;return concatHex([i,u??"0x"])}const panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function bytesToBigInt(e,t={}){typeof t.size<"u"&&assertSize(e,{size:t.size});const r=bytesToHex$3(e,t);return hexToBigInt(r,t)}function bytesToBool(e,t={}){let r=e;if(typeof t.size<"u"&&(assertSize(r,{size:t.size}),r=trim(r)),r.length>1||r[0]>1)throw new InvalidBytesBooleanError(r);return!!r[0]}function bytesToNumber(e,t={}){typeof t.size<"u"&&assertSize(e,{size:t.size});const r=bytesToHex$3(e,t);return hexToNumber$2(r,t)}function bytesToString$1(e,t={}){let r=e;return typeof t.size<"u"&&(assertSize(r,{size:t.size}),r=trim(r,{dir:"right"})),new TextDecoder().decode(r)}function decodeAbiParameters(e,t){const r=typeof t=="string"?hexToBytes$1(t):t,n=createCursor(r);if(size$1(r)===0&&e.length>0)throw new AbiDecodingZeroDataError;if(size$1(t)&&size$1(t)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof t=="string"?t:bytesToHex$3(t),params:e,size:size$1(t)});let o=0;const i=[];for(let u=0;u<e.length;++u){const a=e[u];n.setPosition(o);const[s,f]=decodeParameter(n,a,{staticPosition:0});o+=f,i.push(s)}return i}function decodeParameter(e,t,{staticPosition:r}){const n=getArrayComponents(t.type);if(n){const[o,i]=n;return decodeArray(e,{...t,type:i},{length:o,staticPosition:r})}if(t.type==="tuple")return decodeTuple(e,t,{staticPosition:r});if(t.type==="address")return decodeAddress$1(e);if(t.type==="bool")return decodeBool(e);if(t.type.startsWith("bytes"))return decodeBytes(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return decodeNumber(e,t);if(t.type==="string")return decodeString(e,{staticPosition:r});throw new InvalidAbiDecodingTypeError(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const sizeOfLength=32,sizeOfOffset=32;function decodeAddress$1(e){const t=e.readBytes(32);return[checksumAddress(bytesToHex$3(sliceBytes(t,-20))),32]}function decodeArray(e,t,{length:r,staticPosition:n}){if(!r){const u=bytesToNumber(e.readBytes(sizeOfOffset)),a=n+u,s=a+sizeOfLength;e.setPosition(a);const f=bytesToNumber(e.readBytes(sizeOfLength)),c=hasDynamicChild(t);let d=0;const p=[];for(let h=0;h<f;++h){e.setPosition(s+(c?h*32:d));const[y,b]=decodeParameter(e,t,{staticPosition:s});d+=b,p.push(y)}return e.setPosition(n+32),[p,32]}if(hasDynamicChild(t)){const u=bytesToNumber(e.readBytes(sizeOfOffset)),a=n+u,s=[];for(let f=0;f<r;++f){e.setPosition(a+f*32);const[c]=decodeParameter(e,t,{staticPosition:a});s.push(c)}return e.setPosition(n+32),[s,32]}let o=0;const i=[];for(let u=0;u<r;++u){const[a,s]=decodeParameter(e,t,{staticPosition:n+o});o+=s,i.push(a)}return[i,o]}function decodeBool(e){return[bytesToBool(e.readBytes(32),{size:32}),32]}function decodeBytes(e,t,{staticPosition:r}){const[n,o]=t.type.split("bytes");if(!o){const u=bytesToNumber(e.readBytes(32));e.setPosition(r+u);const a=bytesToNumber(e.readBytes(32));if(a===0)return e.setPosition(r+32),["0x",32];const s=e.readBytes(a);return e.setPosition(r+32),[bytesToHex$3(s),32]}return[bytesToHex$3(e.readBytes(Number.parseInt(o,10),32)),32]}function decodeNumber(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[n>48?bytesToBigInt(o,{signed:r}):bytesToNumber(o,{signed:r}),32]}function decodeTuple(e,t,{staticPosition:r}){const n=t.components.length===0||t.components.some(({name:u})=>!u),o=n?[]:{};let i=0;if(hasDynamicChild(t)){const u=bytesToNumber(e.readBytes(sizeOfOffset)),a=r+u;for(let s=0;s<t.components.length;++s){const f=t.components[s];e.setPosition(a+i);const[c,d]=decodeParameter(e,f,{staticPosition:a});i+=d,o[n?s:f?.name]=c}return e.setPosition(r+32),[o,32]}for(let u=0;u<t.components.length;++u){const a=t.components[u],[s,f]=decodeParameter(e,a,{staticPosition:r});o[n?u:a?.name]=s,i+=f}return[o,i]}function decodeString(e,{staticPosition:t}){const r=bytesToNumber(e.readBytes(32)),n=t+r;e.setPosition(n);const o=bytesToNumber(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const i=e.readBytes(o,32),u=bytesToString$1(trim(i));return e.setPosition(t+32),[u,32]}function hasDynamicChild(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(hasDynamicChild);const r=getArrayComponents(e.type);return!!(r&&hasDynamicChild({...e,type:r[1]}))}function decodeErrorResult(e){const{abi:t,data:r}=e,n=slice(r,0,4);if(n==="0x")throw new AbiDecodingZeroDataError;const i=[...t||[],solidityError,solidityPanic].find(u=>u.type==="error"&&n===toFunctionSelector(formatAbiItem$1(u)));if(!i)throw new AbiErrorSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?decodeAbiParameters(i.inputs,slice(r,4)):void 0,errorName:i.name}}function formatAbiItemWithArgs({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((o,i)=>`${n&&o.name?`${o.name}: `:""}${typeof t[i]=="object"?stringify$1(t[i]):t[i]}`).join(", ")})`}class AccountStateConflictError extends BaseError{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}const getContractAddress=e=>e,getUrl=e=>e;class ContractFunctionExecutionError extends BaseError{constructor(t,{abi:r,args:n,contractAddress:o,docsPath:i,functionName:u,sender:a}){const s=getAbiItem({abi:r,args:n,name:u}),f=s?formatAbiItemWithArgs({abiItem:s,args:n,includeFunctionName:!1,includeName:!1}):void 0,c=s?formatAbiItem$1(s,{includeName:!0}):void 0,d=prettyPrint({address:o&&getContractAddress(o),function:c,args:f&&f!=="()"&&`${[...Array(u?.length??0).keys()].map(()=>" ").join("")}${f}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${u}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=t,this.contractAddress=o,this.functionName=u,this.sender=a}}class ContractFunctionRevertedError extends BaseError{constructor({abi:t,data:r,functionName:n,message:o}){let i,u,a,s;if(r&&r!=="0x")try{u=decodeErrorResult({abi:t,data:r});const{abiItem:c,errorName:d,args:p}=u;if(d==="Error")s=p[0];else if(d==="Panic"){const[h]=p;s=panicReasons[h]}else{const h=c?formatAbiItem$1(c,{includeName:!0}):void 0,y=c&&p?formatAbiItemWithArgs({abiItem:c,args:p,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",y&&y!=="()"?` ${[...Array(d?.length??0).keys()].map(()=>" ").join("")}${y}`:""]}}catch(c){i=c}else o&&(s=o);let f;i instanceof AbiErrorSignatureNotFoundError&&(f=i.signature,a=[`Unable to decode signature "${f}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${f}.`]),super(s&&s!=="execution reverted"||f?[`The contract function "${n}" reverted with the following ${f?"signature":"reason"}:`,s||f].join(`
58
58
  `):`The contract function "${n}" reverted.`,{cause:i,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=u,this.raw=r,this.reason=s,this.signature=f}}class ContractFunctionZeroDataError extends BaseError{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class RawContractError extends BaseError{constructor({data:t,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class HttpRequestError extends BaseError{constructor({body:t,cause:r,details:n,headers:o,status:i,url:u}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[i&&`Status: ${i}`,`URL: ${getUrl(u)}`,t&&`Request body: ${stringify$1(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=i,this.url=u}}class RpcRequestError extends BaseError{constructor({body:t,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${getUrl(n)}`,`Request body: ${stringify$1(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data}}class TimeoutError extends BaseError{constructor({body:t,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl(r)}`,`Request body: ${stringify$1(t)}`],name:"TimeoutError"})}}const unknownErrorCode=-1;let RpcError$1=class extends BaseError{constructor(t,{code:r,docsPath:n,metaMessages:o,name:i,shortMessage:u}){super(u,{cause:t,docsPath:n,metaMessages:o||t?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||t.name,this.code=t instanceof RpcRequestError?t.code:r??unknownErrorCode}};class ProviderRpcError extends RpcError$1{constructor(t,r){super(t,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class ParseRpcError extends RpcError$1{constructor(t){super(t,{code:ParseRpcError.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError$1{constructor(t){super(t,{code:InvalidRequestRpcError.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError$1{constructor(t,{method:r}={}){super(t,{code:MethodNotFoundRpcError.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError$1{constructor(t){super(t,{code:InvalidParamsRpcError.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
59
59
  `)})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError$1{constructor(t){super(t,{code:InternalRpcError.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError$1{constructor(t){super(t,{code:InvalidInputRpcError.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
60
- `)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError$1{constructor(t){super(t,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError$1{constructor(t){super(t,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError$1{constructor(t){super(t,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError$1{constructor(t,{method:r}={}){super(t,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError$1{constructor(t){super(t,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError$1{constructor(t){super(t,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(t){super(t,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(t){super(t,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(t,{method:r}={}){super(t,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(t){super(t,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(t){super(t,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(t){super(t,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnsupportedNonOptionalCapabilityError extends ProviderRpcError{constructor(t){super(t,{code:UnsupportedNonOptionalCapabilityError.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(UnsupportedNonOptionalCapabilityError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class UnsupportedChainIdError extends ProviderRpcError{constructor(t){super(t,{code:UnsupportedChainIdError.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(UnsupportedChainIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class DuplicateIdError extends ProviderRpcError{constructor(t){super(t,{code:DuplicateIdError.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(DuplicateIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class UnknownBundleIdError extends ProviderRpcError{constructor(t){super(t,{code:UnknownBundleIdError.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(UnknownBundleIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class BundleTooLargeError extends ProviderRpcError{constructor(t){super(t,{code:BundleTooLargeError.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(BundleTooLargeError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError{constructor(t){super(t,{code:AtomicReadyWalletRejectedUpgradeError.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(AtomicReadyWalletRejectedUpgradeError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class AtomicityNotSupportedError extends ProviderRpcError{constructor(t){super(t,{code:AtomicityNotSupportedError.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(AtomicityNotSupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class UnknownRpcError extends RpcError$1{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(e,{abi:t,address:r,args:n,docsPath:o,functionName:i,sender:u}){const a=e instanceof RawContractError?e:e instanceof BaseError?e.walk(y=>"data"in y)||e.walk():{},{code:s,data:f,details:c,message:d,shortMessage:p}=a,h=e instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:i}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(s)&&(f||c||d||p)?new ContractFunctionRevertedError({abi:t,data:typeof f=="object"?f.data:f,functionName:i,message:a instanceof RpcRequestError?c:p??d}):e;return new ContractFunctionExecutionError(h,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:i,sender:u})}const scriptRel="modulepreload",assetsURL=function(e){return"/"+e},seen={},__vitePreload=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){let f=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};var u=f;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");o=f(r.map(c=>{if(c=assetsURL(c),c in seen)return;seen[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":scriptRel,d||(h.as="script"),h.crossOrigin="",h.href=c,s&&h.setAttribute("nonce",s),document.head.appendChild(h),d)return new Promise((y,b)=>{h.addEventListener("load",y),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return o.then(a=>{for(const s of a||[])s.status==="rejected"&&i(s.reason);return t().catch(i)})};async function recoverPublicKey({hash:e,signature:t}){const r=isHex$1(e)?e:toHex(e),{secp256k1:n}=await __vitePreload(async()=>{const{secp256k1:u}=await Promise.resolve().then(()=>secp256k1$2);return{secp256k1:u}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:f,s:c,v:d,yParity:p}=t,h=Number(p??d),y=toRecoveryBit(h);return new n.Signature(hexToBigInt(f),hexToBigInt(c)).addRecoveryBit(y)}const u=isHex$1(t)?t:toHex(t);if(size$1(u)!==65)throw new Error("invalid signature length");const a=hexToNumber$2(`0x${u.slice(130)}`),s=toRecoveryBit(a);return n.Signature.fromCompact(u.substring(2,130)).addRecoveryBit(s)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function toRecoveryBit(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function recoverAddress({hash:e,signature:t}){return publicKeyToAddress(await recoverPublicKey({hash:e,signature:t}))}async function recoverAuthorizationAddress(e){const{authorization:t,signature:r}=e;return recoverAddress({hash:hashAuthorization(t),signature:r??t})}class EstimateGasExecutionError extends BaseError{constructor(t,{account:r,docsPath:n,chain:o,data:i,gas:u,gasPrice:a,maxFeePerGas:s,maxPriorityFeePerGas:f,nonce:c,to:d,value:p}){const h=prettyPrint({from:r?.address,to:d,value:typeof p<"u"&&`${formatEther(p)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:u,gasPrice:typeof a<"u"&&`${formatGwei(a)} gwei`,maxFeePerGas:typeof s<"u"&&`${formatGwei(s)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${formatGwei(f)} gwei`,nonce:c});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function getNodeError(e,t){const r=(e.details||"").toLowerCase(),n=e instanceof BaseError?e.walk(o=>o?.code===ExecutionRevertedError.code):e;return n instanceof BaseError?new ExecutionRevertedError({cause:e,message:n.details}):ExecutionRevertedError.nodeMessage.test(r)?new ExecutionRevertedError({cause:e,message:e.details}):FeeCapTooHighError.nodeMessage.test(r)?new FeeCapTooHighError({cause:e,maxFeePerGas:t?.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(r)?new FeeCapTooLowError({cause:e,maxFeePerGas:t?.maxFeePerGas}):NonceTooHighError.nodeMessage.test(r)?new NonceTooHighError({cause:e,nonce:t?.nonce}):NonceTooLowError.nodeMessage.test(r)?new NonceTooLowError({cause:e,nonce:t?.nonce}):NonceMaxValueError.nodeMessage.test(r)?new NonceMaxValueError({cause:e,nonce:t?.nonce}):InsufficientFundsError.nodeMessage.test(r)?new InsufficientFundsError({cause:e}):IntrinsicGasTooHighError.nodeMessage.test(r)?new IntrinsicGasTooHighError({cause:e,gas:t?.gas}):IntrinsicGasTooLowError.nodeMessage.test(r)?new IntrinsicGasTooLowError({cause:e,gas:t?.gas}):TransactionTypeNotSupportedError.nodeMessage.test(r)?new TransactionTypeNotSupportedError({cause:e}):TipAboveFeeCapError.nodeMessage.test(r)?new TipAboveFeeCapError({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new UnknownNodeError({cause:e})}function getEstimateGasError(e,{docsPath:t,...r}){const n=(()=>{const o=getNodeError(e,r);return o instanceof UnknownNodeError?e:o})();return new EstimateGasExecutionError(n,{docsPath:t,...r})}function extract(e,{format:t}){if(!t)return{};const r={};function n(i){const u=Object.keys(i);for(const a of u)a in e&&(r[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&n(i[a])}const o=t(e||{});return n(o),r}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=formatAuthorizationList$1(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(r=>bytesToHex$3(r)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=numberToHex$1(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=numberToHex$1(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=numberToHex$1(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=numberToHex$1(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=numberToHex$1(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=numberToHex$1(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=rpcTransactionType[e.type]),typeof e.value<"u"&&(t.value=numberToHex$1(e.value)),t}function formatAuthorizationList$1(e){return e.map(t=>({address:t.address,r:t.r?numberToHex$1(BigInt(t.r)):t.r,s:t.s?numberToHex$1(BigInt(t.s)):t.s,chainId:numberToHex$1(t.chainId),nonce:numberToHex$1(t.nonce),...typeof t.yParity<"u"?{yParity:numberToHex$1(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:numberToHex$1(t.v)}:{}}))}function serializeStateMapping(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new InvalidBytesLengthError({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function serializeAccountStateOverride(e){const{balance:t,nonce:r,state:n,stateDiff:o,code:i}=e,u={};if(i!==void 0&&(u.code=i),t!==void 0&&(u.balance=numberToHex$1(t)),r!==void 0&&(u.nonce=numberToHex$1(r)),n!==void 0&&(u.state=serializeStateMapping(n)),o!==void 0){if(u.state)throw new StateAssignmentConflictError;u.stateDiff=serializeStateMapping(o)}return u}function serializeStateOverride(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!isAddress$1(r,{strict:!1}))throw new InvalidAddressError({address:r});if(t[r])throw new AccountStateConflictError({address:r});t[r]=serializeAccountStateOverride(n)}return t}function assertRequest(e){const{account:t,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:o,to:i}=e,u=t?parseAccount(t):void 0;if(u&&!isAddress$1(u.address))throw new InvalidAddressError({address:u.address});if(i&&!isAddress$1(i))throw new InvalidAddressError({address:i});if(typeof r<"u"&&(typeof n<"u"||typeof o<"u"))throw new FeeConflictError;if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n});if(o&&n&&o>n)throw new TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:o})}class BaseFeeScalarError extends BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Eip1559FeesNotSupportedError extends BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class MaxFeePerGasTooLowError extends BaseError{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class BlockNotFoundError extends BaseError{constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?hexToNumber$2(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?hexToNumber$2(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?transactionType[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=formatAuthorizationList(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}function formatAuthorizationList(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function formatBlock(e){const t=(e.transactions??[]).map(r=>typeof r=="string"?r:formatTransaction(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function getBlock(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:o}={}){const i=o??!1,u=r!==void 0?numberToHex$1(r):void 0;let a=null;if(t?a=await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):a=await e.request({method:"eth_getBlockByNumber",params:[u||n,i]},{dedupe:!!u}),!a)throw new BlockNotFoundError({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||formatBlock)(a)}async function getGasPrice(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function internal_estimateMaxPriorityFeePerGas(e,t){const{block:r,chain:n=e.chain,request:o}=t||{};try{const i=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof i=="function"){const a=r||await getAction(e,getBlock,"getBlock")({}),s=await i({block:a,client:e,request:o});if(s===null)throw new Error;return s}if(typeof i<"u")return i;const u=await e.request({method:"eth_maxPriorityFeePerGas"});return hexToBigInt(u)}catch{const[i,u]=await Promise.all([r?Promise.resolve(r):getAction(e,getBlock,"getBlock")({}),getAction(e,getGasPrice,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const a=u-i.baseFeePerGas;return a<0n?0n:a}}async function internal_estimateFeesPerGas(e,t){const{block:r,chain:n=e.chain,request:o,type:i="eip1559"}=t||{},u=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:o}):n?.fees?.baseFeeMultiplier??1.2)();if(u<1)throw new BaseFeeScalarError;const s=10**(u.toString().split(".")[1]?.length??0),f=p=>p*BigInt(Math.ceil(u*s))/BigInt(s),c=r||await getAction(e,getBlock,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){const p=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:f,request:o,type:i});if(p!==null)return p}if(i==="eip1559"){if(typeof c.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const p=typeof o?.maxPriorityFeePerGas=="bigint"?o.maxPriorityFeePerGas:await internal_estimateMaxPriorityFeePerGas(e,{block:c,chain:n,request:o}),h=f(c.baseFeePerGas);return{maxFeePerGas:o?.maxFeePerGas??h+p,maxPriorityFeePerGas:p}}return{gasPrice:o?.gasPrice??f(await getAction(e,getGasPrice,"getGasPrice")({}))}}async function getChainId(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return hexToNumber$2(t)}const defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],eip1559NetworkCache=new Map;async function prepareTransactionRequest(e,t){const{account:r=e.account,blobs:n,chain:o,gas:i,kzg:u,nonce:a,nonceManager:s,parameters:f=defaultParameters,type:c}=t,d=r&&parseAccount(r),p={...t,...d?{from:d?.address}:{}};let h;async function y(){return h||(h=await getAction(e,getBlock,"getBlock")({blockTag:"latest"}),h)}let b;async function w(){return b||(o?o.id:typeof t.chainId<"u"?t.chainId:(b=await getAction(e,getChainId,"getChainId")({}),b))}if(f.includes("nonce")&&typeof a>"u"&&d)if(s){const S=await w();p.nonce=await s.consume({address:d.address,chainId:S,client:e})}else p.nonce=await getAction(e,getTransactionCount,"getTransactionCount")({address:d.address,blockTag:"pending"});if((f.includes("blobVersionedHashes")||f.includes("sidecars"))&&n&&u){const S=blobsToCommitments({blobs:n,kzg:u});if(f.includes("blobVersionedHashes")){const E=commitmentsToVersionedHashes({commitments:S,to:"hex"});p.blobVersionedHashes=E}if(f.includes("sidecars")){const E=blobsToProofs({blobs:n,commitments:S,kzg:u}),B=toBlobSidecars({blobs:n,commitments:S,proofs:E,to:"hex"});p.sidecars=B}}if(f.includes("chainId")&&(p.chainId=await w()),(f.includes("fees")||f.includes("type"))&&typeof c>"u")try{p.type=getTransactionType(p)}catch{let S=eip1559NetworkCache.get(e.uid);typeof S>"u"&&(S=typeof(await y())?.baseFeePerGas=="bigint",eip1559NetworkCache.set(e.uid,S)),p.type=S?"eip1559":"legacy"}if(f.includes("fees"))if(p.type!=="legacy"&&p.type!=="eip2930"){if(typeof p.maxFeePerGas>"u"||typeof p.maxPriorityFeePerGas>"u"){const S=await y(),{maxFeePerGas:E,maxPriorityFeePerGas:B}=await internal_estimateFeesPerGas(e,{block:S,chain:o,request:p});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<B)throw new MaxFeePerGasTooLowError({maxPriorityFeePerGas:B});p.maxPriorityFeePerGas=B,p.maxFeePerGas=E}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new Eip1559FeesNotSupportedError;if(typeof t.gasPrice>"u"){const S=await y(),{gasPrice:E}=await internal_estimateFeesPerGas(e,{block:S,chain:o,request:p,type:"legacy"});p.gasPrice=E}}return f.includes("gas")&&typeof i>"u"&&(p.gas=await getAction(e,estimateGas,"estimateGas")({...p,account:d&&{address:d.address,type:"json-rpc"}})),assertRequest(p),delete p.parameters,p}async function getBalance(e,{address:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}){const o=typeof r=="bigint"?numberToHex$1(r):void 0,i=await e.request({method:"eth_getBalance",params:[t,o||n]});return BigInt(i)}async function estimateGas(e,t){const{account:r=e.account}=t,n=r?parseAccount(r):void 0;try{let ce=function(se){const{block:vt,request:ur,rpcStateOverride:ue}=se;return e.request({method:"eth_estimateGas",params:ue?[ur,vt??e.experimental_blockTag??"latest",ue]:vt?[ur,vt]:[ur]})};var o=ce;const{accessList:i,authorizationList:u,blobs:a,blobVersionedHashes:s,blockNumber:f,blockTag:c,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:S,value:E,stateOverride:B,...ae}=await prepareTransactionRequest(e,{...t,parameters:n?.type==="local"?void 0:["blobVersionedHashes"]}),J=(typeof f=="bigint"?numberToHex$1(f):void 0)||c,ve=serializeStateOverride(B),Qe=await(async()=>{if(ae.to)return ae.to;if(u&&u.length>0)return await recoverAuthorizationAddress({authorization:u[0]}).catch(()=>{throw new BaseError("`to` is required. Could not infer from `authorizationList`")})})();assertRequest(t);const kt=e.chain?.formatters?.transactionRequest?.format,sr=(kt||formatTransactionRequest)({...extract(ae,{format:kt}),from:n?.address,accessList:i,authorizationList:u,blobs:a,blobVersionedHashes:s,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:S,to:Qe,value:E});let Ze=BigInt(await ce({block:J,request:sr,rpcStateOverride:ve}));if(u){const se=await getBalance(e,{address:sr.from}),vt=await Promise.all(u.map(async ur=>{const{address:ue}=ur,bt=await ce({block:J,request:{authorizationList:void 0,data:d,from:n?.address,to:ue,value:numberToHex$1(se)},rpcStateOverride:ve}).catch(()=>100000n);return 2n*BigInt(bt)}));Ze+=vt.reduce((ur,ue)=>ur+ue,0n)}return Ze}catch(i){throw getEstimateGasError(i,{...t,account:n,chain:e.chain})}}function isAddressEqual(e,t){if(!isAddress$1(e,{strict:!1}))throw new InvalidAddressError({address:e});if(!isAddress$1(t,{strict:!1}))throw new InvalidAddressError({address:t});return e.toLowerCase()===t.toLowerCase()}const docsPath="/docs/contract/encodeDeployData";function encodeDeployData(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const o=t.find(u=>"type"in u&&u.type==="constructor");if(!o)throw new AbiConstructorNotFoundError({docsPath});if(!("inputs"in o))throw new AbiConstructorParamsNotFoundError({docsPath});if(!o.inputs||o.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath});const i=encodeAbiParameters(o.inputs,r);return concatHex([n,i])}function withResolvers(){let e=()=>{},t=()=>{};return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}const schedulerCache=new Map;function createBatchScheduler({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:o}){const i=async()=>{const c=s();u();const d=c.map(({args:p})=>p);d.length!==0&&e(d).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let h=0;h<c.length;h++){const{resolve:y}=c[h];y?.([p[h],p])}}).catch(p=>{for(let h=0;h<c.length;h++){const{reject:y}=c[h];y?.(p)}})},u=()=>schedulerCache.delete(t),a=()=>s().map(({args:c})=>c),s=()=>schedulerCache.get(t)||[],f=c=>schedulerCache.set(t,[...s(),c]);return{flush:u,async schedule(c){const{promise:d,resolve:p,reject:h}=withResolvers();return r?.([...a(),c])&&i(),s().length>0?(f({args:c,resolve:p,reject:h}),d):(f({args:c,resolve:p,reject:h}),setTimeout(i,n),d)}}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(e,t,r){const n=++callbackCount,o=()=>listenersCache.get(e)||[],i=()=>{const c=o();listenersCache.set(e,c.filter(d=>d.id!==n))},u=()=>{const c=o();if(!c.some(p=>p.id===n))return;const d=cleanupCache.get(e);if(c.length===1&&d){const p=d();p instanceof Promise&&p.catch(()=>{})}i()},a=o();if(listenersCache.set(e,[...a,{id:n,fns:t}]),a&&a.length>0)return u;const s={};for(const c in t)s[c]=((...d)=>{const p=o();if(p.length!==0)for(const h of p)h.fns[c]?.(...d)});const f=r(s);return typeof f=="function"&&cleanupCache.set(e,f),u}async function wait(e){return new Promise(t=>setTimeout(t,e))}function poll(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let o=!0;const i=()=>o=!1;return(async()=>{let a;a=await e({unpoll:i});const s=await r?.(a)??n;await wait(s);const f=async()=>{o&&(await e({unpoll:i}),await wait(n),f())};f()})(),i}class AccountNotFoundError extends BaseError{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
61
- `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class AccountTypeNotSupportedError extends BaseError{constructor({docsPath:t,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:t,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function assertCurrentChain({chain:e,currentChainId:t}){if(!e)throw new ChainNotFoundError;if(t!==e.id)throw new ChainMismatchError({chain:e,currentChainId:t})}function getTransactionError(e,{docsPath:t,...r}){const n=(()=>{const o=getNodeError(e,r);return o instanceof UnknownNodeError?e:o})();return new TransactionExecutionError(n,{docsPath:t,...r})}async function sendRawTransaction(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const supportsWalletNamespace=new LruMap(128);async function sendTransaction(e,t){const{account:r=e.account,chain:n=e.chain,accessList:o,authorizationList:i,blobs:u,data:a,gas:s,gasPrice:f,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,type:y,value:b,...w}=t;if(typeof r>"u")throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const S=r?parseAccount(r):null;try{assertRequest(t);const E=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await recoverAuthorizationAddress({authorization:i[0]}).catch(()=>{throw new BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(S?.type==="json-rpc"||S===null){let B;n!==null&&(B=await getAction(e,getChainId,"getChainId")({}),assertCurrentChain({currentChainId:B,chain:n}));const ae=e.chain?.formatters?.transactionRequest?.format,J=(ae||formatTransactionRequest)({...extract(w,{format:ae}),accessList:o,authorizationList:i,blobs:u,chainId:B,data:a,from:S?.address,gas:s,gasPrice:f,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:E,type:y,value:b}),ve=supportsWalletNamespace.get(e.uid),Qe=ve?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:Qe,params:[J]},{retryCount:0})}catch(kt){if(ve===!1)throw kt;const nr=kt;if(nr.name==="InvalidInputRpcError"||nr.name==="InvalidParamsRpcError"||nr.name==="MethodNotFoundRpcError"||nr.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[J]},{retryCount:0}).then(sr=>(supportsWalletNamespace.set(e.uid,!0),sr)).catch(sr=>{const ce=sr;throw ce.name==="MethodNotFoundRpcError"||ce.name==="MethodNotSupportedRpcError"?(supportsWalletNamespace.set(e.uid,!1),nr):ce});throw nr}}if(S?.type==="local"){const B=await getAction(e,prepareTransactionRequest,"prepareTransactionRequest")({account:S,accessList:o,authorizationList:i,blobs:u,chain:n,data:a,gas:s,gasPrice:f,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,nonceManager:S.nonceManager,parameters:[...defaultParameters,"sidecars"],type:y,value:b,...w,to:E}),ae=n?.serializers?.transaction,W=await S.signTransaction(B,{serializer:ae});return await getAction(e,sendRawTransaction,"sendRawTransaction")({serializedTransaction:W})}throw S?.type==="smart"?new AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:S?.type})}catch(E){throw E instanceof AccountTypeNotSupportedError?E:getTransactionError(E,{...t,account:S,chain:t.chain||void 0})}}async function writeContract(e,t){const{abi:r,account:n=e.account,address:o,args:i,dataSuffix:u,functionName:a,...s}=t;if(typeof n>"u")throw new AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const f=n?parseAccount(n):null,c=encodeFunctionData({abi:r,args:i,functionName:a});try{return await getAction(e,sendTransaction,"sendTransaction")({data:`${c}${u?u.replace("0x",""):""}`,to:o,account:f,...s})}catch(d){throw getContractError(d,{abi:r,address:o,args:i,docsPath:"/docs/contract/writeContract",functionName:a,sender:f?.address})}}class BundleFailedError extends BaseError{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}function withRetry(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((o,i)=>{const u=async({count:a=0}={})=>{const s=async({error:f})=>{const c=typeof t=="function"?t({count:a,error:f}):t;c&&await wait(c),u({count:a+1})};try{const f=await e();o(f)}catch(f){if(a<r&&await n({count:a,error:f}))return s({error:f});i(f)}};u()})}const receiptStatuses={"0x0":"reverted","0x1":"success"},fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",fallbackTransactionErrorMagicIdentifier=numberToHex$1(0,{size:32});async function sendCalls(e,t){const{account:r=e.account,capabilities:n,chain:o=e.chain,experimental_fallback:i,experimental_fallbackDelay:u=32,forceAtomic:a=!1,id:s,version:f="2.0.0"}=t,c=r?parseAccount(r):null,d=t.calls.map(p=>{const h=p,y=h.abi?encodeFunctionData({abi:h.abi,functionName:h.functionName,args:h.args}):h.data;return{data:h.dataSuffix&&y?concat([y,h.dataSuffix]):y,to:h.to,value:h.value?numberToHex$1(h.value):void 0}});try{const p=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:a,calls:d,capabilities:n,chainId:numberToHex$1(o.id),from:c?.address,id:s,version:f}]},{retryCount:0});return typeof p=="string"?{id:p}:p}catch(p){const h=p;if(i&&(h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"||h.name==="UnknownRpcError"||h.details.toLowerCase().includes("does not exist / is not available")||h.details.toLowerCase().includes("missing or invalid. request()")||h.details.toLowerCase().includes("did not match any variant of untagged enum")||h.details.toLowerCase().includes("account upgraded to unsupported contract")||h.details.toLowerCase().includes("eip-7702 not supported")||h.details.toLowerCase().includes("unsupported wc_ method")||h.details.toLowerCase().includes("feature toggled misconfigured"))){if(n&&Object.values(n).some(E=>!E.optional)){const E="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new UnsupportedNonOptionalCapabilityError(new BaseError(E,{details:E}))}if(a&&d.length>1){const S="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new AtomicityNotSupportedError(new BaseError(S,{details:S}))}const y=[];for(const S of d){const E=sendTransaction(e,{account:c,chain:o,data:S.data,to:S.to,value:S.value?hexToBigInt(S.value):void 0});y.push(E),u>0&&await new Promise(B=>setTimeout(B,u))}const b=await Promise.allSettled(y);if(b.every(S=>S.status==="rejected"))throw b[0].reason;const w=b.map(S=>S.status==="fulfilled"?S.value:fallbackTransactionErrorMagicIdentifier);return{id:concat([...w,numberToHex$1(o.id,{size:32}),fallbackMagicIdentifier])}}throw getTransactionError(p,{...t,account:c,chain:t.chain})}}async function getCallsStatus(e,t){async function r(c){if(c.endsWith(fallbackMagicIdentifier.slice(2))){const p=trim(sliceHex(c,-64,-32)),h=sliceHex(c,0,-64).slice(2).match(/.{1,64}/g),y=await Promise.all(h.map(w=>fallbackTransactionErrorMagicIdentifier.slice(2)!==w?e.request({method:"eth_getTransactionReceipt",params:[`0x${w}`]},{dedupe:!0}):void 0)),b=y.some(w=>w===null)?100:y.every(w=>w?.status==="0x1")?200:y.every(w=>w?.status==="0x0")?500:600;return{atomic:!1,chainId:hexToNumber$2(p),receipts:y.filter(Boolean),status:b,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[c]})}const{atomic:n=!1,chainId:o,receipts:i,version:u="2.0.0",...a}=await r(t.id),[s,f]=(()=>{const c=a.status;return c>=100&&c<200?["pending",c]:c>=200&&c<300?["success",c]:c>=300&&c<700?["failure",c]:c==="CONFIRMED"?["success",200]:c==="PENDING"?["pending",100]:[void 0,c]})();return{...a,atomic:n,chainId:o?hexToNumber$2(o):void 0,receipts:i?.map(c=>({...c,blockNumber:hexToBigInt(c.blockNumber),gasUsed:hexToBigInt(c.gasUsed),status:receiptStatuses[c.status]}))??[],statusCode:f,status:s,version:u}}async function waitForCallsStatus(e,t){const{id:r,pollingInterval:n=e.pollingInterval,status:o=({statusCode:b})=>b===200||b>=300,retryCount:i=4,retryDelay:u=({count:b})=>~~(1<<b)*200,timeout:a=6e4,throwOnFailure:s=!1}=t,f=stringify$1(["waitForCallsStatus",e.uid,r]),{promise:c,resolve:d,reject:p}=withResolvers();let h;const y=observe(f,{resolve:d,reject:p},b=>{const w=poll(async()=>{const S=E=>{clearTimeout(h),w(),E(),y()};try{const E=await withRetry(async()=>{const B=await getAction(e,getCallsStatus,"getCallsStatus")({id:r});if(s&&B.status==="failure")throw new BundleFailedError(B);return B},{retryCount:i,delay:u});if(!o(E))return;S(()=>b.resolve(E))}catch(E){S(()=>b.reject(E))}},{interval:n,emitOnBegin:!0});return w});return h=a?setTimeout(()=>{y(),clearTimeout(h),p(new WaitForCallsStatusTimeoutError({id:r}))},a):void 0,await c}class WaitForCallsStatusTimeoutError extends BaseError{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const size=256;let index=size,buffer$1;function uid(e=11){if(!buffer$1||index+e>size*2){buffer$1="",index=0;for(let t=0;t<size;t++)buffer$1+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$1.substring(index,index+++e)}function createClient(e){const{batch:t,chain:r,ccipRead:n,key:o="base",name:i="Base Client",type:u="base"}=e,a=e.experimental_blockTag??(typeof r?.experimental_preconfirmationTime=="number"?"pending":void 0),s=r?.blockTime??12e3,f=Math.min(Math.max(Math.floor(s/2),500),4e3),c=e.pollingInterval??f,d=e.cacheTime??c,p=e.account?parseAccount(e.account):void 0,{config:h,request:y,value:b}=e.transport({chain:r,pollingInterval:c}),w={...h,...b},S={account:p,batch:t,cacheTime:d,ccipRead:n,chain:r,key:o,name:i,pollingInterval:c,request:y,transport:w,type:u,uid:uid(),...a?{experimental_blockTag:a}:{}};function E(B){return ae=>{const W=ae(B);for(const ve in S)delete W[ve];const J={...B,...W};return Object.assign(J,{extend:E(J)})}}return Object.assign(S,{extend:E(S)})}const promiseCache=new LruMap(8192);function withDedupe(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(promiseCache.get(r))return promiseCache.get(r);const n=e().finally(()=>promiseCache.delete(r));return promiseCache.set(r,n),n}function buildRequest(e,t={}){return async(r,n={})=>{const{dedupe:o=!1,methods:i,retryDelay:u=150,retryCount:a=3,uid:s}={...t,...n},{method:f}=r;if(i?.exclude?.includes(f))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:f});if(i?.include&&!i.include.includes(f))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:f});const c=o?stringToHex(`${s}.${stringify$1(r)}`):void 0;return withDedupe(()=>withRetry(async()=>{try{return await e(r)}catch(d){const p=d;switch(p.code){case ParseRpcError.code:throw new ParseRpcError(p);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(p);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(p,{method:r.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(p);case InternalRpcError.code:throw new InternalRpcError(p);case InvalidInputRpcError.code:throw new InvalidInputRpcError(p);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(p);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(p);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(p);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(p,{method:r.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(p);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(p);case UserRejectedRequestError.code:throw new UserRejectedRequestError(p);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(p);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(p);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(p);case ChainDisconnectedError.code:throw new ChainDisconnectedError(p);case SwitchChainError.code:throw new SwitchChainError(p);case UnsupportedNonOptionalCapabilityError.code:throw new UnsupportedNonOptionalCapabilityError(p);case UnsupportedChainIdError.code:throw new UnsupportedChainIdError(p);case DuplicateIdError.code:throw new DuplicateIdError(p);case UnknownBundleIdError.code:throw new UnknownBundleIdError(p);case BundleTooLargeError.code:throw new BundleTooLargeError(p);case AtomicReadyWalletRejectedUpgradeError.code:throw new AtomicReadyWalletRejectedUpgradeError(p);case AtomicityNotSupportedError.code:throw new AtomicityNotSupportedError(p);case 5e3:throw new UserRejectedRequestError(p);default:throw d instanceof BaseError?d:new UnknownRpcError(p)}}},{delay:({count:d,error:p})=>{if(p&&p instanceof HttpRequestError){const h=p?.headers?.get("Retry-After");if(h?.match(/\d/))return Number.parseInt(h,10)*1e3}return~~(1<<d)*u},retryCount:a,shouldRetry:({error:d})=>shouldRetry(d)}),{enabled:o,id:c})}}function shouldRetry(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===LimitExceededRpcError.code||e.code===InternalRpcError.code:e instanceof HttpRequestError&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function defineChain(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function withTimeout(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((o,i)=>{(async()=>{let u;try{const a=new AbortController;r>0&&(u=setTimeout(()=>{n&&a.abort()},r)),o(await e({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&i(t),i(a)}finally{clearTimeout(u)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(e,t={}){return{async request(r){const{body:n,fetchFn:o=t.fetchFn??fetch,onRequest:i=t.onRequest,onResponse:u=t.onResponse,timeout:a=t.timeout??1e4}=r,s={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:f,method:c,signal:d}=s;try{const p=await withTimeout(async({signal:y})=>{const b={...s,body:Array.isArray(n)?stringify$1(n.map(B=>({jsonrpc:"2.0",id:B.id??idCache.take(),...B}))):stringify$1({jsonrpc:"2.0",id:n.id??idCache.take(),...n}),headers:{"Content-Type":"application/json",...f},method:c||"POST",signal:d||(a>0?y:null)},w=new Request(e,b),S=await i?.(w,b)??{...b,url:e};return await o(S.url??e,S)},{errorInstance:new TimeoutError({body:n,url:e}),timeout:a,signal:!0});u&&await u(p);let h;if(p.headers.get("Content-Type")?.startsWith("application/json"))h=await p.json();else{h=await p.text();try{h=JSON.parse(h||"{}")}catch(y){if(p.ok)throw y;h={error:h}}}if(!p.ok)throw new HttpRequestError({body:n,details:stringify$1(h.error)||p.statusText,headers:p.headers,status:p.status,url:e});return h}catch(p){throw p instanceof HttpRequestError||p instanceof TimeoutError?p:new HttpRequestError({body:n,cause:p,url:e})}}}}async function recoverMessageAddress({message:e,signature:t}){return recoverAddress({hash:hashMessage(e),signature:t})}async function verifyMessage({address:e,message:t,signature:r}){return isAddressEqual(getAddress(e),await recoverMessageAddress({message:t,signature:r}))}async function addChain(e,{chain:t}){const{id:r,name:n,nativeCurrency:o,rpcUrls:i,blockExplorers:u}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex$1(r),chainName:n,nativeCurrency:o,rpcUrls:i.default.http,blockExplorerUrls:u?Object.values(u).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}function deployContract(e,t){const{abi:r,args:n,bytecode:o,...i}=t,u=encodeDeployData({abi:r,args:n,bytecode:o});return sendTransaction(e,{...i,...i.authorizationList?{to:null}:{},data:u})}async function getAddresses(e){return e.account?.type==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(r=>checksumAddress(r))}async function getCapabilities(e,t={}){const{account:r=e.account,chainId:n}=t,o=r?parseAccount(r):void 0,i=n?[o?.address,[numberToHex$1(n)]]:[o?.address],u=await e.request({method:"wallet_getCapabilities",params:i}),a={};for(const[s,f]of Object.entries(u)){a[Number(s)]={};for(let[c,d]of Object.entries(f))c==="addSubAccount"&&(c="unstable_addSubAccount"),a[Number(s)][c]=d}return typeof n=="number"?a[n]:a}async function getPermissions(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function prepareAuthorization(e,t){const{account:r=e.account,chainId:n,nonce:o}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const i=parseAccount(r),u=(()=>{if(t.executor)return t.executor==="self"?t.executor:parseAccount(t.executor)})(),a={address:t.contractAddress??t.address,chainId:n,nonce:o};return typeof a.chainId>"u"&&(a.chainId=e.chain?.id??await getAction(e,getChainId,"getChainId")({})),typeof a.nonce>"u"&&(a.nonce=await getAction(e,getTransactionCount,"getTransactionCount")({address:i.address,blockTag:"pending"}),(u==="self"||u?.address&&isAddressEqual(u.address,i.address))&&(a.nonce+=1)),a}async function requestAddresses(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>getAddress(r))}async function requestPermissions(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function showCallsStatus(e,t){const{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}async function signAuthorization(e,t){const{account:r=e.account}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const n=parseAccount(r);if(!n.signAuthorization)throw new AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const o=await prepareAuthorization(e,t);return n.signAuthorization(o)}async function signMessage(e,{account:t=e.account,message:r}){if(!t)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const n=parseAccount(t);if(n.signMessage)return n.signMessage({message:r});const o=typeof r=="string"?stringToHex(r):r.raw instanceof Uint8Array?toHex(r.raw):r.raw;return e.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}async function signTransaction(e,t){const{account:r=e.account,chain:n=e.chain,...o}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const i=parseAccount(r);assertRequest({account:i,...t});const u=await getAction(e,getChainId,"getChainId")({});n!==null&&assertCurrentChain({currentChainId:u,chain:n});const s=(n?.formatters||e.chain?.formatters)?.transactionRequest?.format||formatTransactionRequest;return i.signTransaction?i.signTransaction({...o,chainId:u},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...s(o),chainId:numberToHex$1(u),from:i.address}]},{retryCount:0})}async function signTypedData(e,t){const{account:r=e.account,domain:n,message:o,primaryType:i}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const u=parseAccount(r),a={EIP712Domain:getTypesForEIP712Domain({domain:n}),...t.types};if(validateTypedData({domain:n,message:o,primaryType:i,types:a}),u.signTypedData)return u.signTypedData({domain:n,message:o,primaryType:i,types:a});const s=serializeTypedData({domain:n,message:o,primaryType:i,types:a});return e.request({method:"eth_signTypedData_v4",params:[u.address,s]},{retryCount:0})}async function switchChain(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex$1(t)}]},{retryCount:0})}async function watchAsset(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}function walletActions(e){return{addChain:t=>addChain(e,t),deployContract:t=>deployContract(e,t),getAddresses:()=>getAddresses(e),getCallsStatus:t=>getCallsStatus(e,t),getCapabilities:t=>getCapabilities(e,t),getChainId:()=>getChainId(e),getPermissions:()=>getPermissions(e),prepareAuthorization:t=>prepareAuthorization(e,t),prepareTransactionRequest:t=>prepareTransactionRequest(e,t),requestAddresses:()=>requestAddresses(e),requestPermissions:t=>requestPermissions(e,t),sendCalls:t=>sendCalls(e,t),sendRawTransaction:t=>sendRawTransaction(e,t),sendTransaction:t=>sendTransaction(e,t),showCallsStatus:t=>showCallsStatus(e,t),signAuthorization:t=>signAuthorization(e,t),signMessage:t=>signMessage(e,t),signTransaction:t=>signTransaction(e,t),signTypedData:t=>signTypedData(e,t),switchChain:t=>switchChain(e,t),waitForCallsStatus:t=>waitForCallsStatus(e,t),watchAsset:t=>watchAsset(e,t),writeContract:t=>writeContract(e,t)}}function createWalletClient(e){const{key:t="wallet",name:r="Wallet Client",transport:n}=e;return createClient({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(walletActions)}function createTransport({key:e,methods:t,name:r,request:n,retryCount:o=3,retryDelay:i=150,timeout:u,type:a},s){const f=uid();return{config:{key:e,methods:t,name:r,request:n,retryCount:o,retryDelay:i,timeout:u,type:a},request:buildRequest(n,{methods:t,retryCount:o,retryDelay:i,uid:f}),value:s}}class UrlRequiredError extends BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(e,t={}){const{batch:r,fetchFn:n,fetchOptions:o,key:i="http",methods:u,name:a="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:f,retryDelay:c,raw:d}=t;return({chain:p,retryCount:h,timeout:y})=>{const{batchSize:b=1e3,wait:w=0}=typeof r=="object"?r:{},S=t.retryCount??h,E=y??t.timeout??1e4,B=p?.rpcUrls.default.http[0];if(!B)throw new UrlRequiredError;const ae=getHttpRpcClient(B,{fetchFn:n,fetchOptions:o,onRequest:s,onResponse:f,timeout:E});return createTransport({key:i,methods:u,name:a,async request({method:W,params:J}){const ve={method:W,params:J},{schedule:Qe}=createBatchScheduler({id:B,wait:w,shouldSplitBatch(ce){return ce.length>b},fn:ce=>ae.request({body:ce}),sort:(ce,Ze)=>ce.id-Ze.id}),kt=async ce=>r?Qe(ce):[await ae.request({body:ce})],[{error:nr,result:sr}]=await kt(ve);if(d)return{error:nr,result:sr};if(nr)throw new RpcRequestError({body:ve,error:nr,url:B});return sr},retryCount:S,retryDelay:c,timeout:E,type:"http"},{fetchOptions:o,url:B})}}const hardhat=defineChain({id:31337,name:"Hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),ENV$1={EFFECTSTREAM_API_PORT:"9999",BATCHER_PORT:"3334"},CHAIN_COLORS={evm:"#4caf50",evmParallel:"#ff9800",cardano:"#2196f3",midnight:"#9c27b0"};function transformConfigToPaimaChains(e){const t={};return e.filter(n=>n.networkType!=="ntp").forEach((n,o)=>{const i=n.network,u=n.syncProtocol;let a=i.name;i.type==="evm"&&i.chainId?a=`evm_${i.chainId}`:i.type==="evm"&&i.id&&(a=`evm_${i.id}`),t[a]&&(a=`${a}_${o}`);let s;i.type==="evm"?i.rpcUrls?.default?.http?.[0]?s=i.rpcUrls.default.http[0]:u.chainUri&&(s=u.chainUri):(i.type==="midnight"||i.type==="avail"||i.type==="cardano")&&(s=i.nodeUrl);let f=CHAIN_COLORS.evm;i.type==="cardano"?f=CHAIN_COLORS.cardano:i.type==="midnight"?f=CHAIN_COLORS.midnight:i.name.toLowerCase().includes("arbitrum")?f=CHAIN_COLORS.evm:(i.name.toLowerCase().includes("ethereum")||i.name.toLowerCase().includes("l1"))&&(f=CHAIN_COLORS.evmParallel);const c={type:i.type.toUpperCase(),name:i.name,blockTime:i.blockTimeMS??u.pollingInterval??void 0,color:f,blocks:[],currentBlock:i.type==="evm"?5e5:1e5,rpcEndpoint:s,latestBlockNumber:0,previousLatestBlockNumber:0,isConnected:!1,protocolName:u.name};t[a]=c}),t}async function fetchChainConfigs(){const e=await fetch(CONFIG_ENDPOINT);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json(),r=transformConfigToPaimaChains(t);return{Paima:{type:"EVM",name:"Paima Engine",blockTime:t.find(o=>o.syncProtocol.name==="mainNtp")?.network.blockTimeMS??1e3,color:"#667eea",blocks:[],currentBlock:1e6,rpcEndpoint:`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/rpc/evm`,latestBlockNumber:0,previousLatestBlockNumber:0,isConnected:!1},...r}}const CONFIG_ENDPOINT="http://127.0.0.1:9999/config",BLOCK_HEIGHTS_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/block-heights`,PRIMITIVES_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/primitives`,TABLES_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/tables`,SCHEDULED_DATA_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/scheduled-data`,PRIMITIVES_SCHEMA_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/primitives-schema`,TABLE_SCHEMA_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/table-schema`,SYNC_PROTOCOLS_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/sync-protocols`,BATCHER_ENDPOINT=`http://localhost:${ENV$1.BATCHER_PORT}/send-input`,BATCHER_OPENAPI_URL=`http://localhost:${ENV$1.BATCHER_PORT}/documentation`,ENGINE_OPENAPI_URL=`http://localhost:${ENV$1.EFFECTSTREAM_API_PORT}/documentation`,DOCUMENTATION_URL="https://effectstream.github.io/docs/",ADDRESSES_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/addresses`;function IsAsyncIterator$3(e){return IsObject$3(e)&&!IsArray$3(e)&&!IsUint8Array$3(e)&&Symbol.asyncIterator in e}function IsArray$3(e){return Array.isArray(e)}function IsBigInt$3(e){return typeof e=="bigint"}function IsBoolean$3(e){return typeof e=="boolean"}function IsDate$3(e){return e instanceof globalThis.Date}function IsFunction$3(e){return typeof e=="function"}function IsIterator$3(e){return IsObject$3(e)&&!IsArray$3(e)&&!IsUint8Array$3(e)&&Symbol.iterator in e}function IsNull$3(e){return e===null}function IsNumber$3(e){return typeof e=="number"}function IsObject$3(e){return typeof e=="object"&&e!==null}function IsRegExp$2(e){return e instanceof globalThis.RegExp}function IsString$3(e){return typeof e=="string"}function IsSymbol$3(e){return typeof e=="symbol"}function IsUint8Array$3(e){return e instanceof globalThis.Uint8Array}function IsUndefined$3(e){return e===void 0}function ArrayType$1(e){return e.map(t=>Visit$7(t))}function DateType$1(e){return new Date(e.getTime())}function Uint8ArrayType$1(e){return new Uint8Array(e)}function RegExpType(e){return new RegExp(e.source,e.flags)}function ObjectType$1(e){const t={};for(const r of Object.getOwnPropertyNames(e))t[r]=Visit$7(e[r]);for(const r of Object.getOwnPropertySymbols(e))t[r]=Visit$7(e[r]);return t}function Visit$7(e){return IsArray$3(e)?ArrayType$1(e):IsDate$3(e)?DateType$1(e):IsUint8Array$3(e)?Uint8ArrayType$1(e):IsRegExp$2(e)?RegExpType(e):IsObject$3(e)?ObjectType$1(e):e}function Clone(e){return Visit$7(e)}function CloneType(e,t){return Clone(t===void 0?e:{...t,...e})}function IsAsyncIterator$2(e){return IsObject$2(e)&&globalThis.Symbol.asyncIterator in e}function IsIterator$2(e){return IsObject$2(e)&&globalThis.Symbol.iterator in e}function IsPromise$2(e){return e instanceof globalThis.Promise}function IsDate$2(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function IsUint8Array$2(e){return e instanceof globalThis.Uint8Array}function HasPropertyKey(e,t){return t in e}function IsObject$2(e){return e!==null&&typeof e=="object"}function IsArray$2(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function IsUndefined$2(e){return e===void 0}function IsNull$2(e){return e===null}function IsBoolean$2(e){return typeof e=="boolean"}function IsNumber$2(e){return typeof e=="number"}function IsInteger$2(e){return globalThis.Number.isInteger(e)}function IsBigInt$2(e){return typeof e=="bigint"}function IsString$2(e){return typeof e=="string"}function IsFunction$2(e){return typeof e=="function"}function IsSymbol$2(e){return typeof e=="symbol"}function IsValueType(e){return IsBigInt$2(e)||IsBoolean$2(e)||IsNull$2(e)||IsNumber$2(e)||IsString$2(e)||IsSymbol$2(e)||IsUndefined$2(e)}var TypeSystemPolicy;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(u,a){return e.ExactOptionalPropertyTypes?a in u:u[a]!==void 0}e.IsExactOptionalProperty=t;function r(u){const a=IsObject$2(u);return e.AllowArrayObject?a:a&&!IsArray$2(u)}e.IsObjectLike=r;function n(u){return r(u)&&!(u instanceof Date)&&!(u instanceof Uint8Array)}e.IsRecordLike=n;function o(u){return e.AllowNaN?IsNumber$2(u):Number.isFinite(u)}e.IsNumberLike=o;function i(u){const a=IsUndefined$2(u);return e.AllowNullVoid?a||u===null:a}e.IsVoidLike=i})(TypeSystemPolicy||(TypeSystemPolicy={}));function ImmutableArray(e){return globalThis.Object.freeze(e).map(t=>Immutable(t))}function ImmutableDate(e){return e}function ImmutableUint8Array(e){return e}function ImmutableRegExp(e){return e}function ImmutableObject(e){const t={};for(const r of Object.getOwnPropertyNames(e))t[r]=Immutable(e[r]);for(const r of Object.getOwnPropertySymbols(e))t[r]=Immutable(e[r]);return globalThis.Object.freeze(t)}function Immutable(e){return IsArray$3(e)?ImmutableArray(e):IsDate$3(e)?e:IsUint8Array$3(e)?e:IsRegExp$2(e)?e:IsObject$3(e)?ImmutableObject(e):e}function CreateType(e,t){const r=t!==void 0?{...t,...e}:e;switch(TypeSystemPolicy.InstanceMode){case"freeze":return Immutable(r);case"clone":return Clone(r);default:return r}}class TypeBoxError extends Error{constructor(t){super(t)}}const TransformKind=Symbol.for("TypeBox.Transform"),ReadonlyKind=Symbol.for("TypeBox.Readonly"),OptionalKind=Symbol.for("TypeBox.Optional"),Hint=Symbol.for("TypeBox.Hint"),Kind=Symbol.for("TypeBox.Kind");function IsReadonly(e){return IsObject$3(e)&&e[ReadonlyKind]==="Readonly"}function IsOptional$1(e){return IsObject$3(e)&&e[OptionalKind]==="Optional"}function IsAny$1(e){return IsKindOf$1(e,"Any")}function IsArgument$1(e){return IsKindOf$1(e,"Argument")}function IsArray$1(e){return IsKindOf$1(e,"Array")}function IsAsyncIterator$1(e){return IsKindOf$1(e,"AsyncIterator")}function IsBigInt$1(e){return IsKindOf$1(e,"BigInt")}function IsBoolean$1(e){return IsKindOf$1(e,"Boolean")}function IsComputed$1(e){return IsKindOf$1(e,"Computed")}function IsConstructor$1(e){return IsKindOf$1(e,"Constructor")}function IsDate$1(e){return IsKindOf$1(e,"Date")}function IsFunction$1(e){return IsKindOf$1(e,"Function")}function IsInteger$1(e){return IsKindOf$1(e,"Integer")}function IsIntersect$1(e){return IsKindOf$1(e,"Intersect")}function IsIterator$1(e){return IsKindOf$1(e,"Iterator")}function IsKindOf$1(e,t){return IsObject$3(e)&&Kind in e&&e[Kind]===t}function IsLiteralValue$1(e){return IsBoolean$3(e)||IsNumber$3(e)||IsString$3(e)}function IsLiteral$1(e){return IsKindOf$1(e,"Literal")}function IsMappedKey$1(e){return IsKindOf$1(e,"MappedKey")}function IsMappedResult$1(e){return IsKindOf$1(e,"MappedResult")}function IsNever$1(e){return IsKindOf$1(e,"Never")}function IsNot$1(e){return IsKindOf$1(e,"Not")}function IsNull$1(e){return IsKindOf$1(e,"Null")}function IsNumber$1(e){return IsKindOf$1(e,"Number")}function IsObject$1(e){return IsKindOf$1(e,"Object")}function IsPromise$1(e){return IsKindOf$1(e,"Promise")}function IsRecord$1(e){return IsKindOf$1(e,"Record")}function IsRef$1(e){return IsKindOf$1(e,"Ref")}function IsRegExp$1(e){return IsKindOf$1(e,"RegExp")}function IsString$1(e){return IsKindOf$1(e,"String")}function IsSymbol$1(e){return IsKindOf$1(e,"Symbol")}function IsTemplateLiteral$1(e){return IsKindOf$1(e,"TemplateLiteral")}function IsThis$1(e){return IsKindOf$1(e,"This")}function IsTransform$1(e){return IsObject$3(e)&&TransformKind in e}function IsTuple$1(e){return IsKindOf$1(e,"Tuple")}function IsUndefined$1(e){return IsKindOf$1(e,"Undefined")}function IsUnion$1(e){return IsKindOf$1(e,"Union")}function IsUint8Array$1(e){return IsKindOf$1(e,"Uint8Array")}function IsUnknown$1(e){return IsKindOf$1(e,"Unknown")}function IsUnsafe$1(e){return IsKindOf$1(e,"Unsafe")}function IsVoid$1(e){return IsKindOf$1(e,"Void")}function IsKind$1(e){return IsObject$3(e)&&Kind in e&&IsString$3(e[Kind])}function IsSchema$1(e){return IsAny$1(e)||IsArgument$1(e)||IsArray$1(e)||IsBoolean$1(e)||IsBigInt$1(e)||IsAsyncIterator$1(e)||IsComputed$1(e)||IsConstructor$1(e)||IsDate$1(e)||IsFunction$1(e)||IsInteger$1(e)||IsIntersect$1(e)||IsIterator$1(e)||IsLiteral$1(e)||IsMappedKey$1(e)||IsMappedResult$1(e)||IsNever$1(e)||IsNot$1(e)||IsNull$1(e)||IsNumber$1(e)||IsObject$1(e)||IsPromise$1(e)||IsRecord$1(e)||IsRef$1(e)||IsRegExp$1(e)||IsString$1(e)||IsSymbol$1(e)||IsTemplateLiteral$1(e)||IsThis$1(e)||IsTuple$1(e)||IsUndefined$1(e)||IsUnion$1(e)||IsUint8Array$1(e)||IsUnknown$1(e)||IsUnsafe$1(e)||IsVoid$1(e)||IsKind$1(e)}const KnownTypes=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function IsPattern(e){try{return new RegExp(e),!0}catch{return!1}}function IsControlCharacterFree(e){if(!IsString$3(e))return!1;for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}function IsAdditionalProperties(e){return IsOptionalBoolean(e)||IsSchema(e)}function IsOptionalBigInt(e){return IsUndefined$3(e)||IsBigInt$3(e)}function IsOptionalNumber(e){return IsUndefined$3(e)||IsNumber$3(e)}function IsOptionalBoolean(e){return IsUndefined$3(e)||IsBoolean$3(e)}function IsOptionalString(e){return IsUndefined$3(e)||IsString$3(e)}function IsOptionalPattern(e){return IsUndefined$3(e)||IsString$3(e)&&IsControlCharacterFree(e)&&IsPattern(e)}function IsOptionalFormat(e){return IsUndefined$3(e)||IsString$3(e)&&IsControlCharacterFree(e)}function IsOptionalSchema(e){return IsUndefined$3(e)||IsSchema(e)}function IsOptional(e){return IsObject$3(e)&&e[OptionalKind]==="Optional"}function IsAny(e){return IsKindOf(e,"Any")&&IsOptionalString(e.$id)}function IsArgument(e){return IsKindOf(e,"Argument")&&IsNumber$3(e.index)}function IsArray(e){return IsKindOf(e,"Array")&&e.type==="array"&&IsOptionalString(e.$id)&&IsSchema(e.items)&&IsOptionalNumber(e.minItems)&&IsOptionalNumber(e.maxItems)&&IsOptionalBoolean(e.uniqueItems)&&IsOptionalSchema(e.contains)&&IsOptionalNumber(e.minContains)&&IsOptionalNumber(e.maxContains)}function IsAsyncIterator(e){return IsKindOf(e,"AsyncIterator")&&e.type==="AsyncIterator"&&IsOptionalString(e.$id)&&IsSchema(e.items)}function IsBigInt(e){return IsKindOf(e,"BigInt")&&e.type==="bigint"&&IsOptionalString(e.$id)&&IsOptionalBigInt(e.exclusiveMaximum)&&IsOptionalBigInt(e.exclusiveMinimum)&&IsOptionalBigInt(e.maximum)&&IsOptionalBigInt(e.minimum)&&IsOptionalBigInt(e.multipleOf)}function IsBoolean(e){return IsKindOf(e,"Boolean")&&e.type==="boolean"&&IsOptionalString(e.$id)}function IsComputed(e){return IsKindOf(e,"Computed")&&IsString$3(e.target)&&IsArray$3(e.parameters)&&e.parameters.every(t=>IsSchema(t))}function IsConstructor(e){return IsKindOf(e,"Constructor")&&e.type==="Constructor"&&IsOptionalString(e.$id)&&IsArray$3(e.parameters)&&e.parameters.every(t=>IsSchema(t))&&IsSchema(e.returns)}function IsDate(e){return IsKindOf(e,"Date")&&e.type==="Date"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.exclusiveMaximumTimestamp)&&IsOptionalNumber(e.exclusiveMinimumTimestamp)&&IsOptionalNumber(e.maximumTimestamp)&&IsOptionalNumber(e.minimumTimestamp)&&IsOptionalNumber(e.multipleOfTimestamp)}function IsFunction(e){return IsKindOf(e,"Function")&&e.type==="Function"&&IsOptionalString(e.$id)&&IsArray$3(e.parameters)&&e.parameters.every(t=>IsSchema(t))&&IsSchema(e.returns)}function IsInteger(e){return IsKindOf(e,"Integer")&&e.type==="integer"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.exclusiveMaximum)&&IsOptionalNumber(e.exclusiveMinimum)&&IsOptionalNumber(e.maximum)&&IsOptionalNumber(e.minimum)&&IsOptionalNumber(e.multipleOf)}function IsProperties(e){return IsObject$3(e)&&Object.entries(e).every(([t,r])=>IsControlCharacterFree(t)&&IsSchema(r))}function IsIntersect(e){return IsKindOf(e,"Intersect")&&!(IsString$3(e.type)&&e.type!=="object")&&IsArray$3(e.allOf)&&e.allOf.every(t=>IsSchema(t)&&!IsTransform(t))&&IsOptionalString(e.type)&&(IsOptionalBoolean(e.unevaluatedProperties)||IsOptionalSchema(e.unevaluatedProperties))&&IsOptionalString(e.$id)}function IsIterator(e){return IsKindOf(e,"Iterator")&&e.type==="Iterator"&&IsOptionalString(e.$id)&&IsSchema(e.items)}function IsKindOf(e,t){return IsObject$3(e)&&Kind in e&&e[Kind]===t}function IsLiteralString(e){return IsLiteral(e)&&IsString$3(e.const)}function IsLiteralNumber(e){return IsLiteral(e)&&IsNumber$3(e.const)}function IsLiteralBoolean(e){return IsLiteral(e)&&IsBoolean$3(e.const)}function IsLiteral(e){return IsKindOf(e,"Literal")&&IsOptionalString(e.$id)&&IsLiteralValue(e.const)}function IsLiteralValue(e){return IsBoolean$3(e)||IsNumber$3(e)||IsString$3(e)}function IsMappedKey(e){return IsKindOf(e,"MappedKey")&&IsArray$3(e.keys)&&e.keys.every(t=>IsNumber$3(t)||IsString$3(t))}function IsMappedResult(e){return IsKindOf(e,"MappedResult")&&IsProperties(e.properties)}function IsNever(e){return IsKindOf(e,"Never")&&IsObject$3(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function IsNot(e){return IsKindOf(e,"Not")&&IsSchema(e.not)}function IsNull(e){return IsKindOf(e,"Null")&&e.type==="null"&&IsOptionalString(e.$id)}function IsNumber(e){return IsKindOf(e,"Number")&&e.type==="number"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.exclusiveMaximum)&&IsOptionalNumber(e.exclusiveMinimum)&&IsOptionalNumber(e.maximum)&&IsOptionalNumber(e.minimum)&&IsOptionalNumber(e.multipleOf)}function IsObject(e){return IsKindOf(e,"Object")&&e.type==="object"&&IsOptionalString(e.$id)&&IsProperties(e.properties)&&IsAdditionalProperties(e.additionalProperties)&&IsOptionalNumber(e.minProperties)&&IsOptionalNumber(e.maxProperties)}function IsPromise(e){return IsKindOf(e,"Promise")&&e.type==="Promise"&&IsOptionalString(e.$id)&&IsSchema(e.item)}function IsRecord(e){return IsKindOf(e,"Record")&&e.type==="object"&&IsOptionalString(e.$id)&&IsAdditionalProperties(e.additionalProperties)&&IsObject$3(e.patternProperties)&&(t=>{const r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&IsPattern(r[0])&&IsObject$3(t.patternProperties)&&IsSchema(t.patternProperties[r[0]])})(e)}function IsRef(e){return IsKindOf(e,"Ref")&&IsOptionalString(e.$id)&&IsString$3(e.$ref)}function IsRegExp(e){return IsKindOf(e,"RegExp")&&IsOptionalString(e.$id)&&IsString$3(e.source)&&IsString$3(e.flags)&&IsOptionalNumber(e.maxLength)&&IsOptionalNumber(e.minLength)}function IsString(e){return IsKindOf(e,"String")&&e.type==="string"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.minLength)&&IsOptionalNumber(e.maxLength)&&IsOptionalPattern(e.pattern)&&IsOptionalFormat(e.format)}function IsSymbol(e){return IsKindOf(e,"Symbol")&&e.type==="symbol"&&IsOptionalString(e.$id)}function IsTemplateLiteral(e){return IsKindOf(e,"TemplateLiteral")&&e.type==="string"&&IsString$3(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function IsThis(e){return IsKindOf(e,"This")&&IsOptionalString(e.$id)&&IsString$3(e.$ref)}function IsTransform(e){return IsObject$3(e)&&TransformKind in e}function IsTuple(e){return IsKindOf(e,"Tuple")&&e.type==="array"&&IsOptionalString(e.$id)&&IsNumber$3(e.minItems)&&IsNumber$3(e.maxItems)&&e.minItems===e.maxItems&&(IsUndefined$3(e.items)&&IsUndefined$3(e.additionalItems)&&e.minItems===0||IsArray$3(e.items)&&e.items.every(t=>IsSchema(t)))}function IsUndefined(e){return IsKindOf(e,"Undefined")&&e.type==="undefined"&&IsOptionalString(e.$id)}function IsUnion(e){return IsKindOf(e,"Union")&&IsOptionalString(e.$id)&&IsObject$3(e)&&IsArray$3(e.anyOf)&&e.anyOf.every(t=>IsSchema(t))}function IsUint8Array(e){return IsKindOf(e,"Uint8Array")&&e.type==="Uint8Array"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.minByteLength)&&IsOptionalNumber(e.maxByteLength)}function IsUnknown(e){return IsKindOf(e,"Unknown")&&IsOptionalString(e.$id)}function IsUnsafe(e){return IsKindOf(e,"Unsafe")}function IsVoid(e){return IsKindOf(e,"Void")&&e.type==="void"&&IsOptionalString(e.$id)}function IsKind(e){return IsObject$3(e)&&Kind in e&&IsString$3(e[Kind])&&!KnownTypes.includes(e[Kind])}function IsSchema(e){return IsObject$3(e)&&(IsAny(e)||IsArgument(e)||IsArray(e)||IsBoolean(e)||IsBigInt(e)||IsAsyncIterator(e)||IsComputed(e)||IsConstructor(e)||IsDate(e)||IsFunction(e)||IsInteger(e)||IsIntersect(e)||IsIterator(e)||IsLiteral(e)||IsMappedKey(e)||IsMappedResult(e)||IsNever(e)||IsNot(e)||IsNull(e)||IsNumber(e)||IsObject(e)||IsPromise(e)||IsRecord(e)||IsRef(e)||IsRegExp(e)||IsString(e)||IsSymbol(e)||IsTemplateLiteral(e)||IsThis(e)||IsTuple(e)||IsUndefined(e)||IsUnion(e)||IsUint8Array(e)||IsUnknown(e)||IsUnsafe(e)||IsVoid(e)||IsKind(e))}const PatternBoolean="(true|false)",PatternNumber="(0|[1-9][0-9]*)",PatternString="(.*)",PatternNever="(?!.*)",PatternNumberExact=`^${PatternNumber}$`,PatternStringExact=`^${PatternString}$`,PatternNeverExact=`^${PatternNever}$`,map$2=new Map;function Has$1(e){return map$2.has(e)}function Set$1(e,t){map$2.set(e,t)}function Get$1(e){return map$2.get(e)}const map$1=new Map;function Has(e){return map$1.has(e)}function Get(e){return map$1.get(e)}function SetIncludes(e,t){return e.includes(t)}function SetDistinct(e){return[...new Set(e)]}function SetIntersect(e,t){return e.filter(r=>t.includes(r))}function SetIntersectManyResolve(e,t){return e.reduce((r,n)=>SetIntersect(r,n),t)}function SetIntersectMany(e){return e.length===1?e[0]:e.length>1?SetIntersectManyResolve(e.slice(1),e[0]):[]}function SetUnionMany(e){const t=[];for(const r of e)t.push(...r);return t}function Any(e){return CreateType({[Kind]:"Any"},e)}function Array$1(e,t){return CreateType({[Kind]:"Array",type:"array",items:e},t)}function Argument(e){return CreateType({[Kind]:"Argument",index:e})}function AsyncIterator(e,t){return CreateType({[Kind]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function Computed(e,t,r){return CreateType({[Kind]:"Computed",target:e,parameters:t},r)}function DiscardKey(e,t){const{[t]:r,...n}=e;return n}function Discard(e,t){return t.reduce((r,n)=>DiscardKey(r,n),e)}function Never(e){return CreateType({[Kind]:"Never",not:{}},e)}function MappedResult(e){return CreateType({[Kind]:"MappedResult",properties:e})}function Constructor(e,t,r){return CreateType({[Kind]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}function Function$1(e,t,r){return CreateType({[Kind]:"Function",type:"Function",parameters:e,returns:t},r)}function UnionCreate(e,t){return CreateType({[Kind]:"Union",anyOf:e},t)}function IsUnionOptional(e){return e.some(t=>IsOptional$1(t))}function RemoveOptionalFromRest$1(e){return e.map(t=>IsOptional$1(t)?RemoveOptionalFromType$1(t):t)}function RemoveOptionalFromType$1(e){return Discard(e,[OptionalKind])}function ResolveUnion(e,t){return IsUnionOptional(e)?Optional(UnionCreate(RemoveOptionalFromRest$1(e),t)):UnionCreate(RemoveOptionalFromRest$1(e),t)}function UnionEvaluated(e,t){return e.length===1?CreateType(e[0],t):e.length===0?Never(t):ResolveUnion(e,t)}function Union$1(e,t){return e.length===0?Never(t):e.length===1?CreateType(e[0],t):UnionCreate(e,t)}class TemplateLiteralParserError extends TypeBoxError{}function Unescape(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function IsNonEscaped(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function IsOpenParen(e,t){return IsNonEscaped(e,t,"(")}function IsCloseParen(e,t){return IsNonEscaped(e,t,")")}function IsSeparator(e,t){return IsNonEscaped(e,t,"|")}function IsGroup(e){if(!(IsOpenParen(e,0)&&IsCloseParen(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(IsOpenParen(e,r)&&(t+=1),IsCloseParen(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function InGroup(e){return e.slice(1,e.length-1)}function IsPrecedenceOr(e){let t=0;for(let r=0;r<e.length;r++)if(IsOpenParen(e,r)&&(t+=1),IsCloseParen(e,r)&&(t-=1),IsSeparator(e,r)&&t===0)return!0;return!1}function IsPrecedenceAnd(e){for(let t=0;t<e.length;t++)if(IsOpenParen(e,t))return!0;return!1}function Or$1(e){let[t,r]=[0,0];const n=[];for(let i=0;i<e.length;i++)if(IsOpenParen(e,i)&&(t+=1),IsCloseParen(e,i)&&(t-=1),IsSeparator(e,i)&&t===0){const u=e.slice(r,i);u.length>0&&n.push(TemplateLiteralParse(u)),r=i+1}const o=e.slice(r);return o.length>0&&n.push(TemplateLiteralParse(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}function And(e){function t(o,i){if(!IsOpenParen(o,i))throw new TemplateLiteralParserError("TemplateLiteralParser: Index must point to open parens");let u=0;for(let a=i;a<o.length;a++)if(IsOpenParen(o,a)&&(u+=1),IsCloseParen(o,a)&&(u-=1),u===0)return[i,a];throw new TemplateLiteralParserError("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,i){for(let u=i;u<o.length;u++)if(IsOpenParen(o,u))return[i,u];return[i,o.length]}const n=[];for(let o=0;o<e.length;o++)if(IsOpenParen(e,o)){const[i,u]=t(e,o),a=e.slice(i,u+1);n.push(TemplateLiteralParse(a)),o=u}else{const[i,u]=r(e,o),a=e.slice(i,u);a.length>0&&n.push(TemplateLiteralParse(a)),o=u-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}function TemplateLiteralParse(e){return IsGroup(e)?TemplateLiteralParse(InGroup(e)):IsPrecedenceOr(e)?Or$1(e):IsPrecedenceAnd(e)?And(e):{type:"const",const:Unescape(e)}}function TemplateLiteralParseExact(e){return TemplateLiteralParse(e.slice(1,e.length-1))}class TemplateLiteralFiniteError extends TypeBoxError{}function IsNumberExpression(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function IsBooleanExpression(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function IsStringExpression(e){return e.type==="const"&&e.const===".*"}function IsTemplateLiteralExpressionFinite(e){return IsNumberExpression(e)||IsStringExpression(e)?!1:IsBooleanExpression(e)?!0:e.type==="and"?e.expr.every(t=>IsTemplateLiteralExpressionFinite(t)):e.type==="or"?e.expr.every(t=>IsTemplateLiteralExpressionFinite(t)):e.type==="const"?!0:(()=>{throw new TemplateLiteralFiniteError("Unknown expression type")})()}function IsTemplateLiteralFinite(e){const t=TemplateLiteralParseExact(e.pattern);return IsTemplateLiteralExpressionFinite(t)}class TemplateLiteralGenerateError extends TypeBoxError{}function*GenerateReduce(e){if(e.length===1)return yield*e[0];for(const t of e[0])for(const r of GenerateReduce(e.slice(1)))yield`${t}${r}`}function*GenerateAnd(e){return yield*GenerateReduce(e.expr.map(t=>[...TemplateLiteralExpressionGenerate(t)]))}function*GenerateOr(e){for(const t of e.expr)yield*TemplateLiteralExpressionGenerate(t)}function*GenerateConst(e){return yield e.const}function*TemplateLiteralExpressionGenerate(e){return e.type==="and"?yield*GenerateAnd(e):e.type==="or"?yield*GenerateOr(e):e.type==="const"?yield*GenerateConst(e):(()=>{throw new TemplateLiteralGenerateError("Unknown expression")})()}function TemplateLiteralGenerate(e){const t=TemplateLiteralParseExact(e.pattern);return IsTemplateLiteralExpressionFinite(t)?[...TemplateLiteralExpressionGenerate(t)]:[]}function Literal(e,t){return CreateType({[Kind]:"Literal",const:e,type:typeof e},t)}function Boolean$1(e){return CreateType({[Kind]:"Boolean",type:"boolean"},e)}function BigInt$2(e){return CreateType({[Kind]:"BigInt",type:"bigint"},e)}function Number$1(e){return CreateType({[Kind]:"Number",type:"number"},e)}function String$1(e){return CreateType({[Kind]:"String",type:"string"},e)}function*FromUnion$d(e){const t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield Boolean$1():t==="number"?yield Number$1():t==="bigint"?yield BigInt$2():t==="string"?yield String$1():yield(()=>{const r=t.split("|").map(n=>Literal(n.trim()));return r.length===0?Never():r.length===1?r[0]:UnionEvaluated(r)})()}function*FromTerminal(e){if(e[1]!=="{"){const t=Literal("$"),r=FromSyntax(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){const r=FromUnion$d(e.slice(2,t)),n=FromSyntax(e.slice(t+1));return yield*[...r,...n]}yield Literal(e)}function*FromSyntax(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){const r=Literal(e.slice(0,t)),n=FromTerminal(e.slice(t));return yield*[r,...n]}yield Literal(e)}function TemplateLiteralSyntax(e){return[...FromSyntax(e)]}class TemplateLiteralPatternError extends TypeBoxError{}function Escape(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Visit$6(e,t){return IsTemplateLiteral$1(e)?e.pattern.slice(1,e.pattern.length-1):IsUnion$1(e)?`(${e.anyOf.map(r=>Visit$6(r,t)).join("|")})`:IsNumber$1(e)?`${t}${PatternNumber}`:IsInteger$1(e)?`${t}${PatternNumber}`:IsBigInt$1(e)?`${t}${PatternNumber}`:IsString$1(e)?`${t}${PatternString}`:IsLiteral$1(e)?`${t}${Escape(e.const.toString())}`:IsBoolean$1(e)?`${t}${PatternBoolean}`:(()=>{throw new TemplateLiteralPatternError(`Unexpected Kind '${e[Kind]}'`)})()}function TemplateLiteralPattern(e){return`^${e.map(t=>Visit$6(t,"")).join("")}$`}function TemplateLiteralToUnion(e){const r=TemplateLiteralGenerate(e).map(n=>Literal(n));return UnionEvaluated(r)}function TemplateLiteral(e,t){const r=IsString$3(e)?TemplateLiteralPattern(TemplateLiteralSyntax(e)):TemplateLiteralPattern(e);return CreateType({[Kind]:"TemplateLiteral",type:"string",pattern:r},t)}function FromTemplateLiteral$4(e){return TemplateLiteralGenerate(e).map(r=>r.toString())}function FromUnion$c(e){const t=[];for(const r of e)t.push(...IndexPropertyKeys(r));return t}function FromLiteral$3(e){return[e.toString()]}function IndexPropertyKeys(e){return[...new Set(IsTemplateLiteral$1(e)?FromTemplateLiteral$4(e):IsUnion$1(e)?FromUnion$c(e.anyOf):IsLiteral$1(e)?FromLiteral$3(e.const):IsNumber$1(e)?["[number]"]:IsInteger$1(e)?["[number]"]:[])]}function FromProperties$i(e,t,r){const n={};for(const o of Object.getOwnPropertyNames(t))n[o]=Index(e,IndexPropertyKeys(t[o]),r);return n}function FromMappedResult$b(e,t,r){return FromProperties$i(e,t.properties,r)}function IndexFromMappedResult(e,t,r){const n=FromMappedResult$b(e,t,r);return MappedResult(n)}function FromRest$6(e,t){return e.map(r=>IndexFromPropertyKey(r,t))}function FromIntersectRest(e){return e.filter(t=>!IsNever$1(t))}function FromIntersect$b(e,t){return IntersectEvaluated(FromIntersectRest(FromRest$6(e,t)))}function FromUnionRest(e){return e.some(t=>IsNever$1(t))?[]:e}function FromUnion$b(e,t){return UnionEvaluated(FromUnionRest(FromRest$6(e,t)))}function FromTuple$8(e,t){return t in e?e[t]:t==="[number]"?UnionEvaluated(e):Never()}function FromArray$9(e,t){return t==="[number]"?e:Never()}function FromProperty$2(e,t){return t in e?e[t]:Never()}function IndexFromPropertyKey(e,t){return IsIntersect$1(e)?FromIntersect$b(e.allOf,t):IsUnion$1(e)?FromUnion$b(e.anyOf,t):IsTuple$1(e)?FromTuple$8(e.items??[],t):IsArray$1(e)?FromArray$9(e.items,t):IsObject$1(e)?FromProperty$2(e.properties,t):Never()}function IndexFromPropertyKeys(e,t){return t.map(r=>IndexFromPropertyKey(e,r))}function FromSchema(e,t){return UnionEvaluated(IndexFromPropertyKeys(e,t))}function Index(e,t,r){if(IsRef$1(e)||IsRef$1(t)){const n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!IsSchema$1(e)||!IsSchema$1(t))throw new TypeBoxError(n);return Computed("Index",[e,t])}return IsMappedResult$1(t)?IndexFromMappedResult(e,t,r):IsMappedKey$1(t)?IndexFromMappedKey(e,t,r):CreateType(IsSchema$1(t)?FromSchema(e,IndexPropertyKeys(t)):FromSchema(e,t),r)}function MappedIndexPropertyKey(e,t,r){return{[t]:Index(e,[t],Clone(r))}}function MappedIndexPropertyKeys(e,t,r){return t.reduce((n,o)=>({...n,...MappedIndexPropertyKey(e,o,r)}),{})}function MappedIndexProperties(e,t,r){return MappedIndexPropertyKeys(e,t.keys,r)}function IndexFromMappedKey(e,t,r){const n=MappedIndexProperties(e,t,r);return MappedResult(n)}function Iterator(e,t){return CreateType({[Kind]:"Iterator",type:"Iterator",items:e},t)}function RequiredKeys(e){const t=[];for(let r in e)IsOptional$1(e[r])||t.push(r);return t}function _Object(e,t){const r=RequiredKeys(e),n=r.length>0?{[Kind]:"Object",type:"object",properties:e,required:r}:{[Kind]:"Object",type:"object",properties:e};return CreateType(n,t)}var Object$1=_Object;function Promise$1(e,t){return CreateType({[Kind]:"Promise",type:"Promise",item:e},t)}function RemoveReadonly(e){return CreateType(Discard(e,[ReadonlyKind]))}function AddReadonly(e){return CreateType({...e,[ReadonlyKind]:"Readonly"})}function ReadonlyWithFlag(e,t){return t===!1?RemoveReadonly(e):AddReadonly(e)}function Readonly(e,t){const r=t??!0;return IsMappedResult$1(e)?ReadonlyFromMappedResult(e,r):ReadonlyWithFlag(e,r)}function FromProperties$h(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Readonly(e[n],t);return r}function FromMappedResult$a(e,t){return FromProperties$h(e.properties,t)}function ReadonlyFromMappedResult(e,t){const r=FromMappedResult$a(e,t);return MappedResult(r)}function Tuple(e,t){return CreateType(e.length>0?{[Kind]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Kind]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function FromMappedResult$9(e,t){return e in t?FromSchemaType(e,t[e]):MappedResult(t)}function MappedKeyToKnownMappedResultProperties(e){return{[e]:Literal(e)}}function MappedKeyToUnknownMappedResultProperties(e){const t={};for(const r of e)t[r]=Literal(r);return t}function MappedKeyToMappedResultProperties(e,t){return SetIncludes(t,e)?MappedKeyToKnownMappedResultProperties(e):MappedKeyToUnknownMappedResultProperties(t)}function FromMappedKey$3(e,t){const r=MappedKeyToMappedResultProperties(e,t);return FromMappedResult$9(e,r)}function FromRest$5(e,t){return t.map(r=>FromSchemaType(e,r))}function FromProperties$g(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(t))r[n]=FromSchemaType(e,t[n]);return r}function FromSchemaType(e,t){const r={...t};return IsOptional$1(t)?Optional(FromSchemaType(e,Discard(t,[OptionalKind]))):IsReadonly(t)?Readonly(FromSchemaType(e,Discard(t,[ReadonlyKind]))):IsMappedResult$1(t)?FromMappedResult$9(e,t.properties):IsMappedKey$1(t)?FromMappedKey$3(e,t.keys):IsConstructor$1(t)?Constructor(FromRest$5(e,t.parameters),FromSchemaType(e,t.returns),r):IsFunction$1(t)?Function$1(FromRest$5(e,t.parameters),FromSchemaType(e,t.returns),r):IsAsyncIterator$1(t)?AsyncIterator(FromSchemaType(e,t.items),r):IsIterator$1(t)?Iterator(FromSchemaType(e,t.items),r):IsIntersect$1(t)?Intersect$1(FromRest$5(e,t.allOf),r):IsUnion$1(t)?Union$1(FromRest$5(e,t.anyOf),r):IsTuple$1(t)?Tuple(FromRest$5(e,t.items??[]),r):IsObject$1(t)?Object$1(FromProperties$g(e,t.properties),r):IsArray$1(t)?Array$1(FromSchemaType(e,t.items),r):IsPromise$1(t)?Promise$1(FromSchemaType(e,t.item),r):t}function MappedFunctionReturnType(e,t){const r={};for(const n of e)r[n]=FromSchemaType(n,t);return r}function Mapped(e,t,r){const n=IsSchema$1(e)?IndexPropertyKeys(e):e,o=t({[Kind]:"MappedKey",keys:n}),i=MappedFunctionReturnType(n,o);return Object$1(i,r)}function RemoveOptional(e){return CreateType(Discard(e,[OptionalKind]))}function AddOptional(e){return CreateType({...e,[OptionalKind]:"Optional"})}function OptionalWithFlag(e,t){return t===!1?RemoveOptional(e):AddOptional(e)}function Optional(e,t){const r=t??!0;return IsMappedResult$1(e)?OptionalFromMappedResult(e,r):OptionalWithFlag(e,r)}function FromProperties$f(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Optional(e[n],t);return r}function FromMappedResult$8(e,t){return FromProperties$f(e.properties,t)}function OptionalFromMappedResult(e,t){const r=FromMappedResult$8(e,t);return MappedResult(r)}function IntersectCreate(e,t={}){const r=e.every(o=>IsObject$1(o)),n=IsSchema$1(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return CreateType(t.unevaluatedProperties===!1||IsSchema$1(t.unevaluatedProperties)||r?{...n,[Kind]:"Intersect",type:"object",allOf:e}:{...n,[Kind]:"Intersect",allOf:e},t)}function IsIntersectOptional(e){return e.every(t=>IsOptional$1(t))}function RemoveOptionalFromType(e){return Discard(e,[OptionalKind])}function RemoveOptionalFromRest(e){return e.map(t=>IsOptional$1(t)?RemoveOptionalFromType(t):t)}function ResolveIntersect(e,t){return IsIntersectOptional(e)?Optional(IntersectCreate(RemoveOptionalFromRest(e),t)):IntersectCreate(RemoveOptionalFromRest(e),t)}function IntersectEvaluated(e,t={}){if(e.length===1)return CreateType(e[0],t);if(e.length===0)return Never(t);if(e.some(r=>IsTransform$1(r)))throw new Error("Cannot intersect transform types");return ResolveIntersect(e,t)}function Intersect$1(e,t){if(e.length===1)return CreateType(e[0],t);if(e.length===0)return Never(t);if(e.some(r=>IsTransform$1(r)))throw new Error("Cannot intersect transform types");return IntersectCreate(e,t)}function Ref(...e){const[t,r]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new TypeBoxError("Ref: $ref must be a string");return CreateType({[Kind]:"Ref",$ref:t},r)}function FromComputed$4(e,t){return Computed("Awaited",[Computed(e,t)])}function FromRef$7(e){return Computed("Awaited",[Ref(e)])}function FromIntersect$a(e){return Intersect$1(FromRest$4(e))}function FromUnion$a(e){return Union$1(FromRest$4(e))}function FromPromise$5(e){return Awaited(e)}function FromRest$4(e){return e.map(t=>Awaited(t))}function Awaited(e,t){return CreateType(IsComputed$1(e)?FromComputed$4(e.target,e.parameters):IsIntersect$1(e)?FromIntersect$a(e.allOf):IsUnion$1(e)?FromUnion$a(e.anyOf):IsPromise$1(e)?FromPromise$5(e.item):IsRef$1(e)?FromRef$7(e.$ref):e,t)}function FromRest$3(e){const t=[];for(const r of e)t.push(KeyOfPropertyKeys(r));return t}function FromIntersect$9(e){const t=FromRest$3(e);return SetUnionMany(t)}function FromUnion$9(e){const t=FromRest$3(e);return SetIntersectMany(t)}function FromTuple$7(e){return e.map((t,r)=>r.toString())}function FromArray$8(e){return["[number]"]}function FromProperties$e(e){return globalThis.Object.getOwnPropertyNames(e)}function FromPatternProperties(e){return includePatternProperties?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function KeyOfPropertyKeys(e){return IsIntersect$1(e)?FromIntersect$9(e.allOf):IsUnion$1(e)?FromUnion$9(e.anyOf):IsTuple$1(e)?FromTuple$7(e.items??[]):IsArray$1(e)?FromArray$8(e.items):IsObject$1(e)?FromProperties$e(e.properties):IsRecord$1(e)?FromPatternProperties(e.patternProperties):[]}let includePatternProperties=!1;function KeyOfPattern(e){includePatternProperties=!0;const t=KeyOfPropertyKeys(e);return includePatternProperties=!1,`^(${t.map(n=>`(${n})`).join("|")})$`}function FromComputed$3(e,t){return Computed("KeyOf",[Computed(e,t)])}function FromRef$6(e){return Computed("KeyOf",[Ref(e)])}function KeyOfFromType(e,t){const r=KeyOfPropertyKeys(e),n=KeyOfPropertyKeysToRest(r),o=UnionEvaluated(n);return CreateType(o,t)}function KeyOfPropertyKeysToRest(e){return e.map(t=>t==="[number]"?Number$1():Literal(t))}function KeyOf(e,t){return IsComputed$1(e)?FromComputed$3(e.target,e.parameters):IsRef$1(e)?FromRef$6(e.$ref):IsMappedResult$1(e)?KeyOfFromMappedResult(e,t):KeyOfFromType(e,t)}function FromProperties$d(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=KeyOf(e[n],Clone(t));return r}function FromMappedResult$7(e,t){return FromProperties$d(e.properties,t)}function KeyOfFromMappedResult(e,t){const r=FromMappedResult$7(e,t);return MappedResult(r)}function KeyOfPropertyEntries(e){const t=KeyOfPropertyKeys(e),r=IndexFromPropertyKeys(e,t);return t.map((n,o)=>[t[o],r[o]])}function CompositeKeys(e){const t=[];for(const r of e)t.push(...KeyOfPropertyKeys(r));return SetDistinct(t)}function FilterNever(e){return e.filter(t=>!IsNever$1(t))}function CompositeProperty(e,t){const r=[];for(const n of e)r.push(...IndexFromPropertyKeys(n,[t]));return FilterNever(r)}function CompositeProperties(e,t){const r={};for(const n of t)r[n]=IntersectEvaluated(CompositeProperty(e,n));return r}function Composite(e,t){const r=CompositeKeys(e),n=CompositeProperties(e,r);return Object$1(n,t)}function Date$1(e){return CreateType({[Kind]:"Date",type:"Date"},e)}function Null(e){return CreateType({[Kind]:"Null",type:"null"},e)}function Symbol$1(e){return CreateType({[Kind]:"Symbol",type:"symbol"},e)}function Undefined(e){return CreateType({[Kind]:"Undefined",type:"undefined"},e)}function Uint8Array$1(e){return CreateType({[Kind]:"Uint8Array",type:"Uint8Array"},e)}function Unknown(e){return CreateType({[Kind]:"Unknown"},e)}function FromArray$7(e){return e.map(t=>FromValue(t,!1))}function FromProperties$c(e){const t={};for(const r of globalThis.Object.getOwnPropertyNames(e))t[r]=Readonly(FromValue(e[r],!1));return t}function ConditionalReadonly(e,t){return t===!0?e:Readonly(e)}function FromValue(e,t){return IsAsyncIterator$3(e)||IsIterator$3(e)?ConditionalReadonly(Any(),t):IsArray$3(e)?Readonly(Tuple(FromArray$7(e))):IsUint8Array$3(e)?Uint8Array$1():IsDate$3(e)?Date$1():IsObject$3(e)?ConditionalReadonly(Object$1(FromProperties$c(e)),t):IsFunction$3(e)?ConditionalReadonly(Function$1([],Unknown()),t):IsUndefined$3(e)?Undefined():IsNull$3(e)?Null():IsSymbol$3(e)?Symbol$1():IsBigInt$3(e)?BigInt$2():IsNumber$3(e)||IsBoolean$3(e)||IsString$3(e)?Literal(e):Object$1({})}function Const(e,t){return CreateType(FromValue(e,!0),t)}function ConstructorParameters(e,t){return IsConstructor$1(e)?Tuple(e.parameters,t):Never(t)}function Enum(e,t){if(IsUndefined$3(e))throw new Error("Enum undefined or empty");const r=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),o=[...new Set(r)].map(i=>Literal(i));return Union$1(o,{...t,[Hint]:"Enum"})}class ExtendsResolverError extends TypeBoxError{}var ExtendsResult;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(ExtendsResult||(ExtendsResult={}));function IntoBooleanResult(e){return e===ExtendsResult.False?e:ExtendsResult.True}function Throw(e){throw new ExtendsResolverError(e)}function IsStructuralRight(e){return IsNever(e)||IsIntersect(e)||IsUnion(e)||IsUnknown(e)||IsAny(e)}function StructuralRight(e,t){return IsNever(t)?FromNeverRight():IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)?FromUnionRight(e,t):IsUnknown(t)?FromUnknownRight():IsAny(t)?FromAnyRight():Throw("StructuralRight")}function FromAnyRight(e,t){return ExtendsResult.True}function FromAny$2(e,t){return IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)&&t.anyOf.some(r=>IsAny(r)||IsUnknown(r))?ExtendsResult.True:IsUnion(t)?ExtendsResult.Union:IsUnknown(t)||IsAny(t)?ExtendsResult.True:ExtendsResult.Union}function FromArrayRight(e,t){return IsUnknown(e)?ExtendsResult.False:IsAny(e)?ExtendsResult.Union:IsNever(e)?ExtendsResult.True:ExtendsResult.False}function FromArray$6(e,t){return IsObject(t)&&IsObjectArrayLike(t)?ExtendsResult.True:IsStructuralRight(t)?StructuralRight(e,t):IsArray(t)?IntoBooleanResult(Visit$5(e.items,t.items)):ExtendsResult.False}function FromAsyncIterator$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsAsyncIterator(t)?IntoBooleanResult(Visit$5(e.items,t.items)):ExtendsResult.False}function FromBigInt$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsBigInt(t)?ExtendsResult.True:ExtendsResult.False}function FromBooleanRight(e,t){return IsLiteralBoolean(e)||IsBoolean(e)?ExtendsResult.True:ExtendsResult.False}function FromBoolean$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsBoolean(t)?ExtendsResult.True:ExtendsResult.False}function FromConstructor$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsConstructor(t)?e.parameters.length>t.parameters.length?ExtendsResult.False:e.parameters.every((r,n)=>IntoBooleanResult(Visit$5(t.parameters[n],r))===ExtendsResult.True)?IntoBooleanResult(Visit$5(e.returns,t.returns)):ExtendsResult.False:ExtendsResult.False}function FromDate$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsDate(t)?ExtendsResult.True:ExtendsResult.False}function FromFunction$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsFunction(t)?e.parameters.length>t.parameters.length?ExtendsResult.False:e.parameters.every((r,n)=>IntoBooleanResult(Visit$5(t.parameters[n],r))===ExtendsResult.True)?IntoBooleanResult(Visit$5(e.returns,t.returns)):ExtendsResult.False:ExtendsResult.False}function FromIntegerRight(e,t){return IsLiteral(e)&&IsNumber$3(e.const)||IsNumber(e)||IsInteger(e)?ExtendsResult.True:ExtendsResult.False}function FromInteger$2(e,t){return IsInteger(t)||IsNumber(t)?ExtendsResult.True:IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):ExtendsResult.False}function FromIntersectRight(e,t){return t.allOf.every(r=>Visit$5(e,r)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromIntersect$8(e,t){return e.allOf.some(r=>Visit$5(r,t)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromIterator$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsIterator(t)?IntoBooleanResult(Visit$5(e.items,t.items)):ExtendsResult.False}function FromLiteral$2(e,t){return IsLiteral(t)&&t.const===e.const?ExtendsResult.True:IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsString(t)?FromStringRight(e):IsNumber(t)?FromNumberRight(e):IsInteger(t)?FromIntegerRight(e):IsBoolean(t)?FromBooleanRight(e):ExtendsResult.False}function FromNeverRight(e,t){return ExtendsResult.False}function FromNever$2(e,t){return ExtendsResult.True}function UnwrapTNot(e){let[t,r]=[e,0];for(;IsNot(t);)t=t.not,r+=1;return r%2===0?t:Unknown()}function FromNot$4(e,t){return IsNot(e)?Visit$5(UnwrapTNot(e),t):IsNot(t)?Visit$5(e,UnwrapTNot(t)):Throw("Invalid fallthrough for Not")}function FromNull$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsNull(t)?ExtendsResult.True:ExtendsResult.False}function FromNumberRight(e,t){return IsLiteralNumber(e)||IsNumber(e)||IsInteger(e)?ExtendsResult.True:ExtendsResult.False}function FromNumber$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsInteger(t)||IsNumber(t)?ExtendsResult.True:ExtendsResult.False}function IsObjectPropertyCount(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function IsObjectStringLike(e){return IsObjectArrayLike(e)}function IsObjectSymbolLike(e){return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"description"in e.properties&&IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(IsString(e.properties.description.anyOf[0])&&IsUndefined(e.properties.description.anyOf[1])||IsString(e.properties.description.anyOf[1])&&IsUndefined(e.properties.description.anyOf[0]))}function IsObjectNumberLike(e){return IsObjectPropertyCount(e,0)}function IsObjectBooleanLike(e){return IsObjectPropertyCount(e,0)}function IsObjectBigIntLike(e){return IsObjectPropertyCount(e,0)}function IsObjectDateLike(e){return IsObjectPropertyCount(e,0)}function IsObjectUint8ArrayLike(e){return IsObjectArrayLike(e)}function IsObjectFunctionLike(e){const t=Number$1();return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"length"in e.properties&&IntoBooleanResult(Visit$5(e.properties.length,t))===ExtendsResult.True}function IsObjectConstructorLike(e){return IsObjectPropertyCount(e,0)}function IsObjectArrayLike(e){const t=Number$1();return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"length"in e.properties&&IntoBooleanResult(Visit$5(e.properties.length,t))===ExtendsResult.True}function IsObjectPromiseLike(e){const t=Function$1([Any()],Any());return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"then"in e.properties&&IntoBooleanResult(Visit$5(e.properties.then,t))===ExtendsResult.True}function Property(e,t){return Visit$5(e,t)===ExtendsResult.False||IsOptional(e)&&!IsOptional(t)?ExtendsResult.False:ExtendsResult.True}function FromObjectRight(e,t){return IsUnknown(e)?ExtendsResult.False:IsAny(e)?ExtendsResult.Union:IsNever(e)||IsLiteralString(e)&&IsObjectStringLike(t)||IsLiteralNumber(e)&&IsObjectNumberLike(t)||IsLiteralBoolean(e)&&IsObjectBooleanLike(t)||IsSymbol(e)&&IsObjectSymbolLike(t)||IsBigInt(e)&&IsObjectBigIntLike(t)||IsString(e)&&IsObjectStringLike(t)||IsSymbol(e)&&IsObjectSymbolLike(t)||IsNumber(e)&&IsObjectNumberLike(t)||IsInteger(e)&&IsObjectNumberLike(t)||IsBoolean(e)&&IsObjectBooleanLike(t)||IsUint8Array(e)&&IsObjectUint8ArrayLike(t)||IsDate(e)&&IsObjectDateLike(t)||IsConstructor(e)&&IsObjectConstructorLike(t)||IsFunction(e)&&IsObjectFunctionLike(t)?ExtendsResult.True:IsRecord(e)&&IsString(RecordKey$1(e))?t[Hint]==="Record"?ExtendsResult.True:ExtendsResult.False:IsRecord(e)&&IsNumber(RecordKey$1(e))?IsObjectPropertyCount(t,0)?ExtendsResult.True:ExtendsResult.False:ExtendsResult.False}function FromObject$a(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsObject(t)?(()=>{for(const r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!IsOptional(t.properties[r]))return ExtendsResult.False;if(IsOptional(t.properties[r]))return ExtendsResult.True;if(Property(e.properties[r],t.properties[r])===ExtendsResult.False)return ExtendsResult.False}return ExtendsResult.True})():ExtendsResult.False}function FromPromise$4(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)&&IsObjectPromiseLike(t)?ExtendsResult.True:IsPromise(t)?IntoBooleanResult(Visit$5(e.item,t.item)):ExtendsResult.False}function RecordKey$1(e){return PatternNumberExact in e.patternProperties?Number$1():PatternStringExact in e.patternProperties?String$1():Throw("Unknown record key pattern")}function RecordValue$1(e){return PatternNumberExact in e.patternProperties?e.patternProperties[PatternNumberExact]:PatternStringExact in e.patternProperties?e.patternProperties[PatternStringExact]:Throw("Unable to get record value schema")}function FromRecordRight(e,t){const[r,n]=[RecordKey$1(t),RecordValue$1(t)];return IsLiteralString(e)&&IsNumber(r)&&IntoBooleanResult(Visit$5(e,n))===ExtendsResult.True?ExtendsResult.True:IsUint8Array(e)&&IsNumber(r)||IsString(e)&&IsNumber(r)||IsArray(e)&&IsNumber(r)?Visit$5(e,n):IsObject(e)?(()=>{for(const o of Object.getOwnPropertyNames(e.properties))if(Property(n,e.properties[o])===ExtendsResult.False)return ExtendsResult.False;return ExtendsResult.True})():ExtendsResult.False}function FromRecord$6(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?Visit$5(RecordValue$1(e),RecordValue$1(t)):ExtendsResult.False}function FromRegExp$2(e,t){const r=IsRegExp(e)?String$1():e,n=IsRegExp(t)?String$1():t;return Visit$5(r,n)}function FromStringRight(e,t){return IsLiteral(e)&&IsString$3(e.const)||IsString(e)?ExtendsResult.True:ExtendsResult.False}function FromString$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsString(t)?ExtendsResult.True:ExtendsResult.False}function FromSymbol$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsSymbol(t)?ExtendsResult.True:ExtendsResult.False}function FromTemplateLiteral$3(e,t){return IsTemplateLiteral(e)?Visit$5(TemplateLiteralToUnion(e),t):IsTemplateLiteral(t)?Visit$5(e,TemplateLiteralToUnion(t)):Throw("Invalid fallthrough for TemplateLiteral")}function IsArrayOfTuple(e,t){return IsArray(t)&&e.items!==void 0&&e.items.every(r=>Visit$5(r,t.items)===ExtendsResult.True)}function FromTupleRight(e,t){return IsNever(e)?ExtendsResult.True:IsUnknown(e)?ExtendsResult.False:IsAny(e)?ExtendsResult.Union:ExtendsResult.False}function FromTuple$6(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)&&IsObjectArrayLike(t)||IsArray(t)&&IsArrayOfTuple(e,t)?ExtendsResult.True:IsTuple(t)?IsUndefined$3(e.items)&&!IsUndefined$3(t.items)||!IsUndefined$3(e.items)&&IsUndefined$3(t.items)?ExtendsResult.False:IsUndefined$3(e.items)&&!IsUndefined$3(t.items)||e.items.every((r,n)=>Visit$5(r,t.items[n])===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False:ExtendsResult.False}function FromUint8Array$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsUint8Array(t)?ExtendsResult.True:ExtendsResult.False}function FromUndefined$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsVoid(t)?FromVoidRight(e):IsUndefined(t)?ExtendsResult.True:ExtendsResult.False}function FromUnionRight(e,t){return t.anyOf.some(r=>Visit$5(e,r)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromUnion$8(e,t){return e.anyOf.every(r=>Visit$5(r,t)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromUnknownRight(e,t){return ExtendsResult.True}function FromUnknown$2(e,t){return IsNever(t)?FromNeverRight():IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)?FromUnionRight(e,t):IsAny(t)?FromAnyRight():IsString(t)?FromStringRight(e):IsNumber(t)?FromNumberRight(e):IsInteger(t)?FromIntegerRight(e):IsBoolean(t)?FromBooleanRight(e):IsArray(t)?FromArrayRight(e):IsTuple(t)?FromTupleRight(e):IsObject(t)?FromObjectRight(e,t):IsUnknown(t)?ExtendsResult.True:ExtendsResult.False}function FromVoidRight(e,t){return IsUndefined(e)||IsUndefined(e)?ExtendsResult.True:ExtendsResult.False}function FromVoid$2(e,t){return IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)?FromUnionRight(e,t):IsUnknown(t)?FromUnknownRight():IsAny(t)?FromAnyRight():IsObject(t)?FromObjectRight(e,t):IsVoid(t)?ExtendsResult.True:ExtendsResult.False}function Visit$5(e,t){return IsTemplateLiteral(e)||IsTemplateLiteral(t)?FromTemplateLiteral$3(e,t):IsRegExp(e)||IsRegExp(t)?FromRegExp$2(e,t):IsNot(e)||IsNot(t)?FromNot$4(e,t):IsAny(e)?FromAny$2(e,t):IsArray(e)?FromArray$6(e,t):IsBigInt(e)?FromBigInt$2(e,t):IsBoolean(e)?FromBoolean$2(e,t):IsAsyncIterator(e)?FromAsyncIterator$5(e,t):IsConstructor(e)?FromConstructor$5(e,t):IsDate(e)?FromDate$2(e,t):IsFunction(e)?FromFunction$5(e,t):IsInteger(e)?FromInteger$2(e,t):IsIntersect(e)?FromIntersect$8(e,t):IsIterator(e)?FromIterator$5(e,t):IsLiteral(e)?FromLiteral$2(e,t):IsNever(e)?FromNever$2():IsNull(e)?FromNull$2(e,t):IsNumber(e)?FromNumber$2(e,t):IsObject(e)?FromObject$a(e,t):IsRecord(e)?FromRecord$6(e,t):IsString(e)?FromString$2(e,t):IsSymbol(e)?FromSymbol$2(e,t):IsTuple(e)?FromTuple$6(e,t):IsPromise(e)?FromPromise$4(e,t):IsUint8Array(e)?FromUint8Array$2(e,t):IsUndefined(e)?FromUndefined$2(e,t):IsUnion(e)?FromUnion$8(e,t):IsUnknown(e)?FromUnknown$2(e,t):IsVoid(e)?FromVoid$2(e,t):Throw(`Unknown left type operand '${e[Kind]}'`)}function ExtendsCheck(e,t){return Visit$5(e,t)}function FromProperties$b(e,t,r,n,o){const i={};for(const u of globalThis.Object.getOwnPropertyNames(e))i[u]=Extends(e[u],t,r,n,Clone(o));return i}function FromMappedResult$6(e,t,r,n,o){return FromProperties$b(e.properties,t,r,n,o)}function ExtendsFromMappedResult(e,t,r,n,o){const i=FromMappedResult$6(e,t,r,n,o);return MappedResult(i)}function ExtendsResolve(e,t,r,n){const o=ExtendsCheck(e,t);return o===ExtendsResult.Union?Union$1([r,n]):o===ExtendsResult.True?r:n}function Extends(e,t,r,n,o){return IsMappedResult$1(e)?ExtendsFromMappedResult(e,t,r,n,o):IsMappedKey$1(e)?CreateType(ExtendsFromMappedKey(e,t,r,n,o)):CreateType(ExtendsResolve(e,t,r,n),o)}function FromPropertyKey$2(e,t,r,n,o){return{[e]:Extends(Literal(e),t,r,n,Clone(o))}}function FromPropertyKeys$2(e,t,r,n,o){return e.reduce((i,u)=>({...i,...FromPropertyKey$2(u,t,r,n,o)}),{})}function FromMappedKey$2(e,t,r,n,o){return FromPropertyKeys$2(e.keys,t,r,n,o)}function ExtendsFromMappedKey(e,t,r,n,o){const i=FromMappedKey$2(e,t,r,n,o);return MappedResult(i)}function Intersect(e){return e.allOf.every(t=>ExtendsUndefinedCheck(t))}function Union(e){return e.anyOf.some(t=>ExtendsUndefinedCheck(t))}function Not$1(e){return!ExtendsUndefinedCheck(e.not)}function ExtendsUndefinedCheck(e){return e[Kind]==="Intersect"?Intersect(e):e[Kind]==="Union"?Union(e):e[Kind]==="Not"?Not$1(e):e[Kind]==="Undefined"}function ExcludeFromTemplateLiteral(e,t){return Exclude(TemplateLiteralToUnion(e),t)}function ExcludeRest(e,t){const r=e.filter(n=>ExtendsCheck(n,t)===ExtendsResult.False);return r.length===1?r[0]:Union$1(r)}function Exclude(e,t,r={}){return IsTemplateLiteral$1(e)?CreateType(ExcludeFromTemplateLiteral(e,t),r):IsMappedResult$1(e)?CreateType(ExcludeFromMappedResult(e,t),r):CreateType(IsUnion$1(e)?ExcludeRest(e.anyOf,t):ExtendsCheck(e,t)!==ExtendsResult.False?Never():e,r)}function FromProperties$a(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Exclude(e[n],t);return r}function FromMappedResult$5(e,t){return FromProperties$a(e.properties,t)}function ExcludeFromMappedResult(e,t){const r=FromMappedResult$5(e,t);return MappedResult(r)}function ExtractFromTemplateLiteral(e,t){return Extract(TemplateLiteralToUnion(e),t)}function ExtractRest(e,t){const r=e.filter(n=>ExtendsCheck(n,t)!==ExtendsResult.False);return r.length===1?r[0]:Union$1(r)}function Extract(e,t,r){return IsTemplateLiteral$1(e)?CreateType(ExtractFromTemplateLiteral(e,t),r):IsMappedResult$1(e)?CreateType(ExtractFromMappedResult(e,t),r):CreateType(IsUnion$1(e)?ExtractRest(e.anyOf,t):ExtendsCheck(e,t)!==ExtendsResult.False?e:Never(),r)}function FromProperties$9(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Extract(e[n],t);return r}function FromMappedResult$4(e,t){return FromProperties$9(e.properties,t)}function ExtractFromMappedResult(e,t){const r=FromMappedResult$4(e,t);return MappedResult(r)}function InstanceType(e,t){return IsConstructor$1(e)?CreateType(e.returns,t):Never(t)}function ReadonlyOptional(e){return Readonly(Optional(e))}function RecordCreateFromPattern(e,t,r){return CreateType({[Kind]:"Record",type:"object",patternProperties:{[e]:t}},r)}function RecordCreateFromKeys(e,t,r){const n={};for(const o of e)n[o]=t;return Object$1(n,{...r,[Hint]:"Record"})}function FromTemplateLiteralKey(e,t,r){return IsTemplateLiteralFinite(e)?RecordCreateFromKeys(IndexPropertyKeys(e),t,r):RecordCreateFromPattern(e.pattern,t,r)}function FromUnionKey(e,t,r){return RecordCreateFromKeys(IndexPropertyKeys(Union$1(e)),t,r)}function FromLiteralKey(e,t,r){return RecordCreateFromKeys([e.toString()],t,r)}function FromRegExpKey(e,t,r){return RecordCreateFromPattern(e.source,t,r)}function FromStringKey(e,t,r){const n=IsUndefined$3(e.pattern)?PatternStringExact:e.pattern;return RecordCreateFromPattern(n,t,r)}function FromAnyKey(e,t,r){return RecordCreateFromPattern(PatternStringExact,t,r)}function FromNeverKey(e,t,r){return RecordCreateFromPattern(PatternNeverExact,t,r)}function FromBooleanKey(e,t,r){return Object$1({true:t,false:t},r)}function FromIntegerKey(e,t,r){return RecordCreateFromPattern(PatternNumberExact,t,r)}function FromNumberKey(e,t,r){return RecordCreateFromPattern(PatternNumberExact,t,r)}function Record(e,t,r={}){return IsUnion$1(e)?FromUnionKey(e.anyOf,t,r):IsTemplateLiteral$1(e)?FromTemplateLiteralKey(e,t,r):IsLiteral$1(e)?FromLiteralKey(e.const,t,r):IsBoolean$1(e)?FromBooleanKey(e,t,r):IsInteger$1(e)?FromIntegerKey(e,t,r):IsNumber$1(e)?FromNumberKey(e,t,r):IsRegExp$1(e)?FromRegExpKey(e,t,r):IsString$1(e)?FromStringKey(e,t,r):IsAny$1(e)?FromAnyKey(e,t,r):IsNever$1(e)?FromNeverKey(e,t,r):Never(r)}function RecordPattern(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function RecordKey(e){const t=RecordPattern(e);return t===PatternStringExact?String$1():t===PatternNumberExact?Number$1():String$1({pattern:t})}function RecordValue(e){return e.patternProperties[RecordPattern(e)]}function FromConstructor$4(e,t){return t.parameters=FromTypes$1(e,t.parameters),t.returns=FromType$1(e,t.returns),t}function FromFunction$4(e,t){return t.parameters=FromTypes$1(e,t.parameters),t.returns=FromType$1(e,t.returns),t}function FromIntersect$7(e,t){return t.allOf=FromTypes$1(e,t.allOf),t}function FromUnion$7(e,t){return t.anyOf=FromTypes$1(e,t.anyOf),t}function FromTuple$5(e,t){return IsUndefined$3(t.items)||(t.items=FromTypes$1(e,t.items)),t}function FromArray$5(e,t){return t.items=FromType$1(e,t.items),t}function FromAsyncIterator$4(e,t){return t.items=FromType$1(e,t.items),t}function FromIterator$4(e,t){return t.items=FromType$1(e,t.items),t}function FromPromise$3(e,t){return t.item=FromType$1(e,t.item),t}function FromObject$9(e,t){const r=FromProperties$8(e,t.properties);return{...t,...Object$1(r)}}function FromRecord$5(e,t){const r=FromType$1(e,RecordKey(t)),n=FromType$1(e,RecordValue(t)),o=Record(r,n);return{...t,...o}}function FromArgument$2(e,t){return t.index in e?e[t.index]:Unknown()}function FromProperty$1(e,t){const r=IsReadonly(t),n=IsOptional$1(t),o=FromType$1(e,t);return r&&n?ReadonlyOptional(o):r&&!n?Readonly(o):!r&&n?Optional(o):o}function FromProperties$8(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>({...r,[n]:FromProperty$1(e,t[n])}),{})}function FromTypes$1(e,t){return t.map(r=>FromType$1(e,r))}function FromType$1(e,t){return IsConstructor$1(t)?FromConstructor$4(e,t):IsFunction$1(t)?FromFunction$4(e,t):IsIntersect$1(t)?FromIntersect$7(e,t):IsUnion$1(t)?FromUnion$7(e,t):IsTuple$1(t)?FromTuple$5(e,t):IsArray$1(t)?FromArray$5(e,t):IsAsyncIterator$1(t)?FromAsyncIterator$4(e,t):IsIterator$1(t)?FromIterator$4(e,t):IsPromise$1(t)?FromPromise$3(e,t):IsObject$1(t)?FromObject$9(e,t):IsRecord$1(t)?FromRecord$5(e,t):IsArgument$1(t)?FromArgument$2(e,t):t}function Instantiate(e,t){return FromType$1(t,CloneType(e))}function Integer(e){return CreateType({[Kind]:"Integer",type:"integer"},e)}function MappedIntrinsicPropertyKey(e,t,r){return{[e]:Intrinsic(Literal(e),t,Clone(r))}}function MappedIntrinsicPropertyKeys(e,t,r){return e.reduce((o,i)=>({...o,...MappedIntrinsicPropertyKey(i,t,r)}),{})}function MappedIntrinsicProperties(e,t,r){return MappedIntrinsicPropertyKeys(e.keys,t,r)}function IntrinsicFromMappedKey(e,t,r){const n=MappedIntrinsicProperties(e,t,r);return MappedResult(n)}function ApplyUncapitalize(e){const[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function ApplyCapitalize(e){const[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function ApplyUppercase(e){return e.toUpperCase()}function ApplyLowercase(e){return e.toLowerCase()}function FromTemplateLiteral$2(e,t,r){const n=TemplateLiteralParseExact(e.pattern);if(!IsTemplateLiteralExpressionFinite(n))return{...e,pattern:FromLiteralValue(e.pattern,t)};const u=[...TemplateLiteralExpressionGenerate(n)].map(f=>Literal(f)),a=FromRest$2(u,t),s=Union$1(a);return TemplateLiteral([s],r)}function FromLiteralValue(e,t){return typeof e=="string"?t==="Uncapitalize"?ApplyUncapitalize(e):t==="Capitalize"?ApplyCapitalize(e):t==="Uppercase"?ApplyUppercase(e):t==="Lowercase"?ApplyLowercase(e):e:e.toString()}function FromRest$2(e,t){return e.map(r=>Intrinsic(r,t))}function Intrinsic(e,t,r={}){return IsMappedKey$1(e)?IntrinsicFromMappedKey(e,t,r):IsTemplateLiteral$1(e)?FromTemplateLiteral$2(e,t,r):IsUnion$1(e)?Union$1(FromRest$2(e.anyOf,t),r):IsLiteral$1(e)?Literal(FromLiteralValue(e.const,t),r):CreateType(e,r)}function Capitalize(e,t={}){return Intrinsic(e,"Capitalize",t)}function Lowercase(e,t={}){return Intrinsic(e,"Lowercase",t)}function Uncapitalize(e,t={}){return Intrinsic(e,"Uncapitalize",t)}function Uppercase(e,t={}){return Intrinsic(e,"Uppercase",t)}function FromProperties$7(e,t,r){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Omit(e[o],t,Clone(r));return n}function FromMappedResult$3(e,t,r){return FromProperties$7(e.properties,t,r)}function OmitFromMappedResult(e,t,r){const n=FromMappedResult$3(e,t,r);return MappedResult(n)}function FromIntersect$6(e,t){return e.map(r=>OmitResolve(r,t))}function FromUnion$6(e,t){return e.map(r=>OmitResolve(r,t))}function FromProperty(e,t){const{[t]:r,...n}=e;return n}function FromProperties$6(e,t){return t.reduce((r,n)=>FromProperty(r,n),e)}function FromObject$8(e,t){const r=Discard(e,[TransformKind,"$id","required","properties"]),n=FromProperties$6(e.properties,t);return Object$1(n,r)}function UnionFromPropertyKeys$1(e){const t=e.reduce((r,n)=>IsLiteralValue$1(n)?[...r,Literal(n)]:r,[]);return Union$1(t)}function OmitResolve(e,t){return IsIntersect$1(e)?Intersect$1(FromIntersect$6(e.allOf,t)):IsUnion$1(e)?Union$1(FromUnion$6(e.anyOf,t)):IsObject$1(e)?FromObject$8(e,t):Object$1({})}function Omit(e,t,r){const n=IsArray$3(t)?UnionFromPropertyKeys$1(t):t,o=IsSchema$1(t)?IndexPropertyKeys(t):t,i=IsRef$1(e),u=IsRef$1(t);return IsMappedResult$1(e)?OmitFromMappedResult(e,o,r):IsMappedKey$1(t)?OmitFromMappedKey(e,t,r):i&&u?Computed("Omit",[e,n],r):!i&&u?Computed("Omit",[e,n],r):i&&!u?Computed("Omit",[e,n],r):CreateType({...OmitResolve(e,o),...r})}function FromPropertyKey$1(e,t,r){return{[t]:Omit(e,[t],Clone(r))}}function FromPropertyKeys$1(e,t,r){return t.reduce((n,o)=>({...n,...FromPropertyKey$1(e,o,r)}),{})}function FromMappedKey$1(e,t,r){return FromPropertyKeys$1(e,t.keys,r)}function OmitFromMappedKey(e,t,r){const n=FromMappedKey$1(e,t,r);return MappedResult(n)}function FromProperties$5(e,t,r){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Pick(e[o],t,Clone(r));return n}function FromMappedResult$2(e,t,r){return FromProperties$5(e.properties,t,r)}function PickFromMappedResult(e,t,r){const n=FromMappedResult$2(e,t,r);return MappedResult(n)}function FromIntersect$5(e,t){return e.map(r=>PickResolve(r,t))}function FromUnion$5(e,t){return e.map(r=>PickResolve(r,t))}function FromProperties$4(e,t){const r={};for(const n of t)n in e&&(r[n]=e[n]);return r}function FromObject$7(e,t){const r=Discard(e,[TransformKind,"$id","required","properties"]),n=FromProperties$4(e.properties,t);return Object$1(n,r)}function UnionFromPropertyKeys(e){const t=e.reduce((r,n)=>IsLiteralValue$1(n)?[...r,Literal(n)]:r,[]);return Union$1(t)}function PickResolve(e,t){return IsIntersect$1(e)?Intersect$1(FromIntersect$5(e.allOf,t)):IsUnion$1(e)?Union$1(FromUnion$5(e.anyOf,t)):IsObject$1(e)?FromObject$7(e,t):Object$1({})}function Pick(e,t,r){const n=IsArray$3(t)?UnionFromPropertyKeys(t):t,o=IsSchema$1(t)?IndexPropertyKeys(t):t,i=IsRef$1(e),u=IsRef$1(t);return IsMappedResult$1(e)?PickFromMappedResult(e,o,r):IsMappedKey$1(t)?PickFromMappedKey(e,t,r):i&&u?Computed("Pick",[e,n],r):!i&&u?Computed("Pick",[e,n],r):i&&!u?Computed("Pick",[e,n],r):CreateType({...PickResolve(e,o),...r})}function FromPropertyKey(e,t,r){return{[t]:Pick(e,[t],Clone(r))}}function FromPropertyKeys(e,t,r){return t.reduce((n,o)=>({...n,...FromPropertyKey(e,o,r)}),{})}function FromMappedKey(e,t,r){return FromPropertyKeys(e,t.keys,r)}function PickFromMappedKey(e,t,r){const n=FromMappedKey(e,t,r);return MappedResult(n)}function FromComputed$2(e,t){return Computed("Partial",[Computed(e,t)])}function FromRef$5(e){return Computed("Partial",[Ref(e)])}function FromProperties$3(e){const t={};for(const r of globalThis.Object.getOwnPropertyNames(e))t[r]=Optional(e[r]);return t}function FromObject$6(e){const t=Discard(e,[TransformKind,"$id","required","properties"]),r=FromProperties$3(e.properties);return Object$1(r,t)}function FromRest$1(e){return e.map(t=>PartialResolve(t))}function PartialResolve(e){return IsComputed$1(e)?FromComputed$2(e.target,e.parameters):IsRef$1(e)?FromRef$5(e.$ref):IsIntersect$1(e)?Intersect$1(FromRest$1(e.allOf)):IsUnion$1(e)?Union$1(FromRest$1(e.anyOf)):IsObject$1(e)?FromObject$6(e):IsBigInt$1(e)||IsBoolean$1(e)||IsInteger$1(e)||IsLiteral$1(e)||IsNull$1(e)||IsNumber$1(e)||IsString$1(e)||IsSymbol$1(e)||IsUndefined$1(e)?e:Object$1({})}function Partial(e,t){return IsMappedResult$1(e)?PartialFromMappedResult(e,t):CreateType({...PartialResolve(e),...t})}function FromProperties$2(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Partial(e[n],Clone(t));return r}function FromMappedResult$1(e,t){return FromProperties$2(e.properties,t)}function PartialFromMappedResult(e,t){const r=FromMappedResult$1(e,t);return MappedResult(r)}function FromComputed$1(e,t){return Computed("Required",[Computed(e,t)])}function FromRef$4(e){return Computed("Required",[Ref(e)])}function FromProperties$1(e){const t={};for(const r of globalThis.Object.getOwnPropertyNames(e))t[r]=Discard(e[r],[OptionalKind]);return t}function FromObject$5(e){const t=Discard(e,[TransformKind,"$id","required","properties"]),r=FromProperties$1(e.properties);return Object$1(r,t)}function FromRest(e){return e.map(t=>RequiredResolve(t))}function RequiredResolve(e){return IsComputed$1(e)?FromComputed$1(e.target,e.parameters):IsRef$1(e)?FromRef$4(e.$ref):IsIntersect$1(e)?Intersect$1(FromRest(e.allOf)):IsUnion$1(e)?Union$1(FromRest(e.anyOf)):IsObject$1(e)?FromObject$5(e):IsBigInt$1(e)||IsBoolean$1(e)||IsInteger$1(e)||IsLiteral$1(e)||IsNull$1(e)||IsNumber$1(e)||IsString$1(e)||IsSymbol$1(e)||IsUndefined$1(e)?e:Object$1({})}function Required(e,t){return IsMappedResult$1(e)?RequiredFromMappedResult(e,t):CreateType({...RequiredResolve(e),...t})}function FromProperties(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Required(e[n],t);return r}function FromMappedResult(e,t){return FromProperties(e.properties,t)}function RequiredFromMappedResult(e,t){const r=FromMappedResult(e,t);return MappedResult(r)}function DereferenceParameters(e,t){return t.map(r=>IsRef$1(r)?Dereference(e,r.$ref):FromType(e,r))}function Dereference(e,t){return t in e?IsRef$1(e[t])?Dereference(e,e[t].$ref):FromType(e,e[t]):Never()}function FromAwaited(e){return Awaited(e[0])}function FromIndex(e){return Index(e[0],e[1])}function FromKeyOf(e){return KeyOf(e[0])}function FromPartial(e){return Partial(e[0])}function FromOmit(e){return Omit(e[0],e[1])}function FromPick(e){return Pick(e[0],e[1])}function FromRequired(e){return Required(e[0])}function FromComputed(e,t,r){const n=DereferenceParameters(e,r);return t==="Awaited"?FromAwaited(n):t==="Index"?FromIndex(n):t==="KeyOf"?FromKeyOf(n):t==="Partial"?FromPartial(n):t==="Omit"?FromOmit(n):t==="Pick"?FromPick(n):t==="Required"?FromRequired(n):Never()}function FromArray$4(e,t){return Array$1(FromType(e,t))}function FromAsyncIterator$3(e,t){return AsyncIterator(FromType(e,t))}function FromConstructor$3(e,t,r){return Constructor(FromTypes(e,t),FromType(e,r))}function FromFunction$3(e,t,r){return Function$1(FromTypes(e,t),FromType(e,r))}function FromIntersect$4(e,t){return Intersect$1(FromTypes(e,t))}function FromIterator$3(e,t){return Iterator(FromType(e,t))}function FromObject$4(e,t){return Object$1(globalThis.Object.keys(t).reduce((r,n)=>({...r,[n]:FromType(e,t[n])}),{}))}function FromRecord$4(e,t){const[r,n]=[FromType(e,RecordValue(t)),RecordPattern(t)],o=CloneType(t);return o.patternProperties[n]=r,o}function FromTransform(e,t){return IsRef$1(t)?{...Dereference(e,t.$ref),[TransformKind]:t[TransformKind]}:t}function FromTuple$4(e,t){return Tuple(FromTypes(e,t))}function FromUnion$4(e,t){return Union$1(FromTypes(e,t))}function FromTypes(e,t){return t.map(r=>FromType(e,r))}function FromType(e,t){return IsOptional$1(t)?CreateType(FromType(e,Discard(t,[OptionalKind])),t):IsReadonly(t)?CreateType(FromType(e,Discard(t,[ReadonlyKind])),t):IsTransform$1(t)?CreateType(FromTransform(e,t),t):IsArray$1(t)?CreateType(FromArray$4(e,t.items),t):IsAsyncIterator$1(t)?CreateType(FromAsyncIterator$3(e,t.items),t):IsComputed$1(t)?CreateType(FromComputed(e,t.target,t.parameters)):IsConstructor$1(t)?CreateType(FromConstructor$3(e,t.parameters,t.returns),t):IsFunction$1(t)?CreateType(FromFunction$3(e,t.parameters,t.returns),t):IsIntersect$1(t)?CreateType(FromIntersect$4(e,t.allOf),t):IsIterator$1(t)?CreateType(FromIterator$3(e,t.items),t):IsObject$1(t)?CreateType(FromObject$4(e,t.properties),t):IsRecord$1(t)?CreateType(FromRecord$4(e,t)):IsTuple$1(t)?CreateType(FromTuple$4(e,t.items||[]),t):IsUnion$1(t)?CreateType(FromUnion$4(e,t.anyOf),t):t}function ComputeType(e,t){return t in e?FromType(e,e[t]):Never()}function ComputeModuleProperties(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,r)=>({...t,[r]:ComputeType(e,r)}),{})}class TModule{constructor(t){const r=ComputeModuleProperties(t),n=this.WithIdentifiers(r);this.$defs=n}Import(t,r){const n={...this.$defs,[t]:CreateType(this.$defs[t],r)};return CreateType({[Kind]:"Import",$defs:n,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>({...r,[n]:{...t[n],$id:n}}),{})}}function Module(e){return new TModule(e)}function Not(e,t){return CreateType({[Kind]:"Not",not:e},t)}function Parameters(e,t){return IsFunction$1(e)?Tuple(e.parameters,t):Never()}let Ordinal=0;function Recursive(e,t={}){IsUndefined$3(t.$id)&&(t.$id=`T${Ordinal++}`);const r=CloneType(e({[Kind]:"This",$ref:`${t.$id}`}));return r.$id=t.$id,CreateType({[Hint]:"Recursive",...r},t)}function RegExp$1(e,t){const r=IsString$3(e)?new globalThis.RegExp(e):e;return CreateType({[Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}function RestResolve(e){return IsIntersect$1(e)?e.allOf:IsUnion$1(e)?e.anyOf:IsTuple$1(e)?e.items??[]:[]}function Rest(e){return RestResolve(e)}function ReturnType(e,t){return IsFunction$1(e)?CreateType(e.returns,t):Never(t)}class TransformDecodeBuilder{constructor(t){this.schema=t}Decode(t){return new TransformEncodeBuilder(this.schema,t)}}class TransformEncodeBuilder{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){const i={Encode:u=>r[TransformKind].Encode(t(u)),Decode:u=>this.decode(r[TransformKind].Decode(u))};return{...r,[TransformKind]:i}}EncodeSchema(t,r){const n={Decode:this.decode,Encode:t};return{...r,[TransformKind]:n}}Encode(t){return IsTransform$1(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}}function Transform(e){return new TransformDecodeBuilder(e)}function Unsafe(e={}){return CreateType({[Kind]:e[Kind]??"Unsafe"},e)}function Void(e){return CreateType({[Kind]:"Void",type:"void"},e)}const TypeBuilder=Object.freeze(Object.defineProperty({__proto__:null,Any,Argument,Array:Array$1,AsyncIterator,Awaited,BigInt:BigInt$2,Boolean:Boolean$1,Capitalize,Composite,Const,Constructor,ConstructorParameters,Date:Date$1,Enum,Exclude,Extends,Extract,Function:Function$1,Index,InstanceType,Instantiate,Integer,Intersect:Intersect$1,Iterator,KeyOf,Literal,Lowercase,Mapped,Module,Never,Not,Null,Number:Number$1,Object:Object$1,Omit,Optional,Parameters,Partial,Pick,Promise:Promise$1,Readonly,ReadonlyOptional,Record,Recursive,Ref,RegExp:RegExp$1,Required,Rest,ReturnType,String:String$1,Symbol:Symbol$1,TemplateLiteral,Transform,Tuple,Uint8Array:Uint8Array$1,Uncapitalize,Undefined,Union:Union$1,Unknown,Unsafe,Uppercase,Void},Symbol.toStringTag,{value:"Module"})),Type=TypeBuilder;function DefaultErrorFunction(e){switch(e.errorType){case ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case ValueErrorType.Array:return"Expected array";case ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case ValueErrorType.BigInt:return"Expected bigint";case ValueErrorType.Boolean:return"Expected boolean";case ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case ValueErrorType.Date:return"Expected Date";case ValueErrorType.Function:return"Expected function";case ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case ValueErrorType.Integer:return"Expected integer";case ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case ValueErrorType.Intersect:return"Expected all values to match";case ValueErrorType.Iterator:return"Expected Iterator";case ValueErrorType.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case ValueErrorType.Never:return"Never";case ValueErrorType.Not:return"Value should not match";case ValueErrorType.Null:return"Expected null";case ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case ValueErrorType.Number:return"Expected number";case ValueErrorType.Object:return"Expected object";case ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case ValueErrorType.ObjectRequiredProperty:return"Expected required property";case ValueErrorType.Promise:return"Expected Promise";case ValueErrorType.RegExp:return"Expected string to match regular expression";case ValueErrorType.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case ValueErrorType.StringFormat:return`Expected string to match '${e.schema.format}' format`;case ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case ValueErrorType.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case ValueErrorType.String:return"Expected string";case ValueErrorType.Symbol:return"Expected symbol";case ValueErrorType.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case ValueErrorType.Tuple:return"Expected tuple";case ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case ValueErrorType.Uint8Array:return"Expected Uint8Array";case ValueErrorType.Undefined:return"Expected undefined";case ValueErrorType.Union:return"Expected union value";case ValueErrorType.Void:return"Expected void";case ValueErrorType.Kind:return`Expected kind '${e.schema[Kind]}'`;default:return"Unknown error type"}}let errorFunction=DefaultErrorFunction;function GetErrorFunction(){return errorFunction}class TypeDereferenceError extends TypeBoxError{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`),this.schema=t}}function Resolve(e,t){const r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new TypeDereferenceError(e);return Deref(r,t)}function Pushref(e,t){return!IsString$2(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function Deref(e,t){return e[Kind]==="This"||e[Kind]==="Ref"?Resolve(e,t):e}class ValueHashError extends TypeBoxError{constructor(t){super("Unable to hash value"),this.value=t}}var ByteMarker;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(ByteMarker||(ByteMarker={}));let Accumulator=BigInt("14695981039346656037");const[Prime,Size]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Bytes=Array.from({length:256}).map((e,t)=>BigInt(t)),F64=new Float64Array(1),F64In=new DataView(F64.buffer),F64Out=new Uint8Array(F64.buffer);function*NumberToBytes(e){const t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}function ArrayType(e){FNV1A64(ByteMarker.Array);for(const t of e)Visit$4(t)}function BooleanType(e){FNV1A64(ByteMarker.Boolean),FNV1A64(e?1:0)}function BigIntType(e){FNV1A64(ByteMarker.BigInt),F64In.setBigInt64(0,e);for(const t of F64Out)FNV1A64(t)}function DateType(e){FNV1A64(ByteMarker.Date),Visit$4(e.getTime())}function NullType(e){FNV1A64(ByteMarker.Null)}function NumberType(e){FNV1A64(ByteMarker.Number),F64In.setFloat64(0,e);for(const t of F64Out)FNV1A64(t)}function ObjectType(e){FNV1A64(ByteMarker.Object);for(const t of globalThis.Object.getOwnPropertyNames(e).sort())Visit$4(t),Visit$4(e[t])}function StringType(e){FNV1A64(ByteMarker.String);for(let t=0;t<e.length;t++)for(const r of NumberToBytes(e.charCodeAt(t)))FNV1A64(r)}function SymbolType(e){FNV1A64(ByteMarker.Symbol),Visit$4(e.description)}function Uint8ArrayType(e){FNV1A64(ByteMarker.Uint8Array);for(let t=0;t<e.length;t++)FNV1A64(e[t])}function UndefinedType(e){return FNV1A64(ByteMarker.Undefined)}function Visit$4(e){if(IsArray$2(e))return ArrayType(e);if(IsBoolean$2(e))return BooleanType(e);if(IsBigInt$2(e))return BigIntType(e);if(IsDate$2(e))return DateType(e);if(IsNull$2(e))return NullType();if(IsNumber$2(e))return NumberType(e);if(IsObject$2(e))return ObjectType(e);if(IsString$2(e))return StringType(e);if(IsSymbol$2(e))return SymbolType(e);if(IsUint8Array$2(e))return Uint8ArrayType(e);if(IsUndefined$2(e))return UndefinedType();throw new ValueHashError(e)}function FNV1A64(e){Accumulator=Accumulator^Bytes[e],Accumulator=Accumulator*Prime%Size}function Hash$1(e){return Accumulator=BigInt("14695981039346656037"),Visit$4(e),Accumulator}class ValueCheckUnknownTypeError extends TypeBoxError{constructor(t){super("Unknown type"),this.schema=t}}function IsAnyOrUnknown(e){return e[Kind]==="Any"||e[Kind]==="Unknown"}function IsDefined$1(e){return e!==void 0}function FromAny$1(e,t,r){return!0}function FromArgument$1(e,t,r){return!0}function FromArray$3(e,t,r){if(!IsArray$2(r)||IsDefined$1(e.minItems)&&!(r.length>=e.minItems)||IsDefined$1(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>Visit$3(e.items,t,i))||e.uniqueItems===!0&&!(function(){const i=new Set;for(const u of r){const a=Hash$1(u);if(i.has(a))return!1;i.add(a)}return!0})())return!1;if(!(IsDefined$1(e.contains)||IsNumber$2(e.minContains)||IsNumber$2(e.maxContains)))return!0;const n=IsDefined$1(e.contains)?e.contains:Never(),o=r.reduce((i,u)=>Visit$3(n,t,u)?i+1:i,0);return!(o===0||IsNumber$2(e.minContains)&&o<e.minContains||IsNumber$2(e.maxContains)&&o>e.maxContains)}function FromAsyncIterator$2(e,t,r){return IsAsyncIterator$2(r)}function FromBigInt$1(e,t,r){return!(!IsBigInt$2(r)||IsDefined$1(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||IsDefined$1(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||IsDefined$1(e.maximum)&&!(r<=e.maximum)||IsDefined$1(e.minimum)&&!(r>=e.minimum)||IsDefined$1(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function FromBoolean$1(e,t,r){return IsBoolean$2(r)}function FromConstructor$2(e,t,r){return Visit$3(e.returns,t,r.prototype)}function FromDate$1(e,t,r){return!(!IsDate$2(r)||IsDefined$1(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||IsDefined$1(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||IsDefined$1(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||IsDefined$1(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||IsDefined$1(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function FromFunction$2(e,t,r){return IsFunction$2(r)}function FromImport$3(e,t,r){const n=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return Visit$3(o,[...t,...n],r)}function FromInteger$1(e,t,r){return!(!IsInteger$2(r)||IsDefined$1(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||IsDefined$1(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||IsDefined$1(e.maximum)&&!(r<=e.maximum)||IsDefined$1(e.minimum)&&!(r>=e.minimum)||IsDefined$1(e.multipleOf)&&r%e.multipleOf!==0)}function FromIntersect$3(e,t,r){const n=e.allOf.every(o=>Visit$3(o,t,r));if(e.unevaluatedProperties===!1){const o=new RegExp(KeyOfPattern(e)),i=Object.getOwnPropertyNames(r).every(u=>o.test(u));return n&&i}else if(IsSchema$1(e.unevaluatedProperties)){const o=new RegExp(KeyOfPattern(e)),i=Object.getOwnPropertyNames(r).every(u=>o.test(u)||Visit$3(e.unevaluatedProperties,t,r[u]));return n&&i}else return n}function FromIterator$2(e,t,r){return IsIterator$2(r)}function FromLiteral$1(e,t,r){return r===e.const}function FromNever$1(e,t,r){return!1}function FromNot$3(e,t,r){return!Visit$3(e.not,t,r)}function FromNull$1(e,t,r){return IsNull$2(r)}function FromNumber$1(e,t,r){return!(!TypeSystemPolicy.IsNumberLike(r)||IsDefined$1(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||IsDefined$1(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||IsDefined$1(e.minimum)&&!(r>=e.minimum)||IsDefined$1(e.maximum)&&!(r<=e.maximum)||IsDefined$1(e.multipleOf)&&r%e.multipleOf!==0)}function FromObject$3(e,t,r){if(!TypeSystemPolicy.IsObjectLike(r)||IsDefined$1(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||IsDefined$1(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;const n=Object.getOwnPropertyNames(e.properties);for(const o of n){const i=e.properties[o];if(e.required&&e.required.includes(o)){if(!Visit$3(i,t,r[o])||(ExtendsUndefinedCheck(i)||IsAnyOrUnknown(i))&&!(o in r))return!1}else if(TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Visit$3(i,t,r[o]))return!1}if(e.additionalProperties===!1){const o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&o.length===n.length?!0:o.every(i=>n.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(i=>n.includes(i)||Visit$3(e.additionalProperties,t,r[i])):!0}function FromPromise$2(e,t,r){return IsPromise$2(r)}function FromRecord$3(e,t,r){if(!TypeSystemPolicy.IsRecordLike(r)||IsDefined$1(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||IsDefined$1(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;const[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),u=Object.entries(r).every(([f,c])=>i.test(f)?Visit$3(o,t,c):!0),a=typeof e.additionalProperties=="object"?Object.entries(r).every(([f,c])=>i.test(f)?!0:Visit$3(e.additionalProperties,t,c)):!0,s=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(f=>i.test(f)):!0;return u&&a&&s}function FromRef$3(e,t,r){return Visit$3(Deref(e,t),t,r)}function FromRegExp$1(e,t,r){const n=new RegExp(e.source,e.flags);return IsDefined$1(e.minLength)&&!(r.length>=e.minLength)||IsDefined$1(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}function FromString$1(e,t,r){return!IsString$2(r)||IsDefined$1(e.minLength)&&!(r.length>=e.minLength)||IsDefined$1(e.maxLength)&&!(r.length<=e.maxLength)||IsDefined$1(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:IsDefined$1(e.format)?Has$1(e.format)?Get$1(e.format)(r):!1:!0}function FromSymbol$1(e,t,r){return IsSymbol$2(r)}function FromTemplateLiteral$1(e,t,r){return IsString$2(r)&&new RegExp(e.pattern).test(r)}function FromThis$3(e,t,r){return Visit$3(Deref(e,t),t,r)}function FromTuple$3(e,t,r){if(!IsArray$2(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!Visit$3(e.items[n],t,r[n]))return!1;return!0}function FromUndefined$1(e,t,r){return IsUndefined$2(r)}function FromUnion$3(e,t,r){return e.anyOf.some(n=>Visit$3(n,t,r))}function FromUint8Array$1(e,t,r){return!(!IsUint8Array$2(r)||IsDefined$1(e.maxByteLength)&&!(r.length<=e.maxByteLength)||IsDefined$1(e.minByteLength)&&!(r.length>=e.minByteLength))}function FromUnknown$1(e,t,r){return!0}function FromVoid$1(e,t,r){return TypeSystemPolicy.IsVoidLike(r)}function FromKind$1(e,t,r){return Has(e[Kind])?Get(e[Kind])(e,r):!1}function Visit$3(e,t,r){const n=IsDefined$1(e.$id)?Pushref(e,t):t,o=e;switch(o[Kind]){case"Any":return FromAny$1();case"Argument":return FromArgument$1();case"Array":return FromArray$3(o,n,r);case"AsyncIterator":return FromAsyncIterator$2(o,n,r);case"BigInt":return FromBigInt$1(o,n,r);case"Boolean":return FromBoolean$1(o,n,r);case"Constructor":return FromConstructor$2(o,n,r);case"Date":return FromDate$1(o,n,r);case"Function":return FromFunction$2(o,n,r);case"Import":return FromImport$3(o,n,r);case"Integer":return FromInteger$1(o,n,r);case"Intersect":return FromIntersect$3(o,n,r);case"Iterator":return FromIterator$2(o,n,r);case"Literal":return FromLiteral$1(o,n,r);case"Never":return FromNever$1();case"Not":return FromNot$3(o,n,r);case"Null":return FromNull$1(o,n,r);case"Number":return FromNumber$1(o,n,r);case"Object":return FromObject$3(o,n,r);case"Promise":return FromPromise$2(o,n,r);case"Record":return FromRecord$3(o,n,r);case"Ref":return FromRef$3(o,n,r);case"RegExp":return FromRegExp$1(o,n,r);case"String":return FromString$1(o,n,r);case"Symbol":return FromSymbol$1(o,n,r);case"TemplateLiteral":return FromTemplateLiteral$1(o,n,r);case"This":return FromThis$3(o,n,r);case"Tuple":return FromTuple$3(o,n,r);case"Undefined":return FromUndefined$1(o,n,r);case"Union":return FromUnion$3(o,n,r);case"Uint8Array":return FromUint8Array$1(o,n,r);case"Unknown":return FromUnknown$1();case"Void":return FromVoid$1(o,n,r);default:if(!Has(o[Kind]))throw new ValueCheckUnknownTypeError(o);return FromKind$1(o,n,r)}}function Check(...e){return e.length===3?Visit$3(e[0],e[1],e[2]):Visit$3(e[0],[],e[1])}var ValueErrorType;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(ValueErrorType||(ValueErrorType={}));class ValueErrorsUnknownTypeError extends TypeBoxError{constructor(t){super("Unknown type"),this.schema=t}}function EscapeKey(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function IsDefined(e){return e!==void 0}class ValueErrorIterator{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){const t=this.iterator.next();return t.done?void 0:t.value}}function Create(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:GetErrorFunction()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}function*FromAny(e,t,r,n){}function*FromArgument(e,t,r,n){}function*FromArray$2(e,t,r,n){if(!IsArray$2(n))return yield Create(ValueErrorType.Array,e,r,n);IsDefined(e.minItems)&&!(n.length>=e.minItems)&&(yield Create(ValueErrorType.ArrayMinItems,e,r,n)),IsDefined(e.maxItems)&&!(n.length<=e.maxItems)&&(yield Create(ValueErrorType.ArrayMaxItems,e,r,n));for(let u=0;u<n.length;u++)yield*Visit$2(e.items,t,`${r}/${u}`,n[u]);if(e.uniqueItems===!0&&!(function(){const u=new Set;for(const a of n){const s=Hash$1(a);if(u.has(s))return!1;u.add(s)}return!0})()&&(yield Create(ValueErrorType.ArrayUniqueItems,e,r,n)),!(IsDefined(e.contains)||IsDefined(e.minContains)||IsDefined(e.maxContains)))return;const o=IsDefined(e.contains)?e.contains:Never(),i=n.reduce((u,a,s)=>Visit$2(o,t,`${r}${s}`,a).next().done===!0?u+1:u,0);i===0&&(yield Create(ValueErrorType.ArrayContains,e,r,n)),IsNumber$2(e.minContains)&&i<e.minContains&&(yield Create(ValueErrorType.ArrayMinContains,e,r,n)),IsNumber$2(e.maxContains)&&i>e.maxContains&&(yield Create(ValueErrorType.ArrayMaxContains,e,r,n))}function*FromAsyncIterator$1(e,t,r,n){IsAsyncIterator$2(n)||(yield Create(ValueErrorType.AsyncIterator,e,r,n))}function*FromBigInt(e,t,r,n){if(!IsBigInt$2(n))return yield Create(ValueErrorType.BigInt,e,r,n);IsDefined(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Create(ValueErrorType.BigIntExclusiveMaximum,e,r,n)),IsDefined(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Create(ValueErrorType.BigIntExclusiveMinimum,e,r,n)),IsDefined(e.maximum)&&!(n<=e.maximum)&&(yield Create(ValueErrorType.BigIntMaximum,e,r,n)),IsDefined(e.minimum)&&!(n>=e.minimum)&&(yield Create(ValueErrorType.BigIntMinimum,e,r,n)),IsDefined(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield Create(ValueErrorType.BigIntMultipleOf,e,r,n))}function*FromBoolean(e,t,r,n){IsBoolean$2(n)||(yield Create(ValueErrorType.Boolean,e,r,n))}function*FromConstructor$1(e,t,r,n){yield*Visit$2(e.returns,t,r,n.prototype)}function*FromDate(e,t,r,n){if(!IsDate$2(n))return yield Create(ValueErrorType.Date,e,r,n);IsDefined(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield Create(ValueErrorType.DateExclusiveMaximumTimestamp,e,r,n)),IsDefined(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield Create(ValueErrorType.DateExclusiveMinimumTimestamp,e,r,n)),IsDefined(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield Create(ValueErrorType.DateMaximumTimestamp,e,r,n)),IsDefined(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield Create(ValueErrorType.DateMinimumTimestamp,e,r,n)),IsDefined(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield Create(ValueErrorType.DateMultipleOfTimestamp,e,r,n))}function*FromFunction$1(e,t,r,n){IsFunction$2(n)||(yield Create(ValueErrorType.Function,e,r,n))}function*FromImport$2(e,t,r,n){const o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];yield*Visit$2(i,[...t,...o],r,n)}function*FromInteger(e,t,r,n){if(!IsInteger$2(n))return yield Create(ValueErrorType.Integer,e,r,n);IsDefined(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Create(ValueErrorType.IntegerExclusiveMaximum,e,r,n)),IsDefined(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Create(ValueErrorType.IntegerExclusiveMinimum,e,r,n)),IsDefined(e.maximum)&&!(n<=e.maximum)&&(yield Create(ValueErrorType.IntegerMaximum,e,r,n)),IsDefined(e.minimum)&&!(n>=e.minimum)&&(yield Create(ValueErrorType.IntegerMinimum,e,r,n)),IsDefined(e.multipleOf)&&n%e.multipleOf!==0&&(yield Create(ValueErrorType.IntegerMultipleOf,e,r,n))}function*FromIntersect$2(e,t,r,n){let o=!1;for(const i of e.allOf)for(const u of Visit$2(i,t,r,n))o=!0,yield u;if(o)return yield Create(ValueErrorType.Intersect,e,r,n);if(e.unevaluatedProperties===!1){const i=new RegExp(KeyOfPattern(e));for(const u of Object.getOwnPropertyNames(n))i.test(u)||(yield Create(ValueErrorType.IntersectUnevaluatedProperties,e,`${r}/${u}`,n))}if(typeof e.unevaluatedProperties=="object"){const i=new RegExp(KeyOfPattern(e));for(const u of Object.getOwnPropertyNames(n))if(!i.test(u)){const a=Visit$2(e.unevaluatedProperties,t,`${r}/${u}`,n[u]).next();a.done||(yield a.value)}}}function*FromIterator$1(e,t,r,n){IsIterator$2(n)||(yield Create(ValueErrorType.Iterator,e,r,n))}function*FromLiteral(e,t,r,n){n!==e.const&&(yield Create(ValueErrorType.Literal,e,r,n))}function*FromNever(e,t,r,n){yield Create(ValueErrorType.Never,e,r,n)}function*FromNot$2(e,t,r,n){Visit$2(e.not,t,r,n).next().done===!0&&(yield Create(ValueErrorType.Not,e,r,n))}function*FromNull(e,t,r,n){IsNull$2(n)||(yield Create(ValueErrorType.Null,e,r,n))}function*FromNumber(e,t,r,n){if(!TypeSystemPolicy.IsNumberLike(n))return yield Create(ValueErrorType.Number,e,r,n);IsDefined(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Create(ValueErrorType.NumberExclusiveMaximum,e,r,n)),IsDefined(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Create(ValueErrorType.NumberExclusiveMinimum,e,r,n)),IsDefined(e.maximum)&&!(n<=e.maximum)&&(yield Create(ValueErrorType.NumberMaximum,e,r,n)),IsDefined(e.minimum)&&!(n>=e.minimum)&&(yield Create(ValueErrorType.NumberMinimum,e,r,n)),IsDefined(e.multipleOf)&&n%e.multipleOf!==0&&(yield Create(ValueErrorType.NumberMultipleOf,e,r,n))}function*FromObject$2(e,t,r,n){if(!TypeSystemPolicy.IsObjectLike(n))return yield Create(ValueErrorType.Object,e,r,n);IsDefined(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield Create(ValueErrorType.ObjectMinProperties,e,r,n)),IsDefined(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield Create(ValueErrorType.ObjectMaxProperties,e,r,n));const o=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),u=Object.getOwnPropertyNames(n);for(const a of o)u.includes(a)||(yield Create(ValueErrorType.ObjectRequiredProperty,e.properties[a],`${r}/${EscapeKey(a)}`,void 0));if(e.additionalProperties===!1)for(const a of u)i.includes(a)||(yield Create(ValueErrorType.ObjectAdditionalProperties,e,`${r}/${EscapeKey(a)}`,n[a]));if(typeof e.additionalProperties=="object")for(const a of u)i.includes(a)||(yield*Visit$2(e.additionalProperties,t,`${r}/${EscapeKey(a)}`,n[a]));for(const a of i){const s=e.properties[a];e.required&&e.required.includes(a)?(yield*Visit$2(s,t,`${r}/${EscapeKey(a)}`,n[a]),ExtendsUndefinedCheck(e)&&!(a in n)&&(yield Create(ValueErrorType.ObjectRequiredProperty,s,`${r}/${EscapeKey(a)}`,void 0))):TypeSystemPolicy.IsExactOptionalProperty(n,a)&&(yield*Visit$2(s,t,`${r}/${EscapeKey(a)}`,n[a]))}}function*FromPromise$1(e,t,r,n){IsPromise$2(n)||(yield Create(ValueErrorType.Promise,e,r,n))}function*FromRecord$2(e,t,r,n){if(!TypeSystemPolicy.IsRecordLike(n))return yield Create(ValueErrorType.Object,e,r,n);IsDefined(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield Create(ValueErrorType.ObjectMinProperties,e,r,n)),IsDefined(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield Create(ValueErrorType.ObjectMaxProperties,e,r,n));const[o,i]=Object.entries(e.patternProperties)[0],u=new RegExp(o);for(const[a,s]of Object.entries(n))u.test(a)&&(yield*Visit$2(i,t,`${r}/${EscapeKey(a)}`,s));if(typeof e.additionalProperties=="object")for(const[a,s]of Object.entries(n))u.test(a)||(yield*Visit$2(e.additionalProperties,t,`${r}/${EscapeKey(a)}`,s));if(e.additionalProperties===!1){for(const[a,s]of Object.entries(n))if(!u.test(a))return yield Create(ValueErrorType.ObjectAdditionalProperties,e,`${r}/${EscapeKey(a)}`,s)}}function*FromRef$2(e,t,r,n){yield*Visit$2(Deref(e,t),t,r,n)}function*FromRegExp(e,t,r,n){if(!IsString$2(n))return yield Create(ValueErrorType.String,e,r,n);if(IsDefined(e.minLength)&&!(n.length>=e.minLength)&&(yield Create(ValueErrorType.StringMinLength,e,r,n)),IsDefined(e.maxLength)&&!(n.length<=e.maxLength)&&(yield Create(ValueErrorType.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield Create(ValueErrorType.RegExp,e,r,n)}function*FromString(e,t,r,n){if(!IsString$2(n))return yield Create(ValueErrorType.String,e,r,n);IsDefined(e.minLength)&&!(n.length>=e.minLength)&&(yield Create(ValueErrorType.StringMinLength,e,r,n)),IsDefined(e.maxLength)&&!(n.length<=e.maxLength)&&(yield Create(ValueErrorType.StringMaxLength,e,r,n)),IsString$2(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield Create(ValueErrorType.StringPattern,e,r,n))),IsString$2(e.format)&&(Has$1(e.format)?Get$1(e.format)(n)||(yield Create(ValueErrorType.StringFormat,e,r,n)):yield Create(ValueErrorType.StringFormatUnknown,e,r,n))}function*FromSymbol(e,t,r,n){IsSymbol$2(n)||(yield Create(ValueErrorType.Symbol,e,r,n))}function*FromTemplateLiteral(e,t,r,n){if(!IsString$2(n))return yield Create(ValueErrorType.String,e,r,n);new RegExp(e.pattern).test(n)||(yield Create(ValueErrorType.StringPattern,e,r,n))}function*FromThis$2(e,t,r,n){yield*Visit$2(Deref(e,t),t,r,n)}function*FromTuple$2(e,t,r,n){if(!IsArray$2(n))return yield Create(ValueErrorType.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield Create(ValueErrorType.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield Create(ValueErrorType.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*Visit$2(e.items[o],t,`${r}/${o}`,n[o])}function*FromUndefined(e,t,r,n){IsUndefined$2(n)||(yield Create(ValueErrorType.Undefined,e,r,n))}function*FromUnion$2(e,t,r,n){if(Check(e,t,n))return;const o=e.anyOf.map(i=>new ValueErrorIterator(Visit$2(i,t,r,n)));yield Create(ValueErrorType.Union,e,r,n,o)}function*FromUint8Array(e,t,r,n){if(!IsUint8Array$2(n))return yield Create(ValueErrorType.Uint8Array,e,r,n);IsDefined(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield Create(ValueErrorType.Uint8ArrayMaxByteLength,e,r,n)),IsDefined(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield Create(ValueErrorType.Uint8ArrayMinByteLength,e,r,n))}function*FromUnknown(e,t,r,n){}function*FromVoid(e,t,r,n){TypeSystemPolicy.IsVoidLike(n)||(yield Create(ValueErrorType.Void,e,r,n))}function*FromKind(e,t,r,n){Get(e[Kind])(e,n)||(yield Create(ValueErrorType.Kind,e,r,n))}function*Visit$2(e,t,r,n){const o=IsDefined(e.$id)?[...t,e]:t,i=e;switch(i[Kind]){case"Any":return yield*FromAny();case"Argument":return yield*FromArgument();case"Array":return yield*FromArray$2(i,o,r,n);case"AsyncIterator":return yield*FromAsyncIterator$1(i,o,r,n);case"BigInt":return yield*FromBigInt(i,o,r,n);case"Boolean":return yield*FromBoolean(i,o,r,n);case"Constructor":return yield*FromConstructor$1(i,o,r,n);case"Date":return yield*FromDate(i,o,r,n);case"Function":return yield*FromFunction$1(i,o,r,n);case"Import":return yield*FromImport$2(i,o,r,n);case"Integer":return yield*FromInteger(i,o,r,n);case"Intersect":return yield*FromIntersect$2(i,o,r,n);case"Iterator":return yield*FromIterator$1(i,o,r,n);case"Literal":return yield*FromLiteral(i,o,r,n);case"Never":return yield*FromNever(i,o,r,n);case"Not":return yield*FromNot$2(i,o,r,n);case"Null":return yield*FromNull(i,o,r,n);case"Number":return yield*FromNumber(i,o,r,n);case"Object":return yield*FromObject$2(i,o,r,n);case"Promise":return yield*FromPromise$1(i,o,r,n);case"Record":return yield*FromRecord$2(i,o,r,n);case"Ref":return yield*FromRef$2(i,o,r,n);case"RegExp":return yield*FromRegExp(i,o,r,n);case"String":return yield*FromString(i,o,r,n);case"Symbol":return yield*FromSymbol(i,o,r,n);case"TemplateLiteral":return yield*FromTemplateLiteral(i,o,r,n);case"This":return yield*FromThis$2(i,o,r,n);case"Tuple":return yield*FromTuple$2(i,o,r,n);case"Undefined":return yield*FromUndefined(i,o,r,n);case"Union":return yield*FromUnion$2(i,o,r,n);case"Uint8Array":return yield*FromUint8Array(i,o,r,n);case"Unknown":return yield*FromUnknown();case"Void":return yield*FromVoid(i,o,r,n);default:if(!Has(i[Kind]))throw new ValueErrorsUnknownTypeError(e);return yield*FromKind(i,o,r,n)}}function Errors(...e){const t=e.length===3?Visit$2(e[0],e[1],"",e[2]):Visit$2(e[0],[],"",e[1]);return new ValueErrorIterator(t)}class TransformDecodeCheckError extends TypeBoxError{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}}class TransformDecodeError extends TypeBoxError{constructor(t,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=o}}function Default(e,t,r){try{return IsTransform$1(e)?e[TransformKind].Decode(r):r}catch(n){throw new TransformDecodeError(e,t,r,n)}}function FromArray$1(e,t,r,n){return IsArray$2(n)?Default(e,r,n.map((o,i)=>Visit$1(e.items,t,`${r}/${i}`,o))):Default(e,r,n)}function FromIntersect$1(e,t,r,n){if(!IsObject$2(n)||IsValueType(n))return Default(e,r,n);const o=KeyOfPropertyEntries(e),i=o.map(c=>c[0]),u={...n};for(const[c,d]of o)c in u&&(u[c]=Visit$1(d,t,`${r}/${c}`,u[c]));if(!IsTransform$1(e.unevaluatedProperties))return Default(e,r,u);const a=Object.getOwnPropertyNames(u),s=e.unevaluatedProperties,f={...u};for(const c of a)i.includes(c)||(f[c]=Default(s,`${r}/${c}`,f[c]));return Default(e,r,f)}function FromImport$1(e,t,r,n){const o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref],u=Visit$1(i,[...t,...o],r,n);return Default(e,r,u)}function FromNot$1(e,t,r,n){return Default(e,r,Visit$1(e.not,t,r,n))}function FromObject$1(e,t,r,n){if(!IsObject$2(n))return Default(e,r,n);const o=KeyOfPropertyKeys(e),i={...n};for(const f of o)HasPropertyKey(i,f)&&(IsUndefined$2(i[f])&&(!IsUndefined$1(e.properties[f])||TypeSystemPolicy.IsExactOptionalProperty(i,f))||(i[f]=Visit$1(e.properties[f],t,`${r}/${f}`,i[f])));if(!IsSchema$1(e.additionalProperties))return Default(e,r,i);const u=Object.getOwnPropertyNames(i),a=e.additionalProperties,s={...i};for(const f of u)o.includes(f)||(s[f]=Default(a,`${r}/${f}`,s[f]));return Default(e,r,s)}function FromRecord$1(e,t,r,n){if(!IsObject$2(n))return Default(e,r,n);const o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),u={...n};for(const c of Object.getOwnPropertyNames(n))i.test(c)&&(u[c]=Visit$1(e.patternProperties[o],t,`${r}/${c}`,u[c]));if(!IsSchema$1(e.additionalProperties))return Default(e,r,u);const a=Object.getOwnPropertyNames(u),s=e.additionalProperties,f={...u};for(const c of a)i.test(c)||(f[c]=Default(s,`${r}/${c}`,f[c]));return Default(e,r,f)}function FromRef$1(e,t,r,n){const o=Deref(e,t);return Default(e,r,Visit$1(o,t,r,n))}function FromThis$1(e,t,r,n){const o=Deref(e,t);return Default(e,r,Visit$1(o,t,r,n))}function FromTuple$1(e,t,r,n){return IsArray$2(n)&&IsArray$2(e.items)?Default(e,r,e.items.map((o,i)=>Visit$1(o,t,`${r}/${i}`,n[i]))):Default(e,r,n)}function FromUnion$1(e,t,r,n){for(const o of e.anyOf){if(!Check(o,t,n))continue;const i=Visit$1(o,t,r,n);return Default(e,r,i)}return Default(e,r,n)}function Visit$1(e,t,r,n){const o=Pushref(e,t),i=e;switch(e[Kind]){case"Array":return FromArray$1(i,o,r,n);case"Import":return FromImport$1(i,o,r,n);case"Intersect":return FromIntersect$1(i,o,r,n);case"Not":return FromNot$1(i,o,r,n);case"Object":return FromObject$1(i,o,r,n);case"Record":return FromRecord$1(i,o,r,n);case"Ref":return FromRef$1(i,o,r,n);case"Symbol":return Default(i,r,n);case"This":return FromThis$1(i,o,r,n);case"Tuple":return FromTuple$1(i,o,r,n);case"Union":return FromUnion$1(i,o,r,n);default:return Default(i,r,n)}}function TransformDecode(e,t,r){return Visit$1(e,t,"",r)}function FromArray(e,t){return IsTransform$1(e)||Visit(e.items,t)}function FromAsyncIterator(e,t){return IsTransform$1(e)||Visit(e.items,t)}function FromConstructor(e,t){return IsTransform$1(e)||Visit(e.returns,t)||e.parameters.some(r=>Visit(r,t))}function FromFunction(e,t){return IsTransform$1(e)||Visit(e.returns,t)||e.parameters.some(r=>Visit(r,t))}function FromIntersect(e,t){return IsTransform$1(e)||IsTransform$1(e.unevaluatedProperties)||e.allOf.some(r=>Visit(r,t))}function FromImport(e,t){const r=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((o,i)=>[...o,e.$defs[i]],[]),n=e.$defs[e.$ref];return IsTransform$1(e)||Visit(n,[...r,...t])}function FromIterator(e,t){return IsTransform$1(e)||Visit(e.items,t)}function FromNot(e,t){return IsTransform$1(e)||Visit(e.not,t)}function FromObject(e,t){return IsTransform$1(e)||Object.values(e.properties).some(r=>Visit(r,t))||IsSchema$1(e.additionalProperties)&&Visit(e.additionalProperties,t)}function FromPromise(e,t){return IsTransform$1(e)||Visit(e.item,t)}function FromRecord(e,t){const r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return IsTransform$1(e)||Visit(n,t)||IsSchema$1(e.additionalProperties)&&IsTransform$1(e.additionalProperties)}function FromRef(e,t){return IsTransform$1(e)?!0:Visit(Deref(e,t),t)}function FromThis(e,t){return IsTransform$1(e)?!0:Visit(Deref(e,t),t)}function FromTuple(e,t){return IsTransform$1(e)||!IsUndefined$2(e.items)&&e.items.some(r=>Visit(r,t))}function FromUnion(e,t){return IsTransform$1(e)||e.anyOf.some(r=>Visit(r,t))}function Visit(e,t){const r=Pushref(e,t),n=e;if(e.$id&&visited.has(e.$id))return!1;switch(e.$id&&visited.add(e.$id),e[Kind]){case"Array":return FromArray(n,r);case"AsyncIterator":return FromAsyncIterator(n,r);case"Constructor":return FromConstructor(n,r);case"Function":return FromFunction(n,r);case"Import":return FromImport(n,r);case"Intersect":return FromIntersect(n,r);case"Iterator":return FromIterator(n,r);case"Not":return FromNot(n,r);case"Object":return FromObject(n,r);case"Promise":return FromPromise(n,r);case"Record":return FromRecord(n,r);case"Ref":return FromRef(n,r);case"This":return FromThis(n,r);case"Tuple":return FromTuple(n,r);case"Union":return FromUnion(n,r);default:return IsTransform$1(e)}}const visited=new Set;function HasTransform(e,t){return visited.clear(),Visit(e,t)}function Decode(...e){const[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Check(t,r,n))throw new TransformDecodeCheckError(t,n,Errors(t,r,n).First());return HasTransform(t,r)?TransformDecode(t,r,n):n}var lib={},assert$1={exports:{}},errors={},util$2={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max$1,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max$1=Math.max),max$1}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round=Math.round),round}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var sign$2,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$2;hasRequiredSign$1=1;var e=require_isNaN();return sign$2=function(r){return e(r)||r===0?r:r<0?-1:1},sign$2}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var e=requireGOPD();if(e)try{e([],"length")}catch{e=null}return gopd=e,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return esDefineProperty=e,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var e=requireEsObjectAtoms();return Object_getPrototypeOf=e.getPrototypeOf||null,Object_getPrototypeOf}var implementation$4,hasRequiredImplementation$4;function requireImplementation$4(){if(hasRequiredImplementation$4)return implementation$4;hasRequiredImplementation$4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",o=function(s,f){for(var c=[],d=0;d<s.length;d+=1)c[d]=s[d];for(var p=0;p<f.length;p+=1)c[p+s.length]=f[p];return c},i=function(s,f){for(var c=[],d=f,p=0;d<s.length;d+=1,p+=1)c[p]=s[d];return c},u=function(a,s){for(var f="",c=0;c<a.length;c+=1)f+=a[c],c+1<a.length&&(f+=s);return f};return implementation$4=function(s){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var c=i(arguments,1),d,p=function(){if(this instanceof d){var S=f.apply(this,o(c,arguments));return Object(S)===S?S:this}return f.apply(s,o(c,arguments))},h=r(0,f.length-c.length),y=[],b=0;b<h;b++)y[b]="$"+b;if(d=Function("binder","return function ("+u(y,",")+"){ return binder.apply(this,arguments); }")(p),f.prototype){var w=function(){};w.prototype=f.prototype,d.prototype=new w,w.prototype=null}return d},implementation$4}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var e=requireImplementation$4();return functionBind=Function.prototype.bind||e,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),n=requireReflectApply();return actualApply=n||e.call(r,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType(),r=requireFunctionCall(),n=requireActualApply();return callBindApplyHelpers=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return n(e,r,i)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var e=requireCallBindApplyHelpers(),t=requireGopd(),r;try{r=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!r&&t&&t(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return get=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var e=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),r=requireGet();return getProto=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:r?function(o){return r(o)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=requireFunctionBind();return hasown=r.call(e,t),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var e,t=requireEsObjectAtoms(),r=requireEsErrors(),n=require_eval(),o=requireRange(),i=requireRef(),u=requireSyntax(),a=requireType(),s=requireUri(),f=requireAbs(),c=requireFloor(),d=requireMax(),p=requireMin(),h=requirePow(),y=requireRound(),b=requireSign$1(),w=Function,S=function(ui){try{return w('"use strict"; return ('+ui+").constructor;")()}catch{}},E=requireGopd(),B=requireEsDefineProperty(),ae=function(){throw new a},W=E?(function(){try{return arguments.callee,ae}catch{try{return E(arguments,"callee").get}catch{return ae}}})():ae,J=requireHasSymbols()(),ve=requireGetProto(),Qe=requireObject_getPrototypeOf(),kt=requireReflect_getPrototypeOf(),nr=requireFunctionApply(),sr=requireFunctionCall(),ce={},Ze=typeof Uint8Array>"u"||!ve?e:ve(Uint8Array),se={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":J&&ve?ve([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":ce,"%AsyncGenerator%":ce,"%AsyncGeneratorFunction%":ce,"%AsyncIteratorPrototype%":ce,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":ce,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":J&&ve?ve(ve([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!J||!ve?e:ve(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!J||!ve?e:ve(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":J&&ve?ve(""[Symbol.iterator]()):e,"%Symbol%":J?Symbol:e,"%SyntaxError%":u,"%ThrowTypeError%":W,"%TypedArray%":Ze,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":sr,"%Function.prototype.apply%":nr,"%Object.defineProperty%":B,"%Object.getPrototypeOf%":Qe,"%Math.abs%":f,"%Math.floor%":c,"%Math.max%":d,"%Math.min%":p,"%Math.pow%":h,"%Math.round%":y,"%Math.sign%":b,"%Reflect.getPrototypeOf%":kt};if(ve)try{null.error}catch(ui){var vt=ve(ve(ui));se["%Error.prototype%"]=vt}var ur=function ui(lr){var ar;if(lr==="%AsyncFunction%")ar=S("async function () {}");else if(lr==="%GeneratorFunction%")ar=S("function* () {}");else if(lr==="%AsyncGeneratorFunction%")ar=S("async function* () {}");else if(lr==="%AsyncGenerator%"){var jr=ui("%AsyncGeneratorFunction%");jr&&(ar=jr.prototype)}else if(lr==="%AsyncIteratorPrototype%"){var ci=ui("%AsyncGenerator%");ci&&ve&&(ar=ve(ci.prototype))}return se[lr]=ar,ar},ue={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bt=requireFunctionBind(),L=requireHasown(),_=bt.call(sr,Array.prototype.concat),F=bt.call(nr,Array.prototype.splice),k=bt.call(sr,String.prototype.replace),Ye=bt.call(sr,String.prototype.slice),rn=bt.call(sr,RegExp.prototype.exec),ii=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ai=/\\(\\)?/g,ni=function(lr){var ar=Ye(lr,0,1),jr=Ye(lr,-1);if(ar==="%"&&jr!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(jr==="%"&&ar!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var ci=[];return k(lr,ii,function(mi,pi,ei,Gr){ci[ci.length]=ei?k(Gr,ai,"$1"):pi||mi}),ci},ri=function(lr,ar){var jr=lr,ci;if(L(ue,jr)&&(ci=ue[jr],jr="%"+ci[0]+"%"),L(se,jr)){var mi=se[jr];if(mi===ce&&(mi=ur(jr)),typeof mi>"u"&&!ar)throw new a("intrinsic "+lr+" exists, but is not available. Please file an issue!");return{alias:ci,name:jr,value:mi}}throw new u("intrinsic "+lr+" does not exist!")};return getIntrinsic=function(lr,ar){if(typeof lr!="string"||lr.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ar!="boolean")throw new a('"allowMissing" argument must be a boolean');if(rn(/^%?[^%]*%?$/,lr)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var jr=ni(lr),ci=jr.length>0?jr[0]:"",mi=ri("%"+ci+"%",ar),pi=mi.name,ei=mi.value,Gr=!1,ti=mi.alias;ti&&(ci=ti[0],F(jr,_([0,1],ti)));for(var fi=1,bi=!0;fi<jr.length;fi+=1){var Ai=jr[fi],Bi=Ye(Ai,0,1),qi=Ye(Ai,-1);if((Bi==='"'||Bi==="'"||Bi==="`"||qi==='"'||qi==="'"||qi==="`")&&Bi!==qi)throw new u("property names with quotes must have matching quotes");if((Ai==="constructor"||!bi)&&(Gr=!0),ci+="."+Ai,pi="%"+ci+"%",L(se,pi))ei=se[pi];else if(ei!=null){if(!(Ai in ei)){if(!ar)throw new a("base intrinsic for "+lr+" exists, but the property is not available.");return}if(E&&fi+1>=jr.length){var vn=E(ei,Ai);bi=!!vn,bi&&"get"in vn&&!("originalValue"in vn.get)?ei=vn.get:ei=ei[Ai]}else bi=L(ei,Ai),ei=ei[Ai];bi&&!Gr&&(se[pi]=ei)}}return ei},getIntrinsic}var callBound$1,hasRequiredCallBound$1;function requireCallBound$1(){if(hasRequiredCallBound$1)return callBound$1;hasRequiredCallBound$1=1;var e=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),r=t([e("%String.prototype.indexOf%")]);return callBound$1=function(o,i){var u=e(o,!!i);return typeof u=="function"&&r(o,".prototype.")>-1?t([u]):u},callBound$1}var isArguments$1,hasRequiredIsArguments$1;function requireIsArguments$1(){if(hasRequiredIsArguments$1)return isArguments$1;hasRequiredIsArguments$1=1;var e=requireShams()(),t=requireCallBound$1(),r=t("Object.prototype.toString"),n=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:r(a)==="[object Arguments]"},o=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&r(a)!=="[object Array]"&&"callee"in a&&r(a.callee)==="[object Function]"},i=(function(){return n(arguments)})();return n.isLegacyArguments=o,isArguments$1=i?n:o,isArguments$1}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var e=requireCallBound$1(),t=requireShams()(),r=requireHasown(),n=requireGopd(),o;if(t){var i=e("RegExp.prototype.exec"),u={},a=function(){throw u},s={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(s[Symbol.toPrimitive]=a),o=function(p){if(!p||typeof p!="object")return!1;var h=n(p,"lastIndex"),y=h&&r(h,"value");if(!y)return!1;try{i(p,s)}catch(b){return b===u}}}else{var f=e("Object.prototype.toString"),c="[object RegExp]";o=function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:f(p)===c}}return isRegex=o,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound$1(),t=requireIsRegex(),r=e("RegExp.prototype.exec"),n=requireType();return safeRegexTest=function(i){if(!t(i))throw new n("`regex` must be a RegExp");return function(a){return r(i,a)!==null}},safeRegexTest}var generatorFunction,hasRequiredGeneratorFunction;function requireGeneratorFunction(){if(hasRequiredGeneratorFunction)return generatorFunction;hasRequiredGeneratorFunction=1;const e=(function*(){}).constructor;return generatorFunction=()=>e,generatorFunction}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var e=requireCallBound$1(),t=requireSafeRegexTest(),r=t(/^\s*(?:function)?\*/),n=requireShams()(),o=requireGetProto(),i=e("Object.prototype.toString"),u=e("Function.prototype.toString"),a=requireGeneratorFunction();return isGeneratorFunction=function(f){if(typeof f!="function")return!1;if(r(u(f)))return!0;if(!n){var c=i(f);return c==="[object GeneratorFunction]"}if(!o)return!1;var d=a();return d&&o(f)===d.prototype},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(E){E!==n&&(t=null)}else t=null;var o=/^\s*class\b/,i=function(B){try{var ae=e.call(B);return o.test(ae)}catch{return!1}},u=function(B){try{return i(B)?!1:(e.call(B),!0)}catch{return!1}},a=Object.prototype.toString,s="[object Object]",f="[object Function]",c="[object GeneratorFunction]",d="[object HTMLAllCollection]",p="[object HTML document.all class]",h="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,b=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var S=document.all;a.call(S)===a.call(document.all)&&(w=function(B){if((b||!B)&&(typeof B>"u"||typeof B=="object"))try{var ae=a.call(B);return(ae===d||ae===p||ae===h||ae===s)&&B("")==null}catch{}return!1})}return isCallable=t?function(B){if(w(B))return!0;if(!B||typeof B!="function"&&typeof B!="object")return!1;try{t(B,null,r)}catch(ae){if(ae!==n)return!1}return!i(B)&&u(B)}:function(B){if(w(B))return!0;if(!B||typeof B!="function"&&typeof B!="object")return!1;if(y)return u(B);if(i(B))return!1;var ae=a.call(B);return ae!==f&&ae!==c&&!/^\[object HTML/.test(ae)?!1:u(B)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var e=requireIsCallable(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(s,f,c){for(var d=0,p=s.length;d<p;d++)r.call(s,d)&&(c==null?f(s[d],d,s):f.call(c,s[d],d,s))},o=function(s,f,c){for(var d=0,p=s.length;d<p;d++)c==null?f(s.charAt(d),d,s):f.call(c,s.charAt(d),d,s)},i=function(s,f,c){for(var d in s)r.call(s,d)&&(c==null?f(s[d],d,s):f.call(c,s[d],d,s))};function u(a){return t.call(a)==="[object Array]"}return forEach=function(s,f,c){if(!e(f))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=c),u(s)?n(s,f,d):typeof s=="string"?o(s,f,d):i(s,f,d)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var e=requirePossibleTypedArrayNames(),t=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var n=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(n[n.length]=e[o]);return n},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var e=requireEsDefineProperty(),t=requireSyntax(),r=requireType(),n=requireGopd();return defineDataProperty=function(i,u,a){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,p=!!n&&n(i,u);if(e)e(i,u,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:a,writable:f===null&&p?p.writable:!f});else if(d||!s&&!f&&!c)i[u]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),r=requireHasPropertyDescriptors()(),n=requireGopd(),o=requireType(),i=e("%Math.floor%");return setFunctionLength=function(a,s){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||i(s)!==s)throw new o("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],c=!0,d=!0;if("length"in a&&n){var p=n(a,"length");p&&!p.configurable&&(c=!1),p&&!p.writable&&(d=!1)}return(c||d||!f)&&(r?t(a,"length",s,!0,!0):t(a,"length",s)),a},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(e){var t=requireSetFunctionLength(),r=requireEsDefineProperty(),n=requireCallBindApplyHelpers(),o=requireApplyBind();e.exports=function(u){var a=n(arguments),s=u.length-(arguments.length-1);return t(a,1+(s>0?s:0),!0)},r?r(e.exports,"apply",{value:o}):e.exports.apply=o})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var e=requireForEach(),t=requireAvailableTypedArrays(),r=requireCallBind(),n=requireCallBound$1(),o=requireGopd(),i=requireGetProto(),u=n("Object.prototype.toString"),a=requireShams()(),s=typeof globalThis>"u"?commonjsGlobal:globalThis,f=t(),c=n("String.prototype.slice"),d=n("Array.prototype.indexOf",!0)||function(w,S){for(var E=0;E<w.length;E+=1)if(w[E]===S)return E;return-1},p={__proto__:null};a&&o&&i?e(f,function(b){var w=new s[b];if(Symbol.toStringTag in w&&i){var S=i(w),E=o(S,Symbol.toStringTag);if(!E&&S){var B=i(S);E=o(B,Symbol.toStringTag)}if(E&&E.get){var ae=r(E.get);p["$"+b]=ae}}}):e(f,function(b){var w=new s[b],S=w.slice||w.set;if(S){var E=r(S);p["$"+b]=E}});var h=function(w){var S=!1;return e(p,function(E,B){if(!S)try{"$"+E(w)===B&&(S=c(B,1))}catch{}}),S},y=function(w){var S=!1;return e(p,function(E,B){if(!S)try{E(w),S=c(B,1)}catch{}}),S};return whichTypedArray=function(w){if(!w||typeof w!="object")return!1;if(!a){var S=c(u(w),8,-1);return d(f,S)>-1?S:S!=="Object"?!1:y(w)}return o?h(w):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var e=requireWhichTypedArray();return isTypedArray=function(r){return!!e(r)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,(function(e){var t=requireIsArguments$1(),r=requireIsGeneratorFunction(),n=requireWhichTypedArray(),o=requireIsTypedArray();function i(fi){return fi.call.bind(fi)}var u=typeof BigInt<"u",a=typeof Symbol<"u",s=i(Object.prototype.toString),f=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),d=i(Boolean.prototype.valueOf);if(u)var p=i(BigInt.prototype.valueOf);if(a)var h=i(Symbol.prototype.valueOf);function y(fi,bi){if(typeof fi!="object")return!1;try{return bi(fi),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function b(fi){return typeof Promise<"u"&&fi instanceof Promise||fi!==null&&typeof fi=="object"&&typeof fi.then=="function"&&typeof fi.catch=="function"}e.isPromise=b;function w(fi){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(fi):o(fi)||Ye(fi)}e.isArrayBufferView=w;function S(fi){return n(fi)==="Uint8Array"}e.isUint8Array=S;function E(fi){return n(fi)==="Uint8ClampedArray"}e.isUint8ClampedArray=E;function B(fi){return n(fi)==="Uint16Array"}e.isUint16Array=B;function ae(fi){return n(fi)==="Uint32Array"}e.isUint32Array=ae;function W(fi){return n(fi)==="Int8Array"}e.isInt8Array=W;function J(fi){return n(fi)==="Int16Array"}e.isInt16Array=J;function ve(fi){return n(fi)==="Int32Array"}e.isInt32Array=ve;function Qe(fi){return n(fi)==="Float32Array"}e.isFloat32Array=Qe;function kt(fi){return n(fi)==="Float64Array"}e.isFloat64Array=kt;function nr(fi){return n(fi)==="BigInt64Array"}e.isBigInt64Array=nr;function sr(fi){return n(fi)==="BigUint64Array"}e.isBigUint64Array=sr;function ce(fi){return s(fi)==="[object Map]"}ce.working=typeof Map<"u"&&ce(new Map);function Ze(fi){return typeof Map>"u"?!1:ce.working?ce(fi):fi instanceof Map}e.isMap=Ze;function se(fi){return s(fi)==="[object Set]"}se.working=typeof Set<"u"&&se(new Set);function vt(fi){return typeof Set>"u"?!1:se.working?se(fi):fi instanceof Set}e.isSet=vt;function ur(fi){return s(fi)==="[object WeakMap]"}ur.working=typeof WeakMap<"u"&&ur(new WeakMap);function ue(fi){return typeof WeakMap>"u"?!1:ur.working?ur(fi):fi instanceof WeakMap}e.isWeakMap=ue;function bt(fi){return s(fi)==="[object WeakSet]"}bt.working=typeof WeakSet<"u"&&bt(new WeakSet);function L(fi){return bt(fi)}e.isWeakSet=L;function _(fi){return s(fi)==="[object ArrayBuffer]"}_.working=typeof ArrayBuffer<"u"&&_(new ArrayBuffer);function F(fi){return typeof ArrayBuffer>"u"?!1:_.working?_(fi):fi instanceof ArrayBuffer}e.isArrayBuffer=F;function k(fi){return s(fi)==="[object DataView]"}k.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&k(new DataView(new ArrayBuffer(1),0,1));function Ye(fi){return typeof DataView>"u"?!1:k.working?k(fi):fi instanceof DataView}e.isDataView=Ye;var rn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ii(fi){return s(fi)==="[object SharedArrayBuffer]"}function ai(fi){return typeof rn>"u"?!1:(typeof ii.working>"u"&&(ii.working=ii(new rn)),ii.working?ii(fi):fi instanceof rn)}e.isSharedArrayBuffer=ai;function ni(fi){return s(fi)==="[object AsyncFunction]"}e.isAsyncFunction=ni;function ri(fi){return s(fi)==="[object Map Iterator]"}e.isMapIterator=ri;function ui(fi){return s(fi)==="[object Set Iterator]"}e.isSetIterator=ui;function lr(fi){return s(fi)==="[object Generator]"}e.isGeneratorObject=lr;function ar(fi){return s(fi)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=ar;function jr(fi){return y(fi,f)}e.isNumberObject=jr;function ci(fi){return y(fi,c)}e.isStringObject=ci;function mi(fi){return y(fi,d)}e.isBooleanObject=mi;function pi(fi){return u&&y(fi,p)}e.isBigIntObject=pi;function ei(fi){return a&&y(fi,h)}e.isSymbolObject=ei;function Gr(fi){return jr(fi)||ci(fi)||mi(fi)||pi(fi)||ei(fi)}e.isBoxedPrimitive=Gr;function ti(fi){return typeof Uint8Array<"u"&&(F(fi)||ai(fi))}e.isAnyArrayBuffer=ti,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(fi){Object.defineProperty(e,fi,{enumerable:!1,value:function(){throw new Error(fi+" is not supported in userland")}})})})(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),isBufferBrowser}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}),inherits_browser.exports}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(e){var t={},r=Object.getOwnPropertyDescriptors||function(rn){for(var ii=Object.keys(rn),ai={},ni=0;ni<ii.length;ni++)ai[ii[ni]]=Object.getOwnPropertyDescriptor(rn,ii[ni]);return ai},n=/%[sdj%]/g;e.format=function(Ye){if(!J(Ye)){for(var rn=[],ii=0;ii<arguments.length;ii++)rn.push(a(arguments[ii]));return rn.join(" ")}for(var ii=1,ai=arguments,ni=ai.length,ri=String(Ye).replace(n,function(lr){if(lr==="%%")return"%";if(ii>=ni)return lr;switch(lr){case"%s":return String(ai[ii++]);case"%d":return Number(ai[ii++]);case"%j":try{return JSON.stringify(ai[ii++])}catch{return"[Circular]"}default:return lr}}),ui=ai[ii];ii<ni;ui=ai[++ii])B(ui)||!nr(ui)?ri+=" "+ui:ri+=" "+a(ui);return ri},e.deprecate=function(Ye,rn){if(typeof process<"u"&&process.noDeprecation===!0)return Ye;if(typeof process>"u")return function(){return e.deprecate(Ye,rn).apply(this,arguments)};var ii=!1;function ai(){if(!ii){if(process.throwDeprecation)throw new Error(rn);process.traceDeprecation?console.trace(rn):console.error(rn),ii=!0}return Ye.apply(this,arguments)}return ai};var o={},i=/^$/;if(t.NODE_DEBUG){var u=t.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+u+"$","i")}e.debuglog=function(Ye){if(Ye=Ye.toUpperCase(),!o[Ye])if(i.test(Ye)){var rn=process.pid;o[Ye]=function(){var ii=e.format.apply(e,arguments);console.error("%s %d: %s",Ye,rn,ii)}}else o[Ye]=function(){};return o[Ye]};function a(Ye,rn){var ii={seen:[],stylize:f};return arguments.length>=3&&(ii.depth=arguments[2]),arguments.length>=4&&(ii.colors=arguments[3]),E(rn)?ii.showHidden=rn:rn&&e._extend(ii,rn),Qe(ii.showHidden)&&(ii.showHidden=!1),Qe(ii.depth)&&(ii.depth=2),Qe(ii.colors)&&(ii.colors=!1),Qe(ii.customInspect)&&(ii.customInspect=!0),ii.colors&&(ii.stylize=s),d(ii,Ye,ii.depth)}e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(Ye,rn){var ii=a.styles[rn];return ii?"\x1B["+a.colors[ii][0]+"m"+Ye+"\x1B["+a.colors[ii][1]+"m":Ye}function f(Ye,rn){return Ye}function c(Ye){var rn={};return Ye.forEach(function(ii,ai){rn[ii]=!0}),rn}function d(Ye,rn,ii){if(Ye.customInspect&&rn&&Ze(rn.inspect)&&rn.inspect!==e.inspect&&!(rn.constructor&&rn.constructor.prototype===rn)){var ai=rn.inspect(ii,Ye);return J(ai)||(ai=d(Ye,ai,ii)),ai}var ni=p(Ye,rn);if(ni)return ni;var ri=Object.keys(rn),ui=c(ri);if(Ye.showHidden&&(ri=Object.getOwnPropertyNames(rn)),ce(rn)&&(ri.indexOf("message")>=0||ri.indexOf("description")>=0))return h(rn);if(ri.length===0){if(Ze(rn)){var lr=rn.name?": "+rn.name:"";return Ye.stylize("[Function"+lr+"]","special")}if(kt(rn))return Ye.stylize(RegExp.prototype.toString.call(rn),"regexp");if(sr(rn))return Ye.stylize(Date.prototype.toString.call(rn),"date");if(ce(rn))return h(rn)}var ar="",jr=!1,ci=["{","}"];if(S(rn)&&(jr=!0,ci=["[","]"]),Ze(rn)){var mi=rn.name?": "+rn.name:"";ar=" [Function"+mi+"]"}if(kt(rn)&&(ar=" "+RegExp.prototype.toString.call(rn)),sr(rn)&&(ar=" "+Date.prototype.toUTCString.call(rn)),ce(rn)&&(ar=" "+h(rn)),ri.length===0&&(!jr||rn.length==0))return ci[0]+ar+ci[1];if(ii<0)return kt(rn)?Ye.stylize(RegExp.prototype.toString.call(rn),"regexp"):Ye.stylize("[Object]","special");Ye.seen.push(rn);var pi;return jr?pi=y(Ye,rn,ii,ui,ri):pi=ri.map(function(ei){return b(Ye,rn,ii,ui,ei,jr)}),Ye.seen.pop(),w(pi,ar,ci)}function p(Ye,rn){if(Qe(rn))return Ye.stylize("undefined","undefined");if(J(rn)){var ii="'"+JSON.stringify(rn).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Ye.stylize(ii,"string")}if(W(rn))return Ye.stylize(""+rn,"number");if(E(rn))return Ye.stylize(""+rn,"boolean");if(B(rn))return Ye.stylize("null","null")}function h(Ye){return"["+Error.prototype.toString.call(Ye)+"]"}function y(Ye,rn,ii,ai,ni){for(var ri=[],ui=0,lr=rn.length;ui<lr;++ui)L(rn,String(ui))?ri.push(b(Ye,rn,ii,ai,String(ui),!0)):ri.push("");return ni.forEach(function(ar){ar.match(/^\d+$/)||ri.push(b(Ye,rn,ii,ai,ar,!0))}),ri}function b(Ye,rn,ii,ai,ni,ri){var ui,lr,ar;if(ar=Object.getOwnPropertyDescriptor(rn,ni)||{value:rn[ni]},ar.get?ar.set?lr=Ye.stylize("[Getter/Setter]","special"):lr=Ye.stylize("[Getter]","special"):ar.set&&(lr=Ye.stylize("[Setter]","special")),L(ai,ni)||(ui="["+ni+"]"),lr||(Ye.seen.indexOf(ar.value)<0?(B(ii)?lr=d(Ye,ar.value,null):lr=d(Ye,ar.value,ii-1),lr.indexOf(`
60
+ `)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError$1{constructor(t){super(t,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError$1{constructor(t){super(t,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError$1{constructor(t){super(t,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError$1{constructor(t,{method:r}={}){super(t,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError$1{constructor(t){super(t,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError$1{constructor(t){super(t,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(t){super(t,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(t){super(t,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(t,{method:r}={}){super(t,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(t){super(t,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(t){super(t,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(t){super(t,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnsupportedNonOptionalCapabilityError extends ProviderRpcError{constructor(t){super(t,{code:UnsupportedNonOptionalCapabilityError.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(UnsupportedNonOptionalCapabilityError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class UnsupportedChainIdError extends ProviderRpcError{constructor(t){super(t,{code:UnsupportedChainIdError.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(UnsupportedChainIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class DuplicateIdError extends ProviderRpcError{constructor(t){super(t,{code:DuplicateIdError.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(DuplicateIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class UnknownBundleIdError extends ProviderRpcError{constructor(t){super(t,{code:UnknownBundleIdError.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(UnknownBundleIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class BundleTooLargeError extends ProviderRpcError{constructor(t){super(t,{code:BundleTooLargeError.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(BundleTooLargeError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError{constructor(t){super(t,{code:AtomicReadyWalletRejectedUpgradeError.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(AtomicReadyWalletRejectedUpgradeError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class AtomicityNotSupportedError extends ProviderRpcError{constructor(t){super(t,{code:AtomicityNotSupportedError.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(AtomicityNotSupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class UnknownRpcError extends RpcError$1{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(e,{abi:t,address:r,args:n,docsPath:o,functionName:i,sender:u}){const a=e instanceof RawContractError?e:e instanceof BaseError?e.walk(y=>"data"in y)||e.walk():{},{code:s,data:f,details:c,message:d,shortMessage:p}=a,h=e instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:i}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(s)&&(f||c||d||p)?new ContractFunctionRevertedError({abi:t,data:typeof f=="object"?f.data:f,functionName:i,message:a instanceof RpcRequestError?c:p??d}):e;return new ContractFunctionExecutionError(h,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:i,sender:u})}const scriptRel="modulepreload",assetsURL=function(e){return"/"+e},seen={},__vitePreload=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){let f=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};var u=f;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");o=f(r.map(c=>{if(c=assetsURL(c),c in seen)return;seen[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":scriptRel,d||(h.as="script"),h.crossOrigin="",h.href=c,s&&h.setAttribute("nonce",s),document.head.appendChild(h),d)return new Promise((y,b)=>{h.addEventListener("load",y),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return o.then(a=>{for(const s of a||[])s.status==="rejected"&&i(s.reason);return t().catch(i)})};async function recoverPublicKey({hash:e,signature:t}){const r=isHex$1(e)?e:toHex(e),{secp256k1:n}=await __vitePreload(async()=>{const{secp256k1:u}=await Promise.resolve().then(()=>secp256k1$2);return{secp256k1:u}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:f,s:c,v:d,yParity:p}=t,h=Number(p??d),y=toRecoveryBit(h);return new n.Signature(hexToBigInt(f),hexToBigInt(c)).addRecoveryBit(y)}const u=isHex$1(t)?t:toHex(t);if(size$1(u)!==65)throw new Error("invalid signature length");const a=hexToNumber$2(`0x${u.slice(130)}`),s=toRecoveryBit(a);return n.Signature.fromCompact(u.substring(2,130)).addRecoveryBit(s)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function toRecoveryBit(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function recoverAddress({hash:e,signature:t}){return publicKeyToAddress(await recoverPublicKey({hash:e,signature:t}))}async function recoverAuthorizationAddress(e){const{authorization:t,signature:r}=e;return recoverAddress({hash:hashAuthorization(t),signature:r??t})}class EstimateGasExecutionError extends BaseError{constructor(t,{account:r,docsPath:n,chain:o,data:i,gas:u,gasPrice:a,maxFeePerGas:s,maxPriorityFeePerGas:f,nonce:c,to:d,value:p}){const h=prettyPrint({from:r?.address,to:d,value:typeof p<"u"&&`${formatEther(p)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:u,gasPrice:typeof a<"u"&&`${formatGwei(a)} gwei`,maxFeePerGas:typeof s<"u"&&`${formatGwei(s)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${formatGwei(f)} gwei`,nonce:c});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function getNodeError(e,t){const r=(e.details||"").toLowerCase(),n=e instanceof BaseError?e.walk(o=>o?.code===ExecutionRevertedError.code):e;return n instanceof BaseError?new ExecutionRevertedError({cause:e,message:n.details}):ExecutionRevertedError.nodeMessage.test(r)?new ExecutionRevertedError({cause:e,message:e.details}):FeeCapTooHighError.nodeMessage.test(r)?new FeeCapTooHighError({cause:e,maxFeePerGas:t?.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(r)?new FeeCapTooLowError({cause:e,maxFeePerGas:t?.maxFeePerGas}):NonceTooHighError.nodeMessage.test(r)?new NonceTooHighError({cause:e,nonce:t?.nonce}):NonceTooLowError.nodeMessage.test(r)?new NonceTooLowError({cause:e,nonce:t?.nonce}):NonceMaxValueError.nodeMessage.test(r)?new NonceMaxValueError({cause:e,nonce:t?.nonce}):InsufficientFundsError.nodeMessage.test(r)?new InsufficientFundsError({cause:e}):IntrinsicGasTooHighError.nodeMessage.test(r)?new IntrinsicGasTooHighError({cause:e,gas:t?.gas}):IntrinsicGasTooLowError.nodeMessage.test(r)?new IntrinsicGasTooLowError({cause:e,gas:t?.gas}):TransactionTypeNotSupportedError.nodeMessage.test(r)?new TransactionTypeNotSupportedError({cause:e}):TipAboveFeeCapError.nodeMessage.test(r)?new TipAboveFeeCapError({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new UnknownNodeError({cause:e})}function getEstimateGasError(e,{docsPath:t,...r}){const n=(()=>{const o=getNodeError(e,r);return o instanceof UnknownNodeError?e:o})();return new EstimateGasExecutionError(n,{docsPath:t,...r})}function extract(e,{format:t}){if(!t)return{};const r={};function n(i){const u=Object.keys(i);for(const a of u)a in e&&(r[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&n(i[a])}const o=t(e||{});return n(o),r}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=formatAuthorizationList$1(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(r=>bytesToHex$3(r)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=numberToHex(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=numberToHex(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=rpcTransactionType[e.type]),typeof e.value<"u"&&(t.value=numberToHex(e.value)),t}function formatAuthorizationList$1(e){return e.map(t=>({address:t.address,r:t.r?numberToHex(BigInt(t.r)):t.r,s:t.s?numberToHex(BigInt(t.s)):t.s,chainId:numberToHex(t.chainId),nonce:numberToHex(t.nonce),...typeof t.yParity<"u"?{yParity:numberToHex(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:numberToHex(t.v)}:{}}))}function serializeStateMapping(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new InvalidBytesLengthError({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function serializeAccountStateOverride(e){const{balance:t,nonce:r,state:n,stateDiff:o,code:i}=e,u={};if(i!==void 0&&(u.code=i),t!==void 0&&(u.balance=numberToHex(t)),r!==void 0&&(u.nonce=numberToHex(r)),n!==void 0&&(u.state=serializeStateMapping(n)),o!==void 0){if(u.state)throw new StateAssignmentConflictError;u.stateDiff=serializeStateMapping(o)}return u}function serializeStateOverride(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!isAddress$1(r,{strict:!1}))throw new InvalidAddressError({address:r});if(t[r])throw new AccountStateConflictError({address:r});t[r]=serializeAccountStateOverride(n)}return t}function assertRequest(e){const{account:t,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:o,to:i}=e,u=t?parseAccount(t):void 0;if(u&&!isAddress$1(u.address))throw new InvalidAddressError({address:u.address});if(i&&!isAddress$1(i))throw new InvalidAddressError({address:i});if(typeof r<"u"&&(typeof n<"u"||typeof o<"u"))throw new FeeConflictError;if(n&&n>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:n});if(o&&n&&o>n)throw new TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:o})}class BaseFeeScalarError extends BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Eip1559FeesNotSupportedError extends BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class MaxFeePerGasTooLowError extends BaseError{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class BlockNotFoundError extends BaseError{constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?hexToNumber$2(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?hexToNumber$2(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?transactionType[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=formatAuthorizationList(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}function formatAuthorizationList(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function formatBlock(e){const t=(e.transactions??[]).map(r=>typeof r=="string"?r:formatTransaction(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function getBlock(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:o}={}){const i=o??!1,u=r!==void 0?numberToHex(r):void 0;let a=null;if(t?a=await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):a=await e.request({method:"eth_getBlockByNumber",params:[u||n,i]},{dedupe:!!u}),!a)throw new BlockNotFoundError({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||formatBlock)(a)}async function getGasPrice(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function internal_estimateMaxPriorityFeePerGas(e,t){const{block:r,chain:n=e.chain,request:o}=t||{};try{const i=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof i=="function"){const a=r||await getAction(e,getBlock,"getBlock")({}),s=await i({block:a,client:e,request:o});if(s===null)throw new Error;return s}if(typeof i<"u")return i;const u=await e.request({method:"eth_maxPriorityFeePerGas"});return hexToBigInt(u)}catch{const[i,u]=await Promise.all([r?Promise.resolve(r):getAction(e,getBlock,"getBlock")({}),getAction(e,getGasPrice,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const a=u-i.baseFeePerGas;return a<0n?0n:a}}async function internal_estimateFeesPerGas(e,t){const{block:r,chain:n=e.chain,request:o,type:i="eip1559"}=t||{},u=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:o}):n?.fees?.baseFeeMultiplier??1.2)();if(u<1)throw new BaseFeeScalarError;const s=10**(u.toString().split(".")[1]?.length??0),f=p=>p*BigInt(Math.ceil(u*s))/BigInt(s),c=r||await getAction(e,getBlock,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){const p=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:f,request:o,type:i});if(p!==null)return p}if(i==="eip1559"){if(typeof c.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const p=typeof o?.maxPriorityFeePerGas=="bigint"?o.maxPriorityFeePerGas:await internal_estimateMaxPriorityFeePerGas(e,{block:c,chain:n,request:o}),h=f(c.baseFeePerGas);return{maxFeePerGas:o?.maxFeePerGas??h+p,maxPriorityFeePerGas:p}}return{gasPrice:o?.gasPrice??f(await getAction(e,getGasPrice,"getGasPrice")({}))}}async function getChainId(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return hexToNumber$2(t)}const defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],eip1559NetworkCache=new Map;async function prepareTransactionRequest(e,t){const{account:r=e.account,blobs:n,chain:o,gas:i,kzg:u,nonce:a,nonceManager:s,parameters:f=defaultParameters,type:c}=t,d=r&&parseAccount(r),p={...t,...d?{from:d?.address}:{}};let h;async function y(){return h||(h=await getAction(e,getBlock,"getBlock")({blockTag:"latest"}),h)}let b;async function w(){return b||(o?o.id:typeof t.chainId<"u"?t.chainId:(b=await getAction(e,getChainId,"getChainId")({}),b))}if(f.includes("nonce")&&typeof a>"u"&&d)if(s){const S=await w();p.nonce=await s.consume({address:d.address,chainId:S,client:e})}else p.nonce=await getAction(e,getTransactionCount,"getTransactionCount")({address:d.address,blockTag:"pending"});if((f.includes("blobVersionedHashes")||f.includes("sidecars"))&&n&&u){const S=blobsToCommitments({blobs:n,kzg:u});if(f.includes("blobVersionedHashes")){const E=commitmentsToVersionedHashes({commitments:S,to:"hex"});p.blobVersionedHashes=E}if(f.includes("sidecars")){const E=blobsToProofs({blobs:n,commitments:S,kzg:u}),B=toBlobSidecars({blobs:n,commitments:S,proofs:E,to:"hex"});p.sidecars=B}}if(f.includes("chainId")&&(p.chainId=await w()),(f.includes("fees")||f.includes("type"))&&typeof c>"u")try{p.type=getTransactionType(p)}catch{let S=eip1559NetworkCache.get(e.uid);typeof S>"u"&&(S=typeof(await y())?.baseFeePerGas=="bigint",eip1559NetworkCache.set(e.uid,S)),p.type=S?"eip1559":"legacy"}if(f.includes("fees"))if(p.type!=="legacy"&&p.type!=="eip2930"){if(typeof p.maxFeePerGas>"u"||typeof p.maxPriorityFeePerGas>"u"){const S=await y(),{maxFeePerGas:E,maxPriorityFeePerGas:B}=await internal_estimateFeesPerGas(e,{block:S,chain:o,request:p});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<B)throw new MaxFeePerGasTooLowError({maxPriorityFeePerGas:B});p.maxPriorityFeePerGas=B,p.maxFeePerGas=E}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new Eip1559FeesNotSupportedError;if(typeof t.gasPrice>"u"){const S=await y(),{gasPrice:E}=await internal_estimateFeesPerGas(e,{block:S,chain:o,request:p,type:"legacy"});p.gasPrice=E}}return f.includes("gas")&&typeof i>"u"&&(p.gas=await getAction(e,estimateGas,"estimateGas")({...p,account:d&&{address:d.address,type:"json-rpc"}})),assertRequest(p),delete p.parameters,p}async function getBalance(e,{address:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}){const o=typeof r=="bigint"?numberToHex(r):void 0,i=await e.request({method:"eth_getBalance",params:[t,o||n]});return BigInt(i)}async function estimateGas(e,t){const{account:r=e.account}=t,n=r?parseAccount(r):void 0;try{let ce=function(se){const{block:vt,request:ur,rpcStateOverride:ue}=se;return e.request({method:"eth_estimateGas",params:ue?[ur,vt??e.experimental_blockTag??"latest",ue]:vt?[ur,vt]:[ur]})};var o=ce;const{accessList:i,authorizationList:u,blobs:a,blobVersionedHashes:s,blockNumber:f,blockTag:c,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:S,value:E,stateOverride:B,...ae}=await prepareTransactionRequest(e,{...t,parameters:n?.type==="local"?void 0:["blobVersionedHashes"]}),J=(typeof f=="bigint"?numberToHex(f):void 0)||c,ve=serializeStateOverride(B),Qe=await(async()=>{if(ae.to)return ae.to;if(u&&u.length>0)return await recoverAuthorizationAddress({authorization:u[0]}).catch(()=>{throw new BaseError("`to` is required. Could not infer from `authorizationList`")})})();assertRequest(t);const kt=e.chain?.formatters?.transactionRequest?.format,sr=(kt||formatTransactionRequest)({...extract(ae,{format:kt}),from:n?.address,accessList:i,authorizationList:u,blobs:a,blobVersionedHashes:s,data:d,gas:p,gasPrice:h,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:S,to:Qe,value:E});let Ze=BigInt(await ce({block:J,request:sr,rpcStateOverride:ve}));if(u){const se=await getBalance(e,{address:sr.from}),vt=await Promise.all(u.map(async ur=>{const{address:ue}=ur,bt=await ce({block:J,request:{authorizationList:void 0,data:d,from:n?.address,to:ue,value:numberToHex(se)},rpcStateOverride:ve}).catch(()=>100000n);return 2n*BigInt(bt)}));Ze+=vt.reduce((ur,ue)=>ur+ue,0n)}return Ze}catch(i){throw getEstimateGasError(i,{...t,account:n,chain:e.chain})}}function isAddressEqual(e,t){if(!isAddress$1(e,{strict:!1}))throw new InvalidAddressError({address:e});if(!isAddress$1(t,{strict:!1}))throw new InvalidAddressError({address:t});return e.toLowerCase()===t.toLowerCase()}const docsPath="/docs/contract/encodeDeployData";function encodeDeployData(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const o=t.find(u=>"type"in u&&u.type==="constructor");if(!o)throw new AbiConstructorNotFoundError({docsPath});if(!("inputs"in o))throw new AbiConstructorParamsNotFoundError({docsPath});if(!o.inputs||o.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath});const i=encodeAbiParameters(o.inputs,r);return concatHex([n,i])}function withResolvers(){let e=()=>{},t=()=>{};return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}const schedulerCache=new Map;function createBatchScheduler({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:o}){const i=async()=>{const c=s();u();const d=c.map(({args:p})=>p);d.length!==0&&e(d).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let h=0;h<c.length;h++){const{resolve:y}=c[h];y?.([p[h],p])}}).catch(p=>{for(let h=0;h<c.length;h++){const{reject:y}=c[h];y?.(p)}})},u=()=>schedulerCache.delete(t),a=()=>s().map(({args:c})=>c),s=()=>schedulerCache.get(t)||[],f=c=>schedulerCache.set(t,[...s(),c]);return{flush:u,async schedule(c){const{promise:d,resolve:p,reject:h}=withResolvers();return r?.([...a(),c])&&i(),s().length>0?(f({args:c,resolve:p,reject:h}),d):(f({args:c,resolve:p,reject:h}),setTimeout(i,n),d)}}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(e,t,r){const n=++callbackCount,o=()=>listenersCache.get(e)||[],i=()=>{const c=o();listenersCache.set(e,c.filter(d=>d.id!==n))},u=()=>{const c=o();if(!c.some(p=>p.id===n))return;const d=cleanupCache.get(e);if(c.length===1&&d){const p=d();p instanceof Promise&&p.catch(()=>{})}i()},a=o();if(listenersCache.set(e,[...a,{id:n,fns:t}]),a&&a.length>0)return u;const s={};for(const c in t)s[c]=((...d)=>{const p=o();if(p.length!==0)for(const h of p)h.fns[c]?.(...d)});const f=r(s);return typeof f=="function"&&cleanupCache.set(e,f),u}async function wait(e){return new Promise(t=>setTimeout(t,e))}function poll(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let o=!0;const i=()=>o=!1;return(async()=>{let a;a=await e({unpoll:i});const s=await r?.(a)??n;await wait(s);const f=async()=>{o&&(await e({unpoll:i}),await wait(n),f())};f()})(),i}class AccountNotFoundError extends BaseError{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
61
+ `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class AccountTypeNotSupportedError extends BaseError{constructor({docsPath:t,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:t,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function assertCurrentChain({chain:e,currentChainId:t}){if(!e)throw new ChainNotFoundError;if(t!==e.id)throw new ChainMismatchError({chain:e,currentChainId:t})}function getTransactionError(e,{docsPath:t,...r}){const n=(()=>{const o=getNodeError(e,r);return o instanceof UnknownNodeError?e:o})();return new TransactionExecutionError(n,{docsPath:t,...r})}async function sendRawTransaction(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const supportsWalletNamespace=new LruMap(128);async function sendTransaction(e,t){const{account:r=e.account,chain:n=e.chain,accessList:o,authorizationList:i,blobs:u,data:a,gas:s,gasPrice:f,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,type:y,value:b,...w}=t;if(typeof r>"u")throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const S=r?parseAccount(r):null;try{assertRequest(t);const E=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await recoverAuthorizationAddress({authorization:i[0]}).catch(()=>{throw new BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(S?.type==="json-rpc"||S===null){let B;n!==null&&(B=await getAction(e,getChainId,"getChainId")({}),assertCurrentChain({currentChainId:B,chain:n}));const ae=e.chain?.formatters?.transactionRequest?.format,J=(ae||formatTransactionRequest)({...extract(w,{format:ae}),accessList:o,authorizationList:i,blobs:u,chainId:B,data:a,from:S?.address,gas:s,gasPrice:f,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:E,type:y,value:b}),ve=supportsWalletNamespace.get(e.uid),Qe=ve?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:Qe,params:[J]},{retryCount:0})}catch(kt){if(ve===!1)throw kt;const nr=kt;if(nr.name==="InvalidInputRpcError"||nr.name==="InvalidParamsRpcError"||nr.name==="MethodNotFoundRpcError"||nr.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[J]},{retryCount:0}).then(sr=>(supportsWalletNamespace.set(e.uid,!0),sr)).catch(sr=>{const ce=sr;throw ce.name==="MethodNotFoundRpcError"||ce.name==="MethodNotSupportedRpcError"?(supportsWalletNamespace.set(e.uid,!1),nr):ce});throw nr}}if(S?.type==="local"){const B=await getAction(e,prepareTransactionRequest,"prepareTransactionRequest")({account:S,accessList:o,authorizationList:i,blobs:u,chain:n,data:a,gas:s,gasPrice:f,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,nonceManager:S.nonceManager,parameters:[...defaultParameters,"sidecars"],type:y,value:b,...w,to:E}),ae=n?.serializers?.transaction,W=await S.signTransaction(B,{serializer:ae});return await getAction(e,sendRawTransaction,"sendRawTransaction")({serializedTransaction:W})}throw S?.type==="smart"?new AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:S?.type})}catch(E){throw E instanceof AccountTypeNotSupportedError?E:getTransactionError(E,{...t,account:S,chain:t.chain||void 0})}}async function writeContract(e,t){const{abi:r,account:n=e.account,address:o,args:i,dataSuffix:u,functionName:a,...s}=t;if(typeof n>"u")throw new AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const f=n?parseAccount(n):null,c=encodeFunctionData({abi:r,args:i,functionName:a});try{return await getAction(e,sendTransaction,"sendTransaction")({data:`${c}${u?u.replace("0x",""):""}`,to:o,account:f,...s})}catch(d){throw getContractError(d,{abi:r,address:o,args:i,docsPath:"/docs/contract/writeContract",functionName:a,sender:f?.address})}}class BundleFailedError extends BaseError{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}function withRetry(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((o,i)=>{const u=async({count:a=0}={})=>{const s=async({error:f})=>{const c=typeof t=="function"?t({count:a,error:f}):t;c&&await wait(c),u({count:a+1})};try{const f=await e();o(f)}catch(f){if(a<r&&await n({count:a,error:f}))return s({error:f});i(f)}};u()})}const receiptStatuses={"0x0":"reverted","0x1":"success"},fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",fallbackTransactionErrorMagicIdentifier=numberToHex(0,{size:32});async function sendCalls(e,t){const{account:r=e.account,capabilities:n,chain:o=e.chain,experimental_fallback:i,experimental_fallbackDelay:u=32,forceAtomic:a=!1,id:s,version:f="2.0.0"}=t,c=r?parseAccount(r):null,d=t.calls.map(p=>{const h=p,y=h.abi?encodeFunctionData({abi:h.abi,functionName:h.functionName,args:h.args}):h.data;return{data:h.dataSuffix&&y?concat([y,h.dataSuffix]):y,to:h.to,value:h.value?numberToHex(h.value):void 0}});try{const p=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:a,calls:d,capabilities:n,chainId:numberToHex(o.id),from:c?.address,id:s,version:f}]},{retryCount:0});return typeof p=="string"?{id:p}:p}catch(p){const h=p;if(i&&(h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"||h.name==="UnknownRpcError"||h.details.toLowerCase().includes("does not exist / is not available")||h.details.toLowerCase().includes("missing or invalid. request()")||h.details.toLowerCase().includes("did not match any variant of untagged enum")||h.details.toLowerCase().includes("account upgraded to unsupported contract")||h.details.toLowerCase().includes("eip-7702 not supported")||h.details.toLowerCase().includes("unsupported wc_ method")||h.details.toLowerCase().includes("feature toggled misconfigured"))){if(n&&Object.values(n).some(E=>!E.optional)){const E="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new UnsupportedNonOptionalCapabilityError(new BaseError(E,{details:E}))}if(a&&d.length>1){const S="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new AtomicityNotSupportedError(new BaseError(S,{details:S}))}const y=[];for(const S of d){const E=sendTransaction(e,{account:c,chain:o,data:S.data,to:S.to,value:S.value?hexToBigInt(S.value):void 0});y.push(E),u>0&&await new Promise(B=>setTimeout(B,u))}const b=await Promise.allSettled(y);if(b.every(S=>S.status==="rejected"))throw b[0].reason;const w=b.map(S=>S.status==="fulfilled"?S.value:fallbackTransactionErrorMagicIdentifier);return{id:concat([...w,numberToHex(o.id,{size:32}),fallbackMagicIdentifier])}}throw getTransactionError(p,{...t,account:c,chain:t.chain})}}async function getCallsStatus(e,t){async function r(c){if(c.endsWith(fallbackMagicIdentifier.slice(2))){const p=trim(sliceHex(c,-64,-32)),h=sliceHex(c,0,-64).slice(2).match(/.{1,64}/g),y=await Promise.all(h.map(w=>fallbackTransactionErrorMagicIdentifier.slice(2)!==w?e.request({method:"eth_getTransactionReceipt",params:[`0x${w}`]},{dedupe:!0}):void 0)),b=y.some(w=>w===null)?100:y.every(w=>w?.status==="0x1")?200:y.every(w=>w?.status==="0x0")?500:600;return{atomic:!1,chainId:hexToNumber$2(p),receipts:y.filter(Boolean),status:b,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[c]})}const{atomic:n=!1,chainId:o,receipts:i,version:u="2.0.0",...a}=await r(t.id),[s,f]=(()=>{const c=a.status;return c>=100&&c<200?["pending",c]:c>=200&&c<300?["success",c]:c>=300&&c<700?["failure",c]:c==="CONFIRMED"?["success",200]:c==="PENDING"?["pending",100]:[void 0,c]})();return{...a,atomic:n,chainId:o?hexToNumber$2(o):void 0,receipts:i?.map(c=>({...c,blockNumber:hexToBigInt(c.blockNumber),gasUsed:hexToBigInt(c.gasUsed),status:receiptStatuses[c.status]}))??[],statusCode:f,status:s,version:u}}async function waitForCallsStatus(e,t){const{id:r,pollingInterval:n=e.pollingInterval,status:o=({statusCode:b})=>b===200||b>=300,retryCount:i=4,retryDelay:u=({count:b})=>~~(1<<b)*200,timeout:a=6e4,throwOnFailure:s=!1}=t,f=stringify$1(["waitForCallsStatus",e.uid,r]),{promise:c,resolve:d,reject:p}=withResolvers();let h;const y=observe(f,{resolve:d,reject:p},b=>{const w=poll(async()=>{const S=E=>{clearTimeout(h),w(),E(),y()};try{const E=await withRetry(async()=>{const B=await getAction(e,getCallsStatus,"getCallsStatus")({id:r});if(s&&B.status==="failure")throw new BundleFailedError(B);return B},{retryCount:i,delay:u});if(!o(E))return;S(()=>b.resolve(E))}catch(E){S(()=>b.reject(E))}},{interval:n,emitOnBegin:!0});return w});return h=a?setTimeout(()=>{y(),clearTimeout(h),p(new WaitForCallsStatusTimeoutError({id:r}))},a):void 0,await c}class WaitForCallsStatusTimeoutError extends BaseError{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const size=256;let index=size,buffer$1;function uid(e=11){if(!buffer$1||index+e>size*2){buffer$1="",index=0;for(let t=0;t<size;t++)buffer$1+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$1.substring(index,index+++e)}function createClient(e){const{batch:t,chain:r,ccipRead:n,key:o="base",name:i="Base Client",type:u="base"}=e,a=e.experimental_blockTag??(typeof r?.experimental_preconfirmationTime=="number"?"pending":void 0),s=r?.blockTime??12e3,f=Math.min(Math.max(Math.floor(s/2),500),4e3),c=e.pollingInterval??f,d=e.cacheTime??c,p=e.account?parseAccount(e.account):void 0,{config:h,request:y,value:b}=e.transport({chain:r,pollingInterval:c}),w={...h,...b},S={account:p,batch:t,cacheTime:d,ccipRead:n,chain:r,key:o,name:i,pollingInterval:c,request:y,transport:w,type:u,uid:uid(),...a?{experimental_blockTag:a}:{}};function E(B){return ae=>{const W=ae(B);for(const ve in S)delete W[ve];const J={...B,...W};return Object.assign(J,{extend:E(J)})}}return Object.assign(S,{extend:E(S)})}const promiseCache=new LruMap(8192);function withDedupe(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(promiseCache.get(r))return promiseCache.get(r);const n=e().finally(()=>promiseCache.delete(r));return promiseCache.set(r,n),n}function buildRequest(e,t={}){return async(r,n={})=>{const{dedupe:o=!1,methods:i,retryDelay:u=150,retryCount:a=3,uid:s}={...t,...n},{method:f}=r;if(i?.exclude?.includes(f))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:f});if(i?.include&&!i.include.includes(f))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:f});const c=o?stringToHex(`${s}.${stringify$1(r)}`):void 0;return withDedupe(()=>withRetry(async()=>{try{return await e(r)}catch(d){const p=d;switch(p.code){case ParseRpcError.code:throw new ParseRpcError(p);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(p);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(p,{method:r.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(p);case InternalRpcError.code:throw new InternalRpcError(p);case InvalidInputRpcError.code:throw new InvalidInputRpcError(p);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(p);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(p);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(p);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(p,{method:r.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(p);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(p);case UserRejectedRequestError.code:throw new UserRejectedRequestError(p);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(p);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(p);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(p);case ChainDisconnectedError.code:throw new ChainDisconnectedError(p);case SwitchChainError.code:throw new SwitchChainError(p);case UnsupportedNonOptionalCapabilityError.code:throw new UnsupportedNonOptionalCapabilityError(p);case UnsupportedChainIdError.code:throw new UnsupportedChainIdError(p);case DuplicateIdError.code:throw new DuplicateIdError(p);case UnknownBundleIdError.code:throw new UnknownBundleIdError(p);case BundleTooLargeError.code:throw new BundleTooLargeError(p);case AtomicReadyWalletRejectedUpgradeError.code:throw new AtomicReadyWalletRejectedUpgradeError(p);case AtomicityNotSupportedError.code:throw new AtomicityNotSupportedError(p);case 5e3:throw new UserRejectedRequestError(p);default:throw d instanceof BaseError?d:new UnknownRpcError(p)}}},{delay:({count:d,error:p})=>{if(p&&p instanceof HttpRequestError){const h=p?.headers?.get("Retry-After");if(h?.match(/\d/))return Number.parseInt(h,10)*1e3}return~~(1<<d)*u},retryCount:a,shouldRetry:({error:d})=>shouldRetry(d)}),{enabled:o,id:c})}}function shouldRetry(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===LimitExceededRpcError.code||e.code===InternalRpcError.code:e instanceof HttpRequestError&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function defineChain(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function withTimeout(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((o,i)=>{(async()=>{let u;try{const a=new AbortController;r>0&&(u=setTimeout(()=>{n&&a.abort()},r)),o(await e({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&i(t),i(a)}finally{clearTimeout(u)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(e,t={}){return{async request(r){const{body:n,fetchFn:o=t.fetchFn??fetch,onRequest:i=t.onRequest,onResponse:u=t.onResponse,timeout:a=t.timeout??1e4}=r,s={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:f,method:c,signal:d}=s;try{const p=await withTimeout(async({signal:y})=>{const b={...s,body:Array.isArray(n)?stringify$1(n.map(B=>({jsonrpc:"2.0",id:B.id??idCache.take(),...B}))):stringify$1({jsonrpc:"2.0",id:n.id??idCache.take(),...n}),headers:{"Content-Type":"application/json",...f},method:c||"POST",signal:d||(a>0?y:null)},w=new Request(e,b),S=await i?.(w,b)??{...b,url:e};return await o(S.url??e,S)},{errorInstance:new TimeoutError({body:n,url:e}),timeout:a,signal:!0});u&&await u(p);let h;if(p.headers.get("Content-Type")?.startsWith("application/json"))h=await p.json();else{h=await p.text();try{h=JSON.parse(h||"{}")}catch(y){if(p.ok)throw y;h={error:h}}}if(!p.ok)throw new HttpRequestError({body:n,details:stringify$1(h.error)||p.statusText,headers:p.headers,status:p.status,url:e});return h}catch(p){throw p instanceof HttpRequestError||p instanceof TimeoutError?p:new HttpRequestError({body:n,cause:p,url:e})}}}}async function recoverMessageAddress({message:e,signature:t}){return recoverAddress({hash:hashMessage(e),signature:t})}async function verifyMessage({address:e,message:t,signature:r}){return isAddressEqual(getAddress(e),await recoverMessageAddress({message:t,signature:r}))}async function addChain(e,{chain:t}){const{id:r,name:n,nativeCurrency:o,rpcUrls:i,blockExplorers:u}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex(r),chainName:n,nativeCurrency:o,rpcUrls:i.default.http,blockExplorerUrls:u?Object.values(u).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}function deployContract(e,t){const{abi:r,args:n,bytecode:o,...i}=t,u=encodeDeployData({abi:r,args:n,bytecode:o});return sendTransaction(e,{...i,...i.authorizationList?{to:null}:{},data:u})}async function getAddresses(e){return e.account?.type==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(r=>checksumAddress(r))}async function getCapabilities(e,t={}){const{account:r=e.account,chainId:n}=t,o=r?parseAccount(r):void 0,i=n?[o?.address,[numberToHex(n)]]:[o?.address],u=await e.request({method:"wallet_getCapabilities",params:i}),a={};for(const[s,f]of Object.entries(u)){a[Number(s)]={};for(let[c,d]of Object.entries(f))c==="addSubAccount"&&(c="unstable_addSubAccount"),a[Number(s)][c]=d}return typeof n=="number"?a[n]:a}async function getPermissions(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function prepareAuthorization(e,t){const{account:r=e.account,chainId:n,nonce:o}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const i=parseAccount(r),u=(()=>{if(t.executor)return t.executor==="self"?t.executor:parseAccount(t.executor)})(),a={address:t.contractAddress??t.address,chainId:n,nonce:o};return typeof a.chainId>"u"&&(a.chainId=e.chain?.id??await getAction(e,getChainId,"getChainId")({})),typeof a.nonce>"u"&&(a.nonce=await getAction(e,getTransactionCount,"getTransactionCount")({address:i.address,blockTag:"pending"}),(u==="self"||u?.address&&isAddressEqual(u.address,i.address))&&(a.nonce+=1)),a}async function requestAddresses(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>getAddress(r))}async function requestPermissions(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function showCallsStatus(e,t){const{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}async function signAuthorization(e,t){const{account:r=e.account}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const n=parseAccount(r);if(!n.signAuthorization)throw new AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const o=await prepareAuthorization(e,t);return n.signAuthorization(o)}async function signMessage(e,{account:t=e.account,message:r}){if(!t)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const n=parseAccount(t);if(n.signMessage)return n.signMessage({message:r});const o=typeof r=="string"?stringToHex(r):r.raw instanceof Uint8Array?toHex(r.raw):r.raw;return e.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}async function signTransaction(e,t){const{account:r=e.account,chain:n=e.chain,...o}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const i=parseAccount(r);assertRequest({account:i,...t});const u=await getAction(e,getChainId,"getChainId")({});n!==null&&assertCurrentChain({currentChainId:u,chain:n});const s=(n?.formatters||e.chain?.formatters)?.transactionRequest?.format||formatTransactionRequest;return i.signTransaction?i.signTransaction({...o,chainId:u},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...s(o),chainId:numberToHex(u),from:i.address}]},{retryCount:0})}async function signTypedData(e,t){const{account:r=e.account,domain:n,message:o,primaryType:i}=t;if(!r)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const u=parseAccount(r),a={EIP712Domain:getTypesForEIP712Domain({domain:n}),...t.types};if(validateTypedData({domain:n,message:o,primaryType:i,types:a}),u.signTypedData)return u.signTypedData({domain:n,message:o,primaryType:i,types:a});const s=serializeTypedData({domain:n,message:o,primaryType:i,types:a});return e.request({method:"eth_signTypedData_v4",params:[u.address,s]},{retryCount:0})}async function switchChain(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(t)}]},{retryCount:0})}async function watchAsset(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}function walletActions(e){return{addChain:t=>addChain(e,t),deployContract:t=>deployContract(e,t),getAddresses:()=>getAddresses(e),getCallsStatus:t=>getCallsStatus(e,t),getCapabilities:t=>getCapabilities(e,t),getChainId:()=>getChainId(e),getPermissions:()=>getPermissions(e),prepareAuthorization:t=>prepareAuthorization(e,t),prepareTransactionRequest:t=>prepareTransactionRequest(e,t),requestAddresses:()=>requestAddresses(e),requestPermissions:t=>requestPermissions(e,t),sendCalls:t=>sendCalls(e,t),sendRawTransaction:t=>sendRawTransaction(e,t),sendTransaction:t=>sendTransaction(e,t),showCallsStatus:t=>showCallsStatus(e,t),signAuthorization:t=>signAuthorization(e,t),signMessage:t=>signMessage(e,t),signTransaction:t=>signTransaction(e,t),signTypedData:t=>signTypedData(e,t),switchChain:t=>switchChain(e,t),waitForCallsStatus:t=>waitForCallsStatus(e,t),watchAsset:t=>watchAsset(e,t),writeContract:t=>writeContract(e,t)}}function createWalletClient(e){const{key:t="wallet",name:r="Wallet Client",transport:n}=e;return createClient({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(walletActions)}function createTransport({key:e,methods:t,name:r,request:n,retryCount:o=3,retryDelay:i=150,timeout:u,type:a},s){const f=uid();return{config:{key:e,methods:t,name:r,request:n,retryCount:o,retryDelay:i,timeout:u,type:a},request:buildRequest(n,{methods:t,retryCount:o,retryDelay:i,uid:f}),value:s}}class UrlRequiredError extends BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(e,t={}){const{batch:r,fetchFn:n,fetchOptions:o,key:i="http",methods:u,name:a="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:f,retryDelay:c,raw:d}=t;return({chain:p,retryCount:h,timeout:y})=>{const{batchSize:b=1e3,wait:w=0}=typeof r=="object"?r:{},S=t.retryCount??h,E=y??t.timeout??1e4,B=p?.rpcUrls.default.http[0];if(!B)throw new UrlRequiredError;const ae=getHttpRpcClient(B,{fetchFn:n,fetchOptions:o,onRequest:s,onResponse:f,timeout:E});return createTransport({key:i,methods:u,name:a,async request({method:W,params:J}){const ve={method:W,params:J},{schedule:Qe}=createBatchScheduler({id:B,wait:w,shouldSplitBatch(ce){return ce.length>b},fn:ce=>ae.request({body:ce}),sort:(ce,Ze)=>ce.id-Ze.id}),kt=async ce=>r?Qe(ce):[await ae.request({body:ce})],[{error:nr,result:sr}]=await kt(ve);if(d)return{error:nr,result:sr};if(nr)throw new RpcRequestError({body:ve,error:nr,url:B});return sr},retryCount:S,retryDelay:c,timeout:E,type:"http"},{fetchOptions:o,url:B})}}const hardhat=defineChain({id:31337,name:"Hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),ENV$1={EFFECTSTREAM_API_PORT:"9999",BATCHER_PORT:"3334"},CHAIN_COLORS={evm:"#4caf50",evmParallel:"#ff9800",cardano:"#2196f3",midnight:"#9c27b0"};function transformConfigToPaimaChains(e){const t={};return e.filter(n=>n.networkType!=="ntp").forEach((n,o)=>{const i=n.network,u=n.syncProtocol;let a=i.name;i.type==="evm"&&i.chainId?a=`evm_${i.chainId}`:i.type==="evm"&&i.id&&(a=`evm_${i.id}`),t[a]&&(a=`${a}_${o}`);let s;i.type==="evm"?i.rpcUrls?.default?.http?.[0]?s=i.rpcUrls.default.http[0]:u.chainUri&&(s=u.chainUri):(i.type==="midnight"||i.type==="avail"||i.type==="cardano")&&(s=i.nodeUrl);let f=CHAIN_COLORS.evm;i.type==="cardano"?f=CHAIN_COLORS.cardano:i.type==="midnight"?f=CHAIN_COLORS.midnight:i.name.toLowerCase().includes("arbitrum")?f=CHAIN_COLORS.evm:(i.name.toLowerCase().includes("ethereum")||i.name.toLowerCase().includes("l1"))&&(f=CHAIN_COLORS.evmParallel);const c={type:i.type.toUpperCase(),name:i.name,blockTime:i.blockTimeMS??u.pollingInterval??void 0,color:f,blocks:[],currentBlock:i.type==="evm"?5e5:1e5,rpcEndpoint:s,latestBlockNumber:0,previousLatestBlockNumber:0,isConnected:!1,protocolName:u.name};t[a]=c}),t}async function fetchChainConfigs(){const e=await fetch(CONFIG_ENDPOINT);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json(),r=transformConfigToPaimaChains(t);return{Paima:{type:"EVM",name:"Paima Engine",blockTime:t.find(o=>o.syncProtocol.name==="mainNtp")?.network.blockTimeMS??1e3,color:"#667eea",blocks:[],currentBlock:1e6,rpcEndpoint:`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/rpc/evm`,latestBlockNumber:0,previousLatestBlockNumber:0,isConnected:!1},...r}}const CONFIG_ENDPOINT="http://127.0.0.1:9999/config",BLOCK_HEIGHTS_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/block-heights`,PRIMITIVES_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/primitives`,TABLES_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/tables`,SCHEDULED_DATA_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/scheduled-data`,PRIMITIVES_SCHEMA_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/primitives-schema`,TABLE_SCHEMA_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/table-schema`,SYNC_PROTOCOLS_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/sync-protocols`,BATCHER_ENDPOINT=`http://localhost:${ENV$1.BATCHER_PORT}/send-input`,BATCHER_OPENAPI_URL=`http://localhost:${ENV$1.BATCHER_PORT}/documentation`,ENGINE_OPENAPI_URL=`http://localhost:${ENV$1.EFFECTSTREAM_API_PORT}/documentation`,DOCUMENTATION_URL="https://effectstream.github.io/docs/",ADDRESSES_ENDPOINT=`http://127.0.0.1:${ENV$1.EFFECTSTREAM_API_PORT}/addresses`;function IsAsyncIterator$3(e){return IsObject$3(e)&&!IsArray$3(e)&&!IsUint8Array$3(e)&&Symbol.asyncIterator in e}function IsArray$3(e){return Array.isArray(e)}function IsBigInt$3(e){return typeof e=="bigint"}function IsBoolean$3(e){return typeof e=="boolean"}function IsDate$3(e){return e instanceof globalThis.Date}function IsFunction$3(e){return typeof e=="function"}function IsIterator$3(e){return IsObject$3(e)&&!IsArray$3(e)&&!IsUint8Array$3(e)&&Symbol.iterator in e}function IsNull$3(e){return e===null}function IsNumber$3(e){return typeof e=="number"}function IsObject$3(e){return typeof e=="object"&&e!==null}function IsRegExp$2(e){return e instanceof globalThis.RegExp}function IsString$3(e){return typeof e=="string"}function IsSymbol$3(e){return typeof e=="symbol"}function IsUint8Array$3(e){return e instanceof globalThis.Uint8Array}function IsUndefined$3(e){return e===void 0}function ArrayType$1(e){return e.map(t=>Visit$7(t))}function DateType$1(e){return new Date(e.getTime())}function Uint8ArrayType$1(e){return new Uint8Array(e)}function RegExpType(e){return new RegExp(e.source,e.flags)}function ObjectType$1(e){const t={};for(const r of Object.getOwnPropertyNames(e))t[r]=Visit$7(e[r]);for(const r of Object.getOwnPropertySymbols(e))t[r]=Visit$7(e[r]);return t}function Visit$7(e){return IsArray$3(e)?ArrayType$1(e):IsDate$3(e)?DateType$1(e):IsUint8Array$3(e)?Uint8ArrayType$1(e):IsRegExp$2(e)?RegExpType(e):IsObject$3(e)?ObjectType$1(e):e}function Clone(e){return Visit$7(e)}function CloneType(e,t){return Clone(t===void 0?e:{...t,...e})}function IsAsyncIterator$2(e){return IsObject$2(e)&&globalThis.Symbol.asyncIterator in e}function IsIterator$2(e){return IsObject$2(e)&&globalThis.Symbol.iterator in e}function IsPromise$2(e){return e instanceof globalThis.Promise}function IsDate$2(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function IsUint8Array$2(e){return e instanceof globalThis.Uint8Array}function HasPropertyKey(e,t){return t in e}function IsObject$2(e){return e!==null&&typeof e=="object"}function IsArray$2(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function IsUndefined$2(e){return e===void 0}function IsNull$2(e){return e===null}function IsBoolean$2(e){return typeof e=="boolean"}function IsNumber$2(e){return typeof e=="number"}function IsInteger$2(e){return globalThis.Number.isInteger(e)}function IsBigInt$2(e){return typeof e=="bigint"}function IsString$2(e){return typeof e=="string"}function IsFunction$2(e){return typeof e=="function"}function IsSymbol$2(e){return typeof e=="symbol"}function IsValueType(e){return IsBigInt$2(e)||IsBoolean$2(e)||IsNull$2(e)||IsNumber$2(e)||IsString$2(e)||IsSymbol$2(e)||IsUndefined$2(e)}var TypeSystemPolicy;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(u,a){return e.ExactOptionalPropertyTypes?a in u:u[a]!==void 0}e.IsExactOptionalProperty=t;function r(u){const a=IsObject$2(u);return e.AllowArrayObject?a:a&&!IsArray$2(u)}e.IsObjectLike=r;function n(u){return r(u)&&!(u instanceof Date)&&!(u instanceof Uint8Array)}e.IsRecordLike=n;function o(u){return e.AllowNaN?IsNumber$2(u):Number.isFinite(u)}e.IsNumberLike=o;function i(u){const a=IsUndefined$2(u);return e.AllowNullVoid?a||u===null:a}e.IsVoidLike=i})(TypeSystemPolicy||(TypeSystemPolicy={}));function ImmutableArray(e){return globalThis.Object.freeze(e).map(t=>Immutable(t))}function ImmutableDate(e){return e}function ImmutableUint8Array(e){return e}function ImmutableRegExp(e){return e}function ImmutableObject(e){const t={};for(const r of Object.getOwnPropertyNames(e))t[r]=Immutable(e[r]);for(const r of Object.getOwnPropertySymbols(e))t[r]=Immutable(e[r]);return globalThis.Object.freeze(t)}function Immutable(e){return IsArray$3(e)?ImmutableArray(e):IsDate$3(e)?e:IsUint8Array$3(e)?e:IsRegExp$2(e)?e:IsObject$3(e)?ImmutableObject(e):e}function CreateType(e,t){const r=t!==void 0?{...t,...e}:e;switch(TypeSystemPolicy.InstanceMode){case"freeze":return Immutable(r);case"clone":return Clone(r);default:return r}}class TypeBoxError extends Error{constructor(t){super(t)}}const TransformKind=Symbol.for("TypeBox.Transform"),ReadonlyKind=Symbol.for("TypeBox.Readonly"),OptionalKind=Symbol.for("TypeBox.Optional"),Hint=Symbol.for("TypeBox.Hint"),Kind=Symbol.for("TypeBox.Kind");function IsReadonly(e){return IsObject$3(e)&&e[ReadonlyKind]==="Readonly"}function IsOptional$1(e){return IsObject$3(e)&&e[OptionalKind]==="Optional"}function IsAny$1(e){return IsKindOf$1(e,"Any")}function IsArgument$1(e){return IsKindOf$1(e,"Argument")}function IsArray$1(e){return IsKindOf$1(e,"Array")}function IsAsyncIterator$1(e){return IsKindOf$1(e,"AsyncIterator")}function IsBigInt$1(e){return IsKindOf$1(e,"BigInt")}function IsBoolean$1(e){return IsKindOf$1(e,"Boolean")}function IsComputed$1(e){return IsKindOf$1(e,"Computed")}function IsConstructor$1(e){return IsKindOf$1(e,"Constructor")}function IsDate$1(e){return IsKindOf$1(e,"Date")}function IsFunction$1(e){return IsKindOf$1(e,"Function")}function IsInteger$1(e){return IsKindOf$1(e,"Integer")}function IsIntersect$1(e){return IsKindOf$1(e,"Intersect")}function IsIterator$1(e){return IsKindOf$1(e,"Iterator")}function IsKindOf$1(e,t){return IsObject$3(e)&&Kind in e&&e[Kind]===t}function IsLiteralValue$1(e){return IsBoolean$3(e)||IsNumber$3(e)||IsString$3(e)}function IsLiteral$1(e){return IsKindOf$1(e,"Literal")}function IsMappedKey$1(e){return IsKindOf$1(e,"MappedKey")}function IsMappedResult$1(e){return IsKindOf$1(e,"MappedResult")}function IsNever$1(e){return IsKindOf$1(e,"Never")}function IsNot$1(e){return IsKindOf$1(e,"Not")}function IsNull$1(e){return IsKindOf$1(e,"Null")}function IsNumber$1(e){return IsKindOf$1(e,"Number")}function IsObject$1(e){return IsKindOf$1(e,"Object")}function IsPromise$1(e){return IsKindOf$1(e,"Promise")}function IsRecord$1(e){return IsKindOf$1(e,"Record")}function IsRef$1(e){return IsKindOf$1(e,"Ref")}function IsRegExp$1(e){return IsKindOf$1(e,"RegExp")}function IsString$1(e){return IsKindOf$1(e,"String")}function IsSymbol$1(e){return IsKindOf$1(e,"Symbol")}function IsTemplateLiteral$1(e){return IsKindOf$1(e,"TemplateLiteral")}function IsThis$1(e){return IsKindOf$1(e,"This")}function IsTransform$1(e){return IsObject$3(e)&&TransformKind in e}function IsTuple$1(e){return IsKindOf$1(e,"Tuple")}function IsUndefined$1(e){return IsKindOf$1(e,"Undefined")}function IsUnion$1(e){return IsKindOf$1(e,"Union")}function IsUint8Array$1(e){return IsKindOf$1(e,"Uint8Array")}function IsUnknown$1(e){return IsKindOf$1(e,"Unknown")}function IsUnsafe$1(e){return IsKindOf$1(e,"Unsafe")}function IsVoid$1(e){return IsKindOf$1(e,"Void")}function IsKind$1(e){return IsObject$3(e)&&Kind in e&&IsString$3(e[Kind])}function IsSchema$1(e){return IsAny$1(e)||IsArgument$1(e)||IsArray$1(e)||IsBoolean$1(e)||IsBigInt$1(e)||IsAsyncIterator$1(e)||IsComputed$1(e)||IsConstructor$1(e)||IsDate$1(e)||IsFunction$1(e)||IsInteger$1(e)||IsIntersect$1(e)||IsIterator$1(e)||IsLiteral$1(e)||IsMappedKey$1(e)||IsMappedResult$1(e)||IsNever$1(e)||IsNot$1(e)||IsNull$1(e)||IsNumber$1(e)||IsObject$1(e)||IsPromise$1(e)||IsRecord$1(e)||IsRef$1(e)||IsRegExp$1(e)||IsString$1(e)||IsSymbol$1(e)||IsTemplateLiteral$1(e)||IsThis$1(e)||IsTuple$1(e)||IsUndefined$1(e)||IsUnion$1(e)||IsUint8Array$1(e)||IsUnknown$1(e)||IsUnsafe$1(e)||IsVoid$1(e)||IsKind$1(e)}const KnownTypes=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function IsPattern(e){try{return new RegExp(e),!0}catch{return!1}}function IsControlCharacterFree(e){if(!IsString$3(e))return!1;for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}function IsAdditionalProperties(e){return IsOptionalBoolean(e)||IsSchema(e)}function IsOptionalBigInt(e){return IsUndefined$3(e)||IsBigInt$3(e)}function IsOptionalNumber(e){return IsUndefined$3(e)||IsNumber$3(e)}function IsOptionalBoolean(e){return IsUndefined$3(e)||IsBoolean$3(e)}function IsOptionalString(e){return IsUndefined$3(e)||IsString$3(e)}function IsOptionalPattern(e){return IsUndefined$3(e)||IsString$3(e)&&IsControlCharacterFree(e)&&IsPattern(e)}function IsOptionalFormat(e){return IsUndefined$3(e)||IsString$3(e)&&IsControlCharacterFree(e)}function IsOptionalSchema(e){return IsUndefined$3(e)||IsSchema(e)}function IsOptional(e){return IsObject$3(e)&&e[OptionalKind]==="Optional"}function IsAny(e){return IsKindOf(e,"Any")&&IsOptionalString(e.$id)}function IsArgument(e){return IsKindOf(e,"Argument")&&IsNumber$3(e.index)}function IsArray(e){return IsKindOf(e,"Array")&&e.type==="array"&&IsOptionalString(e.$id)&&IsSchema(e.items)&&IsOptionalNumber(e.minItems)&&IsOptionalNumber(e.maxItems)&&IsOptionalBoolean(e.uniqueItems)&&IsOptionalSchema(e.contains)&&IsOptionalNumber(e.minContains)&&IsOptionalNumber(e.maxContains)}function IsAsyncIterator(e){return IsKindOf(e,"AsyncIterator")&&e.type==="AsyncIterator"&&IsOptionalString(e.$id)&&IsSchema(e.items)}function IsBigInt(e){return IsKindOf(e,"BigInt")&&e.type==="bigint"&&IsOptionalString(e.$id)&&IsOptionalBigInt(e.exclusiveMaximum)&&IsOptionalBigInt(e.exclusiveMinimum)&&IsOptionalBigInt(e.maximum)&&IsOptionalBigInt(e.minimum)&&IsOptionalBigInt(e.multipleOf)}function IsBoolean(e){return IsKindOf(e,"Boolean")&&e.type==="boolean"&&IsOptionalString(e.$id)}function IsComputed(e){return IsKindOf(e,"Computed")&&IsString$3(e.target)&&IsArray$3(e.parameters)&&e.parameters.every(t=>IsSchema(t))}function IsConstructor(e){return IsKindOf(e,"Constructor")&&e.type==="Constructor"&&IsOptionalString(e.$id)&&IsArray$3(e.parameters)&&e.parameters.every(t=>IsSchema(t))&&IsSchema(e.returns)}function IsDate(e){return IsKindOf(e,"Date")&&e.type==="Date"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.exclusiveMaximumTimestamp)&&IsOptionalNumber(e.exclusiveMinimumTimestamp)&&IsOptionalNumber(e.maximumTimestamp)&&IsOptionalNumber(e.minimumTimestamp)&&IsOptionalNumber(e.multipleOfTimestamp)}function IsFunction(e){return IsKindOf(e,"Function")&&e.type==="Function"&&IsOptionalString(e.$id)&&IsArray$3(e.parameters)&&e.parameters.every(t=>IsSchema(t))&&IsSchema(e.returns)}function IsInteger(e){return IsKindOf(e,"Integer")&&e.type==="integer"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.exclusiveMaximum)&&IsOptionalNumber(e.exclusiveMinimum)&&IsOptionalNumber(e.maximum)&&IsOptionalNumber(e.minimum)&&IsOptionalNumber(e.multipleOf)}function IsProperties(e){return IsObject$3(e)&&Object.entries(e).every(([t,r])=>IsControlCharacterFree(t)&&IsSchema(r))}function IsIntersect(e){return IsKindOf(e,"Intersect")&&!(IsString$3(e.type)&&e.type!=="object")&&IsArray$3(e.allOf)&&e.allOf.every(t=>IsSchema(t)&&!IsTransform(t))&&IsOptionalString(e.type)&&(IsOptionalBoolean(e.unevaluatedProperties)||IsOptionalSchema(e.unevaluatedProperties))&&IsOptionalString(e.$id)}function IsIterator(e){return IsKindOf(e,"Iterator")&&e.type==="Iterator"&&IsOptionalString(e.$id)&&IsSchema(e.items)}function IsKindOf(e,t){return IsObject$3(e)&&Kind in e&&e[Kind]===t}function IsLiteralString(e){return IsLiteral(e)&&IsString$3(e.const)}function IsLiteralNumber(e){return IsLiteral(e)&&IsNumber$3(e.const)}function IsLiteralBoolean(e){return IsLiteral(e)&&IsBoolean$3(e.const)}function IsLiteral(e){return IsKindOf(e,"Literal")&&IsOptionalString(e.$id)&&IsLiteralValue(e.const)}function IsLiteralValue(e){return IsBoolean$3(e)||IsNumber$3(e)||IsString$3(e)}function IsMappedKey(e){return IsKindOf(e,"MappedKey")&&IsArray$3(e.keys)&&e.keys.every(t=>IsNumber$3(t)||IsString$3(t))}function IsMappedResult(e){return IsKindOf(e,"MappedResult")&&IsProperties(e.properties)}function IsNever(e){return IsKindOf(e,"Never")&&IsObject$3(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function IsNot(e){return IsKindOf(e,"Not")&&IsSchema(e.not)}function IsNull(e){return IsKindOf(e,"Null")&&e.type==="null"&&IsOptionalString(e.$id)}function IsNumber(e){return IsKindOf(e,"Number")&&e.type==="number"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.exclusiveMaximum)&&IsOptionalNumber(e.exclusiveMinimum)&&IsOptionalNumber(e.maximum)&&IsOptionalNumber(e.minimum)&&IsOptionalNumber(e.multipleOf)}function IsObject(e){return IsKindOf(e,"Object")&&e.type==="object"&&IsOptionalString(e.$id)&&IsProperties(e.properties)&&IsAdditionalProperties(e.additionalProperties)&&IsOptionalNumber(e.minProperties)&&IsOptionalNumber(e.maxProperties)}function IsPromise(e){return IsKindOf(e,"Promise")&&e.type==="Promise"&&IsOptionalString(e.$id)&&IsSchema(e.item)}function IsRecord(e){return IsKindOf(e,"Record")&&e.type==="object"&&IsOptionalString(e.$id)&&IsAdditionalProperties(e.additionalProperties)&&IsObject$3(e.patternProperties)&&(t=>{const r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&IsPattern(r[0])&&IsObject$3(t.patternProperties)&&IsSchema(t.patternProperties[r[0]])})(e)}function IsRef(e){return IsKindOf(e,"Ref")&&IsOptionalString(e.$id)&&IsString$3(e.$ref)}function IsRegExp(e){return IsKindOf(e,"RegExp")&&IsOptionalString(e.$id)&&IsString$3(e.source)&&IsString$3(e.flags)&&IsOptionalNumber(e.maxLength)&&IsOptionalNumber(e.minLength)}function IsString(e){return IsKindOf(e,"String")&&e.type==="string"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.minLength)&&IsOptionalNumber(e.maxLength)&&IsOptionalPattern(e.pattern)&&IsOptionalFormat(e.format)}function IsSymbol(e){return IsKindOf(e,"Symbol")&&e.type==="symbol"&&IsOptionalString(e.$id)}function IsTemplateLiteral(e){return IsKindOf(e,"TemplateLiteral")&&e.type==="string"&&IsString$3(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function IsThis(e){return IsKindOf(e,"This")&&IsOptionalString(e.$id)&&IsString$3(e.$ref)}function IsTransform(e){return IsObject$3(e)&&TransformKind in e}function IsTuple(e){return IsKindOf(e,"Tuple")&&e.type==="array"&&IsOptionalString(e.$id)&&IsNumber$3(e.minItems)&&IsNumber$3(e.maxItems)&&e.minItems===e.maxItems&&(IsUndefined$3(e.items)&&IsUndefined$3(e.additionalItems)&&e.minItems===0||IsArray$3(e.items)&&e.items.every(t=>IsSchema(t)))}function IsUndefined(e){return IsKindOf(e,"Undefined")&&e.type==="undefined"&&IsOptionalString(e.$id)}function IsUnion(e){return IsKindOf(e,"Union")&&IsOptionalString(e.$id)&&IsObject$3(e)&&IsArray$3(e.anyOf)&&e.anyOf.every(t=>IsSchema(t))}function IsUint8Array(e){return IsKindOf(e,"Uint8Array")&&e.type==="Uint8Array"&&IsOptionalString(e.$id)&&IsOptionalNumber(e.minByteLength)&&IsOptionalNumber(e.maxByteLength)}function IsUnknown(e){return IsKindOf(e,"Unknown")&&IsOptionalString(e.$id)}function IsUnsafe(e){return IsKindOf(e,"Unsafe")}function IsVoid(e){return IsKindOf(e,"Void")&&e.type==="void"&&IsOptionalString(e.$id)}function IsKind(e){return IsObject$3(e)&&Kind in e&&IsString$3(e[Kind])&&!KnownTypes.includes(e[Kind])}function IsSchema(e){return IsObject$3(e)&&(IsAny(e)||IsArgument(e)||IsArray(e)||IsBoolean(e)||IsBigInt(e)||IsAsyncIterator(e)||IsComputed(e)||IsConstructor(e)||IsDate(e)||IsFunction(e)||IsInteger(e)||IsIntersect(e)||IsIterator(e)||IsLiteral(e)||IsMappedKey(e)||IsMappedResult(e)||IsNever(e)||IsNot(e)||IsNull(e)||IsNumber(e)||IsObject(e)||IsPromise(e)||IsRecord(e)||IsRef(e)||IsRegExp(e)||IsString(e)||IsSymbol(e)||IsTemplateLiteral(e)||IsThis(e)||IsTuple(e)||IsUndefined(e)||IsUnion(e)||IsUint8Array(e)||IsUnknown(e)||IsUnsafe(e)||IsVoid(e)||IsKind(e))}const PatternBoolean="(true|false)",PatternNumber="(0|[1-9][0-9]*)",PatternString="(.*)",PatternNever="(?!.*)",PatternNumberExact=`^${PatternNumber}$`,PatternStringExact=`^${PatternString}$`,PatternNeverExact=`^${PatternNever}$`,map$2=new Map;function Has$1(e){return map$2.has(e)}function Set$1(e,t){map$2.set(e,t)}function Get$1(e){return map$2.get(e)}const map$1=new Map;function Has(e){return map$1.has(e)}function Get(e){return map$1.get(e)}function SetIncludes(e,t){return e.includes(t)}function SetDistinct(e){return[...new Set(e)]}function SetIntersect(e,t){return e.filter(r=>t.includes(r))}function SetIntersectManyResolve(e,t){return e.reduce((r,n)=>SetIntersect(r,n),t)}function SetIntersectMany(e){return e.length===1?e[0]:e.length>1?SetIntersectManyResolve(e.slice(1),e[0]):[]}function SetUnionMany(e){const t=[];for(const r of e)t.push(...r);return t}function Any(e){return CreateType({[Kind]:"Any"},e)}function Array$1(e,t){return CreateType({[Kind]:"Array",type:"array",items:e},t)}function Argument(e){return CreateType({[Kind]:"Argument",index:e})}function AsyncIterator(e,t){return CreateType({[Kind]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function Computed(e,t,r){return CreateType({[Kind]:"Computed",target:e,parameters:t},r)}function DiscardKey(e,t){const{[t]:r,...n}=e;return n}function Discard(e,t){return t.reduce((r,n)=>DiscardKey(r,n),e)}function Never(e){return CreateType({[Kind]:"Never",not:{}},e)}function MappedResult(e){return CreateType({[Kind]:"MappedResult",properties:e})}function Constructor(e,t,r){return CreateType({[Kind]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}function Function$1(e,t,r){return CreateType({[Kind]:"Function",type:"Function",parameters:e,returns:t},r)}function UnionCreate(e,t){return CreateType({[Kind]:"Union",anyOf:e},t)}function IsUnionOptional(e){return e.some(t=>IsOptional$1(t))}function RemoveOptionalFromRest$1(e){return e.map(t=>IsOptional$1(t)?RemoveOptionalFromType$1(t):t)}function RemoveOptionalFromType$1(e){return Discard(e,[OptionalKind])}function ResolveUnion(e,t){return IsUnionOptional(e)?Optional(UnionCreate(RemoveOptionalFromRest$1(e),t)):UnionCreate(RemoveOptionalFromRest$1(e),t)}function UnionEvaluated(e,t){return e.length===1?CreateType(e[0],t):e.length===0?Never(t):ResolveUnion(e,t)}function Union$1(e,t){return e.length===0?Never(t):e.length===1?CreateType(e[0],t):UnionCreate(e,t)}class TemplateLiteralParserError extends TypeBoxError{}function Unescape(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function IsNonEscaped(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function IsOpenParen(e,t){return IsNonEscaped(e,t,"(")}function IsCloseParen(e,t){return IsNonEscaped(e,t,")")}function IsSeparator(e,t){return IsNonEscaped(e,t,"|")}function IsGroup(e){if(!(IsOpenParen(e,0)&&IsCloseParen(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(IsOpenParen(e,r)&&(t+=1),IsCloseParen(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function InGroup(e){return e.slice(1,e.length-1)}function IsPrecedenceOr(e){let t=0;for(let r=0;r<e.length;r++)if(IsOpenParen(e,r)&&(t+=1),IsCloseParen(e,r)&&(t-=1),IsSeparator(e,r)&&t===0)return!0;return!1}function IsPrecedenceAnd(e){for(let t=0;t<e.length;t++)if(IsOpenParen(e,t))return!0;return!1}function Or$1(e){let[t,r]=[0,0];const n=[];for(let i=0;i<e.length;i++)if(IsOpenParen(e,i)&&(t+=1),IsCloseParen(e,i)&&(t-=1),IsSeparator(e,i)&&t===0){const u=e.slice(r,i);u.length>0&&n.push(TemplateLiteralParse(u)),r=i+1}const o=e.slice(r);return o.length>0&&n.push(TemplateLiteralParse(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}function And(e){function t(o,i){if(!IsOpenParen(o,i))throw new TemplateLiteralParserError("TemplateLiteralParser: Index must point to open parens");let u=0;for(let a=i;a<o.length;a++)if(IsOpenParen(o,a)&&(u+=1),IsCloseParen(o,a)&&(u-=1),u===0)return[i,a];throw new TemplateLiteralParserError("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,i){for(let u=i;u<o.length;u++)if(IsOpenParen(o,u))return[i,u];return[i,o.length]}const n=[];for(let o=0;o<e.length;o++)if(IsOpenParen(e,o)){const[i,u]=t(e,o),a=e.slice(i,u+1);n.push(TemplateLiteralParse(a)),o=u}else{const[i,u]=r(e,o),a=e.slice(i,u);a.length>0&&n.push(TemplateLiteralParse(a)),o=u-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}function TemplateLiteralParse(e){return IsGroup(e)?TemplateLiteralParse(InGroup(e)):IsPrecedenceOr(e)?Or$1(e):IsPrecedenceAnd(e)?And(e):{type:"const",const:Unescape(e)}}function TemplateLiteralParseExact(e){return TemplateLiteralParse(e.slice(1,e.length-1))}class TemplateLiteralFiniteError extends TypeBoxError{}function IsNumberExpression(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function IsBooleanExpression(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function IsStringExpression(e){return e.type==="const"&&e.const===".*"}function IsTemplateLiteralExpressionFinite(e){return IsNumberExpression(e)||IsStringExpression(e)?!1:IsBooleanExpression(e)?!0:e.type==="and"?e.expr.every(t=>IsTemplateLiteralExpressionFinite(t)):e.type==="or"?e.expr.every(t=>IsTemplateLiteralExpressionFinite(t)):e.type==="const"?!0:(()=>{throw new TemplateLiteralFiniteError("Unknown expression type")})()}function IsTemplateLiteralFinite(e){const t=TemplateLiteralParseExact(e.pattern);return IsTemplateLiteralExpressionFinite(t)}class TemplateLiteralGenerateError extends TypeBoxError{}function*GenerateReduce(e){if(e.length===1)return yield*e[0];for(const t of e[0])for(const r of GenerateReduce(e.slice(1)))yield`${t}${r}`}function*GenerateAnd(e){return yield*GenerateReduce(e.expr.map(t=>[...TemplateLiteralExpressionGenerate(t)]))}function*GenerateOr(e){for(const t of e.expr)yield*TemplateLiteralExpressionGenerate(t)}function*GenerateConst(e){return yield e.const}function*TemplateLiteralExpressionGenerate(e){return e.type==="and"?yield*GenerateAnd(e):e.type==="or"?yield*GenerateOr(e):e.type==="const"?yield*GenerateConst(e):(()=>{throw new TemplateLiteralGenerateError("Unknown expression")})()}function TemplateLiteralGenerate(e){const t=TemplateLiteralParseExact(e.pattern);return IsTemplateLiteralExpressionFinite(t)?[...TemplateLiteralExpressionGenerate(t)]:[]}function Literal(e,t){return CreateType({[Kind]:"Literal",const:e,type:typeof e},t)}function Boolean$1(e){return CreateType({[Kind]:"Boolean",type:"boolean"},e)}function BigInt$2(e){return CreateType({[Kind]:"BigInt",type:"bigint"},e)}function Number$1(e){return CreateType({[Kind]:"Number",type:"number"},e)}function String$1(e){return CreateType({[Kind]:"String",type:"string"},e)}function*FromUnion$d(e){const t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield Boolean$1():t==="number"?yield Number$1():t==="bigint"?yield BigInt$2():t==="string"?yield String$1():yield(()=>{const r=t.split("|").map(n=>Literal(n.trim()));return r.length===0?Never():r.length===1?r[0]:UnionEvaluated(r)})()}function*FromTerminal(e){if(e[1]!=="{"){const t=Literal("$"),r=FromSyntax(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){const r=FromUnion$d(e.slice(2,t)),n=FromSyntax(e.slice(t+1));return yield*[...r,...n]}yield Literal(e)}function*FromSyntax(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){const r=Literal(e.slice(0,t)),n=FromTerminal(e.slice(t));return yield*[r,...n]}yield Literal(e)}function TemplateLiteralSyntax(e){return[...FromSyntax(e)]}class TemplateLiteralPatternError extends TypeBoxError{}function Escape(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Visit$6(e,t){return IsTemplateLiteral$1(e)?e.pattern.slice(1,e.pattern.length-1):IsUnion$1(e)?`(${e.anyOf.map(r=>Visit$6(r,t)).join("|")})`:IsNumber$1(e)?`${t}${PatternNumber}`:IsInteger$1(e)?`${t}${PatternNumber}`:IsBigInt$1(e)?`${t}${PatternNumber}`:IsString$1(e)?`${t}${PatternString}`:IsLiteral$1(e)?`${t}${Escape(e.const.toString())}`:IsBoolean$1(e)?`${t}${PatternBoolean}`:(()=>{throw new TemplateLiteralPatternError(`Unexpected Kind '${e[Kind]}'`)})()}function TemplateLiteralPattern(e){return`^${e.map(t=>Visit$6(t,"")).join("")}$`}function TemplateLiteralToUnion(e){const r=TemplateLiteralGenerate(e).map(n=>Literal(n));return UnionEvaluated(r)}function TemplateLiteral(e,t){const r=IsString$3(e)?TemplateLiteralPattern(TemplateLiteralSyntax(e)):TemplateLiteralPattern(e);return CreateType({[Kind]:"TemplateLiteral",type:"string",pattern:r},t)}function FromTemplateLiteral$4(e){return TemplateLiteralGenerate(e).map(r=>r.toString())}function FromUnion$c(e){const t=[];for(const r of e)t.push(...IndexPropertyKeys(r));return t}function FromLiteral$3(e){return[e.toString()]}function IndexPropertyKeys(e){return[...new Set(IsTemplateLiteral$1(e)?FromTemplateLiteral$4(e):IsUnion$1(e)?FromUnion$c(e.anyOf):IsLiteral$1(e)?FromLiteral$3(e.const):IsNumber$1(e)?["[number]"]:IsInteger$1(e)?["[number]"]:[])]}function FromProperties$i(e,t,r){const n={};for(const o of Object.getOwnPropertyNames(t))n[o]=Index(e,IndexPropertyKeys(t[o]),r);return n}function FromMappedResult$b(e,t,r){return FromProperties$i(e,t.properties,r)}function IndexFromMappedResult(e,t,r){const n=FromMappedResult$b(e,t,r);return MappedResult(n)}function FromRest$6(e,t){return e.map(r=>IndexFromPropertyKey(r,t))}function FromIntersectRest(e){return e.filter(t=>!IsNever$1(t))}function FromIntersect$b(e,t){return IntersectEvaluated(FromIntersectRest(FromRest$6(e,t)))}function FromUnionRest(e){return e.some(t=>IsNever$1(t))?[]:e}function FromUnion$b(e,t){return UnionEvaluated(FromUnionRest(FromRest$6(e,t)))}function FromTuple$8(e,t){return t in e?e[t]:t==="[number]"?UnionEvaluated(e):Never()}function FromArray$9(e,t){return t==="[number]"?e:Never()}function FromProperty$2(e,t){return t in e?e[t]:Never()}function IndexFromPropertyKey(e,t){return IsIntersect$1(e)?FromIntersect$b(e.allOf,t):IsUnion$1(e)?FromUnion$b(e.anyOf,t):IsTuple$1(e)?FromTuple$8(e.items??[],t):IsArray$1(e)?FromArray$9(e.items,t):IsObject$1(e)?FromProperty$2(e.properties,t):Never()}function IndexFromPropertyKeys(e,t){return t.map(r=>IndexFromPropertyKey(e,r))}function FromSchema(e,t){return UnionEvaluated(IndexFromPropertyKeys(e,t))}function Index(e,t,r){if(IsRef$1(e)||IsRef$1(t)){const n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!IsSchema$1(e)||!IsSchema$1(t))throw new TypeBoxError(n);return Computed("Index",[e,t])}return IsMappedResult$1(t)?IndexFromMappedResult(e,t,r):IsMappedKey$1(t)?IndexFromMappedKey(e,t,r):CreateType(IsSchema$1(t)?FromSchema(e,IndexPropertyKeys(t)):FromSchema(e,t),r)}function MappedIndexPropertyKey(e,t,r){return{[t]:Index(e,[t],Clone(r))}}function MappedIndexPropertyKeys(e,t,r){return t.reduce((n,o)=>({...n,...MappedIndexPropertyKey(e,o,r)}),{})}function MappedIndexProperties(e,t,r){return MappedIndexPropertyKeys(e,t.keys,r)}function IndexFromMappedKey(e,t,r){const n=MappedIndexProperties(e,t,r);return MappedResult(n)}function Iterator(e,t){return CreateType({[Kind]:"Iterator",type:"Iterator",items:e},t)}function RequiredKeys(e){const t=[];for(let r in e)IsOptional$1(e[r])||t.push(r);return t}function _Object(e,t){const r=RequiredKeys(e),n=r.length>0?{[Kind]:"Object",type:"object",properties:e,required:r}:{[Kind]:"Object",type:"object",properties:e};return CreateType(n,t)}var Object$1=_Object;function Promise$1(e,t){return CreateType({[Kind]:"Promise",type:"Promise",item:e},t)}function RemoveReadonly(e){return CreateType(Discard(e,[ReadonlyKind]))}function AddReadonly(e){return CreateType({...e,[ReadonlyKind]:"Readonly"})}function ReadonlyWithFlag(e,t){return t===!1?RemoveReadonly(e):AddReadonly(e)}function Readonly(e,t){const r=t??!0;return IsMappedResult$1(e)?ReadonlyFromMappedResult(e,r):ReadonlyWithFlag(e,r)}function FromProperties$h(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Readonly(e[n],t);return r}function FromMappedResult$a(e,t){return FromProperties$h(e.properties,t)}function ReadonlyFromMappedResult(e,t){const r=FromMappedResult$a(e,t);return MappedResult(r)}function Tuple(e,t){return CreateType(e.length>0?{[Kind]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Kind]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function FromMappedResult$9(e,t){return e in t?FromSchemaType(e,t[e]):MappedResult(t)}function MappedKeyToKnownMappedResultProperties(e){return{[e]:Literal(e)}}function MappedKeyToUnknownMappedResultProperties(e){const t={};for(const r of e)t[r]=Literal(r);return t}function MappedKeyToMappedResultProperties(e,t){return SetIncludes(t,e)?MappedKeyToKnownMappedResultProperties(e):MappedKeyToUnknownMappedResultProperties(t)}function FromMappedKey$3(e,t){const r=MappedKeyToMappedResultProperties(e,t);return FromMappedResult$9(e,r)}function FromRest$5(e,t){return t.map(r=>FromSchemaType(e,r))}function FromProperties$g(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(t))r[n]=FromSchemaType(e,t[n]);return r}function FromSchemaType(e,t){const r={...t};return IsOptional$1(t)?Optional(FromSchemaType(e,Discard(t,[OptionalKind]))):IsReadonly(t)?Readonly(FromSchemaType(e,Discard(t,[ReadonlyKind]))):IsMappedResult$1(t)?FromMappedResult$9(e,t.properties):IsMappedKey$1(t)?FromMappedKey$3(e,t.keys):IsConstructor$1(t)?Constructor(FromRest$5(e,t.parameters),FromSchemaType(e,t.returns),r):IsFunction$1(t)?Function$1(FromRest$5(e,t.parameters),FromSchemaType(e,t.returns),r):IsAsyncIterator$1(t)?AsyncIterator(FromSchemaType(e,t.items),r):IsIterator$1(t)?Iterator(FromSchemaType(e,t.items),r):IsIntersect$1(t)?Intersect$1(FromRest$5(e,t.allOf),r):IsUnion$1(t)?Union$1(FromRest$5(e,t.anyOf),r):IsTuple$1(t)?Tuple(FromRest$5(e,t.items??[]),r):IsObject$1(t)?Object$1(FromProperties$g(e,t.properties),r):IsArray$1(t)?Array$1(FromSchemaType(e,t.items),r):IsPromise$1(t)?Promise$1(FromSchemaType(e,t.item),r):t}function MappedFunctionReturnType(e,t){const r={};for(const n of e)r[n]=FromSchemaType(n,t);return r}function Mapped(e,t,r){const n=IsSchema$1(e)?IndexPropertyKeys(e):e,o=t({[Kind]:"MappedKey",keys:n}),i=MappedFunctionReturnType(n,o);return Object$1(i,r)}function RemoveOptional(e){return CreateType(Discard(e,[OptionalKind]))}function AddOptional(e){return CreateType({...e,[OptionalKind]:"Optional"})}function OptionalWithFlag(e,t){return t===!1?RemoveOptional(e):AddOptional(e)}function Optional(e,t){const r=t??!0;return IsMappedResult$1(e)?OptionalFromMappedResult(e,r):OptionalWithFlag(e,r)}function FromProperties$f(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Optional(e[n],t);return r}function FromMappedResult$8(e,t){return FromProperties$f(e.properties,t)}function OptionalFromMappedResult(e,t){const r=FromMappedResult$8(e,t);return MappedResult(r)}function IntersectCreate(e,t={}){const r=e.every(o=>IsObject$1(o)),n=IsSchema$1(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return CreateType(t.unevaluatedProperties===!1||IsSchema$1(t.unevaluatedProperties)||r?{...n,[Kind]:"Intersect",type:"object",allOf:e}:{...n,[Kind]:"Intersect",allOf:e},t)}function IsIntersectOptional(e){return e.every(t=>IsOptional$1(t))}function RemoveOptionalFromType(e){return Discard(e,[OptionalKind])}function RemoveOptionalFromRest(e){return e.map(t=>IsOptional$1(t)?RemoveOptionalFromType(t):t)}function ResolveIntersect(e,t){return IsIntersectOptional(e)?Optional(IntersectCreate(RemoveOptionalFromRest(e),t)):IntersectCreate(RemoveOptionalFromRest(e),t)}function IntersectEvaluated(e,t={}){if(e.length===1)return CreateType(e[0],t);if(e.length===0)return Never(t);if(e.some(r=>IsTransform$1(r)))throw new Error("Cannot intersect transform types");return ResolveIntersect(e,t)}function Intersect$1(e,t){if(e.length===1)return CreateType(e[0],t);if(e.length===0)return Never(t);if(e.some(r=>IsTransform$1(r)))throw new Error("Cannot intersect transform types");return IntersectCreate(e,t)}function Ref(...e){const[t,r]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new TypeBoxError("Ref: $ref must be a string");return CreateType({[Kind]:"Ref",$ref:t},r)}function FromComputed$4(e,t){return Computed("Awaited",[Computed(e,t)])}function FromRef$7(e){return Computed("Awaited",[Ref(e)])}function FromIntersect$a(e){return Intersect$1(FromRest$4(e))}function FromUnion$a(e){return Union$1(FromRest$4(e))}function FromPromise$5(e){return Awaited(e)}function FromRest$4(e){return e.map(t=>Awaited(t))}function Awaited(e,t){return CreateType(IsComputed$1(e)?FromComputed$4(e.target,e.parameters):IsIntersect$1(e)?FromIntersect$a(e.allOf):IsUnion$1(e)?FromUnion$a(e.anyOf):IsPromise$1(e)?FromPromise$5(e.item):IsRef$1(e)?FromRef$7(e.$ref):e,t)}function FromRest$3(e){const t=[];for(const r of e)t.push(KeyOfPropertyKeys(r));return t}function FromIntersect$9(e){const t=FromRest$3(e);return SetUnionMany(t)}function FromUnion$9(e){const t=FromRest$3(e);return SetIntersectMany(t)}function FromTuple$7(e){return e.map((t,r)=>r.toString())}function FromArray$8(e){return["[number]"]}function FromProperties$e(e){return globalThis.Object.getOwnPropertyNames(e)}function FromPatternProperties(e){return includePatternProperties?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function KeyOfPropertyKeys(e){return IsIntersect$1(e)?FromIntersect$9(e.allOf):IsUnion$1(e)?FromUnion$9(e.anyOf):IsTuple$1(e)?FromTuple$7(e.items??[]):IsArray$1(e)?FromArray$8(e.items):IsObject$1(e)?FromProperties$e(e.properties):IsRecord$1(e)?FromPatternProperties(e.patternProperties):[]}let includePatternProperties=!1;function KeyOfPattern(e){includePatternProperties=!0;const t=KeyOfPropertyKeys(e);return includePatternProperties=!1,`^(${t.map(n=>`(${n})`).join("|")})$`}function FromComputed$3(e,t){return Computed("KeyOf",[Computed(e,t)])}function FromRef$6(e){return Computed("KeyOf",[Ref(e)])}function KeyOfFromType(e,t){const r=KeyOfPropertyKeys(e),n=KeyOfPropertyKeysToRest(r),o=UnionEvaluated(n);return CreateType(o,t)}function KeyOfPropertyKeysToRest(e){return e.map(t=>t==="[number]"?Number$1():Literal(t))}function KeyOf(e,t){return IsComputed$1(e)?FromComputed$3(e.target,e.parameters):IsRef$1(e)?FromRef$6(e.$ref):IsMappedResult$1(e)?KeyOfFromMappedResult(e,t):KeyOfFromType(e,t)}function FromProperties$d(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=KeyOf(e[n],Clone(t));return r}function FromMappedResult$7(e,t){return FromProperties$d(e.properties,t)}function KeyOfFromMappedResult(e,t){const r=FromMappedResult$7(e,t);return MappedResult(r)}function KeyOfPropertyEntries(e){const t=KeyOfPropertyKeys(e),r=IndexFromPropertyKeys(e,t);return t.map((n,o)=>[t[o],r[o]])}function CompositeKeys(e){const t=[];for(const r of e)t.push(...KeyOfPropertyKeys(r));return SetDistinct(t)}function FilterNever(e){return e.filter(t=>!IsNever$1(t))}function CompositeProperty(e,t){const r=[];for(const n of e)r.push(...IndexFromPropertyKeys(n,[t]));return FilterNever(r)}function CompositeProperties(e,t){const r={};for(const n of t)r[n]=IntersectEvaluated(CompositeProperty(e,n));return r}function Composite(e,t){const r=CompositeKeys(e),n=CompositeProperties(e,r);return Object$1(n,t)}function Date$1(e){return CreateType({[Kind]:"Date",type:"Date"},e)}function Null(e){return CreateType({[Kind]:"Null",type:"null"},e)}function Symbol$1(e){return CreateType({[Kind]:"Symbol",type:"symbol"},e)}function Undefined(e){return CreateType({[Kind]:"Undefined",type:"undefined"},e)}function Uint8Array$1(e){return CreateType({[Kind]:"Uint8Array",type:"Uint8Array"},e)}function Unknown(e){return CreateType({[Kind]:"Unknown"},e)}function FromArray$7(e){return e.map(t=>FromValue(t,!1))}function FromProperties$c(e){const t={};for(const r of globalThis.Object.getOwnPropertyNames(e))t[r]=Readonly(FromValue(e[r],!1));return t}function ConditionalReadonly(e,t){return t===!0?e:Readonly(e)}function FromValue(e,t){return IsAsyncIterator$3(e)||IsIterator$3(e)?ConditionalReadonly(Any(),t):IsArray$3(e)?Readonly(Tuple(FromArray$7(e))):IsUint8Array$3(e)?Uint8Array$1():IsDate$3(e)?Date$1():IsObject$3(e)?ConditionalReadonly(Object$1(FromProperties$c(e)),t):IsFunction$3(e)?ConditionalReadonly(Function$1([],Unknown()),t):IsUndefined$3(e)?Undefined():IsNull$3(e)?Null():IsSymbol$3(e)?Symbol$1():IsBigInt$3(e)?BigInt$2():IsNumber$3(e)||IsBoolean$3(e)||IsString$3(e)?Literal(e):Object$1({})}function Const(e,t){return CreateType(FromValue(e,!0),t)}function ConstructorParameters(e,t){return IsConstructor$1(e)?Tuple(e.parameters,t):Never(t)}function Enum(e,t){if(IsUndefined$3(e))throw new Error("Enum undefined or empty");const r=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),o=[...new Set(r)].map(i=>Literal(i));return Union$1(o,{...t,[Hint]:"Enum"})}class ExtendsResolverError extends TypeBoxError{}var ExtendsResult;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(ExtendsResult||(ExtendsResult={}));function IntoBooleanResult(e){return e===ExtendsResult.False?e:ExtendsResult.True}function Throw(e){throw new ExtendsResolverError(e)}function IsStructuralRight(e){return IsNever(e)||IsIntersect(e)||IsUnion(e)||IsUnknown(e)||IsAny(e)}function StructuralRight(e,t){return IsNever(t)?FromNeverRight():IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)?FromUnionRight(e,t):IsUnknown(t)?FromUnknownRight():IsAny(t)?FromAnyRight():Throw("StructuralRight")}function FromAnyRight(e,t){return ExtendsResult.True}function FromAny$2(e,t){return IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)&&t.anyOf.some(r=>IsAny(r)||IsUnknown(r))?ExtendsResult.True:IsUnion(t)?ExtendsResult.Union:IsUnknown(t)||IsAny(t)?ExtendsResult.True:ExtendsResult.Union}function FromArrayRight(e,t){return IsUnknown(e)?ExtendsResult.False:IsAny(e)?ExtendsResult.Union:IsNever(e)?ExtendsResult.True:ExtendsResult.False}function FromArray$6(e,t){return IsObject(t)&&IsObjectArrayLike(t)?ExtendsResult.True:IsStructuralRight(t)?StructuralRight(e,t):IsArray(t)?IntoBooleanResult(Visit$5(e.items,t.items)):ExtendsResult.False}function FromAsyncIterator$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsAsyncIterator(t)?IntoBooleanResult(Visit$5(e.items,t.items)):ExtendsResult.False}function FromBigInt$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsBigInt(t)?ExtendsResult.True:ExtendsResult.False}function FromBooleanRight(e,t){return IsLiteralBoolean(e)||IsBoolean(e)?ExtendsResult.True:ExtendsResult.False}function FromBoolean$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsBoolean(t)?ExtendsResult.True:ExtendsResult.False}function FromConstructor$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsConstructor(t)?e.parameters.length>t.parameters.length?ExtendsResult.False:e.parameters.every((r,n)=>IntoBooleanResult(Visit$5(t.parameters[n],r))===ExtendsResult.True)?IntoBooleanResult(Visit$5(e.returns,t.returns)):ExtendsResult.False:ExtendsResult.False}function FromDate$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsDate(t)?ExtendsResult.True:ExtendsResult.False}function FromFunction$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsFunction(t)?e.parameters.length>t.parameters.length?ExtendsResult.False:e.parameters.every((r,n)=>IntoBooleanResult(Visit$5(t.parameters[n],r))===ExtendsResult.True)?IntoBooleanResult(Visit$5(e.returns,t.returns)):ExtendsResult.False:ExtendsResult.False}function FromIntegerRight(e,t){return IsLiteral(e)&&IsNumber$3(e.const)||IsNumber(e)||IsInteger(e)?ExtendsResult.True:ExtendsResult.False}function FromInteger$2(e,t){return IsInteger(t)||IsNumber(t)?ExtendsResult.True:IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):ExtendsResult.False}function FromIntersectRight(e,t){return t.allOf.every(r=>Visit$5(e,r)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromIntersect$8(e,t){return e.allOf.some(r=>Visit$5(r,t)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromIterator$5(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsIterator(t)?IntoBooleanResult(Visit$5(e.items,t.items)):ExtendsResult.False}function FromLiteral$2(e,t){return IsLiteral(t)&&t.const===e.const?ExtendsResult.True:IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsString(t)?FromStringRight(e):IsNumber(t)?FromNumberRight(e):IsInteger(t)?FromIntegerRight(e):IsBoolean(t)?FromBooleanRight(e):ExtendsResult.False}function FromNeverRight(e,t){return ExtendsResult.False}function FromNever$2(e,t){return ExtendsResult.True}function UnwrapTNot(e){let[t,r]=[e,0];for(;IsNot(t);)t=t.not,r+=1;return r%2===0?t:Unknown()}function FromNot$4(e,t){return IsNot(e)?Visit$5(UnwrapTNot(e),t):IsNot(t)?Visit$5(e,UnwrapTNot(t)):Throw("Invalid fallthrough for Not")}function FromNull$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsNull(t)?ExtendsResult.True:ExtendsResult.False}function FromNumberRight(e,t){return IsLiteralNumber(e)||IsNumber(e)||IsInteger(e)?ExtendsResult.True:ExtendsResult.False}function FromNumber$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsInteger(t)||IsNumber(t)?ExtendsResult.True:ExtendsResult.False}function IsObjectPropertyCount(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function IsObjectStringLike(e){return IsObjectArrayLike(e)}function IsObjectSymbolLike(e){return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"description"in e.properties&&IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(IsString(e.properties.description.anyOf[0])&&IsUndefined(e.properties.description.anyOf[1])||IsString(e.properties.description.anyOf[1])&&IsUndefined(e.properties.description.anyOf[0]))}function IsObjectNumberLike(e){return IsObjectPropertyCount(e,0)}function IsObjectBooleanLike(e){return IsObjectPropertyCount(e,0)}function IsObjectBigIntLike(e){return IsObjectPropertyCount(e,0)}function IsObjectDateLike(e){return IsObjectPropertyCount(e,0)}function IsObjectUint8ArrayLike(e){return IsObjectArrayLike(e)}function IsObjectFunctionLike(e){const t=Number$1();return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"length"in e.properties&&IntoBooleanResult(Visit$5(e.properties.length,t))===ExtendsResult.True}function IsObjectConstructorLike(e){return IsObjectPropertyCount(e,0)}function IsObjectArrayLike(e){const t=Number$1();return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"length"in e.properties&&IntoBooleanResult(Visit$5(e.properties.length,t))===ExtendsResult.True}function IsObjectPromiseLike(e){const t=Function$1([Any()],Any());return IsObjectPropertyCount(e,0)||IsObjectPropertyCount(e,1)&&"then"in e.properties&&IntoBooleanResult(Visit$5(e.properties.then,t))===ExtendsResult.True}function Property(e,t){return Visit$5(e,t)===ExtendsResult.False||IsOptional(e)&&!IsOptional(t)?ExtendsResult.False:ExtendsResult.True}function FromObjectRight(e,t){return IsUnknown(e)?ExtendsResult.False:IsAny(e)?ExtendsResult.Union:IsNever(e)||IsLiteralString(e)&&IsObjectStringLike(t)||IsLiteralNumber(e)&&IsObjectNumberLike(t)||IsLiteralBoolean(e)&&IsObjectBooleanLike(t)||IsSymbol(e)&&IsObjectSymbolLike(t)||IsBigInt(e)&&IsObjectBigIntLike(t)||IsString(e)&&IsObjectStringLike(t)||IsSymbol(e)&&IsObjectSymbolLike(t)||IsNumber(e)&&IsObjectNumberLike(t)||IsInteger(e)&&IsObjectNumberLike(t)||IsBoolean(e)&&IsObjectBooleanLike(t)||IsUint8Array(e)&&IsObjectUint8ArrayLike(t)||IsDate(e)&&IsObjectDateLike(t)||IsConstructor(e)&&IsObjectConstructorLike(t)||IsFunction(e)&&IsObjectFunctionLike(t)?ExtendsResult.True:IsRecord(e)&&IsString(RecordKey$1(e))?t[Hint]==="Record"?ExtendsResult.True:ExtendsResult.False:IsRecord(e)&&IsNumber(RecordKey$1(e))?IsObjectPropertyCount(t,0)?ExtendsResult.True:ExtendsResult.False:ExtendsResult.False}function FromObject$a(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsObject(t)?(()=>{for(const r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!IsOptional(t.properties[r]))return ExtendsResult.False;if(IsOptional(t.properties[r]))return ExtendsResult.True;if(Property(e.properties[r],t.properties[r])===ExtendsResult.False)return ExtendsResult.False}return ExtendsResult.True})():ExtendsResult.False}function FromPromise$4(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)&&IsObjectPromiseLike(t)?ExtendsResult.True:IsPromise(t)?IntoBooleanResult(Visit$5(e.item,t.item)):ExtendsResult.False}function RecordKey$1(e){return PatternNumberExact in e.patternProperties?Number$1():PatternStringExact in e.patternProperties?String$1():Throw("Unknown record key pattern")}function RecordValue$1(e){return PatternNumberExact in e.patternProperties?e.patternProperties[PatternNumberExact]:PatternStringExact in e.patternProperties?e.patternProperties[PatternStringExact]:Throw("Unable to get record value schema")}function FromRecordRight(e,t){const[r,n]=[RecordKey$1(t),RecordValue$1(t)];return IsLiteralString(e)&&IsNumber(r)&&IntoBooleanResult(Visit$5(e,n))===ExtendsResult.True?ExtendsResult.True:IsUint8Array(e)&&IsNumber(r)||IsString(e)&&IsNumber(r)||IsArray(e)&&IsNumber(r)?Visit$5(e,n):IsObject(e)?(()=>{for(const o of Object.getOwnPropertyNames(e.properties))if(Property(n,e.properties[o])===ExtendsResult.False)return ExtendsResult.False;return ExtendsResult.True})():ExtendsResult.False}function FromRecord$6(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?Visit$5(RecordValue$1(e),RecordValue$1(t)):ExtendsResult.False}function FromRegExp$2(e,t){const r=IsRegExp(e)?String$1():e,n=IsRegExp(t)?String$1():t;return Visit$5(r,n)}function FromStringRight(e,t){return IsLiteral(e)&&IsString$3(e.const)||IsString(e)?ExtendsResult.True:ExtendsResult.False}function FromString$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsString(t)?ExtendsResult.True:ExtendsResult.False}function FromSymbol$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsSymbol(t)?ExtendsResult.True:ExtendsResult.False}function FromTemplateLiteral$3(e,t){return IsTemplateLiteral(e)?Visit$5(TemplateLiteralToUnion(e),t):IsTemplateLiteral(t)?Visit$5(e,TemplateLiteralToUnion(t)):Throw("Invalid fallthrough for TemplateLiteral")}function IsArrayOfTuple(e,t){return IsArray(t)&&e.items!==void 0&&e.items.every(r=>Visit$5(r,t.items)===ExtendsResult.True)}function FromTupleRight(e,t){return IsNever(e)?ExtendsResult.True:IsUnknown(e)?ExtendsResult.False:IsAny(e)?ExtendsResult.Union:ExtendsResult.False}function FromTuple$6(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)&&IsObjectArrayLike(t)||IsArray(t)&&IsArrayOfTuple(e,t)?ExtendsResult.True:IsTuple(t)?IsUndefined$3(e.items)&&!IsUndefined$3(t.items)||!IsUndefined$3(e.items)&&IsUndefined$3(t.items)?ExtendsResult.False:IsUndefined$3(e.items)&&!IsUndefined$3(t.items)||e.items.every((r,n)=>Visit$5(r,t.items[n])===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False:ExtendsResult.False}function FromUint8Array$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsUint8Array(t)?ExtendsResult.True:ExtendsResult.False}function FromUndefined$2(e,t){return IsStructuralRight(t)?StructuralRight(e,t):IsObject(t)?FromObjectRight(e,t):IsRecord(t)?FromRecordRight(e,t):IsVoid(t)?FromVoidRight(e):IsUndefined(t)?ExtendsResult.True:ExtendsResult.False}function FromUnionRight(e,t){return t.anyOf.some(r=>Visit$5(e,r)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromUnion$8(e,t){return e.anyOf.every(r=>Visit$5(r,t)===ExtendsResult.True)?ExtendsResult.True:ExtendsResult.False}function FromUnknownRight(e,t){return ExtendsResult.True}function FromUnknown$2(e,t){return IsNever(t)?FromNeverRight():IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)?FromUnionRight(e,t):IsAny(t)?FromAnyRight():IsString(t)?FromStringRight(e):IsNumber(t)?FromNumberRight(e):IsInteger(t)?FromIntegerRight(e):IsBoolean(t)?FromBooleanRight(e):IsArray(t)?FromArrayRight(e):IsTuple(t)?FromTupleRight(e):IsObject(t)?FromObjectRight(e,t):IsUnknown(t)?ExtendsResult.True:ExtendsResult.False}function FromVoidRight(e,t){return IsUndefined(e)||IsUndefined(e)?ExtendsResult.True:ExtendsResult.False}function FromVoid$2(e,t){return IsIntersect(t)?FromIntersectRight(e,t):IsUnion(t)?FromUnionRight(e,t):IsUnknown(t)?FromUnknownRight():IsAny(t)?FromAnyRight():IsObject(t)?FromObjectRight(e,t):IsVoid(t)?ExtendsResult.True:ExtendsResult.False}function Visit$5(e,t){return IsTemplateLiteral(e)||IsTemplateLiteral(t)?FromTemplateLiteral$3(e,t):IsRegExp(e)||IsRegExp(t)?FromRegExp$2(e,t):IsNot(e)||IsNot(t)?FromNot$4(e,t):IsAny(e)?FromAny$2(e,t):IsArray(e)?FromArray$6(e,t):IsBigInt(e)?FromBigInt$2(e,t):IsBoolean(e)?FromBoolean$2(e,t):IsAsyncIterator(e)?FromAsyncIterator$5(e,t):IsConstructor(e)?FromConstructor$5(e,t):IsDate(e)?FromDate$2(e,t):IsFunction(e)?FromFunction$5(e,t):IsInteger(e)?FromInteger$2(e,t):IsIntersect(e)?FromIntersect$8(e,t):IsIterator(e)?FromIterator$5(e,t):IsLiteral(e)?FromLiteral$2(e,t):IsNever(e)?FromNever$2():IsNull(e)?FromNull$2(e,t):IsNumber(e)?FromNumber$2(e,t):IsObject(e)?FromObject$a(e,t):IsRecord(e)?FromRecord$6(e,t):IsString(e)?FromString$2(e,t):IsSymbol(e)?FromSymbol$2(e,t):IsTuple(e)?FromTuple$6(e,t):IsPromise(e)?FromPromise$4(e,t):IsUint8Array(e)?FromUint8Array$2(e,t):IsUndefined(e)?FromUndefined$2(e,t):IsUnion(e)?FromUnion$8(e,t):IsUnknown(e)?FromUnknown$2(e,t):IsVoid(e)?FromVoid$2(e,t):Throw(`Unknown left type operand '${e[Kind]}'`)}function ExtendsCheck(e,t){return Visit$5(e,t)}function FromProperties$b(e,t,r,n,o){const i={};for(const u of globalThis.Object.getOwnPropertyNames(e))i[u]=Extends(e[u],t,r,n,Clone(o));return i}function FromMappedResult$6(e,t,r,n,o){return FromProperties$b(e.properties,t,r,n,o)}function ExtendsFromMappedResult(e,t,r,n,o){const i=FromMappedResult$6(e,t,r,n,o);return MappedResult(i)}function ExtendsResolve(e,t,r,n){const o=ExtendsCheck(e,t);return o===ExtendsResult.Union?Union$1([r,n]):o===ExtendsResult.True?r:n}function Extends(e,t,r,n,o){return IsMappedResult$1(e)?ExtendsFromMappedResult(e,t,r,n,o):IsMappedKey$1(e)?CreateType(ExtendsFromMappedKey(e,t,r,n,o)):CreateType(ExtendsResolve(e,t,r,n),o)}function FromPropertyKey$2(e,t,r,n,o){return{[e]:Extends(Literal(e),t,r,n,Clone(o))}}function FromPropertyKeys$2(e,t,r,n,o){return e.reduce((i,u)=>({...i,...FromPropertyKey$2(u,t,r,n,o)}),{})}function FromMappedKey$2(e,t,r,n,o){return FromPropertyKeys$2(e.keys,t,r,n,o)}function ExtendsFromMappedKey(e,t,r,n,o){const i=FromMappedKey$2(e,t,r,n,o);return MappedResult(i)}function Intersect(e){return e.allOf.every(t=>ExtendsUndefinedCheck(t))}function Union(e){return e.anyOf.some(t=>ExtendsUndefinedCheck(t))}function Not$1(e){return!ExtendsUndefinedCheck(e.not)}function ExtendsUndefinedCheck(e){return e[Kind]==="Intersect"?Intersect(e):e[Kind]==="Union"?Union(e):e[Kind]==="Not"?Not$1(e):e[Kind]==="Undefined"}function ExcludeFromTemplateLiteral(e,t){return Exclude(TemplateLiteralToUnion(e),t)}function ExcludeRest(e,t){const r=e.filter(n=>ExtendsCheck(n,t)===ExtendsResult.False);return r.length===1?r[0]:Union$1(r)}function Exclude(e,t,r={}){return IsTemplateLiteral$1(e)?CreateType(ExcludeFromTemplateLiteral(e,t),r):IsMappedResult$1(e)?CreateType(ExcludeFromMappedResult(e,t),r):CreateType(IsUnion$1(e)?ExcludeRest(e.anyOf,t):ExtendsCheck(e,t)!==ExtendsResult.False?Never():e,r)}function FromProperties$a(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Exclude(e[n],t);return r}function FromMappedResult$5(e,t){return FromProperties$a(e.properties,t)}function ExcludeFromMappedResult(e,t){const r=FromMappedResult$5(e,t);return MappedResult(r)}function ExtractFromTemplateLiteral(e,t){return Extract(TemplateLiteralToUnion(e),t)}function ExtractRest(e,t){const r=e.filter(n=>ExtendsCheck(n,t)!==ExtendsResult.False);return r.length===1?r[0]:Union$1(r)}function Extract(e,t,r){return IsTemplateLiteral$1(e)?CreateType(ExtractFromTemplateLiteral(e,t),r):IsMappedResult$1(e)?CreateType(ExtractFromMappedResult(e,t),r):CreateType(IsUnion$1(e)?ExtractRest(e.anyOf,t):ExtendsCheck(e,t)!==ExtendsResult.False?e:Never(),r)}function FromProperties$9(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Extract(e[n],t);return r}function FromMappedResult$4(e,t){return FromProperties$9(e.properties,t)}function ExtractFromMappedResult(e,t){const r=FromMappedResult$4(e,t);return MappedResult(r)}function InstanceType(e,t){return IsConstructor$1(e)?CreateType(e.returns,t):Never(t)}function ReadonlyOptional(e){return Readonly(Optional(e))}function RecordCreateFromPattern(e,t,r){return CreateType({[Kind]:"Record",type:"object",patternProperties:{[e]:t}},r)}function RecordCreateFromKeys(e,t,r){const n={};for(const o of e)n[o]=t;return Object$1(n,{...r,[Hint]:"Record"})}function FromTemplateLiteralKey(e,t,r){return IsTemplateLiteralFinite(e)?RecordCreateFromKeys(IndexPropertyKeys(e),t,r):RecordCreateFromPattern(e.pattern,t,r)}function FromUnionKey(e,t,r){return RecordCreateFromKeys(IndexPropertyKeys(Union$1(e)),t,r)}function FromLiteralKey(e,t,r){return RecordCreateFromKeys([e.toString()],t,r)}function FromRegExpKey(e,t,r){return RecordCreateFromPattern(e.source,t,r)}function FromStringKey(e,t,r){const n=IsUndefined$3(e.pattern)?PatternStringExact:e.pattern;return RecordCreateFromPattern(n,t,r)}function FromAnyKey(e,t,r){return RecordCreateFromPattern(PatternStringExact,t,r)}function FromNeverKey(e,t,r){return RecordCreateFromPattern(PatternNeverExact,t,r)}function FromBooleanKey(e,t,r){return Object$1({true:t,false:t},r)}function FromIntegerKey(e,t,r){return RecordCreateFromPattern(PatternNumberExact,t,r)}function FromNumberKey(e,t,r){return RecordCreateFromPattern(PatternNumberExact,t,r)}function Record(e,t,r={}){return IsUnion$1(e)?FromUnionKey(e.anyOf,t,r):IsTemplateLiteral$1(e)?FromTemplateLiteralKey(e,t,r):IsLiteral$1(e)?FromLiteralKey(e.const,t,r):IsBoolean$1(e)?FromBooleanKey(e,t,r):IsInteger$1(e)?FromIntegerKey(e,t,r):IsNumber$1(e)?FromNumberKey(e,t,r):IsRegExp$1(e)?FromRegExpKey(e,t,r):IsString$1(e)?FromStringKey(e,t,r):IsAny$1(e)?FromAnyKey(e,t,r):IsNever$1(e)?FromNeverKey(e,t,r):Never(r)}function RecordPattern(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function RecordKey(e){const t=RecordPattern(e);return t===PatternStringExact?String$1():t===PatternNumberExact?Number$1():String$1({pattern:t})}function RecordValue(e){return e.patternProperties[RecordPattern(e)]}function FromConstructor$4(e,t){return t.parameters=FromTypes$1(e,t.parameters),t.returns=FromType$1(e,t.returns),t}function FromFunction$4(e,t){return t.parameters=FromTypes$1(e,t.parameters),t.returns=FromType$1(e,t.returns),t}function FromIntersect$7(e,t){return t.allOf=FromTypes$1(e,t.allOf),t}function FromUnion$7(e,t){return t.anyOf=FromTypes$1(e,t.anyOf),t}function FromTuple$5(e,t){return IsUndefined$3(t.items)||(t.items=FromTypes$1(e,t.items)),t}function FromArray$5(e,t){return t.items=FromType$1(e,t.items),t}function FromAsyncIterator$4(e,t){return t.items=FromType$1(e,t.items),t}function FromIterator$4(e,t){return t.items=FromType$1(e,t.items),t}function FromPromise$3(e,t){return t.item=FromType$1(e,t.item),t}function FromObject$9(e,t){const r=FromProperties$8(e,t.properties);return{...t,...Object$1(r)}}function FromRecord$5(e,t){const r=FromType$1(e,RecordKey(t)),n=FromType$1(e,RecordValue(t)),o=Record(r,n);return{...t,...o}}function FromArgument$2(e,t){return t.index in e?e[t.index]:Unknown()}function FromProperty$1(e,t){const r=IsReadonly(t),n=IsOptional$1(t),o=FromType$1(e,t);return r&&n?ReadonlyOptional(o):r&&!n?Readonly(o):!r&&n?Optional(o):o}function FromProperties$8(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>({...r,[n]:FromProperty$1(e,t[n])}),{})}function FromTypes$1(e,t){return t.map(r=>FromType$1(e,r))}function FromType$1(e,t){return IsConstructor$1(t)?FromConstructor$4(e,t):IsFunction$1(t)?FromFunction$4(e,t):IsIntersect$1(t)?FromIntersect$7(e,t):IsUnion$1(t)?FromUnion$7(e,t):IsTuple$1(t)?FromTuple$5(e,t):IsArray$1(t)?FromArray$5(e,t):IsAsyncIterator$1(t)?FromAsyncIterator$4(e,t):IsIterator$1(t)?FromIterator$4(e,t):IsPromise$1(t)?FromPromise$3(e,t):IsObject$1(t)?FromObject$9(e,t):IsRecord$1(t)?FromRecord$5(e,t):IsArgument$1(t)?FromArgument$2(e,t):t}function Instantiate(e,t){return FromType$1(t,CloneType(e))}function Integer(e){return CreateType({[Kind]:"Integer",type:"integer"},e)}function MappedIntrinsicPropertyKey(e,t,r){return{[e]:Intrinsic(Literal(e),t,Clone(r))}}function MappedIntrinsicPropertyKeys(e,t,r){return e.reduce((o,i)=>({...o,...MappedIntrinsicPropertyKey(i,t,r)}),{})}function MappedIntrinsicProperties(e,t,r){return MappedIntrinsicPropertyKeys(e.keys,t,r)}function IntrinsicFromMappedKey(e,t,r){const n=MappedIntrinsicProperties(e,t,r);return MappedResult(n)}function ApplyUncapitalize(e){const[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function ApplyCapitalize(e){const[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function ApplyUppercase(e){return e.toUpperCase()}function ApplyLowercase(e){return e.toLowerCase()}function FromTemplateLiteral$2(e,t,r){const n=TemplateLiteralParseExact(e.pattern);if(!IsTemplateLiteralExpressionFinite(n))return{...e,pattern:FromLiteralValue(e.pattern,t)};const u=[...TemplateLiteralExpressionGenerate(n)].map(f=>Literal(f)),a=FromRest$2(u,t),s=Union$1(a);return TemplateLiteral([s],r)}function FromLiteralValue(e,t){return typeof e=="string"?t==="Uncapitalize"?ApplyUncapitalize(e):t==="Capitalize"?ApplyCapitalize(e):t==="Uppercase"?ApplyUppercase(e):t==="Lowercase"?ApplyLowercase(e):e:e.toString()}function FromRest$2(e,t){return e.map(r=>Intrinsic(r,t))}function Intrinsic(e,t,r={}){return IsMappedKey$1(e)?IntrinsicFromMappedKey(e,t,r):IsTemplateLiteral$1(e)?FromTemplateLiteral$2(e,t,r):IsUnion$1(e)?Union$1(FromRest$2(e.anyOf,t),r):IsLiteral$1(e)?Literal(FromLiteralValue(e.const,t),r):CreateType(e,r)}function Capitalize(e,t={}){return Intrinsic(e,"Capitalize",t)}function Lowercase(e,t={}){return Intrinsic(e,"Lowercase",t)}function Uncapitalize(e,t={}){return Intrinsic(e,"Uncapitalize",t)}function Uppercase(e,t={}){return Intrinsic(e,"Uppercase",t)}function FromProperties$7(e,t,r){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Omit(e[o],t,Clone(r));return n}function FromMappedResult$3(e,t,r){return FromProperties$7(e.properties,t,r)}function OmitFromMappedResult(e,t,r){const n=FromMappedResult$3(e,t,r);return MappedResult(n)}function FromIntersect$6(e,t){return e.map(r=>OmitResolve(r,t))}function FromUnion$6(e,t){return e.map(r=>OmitResolve(r,t))}function FromProperty(e,t){const{[t]:r,...n}=e;return n}function FromProperties$6(e,t){return t.reduce((r,n)=>FromProperty(r,n),e)}function FromObject$8(e,t){const r=Discard(e,[TransformKind,"$id","required","properties"]),n=FromProperties$6(e.properties,t);return Object$1(n,r)}function UnionFromPropertyKeys$1(e){const t=e.reduce((r,n)=>IsLiteralValue$1(n)?[...r,Literal(n)]:r,[]);return Union$1(t)}function OmitResolve(e,t){return IsIntersect$1(e)?Intersect$1(FromIntersect$6(e.allOf,t)):IsUnion$1(e)?Union$1(FromUnion$6(e.anyOf,t)):IsObject$1(e)?FromObject$8(e,t):Object$1({})}function Omit(e,t,r){const n=IsArray$3(t)?UnionFromPropertyKeys$1(t):t,o=IsSchema$1(t)?IndexPropertyKeys(t):t,i=IsRef$1(e),u=IsRef$1(t);return IsMappedResult$1(e)?OmitFromMappedResult(e,o,r):IsMappedKey$1(t)?OmitFromMappedKey(e,t,r):i&&u?Computed("Omit",[e,n],r):!i&&u?Computed("Omit",[e,n],r):i&&!u?Computed("Omit",[e,n],r):CreateType({...OmitResolve(e,o),...r})}function FromPropertyKey$1(e,t,r){return{[t]:Omit(e,[t],Clone(r))}}function FromPropertyKeys$1(e,t,r){return t.reduce((n,o)=>({...n,...FromPropertyKey$1(e,o,r)}),{})}function FromMappedKey$1(e,t,r){return FromPropertyKeys$1(e,t.keys,r)}function OmitFromMappedKey(e,t,r){const n=FromMappedKey$1(e,t,r);return MappedResult(n)}function FromProperties$5(e,t,r){const n={};for(const o of globalThis.Object.getOwnPropertyNames(e))n[o]=Pick(e[o],t,Clone(r));return n}function FromMappedResult$2(e,t,r){return FromProperties$5(e.properties,t,r)}function PickFromMappedResult(e,t,r){const n=FromMappedResult$2(e,t,r);return MappedResult(n)}function FromIntersect$5(e,t){return e.map(r=>PickResolve(r,t))}function FromUnion$5(e,t){return e.map(r=>PickResolve(r,t))}function FromProperties$4(e,t){const r={};for(const n of t)n in e&&(r[n]=e[n]);return r}function FromObject$7(e,t){const r=Discard(e,[TransformKind,"$id","required","properties"]),n=FromProperties$4(e.properties,t);return Object$1(n,r)}function UnionFromPropertyKeys(e){const t=e.reduce((r,n)=>IsLiteralValue$1(n)?[...r,Literal(n)]:r,[]);return Union$1(t)}function PickResolve(e,t){return IsIntersect$1(e)?Intersect$1(FromIntersect$5(e.allOf,t)):IsUnion$1(e)?Union$1(FromUnion$5(e.anyOf,t)):IsObject$1(e)?FromObject$7(e,t):Object$1({})}function Pick(e,t,r){const n=IsArray$3(t)?UnionFromPropertyKeys(t):t,o=IsSchema$1(t)?IndexPropertyKeys(t):t,i=IsRef$1(e),u=IsRef$1(t);return IsMappedResult$1(e)?PickFromMappedResult(e,o,r):IsMappedKey$1(t)?PickFromMappedKey(e,t,r):i&&u?Computed("Pick",[e,n],r):!i&&u?Computed("Pick",[e,n],r):i&&!u?Computed("Pick",[e,n],r):CreateType({...PickResolve(e,o),...r})}function FromPropertyKey(e,t,r){return{[t]:Pick(e,[t],Clone(r))}}function FromPropertyKeys(e,t,r){return t.reduce((n,o)=>({...n,...FromPropertyKey(e,o,r)}),{})}function FromMappedKey(e,t,r){return FromPropertyKeys(e,t.keys,r)}function PickFromMappedKey(e,t,r){const n=FromMappedKey(e,t,r);return MappedResult(n)}function FromComputed$2(e,t){return Computed("Partial",[Computed(e,t)])}function FromRef$5(e){return Computed("Partial",[Ref(e)])}function FromProperties$3(e){const t={};for(const r of globalThis.Object.getOwnPropertyNames(e))t[r]=Optional(e[r]);return t}function FromObject$6(e){const t=Discard(e,[TransformKind,"$id","required","properties"]),r=FromProperties$3(e.properties);return Object$1(r,t)}function FromRest$1(e){return e.map(t=>PartialResolve(t))}function PartialResolve(e){return IsComputed$1(e)?FromComputed$2(e.target,e.parameters):IsRef$1(e)?FromRef$5(e.$ref):IsIntersect$1(e)?Intersect$1(FromRest$1(e.allOf)):IsUnion$1(e)?Union$1(FromRest$1(e.anyOf)):IsObject$1(e)?FromObject$6(e):IsBigInt$1(e)||IsBoolean$1(e)||IsInteger$1(e)||IsLiteral$1(e)||IsNull$1(e)||IsNumber$1(e)||IsString$1(e)||IsSymbol$1(e)||IsUndefined$1(e)?e:Object$1({})}function Partial(e,t){return IsMappedResult$1(e)?PartialFromMappedResult(e,t):CreateType({...PartialResolve(e),...t})}function FromProperties$2(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Partial(e[n],Clone(t));return r}function FromMappedResult$1(e,t){return FromProperties$2(e.properties,t)}function PartialFromMappedResult(e,t){const r=FromMappedResult$1(e,t);return MappedResult(r)}function FromComputed$1(e,t){return Computed("Required",[Computed(e,t)])}function FromRef$4(e){return Computed("Required",[Ref(e)])}function FromProperties$1(e){const t={};for(const r of globalThis.Object.getOwnPropertyNames(e))t[r]=Discard(e[r],[OptionalKind]);return t}function FromObject$5(e){const t=Discard(e,[TransformKind,"$id","required","properties"]),r=FromProperties$1(e.properties);return Object$1(r,t)}function FromRest(e){return e.map(t=>RequiredResolve(t))}function RequiredResolve(e){return IsComputed$1(e)?FromComputed$1(e.target,e.parameters):IsRef$1(e)?FromRef$4(e.$ref):IsIntersect$1(e)?Intersect$1(FromRest(e.allOf)):IsUnion$1(e)?Union$1(FromRest(e.anyOf)):IsObject$1(e)?FromObject$5(e):IsBigInt$1(e)||IsBoolean$1(e)||IsInteger$1(e)||IsLiteral$1(e)||IsNull$1(e)||IsNumber$1(e)||IsString$1(e)||IsSymbol$1(e)||IsUndefined$1(e)?e:Object$1({})}function Required(e,t){return IsMappedResult$1(e)?RequiredFromMappedResult(e,t):CreateType({...RequiredResolve(e),...t})}function FromProperties(e,t){const r={};for(const n of globalThis.Object.getOwnPropertyNames(e))r[n]=Required(e[n],t);return r}function FromMappedResult(e,t){return FromProperties(e.properties,t)}function RequiredFromMappedResult(e,t){const r=FromMappedResult(e,t);return MappedResult(r)}function DereferenceParameters(e,t){return t.map(r=>IsRef$1(r)?Dereference(e,r.$ref):FromType(e,r))}function Dereference(e,t){return t in e?IsRef$1(e[t])?Dereference(e,e[t].$ref):FromType(e,e[t]):Never()}function FromAwaited(e){return Awaited(e[0])}function FromIndex(e){return Index(e[0],e[1])}function FromKeyOf(e){return KeyOf(e[0])}function FromPartial(e){return Partial(e[0])}function FromOmit(e){return Omit(e[0],e[1])}function FromPick(e){return Pick(e[0],e[1])}function FromRequired(e){return Required(e[0])}function FromComputed(e,t,r){const n=DereferenceParameters(e,r);return t==="Awaited"?FromAwaited(n):t==="Index"?FromIndex(n):t==="KeyOf"?FromKeyOf(n):t==="Partial"?FromPartial(n):t==="Omit"?FromOmit(n):t==="Pick"?FromPick(n):t==="Required"?FromRequired(n):Never()}function FromArray$4(e,t){return Array$1(FromType(e,t))}function FromAsyncIterator$3(e,t){return AsyncIterator(FromType(e,t))}function FromConstructor$3(e,t,r){return Constructor(FromTypes(e,t),FromType(e,r))}function FromFunction$3(e,t,r){return Function$1(FromTypes(e,t),FromType(e,r))}function FromIntersect$4(e,t){return Intersect$1(FromTypes(e,t))}function FromIterator$3(e,t){return Iterator(FromType(e,t))}function FromObject$4(e,t){return Object$1(globalThis.Object.keys(t).reduce((r,n)=>({...r,[n]:FromType(e,t[n])}),{}))}function FromRecord$4(e,t){const[r,n]=[FromType(e,RecordValue(t)),RecordPattern(t)],o=CloneType(t);return o.patternProperties[n]=r,o}function FromTransform(e,t){return IsRef$1(t)?{...Dereference(e,t.$ref),[TransformKind]:t[TransformKind]}:t}function FromTuple$4(e,t){return Tuple(FromTypes(e,t))}function FromUnion$4(e,t){return Union$1(FromTypes(e,t))}function FromTypes(e,t){return t.map(r=>FromType(e,r))}function FromType(e,t){return IsOptional$1(t)?CreateType(FromType(e,Discard(t,[OptionalKind])),t):IsReadonly(t)?CreateType(FromType(e,Discard(t,[ReadonlyKind])),t):IsTransform$1(t)?CreateType(FromTransform(e,t),t):IsArray$1(t)?CreateType(FromArray$4(e,t.items),t):IsAsyncIterator$1(t)?CreateType(FromAsyncIterator$3(e,t.items),t):IsComputed$1(t)?CreateType(FromComputed(e,t.target,t.parameters)):IsConstructor$1(t)?CreateType(FromConstructor$3(e,t.parameters,t.returns),t):IsFunction$1(t)?CreateType(FromFunction$3(e,t.parameters,t.returns),t):IsIntersect$1(t)?CreateType(FromIntersect$4(e,t.allOf),t):IsIterator$1(t)?CreateType(FromIterator$3(e,t.items),t):IsObject$1(t)?CreateType(FromObject$4(e,t.properties),t):IsRecord$1(t)?CreateType(FromRecord$4(e,t)):IsTuple$1(t)?CreateType(FromTuple$4(e,t.items||[]),t):IsUnion$1(t)?CreateType(FromUnion$4(e,t.anyOf),t):t}function ComputeType(e,t){return t in e?FromType(e,e[t]):Never()}function ComputeModuleProperties(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,r)=>({...t,[r]:ComputeType(e,r)}),{})}class TModule{constructor(t){const r=ComputeModuleProperties(t),n=this.WithIdentifiers(r);this.$defs=n}Import(t,r){const n={...this.$defs,[t]:CreateType(this.$defs[t],r)};return CreateType({[Kind]:"Import",$defs:n,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>({...r,[n]:{...t[n],$id:n}}),{})}}function Module(e){return new TModule(e)}function Not(e,t){return CreateType({[Kind]:"Not",not:e},t)}function Parameters(e,t){return IsFunction$1(e)?Tuple(e.parameters,t):Never()}let Ordinal=0;function Recursive(e,t={}){IsUndefined$3(t.$id)&&(t.$id=`T${Ordinal++}`);const r=CloneType(e({[Kind]:"This",$ref:`${t.$id}`}));return r.$id=t.$id,CreateType({[Hint]:"Recursive",...r},t)}function RegExp$1(e,t){const r=IsString$3(e)?new globalThis.RegExp(e):e;return CreateType({[Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}function RestResolve(e){return IsIntersect$1(e)?e.allOf:IsUnion$1(e)?e.anyOf:IsTuple$1(e)?e.items??[]:[]}function Rest(e){return RestResolve(e)}function ReturnType(e,t){return IsFunction$1(e)?CreateType(e.returns,t):Never(t)}class TransformDecodeBuilder{constructor(t){this.schema=t}Decode(t){return new TransformEncodeBuilder(this.schema,t)}}class TransformEncodeBuilder{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){const i={Encode:u=>r[TransformKind].Encode(t(u)),Decode:u=>this.decode(r[TransformKind].Decode(u))};return{...r,[TransformKind]:i}}EncodeSchema(t,r){const n={Decode:this.decode,Encode:t};return{...r,[TransformKind]:n}}Encode(t){return IsTransform$1(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}}function Transform(e){return new TransformDecodeBuilder(e)}function Unsafe(e={}){return CreateType({[Kind]:e[Kind]??"Unsafe"},e)}function Void(e){return CreateType({[Kind]:"Void",type:"void"},e)}const TypeBuilder=Object.freeze(Object.defineProperty({__proto__:null,Any,Argument,Array:Array$1,AsyncIterator,Awaited,BigInt:BigInt$2,Boolean:Boolean$1,Capitalize,Composite,Const,Constructor,ConstructorParameters,Date:Date$1,Enum,Exclude,Extends,Extract,Function:Function$1,Index,InstanceType,Instantiate,Integer,Intersect:Intersect$1,Iterator,KeyOf,Literal,Lowercase,Mapped,Module,Never,Not,Null,Number:Number$1,Object:Object$1,Omit,Optional,Parameters,Partial,Pick,Promise:Promise$1,Readonly,ReadonlyOptional,Record,Recursive,Ref,RegExp:RegExp$1,Required,Rest,ReturnType,String:String$1,Symbol:Symbol$1,TemplateLiteral,Transform,Tuple,Uint8Array:Uint8Array$1,Uncapitalize,Undefined,Union:Union$1,Unknown,Unsafe,Uppercase,Void},Symbol.toStringTag,{value:"Module"})),Type=TypeBuilder;function DefaultErrorFunction(e){switch(e.errorType){case ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case ValueErrorType.Array:return"Expected array";case ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case ValueErrorType.BigInt:return"Expected bigint";case ValueErrorType.Boolean:return"Expected boolean";case ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case ValueErrorType.Date:return"Expected Date";case ValueErrorType.Function:return"Expected function";case ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case ValueErrorType.Integer:return"Expected integer";case ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case ValueErrorType.Intersect:return"Expected all values to match";case ValueErrorType.Iterator:return"Expected Iterator";case ValueErrorType.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case ValueErrorType.Never:return"Never";case ValueErrorType.Not:return"Value should not match";case ValueErrorType.Null:return"Expected null";case ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case ValueErrorType.Number:return"Expected number";case ValueErrorType.Object:return"Expected object";case ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case ValueErrorType.ObjectRequiredProperty:return"Expected required property";case ValueErrorType.Promise:return"Expected Promise";case ValueErrorType.RegExp:return"Expected string to match regular expression";case ValueErrorType.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case ValueErrorType.StringFormat:return`Expected string to match '${e.schema.format}' format`;case ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case ValueErrorType.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case ValueErrorType.String:return"Expected string";case ValueErrorType.Symbol:return"Expected symbol";case ValueErrorType.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case ValueErrorType.Tuple:return"Expected tuple";case ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case ValueErrorType.Uint8Array:return"Expected Uint8Array";case ValueErrorType.Undefined:return"Expected undefined";case ValueErrorType.Union:return"Expected union value";case ValueErrorType.Void:return"Expected void";case ValueErrorType.Kind:return`Expected kind '${e.schema[Kind]}'`;default:return"Unknown error type"}}let errorFunction=DefaultErrorFunction;function GetErrorFunction(){return errorFunction}class TypeDereferenceError extends TypeBoxError{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`),this.schema=t}}function Resolve(e,t){const r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new TypeDereferenceError(e);return Deref(r,t)}function Pushref(e,t){return!IsString$2(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function Deref(e,t){return e[Kind]==="This"||e[Kind]==="Ref"?Resolve(e,t):e}class ValueHashError extends TypeBoxError{constructor(t){super("Unable to hash value"),this.value=t}}var ByteMarker;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(ByteMarker||(ByteMarker={}));let Accumulator=BigInt("14695981039346656037");const[Prime,Size]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Bytes=Array.from({length:256}).map((e,t)=>BigInt(t)),F64=new Float64Array(1),F64In=new DataView(F64.buffer),F64Out=new Uint8Array(F64.buffer);function*NumberToBytes(e){const t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}function ArrayType(e){FNV1A64(ByteMarker.Array);for(const t of e)Visit$4(t)}function BooleanType(e){FNV1A64(ByteMarker.Boolean),FNV1A64(e?1:0)}function BigIntType(e){FNV1A64(ByteMarker.BigInt),F64In.setBigInt64(0,e);for(const t of F64Out)FNV1A64(t)}function DateType(e){FNV1A64(ByteMarker.Date),Visit$4(e.getTime())}function NullType(e){FNV1A64(ByteMarker.Null)}function NumberType(e){FNV1A64(ByteMarker.Number),F64In.setFloat64(0,e);for(const t of F64Out)FNV1A64(t)}function ObjectType(e){FNV1A64(ByteMarker.Object);for(const t of globalThis.Object.getOwnPropertyNames(e).sort())Visit$4(t),Visit$4(e[t])}function StringType(e){FNV1A64(ByteMarker.String);for(let t=0;t<e.length;t++)for(const r of NumberToBytes(e.charCodeAt(t)))FNV1A64(r)}function SymbolType(e){FNV1A64(ByteMarker.Symbol),Visit$4(e.description)}function Uint8ArrayType(e){FNV1A64(ByteMarker.Uint8Array);for(let t=0;t<e.length;t++)FNV1A64(e[t])}function UndefinedType(e){return FNV1A64(ByteMarker.Undefined)}function Visit$4(e){if(IsArray$2(e))return ArrayType(e);if(IsBoolean$2(e))return BooleanType(e);if(IsBigInt$2(e))return BigIntType(e);if(IsDate$2(e))return DateType(e);if(IsNull$2(e))return NullType();if(IsNumber$2(e))return NumberType(e);if(IsObject$2(e))return ObjectType(e);if(IsString$2(e))return StringType(e);if(IsSymbol$2(e))return SymbolType(e);if(IsUint8Array$2(e))return Uint8ArrayType(e);if(IsUndefined$2(e))return UndefinedType();throw new ValueHashError(e)}function FNV1A64(e){Accumulator=Accumulator^Bytes[e],Accumulator=Accumulator*Prime%Size}function Hash$1(e){return Accumulator=BigInt("14695981039346656037"),Visit$4(e),Accumulator}class ValueCheckUnknownTypeError extends TypeBoxError{constructor(t){super("Unknown type"),this.schema=t}}function IsAnyOrUnknown(e){return e[Kind]==="Any"||e[Kind]==="Unknown"}function IsDefined$1(e){return e!==void 0}function FromAny$1(e,t,r){return!0}function FromArgument$1(e,t,r){return!0}function FromArray$3(e,t,r){if(!IsArray$2(r)||IsDefined$1(e.minItems)&&!(r.length>=e.minItems)||IsDefined$1(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>Visit$3(e.items,t,i))||e.uniqueItems===!0&&!(function(){const i=new Set;for(const u of r){const a=Hash$1(u);if(i.has(a))return!1;i.add(a)}return!0})())return!1;if(!(IsDefined$1(e.contains)||IsNumber$2(e.minContains)||IsNumber$2(e.maxContains)))return!0;const n=IsDefined$1(e.contains)?e.contains:Never(),o=r.reduce((i,u)=>Visit$3(n,t,u)?i+1:i,0);return!(o===0||IsNumber$2(e.minContains)&&o<e.minContains||IsNumber$2(e.maxContains)&&o>e.maxContains)}function FromAsyncIterator$2(e,t,r){return IsAsyncIterator$2(r)}function FromBigInt$1(e,t,r){return!(!IsBigInt$2(r)||IsDefined$1(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||IsDefined$1(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||IsDefined$1(e.maximum)&&!(r<=e.maximum)||IsDefined$1(e.minimum)&&!(r>=e.minimum)||IsDefined$1(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function FromBoolean$1(e,t,r){return IsBoolean$2(r)}function FromConstructor$2(e,t,r){return Visit$3(e.returns,t,r.prototype)}function FromDate$1(e,t,r){return!(!IsDate$2(r)||IsDefined$1(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||IsDefined$1(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||IsDefined$1(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||IsDefined$1(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||IsDefined$1(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function FromFunction$2(e,t,r){return IsFunction$2(r)}function FromImport$3(e,t,r){const n=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return Visit$3(o,[...t,...n],r)}function FromInteger$1(e,t,r){return!(!IsInteger$2(r)||IsDefined$1(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||IsDefined$1(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||IsDefined$1(e.maximum)&&!(r<=e.maximum)||IsDefined$1(e.minimum)&&!(r>=e.minimum)||IsDefined$1(e.multipleOf)&&r%e.multipleOf!==0)}function FromIntersect$3(e,t,r){const n=e.allOf.every(o=>Visit$3(o,t,r));if(e.unevaluatedProperties===!1){const o=new RegExp(KeyOfPattern(e)),i=Object.getOwnPropertyNames(r).every(u=>o.test(u));return n&&i}else if(IsSchema$1(e.unevaluatedProperties)){const o=new RegExp(KeyOfPattern(e)),i=Object.getOwnPropertyNames(r).every(u=>o.test(u)||Visit$3(e.unevaluatedProperties,t,r[u]));return n&&i}else return n}function FromIterator$2(e,t,r){return IsIterator$2(r)}function FromLiteral$1(e,t,r){return r===e.const}function FromNever$1(e,t,r){return!1}function FromNot$3(e,t,r){return!Visit$3(e.not,t,r)}function FromNull$1(e,t,r){return IsNull$2(r)}function FromNumber$1(e,t,r){return!(!TypeSystemPolicy.IsNumberLike(r)||IsDefined$1(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||IsDefined$1(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||IsDefined$1(e.minimum)&&!(r>=e.minimum)||IsDefined$1(e.maximum)&&!(r<=e.maximum)||IsDefined$1(e.multipleOf)&&r%e.multipleOf!==0)}function FromObject$3(e,t,r){if(!TypeSystemPolicy.IsObjectLike(r)||IsDefined$1(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||IsDefined$1(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;const n=Object.getOwnPropertyNames(e.properties);for(const o of n){const i=e.properties[o];if(e.required&&e.required.includes(o)){if(!Visit$3(i,t,r[o])||(ExtendsUndefinedCheck(i)||IsAnyOrUnknown(i))&&!(o in r))return!1}else if(TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Visit$3(i,t,r[o]))return!1}if(e.additionalProperties===!1){const o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&o.length===n.length?!0:o.every(i=>n.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(i=>n.includes(i)||Visit$3(e.additionalProperties,t,r[i])):!0}function FromPromise$2(e,t,r){return IsPromise$2(r)}function FromRecord$3(e,t,r){if(!TypeSystemPolicy.IsRecordLike(r)||IsDefined$1(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||IsDefined$1(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;const[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),u=Object.entries(r).every(([f,c])=>i.test(f)?Visit$3(o,t,c):!0),a=typeof e.additionalProperties=="object"?Object.entries(r).every(([f,c])=>i.test(f)?!0:Visit$3(e.additionalProperties,t,c)):!0,s=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(f=>i.test(f)):!0;return u&&a&&s}function FromRef$3(e,t,r){return Visit$3(Deref(e,t),t,r)}function FromRegExp$1(e,t,r){const n=new RegExp(e.source,e.flags);return IsDefined$1(e.minLength)&&!(r.length>=e.minLength)||IsDefined$1(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}function FromString$1(e,t,r){return!IsString$2(r)||IsDefined$1(e.minLength)&&!(r.length>=e.minLength)||IsDefined$1(e.maxLength)&&!(r.length<=e.maxLength)||IsDefined$1(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:IsDefined$1(e.format)?Has$1(e.format)?Get$1(e.format)(r):!1:!0}function FromSymbol$1(e,t,r){return IsSymbol$2(r)}function FromTemplateLiteral$1(e,t,r){return IsString$2(r)&&new RegExp(e.pattern).test(r)}function FromThis$3(e,t,r){return Visit$3(Deref(e,t),t,r)}function FromTuple$3(e,t,r){if(!IsArray$2(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!Visit$3(e.items[n],t,r[n]))return!1;return!0}function FromUndefined$1(e,t,r){return IsUndefined$2(r)}function FromUnion$3(e,t,r){return e.anyOf.some(n=>Visit$3(n,t,r))}function FromUint8Array$1(e,t,r){return!(!IsUint8Array$2(r)||IsDefined$1(e.maxByteLength)&&!(r.length<=e.maxByteLength)||IsDefined$1(e.minByteLength)&&!(r.length>=e.minByteLength))}function FromUnknown$1(e,t,r){return!0}function FromVoid$1(e,t,r){return TypeSystemPolicy.IsVoidLike(r)}function FromKind$1(e,t,r){return Has(e[Kind])?Get(e[Kind])(e,r):!1}function Visit$3(e,t,r){const n=IsDefined$1(e.$id)?Pushref(e,t):t,o=e;switch(o[Kind]){case"Any":return FromAny$1();case"Argument":return FromArgument$1();case"Array":return FromArray$3(o,n,r);case"AsyncIterator":return FromAsyncIterator$2(o,n,r);case"BigInt":return FromBigInt$1(o,n,r);case"Boolean":return FromBoolean$1(o,n,r);case"Constructor":return FromConstructor$2(o,n,r);case"Date":return FromDate$1(o,n,r);case"Function":return FromFunction$2(o,n,r);case"Import":return FromImport$3(o,n,r);case"Integer":return FromInteger$1(o,n,r);case"Intersect":return FromIntersect$3(o,n,r);case"Iterator":return FromIterator$2(o,n,r);case"Literal":return FromLiteral$1(o,n,r);case"Never":return FromNever$1();case"Not":return FromNot$3(o,n,r);case"Null":return FromNull$1(o,n,r);case"Number":return FromNumber$1(o,n,r);case"Object":return FromObject$3(o,n,r);case"Promise":return FromPromise$2(o,n,r);case"Record":return FromRecord$3(o,n,r);case"Ref":return FromRef$3(o,n,r);case"RegExp":return FromRegExp$1(o,n,r);case"String":return FromString$1(o,n,r);case"Symbol":return FromSymbol$1(o,n,r);case"TemplateLiteral":return FromTemplateLiteral$1(o,n,r);case"This":return FromThis$3(o,n,r);case"Tuple":return FromTuple$3(o,n,r);case"Undefined":return FromUndefined$1(o,n,r);case"Union":return FromUnion$3(o,n,r);case"Uint8Array":return FromUint8Array$1(o,n,r);case"Unknown":return FromUnknown$1();case"Void":return FromVoid$1(o,n,r);default:if(!Has(o[Kind]))throw new ValueCheckUnknownTypeError(o);return FromKind$1(o,n,r)}}function Check(...e){return e.length===3?Visit$3(e[0],e[1],e[2]):Visit$3(e[0],[],e[1])}var ValueErrorType;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(ValueErrorType||(ValueErrorType={}));class ValueErrorsUnknownTypeError extends TypeBoxError{constructor(t){super("Unknown type"),this.schema=t}}function EscapeKey(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function IsDefined(e){return e!==void 0}class ValueErrorIterator{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){const t=this.iterator.next();return t.done?void 0:t.value}}function Create(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:GetErrorFunction()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}function*FromAny(e,t,r,n){}function*FromArgument(e,t,r,n){}function*FromArray$2(e,t,r,n){if(!IsArray$2(n))return yield Create(ValueErrorType.Array,e,r,n);IsDefined(e.minItems)&&!(n.length>=e.minItems)&&(yield Create(ValueErrorType.ArrayMinItems,e,r,n)),IsDefined(e.maxItems)&&!(n.length<=e.maxItems)&&(yield Create(ValueErrorType.ArrayMaxItems,e,r,n));for(let u=0;u<n.length;u++)yield*Visit$2(e.items,t,`${r}/${u}`,n[u]);if(e.uniqueItems===!0&&!(function(){const u=new Set;for(const a of n){const s=Hash$1(a);if(u.has(s))return!1;u.add(s)}return!0})()&&(yield Create(ValueErrorType.ArrayUniqueItems,e,r,n)),!(IsDefined(e.contains)||IsDefined(e.minContains)||IsDefined(e.maxContains)))return;const o=IsDefined(e.contains)?e.contains:Never(),i=n.reduce((u,a,s)=>Visit$2(o,t,`${r}${s}`,a).next().done===!0?u+1:u,0);i===0&&(yield Create(ValueErrorType.ArrayContains,e,r,n)),IsNumber$2(e.minContains)&&i<e.minContains&&(yield Create(ValueErrorType.ArrayMinContains,e,r,n)),IsNumber$2(e.maxContains)&&i>e.maxContains&&(yield Create(ValueErrorType.ArrayMaxContains,e,r,n))}function*FromAsyncIterator$1(e,t,r,n){IsAsyncIterator$2(n)||(yield Create(ValueErrorType.AsyncIterator,e,r,n))}function*FromBigInt(e,t,r,n){if(!IsBigInt$2(n))return yield Create(ValueErrorType.BigInt,e,r,n);IsDefined(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Create(ValueErrorType.BigIntExclusiveMaximum,e,r,n)),IsDefined(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Create(ValueErrorType.BigIntExclusiveMinimum,e,r,n)),IsDefined(e.maximum)&&!(n<=e.maximum)&&(yield Create(ValueErrorType.BigIntMaximum,e,r,n)),IsDefined(e.minimum)&&!(n>=e.minimum)&&(yield Create(ValueErrorType.BigIntMinimum,e,r,n)),IsDefined(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield Create(ValueErrorType.BigIntMultipleOf,e,r,n))}function*FromBoolean(e,t,r,n){IsBoolean$2(n)||(yield Create(ValueErrorType.Boolean,e,r,n))}function*FromConstructor$1(e,t,r,n){yield*Visit$2(e.returns,t,r,n.prototype)}function*FromDate(e,t,r,n){if(!IsDate$2(n))return yield Create(ValueErrorType.Date,e,r,n);IsDefined(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield Create(ValueErrorType.DateExclusiveMaximumTimestamp,e,r,n)),IsDefined(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield Create(ValueErrorType.DateExclusiveMinimumTimestamp,e,r,n)),IsDefined(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield Create(ValueErrorType.DateMaximumTimestamp,e,r,n)),IsDefined(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield Create(ValueErrorType.DateMinimumTimestamp,e,r,n)),IsDefined(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield Create(ValueErrorType.DateMultipleOfTimestamp,e,r,n))}function*FromFunction$1(e,t,r,n){IsFunction$2(n)||(yield Create(ValueErrorType.Function,e,r,n))}function*FromImport$2(e,t,r,n){const o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];yield*Visit$2(i,[...t,...o],r,n)}function*FromInteger(e,t,r,n){if(!IsInteger$2(n))return yield Create(ValueErrorType.Integer,e,r,n);IsDefined(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Create(ValueErrorType.IntegerExclusiveMaximum,e,r,n)),IsDefined(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Create(ValueErrorType.IntegerExclusiveMinimum,e,r,n)),IsDefined(e.maximum)&&!(n<=e.maximum)&&(yield Create(ValueErrorType.IntegerMaximum,e,r,n)),IsDefined(e.minimum)&&!(n>=e.minimum)&&(yield Create(ValueErrorType.IntegerMinimum,e,r,n)),IsDefined(e.multipleOf)&&n%e.multipleOf!==0&&(yield Create(ValueErrorType.IntegerMultipleOf,e,r,n))}function*FromIntersect$2(e,t,r,n){let o=!1;for(const i of e.allOf)for(const u of Visit$2(i,t,r,n))o=!0,yield u;if(o)return yield Create(ValueErrorType.Intersect,e,r,n);if(e.unevaluatedProperties===!1){const i=new RegExp(KeyOfPattern(e));for(const u of Object.getOwnPropertyNames(n))i.test(u)||(yield Create(ValueErrorType.IntersectUnevaluatedProperties,e,`${r}/${u}`,n))}if(typeof e.unevaluatedProperties=="object"){const i=new RegExp(KeyOfPattern(e));for(const u of Object.getOwnPropertyNames(n))if(!i.test(u)){const a=Visit$2(e.unevaluatedProperties,t,`${r}/${u}`,n[u]).next();a.done||(yield a.value)}}}function*FromIterator$1(e,t,r,n){IsIterator$2(n)||(yield Create(ValueErrorType.Iterator,e,r,n))}function*FromLiteral(e,t,r,n){n!==e.const&&(yield Create(ValueErrorType.Literal,e,r,n))}function*FromNever(e,t,r,n){yield Create(ValueErrorType.Never,e,r,n)}function*FromNot$2(e,t,r,n){Visit$2(e.not,t,r,n).next().done===!0&&(yield Create(ValueErrorType.Not,e,r,n))}function*FromNull(e,t,r,n){IsNull$2(n)||(yield Create(ValueErrorType.Null,e,r,n))}function*FromNumber(e,t,r,n){if(!TypeSystemPolicy.IsNumberLike(n))return yield Create(ValueErrorType.Number,e,r,n);IsDefined(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Create(ValueErrorType.NumberExclusiveMaximum,e,r,n)),IsDefined(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Create(ValueErrorType.NumberExclusiveMinimum,e,r,n)),IsDefined(e.maximum)&&!(n<=e.maximum)&&(yield Create(ValueErrorType.NumberMaximum,e,r,n)),IsDefined(e.minimum)&&!(n>=e.minimum)&&(yield Create(ValueErrorType.NumberMinimum,e,r,n)),IsDefined(e.multipleOf)&&n%e.multipleOf!==0&&(yield Create(ValueErrorType.NumberMultipleOf,e,r,n))}function*FromObject$2(e,t,r,n){if(!TypeSystemPolicy.IsObjectLike(n))return yield Create(ValueErrorType.Object,e,r,n);IsDefined(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield Create(ValueErrorType.ObjectMinProperties,e,r,n)),IsDefined(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield Create(ValueErrorType.ObjectMaxProperties,e,r,n));const o=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),u=Object.getOwnPropertyNames(n);for(const a of o)u.includes(a)||(yield Create(ValueErrorType.ObjectRequiredProperty,e.properties[a],`${r}/${EscapeKey(a)}`,void 0));if(e.additionalProperties===!1)for(const a of u)i.includes(a)||(yield Create(ValueErrorType.ObjectAdditionalProperties,e,`${r}/${EscapeKey(a)}`,n[a]));if(typeof e.additionalProperties=="object")for(const a of u)i.includes(a)||(yield*Visit$2(e.additionalProperties,t,`${r}/${EscapeKey(a)}`,n[a]));for(const a of i){const s=e.properties[a];e.required&&e.required.includes(a)?(yield*Visit$2(s,t,`${r}/${EscapeKey(a)}`,n[a]),ExtendsUndefinedCheck(e)&&!(a in n)&&(yield Create(ValueErrorType.ObjectRequiredProperty,s,`${r}/${EscapeKey(a)}`,void 0))):TypeSystemPolicy.IsExactOptionalProperty(n,a)&&(yield*Visit$2(s,t,`${r}/${EscapeKey(a)}`,n[a]))}}function*FromPromise$1(e,t,r,n){IsPromise$2(n)||(yield Create(ValueErrorType.Promise,e,r,n))}function*FromRecord$2(e,t,r,n){if(!TypeSystemPolicy.IsRecordLike(n))return yield Create(ValueErrorType.Object,e,r,n);IsDefined(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield Create(ValueErrorType.ObjectMinProperties,e,r,n)),IsDefined(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield Create(ValueErrorType.ObjectMaxProperties,e,r,n));const[o,i]=Object.entries(e.patternProperties)[0],u=new RegExp(o);for(const[a,s]of Object.entries(n))u.test(a)&&(yield*Visit$2(i,t,`${r}/${EscapeKey(a)}`,s));if(typeof e.additionalProperties=="object")for(const[a,s]of Object.entries(n))u.test(a)||(yield*Visit$2(e.additionalProperties,t,`${r}/${EscapeKey(a)}`,s));if(e.additionalProperties===!1){for(const[a,s]of Object.entries(n))if(!u.test(a))return yield Create(ValueErrorType.ObjectAdditionalProperties,e,`${r}/${EscapeKey(a)}`,s)}}function*FromRef$2(e,t,r,n){yield*Visit$2(Deref(e,t),t,r,n)}function*FromRegExp(e,t,r,n){if(!IsString$2(n))return yield Create(ValueErrorType.String,e,r,n);if(IsDefined(e.minLength)&&!(n.length>=e.minLength)&&(yield Create(ValueErrorType.StringMinLength,e,r,n)),IsDefined(e.maxLength)&&!(n.length<=e.maxLength)&&(yield Create(ValueErrorType.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield Create(ValueErrorType.RegExp,e,r,n)}function*FromString(e,t,r,n){if(!IsString$2(n))return yield Create(ValueErrorType.String,e,r,n);IsDefined(e.minLength)&&!(n.length>=e.minLength)&&(yield Create(ValueErrorType.StringMinLength,e,r,n)),IsDefined(e.maxLength)&&!(n.length<=e.maxLength)&&(yield Create(ValueErrorType.StringMaxLength,e,r,n)),IsString$2(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield Create(ValueErrorType.StringPattern,e,r,n))),IsString$2(e.format)&&(Has$1(e.format)?Get$1(e.format)(n)||(yield Create(ValueErrorType.StringFormat,e,r,n)):yield Create(ValueErrorType.StringFormatUnknown,e,r,n))}function*FromSymbol(e,t,r,n){IsSymbol$2(n)||(yield Create(ValueErrorType.Symbol,e,r,n))}function*FromTemplateLiteral(e,t,r,n){if(!IsString$2(n))return yield Create(ValueErrorType.String,e,r,n);new RegExp(e.pattern).test(n)||(yield Create(ValueErrorType.StringPattern,e,r,n))}function*FromThis$2(e,t,r,n){yield*Visit$2(Deref(e,t),t,r,n)}function*FromTuple$2(e,t,r,n){if(!IsArray$2(n))return yield Create(ValueErrorType.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield Create(ValueErrorType.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield Create(ValueErrorType.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*Visit$2(e.items[o],t,`${r}/${o}`,n[o])}function*FromUndefined(e,t,r,n){IsUndefined$2(n)||(yield Create(ValueErrorType.Undefined,e,r,n))}function*FromUnion$2(e,t,r,n){if(Check(e,t,n))return;const o=e.anyOf.map(i=>new ValueErrorIterator(Visit$2(i,t,r,n)));yield Create(ValueErrorType.Union,e,r,n,o)}function*FromUint8Array(e,t,r,n){if(!IsUint8Array$2(n))return yield Create(ValueErrorType.Uint8Array,e,r,n);IsDefined(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield Create(ValueErrorType.Uint8ArrayMaxByteLength,e,r,n)),IsDefined(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield Create(ValueErrorType.Uint8ArrayMinByteLength,e,r,n))}function*FromUnknown(e,t,r,n){}function*FromVoid(e,t,r,n){TypeSystemPolicy.IsVoidLike(n)||(yield Create(ValueErrorType.Void,e,r,n))}function*FromKind(e,t,r,n){Get(e[Kind])(e,n)||(yield Create(ValueErrorType.Kind,e,r,n))}function*Visit$2(e,t,r,n){const o=IsDefined(e.$id)?[...t,e]:t,i=e;switch(i[Kind]){case"Any":return yield*FromAny();case"Argument":return yield*FromArgument();case"Array":return yield*FromArray$2(i,o,r,n);case"AsyncIterator":return yield*FromAsyncIterator$1(i,o,r,n);case"BigInt":return yield*FromBigInt(i,o,r,n);case"Boolean":return yield*FromBoolean(i,o,r,n);case"Constructor":return yield*FromConstructor$1(i,o,r,n);case"Date":return yield*FromDate(i,o,r,n);case"Function":return yield*FromFunction$1(i,o,r,n);case"Import":return yield*FromImport$2(i,o,r,n);case"Integer":return yield*FromInteger(i,o,r,n);case"Intersect":return yield*FromIntersect$2(i,o,r,n);case"Iterator":return yield*FromIterator$1(i,o,r,n);case"Literal":return yield*FromLiteral(i,o,r,n);case"Never":return yield*FromNever(i,o,r,n);case"Not":return yield*FromNot$2(i,o,r,n);case"Null":return yield*FromNull(i,o,r,n);case"Number":return yield*FromNumber(i,o,r,n);case"Object":return yield*FromObject$2(i,o,r,n);case"Promise":return yield*FromPromise$1(i,o,r,n);case"Record":return yield*FromRecord$2(i,o,r,n);case"Ref":return yield*FromRef$2(i,o,r,n);case"RegExp":return yield*FromRegExp(i,o,r,n);case"String":return yield*FromString(i,o,r,n);case"Symbol":return yield*FromSymbol(i,o,r,n);case"TemplateLiteral":return yield*FromTemplateLiteral(i,o,r,n);case"This":return yield*FromThis$2(i,o,r,n);case"Tuple":return yield*FromTuple$2(i,o,r,n);case"Undefined":return yield*FromUndefined(i,o,r,n);case"Union":return yield*FromUnion$2(i,o,r,n);case"Uint8Array":return yield*FromUint8Array(i,o,r,n);case"Unknown":return yield*FromUnknown();case"Void":return yield*FromVoid(i,o,r,n);default:if(!Has(i[Kind]))throw new ValueErrorsUnknownTypeError(e);return yield*FromKind(i,o,r,n)}}function Errors(...e){const t=e.length===3?Visit$2(e[0],e[1],"",e[2]):Visit$2(e[0],[],"",e[1]);return new ValueErrorIterator(t)}class TransformDecodeCheckError extends TypeBoxError{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}}class TransformDecodeError extends TypeBoxError{constructor(t,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=o}}function Default(e,t,r){try{return IsTransform$1(e)?e[TransformKind].Decode(r):r}catch(n){throw new TransformDecodeError(e,t,r,n)}}function FromArray$1(e,t,r,n){return IsArray$2(n)?Default(e,r,n.map((o,i)=>Visit$1(e.items,t,`${r}/${i}`,o))):Default(e,r,n)}function FromIntersect$1(e,t,r,n){if(!IsObject$2(n)||IsValueType(n))return Default(e,r,n);const o=KeyOfPropertyEntries(e),i=o.map(c=>c[0]),u={...n};for(const[c,d]of o)c in u&&(u[c]=Visit$1(d,t,`${r}/${c}`,u[c]));if(!IsTransform$1(e.unevaluatedProperties))return Default(e,r,u);const a=Object.getOwnPropertyNames(u),s=e.unevaluatedProperties,f={...u};for(const c of a)i.includes(c)||(f[c]=Default(s,`${r}/${c}`,f[c]));return Default(e,r,f)}function FromImport$1(e,t,r,n){const o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref],u=Visit$1(i,[...t,...o],r,n);return Default(e,r,u)}function FromNot$1(e,t,r,n){return Default(e,r,Visit$1(e.not,t,r,n))}function FromObject$1(e,t,r,n){if(!IsObject$2(n))return Default(e,r,n);const o=KeyOfPropertyKeys(e),i={...n};for(const f of o)HasPropertyKey(i,f)&&(IsUndefined$2(i[f])&&(!IsUndefined$1(e.properties[f])||TypeSystemPolicy.IsExactOptionalProperty(i,f))||(i[f]=Visit$1(e.properties[f],t,`${r}/${f}`,i[f])));if(!IsSchema$1(e.additionalProperties))return Default(e,r,i);const u=Object.getOwnPropertyNames(i),a=e.additionalProperties,s={...i};for(const f of u)o.includes(f)||(s[f]=Default(a,`${r}/${f}`,s[f]));return Default(e,r,s)}function FromRecord$1(e,t,r,n){if(!IsObject$2(n))return Default(e,r,n);const o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),u={...n};for(const c of Object.getOwnPropertyNames(n))i.test(c)&&(u[c]=Visit$1(e.patternProperties[o],t,`${r}/${c}`,u[c]));if(!IsSchema$1(e.additionalProperties))return Default(e,r,u);const a=Object.getOwnPropertyNames(u),s=e.additionalProperties,f={...u};for(const c of a)i.test(c)||(f[c]=Default(s,`${r}/${c}`,f[c]));return Default(e,r,f)}function FromRef$1(e,t,r,n){const o=Deref(e,t);return Default(e,r,Visit$1(o,t,r,n))}function FromThis$1(e,t,r,n){const o=Deref(e,t);return Default(e,r,Visit$1(o,t,r,n))}function FromTuple$1(e,t,r,n){return IsArray$2(n)&&IsArray$2(e.items)?Default(e,r,e.items.map((o,i)=>Visit$1(o,t,`${r}/${i}`,n[i]))):Default(e,r,n)}function FromUnion$1(e,t,r,n){for(const o of e.anyOf){if(!Check(o,t,n))continue;const i=Visit$1(o,t,r,n);return Default(e,r,i)}return Default(e,r,n)}function Visit$1(e,t,r,n){const o=Pushref(e,t),i=e;switch(e[Kind]){case"Array":return FromArray$1(i,o,r,n);case"Import":return FromImport$1(i,o,r,n);case"Intersect":return FromIntersect$1(i,o,r,n);case"Not":return FromNot$1(i,o,r,n);case"Object":return FromObject$1(i,o,r,n);case"Record":return FromRecord$1(i,o,r,n);case"Ref":return FromRef$1(i,o,r,n);case"Symbol":return Default(i,r,n);case"This":return FromThis$1(i,o,r,n);case"Tuple":return FromTuple$1(i,o,r,n);case"Union":return FromUnion$1(i,o,r,n);default:return Default(i,r,n)}}function TransformDecode(e,t,r){return Visit$1(e,t,"",r)}function FromArray(e,t){return IsTransform$1(e)||Visit(e.items,t)}function FromAsyncIterator(e,t){return IsTransform$1(e)||Visit(e.items,t)}function FromConstructor(e,t){return IsTransform$1(e)||Visit(e.returns,t)||e.parameters.some(r=>Visit(r,t))}function FromFunction(e,t){return IsTransform$1(e)||Visit(e.returns,t)||e.parameters.some(r=>Visit(r,t))}function FromIntersect(e,t){return IsTransform$1(e)||IsTransform$1(e.unevaluatedProperties)||e.allOf.some(r=>Visit(r,t))}function FromImport(e,t){const r=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((o,i)=>[...o,e.$defs[i]],[]),n=e.$defs[e.$ref];return IsTransform$1(e)||Visit(n,[...r,...t])}function FromIterator(e,t){return IsTransform$1(e)||Visit(e.items,t)}function FromNot(e,t){return IsTransform$1(e)||Visit(e.not,t)}function FromObject(e,t){return IsTransform$1(e)||Object.values(e.properties).some(r=>Visit(r,t))||IsSchema$1(e.additionalProperties)&&Visit(e.additionalProperties,t)}function FromPromise(e,t){return IsTransform$1(e)||Visit(e.item,t)}function FromRecord(e,t){const r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return IsTransform$1(e)||Visit(n,t)||IsSchema$1(e.additionalProperties)&&IsTransform$1(e.additionalProperties)}function FromRef(e,t){return IsTransform$1(e)?!0:Visit(Deref(e,t),t)}function FromThis(e,t){return IsTransform$1(e)?!0:Visit(Deref(e,t),t)}function FromTuple(e,t){return IsTransform$1(e)||!IsUndefined$2(e.items)&&e.items.some(r=>Visit(r,t))}function FromUnion(e,t){return IsTransform$1(e)||e.anyOf.some(r=>Visit(r,t))}function Visit(e,t){const r=Pushref(e,t),n=e;if(e.$id&&visited.has(e.$id))return!1;switch(e.$id&&visited.add(e.$id),e[Kind]){case"Array":return FromArray(n,r);case"AsyncIterator":return FromAsyncIterator(n,r);case"Constructor":return FromConstructor(n,r);case"Function":return FromFunction(n,r);case"Import":return FromImport(n,r);case"Intersect":return FromIntersect(n,r);case"Iterator":return FromIterator(n,r);case"Not":return FromNot(n,r);case"Object":return FromObject(n,r);case"Promise":return FromPromise(n,r);case"Record":return FromRecord(n,r);case"Ref":return FromRef(n,r);case"This":return FromThis(n,r);case"Tuple":return FromTuple(n,r);case"Union":return FromUnion(n,r);default:return IsTransform$1(e)}}const visited=new Set;function HasTransform(e,t){return visited.clear(),Visit(e,t)}function Decode(...e){const[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Check(t,r,n))throw new TransformDecodeCheckError(t,n,Errors(t,r,n).First());return HasTransform(t,r)?TransformDecode(t,r,n):n}var lib={},assert$1={exports:{}},errors={},util$2={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max$1,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max$1=Math.max),max$1}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round=Math.round),round}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var sign$2,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$2;hasRequiredSign$1=1;var e=require_isNaN();return sign$2=function(r){return e(r)||r===0?r:r<0?-1:1},sign$2}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var e=requireGOPD();if(e)try{e([],"length")}catch{e=null}return gopd=e,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return esDefineProperty=e,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var e=requireEsObjectAtoms();return Object_getPrototypeOf=e.getPrototypeOf||null,Object_getPrototypeOf}var implementation$4,hasRequiredImplementation$4;function requireImplementation$4(){if(hasRequiredImplementation$4)return implementation$4;hasRequiredImplementation$4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",o=function(s,f){for(var c=[],d=0;d<s.length;d+=1)c[d]=s[d];for(var p=0;p<f.length;p+=1)c[p+s.length]=f[p];return c},i=function(s,f){for(var c=[],d=f,p=0;d<s.length;d+=1,p+=1)c[p]=s[d];return c},u=function(a,s){for(var f="",c=0;c<a.length;c+=1)f+=a[c],c+1<a.length&&(f+=s);return f};return implementation$4=function(s){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var c=i(arguments,1),d,p=function(){if(this instanceof d){var S=f.apply(this,o(c,arguments));return Object(S)===S?S:this}return f.apply(s,o(c,arguments))},h=r(0,f.length-c.length),y=[],b=0;b<h;b++)y[b]="$"+b;if(d=Function("binder","return function ("+u(y,",")+"){ return binder.apply(this,arguments); }")(p),f.prototype){var w=function(){};w.prototype=f.prototype,d.prototype=new w,w.prototype=null}return d},implementation$4}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var e=requireImplementation$4();return functionBind=Function.prototype.bind||e,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),n=requireReflectApply();return actualApply=n||e.call(r,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType(),r=requireFunctionCall(),n=requireActualApply();return callBindApplyHelpers=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return n(e,r,i)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var e=requireCallBindApplyHelpers(),t=requireGopd(),r;try{r=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!r&&t&&t(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return get=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var e=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),r=requireGet();return getProto=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:r?function(o){return r(o)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=requireFunctionBind();return hasown=r.call(e,t),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var e,t=requireEsObjectAtoms(),r=requireEsErrors(),n=require_eval(),o=requireRange(),i=requireRef(),u=requireSyntax(),a=requireType(),s=requireUri(),f=requireAbs(),c=requireFloor(),d=requireMax(),p=requireMin(),h=requirePow(),y=requireRound(),b=requireSign$1(),w=Function,S=function(ui){try{return w('"use strict"; return ('+ui+").constructor;")()}catch{}},E=requireGopd(),B=requireEsDefineProperty(),ae=function(){throw new a},W=E?(function(){try{return arguments.callee,ae}catch{try{return E(arguments,"callee").get}catch{return ae}}})():ae,J=requireHasSymbols()(),ve=requireGetProto(),Qe=requireObject_getPrototypeOf(),kt=requireReflect_getPrototypeOf(),nr=requireFunctionApply(),sr=requireFunctionCall(),ce={},Ze=typeof Uint8Array>"u"||!ve?e:ve(Uint8Array),se={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":J&&ve?ve([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":ce,"%AsyncGenerator%":ce,"%AsyncGeneratorFunction%":ce,"%AsyncIteratorPrototype%":ce,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":ce,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":J&&ve?ve(ve([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!J||!ve?e:ve(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!J||!ve?e:ve(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":J&&ve?ve(""[Symbol.iterator]()):e,"%Symbol%":J?Symbol:e,"%SyntaxError%":u,"%ThrowTypeError%":W,"%TypedArray%":Ze,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":sr,"%Function.prototype.apply%":nr,"%Object.defineProperty%":B,"%Object.getPrototypeOf%":Qe,"%Math.abs%":f,"%Math.floor%":c,"%Math.max%":d,"%Math.min%":p,"%Math.pow%":h,"%Math.round%":y,"%Math.sign%":b,"%Reflect.getPrototypeOf%":kt};if(ve)try{null.error}catch(ui){var vt=ve(ve(ui));se["%Error.prototype%"]=vt}var ur=function ui(lr){var ar;if(lr==="%AsyncFunction%")ar=S("async function () {}");else if(lr==="%GeneratorFunction%")ar=S("function* () {}");else if(lr==="%AsyncGeneratorFunction%")ar=S("async function* () {}");else if(lr==="%AsyncGenerator%"){var jr=ui("%AsyncGeneratorFunction%");jr&&(ar=jr.prototype)}else if(lr==="%AsyncIteratorPrototype%"){var ci=ui("%AsyncGenerator%");ci&&ve&&(ar=ve(ci.prototype))}return se[lr]=ar,ar},ue={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bt=requireFunctionBind(),L=requireHasown(),_=bt.call(sr,Array.prototype.concat),F=bt.call(nr,Array.prototype.splice),k=bt.call(sr,String.prototype.replace),Ye=bt.call(sr,String.prototype.slice),rn=bt.call(sr,RegExp.prototype.exec),ii=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ai=/\\(\\)?/g,ni=function(lr){var ar=Ye(lr,0,1),jr=Ye(lr,-1);if(ar==="%"&&jr!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(jr==="%"&&ar!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var ci=[];return k(lr,ii,function(mi,pi,ei,Gr){ci[ci.length]=ei?k(Gr,ai,"$1"):pi||mi}),ci},ri=function(lr,ar){var jr=lr,ci;if(L(ue,jr)&&(ci=ue[jr],jr="%"+ci[0]+"%"),L(se,jr)){var mi=se[jr];if(mi===ce&&(mi=ur(jr)),typeof mi>"u"&&!ar)throw new a("intrinsic "+lr+" exists, but is not available. Please file an issue!");return{alias:ci,name:jr,value:mi}}throw new u("intrinsic "+lr+" does not exist!")};return getIntrinsic=function(lr,ar){if(typeof lr!="string"||lr.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ar!="boolean")throw new a('"allowMissing" argument must be a boolean');if(rn(/^%?[^%]*%?$/,lr)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var jr=ni(lr),ci=jr.length>0?jr[0]:"",mi=ri("%"+ci+"%",ar),pi=mi.name,ei=mi.value,Gr=!1,ti=mi.alias;ti&&(ci=ti[0],F(jr,_([0,1],ti)));for(var fi=1,bi=!0;fi<jr.length;fi+=1){var Ai=jr[fi],Bi=Ye(Ai,0,1),qi=Ye(Ai,-1);if((Bi==='"'||Bi==="'"||Bi==="`"||qi==='"'||qi==="'"||qi==="`")&&Bi!==qi)throw new u("property names with quotes must have matching quotes");if((Ai==="constructor"||!bi)&&(Gr=!0),ci+="."+Ai,pi="%"+ci+"%",L(se,pi))ei=se[pi];else if(ei!=null){if(!(Ai in ei)){if(!ar)throw new a("base intrinsic for "+lr+" exists, but the property is not available.");return}if(E&&fi+1>=jr.length){var vn=E(ei,Ai);bi=!!vn,bi&&"get"in vn&&!("originalValue"in vn.get)?ei=vn.get:ei=ei[Ai]}else bi=L(ei,Ai),ei=ei[Ai];bi&&!Gr&&(se[pi]=ei)}}return ei},getIntrinsic}var callBound$1,hasRequiredCallBound$1;function requireCallBound$1(){if(hasRequiredCallBound$1)return callBound$1;hasRequiredCallBound$1=1;var e=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),r=t([e("%String.prototype.indexOf%")]);return callBound$1=function(o,i){var u=e(o,!!i);return typeof u=="function"&&r(o,".prototype.")>-1?t([u]):u},callBound$1}var isArguments$1,hasRequiredIsArguments$1;function requireIsArguments$1(){if(hasRequiredIsArguments$1)return isArguments$1;hasRequiredIsArguments$1=1;var e=requireShams()(),t=requireCallBound$1(),r=t("Object.prototype.toString"),n=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:r(a)==="[object Arguments]"},o=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&r(a)!=="[object Array]"&&"callee"in a&&r(a.callee)==="[object Function]"},i=(function(){return n(arguments)})();return n.isLegacyArguments=o,isArguments$1=i?n:o,isArguments$1}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var e=requireCallBound$1(),t=requireShams()(),r=requireHasown(),n=requireGopd(),o;if(t){var i=e("RegExp.prototype.exec"),u={},a=function(){throw u},s={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(s[Symbol.toPrimitive]=a),o=function(p){if(!p||typeof p!="object")return!1;var h=n(p,"lastIndex"),y=h&&r(h,"value");if(!y)return!1;try{i(p,s)}catch(b){return b===u}}}else{var f=e("Object.prototype.toString"),c="[object RegExp]";o=function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:f(p)===c}}return isRegex=o,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound$1(),t=requireIsRegex(),r=e("RegExp.prototype.exec"),n=requireType();return safeRegexTest=function(i){if(!t(i))throw new n("`regex` must be a RegExp");return function(a){return r(i,a)!==null}},safeRegexTest}var generatorFunction,hasRequiredGeneratorFunction;function requireGeneratorFunction(){if(hasRequiredGeneratorFunction)return generatorFunction;hasRequiredGeneratorFunction=1;const e=(function*(){}).constructor;return generatorFunction=()=>e,generatorFunction}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var e=requireCallBound$1(),t=requireSafeRegexTest(),r=t(/^\s*(?:function)?\*/),n=requireShams()(),o=requireGetProto(),i=e("Object.prototype.toString"),u=e("Function.prototype.toString"),a=requireGeneratorFunction();return isGeneratorFunction=function(f){if(typeof f!="function")return!1;if(r(u(f)))return!0;if(!n){var c=i(f);return c==="[object GeneratorFunction]"}if(!o)return!1;var d=a();return d&&o(f)===d.prototype},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(E){E!==n&&(t=null)}else t=null;var o=/^\s*class\b/,i=function(B){try{var ae=e.call(B);return o.test(ae)}catch{return!1}},u=function(B){try{return i(B)?!1:(e.call(B),!0)}catch{return!1}},a=Object.prototype.toString,s="[object Object]",f="[object Function]",c="[object GeneratorFunction]",d="[object HTMLAllCollection]",p="[object HTML document.all class]",h="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,b=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var S=document.all;a.call(S)===a.call(document.all)&&(w=function(B){if((b||!B)&&(typeof B>"u"||typeof B=="object"))try{var ae=a.call(B);return(ae===d||ae===p||ae===h||ae===s)&&B("")==null}catch{}return!1})}return isCallable=t?function(B){if(w(B))return!0;if(!B||typeof B!="function"&&typeof B!="object")return!1;try{t(B,null,r)}catch(ae){if(ae!==n)return!1}return!i(B)&&u(B)}:function(B){if(w(B))return!0;if(!B||typeof B!="function"&&typeof B!="object")return!1;if(y)return u(B);if(i(B))return!1;var ae=a.call(B);return ae!==f&&ae!==c&&!/^\[object HTML/.test(ae)?!1:u(B)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var e=requireIsCallable(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(s,f,c){for(var d=0,p=s.length;d<p;d++)r.call(s,d)&&(c==null?f(s[d],d,s):f.call(c,s[d],d,s))},o=function(s,f,c){for(var d=0,p=s.length;d<p;d++)c==null?f(s.charAt(d),d,s):f.call(c,s.charAt(d),d,s)},i=function(s,f,c){for(var d in s)r.call(s,d)&&(c==null?f(s[d],d,s):f.call(c,s[d],d,s))};function u(a){return t.call(a)==="[object Array]"}return forEach=function(s,f,c){if(!e(f))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=c),u(s)?n(s,f,d):typeof s=="string"?o(s,f,d):i(s,f,d)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var e=requirePossibleTypedArrayNames(),t=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var n=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(n[n.length]=e[o]);return n},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var e=requireEsDefineProperty(),t=requireSyntax(),r=requireType(),n=requireGopd();return defineDataProperty=function(i,u,a){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,p=!!n&&n(i,u);if(e)e(i,u,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:a,writable:f===null&&p?p.writable:!f});else if(d||!s&&!f&&!c)i[u]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),r=requireHasPropertyDescriptors()(),n=requireGopd(),o=requireType(),i=e("%Math.floor%");return setFunctionLength=function(a,s){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||i(s)!==s)throw new o("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],c=!0,d=!0;if("length"in a&&n){var p=n(a,"length");p&&!p.configurable&&(c=!1),p&&!p.writable&&(d=!1)}return(c||d||!f)&&(r?t(a,"length",s,!0,!0):t(a,"length",s)),a},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(e){var t=requireSetFunctionLength(),r=requireEsDefineProperty(),n=requireCallBindApplyHelpers(),o=requireApplyBind();e.exports=function(u){var a=n(arguments),s=u.length-(arguments.length-1);return t(a,1+(s>0?s:0),!0)},r?r(e.exports,"apply",{value:o}):e.exports.apply=o})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var e=requireForEach(),t=requireAvailableTypedArrays(),r=requireCallBind(),n=requireCallBound$1(),o=requireGopd(),i=requireGetProto(),u=n("Object.prototype.toString"),a=requireShams()(),s=typeof globalThis>"u"?commonjsGlobal:globalThis,f=t(),c=n("String.prototype.slice"),d=n("Array.prototype.indexOf",!0)||function(w,S){for(var E=0;E<w.length;E+=1)if(w[E]===S)return E;return-1},p={__proto__:null};a&&o&&i?e(f,function(b){var w=new s[b];if(Symbol.toStringTag in w&&i){var S=i(w),E=o(S,Symbol.toStringTag);if(!E&&S){var B=i(S);E=o(B,Symbol.toStringTag)}if(E&&E.get){var ae=r(E.get);p["$"+b]=ae}}}):e(f,function(b){var w=new s[b],S=w.slice||w.set;if(S){var E=r(S);p["$"+b]=E}});var h=function(w){var S=!1;return e(p,function(E,B){if(!S)try{"$"+E(w)===B&&(S=c(B,1))}catch{}}),S},y=function(w){var S=!1;return e(p,function(E,B){if(!S)try{E(w),S=c(B,1)}catch{}}),S};return whichTypedArray=function(w){if(!w||typeof w!="object")return!1;if(!a){var S=c(u(w),8,-1);return d(f,S)>-1?S:S!=="Object"?!1:y(w)}return o?h(w):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var e=requireWhichTypedArray();return isTypedArray=function(r){return!!e(r)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,(function(e){var t=requireIsArguments$1(),r=requireIsGeneratorFunction(),n=requireWhichTypedArray(),o=requireIsTypedArray();function i(fi){return fi.call.bind(fi)}var u=typeof BigInt<"u",a=typeof Symbol<"u",s=i(Object.prototype.toString),f=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),d=i(Boolean.prototype.valueOf);if(u)var p=i(BigInt.prototype.valueOf);if(a)var h=i(Symbol.prototype.valueOf);function y(fi,bi){if(typeof fi!="object")return!1;try{return bi(fi),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function b(fi){return typeof Promise<"u"&&fi instanceof Promise||fi!==null&&typeof fi=="object"&&typeof fi.then=="function"&&typeof fi.catch=="function"}e.isPromise=b;function w(fi){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(fi):o(fi)||Ye(fi)}e.isArrayBufferView=w;function S(fi){return n(fi)==="Uint8Array"}e.isUint8Array=S;function E(fi){return n(fi)==="Uint8ClampedArray"}e.isUint8ClampedArray=E;function B(fi){return n(fi)==="Uint16Array"}e.isUint16Array=B;function ae(fi){return n(fi)==="Uint32Array"}e.isUint32Array=ae;function W(fi){return n(fi)==="Int8Array"}e.isInt8Array=W;function J(fi){return n(fi)==="Int16Array"}e.isInt16Array=J;function ve(fi){return n(fi)==="Int32Array"}e.isInt32Array=ve;function Qe(fi){return n(fi)==="Float32Array"}e.isFloat32Array=Qe;function kt(fi){return n(fi)==="Float64Array"}e.isFloat64Array=kt;function nr(fi){return n(fi)==="BigInt64Array"}e.isBigInt64Array=nr;function sr(fi){return n(fi)==="BigUint64Array"}e.isBigUint64Array=sr;function ce(fi){return s(fi)==="[object Map]"}ce.working=typeof Map<"u"&&ce(new Map);function Ze(fi){return typeof Map>"u"?!1:ce.working?ce(fi):fi instanceof Map}e.isMap=Ze;function se(fi){return s(fi)==="[object Set]"}se.working=typeof Set<"u"&&se(new Set);function vt(fi){return typeof Set>"u"?!1:se.working?se(fi):fi instanceof Set}e.isSet=vt;function ur(fi){return s(fi)==="[object WeakMap]"}ur.working=typeof WeakMap<"u"&&ur(new WeakMap);function ue(fi){return typeof WeakMap>"u"?!1:ur.working?ur(fi):fi instanceof WeakMap}e.isWeakMap=ue;function bt(fi){return s(fi)==="[object WeakSet]"}bt.working=typeof WeakSet<"u"&&bt(new WeakSet);function L(fi){return bt(fi)}e.isWeakSet=L;function _(fi){return s(fi)==="[object ArrayBuffer]"}_.working=typeof ArrayBuffer<"u"&&_(new ArrayBuffer);function F(fi){return typeof ArrayBuffer>"u"?!1:_.working?_(fi):fi instanceof ArrayBuffer}e.isArrayBuffer=F;function k(fi){return s(fi)==="[object DataView]"}k.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&k(new DataView(new ArrayBuffer(1),0,1));function Ye(fi){return typeof DataView>"u"?!1:k.working?k(fi):fi instanceof DataView}e.isDataView=Ye;var rn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ii(fi){return s(fi)==="[object SharedArrayBuffer]"}function ai(fi){return typeof rn>"u"?!1:(typeof ii.working>"u"&&(ii.working=ii(new rn)),ii.working?ii(fi):fi instanceof rn)}e.isSharedArrayBuffer=ai;function ni(fi){return s(fi)==="[object AsyncFunction]"}e.isAsyncFunction=ni;function ri(fi){return s(fi)==="[object Map Iterator]"}e.isMapIterator=ri;function ui(fi){return s(fi)==="[object Set Iterator]"}e.isSetIterator=ui;function lr(fi){return s(fi)==="[object Generator]"}e.isGeneratorObject=lr;function ar(fi){return s(fi)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=ar;function jr(fi){return y(fi,f)}e.isNumberObject=jr;function ci(fi){return y(fi,c)}e.isStringObject=ci;function mi(fi){return y(fi,d)}e.isBooleanObject=mi;function pi(fi){return u&&y(fi,p)}e.isBigIntObject=pi;function ei(fi){return a&&y(fi,h)}e.isSymbolObject=ei;function Gr(fi){return jr(fi)||ci(fi)||mi(fi)||pi(fi)||ei(fi)}e.isBoxedPrimitive=Gr;function ti(fi){return typeof Uint8Array<"u"&&(F(fi)||ai(fi))}e.isAnyArrayBuffer=ti,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(fi){Object.defineProperty(e,fi,{enumerable:!1,value:function(){throw new Error(fi+" is not supported in userland")}})})})(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),isBufferBrowser}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}),inherits_browser.exports}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(e){var t={},r=Object.getOwnPropertyDescriptors||function(rn){for(var ii=Object.keys(rn),ai={},ni=0;ni<ii.length;ni++)ai[ii[ni]]=Object.getOwnPropertyDescriptor(rn,ii[ni]);return ai},n=/%[sdj%]/g;e.format=function(Ye){if(!J(Ye)){for(var rn=[],ii=0;ii<arguments.length;ii++)rn.push(a(arguments[ii]));return rn.join(" ")}for(var ii=1,ai=arguments,ni=ai.length,ri=String(Ye).replace(n,function(lr){if(lr==="%%")return"%";if(ii>=ni)return lr;switch(lr){case"%s":return String(ai[ii++]);case"%d":return Number(ai[ii++]);case"%j":try{return JSON.stringify(ai[ii++])}catch{return"[Circular]"}default:return lr}}),ui=ai[ii];ii<ni;ui=ai[++ii])B(ui)||!nr(ui)?ri+=" "+ui:ri+=" "+a(ui);return ri},e.deprecate=function(Ye,rn){if(typeof process<"u"&&process.noDeprecation===!0)return Ye;if(typeof process>"u")return function(){return e.deprecate(Ye,rn).apply(this,arguments)};var ii=!1;function ai(){if(!ii){if(process.throwDeprecation)throw new Error(rn);process.traceDeprecation?console.trace(rn):console.error(rn),ii=!0}return Ye.apply(this,arguments)}return ai};var o={},i=/^$/;if(t.NODE_DEBUG){var u=t.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+u+"$","i")}e.debuglog=function(Ye){if(Ye=Ye.toUpperCase(),!o[Ye])if(i.test(Ye)){var rn=process.pid;o[Ye]=function(){var ii=e.format.apply(e,arguments);console.error("%s %d: %s",Ye,rn,ii)}}else o[Ye]=function(){};return o[Ye]};function a(Ye,rn){var ii={seen:[],stylize:f};return arguments.length>=3&&(ii.depth=arguments[2]),arguments.length>=4&&(ii.colors=arguments[3]),E(rn)?ii.showHidden=rn:rn&&e._extend(ii,rn),Qe(ii.showHidden)&&(ii.showHidden=!1),Qe(ii.depth)&&(ii.depth=2),Qe(ii.colors)&&(ii.colors=!1),Qe(ii.customInspect)&&(ii.customInspect=!0),ii.colors&&(ii.stylize=s),d(ii,Ye,ii.depth)}e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(Ye,rn){var ii=a.styles[rn];return ii?"\x1B["+a.colors[ii][0]+"m"+Ye+"\x1B["+a.colors[ii][1]+"m":Ye}function f(Ye,rn){return Ye}function c(Ye){var rn={};return Ye.forEach(function(ii,ai){rn[ii]=!0}),rn}function d(Ye,rn,ii){if(Ye.customInspect&&rn&&Ze(rn.inspect)&&rn.inspect!==e.inspect&&!(rn.constructor&&rn.constructor.prototype===rn)){var ai=rn.inspect(ii,Ye);return J(ai)||(ai=d(Ye,ai,ii)),ai}var ni=p(Ye,rn);if(ni)return ni;var ri=Object.keys(rn),ui=c(ri);if(Ye.showHidden&&(ri=Object.getOwnPropertyNames(rn)),ce(rn)&&(ri.indexOf("message")>=0||ri.indexOf("description")>=0))return h(rn);if(ri.length===0){if(Ze(rn)){var lr=rn.name?": "+rn.name:"";return Ye.stylize("[Function"+lr+"]","special")}if(kt(rn))return Ye.stylize(RegExp.prototype.toString.call(rn),"regexp");if(sr(rn))return Ye.stylize(Date.prototype.toString.call(rn),"date");if(ce(rn))return h(rn)}var ar="",jr=!1,ci=["{","}"];if(S(rn)&&(jr=!0,ci=["[","]"]),Ze(rn)){var mi=rn.name?": "+rn.name:"";ar=" [Function"+mi+"]"}if(kt(rn)&&(ar=" "+RegExp.prototype.toString.call(rn)),sr(rn)&&(ar=" "+Date.prototype.toUTCString.call(rn)),ce(rn)&&(ar=" "+h(rn)),ri.length===0&&(!jr||rn.length==0))return ci[0]+ar+ci[1];if(ii<0)return kt(rn)?Ye.stylize(RegExp.prototype.toString.call(rn),"regexp"):Ye.stylize("[Object]","special");Ye.seen.push(rn);var pi;return jr?pi=y(Ye,rn,ii,ui,ri):pi=ri.map(function(ei){return b(Ye,rn,ii,ui,ei,jr)}),Ye.seen.pop(),w(pi,ar,ci)}function p(Ye,rn){if(Qe(rn))return Ye.stylize("undefined","undefined");if(J(rn)){var ii="'"+JSON.stringify(rn).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Ye.stylize(ii,"string")}if(W(rn))return Ye.stylize(""+rn,"number");if(E(rn))return Ye.stylize(""+rn,"boolean");if(B(rn))return Ye.stylize("null","null")}function h(Ye){return"["+Error.prototype.toString.call(Ye)+"]"}function y(Ye,rn,ii,ai,ni){for(var ri=[],ui=0,lr=rn.length;ui<lr;++ui)L(rn,String(ui))?ri.push(b(Ye,rn,ii,ai,String(ui),!0)):ri.push("");return ni.forEach(function(ar){ar.match(/^\d+$/)||ri.push(b(Ye,rn,ii,ai,ar,!0))}),ri}function b(Ye,rn,ii,ai,ni,ri){var ui,lr,ar;if(ar=Object.getOwnPropertyDescriptor(rn,ni)||{value:rn[ni]},ar.get?ar.set?lr=Ye.stylize("[Getter/Setter]","special"):lr=Ye.stylize("[Getter]","special"):ar.set&&(lr=Ye.stylize("[Setter]","special")),L(ai,ni)||(ui="["+ni+"]"),lr||(Ye.seen.indexOf(ar.value)<0?(B(ii)?lr=d(Ye,ar.value,null):lr=d(Ye,ar.value,ii-1),lr.indexOf(`
62
62
  `)>-1&&(ri?lr=lr.split(`
63
63
  `).map(function(jr){return" "+jr}).join(`
64
64
  `).slice(2):lr=`
@@ -128,9 +128,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
128
128
  `))}throw ni}};function k(rn,ii,ai,ni,ri){if(!b(ii))throw new u("regexp","RegExp",ii);var ui=ri==="match";if(typeof rn!="string"||E(ii,rn)!==ui){if(ai instanceof Error)throw ai;var lr=!ai;ai=ai||(typeof rn!="string"?'The "string" argument must be of type string. Received type '+"".concat(e(rn)," (").concat(p(rn),")"):(ui?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(p(ii),`. Input:
129
129
 
130
130
  `).concat(p(rn),`
131
- `));var ar=new c({actual:rn,expected:ii,message:ai,operator:ri,stackStartFn:ni});throw ar.generatedMessage=lr,ar}}ve.match=function rn(ii,ai,ni){k(ii,ai,ni,rn,"match")},ve.doesNotMatch=function rn(ii,ai,ni){k(ii,ai,ni,rn,"doesNotMatch")};function Ye(){for(var rn=arguments.length,ii=new Array(rn),ai=0;ai<rn;ai++)ii[ai]=arguments[ai];sr.apply(void 0,[Ye,ii.length].concat(ii))}return ve.strict=w(Ye,ve,{equal:ve.strictEqual,deepEqual:ve.deepStrictEqual,notEqual:ve.notStrictEqual,notDeepEqual:ve.notDeepStrictEqual}),ve.strict.strict=ve.strict,assert$1.exports}var src,hasRequiredSrc;function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var i=t.charAt(o),u=i.charCodeAt(0);if(r[u]!==255)throw new TypeError(i+" is ambiguous");r[u]=o}var a=t.length,s=t.charAt(0),f=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function d(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,w=0,S=0,E=y.length;S!==E&&y[S]===0;)S++,b++;for(var B=(E-S)*c+1>>>0,ae=new Uint8Array(B);S!==E;){for(var W=y[S],J=0,ve=B-1;(W!==0||J<w)&&ve!==-1;ve--,J++)W+=256*ae[ve]>>>0,ae[ve]=W%a>>>0,W=W/a>>>0;if(W!==0)throw new Error("Non-zero carry");w=J,S++}for(var Qe=B-w;Qe!==B&&ae[Qe]===0;)Qe++;for(var kt=s.repeat(b);Qe<B;++Qe)kt+=t.charAt(ae[Qe]);return kt}function p(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var b=0,w=0,S=0;y[b]===s;)w++,b++;for(var E=(y.length-b)*f+1>>>0,B=new Uint8Array(E);y[b];){var ae=y.charCodeAt(b);if(ae>255)return;var W=r[ae];if(W===255)return;for(var J=0,ve=E-1;(W!==0||J<S)&&ve!==-1;ve--,J++)W+=a*B[ve]>>>0,B[ve]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");S=J,b++}for(var Qe=E-S;Qe!==E&&B[Qe]===0;)Qe++;for(var kt=new Uint8Array(w+(E-Qe)),nr=w;Qe!==E;)kt[nr++]=B[Qe++];return kt}function h(y){var b=p(y);if(b)return b;throw new Error("Non-base"+a+" character")}return{encode:d,decodeUnsafe:p,decode:h}}return src=e,src}var blake2b$4={exports:{}},nanoassert,hasRequiredNanoassert;function requireNanoassert(){if(hasRequiredNanoassert)return nanoassert;hasRequiredNanoassert=1,nanoassert=t;class e extends Error{}e.prototype.name="AssertionError";function t(r,n){if(!r){var o=new e(n);throw Error.captureStackTrace&&Error.captureStackTrace(o,t),o}}return nanoassert}var blake2bWasm={exports:{}},browser$c={exports:{}},ascii,hasRequiredAscii;function requireAscii(){if(hasRequiredAscii)return ascii;hasRequiredAscii=1;function e(n){return n.length}function t(n){const o=n.byteLength;let i="";for(let u=0;u<o;u++)i+=String.fromCharCode(n[u]);return i}function r(n,o){const i=n.byteLength;for(let u=0;u<i;u++)n[u]=o.charCodeAt(u);return i}return ascii={byteLength:e,toString:t,write:r},ascii}var base64,hasRequiredBase64;function requireBase64(){if(hasRequiredBase64)return base64;hasRequiredBase64=1;const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let i=0;i<e.length;i++)t[e.charCodeAt(i)]=i;t[45]=62,t[95]=63;function r(i){let u=i.length;return i.charCodeAt(u-1)===61&&u--,u>1&&i.charCodeAt(u-1)===61&&u--,u*3>>>2}function n(i){const u=i.byteLength;let a="";for(let s=0;s<u;s+=3)a+=e[i[s]>>2]+e[(i[s]&3)<<4|i[s+1]>>4]+e[(i[s+1]&15)<<2|i[s+2]>>6]+e[i[s+2]&63];return u%3===2?a=a.substring(0,a.length-1)+"=":u%3===1&&(a=a.substring(0,a.length-2)+"=="),a}function o(i,u){const a=i.byteLength;for(let s=0,f=0;f<a;s+=4){const c=t[u.charCodeAt(s)],d=t[u.charCodeAt(s+1)],p=t[u.charCodeAt(s+2)],h=t[u.charCodeAt(s+3)];i[f++]=c<<2|d>>4,i[f++]=(d&15)<<4|p>>2,i[f++]=(p&3)<<6|h&63}return a}return base64={byteLength:r,toString:n,write:o},base64}var hex$1,hasRequiredHex;function requireHex(){if(hasRequiredHex)return hex$1;hasRequiredHex=1;function e(o){return o.length>>>1}function t(o){const i=o.byteLength;o=new DataView(o.buffer,o.byteOffset,i);let u="",a=0;for(let s=i-i%4;a<s;a+=4)u+=o.getUint32(a).toString(16).padStart(8,"0");for(;a<i;a++)u+=o.getUint8(a).toString(16).padStart(2,"0");return u}function r(o,i){const u=o.byteLength;for(let a=0;a<u;a++){const s=n(i.charCodeAt(a*2)),f=n(i.charCodeAt(a*2+1));if(s===void 0||f===void 0)return o.subarray(0,a);o[a]=s<<4|f}return u}hex$1={byteLength:e,toString:t,write:r};function n(o){if(o>=48&&o<=57)return o-48;if(o>=65&&o<=70)return o-65+10;if(o>=97&&o<=102)return o-97+10}return hex$1}var utf8,hasRequiredUtf8;function requireUtf8(){if(hasRequiredUtf8)return utf8;hasRequiredUtf8=1;function e(n){let o=0;for(let i=0,u=n.length;i<u;i++){const a=n.charCodeAt(i);if(a>=55296&&a<=56319&&i+1<u){const s=n.charCodeAt(i+1);if(s>=56320&&s<=57343){o+=4,i++;continue}}a<=127?o+=1:a<=2047?o+=2:o+=3}return o}let t;if(typeof TextDecoder<"u"){const n=new TextDecoder;t=function(i){return n.decode(i)}}else t=function(o){const i=o.byteLength;let u="",a=0;for(;a<i;){let s=o[a];if(s<=127){u+=String.fromCharCode(s),a++;continue}let f=0,c=0;if(s<=223?(f=1,c=s&31):s<=239?(f=2,c=s&15):s<=244&&(f=3,c=s&7),i-a-f>0){let d=0;for(;d<f;)s=o[a+d+1],c=c<<6|s&63,d+=1}else c=65533,f=i-a;u+=String.fromCodePoint(c),a+=f+1}return u};let r;if(typeof TextEncoder<"u"){const n=new TextEncoder;r=function(i,u){return n.encodeInto(u,i).written}}else r=function(o,i){const u=o.byteLength;let a=0,s=0;for(;a<i.length;){const f=i.codePointAt(a);if(f<=127){o[s++]=f,a++;continue}let c=0,d=0;for(f<=2047?(c=6,d=192):f<=65535?(c=12,d=224):f<=2097151&&(c=18,d=240),o[s++]=d|f>>c,c-=6;c>=0;)o[s++]=128|f>>c&63,c-=6;a+=f>=65536?2:1}return u};return utf8={byteLength:e,toString:t,write:r},utf8}var utf16le,hasRequiredUtf16le;function requireUtf16le(){if(hasRequiredUtf16le)return utf16le;hasRequiredUtf16le=1;function e(n){return n.length*2}function t(n){const o=n.byteLength;let i="";for(let u=0;u<o-1;u+=2)i+=String.fromCharCode(n[u]+n[u+1]*256);return i}function r(n,o){const i=n.byteLength;let u=i;for(let a=0;a<o.length&&!((u-=2)<0);++a){const s=o.charCodeAt(a),f=s>>8,c=s%256;n[a*2]=c,n[a*2+1]=f}return i}return utf16le={byteLength:e,toString:t,write:r},utf16le}var hasRequiredBrowser$c;function requireBrowser$c(){return hasRequiredBrowser$c||(hasRequiredBrowser$c=1,(function(e,t){const r=requireAscii(),n=requireBase64(),o=requireHex(),i=requireUtf8(),u=requireUtf16le(),a=new Uint8Array(Uint16Array.of(255).buffer)[0]===255;function s(ei){switch(ei){case"ascii":return r;case"base64":return n;case"hex":return o;case"utf8":case"utf-8":case void 0:case null:return i;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u;default:throw new Error(`Unknown encoding '${ei}'`)}}function f(ei){return ei instanceof Uint8Array}function c(ei){try{return s(ei),!0}catch{return!1}}function d(ei,Gr,ti){const fi=new Uint8Array(ei);return Gr!==void 0&&t.fill(fi,Gr,0,fi.byteLength,ti),fi}function p(ei){return new Uint8Array(ei)}function h(ei){return new Uint8Array(ei)}function y(ei,Gr){return s(Gr).byteLength(ei)}function b(ei,Gr){if(ei===Gr)return 0;const ti=Math.min(ei.byteLength,Gr.byteLength);ei=new DataView(ei.buffer,ei.byteOffset,ei.byteLength),Gr=new DataView(Gr.buffer,Gr.byteOffset,Gr.byteLength);let fi=0;for(let bi=ti-ti%4;fi<bi;fi+=4){const Ai=ei.getUint32(fi,a),Bi=Gr.getUint32(fi,a);if(Ai!==Bi)break}for(;fi<ti;fi++){const bi=ei.getUint8(fi),Ai=Gr.getUint8(fi);if(bi<Ai)return-1;if(bi>Ai)return 1}return ei.byteLength>Gr.byteLength?1:ei.byteLength<Gr.byteLength?-1:0}function w(ei,Gr){Gr===void 0&&(Gr=ei.reduce((bi,Ai)=>bi+Ai.byteLength,0));const ti=new Uint8Array(Gr);let fi=0;for(const bi of ei){if(fi+bi.byteLength>ti.byteLength)return ti.set(bi.subarray(0,ti.byteLength-fi),fi),ti;ti.set(bi,fi),fi+=bi.byteLength}return ti}function S(ei,Gr,ti=0,fi=0,bi=ei.byteLength){if(ti<0&&(ti=0),ti>=Gr.byteLength)return 0;const Ai=Gr.byteLength-ti;if(fi<0&&(fi=0),fi>=ei.byteLength||bi<=fi)return 0;bi>ei.byteLength&&(bi=ei.byteLength),bi-fi>Ai&&(bi=fi+Ai);const Bi=bi-fi;return ei===Gr?Gr.copyWithin(ti,fi,bi):((fi!==0||bi!==ei.byteLength)&&(ei=ei.subarray(fi,bi)),Gr.set(ei,ti)),Bi}function E(ei,Gr){return ei===Gr?!0:ei.byteLength!==Gr.byteLength?!1:b(ei,Gr)===0}function B(ei,Gr,ti=0,fi=ei.byteLength,bi="utf8"){if(typeof Gr=="string"?typeof ti=="string"?(bi=ti,ti=0,fi=ei.byteLength):typeof fi=="string"&&(bi=fi,fi=ei.byteLength):typeof Gr=="number"?Gr=Gr&255:typeof Gr=="boolean"&&(Gr=+Gr),ti<0&&(ti=0),ti>=ei.byteLength||fi<=ti)return ei;if(fi>ei.byteLength&&(fi=ei.byteLength),typeof Gr=="number")return ei.fill(Gr,ti,fi);typeof Gr=="string"&&(Gr=t.from(Gr,bi));const Ai=Gr.byteLength;for(let Bi=0,qi=fi-ti;Bi<qi;++Bi)ei[Bi+ti]=Gr[Bi%Ai];return ei}function ae(ei,Gr,ti){return typeof ei=="string"?W(ei,Gr):Array.isArray(ei)?J(ei):ArrayBuffer.isView(ei)?ve(ei):Qe(ei,Gr,ti)}function W(ei,Gr){const ti=s(Gr),fi=new Uint8Array(ti.byteLength(ei));return ti.write(fi,ei),fi}function J(ei){const Gr=new Uint8Array(ei.length);return Gr.set(ei),Gr}function ve(ei){const Gr=new Uint8Array(ei.byteLength);return Gr.set(ei),Gr}function Qe(ei,Gr,ti){return new Uint8Array(ei,Gr,ti)}function kt(ei,Gr,ti,fi){return nr(ei,Gr,ti,fi)!==-1}function nr(ei,Gr,ti,fi){return ce(ei,Gr,ti,fi,!0)}function sr(ei,Gr,ti,fi){return ce(ei,Gr,ti,fi,!1)}function ce(ei,Gr,ti,fi,bi){if(ei.byteLength===0)return-1;if(typeof ti=="string"?(fi=ti,ti=0):ti===void 0?ti=bi?0:ei.length-1:ti<0&&(ti+=ei.byteLength),ti>=ei.byteLength){if(bi)return-1;ti=ei.byteLength-1}else if(ti<0)if(bi)ti=0;else return-1;if(typeof Gr=="string")Gr=ae(Gr,fi);else if(typeof Gr=="number")return Gr=Gr&255,bi?ei.indexOf(Gr,ti):ei.lastIndexOf(Gr,ti);if(Gr.byteLength===0)return-1;if(bi){let Ai=-1;for(let Bi=ti;Bi<ei.byteLength;Bi++)if(ei[Bi]===Gr[Ai===-1?0:Bi-Ai]){if(Ai===-1&&(Ai=Bi),Bi-Ai+1===Gr.byteLength)return Ai}else Ai!==-1&&(Bi-=Bi-Ai),Ai=-1}else{ti+Gr.byteLength>ei.byteLength&&(ti=ei.byteLength-Gr.byteLength);for(let Ai=ti;Ai>=0;Ai--){let Bi=!0;for(let qi=0;qi<Gr.byteLength;qi++)if(ei[Ai+qi]!==Gr[qi]){Bi=!1;break}if(Bi)return Ai}}return-1}function Ze(ei,Gr,ti){const fi=ei[Gr];ei[Gr]=ei[ti],ei[ti]=fi}function se(ei){const Gr=ei.byteLength;if(Gr%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ti=0;ti<Gr;ti+=2)Ze(ei,ti,ti+1);return ei}function vt(ei){const Gr=ei.byteLength;if(Gr%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ti=0;ti<Gr;ti+=4)Ze(ei,ti,ti+3),Ze(ei,ti+1,ti+2);return ei}function ur(ei){const Gr=ei.byteLength;if(Gr%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ti=0;ti<Gr;ti+=8)Ze(ei,ti,ti+7),Ze(ei,ti+1,ti+6),Ze(ei,ti+2,ti+5),Ze(ei,ti+3,ti+4);return ei}function ue(ei){return ei}function bt(ei,Gr="utf8",ti=0,fi=ei.byteLength){return arguments.length===1?i.toString(ei):arguments.length===2?s(Gr).toString(ei):(ti<0&&(ti=0),ti>=ei.byteLength||fi<=ti?"":(fi>ei.byteLength&&(fi=ei.byteLength),(ti!==0||fi!==ei.byteLength)&&(ei=ei.subarray(ti,fi)),s(Gr).toString(ei)))}function L(ei,Gr,ti,fi,bi){if(arguments.length===2)return i.write(ei,Gr);typeof ti=="string"?(bi=ti,ti=0,fi=ei.byteLength):typeof fi=="string"&&(bi=fi,fi=ei.byteLength-ti),fi=Math.min(fi,t.byteLength(Gr,bi));let Ai=ti;if(Ai<0&&(Ai=0),Ai>=ei.byteLength)return 0;let Bi=ti+fi;return Bi<=Ai?0:(Bi>ei.byteLength&&(Bi=ei.byteLength),(Ai!==0||Bi!==ei.byteLength)&&(ei=ei.subarray(Ai,Bi)),s(bi).write(ei,Gr))}function _(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat64(Gr,!1)}function F(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat64(Gr,!0)}function k(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat32(Gr,!1)}function Ye(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat32(Gr,!0)}function rn(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getInt32(Gr,!1)}function ii(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getInt32(Gr,!0)}function ai(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getUint32(Gr,!1)}function ni(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getUint32(Gr,!0)}function ri(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat64(ti,Gr,!1),ti+8}function ui(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat64(ti,Gr,!0),ti+8}function lr(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat32(ti,Gr,!1),ti+4}function ar(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat32(ti,Gr,!0),ti+4}function jr(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setInt32(ti,Gr,!1),ti+4}function ci(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setInt32(ti,Gr,!0),ti+4}function mi(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setUint32(ti,Gr,!1),ti+4}function pi(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setUint32(ti,Gr,!0),ti+4}e.exports=t={isBuffer:f,isEncoding:c,alloc:d,allocUnsafe:p,allocUnsafeSlow:h,byteLength:y,compare:b,concat:w,copy:S,equals:E,fill:B,from:ae,includes:kt,indexOf:nr,lastIndexOf:sr,swap16:se,swap32:vt,swap64:ur,toBuffer:ue,toString:bt,write:L,readDoubleBE:_,readDoubleLE:F,readFloatBE:k,readFloatLE:Ye,readInt32BE:rn,readInt32LE:ii,readUInt32BE:ai,readUInt32LE:ni,writeDoubleBE:ri,writeDoubleLE:ui,writeFloatBE:lr,writeFloatLE:ar,writeInt32BE:jr,writeInt32LE:ci,writeUInt32BE:mi,writeUInt32LE:pi}})(browser$c,browser$c.exports)),browser$c.exports}var blake2b$3,hasRequiredBlake2b$1;function requireBlake2b$1(){if(hasRequiredBlake2b$1)return blake2b$3;hasRequiredBlake2b$1=1;var e=(i,u)=>function(){return u||(0,i[Object.keys(i)[0]])((u={exports:{}}).exports,u),u.exports},t=(()=>{for(var i=new Uint8Array(128),u=0;u<64;u++)i[u<26?u+65:u<52?u+71:u<62?u-4:u*4-205]=u;return a=>{for(var s=a.length,f=new Uint8Array((s-(a[s-1]=="=")-(a[s-2]=="="))*3/4|0),c=0,d=0;c<s;){var p=i[a.charCodeAt(c++)],h=i[a.charCodeAt(c++)],y=i[a.charCodeAt(c++)],b=i[a.charCodeAt(c++)];f[d++]=p<<2|h>>4,f[d++]=h<<4|y>>2,f[d++]=y<<6|b}return f}})(),r=e({"wasm-binary:./blake2b.wat"(i,u){u.exports=t("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}}),n=r(),o=WebAssembly.compile(n);return blake2b$3=async i=>(await WebAssembly.instantiate(await o,i)).exports,blake2b$3}var hasRequiredBlake2bWasm;function requireBlake2bWasm(){if(hasRequiredBlake2bWasm)return blake2bWasm.exports;hasRequiredBlake2bWasm=1;var e=requireNanoassert(),t=requireBrowser$c(),r=null,n=typeof WebAssembly<"u"&&requireBlake2b$1()().then(y=>{r=y}),o=64,i=[];blake2bWasm.exports=p;var u=blake2bWasm.exports.BYTES_MIN=16,a=blake2bWasm.exports.BYTES_MAX=64;blake2bWasm.exports.BYTES=32;var s=blake2bWasm.exports.KEYBYTES_MIN=16,f=blake2bWasm.exports.KEYBYTES_MAX=64;blake2bWasm.exports.KEYBYTES=32;var c=blake2bWasm.exports.SALTBYTES=16,d=blake2bWasm.exports.PERSONALBYTES=16;function p(y,b,w,S,E){if(!(this instanceof p))return new p(y,b,w,S,E);if(!r)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");y||(y=32),E!==!0&&(e(y>=u,"digestLength must be at least "+u+", was given "+y),e(y<=a,"digestLength must be at most "+a+", was given "+y),b!=null&&(e(b instanceof Uint8Array,"key must be Uint8Array or Buffer"),e(b.length>=s,"key must be at least "+s+", was given "+b.length),e(b.length<=f,"key must be at least "+f+", was given "+b.length)),w!=null&&(e(w instanceof Uint8Array,"salt must be Uint8Array or Buffer"),e(w.length===c,"salt must be exactly "+c+", was given "+w.length)),S!=null&&(e(S instanceof Uint8Array,"personal must be Uint8Array or Buffer"),e(S.length===d,"personal must be exactly "+d+", was given "+S.length))),i.length||(i.push(o),o+=216),this.digestLength=y,this.finalized=!1,this.pointer=i.pop(),this._memory=new Uint8Array(r.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=b?b.length:0,this._memory[2]=1,this._memory[3]=1,w&&this._memory.set(w,32),S&&this._memory.set(S,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),r.blake2b_init(this.pointer,this.digestLength),b&&(this.update(b),this._memory.fill(0,o,o+b.length),this._memory[this.pointer+200]=128)}p.prototype._realloc=function(y){r.memory.grow(Math.max(0,Math.ceil(Math.abs(y-this._memory.length)/65536))),this._memory=new Uint8Array(r.memory.buffer)},p.prototype.update=function(y){return e(this.finalized===!1,"Hash instance finalized"),e(y instanceof Uint8Array,"input must be Uint8Array or Buffer"),o+y.length>this._memory.length&&this._realloc(o+y.length),this._memory.set(y,o),r.blake2b_update(this.pointer,o,o+y.length),this},p.prototype.digest=function(y){if(e(this.finalized===!1,"Hash instance finalized"),this.finalized=!0,i.push(this.pointer),r.blake2b_final(this.pointer),!y||y==="binary")return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if(typeof y=="string")return t.toString(this._memory,y,this.pointer+128,this.pointer+128+this.digestLength);e(y instanceof Uint8Array&&y.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var b=0;b<this.digestLength;b++)y[b]=this._memory[this.pointer+128+b];return y},p.prototype.final=p.prototype.digest,p.WASM=r,p.SUPPORTED=typeof WebAssembly<"u",p.ready=function(y){return y||(y=h),n?n.then(()=>y(),y):y(new Error("WebAssembly not supported"))},p.prototype.ready=p.ready,p.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},p.prototype.setPartialHash=function(y){this._memory.set(y,this.pointer)};function h(){}return blake2bWasm.exports}var hasRequiredBlake2b;function requireBlake2b(){if(hasRequiredBlake2b)return blake2b$4.exports;hasRequiredBlake2b=1;var e=requireNanoassert(),t=requireBlake2bWasm();function r(kt,nr,sr){var ce=kt[nr]+kt[sr],Ze=kt[nr+1]+kt[sr+1];ce>=4294967296&&Ze++,kt[nr]=ce,kt[nr+1]=Ze}function n(kt,nr,sr,ce){var Ze=kt[nr]+sr;sr<0&&(Ze+=4294967296);var se=kt[nr+1]+ce;Ze>=4294967296&&se++,kt[nr]=Ze,kt[nr+1]=se}function o(kt,nr){return kt[nr]^kt[nr+1]<<8^kt[nr+2]<<16^kt[nr+3]<<24}function i(kt,nr,sr,ce,Ze,se){var vt=c[Ze],ur=c[Ze+1],ue=c[se],bt=c[se+1];r(f,kt,nr),n(f,kt,vt,ur);var L=f[ce]^f[kt],_=f[ce+1]^f[kt+1];f[ce]=_,f[ce+1]=L,r(f,sr,ce),L=f[nr]^f[sr],_=f[nr+1]^f[sr+1],f[nr]=L>>>24^_<<8,f[nr+1]=_>>>24^L<<8,r(f,kt,nr),n(f,kt,ue,bt),L=f[ce]^f[kt],_=f[ce+1]^f[kt+1],f[ce]=L>>>16^_<<16,f[ce+1]=_>>>16^L<<16,r(f,sr,ce),L=f[nr]^f[sr],_=f[nr+1]^f[sr+1],f[nr]=_>>>31^L<<1,f[nr+1]=L>>>31^_<<1}var u=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],s=new Uint8Array(a.map(function(kt){return kt*2})),f=new Uint32Array(32),c=new Uint32Array(32);function d(kt,nr){var sr=0;for(sr=0;sr<16;sr++)f[sr]=kt.h[sr],f[sr+16]=u[sr];for(f[24]=f[24]^kt.t,f[25]=f[25]^kt.t/4294967296,nr&&(f[28]=~f[28],f[29]=~f[29]),sr=0;sr<32;sr++)c[sr]=o(kt.b,4*sr);for(sr=0;sr<12;sr++)i(0,8,16,24,s[sr*16+0],s[sr*16+1]),i(2,10,18,26,s[sr*16+2],s[sr*16+3]),i(4,12,20,28,s[sr*16+4],s[sr*16+5]),i(6,14,22,30,s[sr*16+6],s[sr*16+7]),i(0,10,20,30,s[sr*16+8],s[sr*16+9]),i(2,12,22,24,s[sr*16+10],s[sr*16+11]),i(4,14,16,26,s[sr*16+12],s[sr*16+13]),i(6,8,18,28,s[sr*16+14],s[sr*16+15]);for(sr=0;sr<16;sr++)kt.h[sr]=kt.h[sr]^f[sr]^f[sr+16]}var p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(kt,nr,sr,ce){p.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=kt,p[0]=kt,nr&&(p[1]=nr.length),p[2]=1,p[3]=1,sr&&p.set(sr,32),ce&&p.set(ce,48);for(var Ze=0;Ze<16;Ze++)this.h[Ze]=u[Ze]^o(p,Ze*4);nr&&(y(this,nr),this.c=128)}h.prototype.update=function(kt){return e(kt instanceof Uint8Array,"input must be Uint8Array or Buffer"),y(this,kt),this},h.prototype.digest=function(kt){var nr=!kt||kt==="binary"||kt==="hex"?new Uint8Array(this.outlen):kt;return e(nr instanceof Uint8Array,'out must be "binary", "hex", Uint8Array, or Buffer'),e(nr.length>=this.outlen,"out must have at least outlen bytes of space"),b(this,nr),kt==="hex"?w(nr):nr},h.prototype.final=h.prototype.digest,h.ready=function(kt){t.ready(function(){kt()})};function y(kt,nr){for(var sr=0;sr<nr.length;sr++)kt.c===128&&(kt.t+=kt.c,d(kt,!1),kt.c=0),kt.b[kt.c++]=nr[sr]}function b(kt,nr){for(kt.t+=kt.c;kt.c<128;)kt.b[kt.c++]=0;d(kt,!0);for(var sr=0;sr<kt.outlen;sr++)nr[sr]=kt.h[sr>>2]>>8*(sr&3);return nr}function w(kt){for(var nr="",sr=0;sr<kt.length;sr++)nr+=S(kt[sr]);return nr}function S(kt){return kt<16?"0"+kt.toString(16):kt.toString(16)}var E=h;blake2b$4.exports=function(nr,sr,ce,Ze,se){return se!==!0&&(e(nr>=B,"outlen must be at least "+B+", was given "+nr),e(nr<=ae,"outlen must be at most "+ae+", was given "+nr),sr!=null&&(e(sr instanceof Uint8Array,"key must be Uint8Array or Buffer"),e(sr.length>=W,"key must be at least "+W+", was given "+sr.length),e(sr.length<=J,"key must be at most "+J+", was given "+sr.length)),ce!=null&&(e(ce instanceof Uint8Array,"salt must be Uint8Array or Buffer"),e(ce.length===ve,"salt must be exactly "+ve+", was given "+ce.length)),Ze!=null&&(e(Ze instanceof Uint8Array,"personal must be Uint8Array or Buffer"),e(Ze.length===Qe,"personal must be exactly "+Qe+", was given "+Ze.length))),new E(nr,sr,ce,Ze)},blake2b$4.exports.ready=function(kt){t.ready(function(){kt()})},blake2b$4.exports.WASM_SUPPORTED=t.SUPPORTED,blake2b$4.exports.WASM_LOADED=!1;var B=blake2b$4.exports.BYTES_MIN=16,ae=blake2b$4.exports.BYTES_MAX=64;blake2b$4.exports.BYTES=32;var W=blake2b$4.exports.KEYBYTES_MIN=16,J=blake2b$4.exports.KEYBYTES_MAX=64;blake2b$4.exports.KEYBYTES=32;var ve=blake2b$4.exports.SALTBYTES=16,Qe=blake2b$4.exports.PERSONALBYTES=16;return t.ready(function(kt){kt||(blake2b$4.exports.WASM_LOADED=!0,blake2b$4.exports=t)}),blake2b$4.exports}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var e=lib&&lib.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(lib,"__esModule",{value:!0}),lib.encode=lib.decode=void 0;const t=e(requireAssert()),r=e(requireSrc()),n=e(requireBlake2b()),o=(0,r.default)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),i=bufferExports.Buffer.from("SS58PRE"),u=bufferExports.Buffer.alloc(64);function a(d){let p=o.decodeUnsafe(d);if(p==null||p.length<3)throw c(d);let h=p[0],y,b;if(h<64)b=h,y=1;else if(h<128){let S=p[1],E=(h<<2|S>>6)&255,B=S&63;b=E|B<<8,y=2}else throw c(d);let w;switch(p.length-y){case 34:case 35:w=2;break;case 9:case 5:case 3:case 2:w=1;break;default:throw c(d)}f(p,w);for(let S=0;S<w;S++)if(u[S]!=p[p.length-w+S])throw c(d);return{prefix:b,bytes:p.subarray(y,p.length-w)}}lib.decode=a;function s(d){let p=d.prefix;(0,t.default)(Number.isInteger(p)&&p>=0&&p<16384,"invalid prefix");let h=d.bytes.length,y;switch(h){case 1:case 2:case 4:case 8:y=1;break;case 32:case 33:y=2;break;default:(0,t.default)(!1,"invalid address length")}let b,w;p<64?(b=bufferExports.Buffer.allocUnsafe(1+y+h),b[0]=p,w=1):(b=bufferExports.Buffer.allocUnsafe(2+y+h),b[0]=(p&252)>>2|64,b[1]=p>>8|(p&3)<<6,w=2),b.set(d.bytes,w),f(b,y);for(let S=0;S<y;S++)b[w+h+S]=u[S];return o.encode(b)}lib.encode=s;function f(d,p){let h=(0,n.default)(64);h.update(i),h.update(d.subarray(0,d.length-p)),h.digest(u)}function c(d){return new Error("Invalid ss58 address: "+d)}return lib}var libExports=requireLib();function base$2(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let f=0;f<t.length;f++)t[f]=255;for(let f=0;f<e.length;f++){const c=e.charAt(f),d=c.charCodeAt(0);if(t[d]!==255)throw new TypeError(c+" is ambiguous");t[d]=f}const r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),i=Math.log(256)/Math.log(r);function u(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";let c=0,d=0,p=0;const h=f.length;for(;p!==h&&f[p]===0;)p++,c++;const y=(h-p)*i+1>>>0,b=new Uint8Array(y);for(;p!==h;){let E=f[p],B=0;for(let ae=y-1;(E!==0||B<d)&&ae!==-1;ae--,B++)E+=256*b[ae]>>>0,b[ae]=E%r>>>0,E=E/r>>>0;if(E!==0)throw new Error("Non-zero carry");d=B,p++}let w=y-d;for(;w!==y&&b[w]===0;)w++;let S=n.repeat(c);for(;w<y;++w)S+=e.charAt(b[w]);return S}function a(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let c=0,d=0,p=0;for(;f[c]===n;)d++,c++;const h=(f.length-c)*o+1>>>0,y=new Uint8Array(h);for(;c<f.length;){const E=f.charCodeAt(c);if(E>255)return;let B=t[E];if(B===255)return;let ae=0;for(let W=h-1;(B!==0||ae<p)&&W!==-1;W--,ae++)B+=r*y[W]>>>0,y[W]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");p=ae,c++}let b=h-p;for(;b!==h&&y[b]===0;)b++;const w=new Uint8Array(d+(h-b));let S=d;for(;b!==h;)w[S++]=y[b++];return w}function s(f){const c=a(f);if(c)return c;throw new Error("Non-base"+r+" character")}return{encode:u,decodeUnsafe:a,decode:s}}var ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const bs58=base$2(ALPHABET);function bs58checkBase(e){function t(i){var u=Uint8Array.from(i),a=e(u),s=u.length+4,f=new Uint8Array(s);return f.set(u,0),f.set(a.subarray(0,4),u.length),bs58.encode(f)}function r(i){var u=i.slice(0,-4),a=i.slice(-4),s=e(u);if(!(a[0]^s[0]|a[1]^s[1]|a[2]^s[2]|a[3]^s[3]))return u}function n(i){var u=bs58.decodeUnsafe(i);if(u!=null)return r(u)}function o(i){var u=bs58.decode(i),a=r(u);if(a==null)throw new Error("Invalid checksum");return a}return{encode:t,decode:o,decodeUnsafe:n}}function sha256x2(e){return sha256$3(sha256$3(e))}const bs58check=bs58checkBase(sha256x2);var dist$2={},hasRequiredDist$1;function requireDist$1(){if(hasRequiredDist$1)return dist$2;hasRequiredDist$1=1,Object.defineProperty(dist$2,"__esModule",{value:!0}),dist$2.bech32m=dist$2.bech32=void 0;const e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",t={};for(let f=0;f<e.length;f++){const c=e.charAt(f);t[c]=f}function r(f){const c=f>>25;return(f&33554431)<<5^-(c>>0&1)&996825010^-(c>>1&1)&642813549^-(c>>2&1)&513874426^-(c>>3&1)&1027748829^-(c>>4&1)&705979059}function n(f){let c=1;for(let d=0;d<f.length;++d){const p=f.charCodeAt(d);if(p<33||p>126)return"Invalid prefix ("+f+")";c=r(c)^p>>5}c=r(c);for(let d=0;d<f.length;++d){const p=f.charCodeAt(d);c=r(c)^p&31}return c}function o(f,c,d,p){let h=0,y=0;const b=(1<<d)-1,w=[];for(let S=0;S<f.length;++S)for(h=h<<c|f[S],y+=c;y>=d;)y-=d,w.push(h>>y&b);if(p)y>0&&w.push(h<<d-y&b);else{if(y>=c)return"Excess padding";if(h<<d-y&b)return"Non-zero padding"}return w}function i(f){return o(f,8,5,!0)}function u(f){const c=o(f,5,8,!1);if(Array.isArray(c))return c}function a(f){const c=o(f,5,8,!1);if(Array.isArray(c))return c;throw new Error(c)}function s(f){let c;f==="bech32"?c=1:c=734539939;function d(b,w,S){if(S=S||90,b.length+7+w.length>S)throw new TypeError("Exceeds length limit");b=b.toLowerCase();let E=n(b);if(typeof E=="string")throw new Error(E);let B=b+"1";for(let ae=0;ae<w.length;++ae){const W=w[ae];if(W>>5!==0)throw new Error("Non 5-bit word");E=r(E)^W,B+=e.charAt(W)}for(let ae=0;ae<6;++ae)E=r(E);E^=c;for(let ae=0;ae<6;++ae){const W=E>>(5-ae)*5&31;B+=e.charAt(W)}return B}function p(b,w){if(w=w||90,b.length<8)return b+" too short";if(b.length>w)return"Exceeds length limit";const S=b.toLowerCase(),E=b.toUpperCase();if(b!==S&&b!==E)return"Mixed-case string "+b;b=S;const B=b.lastIndexOf("1");if(B===-1)return"No separator character for "+b;if(B===0)return"Missing prefix for "+b;const ae=b.slice(0,B),W=b.slice(B+1);if(W.length<6)return"Data too short";let J=n(ae);if(typeof J=="string")return J;const ve=[];for(let Qe=0;Qe<W.length;++Qe){const kt=W.charAt(Qe),nr=t[kt];if(nr===void 0)return"Unknown character "+kt;J=r(J)^nr,!(Qe+6>=W.length)&&ve.push(nr)}return J!==c?"Invalid checksum for "+b:{prefix:ae,words:ve}}function h(b,w){const S=p(b,w);if(typeof S=="object")return S}function y(b,w){const S=p(b,w);if(typeof S=="object")return S;throw new Error(S)}return{decodeUnsafe:h,decode:y,encode:d,toWords:i,fromWordsUnsafe:u,fromWords:a}}return dist$2.bech32=s("bech32"),dist$2.bech32m=s("bech32m"),dist$2}var distExports$1=requireDist$1(),base32$1={exports:{}},hasRequiredBase32;function requireBase32(){return hasRequiredBase32||(hasRequiredBase32=1,(function(e){(function(){var t=typeof window=="object"?window:{},r=!t.HI_BASE32_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;r&&(t=commonjsGlobal);var n=!t.HI_BASE32_NO_COMMON_JS&&!0&&e.exports,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),i={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},u=[0,0,0,0,0,0,0,0],a=function(w,S){S.length>10&&(S="..."+S.substr(-10));var E=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+w+" bytes: "+S+" <-");throw E.position=w,E},s=function(w){for(var S="",E=w.length,B=0,ae=0,W,J;B<E;){if(W=w[B++],W<=127){S+=String.fromCharCode(W);continue}else W>191&&W<=223?(J=W&31,ae=1):W<=239?(J=W&15,ae=2):W<=247?(J=W&7,ae=3):a(B,S);for(var ve=0;ve<ae;++ve)W=w[B++],(W<128||W>191)&&a(B,S),J<<=6,J+=W&63;J>=55296&&J<=57343&&a(B,S),J>1114111&&a(B,S),J<=65535?S+=String.fromCharCode(J):(J-=65536,S+=String.fromCharCode((J>>10)+55296),S+=String.fromCharCode((J&1023)+56320))}return S},f=function(w){if(w==="")return[];if(!/^[A-Z2-7=]+$/.test(w))throw new Error("Invalid base32 characters");w=w.replace(/=/g,"");for(var S,E,B,ae,W,J,ve,Qe,kt=[],nr=0,sr=w.length,ce=0,Ze=sr>>3<<3;ce<Ze;)S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],Qe=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255,kt[nr++]=(ae<<4|W>>>1)&255,kt[nr++]=(W<<7|J<<2|ve>>>3)&255,kt[nr++]=(ve<<5|Qe)&255;var se=sr-Ze;return se===2?(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255):se===4?(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255):se===5?(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255,kt[nr++]=(ae<<4|W>>>1)&255):se===7&&(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255,kt[nr++]=(ae<<4|W>>>1)&255,kt[nr++]=(W<<7|J<<2|ve>>>3)&255),kt},c=function(w){for(var S,E,B,ae,W,J="",ve=w.length,Qe=0,kt=parseInt(ve/5)*5;Qe<kt;)S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe++),B=w.charCodeAt(Qe++),ae=w.charCodeAt(Qe++),W=w.charCodeAt(Qe++),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[(ae<<3|W>>>5)&31]+o[W&31];var nr=ve-kt;return nr===1?(S=w.charCodeAt(Qe),J+=o[S>>>3]+o[S<<2&31]+"======"):nr===2?(S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[E<<4&31]+"===="):nr===3?(S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe++),B=w.charCodeAt(Qe),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[B<<1&31]+"==="):nr===4&&(S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe++),B=w.charCodeAt(Qe++),ae=w.charCodeAt(Qe),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[ae<<3&31]+"="),J},d=function(w){var S,E,B,ae,W,J,ve=!1,Qe="",kt=0,nr,sr=0,ce=w.length;if(w==="")return Qe;do{for(u[0]=u[5],u[1]=u[6],u[2]=u[7],nr=sr;kt<ce&&nr<5;++kt)J=w.charCodeAt(kt),J<128?u[nr++]=J:J<2048?(u[nr++]=192|J>>6,u[nr++]=128|J&63):J<55296||J>=57344?(u[nr++]=224|J>>12,u[nr++]=128|J>>6&63,u[nr++]=128|J&63):(J=65536+((J&1023)<<10|w.charCodeAt(++kt)&1023),u[nr++]=240|J>>18,u[nr++]=128|J>>12&63,u[nr++]=128|J>>6&63,u[nr++]=128|J&63);sr=nr-5,kt===ce&&++kt,kt>ce&&nr<6&&(ve=!0),S=u[0],nr>4?(E=u[1],B=u[2],ae=u[3],W=u[4],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[(ae<<3|W>>>5)&31]+o[W&31]):nr===1?Qe+=o[S>>>3]+o[S<<2&31]+"======":nr===2?(E=u[1],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[E<<4&31]+"===="):nr===3?(E=u[1],B=u[2],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[B<<1&31]+"==="):(E=u[1],B=u[2],ae=u[3],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[ae<<3&31]+"=")}while(!ve);return Qe},p=function(w){for(var S,E,B,ae,W,J="",ve=w.length,Qe=0,kt=parseInt(ve/5)*5;Qe<kt;)S=w[Qe++],E=w[Qe++],B=w[Qe++],ae=w[Qe++],W=w[Qe++],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[(ae<<3|W>>>5)&31]+o[W&31];var nr=ve-kt;return nr===1?(S=w[Qe],J+=o[S>>>3]+o[S<<2&31]+"======"):nr===2?(S=w[Qe++],E=w[Qe],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[E<<4&31]+"===="):nr===3?(S=w[Qe++],E=w[Qe++],B=w[Qe],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[B<<1&31]+"==="):nr===4&&(S=w[Qe++],E=w[Qe++],B=w[Qe++],ae=w[Qe],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[ae<<3&31]+"="),J},h=function(w,S){var E=typeof w!="string";return E&&w.constructor===ArrayBuffer&&(w=new Uint8Array(w)),E?p(w):S?c(w):d(w)},y=function(w,S){if(!S)return s(f(w));if(w==="")return"";if(!/^[A-Z2-7=]+$/.test(w))throw new Error("Invalid base32 characters");var E,B,ae,W,J,ve,Qe,kt,nr="",sr=w.indexOf("=");sr===-1&&(sr=w.length);for(var ce=0,Ze=sr>>3<<3;ce<Ze;)E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],Qe=i[w.charAt(ce++)],kt=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)+String.fromCharCode((W<<4|J>>>1)&255)+String.fromCharCode((J<<7|ve<<2|Qe>>>3)&255)+String.fromCharCode((Qe<<5|kt)&255);var se=sr-Ze;return se===2?(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)):se===4?(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)):se===5?(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)+String.fromCharCode((W<<4|J>>>1)&255)):se===7&&(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],Qe=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)+String.fromCharCode((W<<4|J>>>1)&255)+String.fromCharCode((J<<7|ve<<2|Qe>>>3)&255)),nr},b={encode:h,decode:y};y.asBytes=f,n?e.exports=b:t.base32=b})()})(base32$1)),base32$1.exports}var base32Exports=requireBase32();const base32=getDefaultExportFromCjs(base32Exports);var sha512$5={exports:{}},hasRequiredSha512$2;function requireSha512$2(){return hasRequiredSha512$2||(hasRequiredSha512$2=1,(function(e){(function(){var t="input is invalid type",r="finalize already called",n=typeof window=="object",o=n?window:{};o.JS_SHA512_NO_WINDOW&&(n=!1);var i=!n&&typeof self=="object",u=!o.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;u?o=commonjsGlobal:i&&(o=self);var a=!o.JS_SHA512_NO_COMMON_JS&&!0&&e.exports,s=!o.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",f="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],d=[24,16,8,0],p=[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],h=["hex","array","digest","arrayBuffer"],y=[],b=Array.isArray;(o.JS_SHA512_NO_NODE_JS||!b)&&(b=function(kt){return Object.prototype.toString.call(kt)==="[object Array]"});var w=ArrayBuffer.isView;s&&(o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!w)&&(w=function(kt){return typeof kt=="object"&&kt.buffer&&kt.buffer.constructor===ArrayBuffer});var S=function(kt){var nr=typeof kt;if(nr==="string")return[kt,!0];if(nr!=="object"||kt===null)throw new Error(t);if(s&&kt.constructor===ArrayBuffer)return[new Uint8Array(kt),!1];if(!b(kt)&&!w(kt))throw new Error(t);return[kt,!1]},E=function(kt,nr){return function(sr){return new J(nr,!0).update(sr)[kt]()}},B=function(kt){var nr=E("hex",kt);nr.create=function(){return new J(kt)},nr.update=function(Ze){return nr.create().update(Ze)};for(var sr=0;sr<h.length;++sr){var ce=h[sr];nr[ce]=E(ce,kt)}return nr},ae=function(kt,nr){return function(sr,ce){return new ve(sr,nr,!0).update(ce)[kt]()}},W=function(kt){var nr=ae("hex",kt);nr.create=function(Ze){return new ve(Ze,kt)},nr.update=function(Ze,se){return nr.create(Ze).update(se)};for(var sr=0;sr<h.length;++sr){var ce=h[sr];nr[ce]=ae(ce,kt)}return nr};function J(kt,nr){nr?(y[0]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=y[16]=y[17]=y[18]=y[19]=y[20]=y[21]=y[22]=y[23]=y[24]=y[25]=y[26]=y[27]=y[28]=y[29]=y[30]=y[31]=y[32]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],kt==384?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):kt==256?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):kt==224?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=kt,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}J.prototype.update=function(kt){if(this.finalized)throw new Error(r);var nr=S(kt);kt=nr[0];for(var sr=nr[1],ce,Ze=0,se,vt=kt.length,ur=this.blocks;Ze<vt;){if(this.hashed&&(this.hashed=!1,ur[0]=this.block,this.block=ur[1]=ur[2]=ur[3]=ur[4]=ur[5]=ur[6]=ur[7]=ur[8]=ur[9]=ur[10]=ur[11]=ur[12]=ur[13]=ur[14]=ur[15]=ur[16]=ur[17]=ur[18]=ur[19]=ur[20]=ur[21]=ur[22]=ur[23]=ur[24]=ur[25]=ur[26]=ur[27]=ur[28]=ur[29]=ur[30]=ur[31]=ur[32]=0),sr)for(se=this.start;Ze<vt&&se<128;++Ze)ce=kt.charCodeAt(Ze),ce<128?ur[se>>>2]|=ce<<d[se++&3]:ce<2048?(ur[se>>>2]|=(192|ce>>>6)<<d[se++&3],ur[se>>>2]|=(128|ce&63)<<d[se++&3]):ce<55296||ce>=57344?(ur[se>>>2]|=(224|ce>>>12)<<d[se++&3],ur[se>>>2]|=(128|ce>>>6&63)<<d[se++&3],ur[se>>>2]|=(128|ce&63)<<d[se++&3]):(ce=65536+((ce&1023)<<10|kt.charCodeAt(++Ze)&1023),ur[se>>>2]|=(240|ce>>>18)<<d[se++&3],ur[se>>>2]|=(128|ce>>>12&63)<<d[se++&3],ur[se>>>2]|=(128|ce>>>6&63)<<d[se++&3],ur[se>>>2]|=(128|ce&63)<<d[se++&3]);else for(se=this.start;Ze<vt&&se<128;++Ze)ur[se>>>2]|=kt[Ze]<<d[se++&3];this.lastByteIndex=se,this.bytes+=se-this.start,se>=128?(this.block=ur[32],this.start=se-128,this.hash(),this.hashed=!0):this.start=se}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var kt=this.blocks,nr=this.lastByteIndex;kt[32]=this.block,kt[nr>>>2]|=c[nr&3],this.block=kt[32],nr>=112&&(this.hashed||this.hash(),kt[0]=this.block,kt[1]=kt[2]=kt[3]=kt[4]=kt[5]=kt[6]=kt[7]=kt[8]=kt[9]=kt[10]=kt[11]=kt[12]=kt[13]=kt[14]=kt[15]=kt[16]=kt[17]=kt[18]=kt[19]=kt[20]=kt[21]=kt[22]=kt[23]=kt[24]=kt[25]=kt[26]=kt[27]=kt[28]=kt[29]=kt[30]=kt[31]=kt[32]=0),kt[30]=this.hBytes<<3|this.bytes>>>29,kt[31]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var kt=this.h0h,nr=this.h0l,sr=this.h1h,ce=this.h1l,Ze=this.h2h,se=this.h2l,vt=this.h3h,ur=this.h3l,ue=this.h4h,bt=this.h4l,L=this.h5h,_=this.h5l,F=this.h6h,k=this.h6l,Ye=this.h7h,rn=this.h7l,ii=this.blocks,ai,ni,ri,ui,lr,ar,jr,ci,mi,pi,ei,Gr,ti,fi,bi,Ai,Bi,qi,vn,di,rr,on,si,vi,Ei;for(ai=32;ai<160;ai+=2)di=ii[ai-30],rr=ii[ai-29],ni=(di>>>1|rr<<31)^(di>>>8|rr<<24)^di>>>7,ri=(rr>>>1|di<<31)^(rr>>>8|di<<24)^(rr>>>7|di<<25),di=ii[ai-4],rr=ii[ai-3],ui=(di>>>19|rr<<13)^(rr>>>29|di<<3)^di>>>6,lr=(rr>>>19|di<<13)^(di>>>29|rr<<3)^(rr>>>6|di<<26),di=ii[ai-32],rr=ii[ai-31],on=ii[ai-14],si=ii[ai-13],ar=(si&65535)+(rr&65535)+(ri&65535)+(lr&65535),jr=(si>>>16)+(rr>>>16)+(ri>>>16)+(lr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(ni&65535)+(ui&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ni>>>16)+(ui>>>16)+(ci>>>16),ii[ai]=mi<<16|ci&65535,ii[ai+1]=jr<<16|ar&65535;var Mi=kt,Di=nr,Ii=sr,Ci=ce,Vi=Ze,Hi=se,Ji=vt,no=ur,co=ue,Fo=bt,Io=L,Ro=_,Oo=F,To=k,Po=Ye,ia=rn;for(Ai=Ii&Vi,Bi=Ci&Hi,ai=0;ai<160;ai+=8)ni=(Mi>>>28|Di<<4)^(Di>>>2|Mi<<30)^(Di>>>7|Mi<<25),ri=(Di>>>28|Mi<<4)^(Mi>>>2|Di<<30)^(Mi>>>7|Di<<25),ui=(co>>>14|Fo<<18)^(co>>>18|Fo<<14)^(Fo>>>9|co<<23),lr=(Fo>>>14|co<<18)^(Fo>>>18|co<<14)^(co>>>9|Fo<<23),pi=Mi&Ii,ei=Di&Ci,qi=pi^Mi&Vi^Ai,vn=ei^Di&Hi^Bi,vi=co&Io^~co&Oo,Ei=Fo&Ro^~Fo&To,di=ii[ai],rr=ii[ai+1],on=p[ai],si=p[ai+1],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(ia&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(ia>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(Po&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(Po>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(no&65535)+(rr&65535),jr=(no>>>16)+(rr>>>16)+(ar>>>16),ci=(Ji&65535)+(di&65535)+(jr>>>16),mi=(Ji>>>16)+(di>>>16)+(ci>>>16),Po=mi<<16|ci&65535,ia=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Ji=mi<<16|ci&65535,no=jr<<16|ar&65535,ni=(Ji>>>28|no<<4)^(no>>>2|Ji<<30)^(no>>>7|Ji<<25),ri=(no>>>28|Ji<<4)^(Ji>>>2|no<<30)^(Ji>>>7|no<<25),ui=(Po>>>14|ia<<18)^(Po>>>18|ia<<14)^(ia>>>9|Po<<23),lr=(ia>>>14|Po<<18)^(ia>>>18|Po<<14)^(Po>>>9|ia<<23),Gr=Ji&Mi,ti=no&Di,qi=Gr^Ji&Ii^pi,vn=ti^no&Ci^ei,vi=Po&co^~Po&Io,Ei=ia&Fo^~ia&Ro,di=ii[ai+2],rr=ii[ai+3],on=p[ai+2],si=p[ai+3],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(To&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(To>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(Oo&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(Oo>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(Hi&65535)+(rr&65535),jr=(Hi>>>16)+(rr>>>16)+(ar>>>16),ci=(Vi&65535)+(di&65535)+(jr>>>16),mi=(Vi>>>16)+(di>>>16)+(ci>>>16),Oo=mi<<16|ci&65535,To=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Vi=mi<<16|ci&65535,Hi=jr<<16|ar&65535,ni=(Vi>>>28|Hi<<4)^(Hi>>>2|Vi<<30)^(Hi>>>7|Vi<<25),ri=(Hi>>>28|Vi<<4)^(Vi>>>2|Hi<<30)^(Vi>>>7|Hi<<25),ui=(Oo>>>14|To<<18)^(Oo>>>18|To<<14)^(To>>>9|Oo<<23),lr=(To>>>14|Oo<<18)^(To>>>18|Oo<<14)^(Oo>>>9|To<<23),fi=Vi&Ji,bi=Hi&no,qi=fi^Vi&Mi^Gr,vn=bi^Hi&Di^ti,vi=Oo&Po^~Oo&co,Ei=To&ia^~To&Fo,di=ii[ai+4],rr=ii[ai+5],on=p[ai+4],si=p[ai+5],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(Ro&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(Ro>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(Io&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(Io>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(Ci&65535)+(rr&65535),jr=(Ci>>>16)+(rr>>>16)+(ar>>>16),ci=(Ii&65535)+(di&65535)+(jr>>>16),mi=(Ii>>>16)+(di>>>16)+(ci>>>16),Io=mi<<16|ci&65535,Ro=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Ii=mi<<16|ci&65535,Ci=jr<<16|ar&65535,ni=(Ii>>>28|Ci<<4)^(Ci>>>2|Ii<<30)^(Ci>>>7|Ii<<25),ri=(Ci>>>28|Ii<<4)^(Ii>>>2|Ci<<30)^(Ii>>>7|Ci<<25),ui=(Io>>>14|Ro<<18)^(Io>>>18|Ro<<14)^(Ro>>>9|Io<<23),lr=(Ro>>>14|Io<<18)^(Ro>>>18|Io<<14)^(Io>>>9|Ro<<23),Ai=Ii&Vi,Bi=Ci&Hi,qi=Ai^Ii&Ji^fi,vn=Bi^Ci&no^bi,vi=Io&Oo^~Io&Po,Ei=Ro&To^~Ro&ia,di=ii[ai+6],rr=ii[ai+7],on=p[ai+6],si=p[ai+7],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(Fo&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(Fo>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(co&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(co>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(Di&65535)+(rr&65535),jr=(Di>>>16)+(rr>>>16)+(ar>>>16),ci=(Mi&65535)+(di&65535)+(jr>>>16),mi=(Mi>>>16)+(di>>>16)+(ci>>>16),co=mi<<16|ci&65535,Fo=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Mi=mi<<16|ci&65535,Di=jr<<16|ar&65535;ar=(nr&65535)+(Di&65535),jr=(nr>>>16)+(Di>>>16)+(ar>>>16),ci=(kt&65535)+(Mi&65535)+(jr>>>16),mi=(kt>>>16)+(Mi>>>16)+(ci>>>16),this.h0h=mi<<16|ci&65535,this.h0l=jr<<16|ar&65535,ar=(ce&65535)+(Ci&65535),jr=(ce>>>16)+(Ci>>>16)+(ar>>>16),ci=(sr&65535)+(Ii&65535)+(jr>>>16),mi=(sr>>>16)+(Ii>>>16)+(ci>>>16),this.h1h=mi<<16|ci&65535,this.h1l=jr<<16|ar&65535,ar=(se&65535)+(Hi&65535),jr=(se>>>16)+(Hi>>>16)+(ar>>>16),ci=(Ze&65535)+(Vi&65535)+(jr>>>16),mi=(Ze>>>16)+(Vi>>>16)+(ci>>>16),this.h2h=mi<<16|ci&65535,this.h2l=jr<<16|ar&65535,ar=(ur&65535)+(no&65535),jr=(ur>>>16)+(no>>>16)+(ar>>>16),ci=(vt&65535)+(Ji&65535)+(jr>>>16),mi=(vt>>>16)+(Ji>>>16)+(ci>>>16),this.h3h=mi<<16|ci&65535,this.h3l=jr<<16|ar&65535,ar=(bt&65535)+(Fo&65535),jr=(bt>>>16)+(Fo>>>16)+(ar>>>16),ci=(ue&65535)+(co&65535)+(jr>>>16),mi=(ue>>>16)+(co>>>16)+(ci>>>16),this.h4h=mi<<16|ci&65535,this.h4l=jr<<16|ar&65535,ar=(_&65535)+(Ro&65535),jr=(_>>>16)+(Ro>>>16)+(ar>>>16),ci=(L&65535)+(Io&65535)+(jr>>>16),mi=(L>>>16)+(Io>>>16)+(ci>>>16),this.h5h=mi<<16|ci&65535,this.h5l=jr<<16|ar&65535,ar=(k&65535)+(To&65535),jr=(k>>>16)+(To>>>16)+(ar>>>16),ci=(F&65535)+(Oo&65535)+(jr>>>16),mi=(F>>>16)+(Oo>>>16)+(ci>>>16),this.h6h=mi<<16|ci&65535,this.h6l=jr<<16|ar&65535,ar=(rn&65535)+(ia&65535),jr=(rn>>>16)+(ia>>>16)+(ar>>>16),ci=(Ye&65535)+(Po&65535)+(jr>>>16),mi=(Ye>>>16)+(Po>>>16)+(ci>>>16),this.h7h=mi<<16|ci&65535,this.h7l=jr<<16|ar&65535},J.prototype.hex=function(){this.finalize();var kt=this.h0h,nr=this.h0l,sr=this.h1h,ce=this.h1l,Ze=this.h2h,se=this.h2l,vt=this.h3h,ur=this.h3l,ue=this.h4h,bt=this.h4l,L=this.h5h,_=this.h5l,F=this.h6h,k=this.h6l,Ye=this.h7h,rn=this.h7l,ii=this.bits,ai=f[kt>>>28&15]+f[kt>>>24&15]+f[kt>>>20&15]+f[kt>>>16&15]+f[kt>>>12&15]+f[kt>>>8&15]+f[kt>>>4&15]+f[kt&15]+f[nr>>>28&15]+f[nr>>>24&15]+f[nr>>>20&15]+f[nr>>>16&15]+f[nr>>>12&15]+f[nr>>>8&15]+f[nr>>>4&15]+f[nr&15]+f[sr>>>28&15]+f[sr>>>24&15]+f[sr>>>20&15]+f[sr>>>16&15]+f[sr>>>12&15]+f[sr>>>8&15]+f[sr>>>4&15]+f[sr&15]+f[ce>>>28&15]+f[ce>>>24&15]+f[ce>>>20&15]+f[ce>>>16&15]+f[ce>>>12&15]+f[ce>>>8&15]+f[ce>>>4&15]+f[ce&15]+f[Ze>>>28&15]+f[Ze>>>24&15]+f[Ze>>>20&15]+f[Ze>>>16&15]+f[Ze>>>12&15]+f[Ze>>>8&15]+f[Ze>>>4&15]+f[Ze&15]+f[se>>>28&15]+f[se>>>24&15]+f[se>>>20&15]+f[se>>>16&15]+f[se>>>12&15]+f[se>>>8&15]+f[se>>>4&15]+f[se&15]+f[vt>>>28&15]+f[vt>>>24&15]+f[vt>>>20&15]+f[vt>>>16&15]+f[vt>>>12&15]+f[vt>>>8&15]+f[vt>>>4&15]+f[vt&15];return ii>=256&&(ai+=f[ur>>>28&15]+f[ur>>>24&15]+f[ur>>>20&15]+f[ur>>>16&15]+f[ur>>>12&15]+f[ur>>>8&15]+f[ur>>>4&15]+f[ur&15]),ii>=384&&(ai+=f[ue>>>28&15]+f[ue>>>24&15]+f[ue>>>20&15]+f[ue>>>16&15]+f[ue>>>12&15]+f[ue>>>8&15]+f[ue>>>4&15]+f[ue&15]+f[bt>>>28&15]+f[bt>>>24&15]+f[bt>>>20&15]+f[bt>>>16&15]+f[bt>>>12&15]+f[bt>>>8&15]+f[bt>>>4&15]+f[bt&15]+f[L>>>28&15]+f[L>>>24&15]+f[L>>>20&15]+f[L>>>16&15]+f[L>>>12&15]+f[L>>>8&15]+f[L>>>4&15]+f[L&15]+f[_>>>28&15]+f[_>>>24&15]+f[_>>>20&15]+f[_>>>16&15]+f[_>>>12&15]+f[_>>>8&15]+f[_>>>4&15]+f[_&15]),ii==512&&(ai+=f[F>>>28&15]+f[F>>>24&15]+f[F>>>20&15]+f[F>>>16&15]+f[F>>>12&15]+f[F>>>8&15]+f[F>>>4&15]+f[F&15]+f[k>>>28&15]+f[k>>>24&15]+f[k>>>20&15]+f[k>>>16&15]+f[k>>>12&15]+f[k>>>8&15]+f[k>>>4&15]+f[k&15]+f[Ye>>>28&15]+f[Ye>>>24&15]+f[Ye>>>20&15]+f[Ye>>>16&15]+f[Ye>>>12&15]+f[Ye>>>8&15]+f[Ye>>>4&15]+f[Ye&15]+f[rn>>>28&15]+f[rn>>>24&15]+f[rn>>>20&15]+f[rn>>>16&15]+f[rn>>>12&15]+f[rn>>>8&15]+f[rn>>>4&15]+f[rn&15]),ai},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var kt=this.h0h,nr=this.h0l,sr=this.h1h,ce=this.h1l,Ze=this.h2h,se=this.h2l,vt=this.h3h,ur=this.h3l,ue=this.h4h,bt=this.h4l,L=this.h5h,_=this.h5l,F=this.h6h,k=this.h6l,Ye=this.h7h,rn=this.h7l,ii=this.bits,ai=[kt>>>24&255,kt>>>16&255,kt>>>8&255,kt&255,nr>>>24&255,nr>>>16&255,nr>>>8&255,nr&255,sr>>>24&255,sr>>>16&255,sr>>>8&255,sr&255,ce>>>24&255,ce>>>16&255,ce>>>8&255,ce&255,Ze>>>24&255,Ze>>>16&255,Ze>>>8&255,Ze&255,se>>>24&255,se>>>16&255,se>>>8&255,se&255,vt>>>24&255,vt>>>16&255,vt>>>8&255,vt&255];return ii>=256&&ai.push(ur>>>24&255,ur>>>16&255,ur>>>8&255,ur&255),ii>=384&&ai.push(ue>>>24&255,ue>>>16&255,ue>>>8&255,ue&255,bt>>>24&255,bt>>>16&255,bt>>>8&255,bt&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255),ii==512&&ai.push(F>>>24&255,F>>>16&255,F>>>8&255,F&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255,Ye>>>24&255,Ye>>>16&255,Ye>>>8&255,Ye&255,rn>>>24&255,rn>>>16&255,rn>>>8&255,rn&255),ai},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var kt=this.bits,nr=new ArrayBuffer(kt/8),sr=new DataView(nr);return sr.setUint32(0,this.h0h),sr.setUint32(4,this.h0l),sr.setUint32(8,this.h1h),sr.setUint32(12,this.h1l),sr.setUint32(16,this.h2h),sr.setUint32(20,this.h2l),sr.setUint32(24,this.h3h),kt>=256&&sr.setUint32(28,this.h3l),kt>=384&&(sr.setUint32(32,this.h4h),sr.setUint32(36,this.h4l),sr.setUint32(40,this.h5h),sr.setUint32(44,this.h5l)),kt==512&&(sr.setUint32(48,this.h6h),sr.setUint32(52,this.h6l),sr.setUint32(56,this.h7h),sr.setUint32(60,this.h7l)),nr},J.prototype.clone=function(){var kt=new J(this.bits,!1);return this.copyTo(kt),kt},J.prototype.copyTo=function(kt){var nr=0,sr=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(nr=0;nr<sr.length;++nr)kt[sr[nr]]=this[sr[nr]];for(nr=0;nr<this.blocks.length;++nr)kt.blocks[nr]=this.blocks[nr]};function ve(kt,nr,sr){var ce,Ze=S(kt);if(kt=Ze[0],Ze[1]){for(var se=[],vt=kt.length,ur=0,ue,ce=0;ce<vt;++ce)ue=kt.charCodeAt(ce),ue<128?se[ur++]=ue:ue<2048?(se[ur++]=192|ue>>>6,se[ur++]=128|ue&63):ue<55296||ue>=57344?(se[ur++]=224|ue>>>12,se[ur++]=128|ue>>>6&63,se[ur++]=128|ue&63):(ue=65536+((ue&1023)<<10|kt.charCodeAt(++ce)&1023),se[ur++]=240|ue>>>18,se[ur++]=128|ue>>>12&63,se[ur++]=128|ue>>>6&63,se[ur++]=128|ue&63);kt=se}kt.length>128&&(kt=new J(nr,!0).update(kt).array());for(var bt=[],L=[],ce=0;ce<128;++ce){var _=kt[ce]||0;bt[ce]=92^_,L[ce]=54^_}J.call(this,nr,sr),this.update(L),this.oKeyPad=bt,this.inner=!0,this.sharedMemory=sr}ve.prototype=new J,ve.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var kt=this.array();J.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(kt),J.prototype.finalize.call(this)}},ve.prototype.clone=function(){var kt=new ve([],this.bits,!1);this.copyTo(kt),kt.inner=this.inner;for(var nr=0;nr<this.oKeyPad.length;++nr)kt.oKeyPad[nr]=this.oKeyPad[nr];return kt};var Qe=B(512);Qe.sha512=Qe,Qe.sha384=B(384),Qe.sha512_256=B(256),Qe.sha512_224=B(224),Qe.sha512.hmac=W(512),Qe.sha384.hmac=W(384),Qe.sha512_256.hmac=W(256),Qe.sha512_224.hmac=W(224),a?e.exports=Qe:(o.sha512=Qe.sha512,o.sha384=Qe.sha384,o.sha512_256=Qe.sha512_256,o.sha512_224=Qe.sha512_224)})()})(sha512$5)),sha512$5.exports}var sha512Exports$1=requireSha512$2();const sha512$4=getDefaultExportFromCjs(sha512Exports$1),version$1="3.7.8",VERSION=version$1,_hasBuffer=typeof bufferExports.Buffer=="function",_TD=typeof TextDecoder=="function"?new TextDecoder:void 0,_TE=typeof TextEncoder=="function"?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(b64chs),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),_mkUriSafe=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),_tidyB64=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=e=>{let t,r,n,o,i="";const u=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,i+=b64chs[t>>18&63]+b64chs[t>>12&63]+b64chs[t>>6&63]+b64chs[t&63]}return u?i.slice(0,u-3)+"===".substring(u):i},_btoa=typeof btoa=="function"?e=>btoa(e):_hasBuffer?e=>bufferExports.Buffer.from(e,"binary").toString("base64"):btoaPolyfill,_fromUint8Array=_hasBuffer?e=>bufferExports.Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(_fromCC.apply(null,e.subarray(n,n+4096)));return _btoa(r.join(""))},fromUint8Array=(e,t=!1)=>t?_mkUriSafe(_fromUint8Array(e)):_fromUint8Array(e),cb_utob=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?_fromCC(192|t>>>6)+_fromCC(128|t&63):_fromCC(224|t>>>12&15)+_fromCC(128|t>>>6&63)+_fromCC(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return _fromCC(240|t>>>18&7)+_fromCC(128|t>>>12&63)+_fromCC(128|t>>>6&63)+_fromCC(128|t&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=e=>e.replace(re_utob,cb_utob),_encode=_hasBuffer?e=>bufferExports.Buffer.from(e,"utf8").toString("base64"):_TE?e=>_fromUint8Array(_TE.encode(e)):e=>_btoa(utob(e)),encode$1=(e,t=!1)=>t?_mkUriSafe(_encode(e)):_encode(e),encodeURI$1=e=>encode$1(e,!0),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return _fromCC((r>>>10)+55296)+_fromCC((r&1023)+56320);case 3:return _fromCC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return _fromCC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=e=>e.replace(re_btou,cb_btou),atobPolyfill=e=>{if(e=e.replace(/\s+/g,""),!b64re.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,o=[];for(let i=0;i<e.length;)t=b64tab[e.charAt(i++)]<<18|b64tab[e.charAt(i++)]<<12|(r=b64tab[e.charAt(i++)])<<6|(n=b64tab[e.charAt(i++)]),r===64?o.push(_fromCC(t>>16&255)):n===64?o.push(_fromCC(t>>16&255,t>>8&255)):o.push(_fromCC(t>>16&255,t>>8&255,t&255));return o.join("")},_atob=typeof atob=="function"?e=>atob(_tidyB64(e)):_hasBuffer?e=>bufferExports.Buffer.from(e,"base64").toString("binary"):atobPolyfill,_toUint8Array=_hasBuffer?e=>_U8Afrom(bufferExports.Buffer.from(e,"base64")):e=>_U8Afrom(_atob(e).split("").map(t=>t.charCodeAt(0))),toUint8Array=e=>_toUint8Array(_unURI(e)),_decode=_hasBuffer?e=>bufferExports.Buffer.from(e,"base64").toString("utf8"):_TD?e=>_TD.decode(_toUint8Array(e)):e=>btou(_atob(e)),_unURI=e=>_tidyB64(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),decode$1=e=>_decode(_unURI(e)),isValid$1=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},_noEnum=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),extendString=function(){const e=(t,r)=>Object.defineProperty(String.prototype,t,_noEnum(r));e("fromBase64",function(){return decode$1(this)}),e("toBase64",function(t){return encode$1(this,t)}),e("toBase64URI",function(){return encode$1(this,!0)}),e("toBase64URL",function(){return encode$1(this,!0)}),e("toUint8Array",function(){return toUint8Array(this)})},extendUint8Array=function(){const e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,_noEnum(r));e("toBase64",function(t){return fromUint8Array(this,t)}),e("toBase64URI",function(){return fromUint8Array(this,!0)}),e("toBase64URL",function(){return fromUint8Array(this,!0)})},extendBuiltins=()=>{extendString(),extendUint8Array()},gBase64={version:version$1,VERSION,atob:_atob,atobPolyfill,btoa:_btoa,btoaPolyfill,fromBase64:decode$1,toBase64:encode$1,encode:encode$1,encodeURI:encodeURI$1,encodeURL:encodeURI$1,utob,btou,decode:decode$1,isValid:isValid$1,fromUint8Array,toUint8Array,extendString,extendUint8Array,extendBuiltins},MALFORMED_ERROR_MSG=e=>`${e} is malformed`,CHECKSUM_ERROR_MSG=e=>`${e} checksum is wrong`,BLOCK_HASH_BYTE_LENGTH$1=32,TX_ID_BYTE_LENGTH$1=32,ADDRESS_BYTE_LENGTH$1=36,CHECKSUM_BYTE_LENGTH=4,ADDRESS_LENGTH=58,HASH_BYTES_LENGTH$1=32,PUBLIC_KEY_LENGTH$1=32,MALFORMED_BLOCK_HASH_ERROR_MSG$1=MALFORMED_ERROR_MSG("block hash"),MALFORMED_TX_ID_ERROR_MSG$1=MALFORMED_ERROR_MSG("tx id"),MALFORMED_ADDRESS_ERROR_MSG$2=MALFORMED_ERROR_MSG("address"),CHECKSUM_ADDRESS_ERROR_MSG$2=CHECKSUM_ERROR_MSG("address");function checksumFromPublicKey$1(e){return Uint8Array.from(sha512$4.sha512_256.array(e).slice(HASH_BYTES_LENGTH$1-CHECKSUM_BYTE_LENGTH,HASH_BYTES_LENGTH$1))}function verifyAlgorandAddress(e){if(typeof e!="string")throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$2}: expected string, got ${typeof e}, ${e}`);if(e.length!==ADDRESS_LENGTH)throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$2}: expected length ${ADDRESS_LENGTH}, got ${e.length}: ${e}`);const t=base32.decode.asBytes(e);if(t.length!==ADDRESS_BYTE_LENGTH$1)throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$2}: expected byte length ${ADDRESS_BYTE_LENGTH$1}, got ${t.length}`);const r=new Uint8Array(t.slice(0,ADDRESS_BYTE_LENGTH$1-CHECKSUM_BYTE_LENGTH)),n=new Uint8Array(t.slice(PUBLIC_KEY_LENGTH$1,ADDRESS_BYTE_LENGTH$1)),o=checksumFromPublicKey$1(r);if(!arrayEqual$1(o,n))throw new Error(CHECKSUM_ADDRESS_ERROR_MSG$2);return!0}function verifyAlgorandBlockHash(e){const t=gBase64.toUint8Array("3KYSrPgi16Cl3iLu3r+GaeZkBBrgNFbMB60jsrJtTdI=");if(t.length!==TX_ID_BYTE_LENGTH$1)throw new Error(`${MALFORMED_TX_ID_ERROR_MSG$1}: expected byte length ${TX_ID_BYTE_LENGTH$1}, got ${t.length}`);return!0}function verifyAlgorandTransactionHash(e){const t=base32.decode.asBytes(e);if(t.length!==BLOCK_HASH_BYTE_LENGTH$1)throw new Error(`${MALFORMED_BLOCK_HASH_ERROR_MSG$1}: expected byte length ${MALFORMED_BLOCK_HASH_ERROR_MSG$1}, got ${t.length}`);return!0}function arrayEqual$1(e,t){return e.length!==t.length?!1:Array.from(e).every((r,n)=>r===t[n])}const BLOCK_HASH_BYTE_LENGTH=34,TX_ID_BYTE_LENGTH=34,ADDRESS_BYTE_LENGTH=36,MALFORMED_BLOCK_HASH_ERROR_MSG=MALFORMED_ERROR_MSG("block hash"),MALFORMED_TX_ID_ERROR_MSG=MALFORMED_ERROR_MSG("tx id"),MALFORMED_ADDRESS_ERROR_MSG$1=MALFORMED_ERROR_MSG("address");function verifyMinaAddress(e){const t=bs58check.decode(e);if(t.length!==ADDRESS_BYTE_LENGTH)throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$1}: expected byte length ${ADDRESS_BYTE_LENGTH}, got ${t.length}`);return!0}function verifyMinaBlockHash(e){const t=bs58check.decode(e);if(t.length!==TX_ID_BYTE_LENGTH)throw new Error(`${MALFORMED_BLOCK_HASH_ERROR_MSG}: expected byte length ${BLOCK_HASH_BYTE_LENGTH}, got ${t.length}`);return!0}function verifyMinaTransactionHash(e){const t=bs58check.decode(e);if(t.length!==TX_ID_BYTE_LENGTH)throw new Error(`${MALFORMED_TX_ID_ERROR_MSG}: expected byte length ${TX_ID_BYTE_LENGTH}, got ${t.length}`);return!0}function crc32GenerateTables({polynomial:e,numTables:t}){const r=new Uint32Array(256*t);for(let n=0;n<256;n++){let o=n;o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,r[n]=o}for(let n=256;n<r.length;n++){const o=r[n-256];r[n]=r[o&255]^o>>>8}return r}const CRC32_TABLE=crc32GenerateTables({polynomial:3988292384,numTables:8});function crc32Init(){return-1}function crc32Update(e,t){const r=t.byteLength,n=new DataView(t.buffer,t.byteOffset,r);let o=e,i=0;const u=-n.byteOffset&3;for(;i<u&&i<r;i++)o=CRC32_TABLE[(o^n.getUint8(i))&255]^o>>>8;if(i===r)return o;i=u;let a=r-i;for(;a>=8;i+=8,a-=8){o^=n.getUint32(i,!0);const s=n.getUint32(i+4,!0);o=CRC32_TABLE[0*256+(s>>>24&255)]^CRC32_TABLE[1*256+(s>>>16&255)]^CRC32_TABLE[2*256+(s>>>8&255)]^CRC32_TABLE[3*256+(s>>>0&255)]^CRC32_TABLE[4*256+(o>>>24&255)]^CRC32_TABLE[5*256+(o>>>16&255)]^CRC32_TABLE[6*256+(o>>>8&255)]^CRC32_TABLE[7*256+(o>>>0&255)]}for(let s=i;s<r;s++)o=CRC32_TABLE[(o^n.getUint8(s))&255]^o>>>8;return o}function crc32Final(e){return(e^-1)>>>0}function crc32(e){return crc32Final(crc32Update(crc32Init(),e))}const CborContentException=Error,CborInvalidOperationException=Error,UNEXPECTED_END_OF_BUFFER_MSG="Unexpected end of buffer",Im=class Im{constructor(t){this.initialByte=t}CborInitialByte(t,r){this.initialByte=t<<5|r}static from(t){return new Im(t)}getInitialByte(){return this.initialByte}getMajorType(){return this.initialByte>>5}getAdditionalInfo(){return this.initialByte&Im.AdditionalInformationMask}};Im.IndefiniteLengthBreakByte=255,Im.AdditionalInformationMask=31;let CborInitialByte=Im;class MiniCborReader{#t;#n=0;#g=new Array;#f=!1;#i;#b=0;constructor(t){this.#t=new Uint8Array(bufferExports.Buffer.from(t,"hex")),this.#i={currentKeyOffset:null,frameOffset:0,itemsRead:0,type:null}}readStartArray(){const t=this.#c(4);if(t.getAdditionalInfo()===31)return this.#d(1),this.#l(4),null;const r=this.#h(),{length:n,bytesRead:o}=MiniCborReader.#m(t,r);return this.#d(o),this.#l(4,n),n}readTag(){const{tag:t,bytesRead:r}=this.#y();return this.#d(r),this.#f=!0,t}readByteString(){const t=this.#c(2);if(t.getAdditionalInfo()===31){const{val:i,encodingLength:u}=this.#a(2);return this.#d(u),this.#r(),i}const r=this.#h(),{length:n,bytesRead:o}=MiniCborReader.#m(t,r);return this.#p(o+n),this.#d(o+n),this.#r(),r.slice(o,o+n)}readInt(){const t=this.#o();return this.#d(t.bytesRead),this.#r(),t.signedInt}#o(){const t=this.#c();switch(t.getMajorType()){case 0:{const{unsignedInt:r,bytesRead:n}=MiniCborReader.#u(t,this.#h());return{bytesRead:n,signedInt:BigInt(r)}}case 1:{const{unsignedInt:r,bytesRead:n}=MiniCborReader.#u(t,this.#h());return{bytesRead:n,signedInt:BigInt(-1)-r}}default:throw new CborInvalidOperationException(`Reader type mismatch, expected 0 or 1 but got ${t.getMajorType()}`)}}#p(t){if(this.#t.length-this.#n<t)throw new CborContentException(UNEXPECTED_END_OF_BUFFER_MSG)}#a(t){const r=this.#h();let n=bufferExports.Buffer.from([]),o=0,i=1,u=MiniCborReader.#e(r.slice(i),t);for(;u.getInitialByte()!==CborInitialByte.IndefiniteLengthBreakByte;){const{length:a,bytesRead:s}=MiniCborReader.#m(u,r.slice(i)),f=s+Number(a);n=bufferExports.Buffer.concat([n,r.slice(i+(f-a),i+f)]),i+=f,u=MiniCborReader.#e(r.slice(i),t)}return o=i+1,{encodingLength:o,val:new Uint8Array(n)}}#r(){++this.#i.itemsRead,this.#f=!1}static#e(t,r){MiniCborReader.ensureReadCapacityInArray(t,1);const n=CborInitialByte.from(t[0]);if(n.getInitialByte()!==CborInitialByte.IndefiniteLengthBreakByte&&n.getMajorType()!==r)throw new CborContentException("Indefinite length string contains invalid data item");return n}#y(){const t=this.#c(6),{unsignedInt:r,bytesRead:n}=MiniCborReader.#u(t,this.#h());return{bytesRead:n,tag:Number(r)}}static#m(t,r){const{unsignedInt:n,bytesRead:o}=MiniCborReader.#u(t,r);return{bytesRead:o,length:Number(n)}}#c(t){if(this.#i.definiteLength!==void 0&&this.#i.definiteLength-this.#i.itemsRead===0)throw new CborInvalidOperationException("No more data items to read");if(this.#n===this.#t.length)throw this.#i.type===null&&this.#i.definiteLength===void 0&&this.#n>0?new CborInvalidOperationException("End of root-level. No more data items to read"):new CborContentException(UNEXPECTED_END_OF_BUFFER_MSG);const r=CborInitialByte.from(this.#t[this.#n]);switch(this.#i.type){case 2:case 3:if(r.getInitialByte()===CborInitialByte.IndefiniteLengthBreakByte||r.getMajorType()===this.#i.type&&r.getAdditionalInfo()!==31)break;throw new CborContentException(`Indefinite length string contains invalid data item, ${r.getMajorType()}`)}if(t&&t!==r.getMajorType())throw new CborInvalidOperationException(`Major type mismatch, expected type ${t} but got ${r.getMajorType()}`);return r}static#u(t,r){if((t.getInitialByte()&CborInitialByte.AdditionalInformationMask)<24)return{bytesRead:1,unsignedInt:BigInt(t.getAdditionalInfo())};switch(t.getAdditionalInfo()){case 24:return MiniCborReader.ensureReadCapacityInArray(r,2),{bytesRead:2,unsignedInt:BigInt(r[1])};case 25:{MiniCborReader.ensureReadCapacityInArray(r,3);const o=bufferExports.Buffer.from(r.slice(1)).readUInt16BE();return{bytesRead:3,unsignedInt:BigInt(o)}}case 26:{MiniCborReader.ensureReadCapacityInArray(r,5);const o=bufferExports.Buffer.from(r.slice(1)).readUInt32BE();return{bytesRead:5,unsignedInt:BigInt(o)}}case 27:{MiniCborReader.ensureReadCapacityInArray(r,9);const n=bufferExports.Buffer.from(r.slice(1,9));let o=BigInt(0);for(const i of n)o=(o<<BigInt(8))+BigInt(i);return{bytesRead:9,unsignedInt:o}}default:throw new CborContentException("Invalid integer encoding")}}static ensureReadCapacityInArray(t,r){if(t.length<r)throw new CborContentException(UNEXPECTED_END_OF_BUFFER_MSG)}#d(t){if(this.#n+t>this.#t.length)throw new CborContentException("Buffer offset out of bounds");this.#n+=t,this.#b=0}#l(t,r){const n={currentKeyOffset:this.#i.currentKeyOffset,definiteLength:this.#i.definiteLength,frameOffset:this.#i.frameOffset,itemsRead:this.#i.itemsRead,type:this.#i.type};this.#g.push(n),this.#i.type=t,this.#i.definiteLength=r,this.#i.itemsRead=0,this.#i.frameOffset=this.#n,this.#f=!1,this.#i.currentKeyOffset=null}#h(){return this.#t.slice(this.#n)}}const CHECKSUM_ADDRESS_ERROR_MSG$1=CHECKSUM_ERROR_MSG("address");function verifyCardanoByronAddress(e){return verifyCardanoByronAddressBytes(bs58.decode(e))}function verifyCardanoByronAddressBytes(e){const t=new MiniCborReader(bufferExports.Buffer.from(e).toString("hex"));t.readStartArray(),t.readTag();const r=t.readByteString();if(Number(t.readInt())!==crc32(r))throw new Error(CHECKSUM_ADDRESS_ERROR_MSG$1);return!0}function verifyCardanoShelleyAddress(e){const t=distExports$1.bech32.decode(e,Number.MAX_SAFE_INTEGER/2),r=distExports$1.bech32.fromWords(t.words);if(!["addr","addr_test","stake","stake_test"].includes(t.prefix))return!1;switch(r[0]>>4){case 0:case 1:case 2:case 3:return r.length===57;case 4:case 5:{if(r.length<=29)return!1;let o=29;const i=bufferExports.Buffer.from(r),{bytesRead:u}=variableLengthDecode(i.subarray(o));o+=u;const{bytesRead:a}=variableLengthDecode(i.subarray(o));return o+=a,variableLengthDecode(i.subarray(o)),!0}case 6:case 7:return r.length===47;case 14:case 15:return r.length===47;case 8:return verifyCardanoByronAddressBytes(new Uint8Array(r));default:throw new Error(MALFORMED_ERROR_MSG("address"))}}const variableLengthDecode=e=>{let t=!0,r=0n,n=0;for(;t&&n<e.length;){const o=e[n];r<<=7n,r|=BigInt(o&127),t=(o&128)!==0,++n}return{bytesRead:n,value:r}};var AddressType$1=(e=>(e[e.NONE=-1]="NONE",e[e.EVM=0]="EVM",e[e.CARDANO=1]="CARDANO",e[e.SUBSTRATE=2]="SUBSTRATE",e[e.ALGORAND=3]="ALGORAND",e[e.MINA=4]="MINA",e[e.MIDNIGHT=5]="MIDNIGHT",e[e.AVAIL=6]="AVAIL",e[e.POLKADOT=7]="POLKADOT",e))(AddressType$1||{});function tryDecode(e,t,r=()=>!0){try{return r(t(e))}catch{return!1}}Set$1("algorand-address",e=>tryDecode(e,verifyAlgorandAddress));Set$1("algorand-blockhash",e=>tryDecode(e,verifyAlgorandBlockHash));Set$1("algorand-txid",e=>tryDecode(e,verifyAlgorandTransactionHash));Set$1("mina-address",e=>tryDecode(e,verifyMinaAddress));Set$1("mina-blockhash",e=>tryDecode(e,verifyMinaBlockHash));Set$1("mina-txid",e=>tryDecode(e,verifyMinaTransactionHash));Set$1("cardano-address",e=>tryDecode(e,verifyCardanoByronAddress)||tryDecode(e,verifyCardanoShelleyAddress));Set$1("ss58",e=>tryDecode(e,libExports.decode));Set$1("bs58check",e=>tryDecode(e,bs58check.decode));Set$1("bech32",e=>tryDecode(e,t=>distExports$1.bech32.decode(t,Number.MAX_SAFE_INTEGER/2)));function forceLowercase(e){return Type.Transform(e).Decode(t=>t.toLowerCase()).Encode(t=>t.toLowerCase())}function forceUppercase(e){return Type.Transform(e).Decode(t=>t.toUpperCase()).Encode(t=>t.toUpperCase())}const TypeboxHelpers={Uint256:Type.Transform(Type.BigInt({maximum:115792089237316195423570985008687907853269984665640564039457584007913129639935n,minimum:0n})).Decode(e=>e.toString()).Encode(e=>BigInt(e)),Algorand:{BlockHash:Type.Unsafe(Type.String({format:"algorand-blockhash"})),TxHash:Type.Unsafe(forceUppercase(Type.String({format:"algorand-txid"}))),Address:Type.Unsafe(forceUppercase(Type.String({format:"algorand-address"})))},Substrate:{Address:Type.Unsafe(Type.String({format:"ss58"}))},Avail:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(Type.String({format:"ss58"}))},Cardano:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),TxHash:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(Type.String({format:"cardano-address"})),Credential:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),PoolId:Type.Unsafe(forceLowercase(Type.String())),PolicyId:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{56}$/))),AssetName:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),Cip14Fingerprint:Type.Unsafe(Type.String()),AmountLovelace:Type.Unsafe(Type.RegExp(/^\d+$/))},Evm:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),TxHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{40}$/))),Selector:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{8}$/))),FullSelector:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Signature:Type.Unsafe(Type.RegExp(/^0x[a-fA-F0-9]{130}$/)),PrivateKey:Type.Unsafe(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))},Midnight:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),TxHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(forceLowercase(Type.RegExp(/^mn_(shield-addr|addr|dust-addr|shield-esk|shield-cpk)_(test|dev|undeployed)[a-zA-Z0-9]+$/))),Signature:Type.Unsafe(Type.RegExp(/^.*$/))},Mina:{BlockHash:Type.Unsafe(Type.String({format:"mina-blockhash"})),TxHash:Type.Unsafe(Type.String({format:"mina-txid"})),Address:Type.Unsafe(Type.String({format:"mina-address"}))},Polkadot:{BlockHash:Type.Unsafe(Type.String({format:"polkadot-blockhash"})),TxHash:Type.Unsafe(Type.String({format:"polkadot-txid"})),Address:Type.Unsafe(Type.String({format:"ss58"}))},Caip2:Type.Unsafe(Type.String()),TimestampMsStr:Type.Unsafe(Type.RegExp(/^\d+$/)),UnknownFormat:Type.Unsafe(Type.String()),Lowercase:forceLowercase(Type.String()),TrueOrFalse:Type.Transform(Type.Union([Type.Literal("T"),Type.Literal("F")])).Decode(e=>e==="T").Encode(e=>e?"T":"F"),EvmAbiEvent:Type.Unsafe(Type.Any())},AddressValidator={[-1]:Type.Literal("0x0"),0:TypeboxHelpers.Evm.Address,1:TypeboxHelpers.Cardano.Address,2:TypeboxHelpers.Substrate.Address,6:TypeboxHelpers.Avail.Address,3:TypeboxHelpers.Algorand.Address,4:TypeboxHelpers.Mina.Address,5:TypeboxHelpers.Midnight.Address,7:TypeboxHelpers.Polkadot.Address};Type.Object({type:Type.Literal(-1),address:Type.Literal("0x0")}),Type.Object({type:Type.Literal(0),address:TypeboxHelpers.Evm.Address}),Type.Object({type:Type.Literal(1),address:TypeboxHelpers.Cardano.Address}),Type.Object({type:Type.Literal(2),address:TypeboxHelpers.Substrate.Address}),Type.Object({type:Type.Literal(6),address:TypeboxHelpers.Avail.Address}),Type.Object({type:Type.Literal(3),address:TypeboxHelpers.Algorand.Address}),Type.Object({type:Type.Literal(4),address:TypeboxHelpers.Mina.Address}),Type.Object({type:Type.Literal(5),address:TypeboxHelpers.Midnight.Address}),Type.Object({type:Type.Literal(7),address:TypeboxHelpers.Polkadot.Address});function number(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function bool(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function isBytes$1(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function bytes$1(e,...t){if(!isBytes$1(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function hash$2(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(e.outputLen),number(e.blockLen)}function exists(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 output(e,t){bytes$1(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const assert={number,bool,bytes:bytes$1,hash:hash$2,exists,output},U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(e,t=!1){return t?{h:Number(e&U32_MASK64),l:Number(e>>_32n&U32_MASK64)}:{h:Number(e>>_32n&U32_MASK64)|0,l:Number(e&U32_MASK64)|0}}function split(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:u}=fromBig(e[o],t);[r[o],n[o]]=[i,u]}return[r,n]}const rotlSH=(e,t,r)=>e<<r|t>>>32-r,rotlSL=(e,t,r)=>t<<r|e>>>32-r,rotlBH=(e,t,r)=>t<<r-32|e>>>64-r,rotlBL=(e,t,r)=>e<<r-32|t>>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function byteSwap32(e){for(let t=0;t<e.length;t++)e[t]=byteSwap(e[t])}function utf8ToBytes(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function toBytes(e){return typeof e=="string"&&(e=utf8ToBytes(e)),bytes$1(e),e}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(e){const t=n=>e().update(toBytes(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$1=BigInt(0),_1n$2=BigInt(1),_2n$2=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let e=0,t=_1n$2,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],SHA3_PI.push(2*(5*n+r)),SHA3_ROTL.push((e+1)*(e+2)/2%64);let o=_0n$1;for(let i=0;i<7;i++)t=(t<<_1n$2^(t>>_7n)*_0x71n)%_256n,t&_2n$2&&(o^=_1n$2<<(_1n$2<<BigInt(i))-_1n$2);_SHA3_IOTA.push(o)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split(_SHA3_IOTA,!0),rotlH=(e,t,r)=>r>32?rotlBH(e,t,r):rotlSH(e,t,r),rotlL=(e,t,r)=>r>32?rotlBL(e,t,r):rotlSL(e,t,r);function keccakP(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let u=0;u<10;u++)r[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){const a=(u+8)%10,s=(u+2)%10,f=r[s],c=r[s+1],d=rotlH(f,c,1)^r[a],p=rotlL(f,c,1)^r[a+1];for(let h=0;h<50;h+=10)e[u+h]^=d,e[u+h+1]^=p}let o=e[2],i=e[3];for(let u=0;u<24;u++){const a=SHA3_ROTL[u],s=rotlH(o,i,a),f=rotlL(o,i,a),c=SHA3_PI[u];o=e[c],i=e[c+1],e[c]=s,e[c+1]=f}for(let u=0;u<50;u+=10){for(let a=0;a<10;a++)r[a]=e[u+a];for(let a=0;a<10;a++)e[u+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=SHA3_IOTA_H[n],e[1]^=SHA3_IOTA_L[n]}r.fill(0)}class Keccak extends Hash{constructor(t,r,n,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(t){exists(this);const{blockLen:r,state:n}=this;t=toBytes(t);const o=t.length;for(let i=0;i<o;){const u=Math.min(r-this.pos,o-i);for(let a=0;a<u;a++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){exists(this,!1),bytes$1(t),this.finish();const r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const u=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+u),o),this.posOut+=u,o+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:u}=this;return t||(t=new Keccak(r,n,o,u,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=u,t.destroyed=this.destroyed,t}}const gen=(e,t,r)=>wrapConstructor(()=>new Keccak(t,e,r)),keccak_256$2=gen(1,136,256/8);function wrapHash(e){return t=>(assert.bytes(t),e(t))}(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();const keccak256$1=(()=>{const e=wrapHash(keccak_256$2);return e.create=keccak_256$2.create,e})(),ERR_MULTIPLE_ERRORS=208,JSONRPC_ERR_REJECTED_REQUEST=4001,JSONRPC_ERR_UNAUTHORIZED=4100,JSONRPC_ERR_UNSUPPORTED_METHOD=4200,JSONRPC_ERR_DISCONNECTED=4900,JSONRPC_ERR_CHAIN_DISCONNECTED=4901,ERR_INVALID_BYTES=1002,ERR_INVALID_NUMBER=1003,ERR_VALIDATION=1100,ERR_SCHEMA_FORMAT=1200,ERR_RPC_INVALID_JSON=-32700,ERR_RPC_INVALID_REQUEST=-32600,ERR_RPC_INVALID_METHOD=-32601,ERR_RPC_INVALID_PARAMS=-32602,ERR_RPC_INTERNAL_ERROR=-32603,ERR_RPC_INVALID_INPUT=-32e3,ERR_RPC_MISSING_RESOURCE=-32001,ERR_RPC_UNAVAILABLE_RESOURCE=-32002,ERR_RPC_TRANSACTION_REJECTED=-32003,ERR_RPC_UNSUPPORTED_METHOD=-32004,ERR_RPC_LIMIT_EXCEEDED=-32005,ERR_RPC_NOT_SUPPORTED=-32006;class BaseWeb3Error extends Error{get innerError(){return this.cause instanceof MultipleErrors?this.cause.errors:this.cause}set innerError(t){Array.isArray(t)?this.cause=new MultipleErrors(t):this.cause=t}constructor(t,r){super(t),Array.isArray(r)?this.cause=new MultipleErrors(r):this.cause=r,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,r=!1){if(t==null)return"undefined";const n=JSON.stringify(t,(o,i)=>typeof i=="bigint"?i.toString():i);return r&&["bigint","string"].includes(typeof t)?n.replace(/['\\"]+/g,""):n}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class MultipleErrors extends BaseWeb3Error{constructor(t){super(`Multiple errors occurred: [${t.map(r=>r.message).join("], [")}]`),this.code=ERR_MULTIPLE_ERRORS,this.errors=t}}class InvalidValueError extends BaseWeb3Error{constructor(t,r){super(`Invalid value given "${BaseWeb3Error.convertToString(t,!0)}". Error: ${r}.`),this.name=this.constructor.name}}class InvalidBytesError extends InvalidValueError{constructor(t){super(t,"can not parse as byte data"),this.code=ERR_INVALID_BYTES}}class InvalidNumberError extends InvalidValueError{constructor(t){super(t,"can not parse as number data"),this.code=ERR_INVALID_NUMBER}}const genericRpcErrorMessageTemplate="An Rpc error has occured with a code of *code*",RpcErrorMessages={[ERR_RPC_INVALID_JSON]:{message:"Parse error",description:"Invalid JSON"},[ERR_RPC_INVALID_REQUEST]:{message:"Invalid request",description:"JSON is not a valid request object "},[ERR_RPC_INVALID_METHOD]:{message:"Method not found",description:"Method does not exist "},[ERR_RPC_INVALID_PARAMS]:{message:"Invalid params",description:"Invalid method parameters"},[ERR_RPC_INTERNAL_ERROR]:{message:"Internal error",description:"Internal JSON-RPC error"},[ERR_RPC_INVALID_INPUT]:{message:"Invalid input",description:"Missing or invalid parameters"},[ERR_RPC_MISSING_RESOURCE]:{message:"Resource not found",description:"Requested resource not found"},[ERR_RPC_UNAVAILABLE_RESOURCE]:{message:"Resource unavailable",description:"Requested resource not available"},[ERR_RPC_TRANSACTION_REJECTED]:{message:"Transaction rejected",description:"Transaction creation failed"},[ERR_RPC_UNSUPPORTED_METHOD]:{message:"Method not supported",description:"Method is not implemented"},[ERR_RPC_LIMIT_EXCEEDED]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[ERR_RPC_NOT_SUPPORTED]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[JSONRPC_ERR_REJECTED_REQUEST]:{name:"User Rejected Request",message:"The user rejected the request."},[JSONRPC_ERR_UNAUTHORIZED]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[JSONRPC_ERR_UNSUPPORTED_METHOD]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[JSONRPC_ERR_DISCONNECTED]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[JSONRPC_ERR_CHAIN_DISCONNECTED]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class RpcError extends BaseWeb3Error{constructor(t,r){super(r??genericRpcErrorMessageTemplate.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class ParseError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_JSON].message),this.code=ERR_RPC_INVALID_JSON}}class InvalidRequestError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_REQUEST].message),this.code=ERR_RPC_INVALID_REQUEST}}class MethodNotFoundError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_METHOD].message),this.code=ERR_RPC_INVALID_METHOD}}class InvalidParamsError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_PARAMS].message),this.code=ERR_RPC_INVALID_PARAMS}}class InternalError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INTERNAL_ERROR].message),this.code=ERR_RPC_INTERNAL_ERROR}}class InvalidInputError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_INPUT].message),this.code=ERR_RPC_INVALID_INPUT}}class MethodNotSupported extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_UNSUPPORTED_METHOD].message),this.code=ERR_RPC_UNSUPPORTED_METHOD}}class ResourceUnavailableError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_UNAVAILABLE_RESOURCE].message),this.code=ERR_RPC_UNAVAILABLE_RESOURCE}}class ResourcesNotFoundError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_MISSING_RESOURCE].message),this.code=ERR_RPC_MISSING_RESOURCE}}class VersionNotSupportedError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_NOT_SUPPORTED].message),this.code=ERR_RPC_NOT_SUPPORTED}}class TransactionRejectedError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_TRANSACTION_REJECTED].message),this.code=ERR_RPC_TRANSACTION_REJECTED}}class LimitExceededError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_LIMIT_EXCEEDED].message),this.code=ERR_RPC_LIMIT_EXCEEDED}}const rpcErrorsMap=new Map;rpcErrorsMap.set(ERR_RPC_INVALID_JSON,{error:ParseError});rpcErrorsMap.set(ERR_RPC_INVALID_REQUEST,{error:InvalidRequestError});rpcErrorsMap.set(ERR_RPC_INVALID_METHOD,{error:MethodNotFoundError});rpcErrorsMap.set(ERR_RPC_INVALID_PARAMS,{error:InvalidParamsError});rpcErrorsMap.set(ERR_RPC_INTERNAL_ERROR,{error:InternalError});rpcErrorsMap.set(ERR_RPC_INVALID_INPUT,{error:InvalidInputError});rpcErrorsMap.set(ERR_RPC_UNSUPPORTED_METHOD,{error:MethodNotSupported});rpcErrorsMap.set(ERR_RPC_UNAVAILABLE_RESOURCE,{error:ResourceUnavailableError});rpcErrorsMap.set(ERR_RPC_TRANSACTION_REJECTED,{error:TransactionRejectedError});rpcErrorsMap.set(ERR_RPC_MISSING_RESOURCE,{error:ResourcesNotFoundError});rpcErrorsMap.set(ERR_RPC_NOT_SUPPORTED,{error:VersionNotSupportedError});rpcErrorsMap.set(ERR_RPC_LIMIT_EXCEEDED,{error:LimitExceededError});class SchemaFormatError extends BaseWeb3Error{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=ERR_SCHEMA_FORMAT}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}var util$1;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{const i={};for(const u of o)i[u]=u;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),u={};for(const a of i)u[a]=o[a];return e.objectValues(u)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&i.push(u);return i},e.find=(o,i)=>{for(const u of o)if(i(u))return u},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(u=>typeof u=="string"?`'${u}'`:u).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(util$1||(util$1={}));var objectUtil;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(objectUtil||(objectUtil={}));const ZodParsedType=util$1.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:e===null?ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?ZodParsedType.map:typeof Set<"u"&&e instanceof Set?ZodParsedType.set:typeof Date<"u"&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$1.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(const u of i.issues)if(u.code==="invalid_union")u.unionErrors.map(o);else if(u.code==="invalid_return_type")o(u.returnTypeError);else if(u.code==="invalid_arguments")o(u.argumentsError);else if(u.path.length===0)n._errors.push(r(u));else{let a=n,s=0;for(;s<u.path.length;){const f=u.path[s];s===u.path.length-1?(a[f]=a[f]||{_errors:[]},a[f]._errors.push(r(u))):a[f]=a[f]||{_errors:[]},a=a[f],s++}}};return o(this),n}static assert(t){if(!(t instanceof ZodError))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$1.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const o of this.issues)if(o.path.length>0){const i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:e.received===ZodParsedType.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util$1.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util$1.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util$1.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util$1.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util$1.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ZodIssueCode.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ZodIssueCode.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util$1.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],u={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="";const s=n.filter(f=>!!f).slice().reverse();for(const f of s)a=f(u,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=getErrorMap(),n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter(o=>!!o)});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const o of r){if(o.status==="aborted")return INVALID;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const o of r){const i=await o.key,u=await o.value;n.push({key:i,value:u})}return ParseStatus.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const o of r){const{key:i,value:u}=o;if(i.status==="aborted"||u.status==="aborted")return INVALID;i.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof u.value<"u"||o.alwaysSet)&&(n[i.value]=u.value)}return{status:t.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>e.status==="aborted",isDirty=e=>e.status==="dirty",isValid=e=>e.status==="valid",isAsync=e=>typeof Promise<"u"&&e instanceof Promise;var errorUtil;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ZodError(e.common.issues);return this._error=r,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(u,a)=>{const{message:s}=e;return u.code==="invalid_enum_value"?{message:s??a.defaultError}:typeof a.data>"u"?{message:s??n??a.defaultError}:u.code!=="invalid_type"?{message:a.defaultError}:{message:s??r??a.defaultError}},description:o}}class ZodType{get description(){return this._def.description}_getType(t){return getParsedType(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(isAsync(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},o=this._parseSync({data:t,path:n.path,parent:n});return handleResult(n,o)}"~validate"(t){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)};if(!this["~standard"].async)try{const n=this._parseSync({data:t,path:[],parent:r});return isValid(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>isValid(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(isAsync(o)?o:Promise.resolve(o));return handleResult(n,i)}refine(t,r){const n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{const u=t(o),a=()=>i.addIssue({code:ZodIssueCode.custom,...n(o)});return typeof Promise<"u"&&u instanceof Promise?u.then(s=>s?!0:(a(),!1)):u?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(t){return ZodUnion.create([this,t],this._def)}and(t){return ZodIntersection.create(this,t,this._def)}transform(t){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:r,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:r,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ZodPipeline.create(this,t)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!!((t==="v4"||!t)&&ipv4Regex.test(e)||(t==="v6"||!t)&&ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function isValidCidr(e,t){return!!((t==="v4"||!t)&&ipv4CidrRegex.test(e)||(t==="v6"||!t)&&ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ZodParsedType.string){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:i.parsedType}),INVALID}const n=new ParseStatus;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const u=t.data.length>i.value,a=t.data.length<i.value;(u||a)&&(o=this._getOrReturnCtx(t,o),u?addIssueToContext(o,{code:ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&addIssueToContext(o,{code:ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")emailRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"email",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"emoji",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")uuidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"uuid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")nanoidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")cuidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"cuid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")cuid2Regex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ulidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"ulid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"url",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"regex",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?datetimeRegex(i).test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?dateRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?timeRegex(i).test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?durationRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"duration",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?isValidIP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"ip",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?isValidJWT(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"jwt",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?isValidCidr(t.data,i.version)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"cidr",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?base64Regex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"base64",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?base64urlRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"base64url",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):util$1.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(t){return new ZodString({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...errorUtil.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...errorUtil.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...errorUtil.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...errorUtil.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...errorUtil.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...errorUtil.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...errorUtil.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...errorUtil.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...errorUtil.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...errorUtil.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...errorUtil.errToObj(r)})}nonempty(t){return this.min(1,errorUtil.errToObj(t))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}ZodString.create=e=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:e?.coerce??!1,...processCreateParams(e)});function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),u=Number.parseInt(t.toFixed(o).replace(".",""));return i%u/10**o}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ZodParsedType.number){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:i.parsedType}),INVALID}let n;const o=new ParseStatus;for(const i of this._def.checks)i.kind==="int"?util$1.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?floatSafeRemainder(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_finite,message:i.message}),o.dirty()):util$1.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,o){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(t){return new ZodNumber({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&util$1.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:e?.coerce||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ZodParsedType.bigint)return this._getInvalidInput(t);let n;const o=new ParseStatus;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):util$1.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:r.parsedType}),INVALID}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,o){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(t){return new ZodBigInt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:e?.coerce??!1,...processCreateParams(e)});class ZodBoolean extends ZodType{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ZodParsedType.boolean){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:n.parsedType}),INVALID}return OK(t.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:e?.coerce||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ZodParsedType.date){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:i.parsedType}),INVALID}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_date}),INVALID}const n=new ParseStatus;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):util$1.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ZodDate({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:errorUtil.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:errorUtil.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.symbol){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:n.parsedType}),INVALID}return OK(t.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:n.parsedType}),INVALID}return OK(t.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.null){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:n.parsedType}),INVALID}return OK(t.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(t){return OK(t.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(t){return OK(t.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:r.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:n.parsedType}),INVALID}return OK(t.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(o.exactLength!==null){const u=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(u||a)&&(addIssueToContext(r,{code:u?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:a?o.exactLength.value:void 0,maximum:u?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((u,a)=>o.type._parseAsync(new ParseInputLazyPath(r,u,r.path,a)))).then(u=>ParseStatus.mergeArray(n,u));const i=[...r.data].map((u,a)=>o.type._parseSync(new ParseInputLazyPath(r,u,r.path,a)));return ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new ZodArray({...this._def,minLength:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodArray({...this._def,maxLength:{value:t,message:errorUtil.toString(r)}})}length(t,r){return new ZodArray({...this._def,exactLength:{value:t,message:errorUtil.toString(r)}})}nonempty(t){return this.min(1,t)}}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}else return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(t=>deepPartialify(t))):e}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=util$1.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ZodParsedType.object){const f=this._getOrReturnCtx(t);return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:f.parsedType}),INVALID}const{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:u}=this._getCached(),a=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const f in o.data)u.includes(f)||a.push(f);const s=[];for(const f of u){const c=i[f],d=o.data[f];s.push({key:{status:"valid",value:f},value:c._parse(new ParseInputLazyPath(o,d,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof ZodNever){const f=this._def.unknownKeys;if(f==="passthrough")for(const c of a)s.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(f==="strict")a.length>0&&(addIssueToContext(o,{code:ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const c of a){const d=o.data[c];s.push({key:{status:"valid",value:c},value:f._parse(new ParseInputLazyPath(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const c of s){const d=await c.key,p=await c.value;f.push({key:d,value:p,alwaysSet:c.alwaysSet})}return f}).then(f=>ParseStatus.mergeObjectSync(n,f)):ParseStatus.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{const o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:errorUtil.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(t){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ZodObject({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ZodObject({...this._def,catchall:t})}pick(t){const r={};for(const n of util$1.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ZodObject({...this._def,shape:()=>r})}omit(t){const r={};for(const n of util$1.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new ZodObject({...this._def,shape:()=>r})}deepPartial(){return deepPartialify(this)}partial(t){const r={};for(const n of util$1.objectKeys(this.shape)){const o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new ZodObject({...this._def,shape:()=>r})}required(t){const r={};for(const n of util$1.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ZodOptional;)i=i._def.innerType;r[n]=i}return new ZodObject({...this._def,shape:()=>r})}keyof(){return createZodEnum(util$1.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const u=i.map(a=>new ZodError(a.ctx.common.issues));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:u}),INVALID}if(r.common.async)return Promise.all(n.map(async i=>{const u={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:u}),ctx:u}})).then(o);{let i;const u=[];for(const s of n){const f={...r,common:{...r.common,issues:[]},parent:null},c=s._parseSync({data:r.data,path:r.path,parent:f});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:f}),f.common.issues.length&&u.push(f.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=u.map(s=>new ZodError(s));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:a}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util$1.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(addIssueToContext(r,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const o=new Map;for(const i of r){const u=getDiscriminator(i.shape[t]);if(!u.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of u){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...processCreateParams(n)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const o=util$1.objectKeys(t),i=util$1.objectKeys(e).filter(a=>o.indexOf(a)!==-1),u={...e,...t};for(const a of i){const s=mergeValues(e[a],t[a]);if(!s.valid)return{valid:!1};u[a]=s.data}return{valid:!0,data:u}}else if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i<e.length;i++){const u=e[i],a=t[i],s=mergeValues(u,a);if(!s.valid)return{valid:!1};o.push(s.data)}return{valid:!0,data:o}}else return r===ZodParsedType.date&&n===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),o=(i,u)=>{if(isAborted(i)||isAborted(u))return INVALID;const a=mergeValues(i.value,u.value);return a.valid?((isDirty(i)||isDirty(u))&&r.dirty(),{status:r.value,value:a.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,u])=>o(i,u)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.length<this._def.items.length)return addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&n.data.length>this._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((u,a)=>{const s=this._def.items[a]||this._def.rest;return s?s._parse(new ParseInputLazyPath(n,u,n.path,a)):null}).filter(u=>!!u);return n.common.async?Promise.all(i).then(u=>ParseStatus.mergeArray(r,u)):ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new ZodTuple({...this._def,rest:t})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const o=[],i=this._def.keyType,u=this._def.valueType;for(const a in n.data)o.push({key:i._parse(new ParseInputLazyPath(n,a,n.path,a)),value:u._parse(new ParseInputLazyPath(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ParseStatus.mergeObjectAsync(r,o):ParseStatus.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ZodType?new ZodRecord({keyType:t,valueType:r,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}):new ZodRecord({keyType:ZodString.create(),valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const o=this._def.keyType,i=this._def.valueType,u=[...n.data.entries()].map(([a,s],f)=>({key:o._parse(new ParseInputLazyPath(n,a,n.path,[f,"key"])),value:i._parse(new ParseInputLazyPath(n,s,n.path,[f,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const s of u){const f=await s.key,c=await s.value;if(f.status==="aborted"||c.status==="aborted")return INVALID;(f.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(f.value,c.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const s of u){const f=s.key,c=s.value;if(f.status==="aborted"||c.status==="aborted")return INVALID;(f.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(f.value,c.value)}return{status:r.value,value:a}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());const i=this._def.valueType;function u(s){const f=new Set;for(const c of s){if(c.status==="aborted")return INVALID;c.status==="dirty"&&r.dirty(),f.add(c.value)}return{status:r.value,value:f}}const a=[...n.data.values()].map((s,f)=>i._parse(new ParseInputLazyPath(n,s,n.path,f)));return n.common.async?Promise.all(a).then(s=>u(s)):u(a)}min(t,r){return new ZodSet({...this._def,minSize:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodSet({...this._def,maxSize:{value:t,message:errorUtil.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.function)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:r.parsedType}),INVALID;function n(a,s){return makeIssue({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(f=>!!f),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:s}})}function o(a,s){return makeIssue({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(f=>!!f),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:s}})}const i={errorMap:r.common.contextualErrorMap},u=r.data;if(this._def.returns instanceof ZodPromise){const a=this;return OK(async function(...s){const f=new ZodError([]),c=await a._def.args.parseAsync(s,i).catch(h=>{throw f.addIssue(n(s,h)),f}),d=await Reflect.apply(u,this,c);return await a._def.returns._def.type.parseAsync(d,i).catch(h=>{throw f.addIssue(o(d,h)),f})})}else{const a=this;return OK(function(...s){const f=a._def.args.safeParse(s,i);if(!f.success)throw new ZodError([n(s,f.error)]);const c=Reflect.apply(u,this,f.data),d=a._def.returns.safeParse(c,i);if(!d.success)throw new ZodError([o(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ZodFunction({...this._def,args:ZodTuple.create(t).rest(ZodUnknown.create())})}returns(t){return new ZodFunction({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ZodFunction({args:t||ZodTuple.create([]).rest(ZodUnknown.create()),returns:r||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}class ZodEnum extends ZodType{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{expected:util$1.joinValues(n),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ZodEnum.create(t,{...this._def,...r})}exclude(t,r=this._def){return ZodEnum.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(t){const r=util$1.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const o=util$1.objectValues(r);return addIssueToContext(n,{expected:util$1.joinValues(o),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(util$1.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=util$1.objectValues(r);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:o}),INVALID}return OK(t.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.promise&&r.common.async===!1)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:r.parsedType}),INVALID;const n=r.parsedType===ZodParsedType.promise?r.data:Promise.resolve(r.data);return OK(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:u=>{addIssueToContext(n,u),u.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const u=o.transform(n.data,i);if(n.common.async)return Promise.resolve(u).then(async a=>{if(r.value==="aborted")return INVALID;const s=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return s.status==="aborted"?INVALID:s.status==="dirty"||r.value==="dirty"?DIRTY(s.value):s});{if(r.value==="aborted")return INVALID;const a=this._def.schema._parseSync({data:u,path:n.path,parent:n});return a.status==="aborted"?INVALID:a.status==="dirty"||r.value==="dirty"?DIRTY(a.value):a}}if(o.type==="refinement"){const u=a=>{const s=o.refinement(a,i);if(n.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?INVALID:(a.status==="dirty"&&r.dirty(),u(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?INVALID:(a.status==="dirty"&&r.dirty(),u(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){const u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(u))return INVALID;const a=o.transform(u.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>isValid(u)?Promise.resolve(o.transform(u.value,i)).then(a=>({status:r.value,value:a})):INVALID);util$1.assertNever(o)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)});ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.null?OK(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.nan){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:n.parsedType}),INVALID}return{status:"valid",value:t.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?INVALID:i.status==="dirty"?(r.dirty(),DIRTY(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?INVALID:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new ZodPipeline({in:t,out:r,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(t){const r=this._def.innerType._parse(t),n=o=>(isValid(o)&&(o.value=Object.freeze(o.value)),o);return isAsync(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});function cleanParams(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function custom(e,t={},r){return e?ZodAny.create().superRefine((n,o)=>{const i=e(n);if(i instanceof Promise)return i.then(u=>{if(!u){const a=cleanParams(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}});if(!i){const u=cleanParams(t,n),a=u.fatal??r??!0;o.addIssue({code:"custom",...u,fatal:a})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom(r=>r instanceof e,t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:(e=>ZodString.create({...e,coerce:!0})),number:(e=>ZodNumber.create({...e,coerce:!0})),boolean:(e=>ZodBoolean.create({...e,coerce:!0})),bigint:(e=>ZodBigInt.create({...e,coerce:!0})),date:(e=>ZodDate.create({...e,coerce:!0}))},NEVER=INVALID,z$1=Object.freeze(Object.defineProperty({__proto__:null,BRAND,DIRTY,EMPTY_PATH,INVALID,NEVER,OK,ParseStatus,Schema:ZodType,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},ZodFunction,ZodIntersection,ZodIssueCode,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSchema:ZodType,ZodSet,ZodString,ZodSymbol,ZodTransformer:ZodEffects,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,addIssueToContext,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,coerce,custom,date:dateType,datetimeRegex,defaultErrorMap:errorMap,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,getErrorMap,getParsedType,instanceof:instanceOfType,intersection:intersectionType,isAborted,isAsync,isDirty,isValid,late,lazy:lazyType,literal:literalType,makeIssue,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,get objectUtil(){return objectUtil},oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,quotelessJson,record:recordType,set:setType,setErrorMap,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,get util(){return util$1},void:voidType},Symbol.toStringTag,{value:"Module"})),errorFormatter=e=>e.message?e.message:"unspecified error";class Web3ValidatorError extends BaseWeb3Error{constructor(t){super(),this.code=ERR_VALIDATION,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
131
+ `));var ar=new c({actual:rn,expected:ii,message:ai,operator:ri,stackStartFn:ni});throw ar.generatedMessage=lr,ar}}ve.match=function rn(ii,ai,ni){k(ii,ai,ni,rn,"match")},ve.doesNotMatch=function rn(ii,ai,ni){k(ii,ai,ni,rn,"doesNotMatch")};function Ye(){for(var rn=arguments.length,ii=new Array(rn),ai=0;ai<rn;ai++)ii[ai]=arguments[ai];sr.apply(void 0,[Ye,ii.length].concat(ii))}return ve.strict=w(Ye,ve,{equal:ve.strictEqual,deepEqual:ve.deepStrictEqual,notEqual:ve.notStrictEqual,notDeepEqual:ve.notDeepStrictEqual}),ve.strict.strict=ve.strict,assert$1.exports}var src,hasRequiredSrc;function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var i=t.charAt(o),u=i.charCodeAt(0);if(r[u]!==255)throw new TypeError(i+" is ambiguous");r[u]=o}var a=t.length,s=t.charAt(0),f=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function d(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,w=0,S=0,E=y.length;S!==E&&y[S]===0;)S++,b++;for(var B=(E-S)*c+1>>>0,ae=new Uint8Array(B);S!==E;){for(var W=y[S],J=0,ve=B-1;(W!==0||J<w)&&ve!==-1;ve--,J++)W+=256*ae[ve]>>>0,ae[ve]=W%a>>>0,W=W/a>>>0;if(W!==0)throw new Error("Non-zero carry");w=J,S++}for(var Qe=B-w;Qe!==B&&ae[Qe]===0;)Qe++;for(var kt=s.repeat(b);Qe<B;++Qe)kt+=t.charAt(ae[Qe]);return kt}function p(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var b=0,w=0,S=0;y[b]===s;)w++,b++;for(var E=(y.length-b)*f+1>>>0,B=new Uint8Array(E);y[b];){var ae=y.charCodeAt(b);if(ae>255)return;var W=r[ae];if(W===255)return;for(var J=0,ve=E-1;(W!==0||J<S)&&ve!==-1;ve--,J++)W+=a*B[ve]>>>0,B[ve]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");S=J,b++}for(var Qe=E-S;Qe!==E&&B[Qe]===0;)Qe++;for(var kt=new Uint8Array(w+(E-Qe)),nr=w;Qe!==E;)kt[nr++]=B[Qe++];return kt}function h(y){var b=p(y);if(b)return b;throw new Error("Non-base"+a+" character")}return{encode:d,decodeUnsafe:p,decode:h}}return src=e,src}var blake2b$4={exports:{}},nanoassert,hasRequiredNanoassert;function requireNanoassert(){if(hasRequiredNanoassert)return nanoassert;hasRequiredNanoassert=1,nanoassert=t;class e extends Error{}e.prototype.name="AssertionError";function t(r,n){if(!r){var o=new e(n);throw Error.captureStackTrace&&Error.captureStackTrace(o,t),o}}return nanoassert}var blake2bWasm={exports:{}},browser$c={exports:{}},ascii,hasRequiredAscii;function requireAscii(){if(hasRequiredAscii)return ascii;hasRequiredAscii=1;function e(n){return n.length}function t(n){const o=n.byteLength;let i="";for(let u=0;u<o;u++)i+=String.fromCharCode(n[u]);return i}function r(n,o){const i=n.byteLength;for(let u=0;u<i;u++)n[u]=o.charCodeAt(u);return i}return ascii={byteLength:e,toString:t,write:r},ascii}var base64,hasRequiredBase64;function requireBase64(){if(hasRequiredBase64)return base64;hasRequiredBase64=1;const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256);for(let i=0;i<e.length;i++)t[e.charCodeAt(i)]=i;t[45]=62,t[95]=63;function r(i){let u=i.length;return i.charCodeAt(u-1)===61&&u--,u>1&&i.charCodeAt(u-1)===61&&u--,u*3>>>2}function n(i){const u=i.byteLength;let a="";for(let s=0;s<u;s+=3)a+=e[i[s]>>2]+e[(i[s]&3)<<4|i[s+1]>>4]+e[(i[s+1]&15)<<2|i[s+2]>>6]+e[i[s+2]&63];return u%3===2?a=a.substring(0,a.length-1)+"=":u%3===1&&(a=a.substring(0,a.length-2)+"=="),a}function o(i,u){const a=i.byteLength;for(let s=0,f=0;f<a;s+=4){const c=t[u.charCodeAt(s)],d=t[u.charCodeAt(s+1)],p=t[u.charCodeAt(s+2)],h=t[u.charCodeAt(s+3)];i[f++]=c<<2|d>>4,i[f++]=(d&15)<<4|p>>2,i[f++]=(p&3)<<6|h&63}return a}return base64={byteLength:r,toString:n,write:o},base64}var hex$1,hasRequiredHex;function requireHex(){if(hasRequiredHex)return hex$1;hasRequiredHex=1;function e(o){return o.length>>>1}function t(o){const i=o.byteLength;o=new DataView(o.buffer,o.byteOffset,i);let u="",a=0;for(let s=i-i%4;a<s;a+=4)u+=o.getUint32(a).toString(16).padStart(8,"0");for(;a<i;a++)u+=o.getUint8(a).toString(16).padStart(2,"0");return u}function r(o,i){const u=o.byteLength;for(let a=0;a<u;a++){const s=n(i.charCodeAt(a*2)),f=n(i.charCodeAt(a*2+1));if(s===void 0||f===void 0)return o.subarray(0,a);o[a]=s<<4|f}return u}hex$1={byteLength:e,toString:t,write:r};function n(o){if(o>=48&&o<=57)return o-48;if(o>=65&&o<=70)return o-65+10;if(o>=97&&o<=102)return o-97+10}return hex$1}var utf8,hasRequiredUtf8;function requireUtf8(){if(hasRequiredUtf8)return utf8;hasRequiredUtf8=1;function e(n){let o=0;for(let i=0,u=n.length;i<u;i++){const a=n.charCodeAt(i);if(a>=55296&&a<=56319&&i+1<u){const s=n.charCodeAt(i+1);if(s>=56320&&s<=57343){o+=4,i++;continue}}a<=127?o+=1:a<=2047?o+=2:o+=3}return o}let t;if(typeof TextDecoder<"u"){const n=new TextDecoder;t=function(i){return n.decode(i)}}else t=function(o){const i=o.byteLength;let u="",a=0;for(;a<i;){let s=o[a];if(s<=127){u+=String.fromCharCode(s),a++;continue}let f=0,c=0;if(s<=223?(f=1,c=s&31):s<=239?(f=2,c=s&15):s<=244&&(f=3,c=s&7),i-a-f>0){let d=0;for(;d<f;)s=o[a+d+1],c=c<<6|s&63,d+=1}else c=65533,f=i-a;u+=String.fromCodePoint(c),a+=f+1}return u};let r;if(typeof TextEncoder<"u"){const n=new TextEncoder;r=function(i,u){return n.encodeInto(u,i).written}}else r=function(o,i){const u=o.byteLength;let a=0,s=0;for(;a<i.length;){const f=i.codePointAt(a);if(f<=127){o[s++]=f,a++;continue}let c=0,d=0;for(f<=2047?(c=6,d=192):f<=65535?(c=12,d=224):f<=2097151&&(c=18,d=240),o[s++]=d|f>>c,c-=6;c>=0;)o[s++]=128|f>>c&63,c-=6;a+=f>=65536?2:1}return u};return utf8={byteLength:e,toString:t,write:r},utf8}var utf16le,hasRequiredUtf16le;function requireUtf16le(){if(hasRequiredUtf16le)return utf16le;hasRequiredUtf16le=1;function e(n){return n.length*2}function t(n){const o=n.byteLength;let i="";for(let u=0;u<o-1;u+=2)i+=String.fromCharCode(n[u]+n[u+1]*256);return i}function r(n,o){const i=n.byteLength;let u=i;for(let a=0;a<o.length&&!((u-=2)<0);++a){const s=o.charCodeAt(a),f=s>>8,c=s%256;n[a*2]=c,n[a*2+1]=f}return i}return utf16le={byteLength:e,toString:t,write:r},utf16le}var hasRequiredBrowser$c;function requireBrowser$c(){return hasRequiredBrowser$c||(hasRequiredBrowser$c=1,(function(e,t){const r=requireAscii(),n=requireBase64(),o=requireHex(),i=requireUtf8(),u=requireUtf16le(),a=new Uint8Array(Uint16Array.of(255).buffer)[0]===255;function s(ei){switch(ei){case"ascii":return r;case"base64":return n;case"hex":return o;case"utf8":case"utf-8":case void 0:case null:return i;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u;default:throw new Error(`Unknown encoding '${ei}'`)}}function f(ei){return ei instanceof Uint8Array}function c(ei){try{return s(ei),!0}catch{return!1}}function d(ei,Gr,ti){const fi=new Uint8Array(ei);return Gr!==void 0&&t.fill(fi,Gr,0,fi.byteLength,ti),fi}function p(ei){return new Uint8Array(ei)}function h(ei){return new Uint8Array(ei)}function y(ei,Gr){return s(Gr).byteLength(ei)}function b(ei,Gr){if(ei===Gr)return 0;const ti=Math.min(ei.byteLength,Gr.byteLength);ei=new DataView(ei.buffer,ei.byteOffset,ei.byteLength),Gr=new DataView(Gr.buffer,Gr.byteOffset,Gr.byteLength);let fi=0;for(let bi=ti-ti%4;fi<bi;fi+=4){const Ai=ei.getUint32(fi,a),Bi=Gr.getUint32(fi,a);if(Ai!==Bi)break}for(;fi<ti;fi++){const bi=ei.getUint8(fi),Ai=Gr.getUint8(fi);if(bi<Ai)return-1;if(bi>Ai)return 1}return ei.byteLength>Gr.byteLength?1:ei.byteLength<Gr.byteLength?-1:0}function w(ei,Gr){Gr===void 0&&(Gr=ei.reduce((bi,Ai)=>bi+Ai.byteLength,0));const ti=new Uint8Array(Gr);let fi=0;for(const bi of ei){if(fi+bi.byteLength>ti.byteLength)return ti.set(bi.subarray(0,ti.byteLength-fi),fi),ti;ti.set(bi,fi),fi+=bi.byteLength}return ti}function S(ei,Gr,ti=0,fi=0,bi=ei.byteLength){if(ti<0&&(ti=0),ti>=Gr.byteLength)return 0;const Ai=Gr.byteLength-ti;if(fi<0&&(fi=0),fi>=ei.byteLength||bi<=fi)return 0;bi>ei.byteLength&&(bi=ei.byteLength),bi-fi>Ai&&(bi=fi+Ai);const Bi=bi-fi;return ei===Gr?Gr.copyWithin(ti,fi,bi):((fi!==0||bi!==ei.byteLength)&&(ei=ei.subarray(fi,bi)),Gr.set(ei,ti)),Bi}function E(ei,Gr){return ei===Gr?!0:ei.byteLength!==Gr.byteLength?!1:b(ei,Gr)===0}function B(ei,Gr,ti=0,fi=ei.byteLength,bi="utf8"){if(typeof Gr=="string"?typeof ti=="string"?(bi=ti,ti=0,fi=ei.byteLength):typeof fi=="string"&&(bi=fi,fi=ei.byteLength):typeof Gr=="number"?Gr=Gr&255:typeof Gr=="boolean"&&(Gr=+Gr),ti<0&&(ti=0),ti>=ei.byteLength||fi<=ti)return ei;if(fi>ei.byteLength&&(fi=ei.byteLength),typeof Gr=="number")return ei.fill(Gr,ti,fi);typeof Gr=="string"&&(Gr=t.from(Gr,bi));const Ai=Gr.byteLength;for(let Bi=0,qi=fi-ti;Bi<qi;++Bi)ei[Bi+ti]=Gr[Bi%Ai];return ei}function ae(ei,Gr,ti){return typeof ei=="string"?W(ei,Gr):Array.isArray(ei)?J(ei):ArrayBuffer.isView(ei)?ve(ei):Qe(ei,Gr,ti)}function W(ei,Gr){const ti=s(Gr),fi=new Uint8Array(ti.byteLength(ei));return ti.write(fi,ei),fi}function J(ei){const Gr=new Uint8Array(ei.length);return Gr.set(ei),Gr}function ve(ei){const Gr=new Uint8Array(ei.byteLength);return Gr.set(ei),Gr}function Qe(ei,Gr,ti){return new Uint8Array(ei,Gr,ti)}function kt(ei,Gr,ti,fi){return nr(ei,Gr,ti,fi)!==-1}function nr(ei,Gr,ti,fi){return ce(ei,Gr,ti,fi,!0)}function sr(ei,Gr,ti,fi){return ce(ei,Gr,ti,fi,!1)}function ce(ei,Gr,ti,fi,bi){if(ei.byteLength===0)return-1;if(typeof ti=="string"?(fi=ti,ti=0):ti===void 0?ti=bi?0:ei.length-1:ti<0&&(ti+=ei.byteLength),ti>=ei.byteLength){if(bi)return-1;ti=ei.byteLength-1}else if(ti<0)if(bi)ti=0;else return-1;if(typeof Gr=="string")Gr=ae(Gr,fi);else if(typeof Gr=="number")return Gr=Gr&255,bi?ei.indexOf(Gr,ti):ei.lastIndexOf(Gr,ti);if(Gr.byteLength===0)return-1;if(bi){let Ai=-1;for(let Bi=ti;Bi<ei.byteLength;Bi++)if(ei[Bi]===Gr[Ai===-1?0:Bi-Ai]){if(Ai===-1&&(Ai=Bi),Bi-Ai+1===Gr.byteLength)return Ai}else Ai!==-1&&(Bi-=Bi-Ai),Ai=-1}else{ti+Gr.byteLength>ei.byteLength&&(ti=ei.byteLength-Gr.byteLength);for(let Ai=ti;Ai>=0;Ai--){let Bi=!0;for(let qi=0;qi<Gr.byteLength;qi++)if(ei[Ai+qi]!==Gr[qi]){Bi=!1;break}if(Bi)return Ai}}return-1}function Ze(ei,Gr,ti){const fi=ei[Gr];ei[Gr]=ei[ti],ei[ti]=fi}function se(ei){const Gr=ei.byteLength;if(Gr%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ti=0;ti<Gr;ti+=2)Ze(ei,ti,ti+1);return ei}function vt(ei){const Gr=ei.byteLength;if(Gr%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ti=0;ti<Gr;ti+=4)Ze(ei,ti,ti+3),Ze(ei,ti+1,ti+2);return ei}function ur(ei){const Gr=ei.byteLength;if(Gr%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ti=0;ti<Gr;ti+=8)Ze(ei,ti,ti+7),Ze(ei,ti+1,ti+6),Ze(ei,ti+2,ti+5),Ze(ei,ti+3,ti+4);return ei}function ue(ei){return ei}function bt(ei,Gr="utf8",ti=0,fi=ei.byteLength){return arguments.length===1?i.toString(ei):arguments.length===2?s(Gr).toString(ei):(ti<0&&(ti=0),ti>=ei.byteLength||fi<=ti?"":(fi>ei.byteLength&&(fi=ei.byteLength),(ti!==0||fi!==ei.byteLength)&&(ei=ei.subarray(ti,fi)),s(Gr).toString(ei)))}function L(ei,Gr,ti,fi,bi){if(arguments.length===2)return i.write(ei,Gr);typeof ti=="string"?(bi=ti,ti=0,fi=ei.byteLength):typeof fi=="string"&&(bi=fi,fi=ei.byteLength-ti),fi=Math.min(fi,t.byteLength(Gr,bi));let Ai=ti;if(Ai<0&&(Ai=0),Ai>=ei.byteLength)return 0;let Bi=ti+fi;return Bi<=Ai?0:(Bi>ei.byteLength&&(Bi=ei.byteLength),(Ai!==0||Bi!==ei.byteLength)&&(ei=ei.subarray(Ai,Bi)),s(bi).write(ei,Gr))}function _(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat64(Gr,!1)}function F(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat64(Gr,!0)}function k(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat32(Gr,!1)}function Ye(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getFloat32(Gr,!0)}function rn(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getInt32(Gr,!1)}function ii(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getInt32(Gr,!0)}function ai(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getUint32(Gr,!1)}function ni(ei,Gr=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).getUint32(Gr,!0)}function ri(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat64(ti,Gr,!1),ti+8}function ui(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat64(ti,Gr,!0),ti+8}function lr(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat32(ti,Gr,!1),ti+4}function ar(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setFloat32(ti,Gr,!0),ti+4}function jr(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setInt32(ti,Gr,!1),ti+4}function ci(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setInt32(ti,Gr,!0),ti+4}function mi(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setUint32(ti,Gr,!1),ti+4}function pi(ei,Gr,ti=0){return new DataView(ei.buffer,ei.byteOffset,ei.byteLength).setUint32(ti,Gr,!0),ti+4}e.exports=t={isBuffer:f,isEncoding:c,alloc:d,allocUnsafe:p,allocUnsafeSlow:h,byteLength:y,compare:b,concat:w,copy:S,equals:E,fill:B,from:ae,includes:kt,indexOf:nr,lastIndexOf:sr,swap16:se,swap32:vt,swap64:ur,toBuffer:ue,toString:bt,write:L,readDoubleBE:_,readDoubleLE:F,readFloatBE:k,readFloatLE:Ye,readInt32BE:rn,readInt32LE:ii,readUInt32BE:ai,readUInt32LE:ni,writeDoubleBE:ri,writeDoubleLE:ui,writeFloatBE:lr,writeFloatLE:ar,writeInt32BE:jr,writeInt32LE:ci,writeUInt32BE:mi,writeUInt32LE:pi}})(browser$c,browser$c.exports)),browser$c.exports}var blake2b$3,hasRequiredBlake2b$1;function requireBlake2b$1(){if(hasRequiredBlake2b$1)return blake2b$3;hasRequiredBlake2b$1=1;var e=(i,u)=>function(){return u||(0,i[Object.keys(i)[0]])((u={exports:{}}).exports,u),u.exports},t=(()=>{for(var i=new Uint8Array(128),u=0;u<64;u++)i[u<26?u+65:u<52?u+71:u<62?u-4:u*4-205]=u;return a=>{for(var s=a.length,f=new Uint8Array((s-(a[s-1]=="=")-(a[s-2]=="="))*3/4|0),c=0,d=0;c<s;){var p=i[a.charCodeAt(c++)],h=i[a.charCodeAt(c++)],y=i[a.charCodeAt(c++)],b=i[a.charCodeAt(c++)];f[d++]=p<<2|h>>4,f[d++]=h<<4|y>>2,f[d++]=y<<6|b}return f}})(),r=e({"wasm-binary:./blake2b.wat"(i,u){u.exports=t("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}}),n=r(),o=WebAssembly.compile(n);return blake2b$3=async i=>(await WebAssembly.instantiate(await o,i)).exports,blake2b$3}var hasRequiredBlake2bWasm;function requireBlake2bWasm(){if(hasRequiredBlake2bWasm)return blake2bWasm.exports;hasRequiredBlake2bWasm=1;var e=requireNanoassert(),t=requireBrowser$c(),r=null,n=typeof WebAssembly<"u"&&requireBlake2b$1()().then(y=>{r=y}),o=64,i=[];blake2bWasm.exports=p;var u=blake2bWasm.exports.BYTES_MIN=16,a=blake2bWasm.exports.BYTES_MAX=64;blake2bWasm.exports.BYTES=32;var s=blake2bWasm.exports.KEYBYTES_MIN=16,f=blake2bWasm.exports.KEYBYTES_MAX=64;blake2bWasm.exports.KEYBYTES=32;var c=blake2bWasm.exports.SALTBYTES=16,d=blake2bWasm.exports.PERSONALBYTES=16;function p(y,b,w,S,E){if(!(this instanceof p))return new p(y,b,w,S,E);if(!r)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");y||(y=32),E!==!0&&(e(y>=u,"digestLength must be at least "+u+", was given "+y),e(y<=a,"digestLength must be at most "+a+", was given "+y),b!=null&&(e(b instanceof Uint8Array,"key must be Uint8Array or Buffer"),e(b.length>=s,"key must be at least "+s+", was given "+b.length),e(b.length<=f,"key must be at least "+f+", was given "+b.length)),w!=null&&(e(w instanceof Uint8Array,"salt must be Uint8Array or Buffer"),e(w.length===c,"salt must be exactly "+c+", was given "+w.length)),S!=null&&(e(S instanceof Uint8Array,"personal must be Uint8Array or Buffer"),e(S.length===d,"personal must be exactly "+d+", was given "+S.length))),i.length||(i.push(o),o+=216),this.digestLength=y,this.finalized=!1,this.pointer=i.pop(),this._memory=new Uint8Array(r.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=b?b.length:0,this._memory[2]=1,this._memory[3]=1,w&&this._memory.set(w,32),S&&this._memory.set(S,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),r.blake2b_init(this.pointer,this.digestLength),b&&(this.update(b),this._memory.fill(0,o,o+b.length),this._memory[this.pointer+200]=128)}p.prototype._realloc=function(y){r.memory.grow(Math.max(0,Math.ceil(Math.abs(y-this._memory.length)/65536))),this._memory=new Uint8Array(r.memory.buffer)},p.prototype.update=function(y){return e(this.finalized===!1,"Hash instance finalized"),e(y instanceof Uint8Array,"input must be Uint8Array or Buffer"),o+y.length>this._memory.length&&this._realloc(o+y.length),this._memory.set(y,o),r.blake2b_update(this.pointer,o,o+y.length),this},p.prototype.digest=function(y){if(e(this.finalized===!1,"Hash instance finalized"),this.finalized=!0,i.push(this.pointer),r.blake2b_final(this.pointer),!y||y==="binary")return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if(typeof y=="string")return t.toString(this._memory,y,this.pointer+128,this.pointer+128+this.digestLength);e(y instanceof Uint8Array&&y.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var b=0;b<this.digestLength;b++)y[b]=this._memory[this.pointer+128+b];return y},p.prototype.final=p.prototype.digest,p.WASM=r,p.SUPPORTED=typeof WebAssembly<"u",p.ready=function(y){return y||(y=h),n?n.then(()=>y(),y):y(new Error("WebAssembly not supported"))},p.prototype.ready=p.ready,p.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},p.prototype.setPartialHash=function(y){this._memory.set(y,this.pointer)};function h(){}return blake2bWasm.exports}var hasRequiredBlake2b;function requireBlake2b(){if(hasRequiredBlake2b)return blake2b$4.exports;hasRequiredBlake2b=1;var e=requireNanoassert(),t=requireBlake2bWasm();function r(kt,nr,sr){var ce=kt[nr]+kt[sr],Ze=kt[nr+1]+kt[sr+1];ce>=4294967296&&Ze++,kt[nr]=ce,kt[nr+1]=Ze}function n(kt,nr,sr,ce){var Ze=kt[nr]+sr;sr<0&&(Ze+=4294967296);var se=kt[nr+1]+ce;Ze>=4294967296&&se++,kt[nr]=Ze,kt[nr+1]=se}function o(kt,nr){return kt[nr]^kt[nr+1]<<8^kt[nr+2]<<16^kt[nr+3]<<24}function i(kt,nr,sr,ce,Ze,se){var vt=c[Ze],ur=c[Ze+1],ue=c[se],bt=c[se+1];r(f,kt,nr),n(f,kt,vt,ur);var L=f[ce]^f[kt],_=f[ce+1]^f[kt+1];f[ce]=_,f[ce+1]=L,r(f,sr,ce),L=f[nr]^f[sr],_=f[nr+1]^f[sr+1],f[nr]=L>>>24^_<<8,f[nr+1]=_>>>24^L<<8,r(f,kt,nr),n(f,kt,ue,bt),L=f[ce]^f[kt],_=f[ce+1]^f[kt+1],f[ce]=L>>>16^_<<16,f[ce+1]=_>>>16^L<<16,r(f,sr,ce),L=f[nr]^f[sr],_=f[nr+1]^f[sr+1],f[nr]=_>>>31^L<<1,f[nr+1]=L>>>31^_<<1}var u=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],s=new Uint8Array(a.map(function(kt){return kt*2})),f=new Uint32Array(32),c=new Uint32Array(32);function d(kt,nr){var sr=0;for(sr=0;sr<16;sr++)f[sr]=kt.h[sr],f[sr+16]=u[sr];for(f[24]=f[24]^kt.t,f[25]=f[25]^kt.t/4294967296,nr&&(f[28]=~f[28],f[29]=~f[29]),sr=0;sr<32;sr++)c[sr]=o(kt.b,4*sr);for(sr=0;sr<12;sr++)i(0,8,16,24,s[sr*16+0],s[sr*16+1]),i(2,10,18,26,s[sr*16+2],s[sr*16+3]),i(4,12,20,28,s[sr*16+4],s[sr*16+5]),i(6,14,22,30,s[sr*16+6],s[sr*16+7]),i(0,10,20,30,s[sr*16+8],s[sr*16+9]),i(2,12,22,24,s[sr*16+10],s[sr*16+11]),i(4,14,16,26,s[sr*16+12],s[sr*16+13]),i(6,8,18,28,s[sr*16+14],s[sr*16+15]);for(sr=0;sr<16;sr++)kt.h[sr]=kt.h[sr]^f[sr]^f[sr+16]}var p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(kt,nr,sr,ce){p.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=kt,p[0]=kt,nr&&(p[1]=nr.length),p[2]=1,p[3]=1,sr&&p.set(sr,32),ce&&p.set(ce,48);for(var Ze=0;Ze<16;Ze++)this.h[Ze]=u[Ze]^o(p,Ze*4);nr&&(y(this,nr),this.c=128)}h.prototype.update=function(kt){return e(kt instanceof Uint8Array,"input must be Uint8Array or Buffer"),y(this,kt),this},h.prototype.digest=function(kt){var nr=!kt||kt==="binary"||kt==="hex"?new Uint8Array(this.outlen):kt;return e(nr instanceof Uint8Array,'out must be "binary", "hex", Uint8Array, or Buffer'),e(nr.length>=this.outlen,"out must have at least outlen bytes of space"),b(this,nr),kt==="hex"?w(nr):nr},h.prototype.final=h.prototype.digest,h.ready=function(kt){t.ready(function(){kt()})};function y(kt,nr){for(var sr=0;sr<nr.length;sr++)kt.c===128&&(kt.t+=kt.c,d(kt,!1),kt.c=0),kt.b[kt.c++]=nr[sr]}function b(kt,nr){for(kt.t+=kt.c;kt.c<128;)kt.b[kt.c++]=0;d(kt,!0);for(var sr=0;sr<kt.outlen;sr++)nr[sr]=kt.h[sr>>2]>>8*(sr&3);return nr}function w(kt){for(var nr="",sr=0;sr<kt.length;sr++)nr+=S(kt[sr]);return nr}function S(kt){return kt<16?"0"+kt.toString(16):kt.toString(16)}var E=h;blake2b$4.exports=function(nr,sr,ce,Ze,se){return se!==!0&&(e(nr>=B,"outlen must be at least "+B+", was given "+nr),e(nr<=ae,"outlen must be at most "+ae+", was given "+nr),sr!=null&&(e(sr instanceof Uint8Array,"key must be Uint8Array or Buffer"),e(sr.length>=W,"key must be at least "+W+", was given "+sr.length),e(sr.length<=J,"key must be at most "+J+", was given "+sr.length)),ce!=null&&(e(ce instanceof Uint8Array,"salt must be Uint8Array or Buffer"),e(ce.length===ve,"salt must be exactly "+ve+", was given "+ce.length)),Ze!=null&&(e(Ze instanceof Uint8Array,"personal must be Uint8Array or Buffer"),e(Ze.length===Qe,"personal must be exactly "+Qe+", was given "+Ze.length))),new E(nr,sr,ce,Ze)},blake2b$4.exports.ready=function(kt){t.ready(function(){kt()})},blake2b$4.exports.WASM_SUPPORTED=t.SUPPORTED,blake2b$4.exports.WASM_LOADED=!1;var B=blake2b$4.exports.BYTES_MIN=16,ae=blake2b$4.exports.BYTES_MAX=64;blake2b$4.exports.BYTES=32;var W=blake2b$4.exports.KEYBYTES_MIN=16,J=blake2b$4.exports.KEYBYTES_MAX=64;blake2b$4.exports.KEYBYTES=32;var ve=blake2b$4.exports.SALTBYTES=16,Qe=blake2b$4.exports.PERSONALBYTES=16;return t.ready(function(kt){kt||(blake2b$4.exports.WASM_LOADED=!0,blake2b$4.exports=t)}),blake2b$4.exports}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var e=lib&&lib.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(lib,"__esModule",{value:!0}),lib.encode=lib.decode=void 0;const t=e(requireAssert()),r=e(requireSrc()),n=e(requireBlake2b()),o=(0,r.default)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),i=bufferExports.Buffer.from("SS58PRE"),u=bufferExports.Buffer.alloc(64);function a(d){let p=o.decodeUnsafe(d);if(p==null||p.length<3)throw c(d);let h=p[0],y,b;if(h<64)b=h,y=1;else if(h<128){let S=p[1],E=(h<<2|S>>6)&255,B=S&63;b=E|B<<8,y=2}else throw c(d);let w;switch(p.length-y){case 34:case 35:w=2;break;case 9:case 5:case 3:case 2:w=1;break;default:throw c(d)}f(p,w);for(let S=0;S<w;S++)if(u[S]!=p[p.length-w+S])throw c(d);return{prefix:b,bytes:p.subarray(y,p.length-w)}}lib.decode=a;function s(d){let p=d.prefix;(0,t.default)(Number.isInteger(p)&&p>=0&&p<16384,"invalid prefix");let h=d.bytes.length,y;switch(h){case 1:case 2:case 4:case 8:y=1;break;case 32:case 33:y=2;break;default:(0,t.default)(!1,"invalid address length")}let b,w;p<64?(b=bufferExports.Buffer.allocUnsafe(1+y+h),b[0]=p,w=1):(b=bufferExports.Buffer.allocUnsafe(2+y+h),b[0]=(p&252)>>2|64,b[1]=p>>8|(p&3)<<6,w=2),b.set(d.bytes,w),f(b,y);for(let S=0;S<y;S++)b[w+h+S]=u[S];return o.encode(b)}lib.encode=s;function f(d,p){let h=(0,n.default)(64);h.update(i),h.update(d.subarray(0,d.length-p)),h.digest(u)}function c(d){return new Error("Invalid ss58 address: "+d)}return lib}var libExports=requireLib();function base$2(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let f=0;f<t.length;f++)t[f]=255;for(let f=0;f<e.length;f++){const c=e.charAt(f),d=c.charCodeAt(0);if(t[d]!==255)throw new TypeError(c+" is ambiguous");t[d]=f}const r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),i=Math.log(256)/Math.log(r);function u(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";let c=0,d=0,p=0;const h=f.length;for(;p!==h&&f[p]===0;)p++,c++;const y=(h-p)*i+1>>>0,b=new Uint8Array(y);for(;p!==h;){let E=f[p],B=0;for(let ae=y-1;(E!==0||B<d)&&ae!==-1;ae--,B++)E+=256*b[ae]>>>0,b[ae]=E%r>>>0,E=E/r>>>0;if(E!==0)throw new Error("Non-zero carry");d=B,p++}let w=y-d;for(;w!==y&&b[w]===0;)w++;let S=n.repeat(c);for(;w<y;++w)S+=e.charAt(b[w]);return S}function a(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let c=0,d=0,p=0;for(;f[c]===n;)d++,c++;const h=(f.length-c)*o+1>>>0,y=new Uint8Array(h);for(;c<f.length;){const E=f.charCodeAt(c);if(E>255)return;let B=t[E];if(B===255)return;let ae=0;for(let W=h-1;(B!==0||ae<p)&&W!==-1;W--,ae++)B+=r*y[W]>>>0,y[W]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");p=ae,c++}let b=h-p;for(;b!==h&&y[b]===0;)b++;const w=new Uint8Array(d+(h-b));let S=d;for(;b!==h;)w[S++]=y[b++];return w}function s(f){const c=a(f);if(c)return c;throw new Error("Non-base"+r+" character")}return{encode:u,decodeUnsafe:a,decode:s}}var ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const bs58=base$2(ALPHABET);function bs58checkBase(e){function t(i){var u=Uint8Array.from(i),a=e(u),s=u.length+4,f=new Uint8Array(s);return f.set(u,0),f.set(a.subarray(0,4),u.length),bs58.encode(f)}function r(i){var u=i.slice(0,-4),a=i.slice(-4),s=e(u);if(!(a[0]^s[0]|a[1]^s[1]|a[2]^s[2]|a[3]^s[3]))return u}function n(i){var u=bs58.decodeUnsafe(i);if(u!=null)return r(u)}function o(i){var u=bs58.decode(i),a=r(u);if(a==null)throw new Error("Invalid checksum");return a}return{encode:t,decode:o,decodeUnsafe:n}}function sha256x2(e){return sha256$3(sha256$3(e))}const bs58check=bs58checkBase(sha256x2);var dist$2={},hasRequiredDist$1;function requireDist$1(){if(hasRequiredDist$1)return dist$2;hasRequiredDist$1=1,Object.defineProperty(dist$2,"__esModule",{value:!0}),dist$2.bech32m=dist$2.bech32=void 0;const e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",t={};for(let f=0;f<e.length;f++){const c=e.charAt(f);t[c]=f}function r(f){const c=f>>25;return(f&33554431)<<5^-(c>>0&1)&996825010^-(c>>1&1)&642813549^-(c>>2&1)&513874426^-(c>>3&1)&1027748829^-(c>>4&1)&705979059}function n(f){let c=1;for(let d=0;d<f.length;++d){const p=f.charCodeAt(d);if(p<33||p>126)return"Invalid prefix ("+f+")";c=r(c)^p>>5}c=r(c);for(let d=0;d<f.length;++d){const p=f.charCodeAt(d);c=r(c)^p&31}return c}function o(f,c,d,p){let h=0,y=0;const b=(1<<d)-1,w=[];for(let S=0;S<f.length;++S)for(h=h<<c|f[S],y+=c;y>=d;)y-=d,w.push(h>>y&b);if(p)y>0&&w.push(h<<d-y&b);else{if(y>=c)return"Excess padding";if(h<<d-y&b)return"Non-zero padding"}return w}function i(f){return o(f,8,5,!0)}function u(f){const c=o(f,5,8,!1);if(Array.isArray(c))return c}function a(f){const c=o(f,5,8,!1);if(Array.isArray(c))return c;throw new Error(c)}function s(f){let c;f==="bech32"?c=1:c=734539939;function d(b,w,S){if(S=S||90,b.length+7+w.length>S)throw new TypeError("Exceeds length limit");b=b.toLowerCase();let E=n(b);if(typeof E=="string")throw new Error(E);let B=b+"1";for(let ae=0;ae<w.length;++ae){const W=w[ae];if(W>>5!==0)throw new Error("Non 5-bit word");E=r(E)^W,B+=e.charAt(W)}for(let ae=0;ae<6;++ae)E=r(E);E^=c;for(let ae=0;ae<6;++ae){const W=E>>(5-ae)*5&31;B+=e.charAt(W)}return B}function p(b,w){if(w=w||90,b.length<8)return b+" too short";if(b.length>w)return"Exceeds length limit";const S=b.toLowerCase(),E=b.toUpperCase();if(b!==S&&b!==E)return"Mixed-case string "+b;b=S;const B=b.lastIndexOf("1");if(B===-1)return"No separator character for "+b;if(B===0)return"Missing prefix for "+b;const ae=b.slice(0,B),W=b.slice(B+1);if(W.length<6)return"Data too short";let J=n(ae);if(typeof J=="string")return J;const ve=[];for(let Qe=0;Qe<W.length;++Qe){const kt=W.charAt(Qe),nr=t[kt];if(nr===void 0)return"Unknown character "+kt;J=r(J)^nr,!(Qe+6>=W.length)&&ve.push(nr)}return J!==c?"Invalid checksum for "+b:{prefix:ae,words:ve}}function h(b,w){const S=p(b,w);if(typeof S=="object")return S}function y(b,w){const S=p(b,w);if(typeof S=="object")return S;throw new Error(S)}return{decodeUnsafe:h,decode:y,encode:d,toWords:i,fromWordsUnsafe:u,fromWords:a}}return dist$2.bech32=s("bech32"),dist$2.bech32m=s("bech32m"),dist$2}var distExports$1=requireDist$1(),base32$1={exports:{}},hasRequiredBase32;function requireBase32(){return hasRequiredBase32||(hasRequiredBase32=1,(function(e){(function(){var t=typeof window=="object"?window:{},r=!t.HI_BASE32_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;r&&(t=commonjsGlobal);var n=!t.HI_BASE32_NO_COMMON_JS&&!0&&e.exports,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),i={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},u=[0,0,0,0,0,0,0,0],a=function(w,S){S.length>10&&(S="..."+S.substr(-10));var E=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+w+" bytes: "+S+" <-");throw E.position=w,E},s=function(w){for(var S="",E=w.length,B=0,ae=0,W,J;B<E;){if(W=w[B++],W<=127){S+=String.fromCharCode(W);continue}else W>191&&W<=223?(J=W&31,ae=1):W<=239?(J=W&15,ae=2):W<=247?(J=W&7,ae=3):a(B,S);for(var ve=0;ve<ae;++ve)W=w[B++],(W<128||W>191)&&a(B,S),J<<=6,J+=W&63;J>=55296&&J<=57343&&a(B,S),J>1114111&&a(B,S),J<=65535?S+=String.fromCharCode(J):(J-=65536,S+=String.fromCharCode((J>>10)+55296),S+=String.fromCharCode((J&1023)+56320))}return S},f=function(w){if(w==="")return[];if(!/^[A-Z2-7=]+$/.test(w))throw new Error("Invalid base32 characters");w=w.replace(/=/g,"");for(var S,E,B,ae,W,J,ve,Qe,kt=[],nr=0,sr=w.length,ce=0,Ze=sr>>3<<3;ce<Ze;)S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],Qe=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255,kt[nr++]=(ae<<4|W>>>1)&255,kt[nr++]=(W<<7|J<<2|ve>>>3)&255,kt[nr++]=(ve<<5|Qe)&255;var se=sr-Ze;return se===2?(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255):se===4?(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255):se===5?(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255,kt[nr++]=(ae<<4|W>>>1)&255):se===7&&(S=i[w.charAt(ce++)],E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],kt[nr++]=(S<<3|E>>>2)&255,kt[nr++]=(E<<6|B<<1|ae>>>4)&255,kt[nr++]=(ae<<4|W>>>1)&255,kt[nr++]=(W<<7|J<<2|ve>>>3)&255),kt},c=function(w){for(var S,E,B,ae,W,J="",ve=w.length,Qe=0,kt=parseInt(ve/5)*5;Qe<kt;)S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe++),B=w.charCodeAt(Qe++),ae=w.charCodeAt(Qe++),W=w.charCodeAt(Qe++),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[(ae<<3|W>>>5)&31]+o[W&31];var nr=ve-kt;return nr===1?(S=w.charCodeAt(Qe),J+=o[S>>>3]+o[S<<2&31]+"======"):nr===2?(S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[E<<4&31]+"===="):nr===3?(S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe++),B=w.charCodeAt(Qe),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[B<<1&31]+"==="):nr===4&&(S=w.charCodeAt(Qe++),E=w.charCodeAt(Qe++),B=w.charCodeAt(Qe++),ae=w.charCodeAt(Qe),J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[ae<<3&31]+"="),J},d=function(w){var S,E,B,ae,W,J,ve=!1,Qe="",kt=0,nr,sr=0,ce=w.length;if(w==="")return Qe;do{for(u[0]=u[5],u[1]=u[6],u[2]=u[7],nr=sr;kt<ce&&nr<5;++kt)J=w.charCodeAt(kt),J<128?u[nr++]=J:J<2048?(u[nr++]=192|J>>6,u[nr++]=128|J&63):J<55296||J>=57344?(u[nr++]=224|J>>12,u[nr++]=128|J>>6&63,u[nr++]=128|J&63):(J=65536+((J&1023)<<10|w.charCodeAt(++kt)&1023),u[nr++]=240|J>>18,u[nr++]=128|J>>12&63,u[nr++]=128|J>>6&63,u[nr++]=128|J&63);sr=nr-5,kt===ce&&++kt,kt>ce&&nr<6&&(ve=!0),S=u[0],nr>4?(E=u[1],B=u[2],ae=u[3],W=u[4],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[(ae<<3|W>>>5)&31]+o[W&31]):nr===1?Qe+=o[S>>>3]+o[S<<2&31]+"======":nr===2?(E=u[1],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[E<<4&31]+"===="):nr===3?(E=u[1],B=u[2],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[B<<1&31]+"==="):(E=u[1],B=u[2],ae=u[3],Qe+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[ae<<3&31]+"=")}while(!ve);return Qe},p=function(w){for(var S,E,B,ae,W,J="",ve=w.length,Qe=0,kt=parseInt(ve/5)*5;Qe<kt;)S=w[Qe++],E=w[Qe++],B=w[Qe++],ae=w[Qe++],W=w[Qe++],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[(ae<<3|W>>>5)&31]+o[W&31];var nr=ve-kt;return nr===1?(S=w[Qe],J+=o[S>>>3]+o[S<<2&31]+"======"):nr===2?(S=w[Qe++],E=w[Qe],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[E<<4&31]+"===="):nr===3?(S=w[Qe++],E=w[Qe++],B=w[Qe],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[B<<1&31]+"==="):nr===4&&(S=w[Qe++],E=w[Qe++],B=w[Qe++],ae=w[Qe],J+=o[S>>>3]+o[(S<<2|E>>>6)&31]+o[E>>>1&31]+o[(E<<4|B>>>4)&31]+o[(B<<1|ae>>>7)&31]+o[ae>>>2&31]+o[ae<<3&31]+"="),J},h=function(w,S){var E=typeof w!="string";return E&&w.constructor===ArrayBuffer&&(w=new Uint8Array(w)),E?p(w):S?c(w):d(w)},y=function(w,S){if(!S)return s(f(w));if(w==="")return"";if(!/^[A-Z2-7=]+$/.test(w))throw new Error("Invalid base32 characters");var E,B,ae,W,J,ve,Qe,kt,nr="",sr=w.indexOf("=");sr===-1&&(sr=w.length);for(var ce=0,Ze=sr>>3<<3;ce<Ze;)E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],Qe=i[w.charAt(ce++)],kt=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)+String.fromCharCode((W<<4|J>>>1)&255)+String.fromCharCode((J<<7|ve<<2|Qe>>>3)&255)+String.fromCharCode((Qe<<5|kt)&255);var se=sr-Ze;return se===2?(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)):se===4?(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)):se===5?(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)+String.fromCharCode((W<<4|J>>>1)&255)):se===7&&(E=i[w.charAt(ce++)],B=i[w.charAt(ce++)],ae=i[w.charAt(ce++)],W=i[w.charAt(ce++)],J=i[w.charAt(ce++)],ve=i[w.charAt(ce++)],Qe=i[w.charAt(ce++)],nr+=String.fromCharCode((E<<3|B>>>2)&255)+String.fromCharCode((B<<6|ae<<1|W>>>4)&255)+String.fromCharCode((W<<4|J>>>1)&255)+String.fromCharCode((J<<7|ve<<2|Qe>>>3)&255)),nr},b={encode:h,decode:y};y.asBytes=f,n?e.exports=b:t.base32=b})()})(base32$1)),base32$1.exports}var base32Exports=requireBase32();const base32=getDefaultExportFromCjs(base32Exports);var sha512$5={exports:{}},hasRequiredSha512$2;function requireSha512$2(){return hasRequiredSha512$2||(hasRequiredSha512$2=1,(function(e){(function(){var t="input is invalid type",r="finalize already called",n=typeof window=="object",o=n?window:{};o.JS_SHA512_NO_WINDOW&&(n=!1);var i=!n&&typeof self=="object",u=!o.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;u?o=commonjsGlobal:i&&(o=self);var a=!o.JS_SHA512_NO_COMMON_JS&&!0&&e.exports,s=!o.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",f="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],d=[24,16,8,0],p=[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],h=["hex","array","digest","arrayBuffer"],y=[],b=Array.isArray;(o.JS_SHA512_NO_NODE_JS||!b)&&(b=function(kt){return Object.prototype.toString.call(kt)==="[object Array]"});var w=ArrayBuffer.isView;s&&(o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!w)&&(w=function(kt){return typeof kt=="object"&&kt.buffer&&kt.buffer.constructor===ArrayBuffer});var S=function(kt){var nr=typeof kt;if(nr==="string")return[kt,!0];if(nr!=="object"||kt===null)throw new Error(t);if(s&&kt.constructor===ArrayBuffer)return[new Uint8Array(kt),!1];if(!b(kt)&&!w(kt))throw new Error(t);return[kt,!1]},E=function(kt,nr){return function(sr){return new J(nr,!0).update(sr)[kt]()}},B=function(kt){var nr=E("hex",kt);nr.create=function(){return new J(kt)},nr.update=function(Ze){return nr.create().update(Ze)};for(var sr=0;sr<h.length;++sr){var ce=h[sr];nr[ce]=E(ce,kt)}return nr},ae=function(kt,nr){return function(sr,ce){return new ve(sr,nr,!0).update(ce)[kt]()}},W=function(kt){var nr=ae("hex",kt);nr.create=function(Ze){return new ve(Ze,kt)},nr.update=function(Ze,se){return nr.create(Ze).update(se)};for(var sr=0;sr<h.length;++sr){var ce=h[sr];nr[ce]=ae(ce,kt)}return nr};function J(kt,nr){nr?(y[0]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=y[16]=y[17]=y[18]=y[19]=y[20]=y[21]=y[22]=y[23]=y[24]=y[25]=y[26]=y[27]=y[28]=y[29]=y[30]=y[31]=y[32]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],kt==384?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):kt==256?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):kt==224?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=kt,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}J.prototype.update=function(kt){if(this.finalized)throw new Error(r);var nr=S(kt);kt=nr[0];for(var sr=nr[1],ce,Ze=0,se,vt=kt.length,ur=this.blocks;Ze<vt;){if(this.hashed&&(this.hashed=!1,ur[0]=this.block,this.block=ur[1]=ur[2]=ur[3]=ur[4]=ur[5]=ur[6]=ur[7]=ur[8]=ur[9]=ur[10]=ur[11]=ur[12]=ur[13]=ur[14]=ur[15]=ur[16]=ur[17]=ur[18]=ur[19]=ur[20]=ur[21]=ur[22]=ur[23]=ur[24]=ur[25]=ur[26]=ur[27]=ur[28]=ur[29]=ur[30]=ur[31]=ur[32]=0),sr)for(se=this.start;Ze<vt&&se<128;++Ze)ce=kt.charCodeAt(Ze),ce<128?ur[se>>>2]|=ce<<d[se++&3]:ce<2048?(ur[se>>>2]|=(192|ce>>>6)<<d[se++&3],ur[se>>>2]|=(128|ce&63)<<d[se++&3]):ce<55296||ce>=57344?(ur[se>>>2]|=(224|ce>>>12)<<d[se++&3],ur[se>>>2]|=(128|ce>>>6&63)<<d[se++&3],ur[se>>>2]|=(128|ce&63)<<d[se++&3]):(ce=65536+((ce&1023)<<10|kt.charCodeAt(++Ze)&1023),ur[se>>>2]|=(240|ce>>>18)<<d[se++&3],ur[se>>>2]|=(128|ce>>>12&63)<<d[se++&3],ur[se>>>2]|=(128|ce>>>6&63)<<d[se++&3],ur[se>>>2]|=(128|ce&63)<<d[se++&3]);else for(se=this.start;Ze<vt&&se<128;++Ze)ur[se>>>2]|=kt[Ze]<<d[se++&3];this.lastByteIndex=se,this.bytes+=se-this.start,se>=128?(this.block=ur[32],this.start=se-128,this.hash(),this.hashed=!0):this.start=se}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var kt=this.blocks,nr=this.lastByteIndex;kt[32]=this.block,kt[nr>>>2]|=c[nr&3],this.block=kt[32],nr>=112&&(this.hashed||this.hash(),kt[0]=this.block,kt[1]=kt[2]=kt[3]=kt[4]=kt[5]=kt[6]=kt[7]=kt[8]=kt[9]=kt[10]=kt[11]=kt[12]=kt[13]=kt[14]=kt[15]=kt[16]=kt[17]=kt[18]=kt[19]=kt[20]=kt[21]=kt[22]=kt[23]=kt[24]=kt[25]=kt[26]=kt[27]=kt[28]=kt[29]=kt[30]=kt[31]=kt[32]=0),kt[30]=this.hBytes<<3|this.bytes>>>29,kt[31]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var kt=this.h0h,nr=this.h0l,sr=this.h1h,ce=this.h1l,Ze=this.h2h,se=this.h2l,vt=this.h3h,ur=this.h3l,ue=this.h4h,bt=this.h4l,L=this.h5h,_=this.h5l,F=this.h6h,k=this.h6l,Ye=this.h7h,rn=this.h7l,ii=this.blocks,ai,ni,ri,ui,lr,ar,jr,ci,mi,pi,ei,Gr,ti,fi,bi,Ai,Bi,qi,vn,di,rr,on,si,vi,Ei;for(ai=32;ai<160;ai+=2)di=ii[ai-30],rr=ii[ai-29],ni=(di>>>1|rr<<31)^(di>>>8|rr<<24)^di>>>7,ri=(rr>>>1|di<<31)^(rr>>>8|di<<24)^(rr>>>7|di<<25),di=ii[ai-4],rr=ii[ai-3],ui=(di>>>19|rr<<13)^(rr>>>29|di<<3)^di>>>6,lr=(rr>>>19|di<<13)^(di>>>29|rr<<3)^(rr>>>6|di<<26),di=ii[ai-32],rr=ii[ai-31],on=ii[ai-14],si=ii[ai-13],ar=(si&65535)+(rr&65535)+(ri&65535)+(lr&65535),jr=(si>>>16)+(rr>>>16)+(ri>>>16)+(lr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(ni&65535)+(ui&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ni>>>16)+(ui>>>16)+(ci>>>16),ii[ai]=mi<<16|ci&65535,ii[ai+1]=jr<<16|ar&65535;var Mi=kt,Di=nr,Ii=sr,Ci=ce,Vi=Ze,Hi=se,Ji=vt,no=ur,co=ue,Fo=bt,Io=L,Ro=_,Oo=F,To=k,Po=Ye,ia=rn;for(Ai=Ii&Vi,Bi=Ci&Hi,ai=0;ai<160;ai+=8)ni=(Mi>>>28|Di<<4)^(Di>>>2|Mi<<30)^(Di>>>7|Mi<<25),ri=(Di>>>28|Mi<<4)^(Mi>>>2|Di<<30)^(Mi>>>7|Di<<25),ui=(co>>>14|Fo<<18)^(co>>>18|Fo<<14)^(Fo>>>9|co<<23),lr=(Fo>>>14|co<<18)^(Fo>>>18|co<<14)^(co>>>9|Fo<<23),pi=Mi&Ii,ei=Di&Ci,qi=pi^Mi&Vi^Ai,vn=ei^Di&Hi^Bi,vi=co&Io^~co&Oo,Ei=Fo&Ro^~Fo&To,di=ii[ai],rr=ii[ai+1],on=p[ai],si=p[ai+1],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(ia&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(ia>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(Po&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(Po>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(no&65535)+(rr&65535),jr=(no>>>16)+(rr>>>16)+(ar>>>16),ci=(Ji&65535)+(di&65535)+(jr>>>16),mi=(Ji>>>16)+(di>>>16)+(ci>>>16),Po=mi<<16|ci&65535,ia=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Ji=mi<<16|ci&65535,no=jr<<16|ar&65535,ni=(Ji>>>28|no<<4)^(no>>>2|Ji<<30)^(no>>>7|Ji<<25),ri=(no>>>28|Ji<<4)^(Ji>>>2|no<<30)^(Ji>>>7|no<<25),ui=(Po>>>14|ia<<18)^(Po>>>18|ia<<14)^(ia>>>9|Po<<23),lr=(ia>>>14|Po<<18)^(ia>>>18|Po<<14)^(Po>>>9|ia<<23),Gr=Ji&Mi,ti=no&Di,qi=Gr^Ji&Ii^pi,vn=ti^no&Ci^ei,vi=Po&co^~Po&Io,Ei=ia&Fo^~ia&Ro,di=ii[ai+2],rr=ii[ai+3],on=p[ai+2],si=p[ai+3],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(To&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(To>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(Oo&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(Oo>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(Hi&65535)+(rr&65535),jr=(Hi>>>16)+(rr>>>16)+(ar>>>16),ci=(Vi&65535)+(di&65535)+(jr>>>16),mi=(Vi>>>16)+(di>>>16)+(ci>>>16),Oo=mi<<16|ci&65535,To=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Vi=mi<<16|ci&65535,Hi=jr<<16|ar&65535,ni=(Vi>>>28|Hi<<4)^(Hi>>>2|Vi<<30)^(Hi>>>7|Vi<<25),ri=(Hi>>>28|Vi<<4)^(Vi>>>2|Hi<<30)^(Vi>>>7|Hi<<25),ui=(Oo>>>14|To<<18)^(Oo>>>18|To<<14)^(To>>>9|Oo<<23),lr=(To>>>14|Oo<<18)^(To>>>18|Oo<<14)^(Oo>>>9|To<<23),fi=Vi&Ji,bi=Hi&no,qi=fi^Vi&Mi^Gr,vn=bi^Hi&Di^ti,vi=Oo&Po^~Oo&co,Ei=To&ia^~To&Fo,di=ii[ai+4],rr=ii[ai+5],on=p[ai+4],si=p[ai+5],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(Ro&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(Ro>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(Io&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(Io>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(Ci&65535)+(rr&65535),jr=(Ci>>>16)+(rr>>>16)+(ar>>>16),ci=(Ii&65535)+(di&65535)+(jr>>>16),mi=(Ii>>>16)+(di>>>16)+(ci>>>16),Io=mi<<16|ci&65535,Ro=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Ii=mi<<16|ci&65535,Ci=jr<<16|ar&65535,ni=(Ii>>>28|Ci<<4)^(Ci>>>2|Ii<<30)^(Ci>>>7|Ii<<25),ri=(Ci>>>28|Ii<<4)^(Ii>>>2|Ci<<30)^(Ii>>>7|Ci<<25),ui=(Io>>>14|Ro<<18)^(Io>>>18|Ro<<14)^(Ro>>>9|Io<<23),lr=(Ro>>>14|Io<<18)^(Ro>>>18|Io<<14)^(Io>>>9|Ro<<23),Ai=Ii&Vi,Bi=Ci&Hi,qi=Ai^Ii&Ji^fi,vn=Bi^Ci&no^bi,vi=Io&Oo^~Io&Po,Ei=Ro&To^~Ro&ia,di=ii[ai+6],rr=ii[ai+7],on=p[ai+6],si=p[ai+7],ar=(si&65535)+(rr&65535)+(Ei&65535)+(lr&65535)+(Fo&65535),jr=(si>>>16)+(rr>>>16)+(Ei>>>16)+(lr>>>16)+(Fo>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(vi&65535)+(ui&65535)+(co&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(vi>>>16)+(ui>>>16)+(co>>>16)+(ci>>>16),di=mi<<16|ci&65535,rr=jr<<16|ar&65535,ar=(vn&65535)+(ri&65535),jr=(vn>>>16)+(ri>>>16)+(ar>>>16),ci=(qi&65535)+(ni&65535)+(jr>>>16),mi=(qi>>>16)+(ni>>>16)+(ci>>>16),on=mi<<16|ci&65535,si=jr<<16|ar&65535,ar=(Di&65535)+(rr&65535),jr=(Di>>>16)+(rr>>>16)+(ar>>>16),ci=(Mi&65535)+(di&65535)+(jr>>>16),mi=(Mi>>>16)+(di>>>16)+(ci>>>16),co=mi<<16|ci&65535,Fo=jr<<16|ar&65535,ar=(si&65535)+(rr&65535),jr=(si>>>16)+(rr>>>16)+(ar>>>16),ci=(on&65535)+(di&65535)+(jr>>>16),mi=(on>>>16)+(di>>>16)+(ci>>>16),Mi=mi<<16|ci&65535,Di=jr<<16|ar&65535;ar=(nr&65535)+(Di&65535),jr=(nr>>>16)+(Di>>>16)+(ar>>>16),ci=(kt&65535)+(Mi&65535)+(jr>>>16),mi=(kt>>>16)+(Mi>>>16)+(ci>>>16),this.h0h=mi<<16|ci&65535,this.h0l=jr<<16|ar&65535,ar=(ce&65535)+(Ci&65535),jr=(ce>>>16)+(Ci>>>16)+(ar>>>16),ci=(sr&65535)+(Ii&65535)+(jr>>>16),mi=(sr>>>16)+(Ii>>>16)+(ci>>>16),this.h1h=mi<<16|ci&65535,this.h1l=jr<<16|ar&65535,ar=(se&65535)+(Hi&65535),jr=(se>>>16)+(Hi>>>16)+(ar>>>16),ci=(Ze&65535)+(Vi&65535)+(jr>>>16),mi=(Ze>>>16)+(Vi>>>16)+(ci>>>16),this.h2h=mi<<16|ci&65535,this.h2l=jr<<16|ar&65535,ar=(ur&65535)+(no&65535),jr=(ur>>>16)+(no>>>16)+(ar>>>16),ci=(vt&65535)+(Ji&65535)+(jr>>>16),mi=(vt>>>16)+(Ji>>>16)+(ci>>>16),this.h3h=mi<<16|ci&65535,this.h3l=jr<<16|ar&65535,ar=(bt&65535)+(Fo&65535),jr=(bt>>>16)+(Fo>>>16)+(ar>>>16),ci=(ue&65535)+(co&65535)+(jr>>>16),mi=(ue>>>16)+(co>>>16)+(ci>>>16),this.h4h=mi<<16|ci&65535,this.h4l=jr<<16|ar&65535,ar=(_&65535)+(Ro&65535),jr=(_>>>16)+(Ro>>>16)+(ar>>>16),ci=(L&65535)+(Io&65535)+(jr>>>16),mi=(L>>>16)+(Io>>>16)+(ci>>>16),this.h5h=mi<<16|ci&65535,this.h5l=jr<<16|ar&65535,ar=(k&65535)+(To&65535),jr=(k>>>16)+(To>>>16)+(ar>>>16),ci=(F&65535)+(Oo&65535)+(jr>>>16),mi=(F>>>16)+(Oo>>>16)+(ci>>>16),this.h6h=mi<<16|ci&65535,this.h6l=jr<<16|ar&65535,ar=(rn&65535)+(ia&65535),jr=(rn>>>16)+(ia>>>16)+(ar>>>16),ci=(Ye&65535)+(Po&65535)+(jr>>>16),mi=(Ye>>>16)+(Po>>>16)+(ci>>>16),this.h7h=mi<<16|ci&65535,this.h7l=jr<<16|ar&65535},J.prototype.hex=function(){this.finalize();var kt=this.h0h,nr=this.h0l,sr=this.h1h,ce=this.h1l,Ze=this.h2h,se=this.h2l,vt=this.h3h,ur=this.h3l,ue=this.h4h,bt=this.h4l,L=this.h5h,_=this.h5l,F=this.h6h,k=this.h6l,Ye=this.h7h,rn=this.h7l,ii=this.bits,ai=f[kt>>>28&15]+f[kt>>>24&15]+f[kt>>>20&15]+f[kt>>>16&15]+f[kt>>>12&15]+f[kt>>>8&15]+f[kt>>>4&15]+f[kt&15]+f[nr>>>28&15]+f[nr>>>24&15]+f[nr>>>20&15]+f[nr>>>16&15]+f[nr>>>12&15]+f[nr>>>8&15]+f[nr>>>4&15]+f[nr&15]+f[sr>>>28&15]+f[sr>>>24&15]+f[sr>>>20&15]+f[sr>>>16&15]+f[sr>>>12&15]+f[sr>>>8&15]+f[sr>>>4&15]+f[sr&15]+f[ce>>>28&15]+f[ce>>>24&15]+f[ce>>>20&15]+f[ce>>>16&15]+f[ce>>>12&15]+f[ce>>>8&15]+f[ce>>>4&15]+f[ce&15]+f[Ze>>>28&15]+f[Ze>>>24&15]+f[Ze>>>20&15]+f[Ze>>>16&15]+f[Ze>>>12&15]+f[Ze>>>8&15]+f[Ze>>>4&15]+f[Ze&15]+f[se>>>28&15]+f[se>>>24&15]+f[se>>>20&15]+f[se>>>16&15]+f[se>>>12&15]+f[se>>>8&15]+f[se>>>4&15]+f[se&15]+f[vt>>>28&15]+f[vt>>>24&15]+f[vt>>>20&15]+f[vt>>>16&15]+f[vt>>>12&15]+f[vt>>>8&15]+f[vt>>>4&15]+f[vt&15];return ii>=256&&(ai+=f[ur>>>28&15]+f[ur>>>24&15]+f[ur>>>20&15]+f[ur>>>16&15]+f[ur>>>12&15]+f[ur>>>8&15]+f[ur>>>4&15]+f[ur&15]),ii>=384&&(ai+=f[ue>>>28&15]+f[ue>>>24&15]+f[ue>>>20&15]+f[ue>>>16&15]+f[ue>>>12&15]+f[ue>>>8&15]+f[ue>>>4&15]+f[ue&15]+f[bt>>>28&15]+f[bt>>>24&15]+f[bt>>>20&15]+f[bt>>>16&15]+f[bt>>>12&15]+f[bt>>>8&15]+f[bt>>>4&15]+f[bt&15]+f[L>>>28&15]+f[L>>>24&15]+f[L>>>20&15]+f[L>>>16&15]+f[L>>>12&15]+f[L>>>8&15]+f[L>>>4&15]+f[L&15]+f[_>>>28&15]+f[_>>>24&15]+f[_>>>20&15]+f[_>>>16&15]+f[_>>>12&15]+f[_>>>8&15]+f[_>>>4&15]+f[_&15]),ii==512&&(ai+=f[F>>>28&15]+f[F>>>24&15]+f[F>>>20&15]+f[F>>>16&15]+f[F>>>12&15]+f[F>>>8&15]+f[F>>>4&15]+f[F&15]+f[k>>>28&15]+f[k>>>24&15]+f[k>>>20&15]+f[k>>>16&15]+f[k>>>12&15]+f[k>>>8&15]+f[k>>>4&15]+f[k&15]+f[Ye>>>28&15]+f[Ye>>>24&15]+f[Ye>>>20&15]+f[Ye>>>16&15]+f[Ye>>>12&15]+f[Ye>>>8&15]+f[Ye>>>4&15]+f[Ye&15]+f[rn>>>28&15]+f[rn>>>24&15]+f[rn>>>20&15]+f[rn>>>16&15]+f[rn>>>12&15]+f[rn>>>8&15]+f[rn>>>4&15]+f[rn&15]),ai},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var kt=this.h0h,nr=this.h0l,sr=this.h1h,ce=this.h1l,Ze=this.h2h,se=this.h2l,vt=this.h3h,ur=this.h3l,ue=this.h4h,bt=this.h4l,L=this.h5h,_=this.h5l,F=this.h6h,k=this.h6l,Ye=this.h7h,rn=this.h7l,ii=this.bits,ai=[kt>>>24&255,kt>>>16&255,kt>>>8&255,kt&255,nr>>>24&255,nr>>>16&255,nr>>>8&255,nr&255,sr>>>24&255,sr>>>16&255,sr>>>8&255,sr&255,ce>>>24&255,ce>>>16&255,ce>>>8&255,ce&255,Ze>>>24&255,Ze>>>16&255,Ze>>>8&255,Ze&255,se>>>24&255,se>>>16&255,se>>>8&255,se&255,vt>>>24&255,vt>>>16&255,vt>>>8&255,vt&255];return ii>=256&&ai.push(ur>>>24&255,ur>>>16&255,ur>>>8&255,ur&255),ii>=384&&ai.push(ue>>>24&255,ue>>>16&255,ue>>>8&255,ue&255,bt>>>24&255,bt>>>16&255,bt>>>8&255,bt&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255),ii==512&&ai.push(F>>>24&255,F>>>16&255,F>>>8&255,F&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255,Ye>>>24&255,Ye>>>16&255,Ye>>>8&255,Ye&255,rn>>>24&255,rn>>>16&255,rn>>>8&255,rn&255),ai},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var kt=this.bits,nr=new ArrayBuffer(kt/8),sr=new DataView(nr);return sr.setUint32(0,this.h0h),sr.setUint32(4,this.h0l),sr.setUint32(8,this.h1h),sr.setUint32(12,this.h1l),sr.setUint32(16,this.h2h),sr.setUint32(20,this.h2l),sr.setUint32(24,this.h3h),kt>=256&&sr.setUint32(28,this.h3l),kt>=384&&(sr.setUint32(32,this.h4h),sr.setUint32(36,this.h4l),sr.setUint32(40,this.h5h),sr.setUint32(44,this.h5l)),kt==512&&(sr.setUint32(48,this.h6h),sr.setUint32(52,this.h6l),sr.setUint32(56,this.h7h),sr.setUint32(60,this.h7l)),nr},J.prototype.clone=function(){var kt=new J(this.bits,!1);return this.copyTo(kt),kt},J.prototype.copyTo=function(kt){var nr=0,sr=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(nr=0;nr<sr.length;++nr)kt[sr[nr]]=this[sr[nr]];for(nr=0;nr<this.blocks.length;++nr)kt.blocks[nr]=this.blocks[nr]};function ve(kt,nr,sr){var ce,Ze=S(kt);if(kt=Ze[0],Ze[1]){for(var se=[],vt=kt.length,ur=0,ue,ce=0;ce<vt;++ce)ue=kt.charCodeAt(ce),ue<128?se[ur++]=ue:ue<2048?(se[ur++]=192|ue>>>6,se[ur++]=128|ue&63):ue<55296||ue>=57344?(se[ur++]=224|ue>>>12,se[ur++]=128|ue>>>6&63,se[ur++]=128|ue&63):(ue=65536+((ue&1023)<<10|kt.charCodeAt(++ce)&1023),se[ur++]=240|ue>>>18,se[ur++]=128|ue>>>12&63,se[ur++]=128|ue>>>6&63,se[ur++]=128|ue&63);kt=se}kt.length>128&&(kt=new J(nr,!0).update(kt).array());for(var bt=[],L=[],ce=0;ce<128;++ce){var _=kt[ce]||0;bt[ce]=92^_,L[ce]=54^_}J.call(this,nr,sr),this.update(L),this.oKeyPad=bt,this.inner=!0,this.sharedMemory=sr}ve.prototype=new J,ve.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var kt=this.array();J.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(kt),J.prototype.finalize.call(this)}},ve.prototype.clone=function(){var kt=new ve([],this.bits,!1);this.copyTo(kt),kt.inner=this.inner;for(var nr=0;nr<this.oKeyPad.length;++nr)kt.oKeyPad[nr]=this.oKeyPad[nr];return kt};var Qe=B(512);Qe.sha512=Qe,Qe.sha384=B(384),Qe.sha512_256=B(256),Qe.sha512_224=B(224),Qe.sha512.hmac=W(512),Qe.sha384.hmac=W(384),Qe.sha512_256.hmac=W(256),Qe.sha512_224.hmac=W(224),a?e.exports=Qe:(o.sha512=Qe.sha512,o.sha384=Qe.sha384,o.sha512_256=Qe.sha512_256,o.sha512_224=Qe.sha512_224)})()})(sha512$5)),sha512$5.exports}var sha512Exports$1=requireSha512$2();const sha512$4=getDefaultExportFromCjs(sha512Exports$1),version$1="3.7.8",VERSION=version$1,_hasBuffer=typeof bufferExports.Buffer=="function",_TD=typeof TextDecoder=="function"?new TextDecoder:void 0,_TE=typeof TextEncoder=="function"?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(b64chs),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),_mkUriSafe=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),_tidyB64=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=e=>{let t,r,n,o,i="";const u=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,i+=b64chs[t>>18&63]+b64chs[t>>12&63]+b64chs[t>>6&63]+b64chs[t&63]}return u?i.slice(0,u-3)+"===".substring(u):i},_btoa=typeof btoa=="function"?e=>btoa(e):_hasBuffer?e=>bufferExports.Buffer.from(e,"binary").toString("base64"):btoaPolyfill,_fromUint8Array=_hasBuffer?e=>bufferExports.Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(_fromCC.apply(null,e.subarray(n,n+4096)));return _btoa(r.join(""))},fromUint8Array=(e,t=!1)=>t?_mkUriSafe(_fromUint8Array(e)):_fromUint8Array(e),cb_utob=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?_fromCC(192|t>>>6)+_fromCC(128|t&63):_fromCC(224|t>>>12&15)+_fromCC(128|t>>>6&63)+_fromCC(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return _fromCC(240|t>>>18&7)+_fromCC(128|t>>>12&63)+_fromCC(128|t>>>6&63)+_fromCC(128|t&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=e=>e.replace(re_utob,cb_utob),_encode=_hasBuffer?e=>bufferExports.Buffer.from(e,"utf8").toString("base64"):_TE?e=>_fromUint8Array(_TE.encode(e)):e=>_btoa(utob(e)),encode$1=(e,t=!1)=>t?_mkUriSafe(_encode(e)):_encode(e),encodeURI$1=e=>encode$1(e,!0),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return _fromCC((r>>>10)+55296)+_fromCC((r&1023)+56320);case 3:return _fromCC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return _fromCC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=e=>e.replace(re_btou,cb_btou),atobPolyfill=e=>{if(e=e.replace(/\s+/g,""),!b64re.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,o=[];for(let i=0;i<e.length;)t=b64tab[e.charAt(i++)]<<18|b64tab[e.charAt(i++)]<<12|(r=b64tab[e.charAt(i++)])<<6|(n=b64tab[e.charAt(i++)]),r===64?o.push(_fromCC(t>>16&255)):n===64?o.push(_fromCC(t>>16&255,t>>8&255)):o.push(_fromCC(t>>16&255,t>>8&255,t&255));return o.join("")},_atob=typeof atob=="function"?e=>atob(_tidyB64(e)):_hasBuffer?e=>bufferExports.Buffer.from(e,"base64").toString("binary"):atobPolyfill,_toUint8Array=_hasBuffer?e=>_U8Afrom(bufferExports.Buffer.from(e,"base64")):e=>_U8Afrom(_atob(e).split("").map(t=>t.charCodeAt(0))),toUint8Array=e=>_toUint8Array(_unURI(e)),_decode=_hasBuffer?e=>bufferExports.Buffer.from(e,"base64").toString("utf8"):_TD?e=>_TD.decode(_toUint8Array(e)):e=>btou(_atob(e)),_unURI=e=>_tidyB64(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),decode$1=e=>_decode(_unURI(e)),isValid$1=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},_noEnum=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),extendString=function(){const e=(t,r)=>Object.defineProperty(String.prototype,t,_noEnum(r));e("fromBase64",function(){return decode$1(this)}),e("toBase64",function(t){return encode$1(this,t)}),e("toBase64URI",function(){return encode$1(this,!0)}),e("toBase64URL",function(){return encode$1(this,!0)}),e("toUint8Array",function(){return toUint8Array(this)})},extendUint8Array=function(){const e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,_noEnum(r));e("toBase64",function(t){return fromUint8Array(this,t)}),e("toBase64URI",function(){return fromUint8Array(this,!0)}),e("toBase64URL",function(){return fromUint8Array(this,!0)})},extendBuiltins=()=>{extendString(),extendUint8Array()},gBase64={version:version$1,VERSION,atob:_atob,atobPolyfill,btoa:_btoa,btoaPolyfill,fromBase64:decode$1,toBase64:encode$1,encode:encode$1,encodeURI:encodeURI$1,encodeURL:encodeURI$1,utob,btou,decode:decode$1,isValid:isValid$1,fromUint8Array,toUint8Array,extendString,extendUint8Array,extendBuiltins},MALFORMED_ERROR_MSG=e=>`${e} is malformed`,CHECKSUM_ERROR_MSG=e=>`${e} checksum is wrong`,BLOCK_HASH_BYTE_LENGTH$1=32,TX_ID_BYTE_LENGTH$1=32,ADDRESS_BYTE_LENGTH$1=36,CHECKSUM_BYTE_LENGTH=4,ADDRESS_LENGTH=58,HASH_BYTES_LENGTH$1=32,PUBLIC_KEY_LENGTH$1=32,MALFORMED_BLOCK_HASH_ERROR_MSG$1=MALFORMED_ERROR_MSG("block hash"),MALFORMED_TX_ID_ERROR_MSG$1=MALFORMED_ERROR_MSG("tx id"),MALFORMED_ADDRESS_ERROR_MSG$2=MALFORMED_ERROR_MSG("address"),CHECKSUM_ADDRESS_ERROR_MSG$2=CHECKSUM_ERROR_MSG("address");function checksumFromPublicKey$1(e){return Uint8Array.from(sha512$4.sha512_256.array(e).slice(HASH_BYTES_LENGTH$1-CHECKSUM_BYTE_LENGTH,HASH_BYTES_LENGTH$1))}function verifyAlgorandAddress(e){if(typeof e!="string")throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$2}: expected string, got ${typeof e}, ${e}`);if(e.length!==ADDRESS_LENGTH)throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$2}: expected length ${ADDRESS_LENGTH}, got ${e.length}: ${e}`);const t=base32.decode.asBytes(e);if(t.length!==ADDRESS_BYTE_LENGTH$1)throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$2}: expected byte length ${ADDRESS_BYTE_LENGTH$1}, got ${t.length}`);const r=new Uint8Array(t.slice(0,ADDRESS_BYTE_LENGTH$1-CHECKSUM_BYTE_LENGTH)),n=new Uint8Array(t.slice(PUBLIC_KEY_LENGTH$1,ADDRESS_BYTE_LENGTH$1)),o=checksumFromPublicKey$1(r);if(!arrayEqual$1(o,n))throw new Error(CHECKSUM_ADDRESS_ERROR_MSG$2);return!0}function verifyAlgorandBlockHash(e){const t=gBase64.toUint8Array("3KYSrPgi16Cl3iLu3r+GaeZkBBrgNFbMB60jsrJtTdI=");if(t.length!==TX_ID_BYTE_LENGTH$1)throw new Error(`${MALFORMED_TX_ID_ERROR_MSG$1}: expected byte length ${TX_ID_BYTE_LENGTH$1}, got ${t.length}`);return!0}function verifyAlgorandTransactionHash(e){const t=base32.decode.asBytes(e);if(t.length!==BLOCK_HASH_BYTE_LENGTH$1)throw new Error(`${MALFORMED_BLOCK_HASH_ERROR_MSG$1}: expected byte length ${MALFORMED_BLOCK_HASH_ERROR_MSG$1}, got ${t.length}`);return!0}function arrayEqual$1(e,t){return e.length!==t.length?!1:Array.from(e).every((r,n)=>r===t[n])}const BLOCK_HASH_BYTE_LENGTH=34,TX_ID_BYTE_LENGTH=34,ADDRESS_BYTE_LENGTH=36,MALFORMED_BLOCK_HASH_ERROR_MSG=MALFORMED_ERROR_MSG("block hash"),MALFORMED_TX_ID_ERROR_MSG=MALFORMED_ERROR_MSG("tx id"),MALFORMED_ADDRESS_ERROR_MSG$1=MALFORMED_ERROR_MSG("address");function verifyMinaAddress(e){const t=bs58check.decode(e);if(t.length!==ADDRESS_BYTE_LENGTH)throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG$1}: expected byte length ${ADDRESS_BYTE_LENGTH}, got ${t.length}`);return!0}function verifyMinaBlockHash(e){const t=bs58check.decode(e);if(t.length!==TX_ID_BYTE_LENGTH)throw new Error(`${MALFORMED_BLOCK_HASH_ERROR_MSG}: expected byte length ${BLOCK_HASH_BYTE_LENGTH}, got ${t.length}`);return!0}function verifyMinaTransactionHash(e){const t=bs58check.decode(e);if(t.length!==TX_ID_BYTE_LENGTH)throw new Error(`${MALFORMED_TX_ID_ERROR_MSG}: expected byte length ${TX_ID_BYTE_LENGTH}, got ${t.length}`);return!0}function crc32GenerateTables({polynomial:e,numTables:t}){const r=new Uint32Array(256*t);for(let n=0;n<256;n++){let o=n;o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,o=(o&1)*e^o>>>1,r[n]=o}for(let n=256;n<r.length;n++){const o=r[n-256];r[n]=r[o&255]^o>>>8}return r}const CRC32_TABLE=crc32GenerateTables({polynomial:3988292384,numTables:8});function crc32Init(){return-1}function crc32Update(e,t){const r=t.byteLength,n=new DataView(t.buffer,t.byteOffset,r);let o=e,i=0;const u=-n.byteOffset&3;for(;i<u&&i<r;i++)o=CRC32_TABLE[(o^n.getUint8(i))&255]^o>>>8;if(i===r)return o;i=u;let a=r-i;for(;a>=8;i+=8,a-=8){o^=n.getUint32(i,!0);const s=n.getUint32(i+4,!0);o=CRC32_TABLE[0*256+(s>>>24&255)]^CRC32_TABLE[1*256+(s>>>16&255)]^CRC32_TABLE[2*256+(s>>>8&255)]^CRC32_TABLE[3*256+(s>>>0&255)]^CRC32_TABLE[4*256+(o>>>24&255)]^CRC32_TABLE[5*256+(o>>>16&255)]^CRC32_TABLE[6*256+(o>>>8&255)]^CRC32_TABLE[7*256+(o>>>0&255)]}for(let s=i;s<r;s++)o=CRC32_TABLE[(o^n.getUint8(s))&255]^o>>>8;return o}function crc32Final(e){return(e^-1)>>>0}function crc32(e){return crc32Final(crc32Update(crc32Init(),e))}const CborContentException=Error,CborInvalidOperationException=Error,UNEXPECTED_END_OF_BUFFER_MSG="Unexpected end of buffer",Im=class Im{constructor(t){this.initialByte=t}CborInitialByte(t,r){this.initialByte=t<<5|r}static from(t){return new Im(t)}getInitialByte(){return this.initialByte}getMajorType(){return this.initialByte>>5}getAdditionalInfo(){return this.initialByte&Im.AdditionalInformationMask}};Im.IndefiniteLengthBreakByte=255,Im.AdditionalInformationMask=31;let CborInitialByte=Im;class MiniCborReader{#t;#n=0;#g=new Array;#f=!1;#i;#b=0;constructor(t){this.#t=new Uint8Array(bufferExports.Buffer.from(t,"hex")),this.#i={currentKeyOffset:null,frameOffset:0,itemsRead:0,type:null}}readStartArray(){const t=this.#c(4);if(t.getAdditionalInfo()===31)return this.#d(1),this.#l(4),null;const r=this.#h(),{length:n,bytesRead:o}=MiniCborReader.#m(t,r);return this.#d(o),this.#l(4,n),n}readTag(){const{tag:t,bytesRead:r}=this.#y();return this.#d(r),this.#f=!0,t}readByteString(){const t=this.#c(2);if(t.getAdditionalInfo()===31){const{val:i,encodingLength:u}=this.#a(2);return this.#d(u),this.#r(),i}const r=this.#h(),{length:n,bytesRead:o}=MiniCborReader.#m(t,r);return this.#p(o+n),this.#d(o+n),this.#r(),r.slice(o,o+n)}readInt(){const t=this.#o();return this.#d(t.bytesRead),this.#r(),t.signedInt}#o(){const t=this.#c();switch(t.getMajorType()){case 0:{const{unsignedInt:r,bytesRead:n}=MiniCborReader.#u(t,this.#h());return{bytesRead:n,signedInt:BigInt(r)}}case 1:{const{unsignedInt:r,bytesRead:n}=MiniCborReader.#u(t,this.#h());return{bytesRead:n,signedInt:BigInt(-1)-r}}default:throw new CborInvalidOperationException(`Reader type mismatch, expected 0 or 1 but got ${t.getMajorType()}`)}}#p(t){if(this.#t.length-this.#n<t)throw new CborContentException(UNEXPECTED_END_OF_BUFFER_MSG)}#a(t){const r=this.#h();let n=bufferExports.Buffer.from([]),o=0,i=1,u=MiniCborReader.#e(r.slice(i),t);for(;u.getInitialByte()!==CborInitialByte.IndefiniteLengthBreakByte;){const{length:a,bytesRead:s}=MiniCborReader.#m(u,r.slice(i)),f=s+Number(a);n=bufferExports.Buffer.concat([n,r.slice(i+(f-a),i+f)]),i+=f,u=MiniCborReader.#e(r.slice(i),t)}return o=i+1,{encodingLength:o,val:new Uint8Array(n)}}#r(){++this.#i.itemsRead,this.#f=!1}static#e(t,r){MiniCborReader.ensureReadCapacityInArray(t,1);const n=CborInitialByte.from(t[0]);if(n.getInitialByte()!==CborInitialByte.IndefiniteLengthBreakByte&&n.getMajorType()!==r)throw new CborContentException("Indefinite length string contains invalid data item");return n}#y(){const t=this.#c(6),{unsignedInt:r,bytesRead:n}=MiniCborReader.#u(t,this.#h());return{bytesRead:n,tag:Number(r)}}static#m(t,r){const{unsignedInt:n,bytesRead:o}=MiniCborReader.#u(t,r);return{bytesRead:o,length:Number(n)}}#c(t){if(this.#i.definiteLength!==void 0&&this.#i.definiteLength-this.#i.itemsRead===0)throw new CborInvalidOperationException("No more data items to read");if(this.#n===this.#t.length)throw this.#i.type===null&&this.#i.definiteLength===void 0&&this.#n>0?new CborInvalidOperationException("End of root-level. No more data items to read"):new CborContentException(UNEXPECTED_END_OF_BUFFER_MSG);const r=CborInitialByte.from(this.#t[this.#n]);switch(this.#i.type){case 2:case 3:if(r.getInitialByte()===CborInitialByte.IndefiniteLengthBreakByte||r.getMajorType()===this.#i.type&&r.getAdditionalInfo()!==31)break;throw new CborContentException(`Indefinite length string contains invalid data item, ${r.getMajorType()}`)}if(t&&t!==r.getMajorType())throw new CborInvalidOperationException(`Major type mismatch, expected type ${t} but got ${r.getMajorType()}`);return r}static#u(t,r){if((t.getInitialByte()&CborInitialByte.AdditionalInformationMask)<24)return{bytesRead:1,unsignedInt:BigInt(t.getAdditionalInfo())};switch(t.getAdditionalInfo()){case 24:return MiniCborReader.ensureReadCapacityInArray(r,2),{bytesRead:2,unsignedInt:BigInt(r[1])};case 25:{MiniCborReader.ensureReadCapacityInArray(r,3);const o=bufferExports.Buffer.from(r.slice(1)).readUInt16BE();return{bytesRead:3,unsignedInt:BigInt(o)}}case 26:{MiniCborReader.ensureReadCapacityInArray(r,5);const o=bufferExports.Buffer.from(r.slice(1)).readUInt32BE();return{bytesRead:5,unsignedInt:BigInt(o)}}case 27:{MiniCborReader.ensureReadCapacityInArray(r,9);const n=bufferExports.Buffer.from(r.slice(1,9));let o=BigInt(0);for(const i of n)o=(o<<BigInt(8))+BigInt(i);return{bytesRead:9,unsignedInt:o}}default:throw new CborContentException("Invalid integer encoding")}}static ensureReadCapacityInArray(t,r){if(t.length<r)throw new CborContentException(UNEXPECTED_END_OF_BUFFER_MSG)}#d(t){if(this.#n+t>this.#t.length)throw new CborContentException("Buffer offset out of bounds");this.#n+=t,this.#b=0}#l(t,r){const n={currentKeyOffset:this.#i.currentKeyOffset,definiteLength:this.#i.definiteLength,frameOffset:this.#i.frameOffset,itemsRead:this.#i.itemsRead,type:this.#i.type};this.#g.push(n),this.#i.type=t,this.#i.definiteLength=r,this.#i.itemsRead=0,this.#i.frameOffset=this.#n,this.#f=!1,this.#i.currentKeyOffset=null}#h(){return this.#t.slice(this.#n)}}const CHECKSUM_ADDRESS_ERROR_MSG$1=CHECKSUM_ERROR_MSG("address");function verifyCardanoByronAddress(e){return verifyCardanoByronAddressBytes(bs58.decode(e))}function verifyCardanoByronAddressBytes(e){const t=new MiniCborReader(bufferExports.Buffer.from(e).toString("hex"));t.readStartArray(),t.readTag();const r=t.readByteString();if(Number(t.readInt())!==crc32(r))throw new Error(CHECKSUM_ADDRESS_ERROR_MSG$1);return!0}function verifyCardanoShelleyAddress(e){const t=distExports$1.bech32.decode(e,Number.MAX_SAFE_INTEGER/2),r=distExports$1.bech32.fromWords(t.words);if(!["addr","addr_test","stake","stake_test"].includes(t.prefix))return!1;switch(r[0]>>4){case 0:case 1:case 2:case 3:return r.length===57;case 4:case 5:{if(r.length<=29)return!1;let o=29;const i=bufferExports.Buffer.from(r),{bytesRead:u}=variableLengthDecode(i.subarray(o));o+=u;const{bytesRead:a}=variableLengthDecode(i.subarray(o));return o+=a,variableLengthDecode(i.subarray(o)),!0}case 6:case 7:return r.length===47;case 14:case 15:return r.length===47;case 8:return verifyCardanoByronAddressBytes(new Uint8Array(r));default:throw new Error(MALFORMED_ERROR_MSG("address"))}}const variableLengthDecode=e=>{let t=!0,r=0n,n=0;for(;t&&n<e.length;){const o=e[n];r<<=7n,r|=BigInt(o&127),t=(o&128)!==0,++n}return{bytesRead:n,value:r}};var AddressType$1=(e=>(e[e.NONE=-1]="NONE",e[e.EVM=0]="EVM",e[e.CARDANO=1]="CARDANO",e[e.SUBSTRATE=2]="SUBSTRATE",e[e.ALGORAND=3]="ALGORAND",e[e.MINA=4]="MINA",e[e.MIDNIGHT=5]="MIDNIGHT",e[e.AVAIL=6]="AVAIL",e[e.POLKADOT=7]="POLKADOT",e))(AddressType$1||{});function tryDecode(e,t,r=()=>!0){try{return r(t(e))}catch{return!1}}Set$1("algorand-address",e=>tryDecode(e,verifyAlgorandAddress));Set$1("algorand-blockhash",e=>tryDecode(e,verifyAlgorandBlockHash));Set$1("algorand-txid",e=>tryDecode(e,verifyAlgorandTransactionHash));Set$1("mina-address",e=>tryDecode(e,verifyMinaAddress));Set$1("mina-blockhash",e=>tryDecode(e,verifyMinaBlockHash));Set$1("mina-txid",e=>tryDecode(e,verifyMinaTransactionHash));Set$1("cardano-address",e=>tryDecode(e,verifyCardanoByronAddress)||tryDecode(e,verifyCardanoShelleyAddress));Set$1("ss58",e=>tryDecode(e,libExports.decode));Set$1("bs58check",e=>tryDecode(e,bs58check.decode));Set$1("bech32",e=>tryDecode(e,t=>distExports$1.bech32.decode(t,Number.MAX_SAFE_INTEGER/2)));function forceLowercase(e){return Type.Transform(e).Decode(t=>t.toLowerCase()).Encode(t=>t.toLowerCase())}function forceUppercase(e){return Type.Transform(e).Decode(t=>t.toUpperCase()).Encode(t=>t.toUpperCase())}const TypeboxHelpers={Uint256:Type.Transform(Type.BigInt({maximum:115792089237316195423570985008687907853269984665640564039457584007913129639935n,minimum:0n})).Decode(e=>e.toString()).Encode(e=>BigInt(e)),Algorand:{BlockHash:Type.Unsafe(Type.String({format:"algorand-blockhash"})),TxHash:Type.Unsafe(forceUppercase(Type.String({format:"algorand-txid"}))),Address:Type.Unsafe(forceUppercase(Type.String({format:"algorand-address"})))},Substrate:{Address:Type.Unsafe(Type.String({format:"ss58"}))},Avail:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(Type.String({format:"ss58"}))},Cardano:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),TxHash:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(Type.String({format:"cardano-address"})),Credential:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),PoolId:Type.Unsafe(forceLowercase(Type.String())),PolicyId:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{56}$/))),AssetName:Type.Unsafe(forceLowercase(Type.RegExp(/^[a-fA-F0-9]{64}$/))),Cip14Fingerprint:Type.Unsafe(Type.String()),AmountLovelace:Type.Unsafe(Type.RegExp(/^\d+$/))},Evm:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),TxHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{40}$/))),Selector:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{8}$/))),FullSelector:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Signature:Type.Unsafe(Type.RegExp(/^0x[a-fA-F0-9]{130}$/)),PrivateKey:Type.Unsafe(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))},Midnight:{BlockHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),TxHash:Type.Unsafe(forceLowercase(Type.RegExp(/^0x[a-fA-F0-9]{64}$/))),Address:Type.Unsafe(forceLowercase(Type.RegExp(/^mn_(shield-addr|addr|dust-addr|shield-esk|shield-cpk)_(test|dev|undeployed)[a-zA-Z0-9]+$/))),Signature:Type.Unsafe(Type.RegExp(/^.*$/))},Mina:{BlockHash:Type.Unsafe(Type.String({format:"mina-blockhash"})),TxHash:Type.Unsafe(Type.String({format:"mina-txid"})),Address:Type.Unsafe(Type.String({format:"mina-address"}))},Polkadot:{BlockHash:Type.Unsafe(Type.String({format:"polkadot-blockhash"})),TxHash:Type.Unsafe(Type.String({format:"polkadot-txid"})),Address:Type.Unsafe(Type.String({format:"ss58"}))},Caip2:Type.Unsafe(Type.String()),TimestampMsStr:Type.Unsafe(Type.RegExp(/^\d+$/)),UnknownFormat:Type.Unsafe(Type.String()),Lowercase:forceLowercase(Type.String()),TrueOrFalse:Type.Transform(Type.Union([Type.Literal("T"),Type.Literal("F")])).Decode(e=>e==="T").Encode(e=>e?"T":"F"),EvmAbiEvent:Type.Unsafe(Type.Any())},AddressValidator={[-1]:Type.Literal("0x0"),0:TypeboxHelpers.Evm.Address,1:TypeboxHelpers.Cardano.Address,2:TypeboxHelpers.Substrate.Address,6:TypeboxHelpers.Avail.Address,3:TypeboxHelpers.Algorand.Address,4:TypeboxHelpers.Mina.Address,5:TypeboxHelpers.Midnight.Address,7:TypeboxHelpers.Polkadot.Address};Type.Object({type:Type.Literal(-1),address:Type.Literal("0x0")}),Type.Object({type:Type.Literal(0),address:TypeboxHelpers.Evm.Address}),Type.Object({type:Type.Literal(1),address:TypeboxHelpers.Cardano.Address}),Type.Object({type:Type.Literal(2),address:TypeboxHelpers.Substrate.Address}),Type.Object({type:Type.Literal(6),address:TypeboxHelpers.Avail.Address}),Type.Object({type:Type.Literal(3),address:TypeboxHelpers.Algorand.Address}),Type.Object({type:Type.Literal(4),address:TypeboxHelpers.Mina.Address}),Type.Object({type:Type.Literal(5),address:TypeboxHelpers.Midnight.Address}),Type.Object({type:Type.Literal(7),address:TypeboxHelpers.Polkadot.Address});function number(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function bool(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function isBytes$1(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function bytes$1(e,...t){if(!isBytes$1(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function hash$2(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(e.outputLen),number(e.blockLen)}function exists(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 output(e,t){bytes$1(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const assert={number,bool,bytes:bytes$1,hash:hash$2,exists,output},U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(e,t=!1){return t?{h:Number(e&U32_MASK64),l:Number(e>>_32n&U32_MASK64)}:{h:Number(e>>_32n&U32_MASK64)|0,l:Number(e&U32_MASK64)|0}}function split(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:u}=fromBig(e[o],t);[r[o],n[o]]=[i,u]}return[r,n]}const rotlSH=(e,t,r)=>e<<r|t>>>32-r,rotlSL=(e,t,r)=>t<<r|e>>>32-r,rotlBH=(e,t,r)=>t<<r-32|e>>>64-r,rotlBL=(e,t,r)=>e<<r-32|t>>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function byteSwap32(e){for(let t=0;t<e.length;t++)e[t]=byteSwap(e[t])}function utf8ToBytes(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function toBytes(e){return typeof e=="string"&&(e=utf8ToBytes(e)),bytes$1(e),e}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(e){const t=n=>e().update(toBytes(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$1=BigInt(0),_1n$2=BigInt(1),_2n$2=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let e=0,t=_1n$2,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],SHA3_PI.push(2*(5*n+r)),SHA3_ROTL.push((e+1)*(e+2)/2%64);let o=_0n$1;for(let i=0;i<7;i++)t=(t<<_1n$2^(t>>_7n)*_0x71n)%_256n,t&_2n$2&&(o^=_1n$2<<(_1n$2<<BigInt(i))-_1n$2);_SHA3_IOTA.push(o)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split(_SHA3_IOTA,!0),rotlH=(e,t,r)=>r>32?rotlBH(e,t,r):rotlSH(e,t,r),rotlL=(e,t,r)=>r>32?rotlBL(e,t,r):rotlSL(e,t,r);function keccakP(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let u=0;u<10;u++)r[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){const a=(u+8)%10,s=(u+2)%10,f=r[s],c=r[s+1],d=rotlH(f,c,1)^r[a],p=rotlL(f,c,1)^r[a+1];for(let h=0;h<50;h+=10)e[u+h]^=d,e[u+h+1]^=p}let o=e[2],i=e[3];for(let u=0;u<24;u++){const a=SHA3_ROTL[u],s=rotlH(o,i,a),f=rotlL(o,i,a),c=SHA3_PI[u];o=e[c],i=e[c+1],e[c]=s,e[c+1]=f}for(let u=0;u<50;u+=10){for(let a=0;a<10;a++)r[a]=e[u+a];for(let a=0;a<10;a++)e[u+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=SHA3_IOTA_H[n],e[1]^=SHA3_IOTA_L[n]}r.fill(0)}class Keccak extends Hash{constructor(t,r,n,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(t){exists(this);const{blockLen:r,state:n}=this;t=toBytes(t);const o=t.length;for(let i=0;i<o;){const u=Math.min(r-this.pos,o-i);for(let a=0;a<u;a++)n[this.pos++]^=t[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){exists(this,!1),bytes$1(t),this.finish();const r=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const u=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+u),o),this.posOut+=u,o+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:u}=this;return t||(t=new Keccak(r,n,o,u,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=u,t.destroyed=this.destroyed,t}}const gen=(e,t,r)=>wrapConstructor(()=>new Keccak(t,e,r)),keccak_256$2=gen(1,136,256/8);function wrapHash(e){return t=>(assert.bytes(t),e(t))}(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();const keccak256$1=(()=>{const e=wrapHash(keccak_256$2);return e.create=keccak_256$2.create,e})(),ERR_MULTIPLE_ERRORS=208,JSONRPC_ERR_REJECTED_REQUEST=4001,JSONRPC_ERR_UNAUTHORIZED=4100,JSONRPC_ERR_UNSUPPORTED_METHOD=4200,JSONRPC_ERR_DISCONNECTED=4900,JSONRPC_ERR_CHAIN_DISCONNECTED=4901,ERR_INVALID_BYTES=1002,ERR_VALIDATION=1100,ERR_SCHEMA_FORMAT=1200,ERR_RPC_INVALID_JSON=-32700,ERR_RPC_INVALID_REQUEST=-32600,ERR_RPC_INVALID_METHOD=-32601,ERR_RPC_INVALID_PARAMS=-32602,ERR_RPC_INTERNAL_ERROR=-32603,ERR_RPC_INVALID_INPUT=-32e3,ERR_RPC_MISSING_RESOURCE=-32001,ERR_RPC_UNAVAILABLE_RESOURCE=-32002,ERR_RPC_TRANSACTION_REJECTED=-32003,ERR_RPC_UNSUPPORTED_METHOD=-32004,ERR_RPC_LIMIT_EXCEEDED=-32005,ERR_RPC_NOT_SUPPORTED=-32006;class BaseWeb3Error extends Error{get innerError(){return this.cause instanceof MultipleErrors?this.cause.errors:this.cause}set innerError(t){Array.isArray(t)?this.cause=new MultipleErrors(t):this.cause=t}constructor(t,r){super(t),Array.isArray(r)?this.cause=new MultipleErrors(r):this.cause=r,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,r=!1){if(t==null)return"undefined";const n=JSON.stringify(t,(o,i)=>typeof i=="bigint"?i.toString():i);return r&&["bigint","string"].includes(typeof t)?n.replace(/['\\"]+/g,""):n}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class MultipleErrors extends BaseWeb3Error{constructor(t){super(`Multiple errors occurred: [${t.map(r=>r.message).join("], [")}]`),this.code=ERR_MULTIPLE_ERRORS,this.errors=t}}class InvalidValueError extends BaseWeb3Error{constructor(t,r){super(`Invalid value given "${BaseWeb3Error.convertToString(t,!0)}". Error: ${r}.`),this.name=this.constructor.name}}class InvalidBytesError extends InvalidValueError{constructor(t){super(t,"can not parse as byte data"),this.code=ERR_INVALID_BYTES}}const genericRpcErrorMessageTemplate="An Rpc error has occured with a code of *code*",RpcErrorMessages={[ERR_RPC_INVALID_JSON]:{message:"Parse error",description:"Invalid JSON"},[ERR_RPC_INVALID_REQUEST]:{message:"Invalid request",description:"JSON is not a valid request object "},[ERR_RPC_INVALID_METHOD]:{message:"Method not found",description:"Method does not exist "},[ERR_RPC_INVALID_PARAMS]:{message:"Invalid params",description:"Invalid method parameters"},[ERR_RPC_INTERNAL_ERROR]:{message:"Internal error",description:"Internal JSON-RPC error"},[ERR_RPC_INVALID_INPUT]:{message:"Invalid input",description:"Missing or invalid parameters"},[ERR_RPC_MISSING_RESOURCE]:{message:"Resource not found",description:"Requested resource not found"},[ERR_RPC_UNAVAILABLE_RESOURCE]:{message:"Resource unavailable",description:"Requested resource not available"},[ERR_RPC_TRANSACTION_REJECTED]:{message:"Transaction rejected",description:"Transaction creation failed"},[ERR_RPC_UNSUPPORTED_METHOD]:{message:"Method not supported",description:"Method is not implemented"},[ERR_RPC_LIMIT_EXCEEDED]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[ERR_RPC_NOT_SUPPORTED]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[JSONRPC_ERR_REJECTED_REQUEST]:{name:"User Rejected Request",message:"The user rejected the request."},[JSONRPC_ERR_UNAUTHORIZED]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[JSONRPC_ERR_UNSUPPORTED_METHOD]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[JSONRPC_ERR_DISCONNECTED]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[JSONRPC_ERR_CHAIN_DISCONNECTED]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class RpcError extends BaseWeb3Error{constructor(t,r){super(r??genericRpcErrorMessageTemplate.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class ParseError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_JSON].message),this.code=ERR_RPC_INVALID_JSON}}class InvalidRequestError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_REQUEST].message),this.code=ERR_RPC_INVALID_REQUEST}}class MethodNotFoundError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_METHOD].message),this.code=ERR_RPC_INVALID_METHOD}}class InvalidParamsError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_PARAMS].message),this.code=ERR_RPC_INVALID_PARAMS}}class InternalError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INTERNAL_ERROR].message),this.code=ERR_RPC_INTERNAL_ERROR}}class InvalidInputError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_INVALID_INPUT].message),this.code=ERR_RPC_INVALID_INPUT}}class MethodNotSupported extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_UNSUPPORTED_METHOD].message),this.code=ERR_RPC_UNSUPPORTED_METHOD}}class ResourceUnavailableError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_UNAVAILABLE_RESOURCE].message),this.code=ERR_RPC_UNAVAILABLE_RESOURCE}}class ResourcesNotFoundError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_MISSING_RESOURCE].message),this.code=ERR_RPC_MISSING_RESOURCE}}class VersionNotSupportedError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_NOT_SUPPORTED].message),this.code=ERR_RPC_NOT_SUPPORTED}}class TransactionRejectedError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_TRANSACTION_REJECTED].message),this.code=ERR_RPC_TRANSACTION_REJECTED}}class LimitExceededError extends RpcError{constructor(t){super(t,RpcErrorMessages[ERR_RPC_LIMIT_EXCEEDED].message),this.code=ERR_RPC_LIMIT_EXCEEDED}}const rpcErrorsMap=new Map;rpcErrorsMap.set(ERR_RPC_INVALID_JSON,{error:ParseError});rpcErrorsMap.set(ERR_RPC_INVALID_REQUEST,{error:InvalidRequestError});rpcErrorsMap.set(ERR_RPC_INVALID_METHOD,{error:MethodNotFoundError});rpcErrorsMap.set(ERR_RPC_INVALID_PARAMS,{error:InvalidParamsError});rpcErrorsMap.set(ERR_RPC_INTERNAL_ERROR,{error:InternalError});rpcErrorsMap.set(ERR_RPC_INVALID_INPUT,{error:InvalidInputError});rpcErrorsMap.set(ERR_RPC_UNSUPPORTED_METHOD,{error:MethodNotSupported});rpcErrorsMap.set(ERR_RPC_UNAVAILABLE_RESOURCE,{error:ResourceUnavailableError});rpcErrorsMap.set(ERR_RPC_TRANSACTION_REJECTED,{error:TransactionRejectedError});rpcErrorsMap.set(ERR_RPC_MISSING_RESOURCE,{error:ResourcesNotFoundError});rpcErrorsMap.set(ERR_RPC_NOT_SUPPORTED,{error:VersionNotSupportedError});rpcErrorsMap.set(ERR_RPC_LIMIT_EXCEEDED,{error:LimitExceededError});class SchemaFormatError extends BaseWeb3Error{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=ERR_SCHEMA_FORMAT}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}var util$1;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{const i={};for(const u of o)i[u]=u;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),u={};for(const a of i)u[a]=o[a];return e.objectValues(u)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&i.push(u);return i},e.find=(o,i)=>{for(const u of o)if(i(u))return u},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(u=>typeof u=="string"?`'${u}'`:u).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(util$1||(util$1={}));var objectUtil;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(objectUtil||(objectUtil={}));const ZodParsedType=util$1.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:e===null?ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?ZodParsedType.map:typeof Set<"u"&&e instanceof Set?ZodParsedType.set:typeof Date<"u"&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$1.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(const u of i.issues)if(u.code==="invalid_union")u.unionErrors.map(o);else if(u.code==="invalid_return_type")o(u.returnTypeError);else if(u.code==="invalid_arguments")o(u.argumentsError);else if(u.path.length===0)n._errors.push(r(u));else{let a=n,s=0;for(;s<u.path.length;){const f=u.path[s];s===u.path.length-1?(a[f]=a[f]||{_errors:[]},a[f]._errors.push(r(u))):a[f]=a[f]||{_errors:[]},a=a[f],s++}}};return o(this),n}static assert(t){if(!(t instanceof ZodError))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$1.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const o of this.issues)if(o.path.length>0){const i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:e.received===ZodParsedType.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util$1.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util$1.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util$1.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util$1.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util$1.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ZodIssueCode.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ZodIssueCode.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util$1.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],u={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="";const s=n.filter(f=>!!f).slice().reverse();for(const f of s)a=f(u,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=getErrorMap(),n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter(o=>!!o)});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const o of r){if(o.status==="aborted")return INVALID;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const o of r){const i=await o.key,u=await o.value;n.push({key:i,value:u})}return ParseStatus.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const o of r){const{key:i,value:u}=o;if(i.status==="aborted"||u.status==="aborted")return INVALID;i.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof u.value<"u"||o.alwaysSet)&&(n[i.value]=u.value)}return{status:t.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>e.status==="aborted",isDirty=e=>e.status==="dirty",isValid=e=>e.status==="valid",isAsync=e=>typeof Promise<"u"&&e instanceof Promise;var errorUtil;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ZodError(e.common.issues);return this._error=r,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(u,a)=>{const{message:s}=e;return u.code==="invalid_enum_value"?{message:s??a.defaultError}:typeof a.data>"u"?{message:s??n??a.defaultError}:u.code!=="invalid_type"?{message:a.defaultError}:{message:s??r??a.defaultError}},description:o}}class ZodType{get description(){return this._def.description}_getType(t){return getParsedType(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(isAsync(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},o=this._parseSync({data:t,path:n.path,parent:n});return handleResult(n,o)}"~validate"(t){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)};if(!this["~standard"].async)try{const n=this._parseSync({data:t,path:[],parent:r});return isValid(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>isValid(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(isAsync(o)?o:Promise.resolve(o));return handleResult(n,i)}refine(t,r){const n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{const u=t(o),a=()=>i.addIssue({code:ZodIssueCode.custom,...n(o)});return typeof Promise<"u"&&u instanceof Promise?u.then(s=>s?!0:(a(),!1)):u?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(t){return ZodUnion.create([this,t],this._def)}and(t){return ZodIntersection.create(this,t,this._def)}transform(t){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:r,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:r,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ZodPipeline.create(this,t)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!!((t==="v4"||!t)&&ipv4Regex.test(e)||(t==="v6"||!t)&&ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function isValidCidr(e,t){return!!((t==="v4"||!t)&&ipv4CidrRegex.test(e)||(t==="v6"||!t)&&ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ZodParsedType.string){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:i.parsedType}),INVALID}const n=new ParseStatus;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const u=t.data.length>i.value,a=t.data.length<i.value;(u||a)&&(o=this._getOrReturnCtx(t,o),u?addIssueToContext(o,{code:ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&addIssueToContext(o,{code:ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")emailRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"email",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"emoji",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")uuidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"uuid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")nanoidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")cuidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"cuid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")cuid2Regex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ulidRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"ulid",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"url",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"regex",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?datetimeRegex(i).test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?dateRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?timeRegex(i).test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?durationRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"duration",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?isValidIP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"ip",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?isValidJWT(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"jwt",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?isValidCidr(t.data,i.version)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"cidr",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?base64Regex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"base64",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?base64urlRegex.test(t.data)||(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{validation:"base64url",code:ZodIssueCode.invalid_string,message:i.message}),n.dirty()):util$1.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(t){return new ZodString({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...errorUtil.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...errorUtil.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...errorUtil.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...errorUtil.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...errorUtil.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...errorUtil.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...errorUtil.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...errorUtil.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...errorUtil.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...errorUtil.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...errorUtil.errToObj(r)})}nonempty(t){return this.min(1,errorUtil.errToObj(t))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}ZodString.create=e=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:e?.coerce??!1,...processCreateParams(e)});function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),u=Number.parseInt(t.toFixed(o).replace(".",""));return i%u/10**o}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ZodParsedType.number){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:i.parsedType}),INVALID}let n;const o=new ParseStatus;for(const i of this._def.checks)i.kind==="int"?util$1.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?floatSafeRemainder(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_finite,message:i.message}),o.dirty()):util$1.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,o){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(t){return new ZodNumber({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&util$1.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:e?.coerce||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ZodParsedType.bigint)return this._getInvalidInput(t);let n;const o=new ParseStatus;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):util$1.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:r.parsedType}),INVALID}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,o){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(o)}]})}_addCheck(t){return new ZodBigInt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:e?.coerce??!1,...processCreateParams(e)});class ZodBoolean extends ZodType{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ZodParsedType.boolean){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:n.parsedType}),INVALID}return OK(t.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:e?.coerce||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ZodParsedType.date){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:i.parsedType}),INVALID}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return addIssueToContext(i,{code:ZodIssueCode.invalid_date}),INVALID}const n=new ParseStatus;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),addIssueToContext(o,{code:ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):util$1.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ZodDate({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:errorUtil.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:errorUtil.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.symbol){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:n.parsedType}),INVALID}return OK(t.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:n.parsedType}),INVALID}return OK(t.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.null){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:n.parsedType}),INVALID}return OK(t.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(t){return OK(t.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(t){return OK(t.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:r.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:n.parsedType}),INVALID}return OK(t.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(o.exactLength!==null){const u=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(u||a)&&(addIssueToContext(r,{code:u?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:a?o.exactLength.value:void 0,maximum:u?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((u,a)=>o.type._parseAsync(new ParseInputLazyPath(r,u,r.path,a)))).then(u=>ParseStatus.mergeArray(n,u));const i=[...r.data].map((u,a)=>o.type._parseSync(new ParseInputLazyPath(r,u,r.path,a)));return ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new ZodArray({...this._def,minLength:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodArray({...this._def,maxLength:{value:t,message:errorUtil.toString(r)}})}length(t,r){return new ZodArray({...this._def,exactLength:{value:t,message:errorUtil.toString(r)}})}nonempty(t){return this.min(1,t)}}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}else return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(t=>deepPartialify(t))):e}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=util$1.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ZodParsedType.object){const f=this._getOrReturnCtx(t);return addIssueToContext(f,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:f.parsedType}),INVALID}const{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:u}=this._getCached(),a=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const f in o.data)u.includes(f)||a.push(f);const s=[];for(const f of u){const c=i[f],d=o.data[f];s.push({key:{status:"valid",value:f},value:c._parse(new ParseInputLazyPath(o,d,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof ZodNever){const f=this._def.unknownKeys;if(f==="passthrough")for(const c of a)s.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(f==="strict")a.length>0&&(addIssueToContext(o,{code:ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const c of a){const d=o.data[c];s.push({key:{status:"valid",value:c},value:f._parse(new ParseInputLazyPath(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const c of s){const d=await c.key,p=await c.value;f.push({key:d,value:p,alwaysSet:c.alwaysSet})}return f}).then(f=>ParseStatus.mergeObjectSync(n,f)):ParseStatus.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{const o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:errorUtil.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(t){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ZodObject({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ZodObject({...this._def,catchall:t})}pick(t){const r={};for(const n of util$1.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ZodObject({...this._def,shape:()=>r})}omit(t){const r={};for(const n of util$1.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new ZodObject({...this._def,shape:()=>r})}deepPartial(){return deepPartialify(this)}partial(t){const r={};for(const n of util$1.objectKeys(this.shape)){const o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new ZodObject({...this._def,shape:()=>r})}required(t){const r={};for(const n of util$1.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ZodOptional;)i=i._def.innerType;r[n]=i}return new ZodObject({...this._def,shape:()=>r})}keyof(){return createZodEnum(util$1.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const u=i.map(a=>new ZodError(a.ctx.common.issues));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:u}),INVALID}if(r.common.async)return Promise.all(n.map(async i=>{const u={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:u}),ctx:u}})).then(o);{let i;const u=[];for(const s of n){const f={...r,common:{...r.common,issues:[]},parent:null},c=s._parseSync({data:r.data,path:r.path,parent:f});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:f}),f.common.issues.length&&u.push(f.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=u.map(s=>new ZodError(s));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:a}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util$1.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(addIssueToContext(r,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const o=new Map;for(const i of r){const u=getDiscriminator(i.shape[t]);if(!u.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of u){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...processCreateParams(n)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const o=util$1.objectKeys(t),i=util$1.objectKeys(e).filter(a=>o.indexOf(a)!==-1),u={...e,...t};for(const a of i){const s=mergeValues(e[a],t[a]);if(!s.valid)return{valid:!1};u[a]=s.data}return{valid:!0,data:u}}else if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i<e.length;i++){const u=e[i],a=t[i],s=mergeValues(u,a);if(!s.valid)return{valid:!1};o.push(s.data)}return{valid:!0,data:o}}else return r===ZodParsedType.date&&n===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),o=(i,u)=>{if(isAborted(i)||isAborted(u))return INVALID;const a=mergeValues(i.value,u.value);return a.valid?((isDirty(i)||isDirty(u))&&r.dirty(),{status:r.value,value:a.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,u])=>o(i,u)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.length<this._def.items.length)return addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&n.data.length>this._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((u,a)=>{const s=this._def.items[a]||this._def.rest;return s?s._parse(new ParseInputLazyPath(n,u,n.path,a)):null}).filter(u=>!!u);return n.common.async?Promise.all(i).then(u=>ParseStatus.mergeArray(r,u)):ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new ZodTuple({...this._def,rest:t})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const o=[],i=this._def.keyType,u=this._def.valueType;for(const a in n.data)o.push({key:i._parse(new ParseInputLazyPath(n,a,n.path,a)),value:u._parse(new ParseInputLazyPath(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ParseStatus.mergeObjectAsync(r,o):ParseStatus.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ZodType?new ZodRecord({keyType:t,valueType:r,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}):new ZodRecord({keyType:ZodString.create(),valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const o=this._def.keyType,i=this._def.valueType,u=[...n.data.entries()].map(([a,s],f)=>({key:o._parse(new ParseInputLazyPath(n,a,n.path,[f,"key"])),value:i._parse(new ParseInputLazyPath(n,s,n.path,[f,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const s of u){const f=await s.key,c=await s.value;if(f.status==="aborted"||c.status==="aborted")return INVALID;(f.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(f.value,c.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const s of u){const f=s.key,c=s.value;if(f.status==="aborted"||c.status==="aborted")return INVALID;(f.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(f.value,c.value)}return{status:r.value,value:a}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());const i=this._def.valueType;function u(s){const f=new Set;for(const c of s){if(c.status==="aborted")return INVALID;c.status==="dirty"&&r.dirty(),f.add(c.value)}return{status:r.value,value:f}}const a=[...n.data.values()].map((s,f)=>i._parse(new ParseInputLazyPath(n,s,n.path,f)));return n.common.async?Promise.all(a).then(s=>u(s)):u(a)}min(t,r){return new ZodSet({...this._def,minSize:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodSet({...this._def,maxSize:{value:t,message:errorUtil.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.function)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:r.parsedType}),INVALID;function n(a,s){return makeIssue({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(f=>!!f),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:s}})}function o(a,s){return makeIssue({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(f=>!!f),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:s}})}const i={errorMap:r.common.contextualErrorMap},u=r.data;if(this._def.returns instanceof ZodPromise){const a=this;return OK(async function(...s){const f=new ZodError([]),c=await a._def.args.parseAsync(s,i).catch(h=>{throw f.addIssue(n(s,h)),f}),d=await Reflect.apply(u,this,c);return await a._def.returns._def.type.parseAsync(d,i).catch(h=>{throw f.addIssue(o(d,h)),f})})}else{const a=this;return OK(function(...s){const f=a._def.args.safeParse(s,i);if(!f.success)throw new ZodError([n(s,f.error)]);const c=Reflect.apply(u,this,f.data),d=a._def.returns.safeParse(c,i);if(!d.success)throw new ZodError([o(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ZodFunction({...this._def,args:ZodTuple.create(t).rest(ZodUnknown.create())})}returns(t){return new ZodFunction({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ZodFunction({args:t||ZodTuple.create([]).rest(ZodUnknown.create()),returns:r||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}class ZodEnum extends ZodType{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{expected:util$1.joinValues(n),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ZodEnum.create(t,{...this._def,...r})}exclude(t,r=this._def){return ZodEnum.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(t){const r=util$1.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const o=util$1.objectValues(r);return addIssueToContext(n,{expected:util$1.joinValues(o),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(util$1.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=util$1.objectValues(r);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:o}),INVALID}return OK(t.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.promise&&r.common.async===!1)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:r.parsedType}),INVALID;const n=r.parsedType===ZodParsedType.promise?r.data:Promise.resolve(r.data);return OK(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:u=>{addIssueToContext(n,u),u.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const u=o.transform(n.data,i);if(n.common.async)return Promise.resolve(u).then(async a=>{if(r.value==="aborted")return INVALID;const s=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return s.status==="aborted"?INVALID:s.status==="dirty"||r.value==="dirty"?DIRTY(s.value):s});{if(r.value==="aborted")return INVALID;const a=this._def.schema._parseSync({data:u,path:n.path,parent:n});return a.status==="aborted"?INVALID:a.status==="dirty"||r.value==="dirty"?DIRTY(a.value):a}}if(o.type==="refinement"){const u=a=>{const s=o.refinement(a,i);if(n.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?INVALID:(a.status==="dirty"&&r.dirty(),u(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?INVALID:(a.status==="dirty"&&r.dirty(),u(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){const u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(u))return INVALID;const a=o.transform(u.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>isValid(u)?Promise.resolve(o.transform(u.value,i)).then(a=>({status:r.value,value:a})):INVALID);util$1.assertNever(o)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)});ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.null?OK(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.nan){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:n.parsedType}),INVALID}return{status:"valid",value:t.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?INVALID:i.status==="dirty"?(r.dirty(),DIRTY(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?INVALID:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new ZodPipeline({in:t,out:r,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(t){const r=this._def.innerType._parse(t),n=o=>(isValid(o)&&(o.value=Object.freeze(o.value)),o);return isAsync(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});function cleanParams(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function custom(e,t={},r){return e?ZodAny.create().superRefine((n,o)=>{const i=e(n);if(i instanceof Promise)return i.then(u=>{if(!u){const a=cleanParams(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}});if(!i){const u=cleanParams(t,n),a=u.fatal??r??!0;o.addIssue({code:"custom",...u,fatal:a})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom(r=>r instanceof e,t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:(e=>ZodString.create({...e,coerce:!0})),number:(e=>ZodNumber.create({...e,coerce:!0})),boolean:(e=>ZodBoolean.create({...e,coerce:!0})),bigint:(e=>ZodBigInt.create({...e,coerce:!0})),date:(e=>ZodDate.create({...e,coerce:!0}))},NEVER=INVALID,z$1=Object.freeze(Object.defineProperty({__proto__:null,BRAND,DIRTY,EMPTY_PATH,INVALID,NEVER,OK,ParseStatus,Schema:ZodType,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},ZodFunction,ZodIntersection,ZodIssueCode,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSchema:ZodType,ZodSet,ZodString,ZodSymbol,ZodTransformer:ZodEffects,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,addIssueToContext,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,coerce,custom,date:dateType,datetimeRegex,defaultErrorMap:errorMap,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,getErrorMap,getParsedType,instanceof:instanceOfType,intersection:intersectionType,isAborted,isAsync,isDirty,isValid,late,lazy:lazyType,literal:literalType,makeIssue,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,get objectUtil(){return objectUtil},oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,quotelessJson,record:recordType,set:setType,setErrorMap,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,get util(){return util$1},void:voidType},Symbol.toStringTag,{value:"Module"})),errorFormatter=e=>e.message?e.message:"unspecified error";class Web3ValidatorError extends BaseWeb3Error{constructor(t){super(),this.code=ERR_VALIDATION,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
132
132
  ${this._compileErrors().join(`
133
- `)}`}_compileErrors(){return this.errors.map(errorFormatter)}}const VALID_ETH_BASE_TYPES=["bool","int","uint","bytes","string","address","tuple"],isAbiParameterSchema=e=>typeof e=="object"&&"type"in e&&"name"in e,isString=e=>typeof e=="string",isHexStrict=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e),extraTypes=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],parseBaseType=e=>{let t=e.replace(/ /,""),r,n=!1,o=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),o=[...e.matchAll(/(?:\[(\d*)\])/g)].map(i=>parseInt(i[1],10)).map(i=>Number.isNaN(i)?-1:i),n=o.length>0),VALID_ETH_BASE_TYPES.includes(t))return{baseType:t,isArray:n,baseTypeSize:r,arraySizes:o};if(t.startsWith("int"))r=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))r=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))r=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:o};return{baseType:t,isArray:n,baseTypeSize:r,arraySizes:o}},convertEthType=(e,t={})=>{if(Object.keys(t).includes("type"))throw new Web3ValidatorError([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:n,baseTypeSize:o}=parseBaseType(e);if(!n&&!extraTypes.includes(e))throw new Web3ValidatorError([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(n){if(n==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${n}${o??""}`,required:!0}}return e?{format:e,required:!0}:{}},abiSchemaToJsonSchema=(e,t="/0")=>{const r={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[n,o]of e.entries()){let i,u,a=[];isAbiParameterSchema(o)?(i=o.type,u=o.name||`${t}/${n}`,a=o.components):typeof o=="string"?(i=o,u=`${t}/${n}`):Array.isArray(o)&&(o[0]&&typeof o[0]=="string"&&o[0].startsWith("tuple")&&!Array.isArray(o[0])&&o[1]&&Array.isArray(o[1])?(i=o[0],u=`${t}/${n}`,a=o[1]):(i="tuple",u=`${t}/${n}`,a=o));const{baseType:s,isArray:f,arraySizes:c}=parseBaseType(i);let d,p=r;for(let h=c.length-1;h>0;h-=1)d={type:"array",$id:u,items:[],maxItems:c[h],minItems:c[h]},c[h]<0&&(delete d.maxItems,delete d.minItems),Array.isArray(p.items)?p.items.length===0?p.items=[d]:p.items.push(d):p.items=[p.items,d],p=d;if(s==="tuple"&&!f){const h=abiSchemaToJsonSchema(a,u);h.$id=u,p.items.push(h)}else if(s==="tuple"&&f){const h=c[0],y=Object.assign({type:"array",$id:u,items:abiSchemaToJsonSchema(a,u)},h>=0&&{minItems:h,maxItems:h});p.items.push(y)}else if(f){const h=c[0],y=Object.assign({type:"array",$id:u,items:convertEthType(i)},h>=0&&{minItems:h,maxItems:h});p.items.push(y)}else Array.isArray(p.items)?p.items.push(Object.assign({$id:u},convertEthType(i))):p.items.push(Object.assign({$id:u},convertEthType(i)));p=r}return r},ethAbiToJsonSchema=e=>abiSchemaToJsonSchema(e),fetchArrayElement=(e,t)=>t===1?e:fetchArrayElement(e[0],t-1),transformJsonDataToAbiFormat=(e,t,r)=>{const n=[];for(const[o,i]of e.entries()){let u,a,s=[];isAbiParameterSchema(i)?(u=i.type,a=i.name,s=i.components):typeof i=="string"?u=i:Array.isArray(i)&&(i[1]&&Array.isArray(i[1])?(u=i[0],s=i[1]):(u="tuple",s=i));const{baseType:f,isArray:c,arraySizes:d}=parseBaseType(u),p=Array.isArray(t)?t[o]:t[a];if(f==="tuple"&&!c)n.push(transformJsonDataToAbiFormat(s,p,r));else if(f==="tuple"&&c){const h=[];for(const y of p)if(d.length>1){const b=fetchArrayElement(y,d.length-1),w=[];for(const S of b)w.push(transformJsonDataToAbiFormat(s,S,r));h.push(w)}else h.push(transformJsonDataToAbiFormat(s,y,r));n.push(h)}else n.push(p)}return r=r??[],r.push(...n),r},codePointToInt=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},hexToNumber=e=>{if(!isHexStrict(e))throw new Error("Invalid hex string");const[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],n=BigInt(r);return n>Number.MAX_SAFE_INTEGER?t?-n:n:n<Number.MIN_SAFE_INTEGER?n:t?-1*Number(n):Number(n)},numberToHex=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&isHexStrict(e)){const[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],n=r.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${n.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!isHexStrict(e))return numberToHex(BigInt(e));throw new InvalidNumberError(e)},padLeft=(e,t,r="0")=>{if(typeof e=="string"&&!isHexStrict(e))return e.padStart(t,r);const n=typeof e=="string"&&isHexStrict(e)?e:numberToHex(e),[o,i]=n.startsWith("-")?["-0x",n.slice(3)]:["0x",n.slice(2)];return`${o}${i.padStart(t,r)}`};function uint8ArrayToHexString$1(e){let t="0x";for(const r of e){const n=r.toString(16);t+=n.length===1?`0${n}`:n}return t}const charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16(e){if(e>=charCodeMap.zero&&e<=charCodeMap.nine)return e-charCodeMap.zero;if(e>=charCodeMap.A&&e<=charCodeMap.F)return e-(charCodeMap.A-10);if(e>=charCodeMap.a&&e<=charCodeMap.f)return e-(charCodeMap.a-10)}function hexToUint8Array(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new InvalidBytesError(`hex string has odd length: ${e}`);const r=(e.length-t)/2,n=new Uint8Array(r);for(let o=0,i=t;o<r;o+=1){const u=charCodeToBase16(e.charCodeAt(i++)),a=charCodeToBase16(e.charCodeAt(i++));if(u===void 0||a===void 0)throw new InvalidBytesError(`Invalid byte sequence ("${e[i-2]}${e[i-1]}" in "${e}").`);n[o]=u*16+a}return n}function ensureIfUint8Array(e){var t;return!(e instanceof Uint8Array)&&((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}const utils$4=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema,codePointToInt,ensureIfUint8Array,ethAbiToJsonSchema,fetchArrayElement,hexToNumber,hexToUint8Array,numberToHex,padLeft,parseBaseType,transformJsonDataToAbiFormat,uint8ArrayToHexString:uint8ArrayToHexString$1},Symbol.toStringTag,{value:"Module"})),isUint8Array$1=e=>{var t,r;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((r=e?.constructor)===null||r===void 0?void 0:r.name)==="Buffer"},isBytes=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!isUint8Array$1(e)||typeof e=="string"&&isHexStrict(e)&&e.startsWith("-")||typeof e=="string"&&!isHexStrict(e))return!1;let r;if(typeof e=="string"){if(e.length%2!==0)return!1;r=hexToUint8Array(e)}else if(Array.isArray(e)){if(e.some(n=>n<0||n>255||!Number.isInteger(n)))return!1;r=new Uint8Array(e)}else r=e;if(t?.abiType){const{baseTypeSize:n}=parseBaseType(t.abiType);return n?r.length===n:!0}return t?.size?r.length===t?.size:!0},checkAddressCheckSum=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),r=utf8ToBytes(t.toLowerCase()),n=uint8ArrayToHexString$1(keccak256$1(ensureIfUint8Array(r))).slice(2);for(let o=0;o<40;o+=1)if(parseInt(n[o],16)>7&&t[o].toUpperCase()!==t[o]||parseInt(n[o],16)<=7&&t[o].toLowerCase()!==t[o])return!1;return!0},isAddress=(e,t=!0)=>{if(typeof e!="string"&&!isUint8Array$1(e))return!1;let r;return isUint8Array$1(e)?r=uint8ArrayToHexString$1(e):typeof e=="string"&&!isHexStrict(e)?r=e.toLowerCase().startsWith("0x")?e:`0x${e}`:r=e,/^(0x)?[0-9a-f]{40}$/i.test(r)?/^(0x|0X)?[0-9a-f]{40}$/.test(r)||/^(0x|0X)?[0-9A-F]{40}$/.test(r)?!0:t?checkAddressCheckSum(r):!0:!1};var FMT_NUMBER;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(FMT_NUMBER||(FMT_NUMBER={}));var FMT_BYTES;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(FMT_BYTES||(FMT_BYTES={}));FMT_NUMBER.BIGINT,FMT_BYTES.HEX;FMT_NUMBER.HEX,FMT_BYTES.HEX;var BlockTags;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized",e.COMMITTED="committed"})(BlockTags||(BlockTags={}));var HardforksOrdered;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(HardforksOrdered||(HardforksOrdered={}));const bigintPower=(e,t)=>{if(t===BigInt(0))return BigInt(1);let r=e;for(let n=1;n<t;n+=1)r*=e;return r},isUInt=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let r;if(t?.abiType){const{baseTypeSize:o}=parseBaseType(t.abiType);o&&(r=o)}else t.bitSize&&(r=t.bitSize);const n=bigintPower(BigInt(2),BigInt(r??256))-BigInt(1);try{const o=typeof e=="string"&&isHexStrict(e)?BigInt(hexToNumber(e)):BigInt(e);return o>=0&&o<=n}catch{return!1}},isInt=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let r;if(t?.abiType){const{baseTypeSize:i,baseType:u}=parseBaseType(t.abiType);if(u!=="int")return!1;i&&(r=i)}else t.bitSize&&(r=t.bitSize);const n=bigintPower(BigInt(2),BigInt((r??256)-1)),o=BigInt(-1)*bigintPower(BigInt(2),BigInt((r??256)-1));try{const i=typeof e=="string"&&isHexStrict(e)?BigInt(hexToNumber(e)):BigInt(e);return i>=o&&i<=n}catch{return!1}},isNumber=e=>!!(isInt(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number"),isBlockNumber=e=>isUInt(e),isBlockTag=e=>Object.values(BlockTags).includes(e),isBlockNumberOrTag=e=>isBlockTag(e)||isBlockNumber(e),isBloom=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e)),isBoolean=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!isHexStrict(e)?e==="1"||e==="0":typeof e=="string"&&isHexStrict(e)?e==="0x1"||e==="0x0":e===1||e===0:!1,isNullish=e=>e==null,isTopic=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e)),isFilterObject=e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(isNullish(e)||typeof e!="object"||!Object.keys(e).every(r=>t.includes(r))||!isNullish(e.fromBlock)&&!isBlockNumberOrTag(e.fromBlock)||!isNullish(e.toBlock)&&!isBlockNumberOrTag(e.toBlock))return!1;if(!isNullish(e.address)){if(Array.isArray(e.address)){if(!e.address.every(r=>isAddress(r)))return!1}else if(!isAddress(e.address))return!1}return!(!isNullish(e.topics)&&!e.topics.every(r=>isNullish(r)?!0:Array.isArray(r)?r.every(n=>isTopic(n)):!!isTopic(r)))},formats={address:e=>isAddress(e),bloom:e=>isBloom(e),blockNumber:e=>isBlockNumber(e),blockTag:e=>isBlockTag(e),blockNumberOrTag:e=>isBlockNumberOrTag(e),bool:e=>isBoolean(e),bytes:e=>isBytes(e),filter:e=>isFilterObject(e),hex:e=>isHexStrict(e),uint:e=>isUInt(e),int:e=>isInt(e),number:e=>isNumber(e),string:e=>isString(e)};for(let e=8;e<=256;e+=8)formats[`int${e}`]=t=>isInt(t,{bitSize:e}),formats[`uint${e}`]=t=>isUInt(t,{bitSize:e});for(let e=1;e<=32;e+=1)formats[`bytes${e}`]=t=>isBytes(t,{size:e});formats.bytes256=formats.bytes;const convertToZod=e=>{if((!e?.type||e?.type==="object")&&e?.properties){const t={};for(const r of Object.keys(e.properties)){const n=convertToZod(e.properties[r]);n&&(t[r]=n)}return Array.isArray(e.required)?objectType(t).partial().required(e.required.reduce((r,n)=>Object.assign(Object.assign({},r),{[n]:!0}),{})):objectType(t).partial()}if(e?.type==="array"&&e?.items){if(Array.isArray(e.items)&&e.items.length>1&&e.maxItems!==void 0&&new Set(e.items.map(n=>n.$id)).size===e.items.length){const n=[];for(const o of e.items){const i=convertToZod(o);i&&n.push(i)}return tupleType(n)}const t=Array.isArray(e.items)?e.items[0]:e.items;let r=arrayType(convertToZod(t));return r=e.minItems!==void 0?r.min(e.minItems):r,r=e.maxItems!==void 0?r.max(e.maxItems):r,r}if(e.oneOf&&Array.isArray(e.oneOf))return unionType(e.oneOf.map(t=>convertToZod(t)));if(e?.format){if(!formats[e.format])throw new SchemaFormatError(e.format);return anyType().refine(formats[e.format],t=>({params:{value:t,format:e.format}}))}return e?.type&&e?.type!=="object"&&typeof z$1[String(e.type)]=="function"?z$1[String(e.type)]():objectType({data:anyType()}).partial()};class Validator{static factory(){return Validator.validatorInstance||(Validator.validatorInstance=new Validator),Validator.validatorInstance}validate(t,r,n){var o,i;const a=convertToZod(t).safeParse(r);if(!a.success){const s=this.convertErrors((i=(o=a.error)===null||o===void 0?void 0:o.issues)!==null&&i!==void 0?i:[]);if(s){if(n?.silent)return s;throw new Web3ValidatorError(s)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(r=>{var n;let o,i,u,a;a=r.path.join("/");const s=String(r.path[r.path.length-1]),f=r.path.join("/");if(r.code===ZodIssueCode.too_big)i="maxItems",a=`${f}/maxItems`,u={limit:r.maximum},o=`must NOT have more than ${r.maximum} items`;else if(r.code===ZodIssueCode.too_small)i="minItems",a=`${f}/minItems`,u={limit:r.minimum},o=`must NOT have fewer than ${r.minimum} items`;else if(r.code===ZodIssueCode.custom){const{value:c,format:d}=(n=r.params)!==null&&n!==void 0?n:{};typeof c>"u"?o=`value at "/${a}" is required`:o=`value "${typeof c=="object"?JSON.stringify(c):c}" at "/${a}" must pass "${d}" validation`,u={value:c}}return{keyword:i??s,instancePath:f?`/${f}`:"",schemaPath:a?`#${a}`:"#",params:u??{value:r.message},message:o??r.message}})}}class Web3Validator{constructor(){this._validator=Validator.factory()}validateJSONSchema(t,r,n){return this._validator.validate(t,r,n)}validate(t,r,n={silent:!1}){var o,i;const u=ethAbiToJsonSchema(t);if(!(Array.isArray(u.items)&&((o=u.items)===null||o===void 0?void 0:o.length)===0&&r.length===0)){if(Array.isArray(u.items)&&((i=u.items)===null||i===void 0?void 0:i.length)===0&&r.length!==0)throw new Web3ValidatorError([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:r}]);return this._validator.validate(u,r,n)}}}const validator=new Web3Validator;function isUint8Array(e){var t,r;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((r=e?.constructor)===null||r===void 0?void 0:r.name)==="Buffer"}BigInt(0),BigInt(1),BigInt(1e3),BigInt(1e3),BigInt(1e3),BigInt(1e3),BigInt(1e6),BigInt(1e6),BigInt(1e6),BigInt(1e6),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e12),BigInt(1e12),BigInt(1e12),BigInt(1e15),BigInt(1e15),BigInt(1e15),BigInt("1000000000000000000"),BigInt("1000000000000000000000"),BigInt("1000000000000000000000"),BigInt("1000000000000000000000000"),BigInt("1000000000000000000000000000"),BigInt("1000000000000000000000000000000");const bytesToUint8Array=e=>{if(validator.validate(["bytes"],[e]),isUint8Array(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return hexToUint8Array(e);throw new InvalidBytesError(e)},{uint8ArrayToHexString}=utils$4,bytesToHex$1=e=>uint8ArrayToHexString(bytesToUint8Array(e)),utf8ToHex=e=>{validator.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),bytesToHex$1(new TextEncoder().encode(t))};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var naclFast={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(e,t){var r=requireBuffer$1(),n=r.Buffer;function o(u,a){for(var s in u)a[s]=u[s]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(u,a,s){return n(u,a,s)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(u,a,s){if(typeof u=="number")throw new TypeError("Argument must not be a number");return n(u,a,s)},i.alloc=function(u,a,s){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=n(u);return a!==void 0?typeof s=="string"?f.fill(a,s):f.fill(a):f.fill(0),f},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(u)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var e=65536,t=4294967295;function r(){throw new Error(`Secure random number generation is not supported by this browser.
133
+ `)}`}_compileErrors(){return this.errors.map(errorFormatter)}}const VALID_ETH_BASE_TYPES=["bool","int","uint","bytes","string","address","tuple"],isAbiParameterSchema=e=>typeof e=="object"&&"type"in e&&"name"in e,isString=e=>typeof e=="string",isHexStrict=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e),extraTypes=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],parseBaseType=e=>{let t=e.replace(/ /,""),r,n=!1,o=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),o=[...e.matchAll(/(?:\[(\d*)\])/g)].map(i=>parseInt(i[1],10)).map(i=>Number.isNaN(i)?-1:i),n=o.length>0),VALID_ETH_BASE_TYPES.includes(t))return{baseType:t,isArray:n,baseTypeSize:r,arraySizes:o};if(t.startsWith("int"))r=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))r=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))r=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:o};return{baseType:t,isArray:n,baseTypeSize:r,arraySizes:o}},convertEthType=(e,t={})=>{if(Object.keys(t).includes("type"))throw new Web3ValidatorError([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:n,baseTypeSize:o}=parseBaseType(e);if(!n&&!extraTypes.includes(e))throw new Web3ValidatorError([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(n){if(n==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${n}${o??""}`,required:!0}}return e?{format:e,required:!0}:{}},abiSchemaToJsonSchema=(e,t="/0")=>{const r={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[n,o]of e.entries()){let i,u,a=[];isAbiParameterSchema(o)?(i=o.type,u=o.name||`${t}/${n}`,a=o.components):typeof o=="string"?(i=o,u=`${t}/${n}`):Array.isArray(o)&&(o[0]&&typeof o[0]=="string"&&o[0].startsWith("tuple")&&!Array.isArray(o[0])&&o[1]&&Array.isArray(o[1])?(i=o[0],u=`${t}/${n}`,a=o[1]):(i="tuple",u=`${t}/${n}`,a=o));const{baseType:s,isArray:f,arraySizes:c}=parseBaseType(i);let d,p=r;for(let h=c.length-1;h>0;h-=1)d={type:"array",$id:u,items:[],maxItems:c[h],minItems:c[h]},c[h]<0&&(delete d.maxItems,delete d.minItems),Array.isArray(p.items)?p.items.length===0?p.items=[d]:p.items.push(d):p.items=[p.items,d],p=d;if(s==="tuple"&&!f){const h=abiSchemaToJsonSchema(a,u);h.$id=u,p.items.push(h)}else if(s==="tuple"&&f){const h=c[0],y=Object.assign({type:"array",$id:u,items:abiSchemaToJsonSchema(a,u)},h>=0&&{minItems:h,maxItems:h});p.items.push(y)}else if(f){const h=c[0],y=Object.assign({type:"array",$id:u,items:convertEthType(i)},h>=0&&{minItems:h,maxItems:h});p.items.push(y)}else Array.isArray(p.items)?p.items.push(Object.assign({$id:u},convertEthType(i))):p.items.push(Object.assign({$id:u},convertEthType(i)));p=r}return r},ethAbiToJsonSchema=e=>abiSchemaToJsonSchema(e),hexToNumber=e=>{if(!isHexStrict(e))throw new Error("Invalid hex string");const[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],n=BigInt(r);return n>Number.MAX_SAFE_INTEGER?t?-n:n:n<Number.MIN_SAFE_INTEGER?n:t?-1*Number(n):Number(n)};function uint8ArrayToHexString$1(e){let t="0x";for(const r of e){const n=r.toString(16);t+=n.length===1?`0${n}`:n}return t}const charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16(e){if(e>=charCodeMap.zero&&e<=charCodeMap.nine)return e-charCodeMap.zero;if(e>=charCodeMap.A&&e<=charCodeMap.F)return e-(charCodeMap.A-10);if(e>=charCodeMap.a&&e<=charCodeMap.f)return e-(charCodeMap.a-10)}function hexToUint8Array(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new InvalidBytesError(`hex string has odd length: ${e}`);const r=(e.length-t)/2,n=new Uint8Array(r);for(let o=0,i=t;o<r;o+=1){const u=charCodeToBase16(e.charCodeAt(i++)),a=charCodeToBase16(e.charCodeAt(i++));if(u===void 0||a===void 0)throw new InvalidBytesError(`Invalid byte sequence ("${e[i-2]}${e[i-1]}" in "${e}").`);n[o]=u*16+a}return n}function ensureIfUint8Array(e){var t;return!(e instanceof Uint8Array)&&((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}const utils$4=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema,ensureIfUint8Array,ethAbiToJsonSchema,hexToNumber,hexToUint8Array,parseBaseType,uint8ArrayToHexString:uint8ArrayToHexString$1},Symbol.toStringTag,{value:"Module"})),isUint8Array$1=e=>{var t,r;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((r=e?.constructor)===null||r===void 0?void 0:r.name)==="Buffer"},isBytes=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!isUint8Array$1(e)||typeof e=="string"&&isHexStrict(e)&&e.startsWith("-")||typeof e=="string"&&!isHexStrict(e))return!1;let r;if(typeof e=="string"){if(e.length%2!==0)return!1;r=hexToUint8Array(e)}else if(Array.isArray(e)){if(e.some(n=>n<0||n>255||!Number.isInteger(n)))return!1;r=new Uint8Array(e)}else r=e;if(t?.abiType){const{baseTypeSize:n}=parseBaseType(t.abiType);return n?r.length===n:!0}return t?.size?r.length===t?.size:!0},checkAddressCheckSum=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),r=utf8ToBytes(t.toLowerCase()),n=uint8ArrayToHexString$1(keccak256$1(ensureIfUint8Array(r))).slice(2);for(let o=0;o<40;o+=1)if(parseInt(n[o],16)>7&&t[o].toUpperCase()!==t[o]||parseInt(n[o],16)<=7&&t[o].toLowerCase()!==t[o])return!1;return!0},isAddress=(e,t=!0)=>{if(typeof e!="string"&&!isUint8Array$1(e))return!1;let r;return isUint8Array$1(e)?r=uint8ArrayToHexString$1(e):typeof e=="string"&&!isHexStrict(e)?r=e.toLowerCase().startsWith("0x")?e:`0x${e}`:r=e,/^(0x)?[0-9a-f]{40}$/i.test(r)?/^(0x|0X)?[0-9a-f]{40}$/.test(r)||/^(0x|0X)?[0-9A-F]{40}$/.test(r)?!0:t?checkAddressCheckSum(r):!0:!1};var FMT_NUMBER;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(FMT_NUMBER||(FMT_NUMBER={}));var FMT_BYTES;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(FMT_BYTES||(FMT_BYTES={}));FMT_NUMBER.BIGINT,FMT_BYTES.HEX;FMT_NUMBER.HEX,FMT_BYTES.HEX;var BlockTags;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized",e.COMMITTED="committed"})(BlockTags||(BlockTags={}));var HardforksOrdered;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(HardforksOrdered||(HardforksOrdered={}));const bigintPower=(e,t)=>{if(t===BigInt(0))return BigInt(1);let r=e;for(let n=1;n<t;n+=1)r*=e;return r},isUInt=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let r;if(t?.abiType){const{baseTypeSize:o}=parseBaseType(t.abiType);o&&(r=o)}else t.bitSize&&(r=t.bitSize);const n=bigintPower(BigInt(2),BigInt(r??256))-BigInt(1);try{const o=typeof e=="string"&&isHexStrict(e)?BigInt(hexToNumber(e)):BigInt(e);return o>=0&&o<=n}catch{return!1}},isInt=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let r;if(t?.abiType){const{baseTypeSize:i,baseType:u}=parseBaseType(t.abiType);if(u!=="int")return!1;i&&(r=i)}else t.bitSize&&(r=t.bitSize);const n=bigintPower(BigInt(2),BigInt((r??256)-1)),o=BigInt(-1)*bigintPower(BigInt(2),BigInt((r??256)-1));try{const i=typeof e=="string"&&isHexStrict(e)?BigInt(hexToNumber(e)):BigInt(e);return i>=o&&i<=n}catch{return!1}},isNumber=e=>!!(isInt(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number"),isBlockNumber=e=>isUInt(e),isBlockTag=e=>Object.values(BlockTags).includes(e),isBlockNumberOrTag=e=>isBlockTag(e)||isBlockNumber(e),isBloom=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e)),isBoolean=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!isHexStrict(e)?e==="1"||e==="0":typeof e=="string"&&isHexStrict(e)?e==="0x1"||e==="0x0":e===1||e===0:!1,isNullish=e=>e==null,isTopic=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e)),isFilterObject=e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(isNullish(e)||typeof e!="object"||!Object.keys(e).every(r=>t.includes(r))||!isNullish(e.fromBlock)&&!isBlockNumberOrTag(e.fromBlock)||!isNullish(e.toBlock)&&!isBlockNumberOrTag(e.toBlock))return!1;if(!isNullish(e.address)){if(Array.isArray(e.address)){if(!e.address.every(r=>isAddress(r)))return!1}else if(!isAddress(e.address))return!1}return!(!isNullish(e.topics)&&!e.topics.every(r=>isNullish(r)?!0:Array.isArray(r)?r.every(n=>isTopic(n)):!!isTopic(r)))},formats={address:e=>isAddress(e),bloom:e=>isBloom(e),blockNumber:e=>isBlockNumber(e),blockTag:e=>isBlockTag(e),blockNumberOrTag:e=>isBlockNumberOrTag(e),bool:e=>isBoolean(e),bytes:e=>isBytes(e),filter:e=>isFilterObject(e),hex:e=>isHexStrict(e),uint:e=>isUInt(e),int:e=>isInt(e),number:e=>isNumber(e),string:e=>isString(e)};for(let e=8;e<=256;e+=8)formats[`int${e}`]=t=>isInt(t,{bitSize:e}),formats[`uint${e}`]=t=>isUInt(t,{bitSize:e});for(let e=1;e<=32;e+=1)formats[`bytes${e}`]=t=>isBytes(t,{size:e});formats.bytes256=formats.bytes;const convertToZod=e=>{if((!e?.type||e?.type==="object")&&e?.properties){const t={};for(const r of Object.keys(e.properties)){const n=convertToZod(e.properties[r]);n&&(t[r]=n)}return Array.isArray(e.required)?objectType(t).partial().required(e.required.reduce((r,n)=>Object.assign(Object.assign({},r),{[n]:!0}),{})):objectType(t).partial()}if(e?.type==="array"&&e?.items){if(Array.isArray(e.items)&&e.items.length>1&&e.maxItems!==void 0&&new Set(e.items.map(n=>n.$id)).size===e.items.length){const n=[];for(const o of e.items){const i=convertToZod(o);i&&n.push(i)}return tupleType(n)}const t=Array.isArray(e.items)?e.items[0]:e.items;let r=arrayType(convertToZod(t));return r=e.minItems!==void 0?r.min(e.minItems):r,r=e.maxItems!==void 0?r.max(e.maxItems):r,r}if(e.oneOf&&Array.isArray(e.oneOf))return unionType(e.oneOf.map(t=>convertToZod(t)));if(e?.format){if(!formats[e.format])throw new SchemaFormatError(e.format);return anyType().refine(formats[e.format],t=>({params:{value:t,format:e.format}}))}return e?.type&&e?.type!=="object"&&typeof z$1[String(e.type)]=="function"?z$1[String(e.type)]():objectType({data:anyType()}).partial()};class Validator{static factory(){return Validator.validatorInstance||(Validator.validatorInstance=new Validator),Validator.validatorInstance}validate(t,r,n){var o,i;const a=convertToZod(t).safeParse(r);if(!a.success){const s=this.convertErrors((i=(o=a.error)===null||o===void 0?void 0:o.issues)!==null&&i!==void 0?i:[]);if(s){if(n?.silent)return s;throw new Web3ValidatorError(s)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(r=>{var n;let o,i,u,a;a=r.path.join("/");const s=String(r.path[r.path.length-1]),f=r.path.join("/");if(r.code===ZodIssueCode.too_big)i="maxItems",a=`${f}/maxItems`,u={limit:r.maximum},o=`must NOT have more than ${r.maximum} items`;else if(r.code===ZodIssueCode.too_small)i="minItems",a=`${f}/minItems`,u={limit:r.minimum},o=`must NOT have fewer than ${r.minimum} items`;else if(r.code===ZodIssueCode.custom){const{value:c,format:d}=(n=r.params)!==null&&n!==void 0?n:{};typeof c>"u"?o=`value at "/${a}" is required`:o=`value "${typeof c=="object"?JSON.stringify(c):c}" at "/${a}" must pass "${d}" validation`,u={value:c}}return{keyword:i??s,instancePath:f?`/${f}`:"",schemaPath:a?`#${a}`:"#",params:u??{value:r.message},message:o??r.message}})}}class Web3Validator{constructor(){this._validator=Validator.factory()}validateJSONSchema(t,r,n){return this._validator.validate(t,r,n)}validate(t,r,n={silent:!1}){var o,i;const u=ethAbiToJsonSchema(t);if(!(Array.isArray(u.items)&&((o=u.items)===null||o===void 0?void 0:o.length)===0&&r.length===0)){if(Array.isArray(u.items)&&((i=u.items)===null||i===void 0?void 0:i.length)===0&&r.length!==0)throw new Web3ValidatorError([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:r}]);return this._validator.validate(u,r,n)}}}const validator=new Web3Validator;function isUint8Array(e){var t,r;return e instanceof Uint8Array||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((r=e?.constructor)===null||r===void 0?void 0:r.name)==="Buffer"}BigInt(0),BigInt(1),BigInt(1e3),BigInt(1e3),BigInt(1e3),BigInt(1e3),BigInt(1e6),BigInt(1e6),BigInt(1e6),BigInt(1e6),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e12),BigInt(1e12),BigInt(1e12),BigInt(1e15),BigInt(1e15),BigInt(1e15),BigInt("1000000000000000000"),BigInt("1000000000000000000000"),BigInt("1000000000000000000000"),BigInt("1000000000000000000000000"),BigInt("1000000000000000000000000000"),BigInt("1000000000000000000000000000000");const bytesToUint8Array=e=>{if(validator.validate(["bytes"],[e]),isUint8Array(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return hexToUint8Array(e);throw new InvalidBytesError(e)},{uint8ArrayToHexString}=utils$4,bytesToHex$1=e=>uint8ArrayToHexString(bytesToUint8Array(e)),utf8ToHex=e=>{validator.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),bytesToHex$1(new TextEncoder().encode(t))};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var naclFast={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(e,t){var r=requireBuffer$1(),n=r.Buffer;function o(u,a){for(var s in u)a[s]=u[s]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(u,a,s){return n(u,a,s)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(u,a,s){if(typeof u=="number")throw new TypeError("Argument must not be a number");return n(u,a,s)},i.alloc=function(u,a,s){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=n(u);return a!==void 0?typeof s=="string"?f.fill(a,s):f.fill(a):f.fill(0),f},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(u)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var e=65536,t=4294967295;function r(){throw new Error(`Secure random number generation is not supported by this browser.
134
134
  Use Chrome, Firefox or Internet Explorer 11`)}var n=requireSafeBuffer$1().Buffer,o=commonjsGlobal.crypto||commonjsGlobal.msCrypto;o&&o.getRandomValues?browser$b.exports=i:browser$b.exports=r;function i(u,a){if(u>t)throw new RangeError("requested too many random bytes");var s=n.allocUnsafe(u);if(u>0)if(u>e)for(var f=0;f<u;f+=e)o.getRandomValues(s.slice(f,f+e));else o.getRandomValues(s);return typeof a=="function"?process.nextTick(function(){a(null,s)}):s}return browser$b.exports}var isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var e={}.toString;return isarray$1=Array.isArray||function(t){return e.call(t)=="[object Array]"},isarray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var e=requireType(),t=requireCallBound$1(),r=t("TypedArray.prototype.buffer",!0),n=requireIsTypedArray();return typedArrayBuffer=r||function(i){if(!n(i))throw new e("Not a Typed Array");return i.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$2;function requireToBuffer$2(){if(hasRequiredToBuffer$2)return toBuffer;hasRequiredToBuffer$2=1;var e=requireSafeBuffer$1().Buffer,t=requireIsarray$1(),r=requireTypedArrayBuffer(),n=ArrayBuffer.isView||function(s){try{return r(s),!0}catch{return!1}},o=typeof Uint8Array<"u",i=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u=i&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return toBuffer=function(s,f){if(e.isBuffer(s))return s.constructor&&!("isBuffer"in s)?e.from(s):s;if(typeof s=="string")return e.from(s,f);if(i&&n(s)){if(s.byteLength===0)return e.alloc(0);if(u){var c=e.from(s.buffer,s.byteOffset,s.byteLength);if(c.byteLength===s.byteLength)return c}var d=s instanceof Uint8Array?s:new Uint8Array(s.buffer,s.byteOffset,s.byteLength),p=e.from(d);if(p.length===s.byteLength)return p}if(o&&s instanceof Uint8Array)return e.from(s);var h=t(s);if(h)for(var y=0;y<s.length;y+=1){var b=s[y];if(typeof b!="number"||b<0||b>255||~~b!==b)throw new RangeError("Array items must be numbers in the range 0-255.")}if(h||e.isBuffer(s)&&s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s))return e.from(s);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var toBuffer_1$1,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer_1$1;hasRequiredToBuffer$1=1;var e=requireSafeBuffer$1().Buffer,t=requireToBuffer$2(),r=typeof Uint8Array<"u",n=r&&typeof ArrayBuffer<"u",o=n&&ArrayBuffer.isView;return toBuffer_1$1=function(i,u){if(typeof i=="string"||e.isBuffer(i)||r&&i instanceof Uint8Array||o&&o(i))return t(i,u);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},toBuffer_1$1}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:e}:processNextickArgs.exports=process;function e(t,r,n,o){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,u,a;switch(i){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick(function(){t.call(null,r)});case 3:return process.nextTick(function(){t.call(null,r,n)});case 4:return process.nextTick(function(){t.call(null,r,n,o)});default:for(u=new Array(i-1),a=0;a<u.length;)u[a++]=arguments[a];return process.nextTick(function(){t.apply(null,u)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var e={}.toString;return isarray=Array.isArray||function(t){return e.call(t)=="[object Array]"},isarray}var events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(W,J,ve){return Function.prototype.apply.call(W,J,ve)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(W){return Object.getOwnPropertyNames(W).concat(Object.getOwnPropertySymbols(W))}:r=function(W){return Object.getOwnPropertyNames(W)};function n(ae){console&&console.warn&&console.warn(ae)}var o=Number.isNaN||function(W){return W!==W};function i(){i.init.call(this)}events.exports=i,events.exports.once=S,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var u=10;function a(ae){if(typeof ae!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ae)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(ae){if(typeof ae!="number"||ae<0||o(ae))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ae+".");u=ae}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(W){if(typeof W!="number"||W<0||o(W))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+W+".");return this._maxListeners=W,this};function s(ae){return ae._maxListeners===void 0?i.defaultMaxListeners:ae._maxListeners}i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(W){for(var J=[],ve=1;ve<arguments.length;ve++)J.push(arguments[ve]);var Qe=W==="error",kt=this._events;if(kt!==void 0)Qe=Qe&&kt.error===void 0;else if(!Qe)return!1;if(Qe){var nr;if(J.length>0&&(nr=J[0]),nr instanceof Error)throw nr;var sr=new Error("Unhandled error."+(nr?" ("+nr.message+")":""));throw sr.context=nr,sr}var ce=kt[W];if(ce===void 0)return!1;if(typeof ce=="function")t(ce,this,J);else for(var Ze=ce.length,se=y(ce,Ze),ve=0;ve<Ze;++ve)t(se[ve],this,J);return!0};function f(ae,W,J,ve){var Qe,kt,nr;if(a(J),kt=ae._events,kt===void 0?(kt=ae._events=Object.create(null),ae._eventsCount=0):(kt.newListener!==void 0&&(ae.emit("newListener",W,J.listener?J.listener:J),kt=ae._events),nr=kt[W]),nr===void 0)nr=kt[W]=J,++ae._eventsCount;else if(typeof nr=="function"?nr=kt[W]=ve?[J,nr]:[nr,J]:ve?nr.unshift(J):nr.push(J),Qe=s(ae),Qe>0&&nr.length>Qe&&!nr.warned){nr.warned=!0;var sr=new Error("Possible EventEmitter memory leak detected. "+nr.length+" "+String(W)+" listeners added. Use emitter.setMaxListeners() to increase limit");sr.name="MaxListenersExceededWarning",sr.emitter=ae,sr.type=W,sr.count=nr.length,n(sr)}return ae}i.prototype.addListener=function(W,J){return f(this,W,J,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(W,J){return f(this,W,J,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(ae,W,J){var ve={fired:!1,wrapFn:void 0,target:ae,type:W,listener:J},Qe=c.bind(ve);return Qe.listener=J,ve.wrapFn=Qe,Qe}i.prototype.once=function(W,J){return a(J),this.on(W,d(this,W,J)),this},i.prototype.prependOnceListener=function(W,J){return a(J),this.prependListener(W,d(this,W,J)),this},i.prototype.removeListener=function(W,J){var ve,Qe,kt,nr,sr;if(a(J),Qe=this._events,Qe===void 0)return this;if(ve=Qe[W],ve===void 0)return this;if(ve===J||ve.listener===J)--this._eventsCount===0?this._events=Object.create(null):(delete Qe[W],Qe.removeListener&&this.emit("removeListener",W,ve.listener||J));else if(typeof ve!="function"){for(kt=-1,nr=ve.length-1;nr>=0;nr--)if(ve[nr]===J||ve[nr].listener===J){sr=ve[nr].listener,kt=nr;break}if(kt<0)return this;kt===0?ve.shift():b(ve,kt),ve.length===1&&(Qe[W]=ve[0]),Qe.removeListener!==void 0&&this.emit("removeListener",W,sr||J)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(W){var J,ve,Qe;if(ve=this._events,ve===void 0)return this;if(ve.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ve[W]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ve[W]),this;if(arguments.length===0){var kt=Object.keys(ve),nr;for(Qe=0;Qe<kt.length;++Qe)nr=kt[Qe],nr!=="removeListener"&&this.removeAllListeners(nr);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(J=ve[W],typeof J=="function")this.removeListener(W,J);else if(J!==void 0)for(Qe=J.length-1;Qe>=0;Qe--)this.removeListener(W,J[Qe]);return this};function p(ae,W,J){var ve=ae._events;if(ve===void 0)return[];var Qe=ve[W];return Qe===void 0?[]:typeof Qe=="function"?J?[Qe.listener||Qe]:[Qe]:J?w(Qe):y(Qe,Qe.length)}i.prototype.listeners=function(W){return p(this,W,!0)},i.prototype.rawListeners=function(W){return p(this,W,!1)},i.listenerCount=function(ae,W){return typeof ae.listenerCount=="function"?ae.listenerCount(W):h.call(ae,W)},i.prototype.listenerCount=h;function h(ae){var W=this._events;if(W!==void 0){var J=W[ae];if(typeof J=="function")return 1;if(J!==void 0)return J.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function y(ae,W){for(var J=new Array(W),ve=0;ve<W;++ve)J[ve]=ae[ve];return J}function b(ae,W){for(;W+1<ae.length;W++)ae[W]=ae[W+1];ae.pop()}function w(ae){for(var W=new Array(ae.length),J=0;J<W.length;++J)W[J]=ae[J].listener||ae[J];return W}function S(ae,W){return new Promise(function(J,ve){function Qe(nr){ae.removeListener(W,kt),ve(nr)}function kt(){typeof ae.removeListener=="function"&&ae.removeListener("error",Qe),J([].slice.call(arguments))}B(ae,W,kt,{once:!0}),W!=="error"&&E(ae,Qe,{once:!0})})}function E(ae,W,J){typeof ae.on=="function"&&B(ae,"error",W,J)}function B(ae,W,J,ve){if(typeof ae.on=="function")ve.once?ae.once(W,J):ae.on(W,J);else if(typeof ae.addEventListener=="function")ae.addEventListener(W,function Qe(kt){ve.once&&ae.removeEventListener(W,Qe),J(kt)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ae)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,(function(e,t){var r=requireBuffer$1(),n=r.Buffer;function o(u,a){for(var s in u)a[s]=u[s]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(u,a,s){return n(u,a,s)}o(n,i),i.from=function(u,a,s){if(typeof u=="number")throw new TypeError("Argument must not be a number");return n(u,a,s)},i.alloc=function(u,a,s){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=n(u);return a!==void 0?typeof s=="string"?f.fill(a,s):f.fill(a):f.fill(0),f},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(u)}})(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function e(b){return Array.isArray?Array.isArray(b):y(b)==="[object Array]"}util.isArray=e;function t(b){return typeof b=="boolean"}util.isBoolean=t;function r(b){return b===null}util.isNull=r;function n(b){return b==null}util.isNullOrUndefined=n;function o(b){return typeof b=="number"}util.isNumber=o;function i(b){return typeof b=="string"}util.isString=i;function u(b){return typeof b=="symbol"}util.isSymbol=u;function a(b){return b===void 0}util.isUndefined=a;function s(b){return y(b)==="[object RegExp]"}util.isRegExp=s;function f(b){return typeof b=="object"&&b!==null}util.isObject=f;function c(b){return y(b)==="[object Date]"}util.isDate=c;function d(b){return y(b)==="[object Error]"||b instanceof Error}util.isError=d;function p(b){return typeof b=="function"}util.isFunction=p;function h(b){return b===null||typeof b=="boolean"||typeof b=="number"||typeof b=="string"||typeof b=="symbol"||typeof b>"u"}util.isPrimitive=h,util.isBuffer=requireBuffer$1().Buffer.isBuffer;function y(b){return Object.prototype.toString.call(b)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,(function(e){function t(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var r=requireSafeBuffer().Buffer,n=requireUtil$1();function o(i,u,a){i.copy(u,a)}e.exports=(function(){function i(){t(this,i),this.head=null,this.tail=null,this.length=0}return i.prototype.push=function(a){var s={data:a,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},i.prototype.unshift=function(a){var s={data:a,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},i.prototype.shift=function(){if(this.length!==0){var a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(a){if(this.length===0)return"";for(var s=this.head,f=""+s.data;s=s.next;)f+=a+s.data;return f},i.prototype.concat=function(a){if(this.length===0)return r.alloc(0);for(var s=r.allocUnsafe(a>>>0),f=this.head,c=0;f;)o(f.data,s,c),c+=f.data.length,f=f.next;return s},i})(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var i=n.inspect({length:this.length});return this.constructor.name+" "+i})})(BufferList)),BufferList.exports}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;var e=requireProcessNextickArgs();function t(o,i){var u=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(i?i(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(n,this,o)):e.nextTick(n,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(f){!i&&f?u._writableState?u._writableState.errorEmitted||(u._writableState.errorEmitted=!0,e.nextTick(n,u,f)):e.nextTick(n,u,f):i&&i(f)}),this)}function r(){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 n(o,i){o.emit("error",i)}return destroy_1$1={destroy:t,undestroy:r},destroy_1$1}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=e;function e(r,n){if(t("noDeprecation"))return r;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),o=!0}return r.apply(this,arguments)}return i}function t(r){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var n=commonjsGlobal.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1;var e=requireProcessNextickArgs();_stream_writable$1=b;function t(ue){var bt=this;this.next=null,this.entry=null,this.finish=function(){ur(bt,ue)}}var r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:e.nextTick,n;b.WritableState=h;var o=Object.create(requireUtil());o.inherits=requireInherits_browser();var i={deprecate:requireBrowser$a()},u=requireStreamBrowser$1(),a=requireSafeBuffer().Buffer,s=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(ue){return a.from(ue)}function c(ue){return a.isBuffer(ue)||ue instanceof s}var d=requireDestroy$1();o.inherits(b,u);function p(){}function h(ue,bt){n=n||require_stream_duplex$1(),ue=ue||{};var L=bt instanceof n;this.objectMode=!!ue.objectMode,L&&(this.objectMode=this.objectMode||!!ue.writableObjectMode);var _=ue.highWaterMark,F=ue.writableHighWaterMark,k=this.objectMode?16:16*1024;_||_===0?this.highWaterMark=_:L&&(F||F===0)?this.highWaterMark=F:this.highWaterMark=k,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 Ye=ue.decodeStrings===!1;this.decodeStrings=!Ye,this.defaultEncoding=ue.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(rn){ve(bt,rn)},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 t(this)}h.prototype.getBuffer=function(){for(var bt=this.bufferedRequest,L=[];bt;)L.push(bt),bt=bt.next;return L},(function(){try{Object.defineProperty(h.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var y;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(y=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(ue){return y.call(this,ue)?!0:this!==b?!1:ue&&ue._writableState instanceof h}})):y=function(ue){return ue instanceof this};function b(ue){if(n=n||require_stream_duplex$1(),!y.call(b,this)&&!(this instanceof n))return new b(ue);this._writableState=new h(ue,this),this.writable=!0,ue&&(typeof ue.write=="function"&&(this._write=ue.write),typeof ue.writev=="function"&&(this._writev=ue.writev),typeof ue.destroy=="function"&&(this._destroy=ue.destroy),typeof ue.final=="function"&&(this._final=ue.final)),u.call(this)}b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function w(ue,bt){var L=new Error("write after end");ue.emit("error",L),e.nextTick(bt,L)}function S(ue,bt,L,_){var F=!0,k=!1;return L===null?k=new TypeError("May not write null values to stream"):typeof L!="string"&&L!==void 0&&!bt.objectMode&&(k=new TypeError("Invalid non-string/buffer chunk")),k&&(ue.emit("error",k),e.nextTick(_,k),F=!1),F}b.prototype.write=function(ue,bt,L){var _=this._writableState,F=!1,k=!_.objectMode&&c(ue);return k&&!a.isBuffer(ue)&&(ue=f(ue)),typeof bt=="function"&&(L=bt,bt=null),k?bt="buffer":bt||(bt=_.defaultEncoding),typeof L!="function"&&(L=p),_.ended?w(this,L):(k||S(this,_,ue,L))&&(_.pendingcb++,F=B(this,_,k,ue,bt,L)),F},b.prototype.cork=function(){var ue=this._writableState;ue.corked++},b.prototype.uncork=function(){var ue=this._writableState;ue.corked&&(ue.corked--,!ue.writing&&!ue.corked&&!ue.bufferProcessing&&ue.bufferedRequest&&nr(this,ue))},b.prototype.setDefaultEncoding=function(bt){if(typeof bt=="string"&&(bt=bt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((bt+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+bt);return this._writableState.defaultEncoding=bt,this};function E(ue,bt,L){return!ue.objectMode&&ue.decodeStrings!==!1&&typeof bt=="string"&&(bt=a.from(bt,L)),bt}Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(ue,bt,L,_,F,k){if(!L){var Ye=E(bt,_,F);_!==Ye&&(L=!0,F="buffer",_=Ye)}var rn=bt.objectMode?1:_.length;bt.length+=rn;var ii=bt.length<bt.highWaterMark;if(ii||(bt.needDrain=!0),bt.writing||bt.corked){var ai=bt.lastBufferedRequest;bt.lastBufferedRequest={chunk:_,encoding:F,isBuf:L,callback:k,next:null},ai?ai.next=bt.lastBufferedRequest:bt.bufferedRequest=bt.lastBufferedRequest,bt.bufferedRequestCount+=1}else ae(ue,bt,!1,rn,_,F,k);return ii}function ae(ue,bt,L,_,F,k,Ye){bt.writelen=_,bt.writecb=Ye,bt.writing=!0,bt.sync=!0,L?ue._writev(F,bt.onwrite):ue._write(F,k,bt.onwrite),bt.sync=!1}function W(ue,bt,L,_,F){--bt.pendingcb,L?(e.nextTick(F,_),e.nextTick(se,ue,bt),ue._writableState.errorEmitted=!0,ue.emit("error",_)):(F(_),ue._writableState.errorEmitted=!0,ue.emit("error",_),se(ue,bt))}function J(ue){ue.writing=!1,ue.writecb=null,ue.length-=ue.writelen,ue.writelen=0}function ve(ue,bt){var L=ue._writableState,_=L.sync,F=L.writecb;if(J(L),bt)W(ue,L,_,bt,F);else{var k=sr(L);!k&&!L.corked&&!L.bufferProcessing&&L.bufferedRequest&&nr(ue,L),_?r(Qe,ue,L,k,F):Qe(ue,L,k,F)}}function Qe(ue,bt,L,_){L||kt(ue,bt),bt.pendingcb--,_(),se(ue,bt)}function kt(ue,bt){bt.length===0&&bt.needDrain&&(bt.needDrain=!1,ue.emit("drain"))}function nr(ue,bt){bt.bufferProcessing=!0;var L=bt.bufferedRequest;if(ue._writev&&L&&L.next){var _=bt.bufferedRequestCount,F=new Array(_),k=bt.corkedRequestsFree;k.entry=L;for(var Ye=0,rn=!0;L;)F[Ye]=L,L.isBuf||(rn=!1),L=L.next,Ye+=1;F.allBuffers=rn,ae(ue,bt,!0,bt.length,F,"",k.finish),bt.pendingcb++,bt.lastBufferedRequest=null,k.next?(bt.corkedRequestsFree=k.next,k.next=null):bt.corkedRequestsFree=new t(bt),bt.bufferedRequestCount=0}else{for(;L;){var ii=L.chunk,ai=L.encoding,ni=L.callback,ri=bt.objectMode?1:ii.length;if(ae(ue,bt,!1,ri,ii,ai,ni),L=L.next,bt.bufferedRequestCount--,bt.writing)break}L===null&&(bt.lastBufferedRequest=null)}bt.bufferedRequest=L,bt.bufferProcessing=!1}b.prototype._write=function(ue,bt,L){L(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(ue,bt,L){var _=this._writableState;typeof ue=="function"?(L=ue,ue=null,bt=null):typeof bt=="function"&&(L=bt,bt=null),ue!=null&&this.write(ue,bt),_.corked&&(_.corked=1,this.uncork()),_.ending||vt(this,_,L)};function sr(ue){return ue.ending&&ue.length===0&&ue.bufferedRequest===null&&!ue.finished&&!ue.writing}function ce(ue,bt){ue._final(function(L){bt.pendingcb--,L&&ue.emit("error",L),bt.prefinished=!0,ue.emit("prefinish"),se(ue,bt)})}function Ze(ue,bt){!bt.prefinished&&!bt.finalCalled&&(typeof ue._final=="function"?(bt.pendingcb++,bt.finalCalled=!0,e.nextTick(ce,ue,bt)):(bt.prefinished=!0,ue.emit("prefinish")))}function se(ue,bt){var L=sr(bt);return L&&(Ze(ue,bt),bt.pendingcb===0&&(bt.finished=!0,ue.emit("finish"))),L}function vt(ue,bt,L){bt.ending=!0,se(ue,bt),L&&(bt.finished?e.nextTick(L):ue.once("finish",L)),bt.ended=!0,ue.writable=!1}function ur(ue,bt,L){var _=ue.entry;for(ue.entry=null;_;){var F=_.callback;bt.pendingcb--,F(L),_=_.next}bt.corkedRequestsFree.next=ue}return Object.defineProperty(b.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ue){this._writableState&&(this._writableState.destroyed=ue)}}),b.prototype.destroy=d.destroy,b.prototype._undestroy=d.undestroy,b.prototype._destroy=function(ue,bt){this.end(),bt(ue)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var e=requireProcessNextickArgs(),t=Object.keys||function(d){var p=[];for(var h in d)p.push(h);return p};_stream_duplex$1=s;var r=Object.create(requireUtil());r.inherits=requireInherits_browser();var n=require_stream_readable$1(),o=require_stream_writable$1();r.inherits(s,n);for(var i=t(o.prototype),u=0;u<i.length;u++){var a=i[u];s.prototype[a]||(s.prototype[a]=o.prototype[a])}function s(d){if(!(this instanceof s))return new s(d);n.call(this,d),o.call(this,d),d&&d.readable===!1&&(this.readable=!1),d&&d.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,d&&d.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",f)}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function f(){this.allowHalfOpen||this._writableState.ended||e.nextTick(c,this)}function c(d){d.end()}return Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),s.prototype._destroy=function(d,p){this.push(null),this.end(),e.nextTick(p,d)},_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer$1().Buffer,t=e.isEncoding||function(S){switch(S=""+S,S&&S.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 r(S){if(!S)return"utf8";for(var E;;)switch(S){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 S;default:if(E)return;S=(""+S).toLowerCase(),E=!0}}function n(S){var E=r(S);if(typeof E!="string"&&(e.isEncoding===t||!t(S)))throw new Error("Unknown encoding: "+S);return E||S}string_decoder.StringDecoder=o;function o(S){this.encoding=n(S);var E;switch(this.encoding){case"utf16le":this.text=d,this.end=p,E=4;break;case"utf8":this.fillLast=s,E=4;break;case"base64":this.text=h,this.end=y,E=3;break;default:this.write=b,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(E)}o.prototype.write=function(S){if(S.length===0)return"";var E,B;if(this.lastNeed){if(E=this.fillLast(S),E===void 0)return"";B=this.lastNeed,this.lastNeed=0}else B=0;return B<S.length?E?E+this.text(S,B):this.text(S,B):E||""},o.prototype.end=c,o.prototype.text=f,o.prototype.fillLast=function(S){if(this.lastNeed<=S.length)return S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,S.length),this.lastNeed-=S.length};function i(S){return S<=127?0:S>>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function u(S,E,B){var ae=E.length-1;if(ae<B)return 0;var W=i(E[ae]);return W>=0?(W>0&&(S.lastNeed=W-1),W):--ae<B||W===-2?0:(W=i(E[ae]),W>=0?(W>0&&(S.lastNeed=W-2),W):--ae<B||W===-2?0:(W=i(E[ae]),W>=0?(W>0&&(W===2?W=0:S.lastNeed=W-3),W):0))}function a(S,E,B){if((E[0]&192)!==128)return S.lastNeed=0,"�";if(S.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return S.lastNeed=1,"�";if(S.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return S.lastNeed=2,"�"}}function s(S){var E=this.lastTotal-this.lastNeed,B=a(this,S);if(B!==void 0)return B;if(this.lastNeed<=S.length)return S.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,E,0,S.length),this.lastNeed-=S.length}function f(S,E){var B=u(this,S,E);if(!this.lastNeed)return S.toString("utf8",E);this.lastTotal=B;var ae=S.length-(B-this.lastNeed);return S.copy(this.lastChar,0,ae),S.toString("utf8",E,ae)}function c(S){var E=S&&S.length?this.write(S):"";return this.lastNeed?E+"�":E}function d(S,E){if((S.length-E)%2===0){var B=S.toString("utf16le",E);if(B){var ae=B.charCodeAt(B.length-1);if(ae>=55296&&ae<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],B.slice(0,-1)}return B}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",E,S.length-1)}function p(S){var E=S&&S.length?this.write(S):"";if(this.lastNeed){var B=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,B)}return E}function h(S,E){var B=(S.length-E)%3;return B===0?S.toString("base64",E):(this.lastNeed=3-B,this.lastTotal=3,B===1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",E,S.length-B))}function y(S){var E=S&&S.length?this.write(S):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function b(S){return S.toString(this.encoding)}function w(S){return S&&S.length?this.write(S):""}return string_decoder}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1;var e=requireProcessNextickArgs();_stream_readable$1=E;var t=requireIsarray(),r;E.ReadableState=S,requireEvents().EventEmitter;var n=function(ni,ri){return ni.listeners(ri).length},o=requireStreamBrowser$1(),i=requireSafeBuffer().Buffer,u=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(ni){return i.from(ni)}function s(ni){return i.isBuffer(ni)||ni instanceof u}var f=Object.create(requireUtil());f.inherits=requireInherits_browser();var c=requireUtil$1(),d=void 0;c&&c.debuglog?d=c.debuglog("stream"):d=function(){};var p=requireBufferList(),h=requireDestroy$1(),y;f.inherits(E,o);var b=["error","close","destroy","pause","resume"];function w(ni,ri,ui){if(typeof ni.prependListener=="function")return ni.prependListener(ri,ui);!ni._events||!ni._events[ri]?ni.on(ri,ui):t(ni._events[ri])?ni._events[ri].unshift(ui):ni._events[ri]=[ui,ni._events[ri]]}function S(ni,ri){r=r||require_stream_duplex$1(),ni=ni||{};var ui=ri instanceof r;this.objectMode=!!ni.objectMode,ui&&(this.objectMode=this.objectMode||!!ni.readableObjectMode);var lr=ni.highWaterMark,ar=ni.readableHighWaterMark,jr=this.objectMode?16:16*1024;lr||lr===0?this.highWaterMark=lr:ui&&(ar||ar===0)?this.highWaterMark=ar:this.highWaterMark=jr,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,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=ni.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ni.encoding&&(y||(y=requireString_decoder().StringDecoder),this.decoder=new y(ni.encoding),this.encoding=ni.encoding)}function E(ni){if(r=r||require_stream_duplex$1(),!(this instanceof E))return new E(ni);this._readableState=new S(ni,this),this.readable=!0,ni&&(typeof ni.read=="function"&&(this._read=ni.read),typeof ni.destroy=="function"&&(this._destroy=ni.destroy)),o.call(this)}Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ni){this._readableState&&(this._readableState.destroyed=ni)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.prototype._destroy=function(ni,ri){this.push(null),ri(ni)},E.prototype.push=function(ni,ri){var ui=this._readableState,lr;return ui.objectMode?lr=!0:typeof ni=="string"&&(ri=ri||ui.defaultEncoding,ri!==ui.encoding&&(ni=i.from(ni,ri),ri=""),lr=!0),B(this,ni,ri,!1,lr)},E.prototype.unshift=function(ni){return B(this,ni,null,!0,!1)};function B(ni,ri,ui,lr,ar){var jr=ni._readableState;if(ri===null)jr.reading=!1,nr(ni,jr);else{var ci;ar||(ci=W(jr,ri)),ci?ni.emit("error",ci):jr.objectMode||ri&&ri.length>0?(typeof ri!="string"&&!jr.objectMode&&Object.getPrototypeOf(ri)!==i.prototype&&(ri=a(ri)),lr?jr.endEmitted?ni.emit("error",new Error("stream.unshift() after end event")):ae(ni,jr,ri,!0):jr.ended?ni.emit("error",new Error("stream.push() after EOF")):(jr.reading=!1,jr.decoder&&!ui?(ri=jr.decoder.write(ri),jr.objectMode||ri.length!==0?ae(ni,jr,ri,!1):Ze(ni,jr)):ae(ni,jr,ri,!1))):lr||(jr.reading=!1)}return J(jr)}function ae(ni,ri,ui,lr){ri.flowing&&ri.length===0&&!ri.sync?(ni.emit("data",ui),ni.read(0)):(ri.length+=ri.objectMode?1:ui.length,lr?ri.buffer.unshift(ui):ri.buffer.push(ui),ri.needReadable&&sr(ni)),Ze(ni,ri)}function W(ni,ri){var ui;return!s(ri)&&typeof ri!="string"&&ri!==void 0&&!ni.objectMode&&(ui=new TypeError("Invalid non-string/buffer chunk")),ui}function J(ni){return!ni.ended&&(ni.needReadable||ni.length<ni.highWaterMark||ni.length===0)}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(ni){return y||(y=requireString_decoder().StringDecoder),this._readableState.decoder=new y(ni),this._readableState.encoding=ni,this};var ve=8388608;function Qe(ni){return ni>=ve?ni=ve:(ni--,ni|=ni>>>1,ni|=ni>>>2,ni|=ni>>>4,ni|=ni>>>8,ni|=ni>>>16,ni++),ni}function kt(ni,ri){return ni<=0||ri.length===0&&ri.ended?0:ri.objectMode?1:ni!==ni?ri.flowing&&ri.length?ri.buffer.head.data.length:ri.length:(ni>ri.highWaterMark&&(ri.highWaterMark=Qe(ni)),ni<=ri.length?ni:ri.ended?ri.length:(ri.needReadable=!0,0))}E.prototype.read=function(ni){d("read",ni),ni=parseInt(ni,10);var ri=this._readableState,ui=ni;if(ni!==0&&(ri.emittedReadable=!1),ni===0&&ri.needReadable&&(ri.length>=ri.highWaterMark||ri.ended))return d("read: emitReadable",ri.length,ri.ended),ri.length===0&&ri.ended?rn(this):sr(this),null;if(ni=kt(ni,ri),ni===0&&ri.ended)return ri.length===0&&rn(this),null;var lr=ri.needReadable;d("need readable",lr),(ri.length===0||ri.length-ni<ri.highWaterMark)&&(lr=!0,d("length less than watermark",lr)),ri.ended||ri.reading?(lr=!1,d("reading or ended",lr)):lr&&(d("do read"),ri.reading=!0,ri.sync=!0,ri.length===0&&(ri.needReadable=!0),this._read(ri.highWaterMark),ri.sync=!1,ri.reading||(ni=kt(ui,ri)));var ar;return ni>0?ar=_(ni,ri):ar=null,ar===null?(ri.needReadable=!0,ni=0):ri.length-=ni,ri.length===0&&(ri.ended||(ri.needReadable=!0),ui!==ni&&ri.ended&&rn(this)),ar!==null&&this.emit("data",ar),ar};function nr(ni,ri){if(!ri.ended){if(ri.decoder){var ui=ri.decoder.end();ui&&ui.length&&(ri.buffer.push(ui),ri.length+=ri.objectMode?1:ui.length)}ri.ended=!0,sr(ni)}}function sr(ni){var ri=ni._readableState;ri.needReadable=!1,ri.emittedReadable||(d("emitReadable",ri.flowing),ri.emittedReadable=!0,ri.sync?e.nextTick(ce,ni):ce(ni))}function ce(ni){d("emit readable"),ni.emit("readable"),L(ni)}function Ze(ni,ri){ri.readingMore||(ri.readingMore=!0,e.nextTick(se,ni,ri))}function se(ni,ri){for(var ui=ri.length;!ri.reading&&!ri.flowing&&!ri.ended&&ri.length<ri.highWaterMark&&(d("maybeReadMore read 0"),ni.read(0),ui!==ri.length);)ui=ri.length;ri.readingMore=!1}E.prototype._read=function(ni){this.emit("error",new Error("_read() is not implemented"))},E.prototype.pipe=function(ni,ri){var ui=this,lr=this._readableState;switch(lr.pipesCount){case 0:lr.pipes=ni;break;case 1:lr.pipes=[lr.pipes,ni];break;default:lr.pipes.push(ni);break}lr.pipesCount+=1,d("pipe count=%d opts=%j",lr.pipesCount,ri);var ar=(!ri||ri.end!==!1)&&ni!==process.stdout&&ni!==process.stderr,jr=ar?mi:qi;lr.endEmitted?e.nextTick(jr):ui.once("end",jr),ni.on("unpipe",ci);function ci(vn,di){d("onunpipe"),vn===ui&&di&&di.hasUnpiped===!1&&(di.hasUnpiped=!0,Gr())}function mi(){d("onend"),ni.end()}var pi=vt(ui);ni.on("drain",pi);var ei=!1;function Gr(){d("cleanup"),ni.removeListener("close",Ai),ni.removeListener("finish",Bi),ni.removeListener("drain",pi),ni.removeListener("error",bi),ni.removeListener("unpipe",ci),ui.removeListener("end",mi),ui.removeListener("end",qi),ui.removeListener("data",fi),ei=!0,lr.awaitDrain&&(!ni._writableState||ni._writableState.needDrain)&&pi()}var ti=!1;ui.on("data",fi);function fi(vn){d("ondata"),ti=!1;var di=ni.write(vn);di===!1&&!ti&&((lr.pipesCount===1&&lr.pipes===ni||lr.pipesCount>1&&ai(lr.pipes,ni)!==-1)&&!ei&&(d("false write response, pause",lr.awaitDrain),lr.awaitDrain++,ti=!0),ui.pause())}function bi(vn){d("onerror",vn),qi(),ni.removeListener("error",bi),n(ni,"error")===0&&ni.emit("error",vn)}w(ni,"error",bi);function Ai(){ni.removeListener("finish",Bi),qi()}ni.once("close",Ai);function Bi(){d("onfinish"),ni.removeListener("close",Ai),qi()}ni.once("finish",Bi);function qi(){d("unpipe"),ui.unpipe(ni)}return ni.emit("pipe",ui),lr.flowing||(d("pipe resume"),ui.resume()),ni};function vt(ni){return function(){var ri=ni._readableState;d("pipeOnDrain",ri.awaitDrain),ri.awaitDrain&&ri.awaitDrain--,ri.awaitDrain===0&&n(ni,"data")&&(ri.flowing=!0,L(ni))}}E.prototype.unpipe=function(ni){var ri=this._readableState,ui={hasUnpiped:!1};if(ri.pipesCount===0)return this;if(ri.pipesCount===1)return ni&&ni!==ri.pipes?this:(ni||(ni=ri.pipes),ri.pipes=null,ri.pipesCount=0,ri.flowing=!1,ni&&ni.emit("unpipe",this,ui),this);if(!ni){var lr=ri.pipes,ar=ri.pipesCount;ri.pipes=null,ri.pipesCount=0,ri.flowing=!1;for(var jr=0;jr<ar;jr++)lr[jr].emit("unpipe",this,{hasUnpiped:!1});return this}var ci=ai(ri.pipes,ni);return ci===-1?this:(ri.pipes.splice(ci,1),ri.pipesCount-=1,ri.pipesCount===1&&(ri.pipes=ri.pipes[0]),ni.emit("unpipe",this,ui),this)},E.prototype.on=function(ni,ri){var ui=o.prototype.on.call(this,ni,ri);if(ni==="data")this._readableState.flowing!==!1&&this.resume();else if(ni==="readable"){var lr=this._readableState;!lr.endEmitted&&!lr.readableListening&&(lr.readableListening=lr.needReadable=!0,lr.emittedReadable=!1,lr.reading?lr.length&&sr(this):e.nextTick(ur,this))}return ui},E.prototype.addListener=E.prototype.on;function ur(ni){d("readable nexttick read 0"),ni.read(0)}E.prototype.resume=function(){var ni=this._readableState;return ni.flowing||(d("resume"),ni.flowing=!0,ue(this,ni)),this};function ue(ni,ri){ri.resumeScheduled||(ri.resumeScheduled=!0,e.nextTick(bt,ni,ri))}function bt(ni,ri){ri.reading||(d("resume read 0"),ni.read(0)),ri.resumeScheduled=!1,ri.awaitDrain=0,ni.emit("resume"),L(ni),ri.flowing&&!ri.reading&&ni.read(0)}E.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function L(ni){var ri=ni._readableState;for(d("flow",ri.flowing);ri.flowing&&ni.read()!==null;);}E.prototype.wrap=function(ni){var ri=this,ui=this._readableState,lr=!1;ni.on("end",function(){if(d("wrapped end"),ui.decoder&&!ui.ended){var ci=ui.decoder.end();ci&&ci.length&&ri.push(ci)}ri.push(null)}),ni.on("data",function(ci){if(d("wrapped data"),ui.decoder&&(ci=ui.decoder.write(ci)),!(ui.objectMode&&ci==null)&&!(!ui.objectMode&&(!ci||!ci.length))){var mi=ri.push(ci);mi||(lr=!0,ni.pause())}});for(var ar in ni)this[ar]===void 0&&typeof ni[ar]=="function"&&(this[ar]=(function(ci){return function(){return ni[ci].apply(ni,arguments)}})(ar));for(var jr=0;jr<b.length;jr++)ni.on(b[jr],this.emit.bind(this,b[jr]));return this._read=function(ci){d("wrapped _read",ci),lr&&(lr=!1,ni.resume())},this},Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),E._fromList=_;function _(ni,ri){if(ri.length===0)return null;var ui;return ri.objectMode?ui=ri.buffer.shift():!ni||ni>=ri.length?(ri.decoder?ui=ri.buffer.join(""):ri.buffer.length===1?ui=ri.buffer.head.data:ui=ri.buffer.concat(ri.length),ri.buffer.clear()):ui=F(ni,ri.buffer,ri.decoder),ui}function F(ni,ri,ui){var lr;return ni<ri.head.data.length?(lr=ri.head.data.slice(0,ni),ri.head.data=ri.head.data.slice(ni)):ni===ri.head.data.length?lr=ri.shift():lr=ui?k(ni,ri):Ye(ni,ri),lr}function k(ni,ri){var ui=ri.head,lr=1,ar=ui.data;for(ni-=ar.length;ui=ui.next;){var jr=ui.data,ci=ni>jr.length?jr.length:ni;if(ci===jr.length?ar+=jr:ar+=jr.slice(0,ni),ni-=ci,ni===0){ci===jr.length?(++lr,ui.next?ri.head=ui.next:ri.head=ri.tail=null):(ri.head=ui,ui.data=jr.slice(ci));break}++lr}return ri.length-=lr,ar}function Ye(ni,ri){var ui=i.allocUnsafe(ni),lr=ri.head,ar=1;for(lr.data.copy(ui),ni-=lr.data.length;lr=lr.next;){var jr=lr.data,ci=ni>jr.length?jr.length:ni;if(jr.copy(ui,ui.length-ni,0,ci),ni-=ci,ni===0){ci===jr.length?(++ar,lr.next?ri.head=lr.next:ri.head=ri.tail=null):(ri.head=lr,lr.data=jr.slice(ci));break}++ar}return ri.length-=ar,ui}function rn(ni){var ri=ni._readableState;if(ri.length>0)throw new Error('"endReadable()" called on non-empty stream');ri.endEmitted||(ri.ended=!0,e.nextTick(ii,ri,ni))}function ii(ni,ri){!ni.endEmitted&&ni.length===0&&(ni.endEmitted=!0,ri.readable=!1,ri.emit("end"))}function ai(ni,ri){for(var ui=0,lr=ni.length;ui<lr;ui++)if(ni[ui]===ri)return ui;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=n;var e=require_stream_duplex$1(),t=Object.create(requireUtil());t.inherits=requireInherits_browser(),t.inherits(n,e);function r(u,a){var s=this._transformState;s.transforming=!1;var f=s.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,a!=null&&this.push(a),f(u);var c=this._readableState;c.reading=!1,(c.needReadable||c.length<c.highWaterMark)&&this._read(c.highWaterMark)}function n(u){if(!(this instanceof n))return new n(u);e.call(this,u),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",o)}function o(){var u=this;typeof this._flush=="function"?this._flush(function(a,s){i(u,a,s)}):i(this,null,null)}n.prototype.push=function(u,a){return this._transformState.needTransform=!1,e.prototype.push.call(this,u,a)},n.prototype._transform=function(u,a,s){throw new Error("_transform() is not implemented")},n.prototype._write=function(u,a,s){var f=this._transformState;if(f.writecb=s,f.writechunk=u,f.writeencoding=a,!f.transforming){var c=this._readableState;(f.needTransform||c.needReadable||c.length<c.highWaterMark)&&this._read(c.highWaterMark)}},n.prototype._read=function(u){var a=this._transformState;a.writechunk!==null&&a.writecb&&!a.transforming?(a.transforming=!0,this._transform(a.writechunk,a.writeencoding,a.afterTransform)):a.needTransform=!0},n.prototype._destroy=function(u,a){var s=this;e.prototype._destroy.call(this,u,function(f){a(f),s.emit("close")})};function i(u,a,s){if(a)return u.emit("error",a);if(s!=null&&u.push(s),u._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(u._transformState.transforming)throw new Error("Calling transform done when still transforming");return u.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=r;var e=require_stream_transform$1(),t=Object.create(requireUtil());t.inherits=requireInherits_browser(),t.inherits(r,e);function r(n){if(!(this instanceof r))return new r(n);e.call(this,n)}return r.prototype._transform=function(n,o,i){i(null,n)},_stream_passthrough$1}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,(function(e,t){t=e.exports=require_stream_readable$1(),t.Stream=t,t.Readable=t,t.Writable=require_stream_writable$1(),t.Duplex=require_stream_duplex$1(),t.Transform=require_stream_transform$1(),t.PassThrough=require_stream_passthrough$1()})(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var e=requireSafeBuffer$1().Buffer,t=requireToBuffer$1(),r=requireReadableBrowser().Transform,n=requireInherits_browser();function o(i){r.call(this),this._block=e.allocUnsafe(i),this._blockSize=i,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return n(o,r),o.prototype._transform=function(i,u,a){var s=null;try{this.update(i,u)}catch(f){s=f}a(s)},o.prototype._flush=function(i){var u=null;try{this.push(this.digest())}catch(a){u=a}i(u)},o.prototype.update=function(i,u){if(this._finalized)throw new Error("Digest already called");for(var a=t(i,u),s=this._block,f=0;this._blockOffset+a.length-f>=this._blockSize;){for(var c=this._blockOffset;c<this._blockSize;)s[c]=a[f],c+=1,f+=1;this._update(),this._blockOffset=0}for(;f<a.length;)s[this._blockOffset]=a[f],this._blockOffset+=1,f+=1;for(var d=0,p=a.length*8;p>0;++d)this._length[d]+=p,p=this._length[d]/4294967296|0,p>0&&(this._length[d]-=4294967296*p);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(i){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var u=this._digest();i!==void 0&&(u=u.toString(i)),this._block.fill(0),this._blockOffset=0;for(var a=0;a<4;++a)this._length[a]=0;return u},o.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=o,hashBase}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var e=requireInherits_browser(),t=requireHashBase(),r=requireSafeBuffer$1().Buffer,n=new Array(16);function o(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}e(o,t),o.prototype._update=function(){for(var c=n,d=0;d<16;++d)c[d]=this._block.readInt32LE(d*4);var p=this._a,h=this._b,y=this._c,b=this._d;p=u(p,h,y,b,c[0],3614090360,7),b=u(b,p,h,y,c[1],3905402710,12),y=u(y,b,p,h,c[2],606105819,17),h=u(h,y,b,p,c[3],3250441966,22),p=u(p,h,y,b,c[4],4118548399,7),b=u(b,p,h,y,c[5],1200080426,12),y=u(y,b,p,h,c[6],2821735955,17),h=u(h,y,b,p,c[7],4249261313,22),p=u(p,h,y,b,c[8],1770035416,7),b=u(b,p,h,y,c[9],2336552879,12),y=u(y,b,p,h,c[10],4294925233,17),h=u(h,y,b,p,c[11],2304563134,22),p=u(p,h,y,b,c[12],1804603682,7),b=u(b,p,h,y,c[13],4254626195,12),y=u(y,b,p,h,c[14],2792965006,17),h=u(h,y,b,p,c[15],1236535329,22),p=a(p,h,y,b,c[1],4129170786,5),b=a(b,p,h,y,c[6],3225465664,9),y=a(y,b,p,h,c[11],643717713,14),h=a(h,y,b,p,c[0],3921069994,20),p=a(p,h,y,b,c[5],3593408605,5),b=a(b,p,h,y,c[10],38016083,9),y=a(y,b,p,h,c[15],3634488961,14),h=a(h,y,b,p,c[4],3889429448,20),p=a(p,h,y,b,c[9],568446438,5),b=a(b,p,h,y,c[14],3275163606,9),y=a(y,b,p,h,c[3],4107603335,14),h=a(h,y,b,p,c[8],1163531501,20),p=a(p,h,y,b,c[13],2850285829,5),b=a(b,p,h,y,c[2],4243563512,9),y=a(y,b,p,h,c[7],1735328473,14),h=a(h,y,b,p,c[12],2368359562,20),p=s(p,h,y,b,c[5],4294588738,4),b=s(b,p,h,y,c[8],2272392833,11),y=s(y,b,p,h,c[11],1839030562,16),h=s(h,y,b,p,c[14],4259657740,23),p=s(p,h,y,b,c[1],2763975236,4),b=s(b,p,h,y,c[4],1272893353,11),y=s(y,b,p,h,c[7],4139469664,16),h=s(h,y,b,p,c[10],3200236656,23),p=s(p,h,y,b,c[13],681279174,4),b=s(b,p,h,y,c[0],3936430074,11),y=s(y,b,p,h,c[3],3572445317,16),h=s(h,y,b,p,c[6],76029189,23),p=s(p,h,y,b,c[9],3654602809,4),b=s(b,p,h,y,c[12],3873151461,11),y=s(y,b,p,h,c[15],530742520,16),h=s(h,y,b,p,c[2],3299628645,23),p=f(p,h,y,b,c[0],4096336452,6),b=f(b,p,h,y,c[7],1126891415,10),y=f(y,b,p,h,c[14],2878612391,15),h=f(h,y,b,p,c[5],4237533241,21),p=f(p,h,y,b,c[12],1700485571,6),b=f(b,p,h,y,c[3],2399980690,10),y=f(y,b,p,h,c[10],4293915773,15),h=f(h,y,b,p,c[1],2240044497,21),p=f(p,h,y,b,c[8],1873313359,6),b=f(b,p,h,y,c[15],4264355552,10),y=f(y,b,p,h,c[6],2734768916,15),h=f(h,y,b,p,c[13],1309151649,21),p=f(p,h,y,b,c[4],4149444226,6),b=f(b,p,h,y,c[11],3174756917,10),y=f(y,b,p,h,c[2],718787259,15),h=f(h,y,b,p,c[9],3951481745,21),this._a=this._a+p|0,this._b=this._b+h|0,this._c=this._c+y|0,this._d=this._d+b|0},o.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 c=r.allocUnsafe(16);return c.writeInt32LE(this._a,0),c.writeInt32LE(this._b,4),c.writeInt32LE(this._c,8),c.writeInt32LE(this._d,12),c};function i(c,d){return c<<d|c>>>32-d}function u(c,d,p,h,y,b,w){return i(c+(d&p|~d&h)+y+b|0,w)+d|0}function a(c,d,p,h,y,b,w){return i(c+(d&h|p&~h)+y+b|0,w)+d|0}function s(c,d,p,h,y,b,w){return i(c+(d^p^h)+y+b|0,w)+d|0}function f(c,d,p,h,y,b,w){return i(c+(p^(d|~h))+y+b|0,w)+d|0}return md5_js=o,md5_js}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var e=requireBuffer$1().Buffer,t=requireInherits_browser(),r=requireHashBase(),n=new Array(16),o=[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],i=[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],u=[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],a=[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],s=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function c(S,E){return S<<E|S>>>32-E}function d(S,E,B,ae,W,J,ve,Qe){return c(S+(E^B^ae)+J+ve|0,Qe)+W|0}function p(S,E,B,ae,W,J,ve,Qe){return c(S+(E&B|~E&ae)+J+ve|0,Qe)+W|0}function h(S,E,B,ae,W,J,ve,Qe){return c(S+((E|~B)^ae)+J+ve|0,Qe)+W|0}function y(S,E,B,ae,W,J,ve,Qe){return c(S+(E&ae|B&~ae)+J+ve|0,Qe)+W|0}function b(S,E,B,ae,W,J,ve,Qe){return c(S+(E^(B|~ae))+J+ve|0,Qe)+W|0}function w(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return t(w,r),w.prototype._update=function(){for(var S=n,E=0;E<16;++E)S[E]=this._block.readInt32LE(E*4);for(var B=this._a|0,ae=this._b|0,W=this._c|0,J=this._d|0,ve=this._e|0,Qe=this._a|0,kt=this._b|0,nr=this._c|0,sr=this._d|0,ce=this._e|0,Ze=0;Ze<80;Ze+=1){var se,vt;Ze<16?(se=d(B,ae,W,J,ve,S[o[Ze]],s[0],u[Ze]),vt=b(Qe,kt,nr,sr,ce,S[i[Ze]],f[0],a[Ze])):Ze<32?(se=p(B,ae,W,J,ve,S[o[Ze]],s[1],u[Ze]),vt=y(Qe,kt,nr,sr,ce,S[i[Ze]],f[1],a[Ze])):Ze<48?(se=h(B,ae,W,J,ve,S[o[Ze]],s[2],u[Ze]),vt=h(Qe,kt,nr,sr,ce,S[i[Ze]],f[2],a[Ze])):Ze<64?(se=y(B,ae,W,J,ve,S[o[Ze]],s[3],u[Ze]),vt=p(Qe,kt,nr,sr,ce,S[i[Ze]],f[3],a[Ze])):(se=b(B,ae,W,J,ve,S[o[Ze]],s[4],u[Ze]),vt=d(Qe,kt,nr,sr,ce,S[i[Ze]],f[4],a[Ze])),B=ve,ve=J,J=c(W,10),W=ae,ae=se,Qe=ce,ce=sr,sr=c(nr,10),nr=kt,kt=vt}var ur=this._b+W+sr|0;this._b=this._c+J+ce|0,this._c=this._d+ve+Qe|0,this._d=this._e+B+kt|0,this._e=this._a+ae+nr|0,this._a=ur},w.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 S=e.alloc?e.alloc(20):new e(20);return S.writeInt32LE(this._a,0),S.writeInt32LE(this._b,4),S.writeInt32LE(this._c,8),S.writeInt32LE(this._d,12),S.writeInt32LE(this._e,16),S},ripemd160=w,ripemd160}var sha_js={exports:{}},hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var e=requireSafeBuffer$1().Buffer,t=requireToBuffer$2();function r(n,o){this._block=e.alloc(n),this._finalSize=o,this._blockSize=n,this._len=0}return r.prototype.update=function(n,o){n=t(n,o||"utf8");for(var i=this._block,u=this._blockSize,a=n.length,s=this._len,f=0;f<a;){for(var c=s%u,d=Math.min(a-f,u-c),p=0;p<d;p++)i[c+p]=n[f+p];s+=d,f+=d,s%u===0&&this._update(i)}return this._len+=a,this},r.prototype.digest=function(n){var o=this._len%this._blockSize;this._block[o]=128,this._block.fill(0,o+1),o>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=this._len*8;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var u=(i&4294967295)>>>0,a=(i-u)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(u,this._blockSize-4)}this._update(this._block);var s=this._hash();return n?s.toString(n):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=r,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$1().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function i(){this.init(),this._w=o,t.call(this,64,56)}e(i,t),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(f){return f<<5|f>>>27}function a(f){return f<<30|f>>>2}function s(f,c,d,p){return f===0?c&d|~c&p:f===2?c&d|c&p|d&p:c^d^p}return i.prototype._update=function(f){for(var c=this._w,d=this._a|0,p=this._b|0,h=this._c|0,y=this._d|0,b=this._e|0,w=0;w<16;++w)c[w]=f.readInt32BE(w*4);for(;w<80;++w)c[w]=c[w-3]^c[w-8]^c[w-14]^c[w-16];for(var S=0;S<80;++S){var E=~~(S/20),B=u(d)+s(E,p,h,y)+b+c[S]+n[E]|0;b=y,y=h,h=a(p),p=d,d=B}this._a=d+this._a|0,this._b=p+this._b|0,this._c=h+this._c|0,this._d=y+this._d|0,this._e=b+this._e|0},i.prototype._hash=function(){var f=r.allocUnsafe(20);return f.writeInt32BE(this._a|0,0),f.writeInt32BE(this._b|0,4),f.writeInt32BE(this._c|0,8),f.writeInt32BE(this._d|0,12),f.writeInt32BE(this._e|0,16),f},sha$1=i,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$1().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function i(){this.init(),this._w=o,t.call(this,64,56)}e(i,t),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(c){return c<<1|c>>>31}function a(c){return c<<5|c>>>27}function s(c){return c<<30|c>>>2}function f(c,d,p,h){return c===0?d&p|~d&h:c===2?d&p|d&h|p&h:d^p^h}return i.prototype._update=function(c){for(var d=this._w,p=this._a|0,h=this._b|0,y=this._c|0,b=this._d|0,w=this._e|0,S=0;S<16;++S)d[S]=c.readInt32BE(S*4);for(;S<80;++S)d[S]=u(d[S-3]^d[S-8]^d[S-14]^d[S-16]);for(var E=0;E<80;++E){var B=~~(E/20),ae=a(p)+f(B,h,y,b)+w+d[E]+n[B]|0;w=b,b=y,y=s(h),h=p,p=ae}this._a=p+this._a|0,this._b=h+this._b|0,this._c=y+this._c|0,this._d=b+this._d|0,this._e=w+this._e|0},i.prototype._hash=function(){var c=r.allocUnsafe(20);return c.writeInt32BE(this._a|0,0),c.writeInt32BE(this._b|0,4),c.writeInt32BE(this._c|0,8),c.writeInt32BE(this._d|0,12),c.writeInt32BE(this._e|0,16),c},sha1=i,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$1().Buffer,n=[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],o=new Array(64);function i(){this.init(),this._w=o,t.call(this,64,56)}e(i,t),i.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 u(p,h,y){return y^p&(h^y)}function a(p,h,y){return p&h|y&(p|h)}function s(p){return(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10)}function f(p){return(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7)}function c(p){return(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3}function d(p){return(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10}return i.prototype._update=function(p){for(var h=this._w,y=this._a|0,b=this._b|0,w=this._c|0,S=this._d|0,E=this._e|0,B=this._f|0,ae=this._g|0,W=this._h|0,J=0;J<16;++J)h[J]=p.readInt32BE(J*4);for(;J<64;++J)h[J]=d(h[J-2])+h[J-7]+c(h[J-15])+h[J-16]|0;for(var ve=0;ve<64;++ve){var Qe=W+f(E)+u(E,B,ae)+n[ve]+h[ve]|0,kt=s(y)+a(y,b,w)|0;W=ae,ae=B,B=E,E=S+Qe|0,S=w,w=b,b=y,y=Qe+kt|0}this._a=y+this._a|0,this._b=b+this._b|0,this._c=w+this._c|0,this._d=S+this._d|0,this._e=E+this._e|0,this._f=B+this._f|0,this._g=ae+this._g|0,this._h=W+this._h|0},i.prototype._hash=function(){var p=r.allocUnsafe(32);return p.writeInt32BE(this._a,0),p.writeInt32BE(this._b,4),p.writeInt32BE(this._c,8),p.writeInt32BE(this._d,12),p.writeInt32BE(this._e,16),p.writeInt32BE(this._f,20),p.writeInt32BE(this._g,24),p.writeInt32BE(this._h,28),p},sha256$1=i,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var e=requireInherits_browser(),t=requireSha256(),r=requireHash$1(),n=requireSafeBuffer$1().Buffer,o=new Array(64);function i(){this.init(),this._w=o,r.call(this,64,56)}return e(i,t),i.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},i.prototype._hash=function(){var u=n.allocUnsafe(28);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u},sha224$1=i,sha224$1}var sha512$3,hasRequiredSha512$1;function requireSha512$1(){if(hasRequiredSha512$1)return sha512$3;hasRequiredSha512$1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$1().Buffer,n=[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],o=new Array(160);function i(){this.init(),this._w=o,t.call(this,128,112)}e(i,t),i.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 u(b,w,S){return S^b&(w^S)}function a(b,w,S){return b&w|S&(b|w)}function s(b,w){return(b>>>28|w<<4)^(w>>>2|b<<30)^(w>>>7|b<<25)}function f(b,w){return(b>>>14|w<<18)^(b>>>18|w<<14)^(w>>>9|b<<23)}function c(b,w){return(b>>>1|w<<31)^(b>>>8|w<<24)^b>>>7}function d(b,w){return(b>>>1|w<<31)^(b>>>8|w<<24)^(b>>>7|w<<25)}function p(b,w){return(b>>>19|w<<13)^(w>>>29|b<<3)^b>>>6}function h(b,w){return(b>>>19|w<<13)^(w>>>29|b<<3)^(b>>>6|w<<26)}function y(b,w){return b>>>0<w>>>0?1:0}return i.prototype._update=function(b){for(var w=this._w,S=this._ah|0,E=this._bh|0,B=this._ch|0,ae=this._dh|0,W=this._eh|0,J=this._fh|0,ve=this._gh|0,Qe=this._hh|0,kt=this._al|0,nr=this._bl|0,sr=this._cl|0,ce=this._dl|0,Ze=this._el|0,se=this._fl|0,vt=this._gl|0,ur=this._hl|0,ue=0;ue<32;ue+=2)w[ue]=b.readInt32BE(ue*4),w[ue+1]=b.readInt32BE(ue*4+4);for(;ue<160;ue+=2){var bt=w[ue-30],L=w[ue-30+1],_=c(bt,L),F=d(L,bt);bt=w[ue-4],L=w[ue-4+1];var k=p(bt,L),Ye=h(L,bt),rn=w[ue-14],ii=w[ue-14+1],ai=w[ue-32],ni=w[ue-32+1],ri=F+ii|0,ui=_+rn+y(ri,F)|0;ri=ri+Ye|0,ui=ui+k+y(ri,Ye)|0,ri=ri+ni|0,ui=ui+ai+y(ri,ni)|0,w[ue]=ui,w[ue+1]=ri}for(var lr=0;lr<160;lr+=2){ui=w[lr],ri=w[lr+1];var ar=a(S,E,B),jr=a(kt,nr,sr),ci=s(S,kt),mi=s(kt,S),pi=f(W,Ze),ei=f(Ze,W),Gr=n[lr],ti=n[lr+1],fi=u(W,J,ve),bi=u(Ze,se,vt),Ai=ur+ei|0,Bi=Qe+pi+y(Ai,ur)|0;Ai=Ai+bi|0,Bi=Bi+fi+y(Ai,bi)|0,Ai=Ai+ti|0,Bi=Bi+Gr+y(Ai,ti)|0,Ai=Ai+ri|0,Bi=Bi+ui+y(Ai,ri)|0;var qi=mi+jr|0,vn=ci+ar+y(qi,mi)|0;Qe=ve,ur=vt,ve=J,vt=se,J=W,se=Ze,Ze=ce+Ai|0,W=ae+Bi+y(Ze,ce)|0,ae=B,ce=sr,B=E,sr=nr,E=S,nr=kt,kt=Ai+qi|0,S=Bi+vn+y(kt,Ai)|0}this._al=this._al+kt|0,this._bl=this._bl+nr|0,this._cl=this._cl+sr|0,this._dl=this._dl+ce|0,this._el=this._el+Ze|0,this._fl=this._fl+se|0,this._gl=this._gl+vt|0,this._hl=this._hl+ur|0,this._ah=this._ah+S+y(this._al,kt)|0,this._bh=this._bh+E+y(this._bl,nr)|0,this._ch=this._ch+B+y(this._cl,sr)|0,this._dh=this._dh+ae+y(this._dl,ce)|0,this._eh=this._eh+W+y(this._el,Ze)|0,this._fh=this._fh+J+y(this._fl,se)|0,this._gh=this._gh+ve+y(this._gl,vt)|0,this._hh=this._hh+Qe+y(this._hl,ur)|0},i.prototype._hash=function(){var b=r.allocUnsafe(64);function w(S,E,B){b.writeInt32BE(S,B),b.writeInt32BE(E,B+4)}return w(this._ah,this._al,0),w(this._bh,this._bl,8),w(this._ch,this._cl,16),w(this._dh,this._dl,24),w(this._eh,this._el,32),w(this._fh,this._fl,40),w(this._gh,this._gl,48),w(this._hh,this._hl,56),b},sha512$3=i,sha512$3}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var e=requireInherits_browser(),t=requireSha512$1(),r=requireHash$1(),n=requireSafeBuffer$1().Buffer,o=new Array(160);function i(){this.init(),this._w=o,r.call(this,128,112)}return e(i,t),i.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},i.prototype._hash=function(){var u=n.allocUnsafe(48);function a(s,f,c){u.writeInt32BE(s,c),u.writeInt32BE(f,c+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),u},sha384$1=i,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(function(e){e.exports=function(r){var n=r.toLowerCase(),o=e.exports[n];if(!o)throw new Error(n+" is not supported (we accept pull requests)");return new o},e.exports.sha=requireSha$1(),e.exports.sha1=requireSha1(),e.exports.sha224=requireSha224(),e.exports.sha256=requireSha256(),e.exports.sha384=requireSha384(),e.exports.sha512=requireSha512$1()})(sha_js)),sha_js.exports}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function e(y,b){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(y);b&&(S=S.filter(function(E){return Object.getOwnPropertyDescriptor(y,E).enumerable})),w.push.apply(w,S)}return w}function t(y){for(var b=1;b<arguments.length;b++){var w=arguments[b]!=null?arguments[b]:{};b%2?e(Object(w),!0).forEach(function(S){r(y,S,w[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(w)):e(Object(w)).forEach(function(S){Object.defineProperty(y,S,Object.getOwnPropertyDescriptor(w,S))})}return y}function r(y,b,w){return b=u(b),b in y?Object.defineProperty(y,b,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[b]=w,y}function n(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function o(y,b){for(var w=0;w<b.length;w++){var S=b[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,u(S.key),S)}}function i(y,b,w){return b&&o(y.prototype,b),Object.defineProperty(y,"prototype",{writable:!1}),y}function u(y){var b=a(y,"string");return typeof b=="symbol"?b:String(b)}function a(y,b){if(typeof y!="object"||y===null)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var S=w.call(y,b);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(y)}var s=requireBuffer$1(),f=s.Buffer,c=requireUtil$1(),d=c.inspect,p=d&&d.custom||"inspect";function h(y,b,w){f.prototype.copy.call(y,b,w)}return buffer_list=(function(){function y(){n(this,y),this.head=null,this.tail=null,this.length=0}return i(y,[{key:"push",value:function(w){var S={data:w,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length}},{key:"unshift",value:function(w){var S={data:w,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var S=this.head,E=""+S.data;S=S.next;)E+=w+S.data;return E}},{key:"concat",value:function(w){if(this.length===0)return f.alloc(0);for(var S=f.allocUnsafe(w>>>0),E=this.head,B=0;E;)h(E.data,S,B),B+=E.data.length,E=E.next;return S}},{key:"consume",value:function(w,S){var E;return w<this.head.data.length?(E=this.head.data.slice(0,w),this.head.data=this.head.data.slice(w)):w===this.head.data.length?E=this.shift():E=S?this._getString(w):this._getBuffer(w),E}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(w){var S=this.head,E=1,B=S.data;for(w-=B.length;S=S.next;){var ae=S.data,W=w>ae.length?ae.length:w;if(W===ae.length?B+=ae:B+=ae.slice(0,w),w-=W,w===0){W===ae.length?(++E,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=ae.slice(W));break}++E}return this.length-=E,B}},{key:"_getBuffer",value:function(w){var S=f.allocUnsafe(w),E=this.head,B=1;for(E.data.copy(S),w-=E.data.length;E=E.next;){var ae=E.data,W=w>ae.length?ae.length:w;if(ae.copy(S,S.length-w,0,W),w-=W,w===0){W===ae.length?(++B,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=ae.slice(W));break}++B}return this.length-=B,S}},{key:p,value:function(w,S){return d(this,t(t({},S),{},{depth:0,customInspect:!1}))}}]),y})(),buffer_list}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;function e(u,a){var s=this,f=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return f||c?(a?a(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,u)):process.nextTick(o,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(d){!a&&d?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,d)):process.nextTick(t,s,d):a?(process.nextTick(r,s),a(d)):process.nextTick(r,s)}),this)}function t(u,a){o(u,a),r(u)}function r(u){u._writableState&&!u._writableState.emitClose||u._readableState&&!u._readableState.emitClose||u.emit("close")}function n(){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 o(u,a){u.emit("error",a)}function i(u,a){var s=u._readableState,f=u._writableState;s&&s.autoDestroy||f&&f.autoDestroy?u.destroy(a):u.emit("error",a)}return destroy_1={destroy:e,undestroy:n,errorOrDestroy:i},destroy_1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function e(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.__proto__=s}var t={};function r(a,s,f){f||(f=Error);function c(p,h,y){return typeof s=="string"?s:s(p,h,y)}var d=(function(p){e(h,p);function h(y,b,w){return p.call(this,c(y,b,w))||this}return h})(f);d.prototype.name=f.name,d.prototype.code=a,t[a]=d}function n(a,s){if(Array.isArray(a)){var f=a.length;return a=a.map(function(c){return String(c)}),f>2?"one of ".concat(s," ").concat(a.slice(0,f-1).join(", "),", or ")+a[f-1]:f===2?"one of ".concat(s," ").concat(a[0]," or ").concat(a[1]):"of ".concat(s," ").concat(a[0])}else return"of ".concat(s," ").concat(String(a))}function o(a,s,f){return a.substr(0,s.length)===s}function i(a,s,f){return(f===void 0||f>a.length)&&(f=a.length),a.substring(f-s.length,f)===s}function u(a,s,f){return typeof f!="number"&&(f=0),f+s.length>a.length?!1:a.indexOf(s,f)!==-1}return r("ERR_INVALID_OPT_VALUE",function(a,s){return'The value "'+s+'" is invalid for option "'+a+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(a,s,f){var c;typeof s=="string"&&o(s,"not ")?(c="must not be",s=s.replace(/^not /,"")):c="must be";var d;if(i(a," argument"))d="The ".concat(a," ").concat(c," ").concat(n(s,"type"));else{var p=u(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(p," ").concat(c," ").concat(n(s,"type"))}return d+=". Received type ".concat(typeof f),d},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=t,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function t(n,o,i){return n.highWaterMark!=null?n.highWaterMark:o?n[i]:null}function r(n,o,i,u){var a=t(o,u,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var s=u?i:"highWaterMark";throw new e(s,a)}return Math.floor(a)}return n.objectMode?16:16*1024}return state={getHighWaterMark:r},state}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=Qe;function e(ai){var ni=this;this.next=null,this.entry=null,this.finish=function(){ii(ni,ai)}}var t;Qe.WritableState=J;var r={deprecate:requireBrowser$a()},n=requireStreamBrowser(),o=requireBuffer$1().Buffer,i=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(ai){return o.from(ai)}function a(ai){return o.isBuffer(ai)||ai instanceof i}var s=requireDestroy(),f=requireState(),c=f.getHighWaterMark,d=requireErrorsBrowser().codes,p=d.ERR_INVALID_ARG_TYPE,h=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,w=d.ERR_STREAM_DESTROYED,S=d.ERR_STREAM_NULL_VALUES,E=d.ERR_STREAM_WRITE_AFTER_END,B=d.ERR_UNKNOWN_ENCODING,ae=s.errorOrDestroy;requireInherits_browser()(Qe,n);function W(){}function J(ai,ni,ri){t=t||require_stream_duplex(),ai=ai||{},typeof ri!="boolean"&&(ri=ni instanceof t),this.objectMode=!!ai.objectMode,ri&&(this.objectMode=this.objectMode||!!ai.writableObjectMode),this.highWaterMark=c(this,ai,"writableHighWaterMark",ri),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ui=ai.decodeStrings===!1;this.decodeStrings=!ui,this.defaultEncoding=ai.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(lr){ur(ni,lr)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ai.emitClose!==!1,this.autoDestroy=!!ai.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}J.prototype.getBuffer=function(){for(var ni=this.bufferedRequest,ri=[];ni;)ri.push(ni),ni=ni.next;return ri},(function(){try{Object.defineProperty(J.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var ve;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ve=Function.prototype[Symbol.hasInstance],Object.defineProperty(Qe,Symbol.hasInstance,{value:function(ni){return ve.call(this,ni)?!0:this!==Qe?!1:ni&&ni._writableState instanceof J}})):ve=function(ni){return ni instanceof this};function Qe(ai){t=t||require_stream_duplex();var ni=this instanceof t;if(!ni&&!ve.call(Qe,this))return new Qe(ai);this._writableState=new J(ai,this,ni),this.writable=!0,ai&&(typeof ai.write=="function"&&(this._write=ai.write),typeof ai.writev=="function"&&(this._writev=ai.writev),typeof ai.destroy=="function"&&(this._destroy=ai.destroy),typeof ai.final=="function"&&(this._final=ai.final)),n.call(this)}Qe.prototype.pipe=function(){ae(this,new b)};function kt(ai,ni){var ri=new E;ae(ai,ri),process.nextTick(ni,ri)}function nr(ai,ni,ri,ui){var lr;return ri===null?lr=new S:typeof ri!="string"&&!ni.objectMode&&(lr=new p("chunk",["string","Buffer"],ri)),lr?(ae(ai,lr),process.nextTick(ui,lr),!1):!0}Qe.prototype.write=function(ai,ni,ri){var ui=this._writableState,lr=!1,ar=!ui.objectMode&&a(ai);return ar&&!o.isBuffer(ai)&&(ai=u(ai)),typeof ni=="function"&&(ri=ni,ni=null),ar?ni="buffer":ni||(ni=ui.defaultEncoding),typeof ri!="function"&&(ri=W),ui.ending?kt(this,ri):(ar||nr(this,ui,ai,ri))&&(ui.pendingcb++,lr=ce(this,ui,ar,ai,ni,ri)),lr},Qe.prototype.cork=function(){this._writableState.corked++},Qe.prototype.uncork=function(){var ai=this._writableState;ai.corked&&(ai.corked--,!ai.writing&&!ai.corked&&!ai.bufferProcessing&&ai.bufferedRequest&&L(this,ai))},Qe.prototype.setDefaultEncoding=function(ni){if(typeof ni=="string"&&(ni=ni.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ni+"").toLowerCase())>-1))throw new B(ni);return this._writableState.defaultEncoding=ni,this},Object.defineProperty(Qe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function sr(ai,ni,ri){return!ai.objectMode&&ai.decodeStrings!==!1&&typeof ni=="string"&&(ni=o.from(ni,ri)),ni}Object.defineProperty(Qe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ce(ai,ni,ri,ui,lr,ar){if(!ri){var jr=sr(ni,ui,lr);ui!==jr&&(ri=!0,lr="buffer",ui=jr)}var ci=ni.objectMode?1:ui.length;ni.length+=ci;var mi=ni.length<ni.highWaterMark;if(mi||(ni.needDrain=!0),ni.writing||ni.corked){var pi=ni.lastBufferedRequest;ni.lastBufferedRequest={chunk:ui,encoding:lr,isBuf:ri,callback:ar,next:null},pi?pi.next=ni.lastBufferedRequest:ni.bufferedRequest=ni.lastBufferedRequest,ni.bufferedRequestCount+=1}else Ze(ai,ni,!1,ci,ui,lr,ar);return mi}function Ze(ai,ni,ri,ui,lr,ar,jr){ni.writelen=ui,ni.writecb=jr,ni.writing=!0,ni.sync=!0,ni.destroyed?ni.onwrite(new w("write")):ri?ai._writev(lr,ni.onwrite):ai._write(lr,ar,ni.onwrite),ni.sync=!1}function se(ai,ni,ri,ui,lr){--ni.pendingcb,ri?(process.nextTick(lr,ui),process.nextTick(Ye,ai,ni),ai._writableState.errorEmitted=!0,ae(ai,ui)):(lr(ui),ai._writableState.errorEmitted=!0,ae(ai,ui),Ye(ai,ni))}function vt(ai){ai.writing=!1,ai.writecb=null,ai.length-=ai.writelen,ai.writelen=0}function ur(ai,ni){var ri=ai._writableState,ui=ri.sync,lr=ri.writecb;if(typeof lr!="function")throw new y;if(vt(ri),ni)se(ai,ri,ui,ni,lr);else{var ar=_(ri)||ai.destroyed;!ar&&!ri.corked&&!ri.bufferProcessing&&ri.bufferedRequest&&L(ai,ri),ui?process.nextTick(ue,ai,ri,ar,lr):ue(ai,ri,ar,lr)}}function ue(ai,ni,ri,ui){ri||bt(ai,ni),ni.pendingcb--,ui(),Ye(ai,ni)}function bt(ai,ni){ni.length===0&&ni.needDrain&&(ni.needDrain=!1,ai.emit("drain"))}function L(ai,ni){ni.bufferProcessing=!0;var ri=ni.bufferedRequest;if(ai._writev&&ri&&ri.next){var ui=ni.bufferedRequestCount,lr=new Array(ui),ar=ni.corkedRequestsFree;ar.entry=ri;for(var jr=0,ci=!0;ri;)lr[jr]=ri,ri.isBuf||(ci=!1),ri=ri.next,jr+=1;lr.allBuffers=ci,Ze(ai,ni,!0,ni.length,lr,"",ar.finish),ni.pendingcb++,ni.lastBufferedRequest=null,ar.next?(ni.corkedRequestsFree=ar.next,ar.next=null):ni.corkedRequestsFree=new e(ni),ni.bufferedRequestCount=0}else{for(;ri;){var mi=ri.chunk,pi=ri.encoding,ei=ri.callback,Gr=ni.objectMode?1:mi.length;if(Ze(ai,ni,!1,Gr,mi,pi,ei),ri=ri.next,ni.bufferedRequestCount--,ni.writing)break}ri===null&&(ni.lastBufferedRequest=null)}ni.bufferedRequest=ri,ni.bufferProcessing=!1}Qe.prototype._write=function(ai,ni,ri){ri(new h("_write()"))},Qe.prototype._writev=null,Qe.prototype.end=function(ai,ni,ri){var ui=this._writableState;return typeof ai=="function"?(ri=ai,ai=null,ni=null):typeof ni=="function"&&(ri=ni,ni=null),ai!=null&&this.write(ai,ni),ui.corked&&(ui.corked=1,this.uncork()),ui.ending||rn(this,ui,ri),this},Object.defineProperty(Qe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function _(ai){return ai.ending&&ai.length===0&&ai.bufferedRequest===null&&!ai.finished&&!ai.writing}function F(ai,ni){ai._final(function(ri){ni.pendingcb--,ri&&ae(ai,ri),ni.prefinished=!0,ai.emit("prefinish"),Ye(ai,ni)})}function k(ai,ni){!ni.prefinished&&!ni.finalCalled&&(typeof ai._final=="function"&&!ni.destroyed?(ni.pendingcb++,ni.finalCalled=!0,process.nextTick(F,ai,ni)):(ni.prefinished=!0,ai.emit("prefinish")))}function Ye(ai,ni){var ri=_(ni);if(ri&&(k(ai,ni),ni.pendingcb===0&&(ni.finished=!0,ai.emit("finish"),ni.autoDestroy))){var ui=ai._readableState;(!ui||ui.autoDestroy&&ui.endEmitted)&&ai.destroy()}return ri}function rn(ai,ni,ri){ni.ending=!0,Ye(ai,ni),ri&&(ni.finished?process.nextTick(ri):ai.once("finish",ri)),ni.ended=!0,ai.writable=!1}function ii(ai,ni,ri){var ui=ai.entry;for(ai.entry=null;ui;){var lr=ui.callback;ni.pendingcb--,lr(ri),ui=ui.next}ni.corkedRequestsFree.next=ai}return Object.defineProperty(Qe.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ni){this._writableState&&(this._writableState.destroyed=ni)}}),Qe.prototype.destroy=s.destroy,Qe.prototype._undestroy=s.undestroy,Qe.prototype._destroy=function(ai,ni){ni(ai)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=Object.keys||function(f){var c=[];for(var d in f)c.push(d);return c};_stream_duplex=u;var t=require_stream_readable(),r=require_stream_writable();requireInherits_browser()(u,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];u.prototype[i]||(u.prototype[i]=r.prototype[i])}function u(f){if(!(this instanceof u))return new u(f);t.call(this,f),r.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(s,this)}function s(f){f.end()}return Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),_stream_duplex}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var u=!1;return function(){if(!u){u=!0;for(var a=arguments.length,s=new Array(a),f=0;f<a;f++)s[f]=arguments[f];i.apply(this,s)}}}function r(){}function n(i){return i.setHeader&&typeof i.abort=="function"}function o(i,u,a){if(typeof u=="function")return o(i,null,u);u||(u={}),a=t(a||r);var s=u.readable||u.readable!==!1&&i.readable,f=u.writable||u.writable!==!1&&i.writable,c=function(){i.writable||p()},d=i._writableState&&i._writableState.finished,p=function(){f=!1,d=!0,s||a.call(i)},h=i._readableState&&i._readableState.endEmitted,y=function(){s=!1,h=!0,f||a.call(i)},b=function(B){a.call(i,B)},w=function(){var B;if(s&&!h)return(!i._readableState||!i._readableState.ended)&&(B=new e),a.call(i,B);if(f&&!d)return(!i._writableState||!i._writableState.ended)&&(B=new e),a.call(i,B)},S=function(){i.req.on("finish",p)};return n(i)?(i.on("complete",p),i.on("abort",w),i.req?S():i.on("request",S)):f&&!i._writableState&&(i.on("end",c),i.on("close",c)),i.on("end",y),i.on("finish",p),u.error!==!1&&i.on("error",b),i.on("close",w),function(){i.removeListener("complete",p),i.removeListener("abort",w),i.removeListener("request",S),i.req&&i.req.removeListener("finish",p),i.removeListener("end",c),i.removeListener("close",c),i.removeListener("finish",p),i.removeListener("end",y),i.removeListener("error",b),i.removeListener("close",w)}}return endOfStream=o,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var e;function t(B,ae,W){return ae=r(ae),ae in B?Object.defineProperty(B,ae,{value:W,enumerable:!0,configurable:!0,writable:!0}):B[ae]=W,B}function r(B){var ae=n(B,"string");return typeof ae=="symbol"?ae:String(ae)}function n(B,ae){if(typeof B!="object"||B===null)return B;var W=B[Symbol.toPrimitive];if(W!==void 0){var J=W.call(B,ae);if(typeof J!="object")return J;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ae==="string"?String:Number)(B)}var o=requireEndOfStream(),i=Symbol("lastResolve"),u=Symbol("lastReject"),a=Symbol("error"),s=Symbol("ended"),f=Symbol("lastPromise"),c=Symbol("handlePromise"),d=Symbol("stream");function p(B,ae){return{value:B,done:ae}}function h(B){var ae=B[i];if(ae!==null){var W=B[d].read();W!==null&&(B[f]=null,B[i]=null,B[u]=null,ae(p(W,!1)))}}function y(B){process.nextTick(h,B)}function b(B,ae){return function(W,J){B.then(function(){if(ae[s]){W(p(void 0,!0));return}ae[c](W,J)},J)}}var w=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var ae=this,W=this[a];if(W!==null)return Promise.reject(W);if(this[s])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(kt,nr){process.nextTick(function(){ae[a]?nr(ae[a]):kt(p(void 0,!0))})});var J=this[f],ve;if(J)ve=new Promise(b(J,this));else{var Qe=this[d].read();if(Qe!==null)return Promise.resolve(p(Qe,!1));ve=new Promise(this[c])}return this[f]=ve,ve}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var ae=this;return new Promise(function(W,J){ae[d].destroy(null,function(ve){if(ve){J(ve);return}W(p(void 0,!0))})})}),e),w),E=function(ae){var W,J=Object.create(S,(W={},t(W,d,{value:ae,writable:!0}),t(W,i,{value:null,writable:!0}),t(W,u,{value:null,writable:!0}),t(W,a,{value:null,writable:!0}),t(W,s,{value:ae._readableState.endEmitted,writable:!0}),t(W,c,{value:function(Qe,kt){var nr=J[d].read();nr?(J[f]=null,J[i]=null,J[u]=null,Qe(p(nr,!1))):(J[i]=Qe,J[u]=kt)},writable:!0}),W));return J[f]=null,o(ae,function(ve){if(ve&&ve.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Qe=J[u];Qe!==null&&(J[f]=null,J[i]=null,J[u]=null,Qe(ve)),J[a]=ve;return}var kt=J[i];kt!==null&&(J[f]=null,J[i]=null,J[u]=null,kt(p(void 0,!0))),J[s]=!0}),ae.on("readable",y.bind(null,J)),J};return async_iterator=E,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1,_stream_readable=kt;var e;kt.ReadableState=Qe,requireEvents().EventEmitter;var t=function(jr,ci){return jr.listeners(ci).length},r=requireStreamBrowser(),n=requireBuffer$1().Buffer,o=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(ar){return n.from(ar)}function u(ar){return n.isBuffer(ar)||ar instanceof o}var a=requireUtil$1(),s;a&&a.debuglog?s=a.debuglog("stream"):s=function(){};var f=requireBuffer_list(),c=requireDestroy(),d=requireState(),p=d.getHighWaterMark,h=requireErrorsBrowser().codes,y=h.ERR_INVALID_ARG_TYPE,b=h.ERR_STREAM_PUSH_AFTER_EOF,w=h.ERR_METHOD_NOT_IMPLEMENTED,S=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,B,ae;requireInherits_browser()(kt,r);var W=c.errorOrDestroy,J=["error","close","destroy","pause","resume"];function ve(ar,jr,ci){if(typeof ar.prependListener=="function")return ar.prependListener(jr,ci);!ar._events||!ar._events[jr]?ar.on(jr,ci):Array.isArray(ar._events[jr])?ar._events[jr].unshift(ci):ar._events[jr]=[ci,ar._events[jr]]}function Qe(ar,jr,ci){e=e||require_stream_duplex(),ar=ar||{},typeof ci!="boolean"&&(ci=jr instanceof e),this.objectMode=!!ar.objectMode,ci&&(this.objectMode=this.objectMode||!!ar.readableObjectMode),this.highWaterMark=p(this,ar,"readableHighWaterMark",ci),this.buffer=new f,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=ar.emitClose!==!1,this.autoDestroy=!!ar.autoDestroy,this.destroyed=!1,this.defaultEncoding=ar.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ar.encoding&&(E||(E=requireString_decoder().StringDecoder),this.decoder=new E(ar.encoding),this.encoding=ar.encoding)}function kt(ar){if(e=e||require_stream_duplex(),!(this instanceof kt))return new kt(ar);var jr=this instanceof e;this._readableState=new Qe(ar,this,jr),this.readable=!0,ar&&(typeof ar.read=="function"&&(this._read=ar.read),typeof ar.destroy=="function"&&(this._destroy=ar.destroy)),r.call(this)}Object.defineProperty(kt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(jr){this._readableState&&(this._readableState.destroyed=jr)}}),kt.prototype.destroy=c.destroy,kt.prototype._undestroy=c.undestroy,kt.prototype._destroy=function(ar,jr){jr(ar)},kt.prototype.push=function(ar,jr){var ci=this._readableState,mi;return ci.objectMode?mi=!0:typeof ar=="string"&&(jr=jr||ci.defaultEncoding,jr!==ci.encoding&&(ar=n.from(ar,jr),jr=""),mi=!0),nr(this,ar,jr,!1,mi)},kt.prototype.unshift=function(ar){return nr(this,ar,null,!0,!1)};function nr(ar,jr,ci,mi,pi){s("readableAddChunk",jr);var ei=ar._readableState;if(jr===null)ei.reading=!1,ur(ar,ei);else{var Gr;if(pi||(Gr=ce(ei,jr)),Gr)W(ar,Gr);else if(ei.objectMode||jr&&jr.length>0)if(typeof jr!="string"&&!ei.objectMode&&Object.getPrototypeOf(jr)!==n.prototype&&(jr=i(jr)),mi)ei.endEmitted?W(ar,new S):sr(ar,ei,jr,!0);else if(ei.ended)W(ar,new b);else{if(ei.destroyed)return!1;ei.reading=!1,ei.decoder&&!ci?(jr=ei.decoder.write(jr),ei.objectMode||jr.length!==0?sr(ar,ei,jr,!1):L(ar,ei)):sr(ar,ei,jr,!1)}else mi||(ei.reading=!1,L(ar,ei))}return!ei.ended&&(ei.length<ei.highWaterMark||ei.length===0)}function sr(ar,jr,ci,mi){jr.flowing&&jr.length===0&&!jr.sync?(jr.awaitDrain=0,ar.emit("data",ci)):(jr.length+=jr.objectMode?1:ci.length,mi?jr.buffer.unshift(ci):jr.buffer.push(ci),jr.needReadable&&ue(ar)),L(ar,jr)}function ce(ar,jr){var ci;return!u(jr)&&typeof jr!="string"&&jr!==void 0&&!ar.objectMode&&(ci=new y("chunk",["string","Buffer","Uint8Array"],jr)),ci}kt.prototype.isPaused=function(){return this._readableState.flowing===!1},kt.prototype.setEncoding=function(ar){E||(E=requireString_decoder().StringDecoder);var jr=new E(ar);this._readableState.decoder=jr,this._readableState.encoding=this._readableState.decoder.encoding;for(var ci=this._readableState.buffer.head,mi="";ci!==null;)mi+=jr.write(ci.data),ci=ci.next;return this._readableState.buffer.clear(),mi!==""&&this._readableState.buffer.push(mi),this._readableState.length=mi.length,this};var Ze=1073741824;function se(ar){return ar>=Ze?ar=Ze:(ar--,ar|=ar>>>1,ar|=ar>>>2,ar|=ar>>>4,ar|=ar>>>8,ar|=ar>>>16,ar++),ar}function vt(ar,jr){return ar<=0||jr.length===0&&jr.ended?0:jr.objectMode?1:ar!==ar?jr.flowing&&jr.length?jr.buffer.head.data.length:jr.length:(ar>jr.highWaterMark&&(jr.highWaterMark=se(ar)),ar<=jr.length?ar:jr.ended?jr.length:(jr.needReadable=!0,0))}kt.prototype.read=function(ar){s("read",ar),ar=parseInt(ar,10);var jr=this._readableState,ci=ar;if(ar!==0&&(jr.emittedReadable=!1),ar===0&&jr.needReadable&&((jr.highWaterMark!==0?jr.length>=jr.highWaterMark:jr.length>0)||jr.ended))return s("read: emitReadable",jr.length,jr.ended),jr.length===0&&jr.ended?ri(this):ue(this),null;if(ar=vt(ar,jr),ar===0&&jr.ended)return jr.length===0&&ri(this),null;var mi=jr.needReadable;s("need readable",mi),(jr.length===0||jr.length-ar<jr.highWaterMark)&&(mi=!0,s("length less than watermark",mi)),jr.ended||jr.reading?(mi=!1,s("reading or ended",mi)):mi&&(s("do read"),jr.reading=!0,jr.sync=!0,jr.length===0&&(jr.needReadable=!0),this._read(jr.highWaterMark),jr.sync=!1,jr.reading||(ar=vt(ci,jr)));var pi;return ar>0?pi=ni(ar,jr):pi=null,pi===null?(jr.needReadable=jr.length<=jr.highWaterMark,ar=0):(jr.length-=ar,jr.awaitDrain=0),jr.length===0&&(jr.ended||(jr.needReadable=!0),ci!==ar&&jr.ended&&ri(this)),pi!==null&&this.emit("data",pi),pi};function ur(ar,jr){if(s("onEofChunk"),!jr.ended){if(jr.decoder){var ci=jr.decoder.end();ci&&ci.length&&(jr.buffer.push(ci),jr.length+=jr.objectMode?1:ci.length)}jr.ended=!0,jr.sync?ue(ar):(jr.needReadable=!1,jr.emittedReadable||(jr.emittedReadable=!0,bt(ar)))}}function ue(ar){var jr=ar._readableState;s("emitReadable",jr.needReadable,jr.emittedReadable),jr.needReadable=!1,jr.emittedReadable||(s("emitReadable",jr.flowing),jr.emittedReadable=!0,process.nextTick(bt,ar))}function bt(ar){var jr=ar._readableState;s("emitReadable_",jr.destroyed,jr.length,jr.ended),!jr.destroyed&&(jr.length||jr.ended)&&(ar.emit("readable"),jr.emittedReadable=!1),jr.needReadable=!jr.flowing&&!jr.ended&&jr.length<=jr.highWaterMark,ai(ar)}function L(ar,jr){jr.readingMore||(jr.readingMore=!0,process.nextTick(_,ar,jr))}function _(ar,jr){for(;!jr.reading&&!jr.ended&&(jr.length<jr.highWaterMark||jr.flowing&&jr.length===0);){var ci=jr.length;if(s("maybeReadMore read 0"),ar.read(0),ci===jr.length)break}jr.readingMore=!1}kt.prototype._read=function(ar){W(this,new w("_read()"))},kt.prototype.pipe=function(ar,jr){var ci=this,mi=this._readableState;switch(mi.pipesCount){case 0:mi.pipes=ar;break;case 1:mi.pipes=[mi.pipes,ar];break;default:mi.pipes.push(ar);break}mi.pipesCount+=1,s("pipe count=%d opts=%j",mi.pipesCount,jr);var pi=(!jr||jr.end!==!1)&&ar!==process.stdout&&ar!==process.stderr,ei=pi?ti:rr;mi.endEmitted?process.nextTick(ei):ci.once("end",ei),ar.on("unpipe",Gr);function Gr(on,si){s("onunpipe"),on===ci&&si&&si.hasUnpiped===!1&&(si.hasUnpiped=!0,Ai())}function ti(){s("onend"),ar.end()}var fi=F(ci);ar.on("drain",fi);var bi=!1;function Ai(){s("cleanup"),ar.removeListener("close",vn),ar.removeListener("finish",di),ar.removeListener("drain",fi),ar.removeListener("error",qi),ar.removeListener("unpipe",Gr),ci.removeListener("end",ti),ci.removeListener("end",rr),ci.removeListener("data",Bi),bi=!0,mi.awaitDrain&&(!ar._writableState||ar._writableState.needDrain)&&fi()}ci.on("data",Bi);function Bi(on){s("ondata");var si=ar.write(on);s("dest.write",si),si===!1&&((mi.pipesCount===1&&mi.pipes===ar||mi.pipesCount>1&&lr(mi.pipes,ar)!==-1)&&!bi&&(s("false write response, pause",mi.awaitDrain),mi.awaitDrain++),ci.pause())}function qi(on){s("onerror",on),rr(),ar.removeListener("error",qi),t(ar,"error")===0&&W(ar,on)}ve(ar,"error",qi);function vn(){ar.removeListener("finish",di),rr()}ar.once("close",vn);function di(){s("onfinish"),ar.removeListener("close",vn),rr()}ar.once("finish",di);function rr(){s("unpipe"),ci.unpipe(ar)}return ar.emit("pipe",ci),mi.flowing||(s("pipe resume"),ci.resume()),ar};function F(ar){return function(){var ci=ar._readableState;s("pipeOnDrain",ci.awaitDrain),ci.awaitDrain&&ci.awaitDrain--,ci.awaitDrain===0&&t(ar,"data")&&(ci.flowing=!0,ai(ar))}}kt.prototype.unpipe=function(ar){var jr=this._readableState,ci={hasUnpiped:!1};if(jr.pipesCount===0)return this;if(jr.pipesCount===1)return ar&&ar!==jr.pipes?this:(ar||(ar=jr.pipes),jr.pipes=null,jr.pipesCount=0,jr.flowing=!1,ar&&ar.emit("unpipe",this,ci),this);if(!ar){var mi=jr.pipes,pi=jr.pipesCount;jr.pipes=null,jr.pipesCount=0,jr.flowing=!1;for(var ei=0;ei<pi;ei++)mi[ei].emit("unpipe",this,{hasUnpiped:!1});return this}var Gr=lr(jr.pipes,ar);return Gr===-1?this:(jr.pipes.splice(Gr,1),jr.pipesCount-=1,jr.pipesCount===1&&(jr.pipes=jr.pipes[0]),ar.emit("unpipe",this,ci),this)},kt.prototype.on=function(ar,jr){var ci=r.prototype.on.call(this,ar,jr),mi=this._readableState;return ar==="data"?(mi.readableListening=this.listenerCount("readable")>0,mi.flowing!==!1&&this.resume()):ar==="readable"&&!mi.endEmitted&&!mi.readableListening&&(mi.readableListening=mi.needReadable=!0,mi.flowing=!1,mi.emittedReadable=!1,s("on readable",mi.length,mi.reading),mi.length?ue(this):mi.reading||process.nextTick(Ye,this)),ci},kt.prototype.addListener=kt.prototype.on,kt.prototype.removeListener=function(ar,jr){var ci=r.prototype.removeListener.call(this,ar,jr);return ar==="readable"&&process.nextTick(k,this),ci},kt.prototype.removeAllListeners=function(ar){var jr=r.prototype.removeAllListeners.apply(this,arguments);return(ar==="readable"||ar===void 0)&&process.nextTick(k,this),jr};function k(ar){var jr=ar._readableState;jr.readableListening=ar.listenerCount("readable")>0,jr.resumeScheduled&&!jr.paused?jr.flowing=!0:ar.listenerCount("data")>0&&ar.resume()}function Ye(ar){s("readable nexttick read 0"),ar.read(0)}kt.prototype.resume=function(){var ar=this._readableState;return ar.flowing||(s("resume"),ar.flowing=!ar.readableListening,rn(this,ar)),ar.paused=!1,this};function rn(ar,jr){jr.resumeScheduled||(jr.resumeScheduled=!0,process.nextTick(ii,ar,jr))}function ii(ar,jr){s("resume",jr.reading),jr.reading||ar.read(0),jr.resumeScheduled=!1,ar.emit("resume"),ai(ar),jr.flowing&&!jr.reading&&ar.read(0)}kt.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ai(ar){var jr=ar._readableState;for(s("flow",jr.flowing);jr.flowing&&ar.read()!==null;);}kt.prototype.wrap=function(ar){var jr=this,ci=this._readableState,mi=!1;ar.on("end",function(){if(s("wrapped end"),ci.decoder&&!ci.ended){var Gr=ci.decoder.end();Gr&&Gr.length&&jr.push(Gr)}jr.push(null)}),ar.on("data",function(Gr){if(s("wrapped data"),ci.decoder&&(Gr=ci.decoder.write(Gr)),!(ci.objectMode&&Gr==null)&&!(!ci.objectMode&&(!Gr||!Gr.length))){var ti=jr.push(Gr);ti||(mi=!0,ar.pause())}});for(var pi in ar)this[pi]===void 0&&typeof ar[pi]=="function"&&(this[pi]=(function(ti){return function(){return ar[ti].apply(ar,arguments)}})(pi));for(var ei=0;ei<J.length;ei++)ar.on(J[ei],this.emit.bind(this,J[ei]));return this._read=function(Gr){s("wrapped _read",Gr),mi&&(mi=!1,ar.resume())},this},typeof Symbol=="function"&&(kt.prototype[Symbol.asyncIterator]=function(){return B===void 0&&(B=requireAsync_iterator()),B(this)}),Object.defineProperty(kt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(kt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(kt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(jr){this._readableState&&(this._readableState.flowing=jr)}}),kt._fromList=ni,Object.defineProperty(kt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ni(ar,jr){if(jr.length===0)return null;var ci;return jr.objectMode?ci=jr.buffer.shift():!ar||ar>=jr.length?(jr.decoder?ci=jr.buffer.join(""):jr.buffer.length===1?ci=jr.buffer.first():ci=jr.buffer.concat(jr.length),jr.buffer.clear()):ci=jr.buffer.consume(ar,jr.decoder),ci}function ri(ar){var jr=ar._readableState;s("endReadable",jr.endEmitted),jr.endEmitted||(jr.ended=!0,process.nextTick(ui,jr,ar))}function ui(ar,jr){if(s("endReadableNT",ar.endEmitted,ar.length),!ar.endEmitted&&ar.length===0&&(ar.endEmitted=!0,jr.readable=!1,jr.emit("end"),ar.autoDestroy)){var ci=jr._writableState;(!ci||ci.autoDestroy&&ci.finished)&&jr.destroy()}}typeof Symbol=="function"&&(kt.from=function(ar,jr){return ae===void 0&&(ae=requireFromBrowser()),ae(kt,ar,jr)});function lr(ar,jr){for(var ci=0,mi=ar.length;ci<mi;ci++)if(ar[ci]===jr)return ci;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=a;var e=requireErrorsBrowser().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=require_stream_duplex();requireInherits_browser()(a,i);function u(c,d){var p=this._transformState;p.transforming=!1;var h=p.writecb;if(h===null)return this.emit("error",new r);p.writechunk=null,p.writecb=null,d!=null&&this.push(d),h(c);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function a(c){if(!(this instanceof a))return new a(c);i.call(this,c),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",s)}function s(){var c=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,p){f(c,d,p)}):f(this,null,null)}a.prototype.push=function(c,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,c,d)},a.prototype._transform=function(c,d,p){p(new t("_transform()"))},a.prototype._write=function(c,d,p){var h=this._transformState;if(h.writecb=p,h.writechunk=c,h.writeencoding=d,!h.transforming){var y=this._readableState;(h.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},a.prototype._read=function(c){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},a.prototype._destroy=function(c,d){i.prototype._destroy.call(this,c,function(p){d(p)})};function f(c,d,p){if(d)return c.emit("error",d);if(p!=null&&c.push(p),c._writableState.length)throw new o;if(c._transformState.transforming)throw new n;return c.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=t;var e=require_stream_transform();requireInherits_browser()(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,n,o){o(null,r)},_stream_passthrough}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var e;function t(p){var h=!1;return function(){h||(h=!0,p.apply(void 0,arguments))}}var r=requireErrorsBrowser().codes,n=r.ERR_MISSING_ARGS,o=r.ERR_STREAM_DESTROYED;function i(p){if(p)throw p}function u(p){return p.setHeader&&typeof p.abort=="function"}function a(p,h,y,b){b=t(b);var w=!1;p.on("close",function(){w=!0}),e===void 0&&(e=requireEndOfStream()),e(p,{readable:h,writable:y},function(E){if(E)return b(E);w=!0,b()});var S=!1;return function(E){if(!w&&!S){if(S=!0,u(p))return p.abort();if(typeof p.destroy=="function")return p.destroy();b(E||new o("pipe"))}}}function s(p){p()}function f(p,h){return p.pipe(h)}function c(p){return!p.length||typeof p[p.length-1]!="function"?i:p.pop()}function d(){for(var p=arguments.length,h=new Array(p),y=0;y<p;y++)h[y]=arguments[y];var b=c(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new n("streams");var w,S=h.map(function(E,B){var ae=B<h.length-1,W=B>0;return a(E,ae,W,function(J){w||(w=J),J&&S.forEach(s),!ae&&(S.forEach(s),b(w))})});return h.reduce(f)}return pipeline_1=d,pipeline_1}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=r;var e=requireEvents().EventEmitter,t=requireInherits_browser();t(r,e),r.Readable=require_stream_readable(),r.Writable=require_stream_writable(),r.Duplex=require_stream_duplex(),r.Transform=require_stream_transform(),r.PassThrough=require_stream_passthrough(),r.finished=requireEndOfStream(),r.pipeline=requirePipeline(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,o){var i=this;function u(h){n.writable&&n.write(h)===!1&&i.pause&&i.pause()}i.on("data",u);function a(){i.readable&&i.resume&&i.resume()}n.on("drain",a),!n._isStdio&&(!o||o.end!==!1)&&(i.on("end",f),i.on("close",c));var s=!1;function f(){s||(s=!0,n.end())}function c(){s||(s=!0,typeof n.destroy=="function"&&n.destroy())}function d(h){if(p(),e.listenerCount(this,"error")===0)throw h}i.on("error",d),n.on("error",d);function p(){i.removeListener("data",u),n.removeListener("drain",a),i.removeListener("end",f),i.removeListener("close",c),i.removeListener("error",d),n.removeListener("error",d),i.removeListener("end",p),i.removeListener("close",p),n.removeListener("close",p)}return i.on("end",p),i.on("close",p),n.on("close",p),n.emit("pipe",i),n},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var e=requireSafeBuffer$1().Buffer,t=requireStreamBrowserify().Transform,r=requireString_decoder().StringDecoder,n=requireInherits_browser(),o=requireToBuffer$2();function i(u){t.call(this),this.hashMode=typeof u=="string",this.hashMode?this[u]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return n(i,t),i.prototype.update=function(u,a,s){var f=o(u,a),c=this._update(f);return this.hashMode?this:(s&&(c=this._toString(c,s)),c)},i.prototype.setAutoPadding=function(){},i.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},i.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},i.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},i.prototype._transform=function(u,a,s){var f;try{this.hashMode?this._update(u):this.push(this._update(u))}catch(c){f=c}finally{s(f)}},i.prototype._flush=function(u){var a;try{this.push(this.__final())}catch(s){a=s}u(a)},i.prototype._finalOrDigest=function(u){var a=this.__final()||e.alloc(0);return u&&(a=this._toString(a,u,!0)),a},i.prototype._toString=function(u,a,s){if(this._decoder||(this._decoder=new r(a),this._encoding=a),this._encoding!==a)throw new Error("can’t switch encodings");var f=this._decoder.write(u);return s&&(f+=this._decoder.end()),f},cipherBase=i,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var e=requireInherits_browser(),t=requireMd5_js(),r=requireRipemd160(),n=requireSha_js(),o=requireCipherBase();function i(u){o.call(this,"digest"),this._hash=u}return e(i,o),i.prototype._update=function(u){this._hash.update(u)},i.prototype._final=function(){return this._hash.digest()},browser$9=function(a){return a=a.toLowerCase(),a==="md5"?new t:a==="rmd160"||a==="ripemd160"?new r:new i(n(a))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var e=requireInherits_browser(),t=requireSafeBuffer$1().Buffer,r=requireCipherBase(),n=t.alloc(128),o=64;function i(u,a){r.call(this,"digest"),typeof a=="string"&&(a=t.from(a)),this._alg=u,this._key=a,a.length>o?a=u(a):a.length<o&&(a=t.concat([a,n],o));for(var s=this._ipad=t.allocUnsafe(o),f=this._opad=t.allocUnsafe(o),c=0;c<o;c++)s[c]=a[c]^54,f[c]=a[c]^92;this._hash=[s]}return e(i,r),i.prototype._update=function(u){this._hash.push(u)},i.prototype._final=function(){var u=this._alg(t.concat(this._hash));return this._alg(t.concat([this._opad,u]))},legacy=i,legacy}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var e=requireMd5_js();return md5=function(t){return new e().update(t).digest()},md5}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var e=requireInherits_browser(),t=requireLegacy(),r=requireCipherBase(),n=requireSafeBuffer$1().Buffer,o=requireMd5(),i=requireRipemd160(),u=requireSha_js(),a=n.alloc(128);function s(f,c){r.call(this,"digest"),typeof c=="string"&&(c=n.from(c));var d=f==="sha512"||f==="sha384"?128:64;if(this._alg=f,this._key=c,c.length>d){var p=f==="rmd160"?new i:u(f);c=p.update(c).digest()}else c.length<d&&(c=n.concat([c,a],d));for(var h=this._ipad=n.allocUnsafe(d),y=this._opad=n.allocUnsafe(d),b=0;b<d;b++)h[b]=c[b]^54,y[b]=c[b]^92;this._hash=f==="rmd160"?new i:u(f),this._hash.update(h)}return e(s,r),s.prototype._update=function(f){this._hash.update(f)},s.prototype._final=function(){var f=this._hash.digest(),c=this._alg==="rmd160"?new i:u(this._alg);return c.update(this._opad).update(f).digest()},browser$8=function(c,d){return c=c.toLowerCase(),c==="rmd160"||c==="ripemd160"?new s("rmd160",d):c==="md5"?new t(o,d):new s(c,d)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256={sign:"ecdsa",hash:"sha256",id:""},sha224={sign:"ecdsa",hash:"sha224",id:""},sha384={sign:"ecdsa",hash:"sha384",id:""},sha512$2={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256,sha224,sha384,sha512:sha512$2,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var e=isFinite,t=Math.pow(2,30)-1;return precondition=function(r,n){if(typeof r!="number")throw new TypeError("Iterations not a number");if(r<0||!e(r))throw new TypeError("Bad iterations");if(typeof n!="number")throw new TypeError("Key length not a number");if(n<0||n>t||n!==n)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var e;if(commonjsGlobal.process&&commonjsGlobal.process.browser)e="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var t=parseInt(process.version.split(".")[0].slice(1),10);e=t>=6?"utf-8":"binary"}else e="utf-8";return defaultEncoding_1=e,defaultEncoding_1}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var e=requireSafeBuffer$1().Buffer,t=requireToBuffer$2(),r=typeof Uint8Array<"u",n=r&&typeof ArrayBuffer<"u",o=n&&ArrayBuffer.isView;return toBuffer_1=function(i,u,a){if(typeof i=="string"||e.isBuffer(i)||r&&i instanceof Uint8Array||o&&o(i))return t(i,u);throw new TypeError(a+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var e=requireMd5(),t=requireRipemd160(),r=requireSha_js(),n=requireSafeBuffer$1().Buffer,o=requirePrecondition(),i=requireDefaultEncoding(),u=requireToBuffer(),a=n.alloc(128),s={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},f={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function c(y){return new t().update(y).digest()}function d(y){function b(w){return r(y).update(w).digest()}return y==="rmd160"||y==="ripemd160"?c:y==="md5"?e:b}function p(y,b,w){var S=d(y),E=y==="sha512"||y==="sha384"?128:64;b.length>E?b=S(b):b.length<E&&(b=n.concat([b,a],E));for(var B=n.allocUnsafe(E+s[y]),ae=n.allocUnsafe(E+s[y]),W=0;W<E;W++)B[W]=b[W]^54,ae[W]=b[W]^92;var J=n.allocUnsafe(E+w+4);B.copy(J,0,0,E),this.ipad1=J,this.ipad2=B,this.opad=ae,this.alg=y,this.blocksize=E,this.hash=S,this.size=s[y]}p.prototype.run=function(y,b){y.copy(b,this.blocksize);var w=this.hash(b);return w.copy(this.opad,this.blocksize),this.hash(this.opad)};function h(y,b,w,S,E){o(w,S),y=u(y,i,"Password"),b=u(b,i,"Salt");var B=(E||"sha1").toLowerCase(),ae=f[B]||B,W=s[ae];if(typeof W!="number"||!W)throw new TypeError("Digest algorithm not supported: "+E);var J=new p(ae,y,b.length),ve=n.allocUnsafe(S),Qe=n.allocUnsafe(b.length+4);b.copy(Qe,0,0,b.length);for(var kt=0,nr=W,sr=Math.ceil(S/nr),ce=1;ce<=sr;ce++){Qe.writeUInt32BE(ce,b.length);for(var Ze=J.run(Qe,J.ipad1),se=Ze,vt=1;vt<w;vt++){se=J.run(se,J.ipad2);for(var ur=0;ur<nr;ur++)Ze[ur]^=se[ur]}Ze.copy(ve,kt),kt+=nr}return ve}return syncBrowser=h,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var e=requireSafeBuffer$1().Buffer,t=requirePrecondition(),r=requireDefaultEncoding(),n=requireSyncBrowser(),o=requireToBuffer(),i,u=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,a={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},s=[],f;function c(){return f||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?f=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?f=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?f=commonjsGlobal.setImmediate:f=commonjsGlobal.setTimeout,f)}function d(y,b,w,S,E){return u.importKey("raw",y,{name:"PBKDF2"},!1,["deriveBits"]).then(function(B){return u.deriveBits({name:"PBKDF2",salt:b,iterations:w,hash:{name:E}},B,S<<3)}).then(function(B){return e.from(B)})}function p(y){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(s[y]!==void 0)return s[y];i=i||e.alloc(8);var b=d(i,i,10,128,y).then(function(){return!0},function(){return!1});return s[y]=b,b}function h(y,b){y.then(function(w){c()(function(){b(null,w)})},function(w){c()(function(){b(w)})})}return async=function(y,b,w,S,E,B){if(typeof E=="function"&&(B=E,E=void 0),t(w,S),y=o(y,r,"Password"),b=o(b,r,"Salt"),typeof B!="function")throw new Error("No callback provided to pbkdf2");E=E||"sha1";var ae=a[E.toLowerCase()];if(!ae||typeof commonjsGlobal.Promise!="function"){c()(function(){var W;try{W=n(y,b,w,S,E)}catch(J){B(J);return}B(null,W)});return}h(p(ae).then(function(W){return W?d(y,b,w,S,ae):n(y,b,w,S,E)}),B)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$3={},hasRequiredUtils$3;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(o,i){var u=o[0+i]<<24|o[1+i]<<16|o[2+i]<<8|o[3+i];return u>>>0},utils$3.writeUInt32BE=function(o,i,u){o[0+u]=i>>>24,o[1+u]=i>>>16&255,o[2+u]=i>>>8&255,o[3+u]=i&255},utils$3.ip=function(o,i,u,a){for(var s=0,f=0,c=6;c>=0;c-=2){for(var d=0;d<=24;d+=8)s<<=1,s|=i>>>d+c&1;for(var d=0;d<=24;d+=8)s<<=1,s|=o>>>d+c&1}for(var c=6;c>=0;c-=2){for(var d=1;d<=25;d+=8)f<<=1,f|=i>>>d+c&1;for(var d=1;d<=25;d+=8)f<<=1,f|=o>>>d+c&1}u[a+0]=s>>>0,u[a+1]=f>>>0},utils$3.rip=function(o,i,u,a){for(var s=0,f=0,c=0;c<4;c++)for(var d=24;d>=0;d-=8)s<<=1,s|=i>>>d+c&1,s<<=1,s|=o>>>d+c&1;for(var c=4;c<8;c++)for(var d=24;d>=0;d-=8)f<<=1,f|=i>>>d+c&1,f<<=1,f|=o>>>d+c&1;u[a+0]=s>>>0,u[a+1]=f>>>0},utils$3.pc1=function(o,i,u,a){for(var s=0,f=0,c=7;c>=5;c--){for(var d=0;d<=24;d+=8)s<<=1,s|=i>>d+c&1;for(var d=0;d<=24;d+=8)s<<=1,s|=o>>d+c&1}for(var d=0;d<=24;d+=8)s<<=1,s|=i>>d+c&1;for(var c=1;c<=3;c++){for(var d=0;d<=24;d+=8)f<<=1,f|=i>>d+c&1;for(var d=0;d<=24;d+=8)f<<=1,f|=o>>d+c&1}for(var d=0;d<=24;d+=8)f<<=1,f|=o>>d+c&1;u[a+0]=s>>>0,u[a+1]=f>>>0},utils$3.r28shl=function(o,i){return o<<i&268435455|o>>>28-i};var e=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$3.pc2=function(o,i,u,a){for(var s=0,f=0,c=e.length>>>1,d=0;d<c;d++)s<<=1,s|=o>>>e[d]&1;for(var d=c;d<e.length;d++)f<<=1,f|=i>>>e[d]&1;u[a+0]=s>>>0,u[a+1]=f>>>0},utils$3.expand=function(o,i,u){var a=0,s=0;a=(o&1)<<5|o>>>27;for(var f=23;f>=15;f-=4)a<<=6,a|=o>>>f&63;for(var f=11;f>=3;f-=4)s|=o>>>f&63,s<<=6;s|=(o&31)<<1|o>>>31,i[u+0]=a>>>0,i[u+1]=s>>>0};var t=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$3.substitute=function(o,i){for(var u=0,a=0;a<4;a++){var s=o>>>18-a*6&63,f=t[a*64+s];u<<=4,u|=f}for(var a=0;a<4;a++){var s=i>>>18-a*6&63,f=t[256+a*64+s];u<<=4,u|=f}return u>>>0};var r=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$3.permute=function(o){for(var i=0,u=0;u<r.length;u++)i<<=1,i|=o>>>r[u]&1;return i>>>0},utils$3.padSplit=function(o,i,u){for(var a=o.toString(2);a.length<i;)a="0"+a;for(var s=[],f=0;f<i;f+=u)s.push(a.slice(f,f+u));return s.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=e;function e(t,r){if(!t)throw new Error(r||"Assertion failed")}return e.equal=function(r,n,o){if(r!=n)throw new Error(o||"Assertion failed: "+r+" != "+n)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var e=requireMinimalisticAssert();function t(r){this.options=r,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=r.padding!==!1}return cipher=t,t.prototype._init=function(){},t.prototype.update=function(n){return n.length===0?[]:this.type==="decrypt"?this._updateDecrypt(n):this._updateEncrypt(n)},t.prototype._buffer=function(n,o){for(var i=Math.min(this.buffer.length-this.bufferOff,n.length-o),u=0;u<i;u++)this.buffer[this.bufferOff+u]=n[o+u];return this.bufferOff+=i,i},t.prototype._flushBuffer=function(n,o){return this._update(this.buffer,0,n,o),this.bufferOff=0,this.blockSize},t.prototype._updateEncrypt=function(n){var o=0,i=0,u=(this.bufferOff+n.length)/this.blockSize|0,a=new Array(u*this.blockSize);this.bufferOff!==0&&(o+=this._buffer(n,o),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(a,i)));for(var s=n.length-(n.length-o)%this.blockSize;o<s;o+=this.blockSize)this._update(n,o,a,i),i+=this.blockSize;for(;o<n.length;o++,this.bufferOff++)this.buffer[this.bufferOff]=n[o];return a},t.prototype._updateDecrypt=function(n){for(var o=0,i=0,u=Math.ceil((this.bufferOff+n.length)/this.blockSize)-1,a=new Array(u*this.blockSize);u>0;u--)o+=this._buffer(n,o),i+=this._flushBuffer(a,i);return o+=this._buffer(n,o),a},t.prototype.final=function(n){var o;n&&(o=this.update(n));var i;return this.type==="encrypt"?i=this._finalEncrypt():i=this._finalDecrypt(),o?o.concat(i):i},t.prototype._pad=function(n,o){if(o===0)return!1;for(;o<n.length;)n[o++]=0;return!0},t.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var n=new Array(this.blockSize);return this._update(this.buffer,0,n,0),n},t.prototype._unpad=function(n){return n},t.prototype._finalDecrypt=function(){e.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var n=new Array(this.blockSize);return this._flushBuffer(n,0),this._unpad(n)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r=requireUtils$3(),n=requireCipher();function o(){this.tmp=new Array(2),this.keys=null}function i(a){n.call(this,a);var s=new o;this._desState=s,this.deriveKeys(s,a.key)}t(i,n),des=i,i.create=function(s){return new i(s)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return i.prototype.deriveKeys=function(s,f){s.keys=new Array(32),e.equal(f.length,this.blockSize,"Invalid key length");var c=r.readUInt32BE(f,0),d=r.readUInt32BE(f,4);r.pc1(c,d,s.tmp,0),c=s.tmp[0],d=s.tmp[1];for(var p=0;p<s.keys.length;p+=2){var h=u[p>>>1];c=r.r28shl(c,h),d=r.r28shl(d,h),r.pc2(c,d,s.keys,p)}},i.prototype._update=function(s,f,c,d){var p=this._desState,h=r.readUInt32BE(s,f),y=r.readUInt32BE(s,f+4);r.ip(h,y,p.tmp,0),h=p.tmp[0],y=p.tmp[1],this.type==="encrypt"?this._encrypt(p,h,y,p.tmp,0):this._decrypt(p,h,y,p.tmp,0),h=p.tmp[0],y=p.tmp[1],r.writeUInt32BE(c,h,d),r.writeUInt32BE(c,y,d+4)},i.prototype._pad=function(s,f){if(this.padding===!1)return!1;for(var c=s.length-f,d=f;d<s.length;d++)s[d]=c;return!0},i.prototype._unpad=function(s){if(this.padding===!1)return s;for(var f=s[s.length-1],c=s.length-f;c<s.length;c++)e.equal(s[c],f);return s.slice(0,s.length-f)},i.prototype._encrypt=function(s,f,c,d,p){for(var h=f,y=c,b=0;b<s.keys.length;b+=2){var w=s.keys[b],S=s.keys[b+1];r.expand(y,s.tmp,0),w^=s.tmp[0],S^=s.tmp[1];var E=r.substitute(w,S),B=r.permute(E),ae=y;y=(h^B)>>>0,h=ae}r.rip(y,h,d,p)},i.prototype._decrypt=function(s,f,c,d,p){for(var h=c,y=f,b=s.keys.length-2;b>=0;b-=2){var w=s.keys[b],S=s.keys[b+1];r.expand(h,s.tmp,0),w^=s.tmp[0],S^=s.tmp[1];var E=r.substitute(w,S),B=r.permute(E),ae=h;h=(y^B)>>>0,y=ae}r.rip(h,y,d,p)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r={};function n(i){e.equal(i.length,8,"Invalid IV length"),this.iv=new Array(8);for(var u=0;u<this.iv.length;u++)this.iv[u]=i[u]}function o(i){function u(c){i.call(this,c),this._cbcInit()}t(u,i);for(var a=Object.keys(r),s=0;s<a.length;s++){var f=a[s];u.prototype[f]=r[f]}return u.create=function(d){return new u(d)},u}return cbc$1.instantiate=o,r._cbcInit=function(){var u=new n(this.options.iv);this._cbcState=u},r._update=function(u,a,s,f){var c=this._cbcState,d=this.constructor.super_.prototype,p=c.iv;if(this.type==="encrypt"){for(var h=0;h<this.blockSize;h++)p[h]^=u[a+h];d._update.call(this,p,0,s,f);for(var h=0;h<this.blockSize;h++)p[h]=s[f+h]}else{d._update.call(this,u,a,s,f);for(var h=0;h<this.blockSize;h++)s[f+h]^=p[h];for(var h=0;h<this.blockSize;h++)p[h]=u[a+h]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r=requireCipher(),n=requireDes$1();function o(u,a){e.equal(a.length,24,"Invalid key length");var s=a.slice(0,8),f=a.slice(8,16),c=a.slice(16,24);u==="encrypt"?this.ciphers=[n.create({type:"encrypt",key:s}),n.create({type:"decrypt",key:f}),n.create({type:"encrypt",key:c})]:this.ciphers=[n.create({type:"decrypt",key:c}),n.create({type:"encrypt",key:f}),n.create({type:"decrypt",key:s})]}function i(u){r.call(this,u);var a=new o(this.type,this.options.key);this._edeState=a}return t(i,r),ede=i,i.create=function(a){return new i(a)},i.prototype._update=function(a,s,f,c){var d=this._edeState;d.ciphers[0]._update(a,s,f,c),d.ciphers[1]._update(f,c,f,c),d.ciphers[2]._update(f,c,f,c)},i.prototype._pad=n.prototype._pad,i.prototype._unpad=n.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var e=requireCipherBase(),t=requireDes(),r=requireInherits_browser(),n=requireSafeBuffer$1().Buffer,o={"des-ede3-cbc":t.CBC.instantiate(t.EDE),"des-ede3":t.EDE,"des-ede-cbc":t.CBC.instantiate(t.EDE),"des-ede":t.EDE,"des-cbc":t.CBC.instantiate(t.DES),"des-ecb":t.DES};o.des=o["des-cbc"],o.des3=o["des-ede3-cbc"],browserifyDes=i,r(i,e);function i(u){e.call(this);var a=u.mode.toLowerCase(),s=o[a],f;u.decrypt?f="decrypt":f="encrypt";var c=u.key;n.isBuffer(c)||(c=n.from(c)),(a==="des-ede"||a==="des-ede-cbc")&&(c=n.concat([c,c.slice(0,8)]));var d=u.iv;n.isBuffer(d)||(d=n.from(d)),this._des=s.create({key:c,iv:d,type:f})}return i.prototype._update=function(u){return n.from(this._des.update(u))},i.prototype._final=function(){return n.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(e,t){return e._cipher.encryptBlock(t)},ecb.decrypt=function(e,t){return e._cipher.decryptBlock(t)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(t,r){for(var n=Math.min(t.length,r.length),o=new bufferExports.Buffer(n),i=0;i<n;++i)o[i]=t[i]^r[i];return o}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var e=requireBufferXor();return cbc.encrypt=function(t,r){var n=e(r,t._prev);return t._prev=t._cipher.encryptBlock(n),t._prev},cbc.decrypt=function(t,r){var n=t._prev;t._prev=r;var o=t._cipher.decryptBlock(r);return e(o,n)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var e=requireSafeBuffer$1().Buffer,t=requireBufferXor();function r(n,o,i){var u=o.length,a=t(o,n._cache);return n._cache=n._cache.slice(u),n._prev=e.concat([n._prev,i?o:a]),a}return cfb.encrypt=function(n,o,i){for(var u=e.allocUnsafe(0),a;o.length;)if(n._cache.length===0&&(n._cache=n._cipher.encryptBlock(n._prev),n._prev=e.allocUnsafe(0)),n._cache.length<=o.length)a=n._cache.length,u=e.concat([u,r(n,o.slice(0,a),i)]),o=o.slice(a);else{u=e.concat([u,r(n,o,i)]);break}return u},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var e=requireSafeBuffer$1().Buffer;function t(r,n,o){var i=r._cipher.encryptBlock(r._prev),u=i[0]^n;return r._prev=e.concat([r._prev.slice(1),e.from([o?n:u])]),u}return cfb8.encrypt=function(r,n,o){for(var i=n.length,u=e.allocUnsafe(i),a=-1;++a<i;)u[a]=t(r,n[a],o);return u},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var e=requireSafeBuffer$1().Buffer;function t(n,o,i){for(var u,a=-1,s=8,f=0,c,d;++a<s;)u=n._cipher.encryptBlock(n._prev),c=o&1<<7-a?128:0,d=u[0]^c,f+=(d&128)>>a%8,n._prev=r(n._prev,i?c:d);return f}function r(n,o){var i=n.length,u=-1,a=e.allocUnsafe(n.length);for(n=e.concat([n,e.from([o])]);++u<i;)a[u]=n[u]<<1|n[u+1]>>7;return a}return cfb1.encrypt=function(n,o,i){for(var u=o.length,a=e.allocUnsafe(u),s=-1;++s<u;)a[s]=t(n,o[s],i);return a},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var e=requireBufferXor();function t(r){return r._prev=r._cipher.encryptBlock(r._prev),r._prev}return ofb.encrypt=function(r,n){for(;r._cache.length<n.length;)r._cache=bufferExports.Buffer.concat([r._cache,t(r)]);var o=r._cache.slice(0,n.length);return r._cache=r._cache.slice(n.length),e(n,o)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function e(t){for(var r=t.length,n;r--;)if(n=t.readUInt8(r),n===255)t.writeUInt8(0,r);else{n++,t.writeUInt8(n,r);break}}return incr32_1=e,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var e=requireBufferXor(),t=requireSafeBuffer$1().Buffer,r=requireIncr32();function n(i){var u=i._cipher.encryptBlockRaw(i._prev);return r(i._prev),u}var o=16;return ctr.encrypt=function(i,u){var a=Math.ceil(u.length/o),s=i._cache.length;i._cache=t.concat([i._cache,t.allocUnsafe(a*o)]);for(var f=0;f<a;f++){var c=n(i),d=s+f*o;i._cache.writeUInt32BE(c[0],d+0),i._cache.writeUInt32BE(c[1],d+4),i._cache.writeUInt32BE(c[2],d+8),i._cache.writeUInt32BE(c[3],d+12)}var p=i._cache.slice(0,u.length);return i._cache=i._cache.slice(u.length),e(u,p)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var e={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},t=require$$2;for(var r in t)t[r].module=e[t[r].mode];return modes_1=t,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var e=requireSafeBuffer$1().Buffer;function t(a){e.isBuffer(a)||(a=e.from(a));for(var s=a.length/4|0,f=new Array(s),c=0;c<s;c++)f[c]=a.readUInt32BE(c*4);return f}function r(a){for(var s=0;s<a.length;a++)a[s]=0}function n(a,s,f,c,d){for(var p=f[0],h=f[1],y=f[2],b=f[3],w=a[0]^s[0],S=a[1]^s[1],E=a[2]^s[2],B=a[3]^s[3],ae,W,J,ve,Qe=4,kt=1;kt<d;kt++)ae=p[w>>>24]^h[S>>>16&255]^y[E>>>8&255]^b[B&255]^s[Qe++],W=p[S>>>24]^h[E>>>16&255]^y[B>>>8&255]^b[w&255]^s[Qe++],J=p[E>>>24]^h[B>>>16&255]^y[w>>>8&255]^b[S&255]^s[Qe++],ve=p[B>>>24]^h[w>>>16&255]^y[S>>>8&255]^b[E&255]^s[Qe++],w=ae,S=W,E=J,B=ve;return ae=(c[w>>>24]<<24|c[S>>>16&255]<<16|c[E>>>8&255]<<8|c[B&255])^s[Qe++],W=(c[S>>>24]<<24|c[E>>>16&255]<<16|c[B>>>8&255]<<8|c[w&255])^s[Qe++],J=(c[E>>>24]<<24|c[B>>>16&255]<<16|c[w>>>8&255]<<8|c[S&255])^s[Qe++],ve=(c[B>>>24]<<24|c[w>>>16&255]<<16|c[S>>>8&255]<<8|c[E&255])^s[Qe++],ae=ae>>>0,W=W>>>0,J=J>>>0,ve=ve>>>0,[ae,W,J,ve]}var o=[0,1,2,4,8,16,32,64,128,27,54],i=(function(){for(var a=new Array(256),s=0;s<256;s++)s<128?a[s]=s<<1:a[s]=s<<1^283;for(var f=[],c=[],d=[[],[],[],[]],p=[[],[],[],[]],h=0,y=0,b=0;b<256;++b){var w=y^y<<1^y<<2^y<<3^y<<4;w=w>>>8^w&255^99,f[h]=w,c[w]=h;var S=a[h],E=a[S],B=a[E],ae=a[w]*257^w*16843008;d[0][h]=ae<<24|ae>>>8,d[1][h]=ae<<16|ae>>>16,d[2][h]=ae<<8|ae>>>24,d[3][h]=ae,ae=B*16843009^E*65537^S*257^h*16843008,p[0][w]=ae<<24|ae>>>8,p[1][w]=ae<<16|ae>>>16,p[2][w]=ae<<8|ae>>>24,p[3][w]=ae,h===0?h=y=1:(h=S^a[a[a[B^S]]],y^=a[a[y]])}return{SBOX:f,INV_SBOX:c,SUB_MIX:d,INV_SUB_MIX:p}})();function u(a){this._key=t(a),this._reset()}return u.blockSize=16,u.keySize=256/8,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var a=this._key,s=a.length,f=s+6,c=(f+1)*4,d=[],p=0;p<s;p++)d[p]=a[p];for(p=s;p<c;p++){var h=d[p-1];p%s===0?(h=h<<8|h>>>24,h=i.SBOX[h>>>24]<<24|i.SBOX[h>>>16&255]<<16|i.SBOX[h>>>8&255]<<8|i.SBOX[h&255],h^=o[p/s|0]<<24):s>6&&p%s===4&&(h=i.SBOX[h>>>24]<<24|i.SBOX[h>>>16&255]<<16|i.SBOX[h>>>8&255]<<8|i.SBOX[h&255]),d[p]=d[p-s]^h}for(var y=[],b=0;b<c;b++){var w=c-b,S=d[w-(b%4?0:4)];b<4||w<=4?y[b]=S:y[b]=i.INV_SUB_MIX[0][i.SBOX[S>>>24]]^i.INV_SUB_MIX[1][i.SBOX[S>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[S>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[S&255]]}this._nRounds=f,this._keySchedule=d,this._invKeySchedule=y},u.prototype.encryptBlockRaw=function(a){return a=t(a),n(a,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},u.prototype.encryptBlock=function(a){var s=this.encryptBlockRaw(a),f=e.allocUnsafe(16);return f.writeUInt32BE(s[0],0),f.writeUInt32BE(s[1],4),f.writeUInt32BE(s[2],8),f.writeUInt32BE(s[3],12),f},u.prototype.decryptBlock=function(a){a=t(a);var s=a[1];a[1]=a[3],a[3]=s;var f=n(a,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),c=e.allocUnsafe(16);return c.writeUInt32BE(f[0],0),c.writeUInt32BE(f[3],4),c.writeUInt32BE(f[2],8),c.writeUInt32BE(f[1],12),c},u.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},aes.AES=u,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var e=requireSafeBuffer$1().Buffer,t=e.alloc(16,0);function r(i){return[i.readUInt32BE(0),i.readUInt32BE(4),i.readUInt32BE(8),i.readUInt32BE(12)]}function n(i){var u=e.allocUnsafe(16);return u.writeUInt32BE(i[0]>>>0,0),u.writeUInt32BE(i[1]>>>0,4),u.writeUInt32BE(i[2]>>>0,8),u.writeUInt32BE(i[3]>>>0,12),u}function o(i){this.h=i,this.state=e.alloc(16,0),this.cache=e.allocUnsafe(0)}return o.prototype.ghash=function(i){for(var u=-1;++u<i.length;)this.state[u]^=i[u];this._multiply()},o.prototype._multiply=function(){for(var i=r(this.h),u=[0,0,0,0],a,s,f,c=-1;++c<128;){for(s=(this.state[~~(c/8)]&1<<7-c%8)!==0,s&&(u[0]^=i[0],u[1]^=i[1],u[2]^=i[2],u[3]^=i[3]),f=(i[3]&1)!==0,a=3;a>0;a--)i[a]=i[a]>>>1|(i[a-1]&1)<<31;i[0]=i[0]>>>1,f&&(i[0]=i[0]^225<<24)}this.state=n(u)},o.prototype.update=function(i){this.cache=e.concat([this.cache,i]);for(var u;this.cache.length>=16;)u=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(u)},o.prototype.final=function(i,u){return this.cache.length&&this.ghash(e.concat([this.cache,t],16)),this.ghash(n([0,i,0,u])),this.state},ghash=o,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var e=requireAes(),t=requireSafeBuffer$1().Buffer,r=requireCipherBase(),n=requireInherits_browser(),o=requireGhash(),i=requireBufferXor(),u=requireIncr32();function a(c,d){var p=0;c.length!==d.length&&p++;for(var h=Math.min(c.length,d.length),y=0;y<h;++y)p+=c[y]^d[y];return p}function s(c,d,p){if(d.length===12)return c._finID=t.concat([d,t.from([0,0,0,1])]),t.concat([d,t.from([0,0,0,2])]);var h=new o(p),y=d.length,b=y%16;h.update(d),b&&(b=16-b,h.update(t.alloc(b,0))),h.update(t.alloc(8,0));var w=y*8,S=t.alloc(8);S.writeUIntBE(w,0,8),h.update(S),c._finID=h.state;var E=t.from(c._finID);return u(E),E}function f(c,d,p,h){r.call(this);var y=t.alloc(4,0);this._cipher=new e.AES(d);var b=this._cipher.encryptBlock(y);this._ghash=new o(b),p=s(this,p,b),this._prev=t.from(p),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=h,this._alen=0,this._len=0,this._mode=c,this._authTag=null,this._called=!1}return n(f,r),f.prototype._update=function(c){if(!this._called&&this._alen){var d=16-this._alen%16;d<16&&(d=t.alloc(d,0),this._ghash.update(d))}this._called=!0;var p=this._mode.encrypt(this,c);return this._decrypt?this._ghash.update(c):this._ghash.update(p),this._len+=c.length,p},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var c=i(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&a(c,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=c,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!t.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(d){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=d},f.prototype.setAAD=function(d){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(d),this._alen+=d.length},authCipher=f,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var e=requireAes(),t=requireSafeBuffer$1().Buffer,r=requireCipherBase(),n=requireInherits_browser();function o(i,u,a,s){r.call(this),this._cipher=new e.AES(u),this._prev=t.from(a),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=s,this._mode=i}return n(o,r),o.prototype._update=function(i){return this._mode.encrypt(this,i,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},streamCipher=o,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var e=requireSafeBuffer$1().Buffer,t=requireMd5_js();function r(n,o,i,u){if(e.isBuffer(n)||(n=e.from(n,"binary")),o&&(e.isBuffer(o)||(o=e.from(o,"binary")),o.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=i/8,s=e.alloc(a),f=e.alloc(u||0),c=e.alloc(0);a>0||u>0;){var d=new t;d.update(c),d.update(n),o&&d.update(o),c=d.digest();var p=0;if(a>0){var h=s.length-a;p=Math.min(a,c.length),c.copy(s,h,0,p),a-=p}if(p<c.length&&u>0){var y=f.length-u,b=Math.min(u,c.length-p);c.copy(f,y,p,p+b),u-=b}}return c.fill(0),{key:s,iv:f}}return evp_bytestokey=r,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var e=requireModes$1(),t=requireAuthCipher(),r=requireSafeBuffer$1().Buffer,n=requireStreamCipher(),o=requireCipherBase(),i=requireAes(),u=requireEvp_bytestokey(),a=requireInherits_browser();function s(h,y,b){o.call(this),this._cache=new c,this._cipher=new i.AES(y),this._prev=r.from(b),this._mode=h,this._autopadding=!0}a(s,o),s.prototype._update=function(h){this._cache.add(h);for(var y,b,w=[];y=this._cache.get();)b=this._mode.encrypt(this,y),w.push(b);return r.concat(w)};var f=r.alloc(16,16);s.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return h=this._mode.encrypt(this,h),this._cipher.scrub(),h;if(!h.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},s.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function c(){this.cache=r.allocUnsafe(0)}c.prototype.add=function(h){this.cache=r.concat([this.cache,h])},c.prototype.get=function(){if(this.cache.length>15){var h=this.cache.slice(0,16);return this.cache=this.cache.slice(16),h}return null},c.prototype.flush=function(){for(var h=16-this.cache.length,y=r.allocUnsafe(h),b=-1;++b<h;)y.writeUInt8(h,b);return r.concat([this.cache,y])};function d(h,y,b){var w=e[h.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof y=="string"&&(y=r.from(y)),y.length!==w.key/8)throw new TypeError("invalid key length "+y.length);if(typeof b=="string"&&(b=r.from(b)),w.mode!=="GCM"&&b.length!==w.iv)throw new TypeError("invalid iv length "+b.length);return w.type==="stream"?new n(w.module,y,b):w.type==="auth"?new t(w.module,y,b):new s(w.module,y,b)}function p(h,y){var b=e[h.toLowerCase()];if(!b)throw new TypeError("invalid suite type");var w=u(y,!1,b.key,b.iv);return d(h,w.key,w.iv)}return encrypter.createCipheriv=d,encrypter.createCipher=p,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var e=requireAuthCipher(),t=requireSafeBuffer$1().Buffer,r=requireModes$1(),n=requireStreamCipher(),o=requireCipherBase(),i=requireAes(),u=requireEvp_bytestokey(),a=requireInherits_browser();function s(h,y,b){o.call(this),this._cache=new f,this._last=void 0,this._cipher=new i.AES(y),this._prev=t.from(b),this._mode=h,this._autopadding=!0}a(s,o),s.prototype._update=function(h){this._cache.add(h);for(var y,b,w=[];y=this._cache.get(this._autopadding);)b=this._mode.decrypt(this,y),w.push(b);return t.concat(w)},s.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return c(this._mode.decrypt(this,h));if(h)throw new Error("data not multiple of block length")},s.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function f(){this.cache=t.allocUnsafe(0)}f.prototype.add=function(h){this.cache=t.concat([this.cache,h])},f.prototype.get=function(h){var y;if(h){if(this.cache.length>16)return y=this.cache.slice(0,16),this.cache=this.cache.slice(16),y}else if(this.cache.length>=16)return y=this.cache.slice(0,16),this.cache=this.cache.slice(16),y;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache};function c(h){var y=h[15];if(y<1||y>16)throw new Error("unable to decrypt data");for(var b=-1;++b<y;)if(h[b+(16-y)]!==y)throw new Error("unable to decrypt data");if(y!==16)return h.slice(0,16-y)}function d(h,y,b){var w=r[h.toLowerCase()];if(!w)throw new TypeError("invalid suite type");if(typeof b=="string"&&(b=t.from(b)),w.mode!=="GCM"&&b.length!==w.iv)throw new TypeError("invalid iv length "+b.length);if(typeof y=="string"&&(y=t.from(y)),y.length!==w.key/8)throw new TypeError("invalid key length "+y.length);return w.type==="stream"?new n(w.module,y,b,!0):w.type==="auth"?new e(w.module,y,b,!0):new s(w.module,y,b)}function p(h,y){var b=r[h.toLowerCase()];if(!b)throw new TypeError("invalid suite type");var w=u(y,!1,b.key,b.iv);return d(h,w.key,w.iv)}return decrypter.createDecipher=p,decrypter.createDecipheriv=d,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var e=requireEncrypter(),t=requireDecrypter(),r=require$$2;function n(){return Object.keys(r)}return browser$5.createCipher=browser$5.Cipher=e.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=e.createCipheriv,browser$5.createDecipher=browser$5.Decipher=t.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=t.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=n,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(function(e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}})(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var e=requireBrowserifyDes(),t=requireBrowser$6(),r=requireModes$1(),n=requireModes(),o=requireEvp_bytestokey();function i(c,d){c=c.toLowerCase();var p,h;if(r[c])p=r[c].key,h=r[c].iv;else if(n[c])p=n[c].key*8,h=n[c].iv;else throw new TypeError("invalid suite type");var y=o(d,!1,p,h);return a(c,y.key,y.iv)}function u(c,d){c=c.toLowerCase();var p,h;if(r[c])p=r[c].key,h=r[c].iv;else if(n[c])p=n[c].key*8,h=n[c].iv;else throw new TypeError("invalid suite type");var y=o(d,!1,p,h);return s(c,y.key,y.iv)}function a(c,d,p){if(c=c.toLowerCase(),r[c])return t.createCipheriv(c,d,p);if(n[c])return new e({key:d,iv:p,mode:c});throw new TypeError("invalid suite type")}function s(c,d,p){if(c=c.toLowerCase(),r[c])return t.createDecipheriv(c,d,p);if(n[c])return new e({key:d,iv:p,mode:c,decrypt:!0});throw new TypeError("invalid suite type")}function f(){return Object.keys(n).concat(t.getCiphers())}return browser$6.createCipher=browser$6.Cipher=i,browser$6.createCipheriv=browser$6.Cipheriv=a,browser$6.createDecipher=browser$6.Decipher=u,browser$6.createDecipheriv=browser$6.Decipheriv=s,browser$6.listCiphers=browser$6.getCiphers=f,browser$6}var browser$4={},bn$4={exports:{}},bn$3=bn$4.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,(function(e){(function(t,r){function n(sr,ce){if(!sr)throw new Error(ce||"Assertion failed")}function o(sr,ce){sr.super_=ce;var Ze=function(){};Ze.prototype=ce.prototype,sr.prototype=new Ze,sr.prototype.constructor=sr}function i(sr,ce,Ze){if(i.isBN(sr))return sr;this.negative=0,this.words=null,this.length=0,this.red=null,sr!==null&&((ce==="le"||ce==="be")&&(Ze=ce,ce=10),this._init(sr||0,ce||10,Ze||"be"))}typeof t=="object"?t.exports=i:r.BN=i,i.BN=i,i.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=requireBuffer$1().Buffer}catch{}i.isBN=function(ce){return ce instanceof i?!0:ce!==null&&typeof ce=="object"&&ce.constructor.wordSize===i.wordSize&&Array.isArray(ce.words)},i.max=function(ce,Ze){return ce.cmp(Ze)>0?ce:Ze},i.min=function(ce,Ze){return ce.cmp(Ze)<0?ce:Ze},i.prototype._init=function(ce,Ze,se){if(typeof ce=="number")return this._initNumber(ce,Ze,se);if(typeof ce=="object")return this._initArray(ce,Ze,se);Ze==="hex"&&(Ze=16),n(Ze===(Ze|0)&&Ze>=2&&Ze<=36),ce=ce.toString().replace(/\s+/g,"");var vt=0;ce[0]==="-"&&(vt++,this.negative=1),vt<ce.length&&(Ze===16?this._parseHex(ce,vt,se):(this._parseBase(ce,Ze,vt),se==="le"&&this._initArray(this.toArray(),Ze,se)))},i.prototype._initNumber=function(ce,Ze,se){ce<0&&(this.negative=1,ce=-ce),ce<67108864?(this.words=[ce&67108863],this.length=1):ce<4503599627370496?(this.words=[ce&67108863,ce/67108864&67108863],this.length=2):(n(ce<9007199254740992),this.words=[ce&67108863,ce/67108864&67108863,1],this.length=3),se==="le"&&this._initArray(this.toArray(),Ze,se)},i.prototype._initArray=function(ce,Ze,se){if(n(typeof ce.length=="number"),ce.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(ce.length/3),this.words=new Array(this.length);for(var vt=0;vt<this.length;vt++)this.words[vt]=0;var ur,ue,bt=0;if(se==="be")for(vt=ce.length-1,ur=0;vt>=0;vt-=3)ue=ce[vt]|ce[vt-1]<<8|ce[vt-2]<<16,this.words[ur]|=ue<<bt&67108863,this.words[ur+1]=ue>>>26-bt&67108863,bt+=24,bt>=26&&(bt-=26,ur++);else if(se==="le")for(vt=0,ur=0;vt<ce.length;vt+=3)ue=ce[vt]|ce[vt+1]<<8|ce[vt+2]<<16,this.words[ur]|=ue<<bt&67108863,this.words[ur+1]=ue>>>26-bt&67108863,bt+=24,bt>=26&&(bt-=26,ur++);return this.strip()};function a(sr,ce){var Ze=sr.charCodeAt(ce);return Ze>=65&&Ze<=70?Ze-55:Ze>=97&&Ze<=102?Ze-87:Ze-48&15}function s(sr,ce,Ze){var se=a(sr,Ze);return Ze-1>=ce&&(se|=a(sr,Ze-1)<<4),se}i.prototype._parseHex=function(ce,Ze,se){this.length=Math.ceil((ce.length-Ze)/6),this.words=new Array(this.length);for(var vt=0;vt<this.length;vt++)this.words[vt]=0;var ur=0,ue=0,bt;if(se==="be")for(vt=ce.length-1;vt>=Ze;vt-=2)bt=s(ce,Ze,vt)<<ur,this.words[ue]|=bt&67108863,ur>=18?(ur-=18,ue+=1,this.words[ue]|=bt>>>26):ur+=8;else{var L=ce.length-Ze;for(vt=L%2===0?Ze+1:Ze;vt<ce.length;vt+=2)bt=s(ce,Ze,vt)<<ur,this.words[ue]|=bt&67108863,ur>=18?(ur-=18,ue+=1,this.words[ue]|=bt>>>26):ur+=8}this.strip()};function f(sr,ce,Ze,se){for(var vt=0,ur=Math.min(sr.length,Ze),ue=ce;ue<ur;ue++){var bt=sr.charCodeAt(ue)-48;vt*=se,bt>=49?vt+=bt-49+10:bt>=17?vt+=bt-17+10:vt+=bt}return vt}i.prototype._parseBase=function(ce,Ze,se){this.words=[0],this.length=1;for(var vt=0,ur=1;ur<=67108863;ur*=Ze)vt++;vt--,ur=ur/Ze|0;for(var ue=ce.length-se,bt=ue%vt,L=Math.min(ue,ue-bt)+se,_=0,F=se;F<L;F+=vt)_=f(ce,F,F+vt,Ze),this.imuln(ur),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_);if(bt!==0){var k=1;for(_=f(ce,F,ce.length,Ze),F=0;F<bt;F++)k*=Ze;this.imuln(k),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_)}this.strip()},i.prototype.copy=function(ce){ce.words=new Array(this.length);for(var Ze=0;Ze<this.length;Ze++)ce.words[Ze]=this.words[Ze];ce.length=this.length,ce.negative=this.negative,ce.red=this.red},i.prototype.clone=function(){var ce=new i(null);return this.copy(ce),ce},i.prototype._expand=function(ce){for(;this.length<ce;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.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"],d=[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],p=[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];i.prototype.toString=function(ce,Ze){ce=ce||10,Ze=Ze|0||1;var se;if(ce===16||ce==="hex"){se="";for(var vt=0,ur=0,ue=0;ue<this.length;ue++){var bt=this.words[ue],L=((bt<<vt|ur)&16777215).toString(16);ur=bt>>>24-vt&16777215,vt+=2,vt>=26&&(vt-=26,ue--),ur!==0||ue!==this.length-1?se=c[6-L.length]+L+se:se=L+se}for(ur!==0&&(se=ur.toString(16)+se);se.length%Ze!==0;)se="0"+se;return this.negative!==0&&(se="-"+se),se}if(ce===(ce|0)&&ce>=2&&ce<=36){var _=d[ce],F=p[ce];se="";var k=this.clone();for(k.negative=0;!k.isZero();){var Ye=k.modn(F).toString(ce);k=k.idivn(F),k.isZero()?se=Ye+se:se=c[_-Ye.length]+Ye+se}for(this.isZero()&&(se="0"+se);se.length%Ze!==0;)se="0"+se;return this.negative!==0&&(se="-"+se),se}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var ce=this.words[0];return this.length===2?ce+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ce+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ce:ce},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(ce,Ze){return n(typeof u<"u"),this.toArrayLike(u,ce,Ze)},i.prototype.toArray=function(ce,Ze){return this.toArrayLike(Array,ce,Ze)},i.prototype.toArrayLike=function(ce,Ze,se){var vt=this.byteLength(),ur=se||Math.max(1,vt);n(vt<=ur,"byte array longer than desired length"),n(ur>0,"Requested array length <= 0"),this.strip();var ue=Ze==="le",bt=new ce(ur),L,_,F=this.clone();if(ue){for(_=0;!F.isZero();_++)L=F.andln(255),F.iushrn(8),bt[_]=L;for(;_<ur;_++)bt[_]=0}else{for(_=0;_<ur-vt;_++)bt[_]=0;for(_=0;!F.isZero();_++)L=F.andln(255),F.iushrn(8),bt[ur-_-1]=L}return bt},Math.clz32?i.prototype._countBits=function(ce){return 32-Math.clz32(ce)}:i.prototype._countBits=function(ce){var Ze=ce,se=0;return Ze>=4096&&(se+=13,Ze>>>=13),Ze>=64&&(se+=7,Ze>>>=7),Ze>=8&&(se+=4,Ze>>>=4),Ze>=2&&(se+=2,Ze>>>=2),se+Ze},i.prototype._zeroBits=function(ce){if(ce===0)return 26;var Ze=ce,se=0;return(Ze&8191)===0&&(se+=13,Ze>>>=13),(Ze&127)===0&&(se+=7,Ze>>>=7),(Ze&15)===0&&(se+=4,Ze>>>=4),(Ze&3)===0&&(se+=2,Ze>>>=2),(Ze&1)===0&&se++,se},i.prototype.bitLength=function(){var ce=this.words[this.length-1],Ze=this._countBits(ce);return(this.length-1)*26+Ze};function h(sr){for(var ce=new Array(sr.bitLength()),Ze=0;Ze<ce.length;Ze++){var se=Ze/26|0,vt=Ze%26;ce[Ze]=(sr.words[se]&1<<vt)>>>vt}return ce}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ce=0,Ze=0;Ze<this.length;Ze++){var se=this._zeroBits(this.words[Ze]);if(ce+=se,se!==26)break}return ce},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(ce){return this.negative!==0?this.abs().inotn(ce).iaddn(1):this.clone()},i.prototype.fromTwos=function(ce){return this.testn(ce-1)?this.notn(ce).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(ce){for(;this.length<ce.length;)this.words[this.length++]=0;for(var Ze=0;Ze<ce.length;Ze++)this.words[Ze]=this.words[Ze]|ce.words[Ze];return this.strip()},i.prototype.ior=function(ce){return n((this.negative|ce.negative)===0),this.iuor(ce)},i.prototype.or=function(ce){return this.length>ce.length?this.clone().ior(ce):ce.clone().ior(this)},i.prototype.uor=function(ce){return this.length>ce.length?this.clone().iuor(ce):ce.clone().iuor(this)},i.prototype.iuand=function(ce){var Ze;this.length>ce.length?Ze=ce:Ze=this;for(var se=0;se<Ze.length;se++)this.words[se]=this.words[se]&ce.words[se];return this.length=Ze.length,this.strip()},i.prototype.iand=function(ce){return n((this.negative|ce.negative)===0),this.iuand(ce)},i.prototype.and=function(ce){return this.length>ce.length?this.clone().iand(ce):ce.clone().iand(this)},i.prototype.uand=function(ce){return this.length>ce.length?this.clone().iuand(ce):ce.clone().iuand(this)},i.prototype.iuxor=function(ce){var Ze,se;this.length>ce.length?(Ze=this,se=ce):(Ze=ce,se=this);for(var vt=0;vt<se.length;vt++)this.words[vt]=Ze.words[vt]^se.words[vt];if(this!==Ze)for(;vt<Ze.length;vt++)this.words[vt]=Ze.words[vt];return this.length=Ze.length,this.strip()},i.prototype.ixor=function(ce){return n((this.negative|ce.negative)===0),this.iuxor(ce)},i.prototype.xor=function(ce){return this.length>ce.length?this.clone().ixor(ce):ce.clone().ixor(this)},i.prototype.uxor=function(ce){return this.length>ce.length?this.clone().iuxor(ce):ce.clone().iuxor(this)},i.prototype.inotn=function(ce){n(typeof ce=="number"&&ce>=0);var Ze=Math.ceil(ce/26)|0,se=ce%26;this._expand(Ze),se>0&&Ze--;for(var vt=0;vt<Ze;vt++)this.words[vt]=~this.words[vt]&67108863;return se>0&&(this.words[vt]=~this.words[vt]&67108863>>26-se),this.strip()},i.prototype.notn=function(ce){return this.clone().inotn(ce)},i.prototype.setn=function(ce,Ze){n(typeof ce=="number"&&ce>=0);var se=ce/26|0,vt=ce%26;return this._expand(se+1),Ze?this.words[se]=this.words[se]|1<<vt:this.words[se]=this.words[se]&~(1<<vt),this.strip()},i.prototype.iadd=function(ce){var Ze;if(this.negative!==0&&ce.negative===0)return this.negative=0,Ze=this.isub(ce),this.negative^=1,this._normSign();if(this.negative===0&&ce.negative!==0)return ce.negative=0,Ze=this.isub(ce),ce.negative=1,Ze._normSign();var se,vt;this.length>ce.length?(se=this,vt=ce):(se=ce,vt=this);for(var ur=0,ue=0;ue<vt.length;ue++)Ze=(se.words[ue]|0)+(vt.words[ue]|0)+ur,this.words[ue]=Ze&67108863,ur=Ze>>>26;for(;ur!==0&&ue<se.length;ue++)Ze=(se.words[ue]|0)+ur,this.words[ue]=Ze&67108863,ur=Ze>>>26;if(this.length=se.length,ur!==0)this.words[this.length]=ur,this.length++;else if(se!==this)for(;ue<se.length;ue++)this.words[ue]=se.words[ue];return this},i.prototype.add=function(ce){var Ze;return ce.negative!==0&&this.negative===0?(ce.negative=0,Ze=this.sub(ce),ce.negative^=1,Ze):ce.negative===0&&this.negative!==0?(this.negative=0,Ze=ce.sub(this),this.negative=1,Ze):this.length>ce.length?this.clone().iadd(ce):ce.clone().iadd(this)},i.prototype.isub=function(ce){if(ce.negative!==0){ce.negative=0;var Ze=this.iadd(ce);return ce.negative=1,Ze._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ce),this.negative=1,this._normSign();var se=this.cmp(ce);if(se===0)return this.negative=0,this.length=1,this.words[0]=0,this;var vt,ur;se>0?(vt=this,ur=ce):(vt=ce,ur=this);for(var ue=0,bt=0;bt<ur.length;bt++)Ze=(vt.words[bt]|0)-(ur.words[bt]|0)+ue,ue=Ze>>26,this.words[bt]=Ze&67108863;for(;ue!==0&&bt<vt.length;bt++)Ze=(vt.words[bt]|0)+ue,ue=Ze>>26,this.words[bt]=Ze&67108863;if(ue===0&&bt<vt.length&&vt!==this)for(;bt<vt.length;bt++)this.words[bt]=vt.words[bt];return this.length=Math.max(this.length,bt),vt!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(ce){return this.clone().isub(ce)};function y(sr,ce,Ze){Ze.negative=ce.negative^sr.negative;var se=sr.length+ce.length|0;Ze.length=se,se=se-1|0;var vt=sr.words[0]|0,ur=ce.words[0]|0,ue=vt*ur,bt=ue&67108863,L=ue/67108864|0;Ze.words[0]=bt;for(var _=1;_<se;_++){for(var F=L>>>26,k=L&67108863,Ye=Math.min(_,ce.length-1),rn=Math.max(0,_-sr.length+1);rn<=Ye;rn++){var ii=_-rn|0;vt=sr.words[ii]|0,ur=ce.words[rn]|0,ue=vt*ur+k,F+=ue/67108864|0,k=ue&67108863}Ze.words[_]=k|0,L=F|0}return L!==0?Ze.words[_]=L|0:Ze.length--,Ze.strip()}var b=function(ce,Ze,se){var vt=ce.words,ur=Ze.words,ue=se.words,bt=0,L,_,F,k=vt[0]|0,Ye=k&8191,rn=k>>>13,ii=vt[1]|0,ai=ii&8191,ni=ii>>>13,ri=vt[2]|0,ui=ri&8191,lr=ri>>>13,ar=vt[3]|0,jr=ar&8191,ci=ar>>>13,mi=vt[4]|0,pi=mi&8191,ei=mi>>>13,Gr=vt[5]|0,ti=Gr&8191,fi=Gr>>>13,bi=vt[6]|0,Ai=bi&8191,Bi=bi>>>13,qi=vt[7]|0,vn=qi&8191,di=qi>>>13,rr=vt[8]|0,on=rr&8191,si=rr>>>13,vi=vt[9]|0,Ei=vi&8191,Mi=vi>>>13,Di=ur[0]|0,Ii=Di&8191,Ci=Di>>>13,Vi=ur[1]|0,Hi=Vi&8191,Ji=Vi>>>13,no=ur[2]|0,co=no&8191,Fo=no>>>13,Io=ur[3]|0,Ro=Io&8191,Oo=Io>>>13,To=ur[4]|0,Po=To&8191,ia=To>>>13,Jo=ur[5]|0,ea=Jo&8191,zi=Jo>>>13,Gi=ur[6]|0,uo=Gi&8191,wo=Gi>>>13,xi=ur[7]|0,Fi=xi&8191,Ui=xi>>>13,gi=ur[8]|0,Li=gi&8191,Qi=gi>>>13,Wi=ur[9]|0,io=Wi&8191,lo=Wi>>>13;se.negative=ce.negative^Ze.negative,se.length=19,L=Math.imul(Ye,Ii),_=Math.imul(Ye,Ci),_=_+Math.imul(rn,Ii)|0,F=Math.imul(rn,Ci);var Ao=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,L=Math.imul(ai,Ii),_=Math.imul(ai,Ci),_=_+Math.imul(ni,Ii)|0,F=Math.imul(ni,Ci),L=L+Math.imul(Ye,Hi)|0,_=_+Math.imul(Ye,Ji)|0,_=_+Math.imul(rn,Hi)|0,F=F+Math.imul(rn,Ji)|0;var _o=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(_o>>>26)|0,_o&=67108863,L=Math.imul(ui,Ii),_=Math.imul(ui,Ci),_=_+Math.imul(lr,Ii)|0,F=Math.imul(lr,Ci),L=L+Math.imul(ai,Hi)|0,_=_+Math.imul(ai,Ji)|0,_=_+Math.imul(ni,Hi)|0,F=F+Math.imul(ni,Ji)|0,L=L+Math.imul(Ye,co)|0,_=_+Math.imul(Ye,Fo)|0,_=_+Math.imul(rn,co)|0,F=F+Math.imul(rn,Fo)|0;var ca=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ca>>>26)|0,ca&=67108863,L=Math.imul(jr,Ii),_=Math.imul(jr,Ci),_=_+Math.imul(ci,Ii)|0,F=Math.imul(ci,Ci),L=L+Math.imul(ui,Hi)|0,_=_+Math.imul(ui,Ji)|0,_=_+Math.imul(lr,Hi)|0,F=F+Math.imul(lr,Ji)|0,L=L+Math.imul(ai,co)|0,_=_+Math.imul(ai,Fo)|0,_=_+Math.imul(ni,co)|0,F=F+Math.imul(ni,Fo)|0,L=L+Math.imul(Ye,Ro)|0,_=_+Math.imul(Ye,Oo)|0,_=_+Math.imul(rn,Ro)|0,F=F+Math.imul(rn,Oo)|0;var Co=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(Co>>>26)|0,Co&=67108863,L=Math.imul(pi,Ii),_=Math.imul(pi,Ci),_=_+Math.imul(ei,Ii)|0,F=Math.imul(ei,Ci),L=L+Math.imul(jr,Hi)|0,_=_+Math.imul(jr,Ji)|0,_=_+Math.imul(ci,Hi)|0,F=F+Math.imul(ci,Ji)|0,L=L+Math.imul(ui,co)|0,_=_+Math.imul(ui,Fo)|0,_=_+Math.imul(lr,co)|0,F=F+Math.imul(lr,Fo)|0,L=L+Math.imul(ai,Ro)|0,_=_+Math.imul(ai,Oo)|0,_=_+Math.imul(ni,Ro)|0,F=F+Math.imul(ni,Oo)|0,L=L+Math.imul(Ye,Po)|0,_=_+Math.imul(Ye,ia)|0,_=_+Math.imul(rn,Po)|0,F=F+Math.imul(rn,ia)|0;var $o=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+($o>>>26)|0,$o&=67108863,L=Math.imul(ti,Ii),_=Math.imul(ti,Ci),_=_+Math.imul(fi,Ii)|0,F=Math.imul(fi,Ci),L=L+Math.imul(pi,Hi)|0,_=_+Math.imul(pi,Ji)|0,_=_+Math.imul(ei,Hi)|0,F=F+Math.imul(ei,Ji)|0,L=L+Math.imul(jr,co)|0,_=_+Math.imul(jr,Fo)|0,_=_+Math.imul(ci,co)|0,F=F+Math.imul(ci,Fo)|0,L=L+Math.imul(ui,Ro)|0,_=_+Math.imul(ui,Oo)|0,_=_+Math.imul(lr,Ro)|0,F=F+Math.imul(lr,Oo)|0,L=L+Math.imul(ai,Po)|0,_=_+Math.imul(ai,ia)|0,_=_+Math.imul(ni,Po)|0,F=F+Math.imul(ni,ia)|0,L=L+Math.imul(Ye,ea)|0,_=_+Math.imul(Ye,zi)|0,_=_+Math.imul(rn,ea)|0,F=F+Math.imul(rn,zi)|0;var ta=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ta>>>26)|0,ta&=67108863,L=Math.imul(Ai,Ii),_=Math.imul(Ai,Ci),_=_+Math.imul(Bi,Ii)|0,F=Math.imul(Bi,Ci),L=L+Math.imul(ti,Hi)|0,_=_+Math.imul(ti,Ji)|0,_=_+Math.imul(fi,Hi)|0,F=F+Math.imul(fi,Ji)|0,L=L+Math.imul(pi,co)|0,_=_+Math.imul(pi,Fo)|0,_=_+Math.imul(ei,co)|0,F=F+Math.imul(ei,Fo)|0,L=L+Math.imul(jr,Ro)|0,_=_+Math.imul(jr,Oo)|0,_=_+Math.imul(ci,Ro)|0,F=F+Math.imul(ci,Oo)|0,L=L+Math.imul(ui,Po)|0,_=_+Math.imul(ui,ia)|0,_=_+Math.imul(lr,Po)|0,F=F+Math.imul(lr,ia)|0,L=L+Math.imul(ai,ea)|0,_=_+Math.imul(ai,zi)|0,_=_+Math.imul(ni,ea)|0,F=F+Math.imul(ni,zi)|0,L=L+Math.imul(Ye,uo)|0,_=_+Math.imul(Ye,wo)|0,_=_+Math.imul(rn,uo)|0,F=F+Math.imul(rn,wo)|0;var sa=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(sa>>>26)|0,sa&=67108863,L=Math.imul(vn,Ii),_=Math.imul(vn,Ci),_=_+Math.imul(di,Ii)|0,F=Math.imul(di,Ci),L=L+Math.imul(Ai,Hi)|0,_=_+Math.imul(Ai,Ji)|0,_=_+Math.imul(Bi,Hi)|0,F=F+Math.imul(Bi,Ji)|0,L=L+Math.imul(ti,co)|0,_=_+Math.imul(ti,Fo)|0,_=_+Math.imul(fi,co)|0,F=F+Math.imul(fi,Fo)|0,L=L+Math.imul(pi,Ro)|0,_=_+Math.imul(pi,Oo)|0,_=_+Math.imul(ei,Ro)|0,F=F+Math.imul(ei,Oo)|0,L=L+Math.imul(jr,Po)|0,_=_+Math.imul(jr,ia)|0,_=_+Math.imul(ci,Po)|0,F=F+Math.imul(ci,ia)|0,L=L+Math.imul(ui,ea)|0,_=_+Math.imul(ui,zi)|0,_=_+Math.imul(lr,ea)|0,F=F+Math.imul(lr,zi)|0,L=L+Math.imul(ai,uo)|0,_=_+Math.imul(ai,wo)|0,_=_+Math.imul(ni,uo)|0,F=F+Math.imul(ni,wo)|0,L=L+Math.imul(Ye,Fi)|0,_=_+Math.imul(Ye,Ui)|0,_=_+Math.imul(rn,Fi)|0,F=F+Math.imul(rn,Ui)|0;var ga=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ga>>>26)|0,ga&=67108863,L=Math.imul(on,Ii),_=Math.imul(on,Ci),_=_+Math.imul(si,Ii)|0,F=Math.imul(si,Ci),L=L+Math.imul(vn,Hi)|0,_=_+Math.imul(vn,Ji)|0,_=_+Math.imul(di,Hi)|0,F=F+Math.imul(di,Ji)|0,L=L+Math.imul(Ai,co)|0,_=_+Math.imul(Ai,Fo)|0,_=_+Math.imul(Bi,co)|0,F=F+Math.imul(Bi,Fo)|0,L=L+Math.imul(ti,Ro)|0,_=_+Math.imul(ti,Oo)|0,_=_+Math.imul(fi,Ro)|0,F=F+Math.imul(fi,Oo)|0,L=L+Math.imul(pi,Po)|0,_=_+Math.imul(pi,ia)|0,_=_+Math.imul(ei,Po)|0,F=F+Math.imul(ei,ia)|0,L=L+Math.imul(jr,ea)|0,_=_+Math.imul(jr,zi)|0,_=_+Math.imul(ci,ea)|0,F=F+Math.imul(ci,zi)|0,L=L+Math.imul(ui,uo)|0,_=_+Math.imul(ui,wo)|0,_=_+Math.imul(lr,uo)|0,F=F+Math.imul(lr,wo)|0,L=L+Math.imul(ai,Fi)|0,_=_+Math.imul(ai,Ui)|0,_=_+Math.imul(ni,Fi)|0,F=F+Math.imul(ni,Ui)|0,L=L+Math.imul(Ye,Li)|0,_=_+Math.imul(Ye,Qi)|0,_=_+Math.imul(rn,Li)|0,F=F+Math.imul(rn,Qi)|0;var ya=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ya>>>26)|0,ya&=67108863,L=Math.imul(Ei,Ii),_=Math.imul(Ei,Ci),_=_+Math.imul(Mi,Ii)|0,F=Math.imul(Mi,Ci),L=L+Math.imul(on,Hi)|0,_=_+Math.imul(on,Ji)|0,_=_+Math.imul(si,Hi)|0,F=F+Math.imul(si,Ji)|0,L=L+Math.imul(vn,co)|0,_=_+Math.imul(vn,Fo)|0,_=_+Math.imul(di,co)|0,F=F+Math.imul(di,Fo)|0,L=L+Math.imul(Ai,Ro)|0,_=_+Math.imul(Ai,Oo)|0,_=_+Math.imul(Bi,Ro)|0,F=F+Math.imul(Bi,Oo)|0,L=L+Math.imul(ti,Po)|0,_=_+Math.imul(ti,ia)|0,_=_+Math.imul(fi,Po)|0,F=F+Math.imul(fi,ia)|0,L=L+Math.imul(pi,ea)|0,_=_+Math.imul(pi,zi)|0,_=_+Math.imul(ei,ea)|0,F=F+Math.imul(ei,zi)|0,L=L+Math.imul(jr,uo)|0,_=_+Math.imul(jr,wo)|0,_=_+Math.imul(ci,uo)|0,F=F+Math.imul(ci,wo)|0,L=L+Math.imul(ui,Fi)|0,_=_+Math.imul(ui,Ui)|0,_=_+Math.imul(lr,Fi)|0,F=F+Math.imul(lr,Ui)|0,L=L+Math.imul(ai,Li)|0,_=_+Math.imul(ai,Qi)|0,_=_+Math.imul(ni,Li)|0,F=F+Math.imul(ni,Qi)|0,L=L+Math.imul(Ye,io)|0,_=_+Math.imul(Ye,lo)|0,_=_+Math.imul(rn,io)|0,F=F+Math.imul(rn,lo)|0;var ma=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ma>>>26)|0,ma&=67108863,L=Math.imul(Ei,Hi),_=Math.imul(Ei,Ji),_=_+Math.imul(Mi,Hi)|0,F=Math.imul(Mi,Ji),L=L+Math.imul(on,co)|0,_=_+Math.imul(on,Fo)|0,_=_+Math.imul(si,co)|0,F=F+Math.imul(si,Fo)|0,L=L+Math.imul(vn,Ro)|0,_=_+Math.imul(vn,Oo)|0,_=_+Math.imul(di,Ro)|0,F=F+Math.imul(di,Oo)|0,L=L+Math.imul(Ai,Po)|0,_=_+Math.imul(Ai,ia)|0,_=_+Math.imul(Bi,Po)|0,F=F+Math.imul(Bi,ia)|0,L=L+Math.imul(ti,ea)|0,_=_+Math.imul(ti,zi)|0,_=_+Math.imul(fi,ea)|0,F=F+Math.imul(fi,zi)|0,L=L+Math.imul(pi,uo)|0,_=_+Math.imul(pi,wo)|0,_=_+Math.imul(ei,uo)|0,F=F+Math.imul(ei,wo)|0,L=L+Math.imul(jr,Fi)|0,_=_+Math.imul(jr,Ui)|0,_=_+Math.imul(ci,Fi)|0,F=F+Math.imul(ci,Ui)|0,L=L+Math.imul(ui,Li)|0,_=_+Math.imul(ui,Qi)|0,_=_+Math.imul(lr,Li)|0,F=F+Math.imul(lr,Qi)|0,L=L+Math.imul(ai,io)|0,_=_+Math.imul(ai,lo)|0,_=_+Math.imul(ni,io)|0,F=F+Math.imul(ni,lo)|0;var fa=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(fa>>>26)|0,fa&=67108863,L=Math.imul(Ei,co),_=Math.imul(Ei,Fo),_=_+Math.imul(Mi,co)|0,F=Math.imul(Mi,Fo),L=L+Math.imul(on,Ro)|0,_=_+Math.imul(on,Oo)|0,_=_+Math.imul(si,Ro)|0,F=F+Math.imul(si,Oo)|0,L=L+Math.imul(vn,Po)|0,_=_+Math.imul(vn,ia)|0,_=_+Math.imul(di,Po)|0,F=F+Math.imul(di,ia)|0,L=L+Math.imul(Ai,ea)|0,_=_+Math.imul(Ai,zi)|0,_=_+Math.imul(Bi,ea)|0,F=F+Math.imul(Bi,zi)|0,L=L+Math.imul(ti,uo)|0,_=_+Math.imul(ti,wo)|0,_=_+Math.imul(fi,uo)|0,F=F+Math.imul(fi,wo)|0,L=L+Math.imul(pi,Fi)|0,_=_+Math.imul(pi,Ui)|0,_=_+Math.imul(ei,Fi)|0,F=F+Math.imul(ei,Ui)|0,L=L+Math.imul(jr,Li)|0,_=_+Math.imul(jr,Qi)|0,_=_+Math.imul(ci,Li)|0,F=F+Math.imul(ci,Qi)|0,L=L+Math.imul(ui,io)|0,_=_+Math.imul(ui,lo)|0,_=_+Math.imul(lr,io)|0,F=F+Math.imul(lr,lo)|0;var ra=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ra>>>26)|0,ra&=67108863,L=Math.imul(Ei,Ro),_=Math.imul(Ei,Oo),_=_+Math.imul(Mi,Ro)|0,F=Math.imul(Mi,Oo),L=L+Math.imul(on,Po)|0,_=_+Math.imul(on,ia)|0,_=_+Math.imul(si,Po)|0,F=F+Math.imul(si,ia)|0,L=L+Math.imul(vn,ea)|0,_=_+Math.imul(vn,zi)|0,_=_+Math.imul(di,ea)|0,F=F+Math.imul(di,zi)|0,L=L+Math.imul(Ai,uo)|0,_=_+Math.imul(Ai,wo)|0,_=_+Math.imul(Bi,uo)|0,F=F+Math.imul(Bi,wo)|0,L=L+Math.imul(ti,Fi)|0,_=_+Math.imul(ti,Ui)|0,_=_+Math.imul(fi,Fi)|0,F=F+Math.imul(fi,Ui)|0,L=L+Math.imul(pi,Li)|0,_=_+Math.imul(pi,Qi)|0,_=_+Math.imul(ei,Li)|0,F=F+Math.imul(ei,Qi)|0,L=L+Math.imul(jr,io)|0,_=_+Math.imul(jr,lo)|0,_=_+Math.imul(ci,io)|0,F=F+Math.imul(ci,lo)|0;var ha=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ha>>>26)|0,ha&=67108863,L=Math.imul(Ei,Po),_=Math.imul(Ei,ia),_=_+Math.imul(Mi,Po)|0,F=Math.imul(Mi,ia),L=L+Math.imul(on,ea)|0,_=_+Math.imul(on,zi)|0,_=_+Math.imul(si,ea)|0,F=F+Math.imul(si,zi)|0,L=L+Math.imul(vn,uo)|0,_=_+Math.imul(vn,wo)|0,_=_+Math.imul(di,uo)|0,F=F+Math.imul(di,wo)|0,L=L+Math.imul(Ai,Fi)|0,_=_+Math.imul(Ai,Ui)|0,_=_+Math.imul(Bi,Fi)|0,F=F+Math.imul(Bi,Ui)|0,L=L+Math.imul(ti,Li)|0,_=_+Math.imul(ti,Qi)|0,_=_+Math.imul(fi,Li)|0,F=F+Math.imul(fi,Qi)|0,L=L+Math.imul(pi,io)|0,_=_+Math.imul(pi,lo)|0,_=_+Math.imul(ei,io)|0,F=F+Math.imul(ei,lo)|0;var Wo=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,L=Math.imul(Ei,ea),_=Math.imul(Ei,zi),_=_+Math.imul(Mi,ea)|0,F=Math.imul(Mi,zi),L=L+Math.imul(on,uo)|0,_=_+Math.imul(on,wo)|0,_=_+Math.imul(si,uo)|0,F=F+Math.imul(si,wo)|0,L=L+Math.imul(vn,Fi)|0,_=_+Math.imul(vn,Ui)|0,_=_+Math.imul(di,Fi)|0,F=F+Math.imul(di,Ui)|0,L=L+Math.imul(Ai,Li)|0,_=_+Math.imul(Ai,Qi)|0,_=_+Math.imul(Bi,Li)|0,F=F+Math.imul(Bi,Qi)|0,L=L+Math.imul(ti,io)|0,_=_+Math.imul(ti,lo)|0,_=_+Math.imul(fi,io)|0,F=F+Math.imul(fi,lo)|0;var na=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(na>>>26)|0,na&=67108863,L=Math.imul(Ei,uo),_=Math.imul(Ei,wo),_=_+Math.imul(Mi,uo)|0,F=Math.imul(Mi,wo),L=L+Math.imul(on,Fi)|0,_=_+Math.imul(on,Ui)|0,_=_+Math.imul(si,Fi)|0,F=F+Math.imul(si,Ui)|0,L=L+Math.imul(vn,Li)|0,_=_+Math.imul(vn,Qi)|0,_=_+Math.imul(di,Li)|0,F=F+Math.imul(di,Qi)|0,L=L+Math.imul(Ai,io)|0,_=_+Math.imul(Ai,lo)|0,_=_+Math.imul(Bi,io)|0,F=F+Math.imul(Bi,lo)|0;var la=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(la>>>26)|0,la&=67108863,L=Math.imul(Ei,Fi),_=Math.imul(Ei,Ui),_=_+Math.imul(Mi,Fi)|0,F=Math.imul(Mi,Ui),L=L+Math.imul(on,Li)|0,_=_+Math.imul(on,Qi)|0,_=_+Math.imul(si,Li)|0,F=F+Math.imul(si,Qi)|0,L=L+Math.imul(vn,io)|0,_=_+Math.imul(vn,lo)|0,_=_+Math.imul(di,io)|0,F=F+Math.imul(di,lo)|0;var Yo=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,L=Math.imul(Ei,Li),_=Math.imul(Ei,Qi),_=_+Math.imul(Mi,Li)|0,F=Math.imul(Mi,Qi),L=L+Math.imul(on,io)|0,_=_+Math.imul(on,lo)|0,_=_+Math.imul(si,io)|0,F=F+Math.imul(si,lo)|0;var ho=(bt+L|0)+((_&8191)<<13)|0;bt=(F+(_>>>13)|0)+(ho>>>26)|0,ho&=67108863,L=Math.imul(Ei,io),_=Math.imul(Ei,lo),_=_+Math.imul(Mi,io)|0,F=Math.imul(Mi,lo);var yo=(bt+L|0)+((_&8191)<<13)|0;return bt=(F+(_>>>13)|0)+(yo>>>26)|0,yo&=67108863,ue[0]=Ao,ue[1]=_o,ue[2]=ca,ue[3]=Co,ue[4]=$o,ue[5]=ta,ue[6]=sa,ue[7]=ga,ue[8]=ya,ue[9]=ma,ue[10]=fa,ue[11]=ra,ue[12]=ha,ue[13]=Wo,ue[14]=na,ue[15]=la,ue[16]=Yo,ue[17]=ho,ue[18]=yo,bt!==0&&(ue[19]=bt,se.length++),se};Math.imul||(b=y);function w(sr,ce,Ze){Ze.negative=ce.negative^sr.negative,Ze.length=sr.length+ce.length;for(var se=0,vt=0,ur=0;ur<Ze.length-1;ur++){var ue=vt;vt=0;for(var bt=se&67108863,L=Math.min(ur,ce.length-1),_=Math.max(0,ur-sr.length+1);_<=L;_++){var F=ur-_,k=sr.words[F]|0,Ye=ce.words[_]|0,rn=k*Ye,ii=rn&67108863;ue=ue+(rn/67108864|0)|0,ii=ii+bt|0,bt=ii&67108863,ue=ue+(ii>>>26)|0,vt+=ue>>>26,ue&=67108863}Ze.words[ur]=bt,se=ue,ue=vt}return se!==0?Ze.words[ur]=se:Ze.length--,Ze.strip()}function S(sr,ce,Ze){var se=new E;return se.mulp(sr,ce,Ze)}i.prototype.mulTo=function(ce,Ze){var se,vt=this.length+ce.length;return this.length===10&&ce.length===10?se=b(this,ce,Ze):vt<63?se=y(this,ce,Ze):vt<1024?se=w(this,ce,Ze):se=S(this,ce,Ze),se};function E(sr,ce){this.x=sr,this.y=ce}E.prototype.makeRBT=function(ce){for(var Ze=new Array(ce),se=i.prototype._countBits(ce)-1,vt=0;vt<ce;vt++)Ze[vt]=this.revBin(vt,se,ce);return Ze},E.prototype.revBin=function(ce,Ze,se){if(ce===0||ce===se-1)return ce;for(var vt=0,ur=0;ur<Ze;ur++)vt|=(ce&1)<<Ze-ur-1,ce>>=1;return vt},E.prototype.permute=function(ce,Ze,se,vt,ur,ue){for(var bt=0;bt<ue;bt++)vt[bt]=Ze[ce[bt]],ur[bt]=se[ce[bt]]},E.prototype.transform=function(ce,Ze,se,vt,ur,ue){this.permute(ue,ce,Ze,se,vt,ur);for(var bt=1;bt<ur;bt<<=1)for(var L=bt<<1,_=Math.cos(2*Math.PI/L),F=Math.sin(2*Math.PI/L),k=0;k<ur;k+=L)for(var Ye=_,rn=F,ii=0;ii<bt;ii++){var ai=se[k+ii],ni=vt[k+ii],ri=se[k+ii+bt],ui=vt[k+ii+bt],lr=Ye*ri-rn*ui;ui=Ye*ui+rn*ri,ri=lr,se[k+ii]=ai+ri,vt[k+ii]=ni+ui,se[k+ii+bt]=ai-ri,vt[k+ii+bt]=ni-ui,ii!==L&&(lr=_*Ye-F*rn,rn=_*rn+F*Ye,Ye=lr)}},E.prototype.guessLen13b=function(ce,Ze){var se=Math.max(Ze,ce)|1,vt=se&1,ur=0;for(se=se/2|0;se;se=se>>>1)ur++;return 1<<ur+1+vt},E.prototype.conjugate=function(ce,Ze,se){if(!(se<=1))for(var vt=0;vt<se/2;vt++){var ur=ce[vt];ce[vt]=ce[se-vt-1],ce[se-vt-1]=ur,ur=Ze[vt],Ze[vt]=-Ze[se-vt-1],Ze[se-vt-1]=-ur}},E.prototype.normalize13b=function(ce,Ze){for(var se=0,vt=0;vt<Ze/2;vt++){var ur=Math.round(ce[2*vt+1]/Ze)*8192+Math.round(ce[2*vt]/Ze)+se;ce[vt]=ur&67108863,ur<67108864?se=0:se=ur/67108864|0}return ce},E.prototype.convert13b=function(ce,Ze,se,vt){for(var ur=0,ue=0;ue<Ze;ue++)ur=ur+(ce[ue]|0),se[2*ue]=ur&8191,ur=ur>>>13,se[2*ue+1]=ur&8191,ur=ur>>>13;for(ue=2*Ze;ue<vt;++ue)se[ue]=0;n(ur===0),n((ur&-8192)===0)},E.prototype.stub=function(ce){for(var Ze=new Array(ce),se=0;se<ce;se++)Ze[se]=0;return Ze},E.prototype.mulp=function(ce,Ze,se){var vt=2*this.guessLen13b(ce.length,Ze.length),ur=this.makeRBT(vt),ue=this.stub(vt),bt=new Array(vt),L=new Array(vt),_=new Array(vt),F=new Array(vt),k=new Array(vt),Ye=new Array(vt),rn=se.words;rn.length=vt,this.convert13b(ce.words,ce.length,bt,vt),this.convert13b(Ze.words,Ze.length,F,vt),this.transform(bt,ue,L,_,vt,ur),this.transform(F,ue,k,Ye,vt,ur);for(var ii=0;ii<vt;ii++){var ai=L[ii]*k[ii]-_[ii]*Ye[ii];_[ii]=L[ii]*Ye[ii]+_[ii]*k[ii],L[ii]=ai}return this.conjugate(L,_,vt),this.transform(L,_,rn,ue,vt,ur),this.conjugate(rn,ue,vt),this.normalize13b(rn,vt),se.negative=ce.negative^Ze.negative,se.length=ce.length+Ze.length,se.strip()},i.prototype.mul=function(ce){var Ze=new i(null);return Ze.words=new Array(this.length+ce.length),this.mulTo(ce,Ze)},i.prototype.mulf=function(ce){var Ze=new i(null);return Ze.words=new Array(this.length+ce.length),S(this,ce,Ze)},i.prototype.imul=function(ce){return this.clone().mulTo(ce,this)},i.prototype.imuln=function(ce){n(typeof ce=="number"),n(ce<67108864);for(var Ze=0,se=0;se<this.length;se++){var vt=(this.words[se]|0)*ce,ur=(vt&67108863)+(Ze&67108863);Ze>>=26,Ze+=vt/67108864|0,Ze+=ur>>>26,this.words[se]=ur&67108863}return Ze!==0&&(this.words[se]=Ze,this.length++),this.length=ce===0?1:this.length,this},i.prototype.muln=function(ce){return this.clone().imuln(ce)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(ce){var Ze=h(ce);if(Ze.length===0)return new i(1);for(var se=this,vt=0;vt<Ze.length&&Ze[vt]===0;vt++,se=se.sqr());if(++vt<Ze.length)for(var ur=se.sqr();vt<Ze.length;vt++,ur=ur.sqr())Ze[vt]!==0&&(se=se.mul(ur));return se},i.prototype.iushln=function(ce){n(typeof ce=="number"&&ce>=0);var Ze=ce%26,se=(ce-Ze)/26,vt=67108863>>>26-Ze<<26-Ze,ur;if(Ze!==0){var ue=0;for(ur=0;ur<this.length;ur++){var bt=this.words[ur]&vt,L=(this.words[ur]|0)-bt<<Ze;this.words[ur]=L|ue,ue=bt>>>26-Ze}ue&&(this.words[ur]=ue,this.length++)}if(se!==0){for(ur=this.length-1;ur>=0;ur--)this.words[ur+se]=this.words[ur];for(ur=0;ur<se;ur++)this.words[ur]=0;this.length+=se}return this.strip()},i.prototype.ishln=function(ce){return n(this.negative===0),this.iushln(ce)},i.prototype.iushrn=function(ce,Ze,se){n(typeof ce=="number"&&ce>=0);var vt;Ze?vt=(Ze-Ze%26)/26:vt=0;var ur=ce%26,ue=Math.min((ce-ur)/26,this.length),bt=67108863^67108863>>>ur<<ur,L=se;if(vt-=ue,vt=Math.max(0,vt),L){for(var _=0;_<ue;_++)L.words[_]=this.words[_];L.length=ue}if(ue!==0)if(this.length>ue)for(this.length-=ue,_=0;_<this.length;_++)this.words[_]=this.words[_+ue];else this.words[0]=0,this.length=1;var F=0;for(_=this.length-1;_>=0&&(F!==0||_>=vt);_--){var k=this.words[_]|0;this.words[_]=F<<26-ur|k>>>ur,F=k&bt}return L&&F!==0&&(L.words[L.length++]=F),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(ce,Ze,se){return n(this.negative===0),this.iushrn(ce,Ze,se)},i.prototype.shln=function(ce){return this.clone().ishln(ce)},i.prototype.ushln=function(ce){return this.clone().iushln(ce)},i.prototype.shrn=function(ce){return this.clone().ishrn(ce)},i.prototype.ushrn=function(ce){return this.clone().iushrn(ce)},i.prototype.testn=function(ce){n(typeof ce=="number"&&ce>=0);var Ze=ce%26,se=(ce-Ze)/26,vt=1<<Ze;if(this.length<=se)return!1;var ur=this.words[se];return!!(ur&vt)},i.prototype.imaskn=function(ce){n(typeof ce=="number"&&ce>=0);var Ze=ce%26,se=(ce-Ze)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=se)return this;if(Ze!==0&&se++,this.length=Math.min(se,this.length),Ze!==0){var vt=67108863^67108863>>>Ze<<Ze;this.words[this.length-1]&=vt}return this.strip()},i.prototype.maskn=function(ce){return this.clone().imaskn(ce)},i.prototype.iaddn=function(ce){return n(typeof ce=="number"),n(ce<67108864),ce<0?this.isubn(-ce):this.negative!==0?this.length===1&&(this.words[0]|0)<ce?(this.words[0]=ce-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(ce),this.negative=1,this):this._iaddn(ce)},i.prototype._iaddn=function(ce){this.words[0]+=ce;for(var Ze=0;Ze<this.length&&this.words[Ze]>=67108864;Ze++)this.words[Ze]-=67108864,Ze===this.length-1?this.words[Ze+1]=1:this.words[Ze+1]++;return this.length=Math.max(this.length,Ze+1),this},i.prototype.isubn=function(ce){if(n(typeof ce=="number"),n(ce<67108864),ce<0)return this.iaddn(-ce);if(this.negative!==0)return this.negative=0,this.iaddn(ce),this.negative=1,this;if(this.words[0]-=ce,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ze=0;Ze<this.length&&this.words[Ze]<0;Ze++)this.words[Ze]+=67108864,this.words[Ze+1]-=1;return this.strip()},i.prototype.addn=function(ce){return this.clone().iaddn(ce)},i.prototype.subn=function(ce){return this.clone().isubn(ce)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(ce,Ze,se){var vt=ce.length+se,ur;this._expand(vt);var ue,bt=0;for(ur=0;ur<ce.length;ur++){ue=(this.words[ur+se]|0)+bt;var L=(ce.words[ur]|0)*Ze;ue-=L&67108863,bt=(ue>>26)-(L/67108864|0),this.words[ur+se]=ue&67108863}for(;ur<this.length-se;ur++)ue=(this.words[ur+se]|0)+bt,bt=ue>>26,this.words[ur+se]=ue&67108863;if(bt===0)return this.strip();for(n(bt===-1),bt=0,ur=0;ur<this.length;ur++)ue=-(this.words[ur]|0)+bt,bt=ue>>26,this.words[ur]=ue&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(ce,Ze){var se=this.length-ce.length,vt=this.clone(),ur=ce,ue=ur.words[ur.length-1]|0,bt=this._countBits(ue);se=26-bt,se!==0&&(ur=ur.ushln(se),vt.iushln(se),ue=ur.words[ur.length-1]|0);var L=vt.length-ur.length,_;if(Ze!=="mod"){_=new i(null),_.length=L+1,_.words=new Array(_.length);for(var F=0;F<_.length;F++)_.words[F]=0}var k=vt.clone()._ishlnsubmul(ur,1,L);k.negative===0&&(vt=k,_&&(_.words[L]=1));for(var Ye=L-1;Ye>=0;Ye--){var rn=(vt.words[ur.length+Ye]|0)*67108864+(vt.words[ur.length+Ye-1]|0);for(rn=Math.min(rn/ue|0,67108863),vt._ishlnsubmul(ur,rn,Ye);vt.negative!==0;)rn--,vt.negative=0,vt._ishlnsubmul(ur,1,Ye),vt.isZero()||(vt.negative^=1);_&&(_.words[Ye]=rn)}return _&&_.strip(),vt.strip(),Ze!=="div"&&se!==0&&vt.iushrn(se),{div:_||null,mod:vt}},i.prototype.divmod=function(ce,Ze,se){if(n(!ce.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var vt,ur,ue;return this.negative!==0&&ce.negative===0?(ue=this.neg().divmod(ce,Ze),Ze!=="mod"&&(vt=ue.div.neg()),Ze!=="div"&&(ur=ue.mod.neg(),se&&ur.negative!==0&&ur.iadd(ce)),{div:vt,mod:ur}):this.negative===0&&ce.negative!==0?(ue=this.divmod(ce.neg(),Ze),Ze!=="mod"&&(vt=ue.div.neg()),{div:vt,mod:ue.mod}):(this.negative&ce.negative)!==0?(ue=this.neg().divmod(ce.neg(),Ze),Ze!=="div"&&(ur=ue.mod.neg(),se&&ur.negative!==0&&ur.isub(ce)),{div:ue.div,mod:ur}):ce.length>this.length||this.cmp(ce)<0?{div:new i(0),mod:this}:ce.length===1?Ze==="div"?{div:this.divn(ce.words[0]),mod:null}:Ze==="mod"?{div:null,mod:new i(this.modn(ce.words[0]))}:{div:this.divn(ce.words[0]),mod:new i(this.modn(ce.words[0]))}:this._wordDiv(ce,Ze)},i.prototype.div=function(ce){return this.divmod(ce,"div",!1).div},i.prototype.mod=function(ce){return this.divmod(ce,"mod",!1).mod},i.prototype.umod=function(ce){return this.divmod(ce,"mod",!0).mod},i.prototype.divRound=function(ce){var Ze=this.divmod(ce);if(Ze.mod.isZero())return Ze.div;var se=Ze.div.negative!==0?Ze.mod.isub(ce):Ze.mod,vt=ce.ushrn(1),ur=ce.andln(1),ue=se.cmp(vt);return ue<0||ur===1&&ue===0?Ze.div:Ze.div.negative!==0?Ze.div.isubn(1):Ze.div.iaddn(1)},i.prototype.modn=function(ce){n(ce<=67108863);for(var Ze=(1<<26)%ce,se=0,vt=this.length-1;vt>=0;vt--)se=(Ze*se+(this.words[vt]|0))%ce;return se},i.prototype.idivn=function(ce){n(ce<=67108863);for(var Ze=0,se=this.length-1;se>=0;se--){var vt=(this.words[se]|0)+Ze*67108864;this.words[se]=vt/ce|0,Ze=vt%ce}return this.strip()},i.prototype.divn=function(ce){return this.clone().idivn(ce)},i.prototype.egcd=function(ce){n(ce.negative===0),n(!ce.isZero());var Ze=this,se=ce.clone();Ze.negative!==0?Ze=Ze.umod(ce):Ze=Ze.clone();for(var vt=new i(1),ur=new i(0),ue=new i(0),bt=new i(1),L=0;Ze.isEven()&&se.isEven();)Ze.iushrn(1),se.iushrn(1),++L;for(var _=se.clone(),F=Ze.clone();!Ze.isZero();){for(var k=0,Ye=1;(Ze.words[0]&Ye)===0&&k<26;++k,Ye<<=1);if(k>0)for(Ze.iushrn(k);k-- >0;)(vt.isOdd()||ur.isOdd())&&(vt.iadd(_),ur.isub(F)),vt.iushrn(1),ur.iushrn(1);for(var rn=0,ii=1;(se.words[0]&ii)===0&&rn<26;++rn,ii<<=1);if(rn>0)for(se.iushrn(rn);rn-- >0;)(ue.isOdd()||bt.isOdd())&&(ue.iadd(_),bt.isub(F)),ue.iushrn(1),bt.iushrn(1);Ze.cmp(se)>=0?(Ze.isub(se),vt.isub(ue),ur.isub(bt)):(se.isub(Ze),ue.isub(vt),bt.isub(ur))}return{a:ue,b:bt,gcd:se.iushln(L)}},i.prototype._invmp=function(ce){n(ce.negative===0),n(!ce.isZero());var Ze=this,se=ce.clone();Ze.negative!==0?Ze=Ze.umod(ce):Ze=Ze.clone();for(var vt=new i(1),ur=new i(0),ue=se.clone();Ze.cmpn(1)>0&&se.cmpn(1)>0;){for(var bt=0,L=1;(Ze.words[0]&L)===0&&bt<26;++bt,L<<=1);if(bt>0)for(Ze.iushrn(bt);bt-- >0;)vt.isOdd()&&vt.iadd(ue),vt.iushrn(1);for(var _=0,F=1;(se.words[0]&F)===0&&_<26;++_,F<<=1);if(_>0)for(se.iushrn(_);_-- >0;)ur.isOdd()&&ur.iadd(ue),ur.iushrn(1);Ze.cmp(se)>=0?(Ze.isub(se),vt.isub(ur)):(se.isub(Ze),ur.isub(vt))}var k;return Ze.cmpn(1)===0?k=vt:k=ur,k.cmpn(0)<0&&k.iadd(ce),k},i.prototype.gcd=function(ce){if(this.isZero())return ce.abs();if(ce.isZero())return this.abs();var Ze=this.clone(),se=ce.clone();Ze.negative=0,se.negative=0;for(var vt=0;Ze.isEven()&&se.isEven();vt++)Ze.iushrn(1),se.iushrn(1);do{for(;Ze.isEven();)Ze.iushrn(1);for(;se.isEven();)se.iushrn(1);var ur=Ze.cmp(se);if(ur<0){var ue=Ze;Ze=se,se=ue}else if(ur===0||se.cmpn(1)===0)break;Ze.isub(se)}while(!0);return se.iushln(vt)},i.prototype.invm=function(ce){return this.egcd(ce).a.umod(ce)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(ce){return this.words[0]&ce},i.prototype.bincn=function(ce){n(typeof ce=="number");var Ze=ce%26,se=(ce-Ze)/26,vt=1<<Ze;if(this.length<=se)return this._expand(se+1),this.words[se]|=vt,this;for(var ur=vt,ue=se;ur!==0&&ue<this.length;ue++){var bt=this.words[ue]|0;bt+=ur,ur=bt>>>26,bt&=67108863,this.words[ue]=bt}return ur!==0&&(this.words[ue]=ur,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(ce){var Ze=ce<0;if(this.negative!==0&&!Ze)return-1;if(this.negative===0&&Ze)return 1;this.strip();var se;if(this.length>1)se=1;else{Ze&&(ce=-ce),n(ce<=67108863,"Number is too big");var vt=this.words[0]|0;se=vt===ce?0:vt<ce?-1:1}return this.negative!==0?-se|0:se},i.prototype.cmp=function(ce){if(this.negative!==0&&ce.negative===0)return-1;if(this.negative===0&&ce.negative!==0)return 1;var Ze=this.ucmp(ce);return this.negative!==0?-Ze|0:Ze},i.prototype.ucmp=function(ce){if(this.length>ce.length)return 1;if(this.length<ce.length)return-1;for(var Ze=0,se=this.length-1;se>=0;se--){var vt=this.words[se]|0,ur=ce.words[se]|0;if(vt!==ur){vt<ur?Ze=-1:vt>ur&&(Ze=1);break}}return Ze},i.prototype.gtn=function(ce){return this.cmpn(ce)===1},i.prototype.gt=function(ce){return this.cmp(ce)===1},i.prototype.gten=function(ce){return this.cmpn(ce)>=0},i.prototype.gte=function(ce){return this.cmp(ce)>=0},i.prototype.ltn=function(ce){return this.cmpn(ce)===-1},i.prototype.lt=function(ce){return this.cmp(ce)===-1},i.prototype.lten=function(ce){return this.cmpn(ce)<=0},i.prototype.lte=function(ce){return this.cmp(ce)<=0},i.prototype.eqn=function(ce){return this.cmpn(ce)===0},i.prototype.eq=function(ce){return this.cmp(ce)===0},i.red=function(ce){return new kt(ce)},i.prototype.toRed=function(ce){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),ce.convertTo(this)._forceRed(ce)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(ce){return this.red=ce,this},i.prototype.forceRed=function(ce){return n(!this.red,"Already a number in reduction context"),this._forceRed(ce)},i.prototype.redAdd=function(ce){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,ce)},i.prototype.redIAdd=function(ce){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ce)},i.prototype.redSub=function(ce){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,ce)},i.prototype.redISub=function(ce){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,ce)},i.prototype.redShl=function(ce){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,ce)},i.prototype.redMul=function(ce){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,ce),this.red.mul(this,ce)},i.prototype.redIMul=function(ce){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,ce),this.red.imul(this,ce)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(ce){return n(this.red&&!ce.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ce)};var B={k256:null,p224:null,p192:null,p25519:null};function ae(sr,ce){this.name=sr,this.p=new i(ce,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}ae.prototype._tmp=function(){var ce=new i(null);return ce.words=new Array(Math.ceil(this.n/13)),ce},ae.prototype.ireduce=function(ce){var Ze=ce,se;do this.split(Ze,this.tmp),Ze=this.imulK(Ze),Ze=Ze.iadd(this.tmp),se=Ze.bitLength();while(se>this.n);var vt=se<this.n?-1:Ze.ucmp(this.p);return vt===0?(Ze.words[0]=0,Ze.length=1):vt>0?Ze.isub(this.p):Ze.strip!==void 0?Ze.strip():Ze._strip(),Ze},ae.prototype.split=function(ce,Ze){ce.iushrn(this.n,0,Ze)},ae.prototype.imulK=function(ce){return ce.imul(this.k)};function W(){ae.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(W,ae),W.prototype.split=function(ce,Ze){for(var se=4194303,vt=Math.min(ce.length,9),ur=0;ur<vt;ur++)Ze.words[ur]=ce.words[ur];if(Ze.length=vt,ce.length<=9){ce.words[0]=0,ce.length=1;return}var ue=ce.words[9];for(Ze.words[Ze.length++]=ue&se,ur=10;ur<ce.length;ur++){var bt=ce.words[ur]|0;ce.words[ur-10]=(bt&se)<<4|ue>>>22,ue=bt}ue>>>=22,ce.words[ur-10]=ue,ue===0&&ce.length>10?ce.length-=10:ce.length-=9},W.prototype.imulK=function(ce){ce.words[ce.length]=0,ce.words[ce.length+1]=0,ce.length+=2;for(var Ze=0,se=0;se<ce.length;se++){var vt=ce.words[se]|0;Ze+=vt*977,ce.words[se]=Ze&67108863,Ze=vt*64+(Ze/67108864|0)}return ce.words[ce.length-1]===0&&(ce.length--,ce.words[ce.length-1]===0&&ce.length--),ce};function J(){ae.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(J,ae);function ve(){ae.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(ve,ae);function Qe(){ae.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(Qe,ae),Qe.prototype.imulK=function(ce){for(var Ze=0,se=0;se<ce.length;se++){var vt=(ce.words[se]|0)*19+Ze,ur=vt&67108863;vt>>>=26,ce.words[se]=ur,Ze=vt}return Ze!==0&&(ce.words[ce.length++]=Ze),ce},i._prime=function(ce){if(B[ce])return B[ce];var Ze;if(ce==="k256")Ze=new W;else if(ce==="p224")Ze=new J;else if(ce==="p192")Ze=new ve;else if(ce==="p25519")Ze=new Qe;else throw new Error("Unknown prime "+ce);return B[ce]=Ze,Ze};function kt(sr){if(typeof sr=="string"){var ce=i._prime(sr);this.m=ce.p,this.prime=ce}else n(sr.gtn(1),"modulus must be greater than 1"),this.m=sr,this.prime=null}kt.prototype._verify1=function(ce){n(ce.negative===0,"red works only with positives"),n(ce.red,"red works only with red numbers")},kt.prototype._verify2=function(ce,Ze){n((ce.negative|Ze.negative)===0,"red works only with positives"),n(ce.red&&ce.red===Ze.red,"red works only with red numbers")},kt.prototype.imod=function(ce){return this.prime?this.prime.ireduce(ce)._forceRed(this):ce.umod(this.m)._forceRed(this)},kt.prototype.neg=function(ce){return ce.isZero()?ce.clone():this.m.sub(ce)._forceRed(this)},kt.prototype.add=function(ce,Ze){this._verify2(ce,Ze);var se=ce.add(Ze);return se.cmp(this.m)>=0&&se.isub(this.m),se._forceRed(this)},kt.prototype.iadd=function(ce,Ze){this._verify2(ce,Ze);var se=ce.iadd(Ze);return se.cmp(this.m)>=0&&se.isub(this.m),se},kt.prototype.sub=function(ce,Ze){this._verify2(ce,Ze);var se=ce.sub(Ze);return se.cmpn(0)<0&&se.iadd(this.m),se._forceRed(this)},kt.prototype.isub=function(ce,Ze){this._verify2(ce,Ze);var se=ce.isub(Ze);return se.cmpn(0)<0&&se.iadd(this.m),se},kt.prototype.shl=function(ce,Ze){return this._verify1(ce),this.imod(ce.ushln(Ze))},kt.prototype.imul=function(ce,Ze){return this._verify2(ce,Ze),this.imod(ce.imul(Ze))},kt.prototype.mul=function(ce,Ze){return this._verify2(ce,Ze),this.imod(ce.mul(Ze))},kt.prototype.isqr=function(ce){return this.imul(ce,ce.clone())},kt.prototype.sqr=function(ce){return this.mul(ce,ce)},kt.prototype.sqrt=function(ce){if(ce.isZero())return ce.clone();var Ze=this.m.andln(3);if(n(Ze%2===1),Ze===3){var se=this.m.add(new i(1)).iushrn(2);return this.pow(ce,se)}for(var vt=this.m.subn(1),ur=0;!vt.isZero()&&vt.andln(1)===0;)ur++,vt.iushrn(1);n(!vt.isZero());var ue=new i(1).toRed(this),bt=ue.redNeg(),L=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new i(2*_*_).toRed(this);this.pow(_,L).cmp(bt)!==0;)_.redIAdd(bt);for(var F=this.pow(_,vt),k=this.pow(ce,vt.addn(1).iushrn(1)),Ye=this.pow(ce,vt),rn=ur;Ye.cmp(ue)!==0;){for(var ii=Ye,ai=0;ii.cmp(ue)!==0;ai++)ii=ii.redSqr();n(ai<rn);var ni=this.pow(F,new i(1).iushln(rn-ai-1));k=k.redMul(ni),F=ni.redSqr(),Ye=Ye.redMul(F),rn=ai}return k},kt.prototype.invm=function(ce){var Ze=ce._invmp(this.m);return Ze.negative!==0?(Ze.negative=0,this.imod(Ze).redNeg()):this.imod(Ze)},kt.prototype.pow=function(ce,Ze){if(Ze.isZero())return new i(1).toRed(this);if(Ze.cmpn(1)===0)return ce.clone();var se=4,vt=new Array(1<<se);vt[0]=new i(1).toRed(this),vt[1]=ce;for(var ur=2;ur<vt.length;ur++)vt[ur]=this.mul(vt[ur-1],ce);var ue=vt[0],bt=0,L=0,_=Ze.bitLength()%26;for(_===0&&(_=26),ur=Ze.length-1;ur>=0;ur--){for(var F=Ze.words[ur],k=_-1;k>=0;k--){var Ye=F>>k&1;if(ue!==vt[0]&&(ue=this.sqr(ue)),Ye===0&&bt===0){L=0;continue}bt<<=1,bt|=Ye,L++,!(L!==se&&(ur!==0||k!==0))&&(ue=this.mul(ue,vt[bt]),L=0,bt=0)}_=26}return ue},kt.prototype.convertTo=function(ce){var Ze=ce.umod(this.m);return Ze===ce?Ze.clone():Ze},kt.prototype.convertFrom=function(ce){var Ze=ce.clone();return Ze.red=null,Ze},i.mont=function(ce){return new nr(ce)};function nr(sr){kt.call(this,sr),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(nr,kt),nr.prototype.convertTo=function(ce){return this.imod(ce.ushln(this.shift))},nr.prototype.convertFrom=function(ce){var Ze=this.imod(ce.mul(this.rinv));return Ze.red=null,Ze},nr.prototype.imul=function(ce,Ze){if(ce.isZero()||Ze.isZero())return ce.words[0]=0,ce.length=1,ce;var se=ce.imul(Ze),vt=se.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ur=se.isub(vt).iushrn(this.shift),ue=ur;return ur.cmp(this.m)>=0?ue=ur.isub(this.m):ur.cmpn(0)<0&&(ue=ur.iadd(this.m)),ue._forceRed(this)},nr.prototype.mul=function(ce,Ze){if(ce.isZero()||Ze.isZero())return new i(0)._forceRed(this);var se=ce.mul(Ze),vt=se.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ur=se.isub(vt).iushrn(this.shift),ue=ur;return ur.cmp(this.m)>=0?ue=ur.isub(this.m):ur.cmpn(0)<0&&(ue=ur.iadd(this.m)),ue._forceRed(this)},nr.prototype.invm=function(ce){var Ze=this.imod(ce._invmp(this.m).mul(this.r2));return Ze._forceRed(this)}})(e,bn$3)})(bn$4)),bn$4.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var e;brorand.exports=function(o){return e||(e=new t(null)),e.generate(o)};function t(n){this.rand=n}if(brorand.exports.Rand=t,t.prototype.generate=function(o){return this._rand(o)},t.prototype._rand=function(o){if(this.rand.getBytes)return this.rand.getBytes(o);for(var i=new Uint8Array(o),u=0;u<i.length;u++)i[u]=this.rand.getByte();return i},typeof self=="object")self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(o){var i=new Uint8Array(o);return self.crypto.getRandomValues(i),i}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(o){var i=new Uint8Array(o);return self.msCrypto.getRandomValues(i),i}:typeof window=="object"&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=requireCryptoBrowserify();if(typeof r.randomBytes!="function")throw new Error("Not supported");t.prototype._rand=function(o){return r.randomBytes(o)}}catch{}return brorand.exports}var mr$2,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr$2;hasRequiredMr=1;var e=requireBn$1(),t=requireBrorand();function r(n){this.rand=n||new t.Rand}return mr$2=r,r.create=function(o){return new r(o)},r.prototype._randbelow=function(o){var i=o.bitLength(),u=Math.ceil(i/8);do var a=new e(this.rand.generate(u));while(a.cmp(o)>=0);return a},r.prototype._randrange=function(o,i){var u=i.sub(o);return o.add(this._randbelow(u))},r.prototype.test=function(o,i,u){var a=o.bitLength(),s=e.mont(o),f=new e(1).toRed(s);i||(i=Math.max(1,a/48|0));for(var c=o.subn(1),d=0;!c.testn(d);d++);for(var p=o.shrn(d),h=c.toRed(s),y=!0;i>0;i--){var b=this._randrange(new e(2),c);u&&u(b);var w=b.toRed(s).redPow(p);if(!(w.cmp(f)===0||w.cmp(h)===0)){for(var S=1;S<d;S++){if(w=w.redSqr(),w.cmp(f)===0)return!1;if(w.cmp(h)===0)break}if(S===d)return!1}}return y},r.prototype.getDivisor=function(o,i){var u=o.bitLength(),a=e.mont(o),s=new e(1).toRed(a);i||(i=Math.max(1,u/48|0));for(var f=o.subn(1),c=0;!f.testn(c);c++);for(var d=o.shrn(c),p=f.toRed(a);i>0;i--){var h=this._randrange(new e(2),f),y=o.gcd(h);if(y.cmpn(1)!==0)return y;var b=h.toRed(a).redPow(d);if(!(b.cmp(s)===0||b.cmp(p)===0)){for(var w=1;w<c;w++){if(b=b.redSqr(),b.cmp(s)===0)return b.fromRed().subn(1).gcd(o);if(b.cmp(p)===0)break}if(w===c)return b=b.redSqr(),b.fromRed().subn(1).gcd(o)}}return!1},mr$2}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var e=requireBrowser$b();generatePrime=w,w.simpleSieve=y,w.fermatTest=b;var t=requireBn$1(),r=new t(24),n=requireMr(),o=new n,i=new t(1),u=new t(2),a=new t(5);new t(16),new t(8);var s=new t(10),f=new t(3);new t(7);var c=new t(11),d=new t(4);new t(12);var p=null;function h(){if(p!==null)return p;var S=1048576,E=[];E[0]=2;for(var B=1,ae=3;ae<S;ae+=2){for(var W=Math.ceil(Math.sqrt(ae)),J=0;J<B&&E[J]<=W&&ae%E[J]!==0;J++);B!==J&&E[J]<=W||(E[B++]=ae)}return p=E,E}function y(S){for(var E=h(),B=0;B<E.length;B++)if(S.modn(E[B])===0)return S.cmpn(E[B])===0;return!0}function b(S){var E=t.mont(S);return u.toRed(E).redPow(S.subn(1)).fromRed().cmpn(1)===0}function w(S,E){if(S<16)return E===2||E===5?new t([140,123]):new t([140,39]);E=new t(E);for(var B,ae;;){for(B=new t(e(Math.ceil(S/8)));B.bitLength()>S;)B.ishrn(1);if(B.isEven()&&B.iadd(i),B.testn(1)||B.iadd(u),E.cmp(u)){if(!E.cmp(a))for(;B.mod(s).cmp(f);)B.iadd(d)}else for(;B.mod(r).cmp(c);)B.iadd(d);if(ae=B.shrn(1),y(ae)&&y(B)&&b(ae)&&b(B)&&o.test(ae)&&o.test(B))return B}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var e=requireBn$1(),t=requireMr(),r=new t,n=new e(24),o=new e(11),i=new e(10),u=new e(3),a=new e(7),s=requireGeneratePrime(),f=requireBrowser$b();dh=y;function c(w,S){return S=S||"utf8",bufferExports.Buffer.isBuffer(w)||(w=new bufferExports.Buffer(w,S)),this._pub=new e(w),this}function d(w,S){return S=S||"utf8",bufferExports.Buffer.isBuffer(w)||(w=new bufferExports.Buffer(w,S)),this._priv=new e(w),this}var p={};function h(w,S){var E=S.toString("hex"),B=[E,w.toString(16)].join("_");if(B in p)return p[B];var ae=0;if(w.isEven()||!s.simpleSieve||!s.fermatTest(w)||!r.test(w))return ae+=1,E==="02"||E==="05"?ae+=8:ae+=4,p[B]=ae,ae;r.test(w.shrn(1))||(ae+=2);var W;switch(E){case"02":w.mod(n).cmp(o)&&(ae+=8);break;case"05":W=w.mod(i),W.cmp(u)&&W.cmp(a)&&(ae+=8);break;default:ae+=4}return p[B]=ae,ae}function y(w,S,E){this.setGenerator(S),this.__prime=new e(w),this._prime=e.mont(this.__prime),this._primeLen=w.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,E?(this.setPublicKey=c,this.setPrivateKey=d):this._primeCode=8}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=h(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new e(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(w){w=new e(w),w=w.toRed(this._prime);var S=w.redPow(this._priv).fromRed(),E=new bufferExports.Buffer(S.toArray()),B=this.getPrime();if(E.length<B.length){var ae=new bufferExports.Buffer(B.length-E.length);ae.fill(0),E=bufferExports.Buffer.concat([ae,E])}return E},y.prototype.getPublicKey=function(S){return b(this._pub,S)},y.prototype.getPrivateKey=function(S){return b(this._priv,S)},y.prototype.getPrime=function(w){return b(this.__prime,w)},y.prototype.getGenerator=function(w){return b(this._gen,w)},y.prototype.setGenerator=function(w,S){return S=S||"utf8",bufferExports.Buffer.isBuffer(w)||(w=new bufferExports.Buffer(w,S)),this.__gen=w,this._gen=new e(w),this};function b(w,S){var E=new bufferExports.Buffer(w.toArray());return S?E.toString(S):E}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var e=requireGeneratePrime(),t=require$$1$1,r=requireDh();function n(u){var a=new bufferExports.Buffer(t[u].prime,"hex"),s=new bufferExports.Buffer(t[u].gen,"hex");return new r(a,s)}var o={binary:!0,hex:!0,base64:!0};function i(u,a,s,f){return bufferExports.Buffer.isBuffer(a)||o[a]===void 0?i(u,"binary",a,s):(a=a||"binary",f=f||"binary",s=s||new bufferExports.Buffer([2]),bufferExports.Buffer.isBuffer(s)||(s=new bufferExports.Buffer(s,f)),typeof u=="number"?new r(e(u,s),s,!0):(bufferExports.Buffer.isBuffer(u)||(u=new bufferExports.Buffer(u,a)),new r(u,s,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=n,browser$4.createDiffieHellman=browser$4.DiffieHellman=i,browser$4}var sign$1={exports:{}},bn$2={exports:{}},bn$1=bn$2.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,(function(e){(function(t,r){function n(Ze,se){if(!Ze)throw new Error(se||"Assertion failed")}function o(Ze,se){Ze.super_=se;var vt=function(){};vt.prototype=se.prototype,Ze.prototype=new vt,Ze.prototype.constructor=Ze}function i(Ze,se,vt){if(i.isBN(Ze))return Ze;this.negative=0,this.words=null,this.length=0,this.red=null,Ze!==null&&((se==="le"||se==="be")&&(vt=se,se=10),this._init(Ze||0,se||10,vt||"be"))}typeof t=="object"?t.exports=i:r.BN=i,i.BN=i,i.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=requireBuffer$1().Buffer}catch{}i.isBN=function(se){return se instanceof i?!0:se!==null&&typeof se=="object"&&se.constructor.wordSize===i.wordSize&&Array.isArray(se.words)},i.max=function(se,vt){return se.cmp(vt)>0?se:vt},i.min=function(se,vt){return se.cmp(vt)<0?se:vt},i.prototype._init=function(se,vt,ur){if(typeof se=="number")return this._initNumber(se,vt,ur);if(typeof se=="object")return this._initArray(se,vt,ur);vt==="hex"&&(vt=16),n(vt===(vt|0)&&vt>=2&&vt<=36),se=se.toString().replace(/\s+/g,"");var ue=0;se[0]==="-"&&(ue++,this.negative=1),ue<se.length&&(vt===16?this._parseHex(se,ue,ur):(this._parseBase(se,vt,ue),ur==="le"&&this._initArray(this.toArray(),vt,ur)))},i.prototype._initNumber=function(se,vt,ur){se<0&&(this.negative=1,se=-se),se<67108864?(this.words=[se&67108863],this.length=1):se<4503599627370496?(this.words=[se&67108863,se/67108864&67108863],this.length=2):(n(se<9007199254740992),this.words=[se&67108863,se/67108864&67108863,1],this.length=3),ur==="le"&&this._initArray(this.toArray(),vt,ur)},i.prototype._initArray=function(se,vt,ur){if(n(typeof se.length=="number"),se.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(se.length/3),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var bt,L,_=0;if(ur==="be")for(ue=se.length-1,bt=0;ue>=0;ue-=3)L=se[ue]|se[ue-1]<<8|se[ue-2]<<16,this.words[bt]|=L<<_&67108863,this.words[bt+1]=L>>>26-_&67108863,_+=24,_>=26&&(_-=26,bt++);else if(ur==="le")for(ue=0,bt=0;ue<se.length;ue+=3)L=se[ue]|se[ue+1]<<8|se[ue+2]<<16,this.words[bt]|=L<<_&67108863,this.words[bt+1]=L>>>26-_&67108863,_+=24,_>=26&&(_-=26,bt++);return this._strip()};function a(Ze,se){var vt=Ze.charCodeAt(se);if(vt>=48&&vt<=57)return vt-48;if(vt>=65&&vt<=70)return vt-55;if(vt>=97&&vt<=102)return vt-87;n(!1,"Invalid character in "+Ze)}function s(Ze,se,vt){var ur=a(Ze,vt);return vt-1>=se&&(ur|=a(Ze,vt-1)<<4),ur}i.prototype._parseHex=function(se,vt,ur){this.length=Math.ceil((se.length-vt)/6),this.words=new Array(this.length);for(var ue=0;ue<this.length;ue++)this.words[ue]=0;var bt=0,L=0,_;if(ur==="be")for(ue=se.length-1;ue>=vt;ue-=2)_=s(se,vt,ue)<<bt,this.words[L]|=_&67108863,bt>=18?(bt-=18,L+=1,this.words[L]|=_>>>26):bt+=8;else{var F=se.length-vt;for(ue=F%2===0?vt+1:vt;ue<se.length;ue+=2)_=s(se,vt,ue)<<bt,this.words[L]|=_&67108863,bt>=18?(bt-=18,L+=1,this.words[L]|=_>>>26):bt+=8}this._strip()};function f(Ze,se,vt,ur){for(var ue=0,bt=0,L=Math.min(Ze.length,vt),_=se;_<L;_++){var F=Ze.charCodeAt(_)-48;ue*=ur,F>=49?bt=F-49+10:F>=17?bt=F-17+10:bt=F,n(F>=0&&bt<ur,"Invalid character"),ue+=bt}return ue}i.prototype._parseBase=function(se,vt,ur){this.words=[0],this.length=1;for(var ue=0,bt=1;bt<=67108863;bt*=vt)ue++;ue--,bt=bt/vt|0;for(var L=se.length-ur,_=L%ue,F=Math.min(L,L-_)+ur,k=0,Ye=ur;Ye<F;Ye+=ue)k=f(se,Ye,Ye+ue,vt),this.imuln(bt),this.words[0]+k<67108864?this.words[0]+=k:this._iaddn(k);if(_!==0){var rn=1;for(k=f(se,Ye,se.length,vt),Ye=0;Ye<_;Ye++)rn*=vt;this.imuln(rn),this.words[0]+k<67108864?this.words[0]+=k:this._iaddn(k)}this._strip()},i.prototype.copy=function(se){se.words=new Array(this.length);for(var vt=0;vt<this.length;vt++)se.words[vt]=this.words[vt];se.length=this.length,se.negative=this.negative,se.red=this.red};function c(Ze,se){Ze.words=se.words,Ze.length=se.length,Ze.negative=se.negative,Ze.red=se.red}if(i.prototype._move=function(se){c(se,this)},i.prototype.clone=function(){var se=new i(null);return this.copy(se),se},i.prototype._expand=function(se){for(;this.length<se;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","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"],h=[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],y=[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];i.prototype.toString=function(se,vt){se=se||10,vt=vt|0||1;var ur;if(se===16||se==="hex"){ur="";for(var ue=0,bt=0,L=0;L<this.length;L++){var _=this.words[L],F=((_<<ue|bt)&16777215).toString(16);bt=_>>>24-ue&16777215,ue+=2,ue>=26&&(ue-=26,L--),bt!==0||L!==this.length-1?ur=p[6-F.length]+F+ur:ur=F+ur}for(bt!==0&&(ur=bt.toString(16)+ur);ur.length%vt!==0;)ur="0"+ur;return this.negative!==0&&(ur="-"+ur),ur}if(se===(se|0)&&se>=2&&se<=36){var k=h[se],Ye=y[se];ur="";var rn=this.clone();for(rn.negative=0;!rn.isZero();){var ii=rn.modrn(Ye).toString(se);rn=rn.idivn(Ye),rn.isZero()?ur=ii+ur:ur=p[k-ii.length]+ii+ur}for(this.isZero()&&(ur="0"+ur);ur.length%vt!==0;)ur="0"+ur;return this.negative!==0&&(ur="-"+ur),ur}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var se=this.words[0];return this.length===2?se+=this.words[1]*67108864:this.length===3&&this.words[2]===1?se+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-se:se},i.prototype.toJSON=function(){return this.toString(16,2)},u&&(i.prototype.toBuffer=function(se,vt){return this.toArrayLike(u,se,vt)}),i.prototype.toArray=function(se,vt){return this.toArrayLike(Array,se,vt)};var b=function(se,vt){return se.allocUnsafe?se.allocUnsafe(vt):new se(vt)};i.prototype.toArrayLike=function(se,vt,ur){this._strip();var ue=this.byteLength(),bt=ur||Math.max(1,ue);n(ue<=bt,"byte array longer than desired length"),n(bt>0,"Requested array length <= 0");var L=b(se,bt),_=vt==="le"?"LE":"BE";return this["_toArrayLike"+_](L,ue),L},i.prototype._toArrayLikeLE=function(se,vt){for(var ur=0,ue=0,bt=0,L=0;bt<this.length;bt++){var _=this.words[bt]<<L|ue;se[ur++]=_&255,ur<se.length&&(se[ur++]=_>>8&255),ur<se.length&&(se[ur++]=_>>16&255),L===6?(ur<se.length&&(se[ur++]=_>>24&255),ue=0,L=0):(ue=_>>>24,L+=2)}if(ur<se.length)for(se[ur++]=ue;ur<se.length;)se[ur++]=0},i.prototype._toArrayLikeBE=function(se,vt){for(var ur=se.length-1,ue=0,bt=0,L=0;bt<this.length;bt++){var _=this.words[bt]<<L|ue;se[ur--]=_&255,ur>=0&&(se[ur--]=_>>8&255),ur>=0&&(se[ur--]=_>>16&255),L===6?(ur>=0&&(se[ur--]=_>>24&255),ue=0,L=0):(ue=_>>>24,L+=2)}if(ur>=0)for(se[ur--]=ue;ur>=0;)se[ur--]=0},Math.clz32?i.prototype._countBits=function(se){return 32-Math.clz32(se)}:i.prototype._countBits=function(se){var vt=se,ur=0;return vt>=4096&&(ur+=13,vt>>>=13),vt>=64&&(ur+=7,vt>>>=7),vt>=8&&(ur+=4,vt>>>=4),vt>=2&&(ur+=2,vt>>>=2),ur+vt},i.prototype._zeroBits=function(se){if(se===0)return 26;var vt=se,ur=0;return(vt&8191)===0&&(ur+=13,vt>>>=13),(vt&127)===0&&(ur+=7,vt>>>=7),(vt&15)===0&&(ur+=4,vt>>>=4),(vt&3)===0&&(ur+=2,vt>>>=2),(vt&1)===0&&ur++,ur},i.prototype.bitLength=function(){var se=this.words[this.length-1],vt=this._countBits(se);return(this.length-1)*26+vt};function w(Ze){for(var se=new Array(Ze.bitLength()),vt=0;vt<se.length;vt++){var ur=vt/26|0,ue=vt%26;se[vt]=Ze.words[ur]>>>ue&1}return se}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var se=0,vt=0;vt<this.length;vt++){var ur=this._zeroBits(this.words[vt]);if(se+=ur,ur!==26)break}return se},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(se){return this.negative!==0?this.abs().inotn(se).iaddn(1):this.clone()},i.prototype.fromTwos=function(se){return this.testn(se-1)?this.notn(se).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(se){for(;this.length<se.length;)this.words[this.length++]=0;for(var vt=0;vt<se.length;vt++)this.words[vt]=this.words[vt]|se.words[vt];return this._strip()},i.prototype.ior=function(se){return n((this.negative|se.negative)===0),this.iuor(se)},i.prototype.or=function(se){return this.length>se.length?this.clone().ior(se):se.clone().ior(this)},i.prototype.uor=function(se){return this.length>se.length?this.clone().iuor(se):se.clone().iuor(this)},i.prototype.iuand=function(se){var vt;this.length>se.length?vt=se:vt=this;for(var ur=0;ur<vt.length;ur++)this.words[ur]=this.words[ur]&se.words[ur];return this.length=vt.length,this._strip()},i.prototype.iand=function(se){return n((this.negative|se.negative)===0),this.iuand(se)},i.prototype.and=function(se){return this.length>se.length?this.clone().iand(se):se.clone().iand(this)},i.prototype.uand=function(se){return this.length>se.length?this.clone().iuand(se):se.clone().iuand(this)},i.prototype.iuxor=function(se){var vt,ur;this.length>se.length?(vt=this,ur=se):(vt=se,ur=this);for(var ue=0;ue<ur.length;ue++)this.words[ue]=vt.words[ue]^ur.words[ue];if(this!==vt)for(;ue<vt.length;ue++)this.words[ue]=vt.words[ue];return this.length=vt.length,this._strip()},i.prototype.ixor=function(se){return n((this.negative|se.negative)===0),this.iuxor(se)},i.prototype.xor=function(se){return this.length>se.length?this.clone().ixor(se):se.clone().ixor(this)},i.prototype.uxor=function(se){return this.length>se.length?this.clone().iuxor(se):se.clone().iuxor(this)},i.prototype.inotn=function(se){n(typeof se=="number"&&se>=0);var vt=Math.ceil(se/26)|0,ur=se%26;this._expand(vt),ur>0&&vt--;for(var ue=0;ue<vt;ue++)this.words[ue]=~this.words[ue]&67108863;return ur>0&&(this.words[ue]=~this.words[ue]&67108863>>26-ur),this._strip()},i.prototype.notn=function(se){return this.clone().inotn(se)},i.prototype.setn=function(se,vt){n(typeof se=="number"&&se>=0);var ur=se/26|0,ue=se%26;return this._expand(ur+1),vt?this.words[ur]=this.words[ur]|1<<ue:this.words[ur]=this.words[ur]&~(1<<ue),this._strip()},i.prototype.iadd=function(se){var vt;if(this.negative!==0&&se.negative===0)return this.negative=0,vt=this.isub(se),this.negative^=1,this._normSign();if(this.negative===0&&se.negative!==0)return se.negative=0,vt=this.isub(se),se.negative=1,vt._normSign();var ur,ue;this.length>se.length?(ur=this,ue=se):(ur=se,ue=this);for(var bt=0,L=0;L<ue.length;L++)vt=(ur.words[L]|0)+(ue.words[L]|0)+bt,this.words[L]=vt&67108863,bt=vt>>>26;for(;bt!==0&&L<ur.length;L++)vt=(ur.words[L]|0)+bt,this.words[L]=vt&67108863,bt=vt>>>26;if(this.length=ur.length,bt!==0)this.words[this.length]=bt,this.length++;else if(ur!==this)for(;L<ur.length;L++)this.words[L]=ur.words[L];return this},i.prototype.add=function(se){var vt;return se.negative!==0&&this.negative===0?(se.negative=0,vt=this.sub(se),se.negative^=1,vt):se.negative===0&&this.negative!==0?(this.negative=0,vt=se.sub(this),this.negative=1,vt):this.length>se.length?this.clone().iadd(se):se.clone().iadd(this)},i.prototype.isub=function(se){if(se.negative!==0){se.negative=0;var vt=this.iadd(se);return se.negative=1,vt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(se),this.negative=1,this._normSign();var ur=this.cmp(se);if(ur===0)return this.negative=0,this.length=1,this.words[0]=0,this;var ue,bt;ur>0?(ue=this,bt=se):(ue=se,bt=this);for(var L=0,_=0;_<bt.length;_++)vt=(ue.words[_]|0)-(bt.words[_]|0)+L,L=vt>>26,this.words[_]=vt&67108863;for(;L!==0&&_<ue.length;_++)vt=(ue.words[_]|0)+L,L=vt>>26,this.words[_]=vt&67108863;if(L===0&&_<ue.length&&ue!==this)for(;_<ue.length;_++)this.words[_]=ue.words[_];return this.length=Math.max(this.length,_),ue!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(se){return this.clone().isub(se)};function S(Ze,se,vt){vt.negative=se.negative^Ze.negative;var ur=Ze.length+se.length|0;vt.length=ur,ur=ur-1|0;var ue=Ze.words[0]|0,bt=se.words[0]|0,L=ue*bt,_=L&67108863,F=L/67108864|0;vt.words[0]=_;for(var k=1;k<ur;k++){for(var Ye=F>>>26,rn=F&67108863,ii=Math.min(k,se.length-1),ai=Math.max(0,k-Ze.length+1);ai<=ii;ai++){var ni=k-ai|0;ue=Ze.words[ni]|0,bt=se.words[ai]|0,L=ue*bt+rn,Ye+=L/67108864|0,rn=L&67108863}vt.words[k]=rn|0,F=Ye|0}return F!==0?vt.words[k]=F|0:vt.length--,vt._strip()}var E=function(se,vt,ur){var ue=se.words,bt=vt.words,L=ur.words,_=0,F,k,Ye,rn=ue[0]|0,ii=rn&8191,ai=rn>>>13,ni=ue[1]|0,ri=ni&8191,ui=ni>>>13,lr=ue[2]|0,ar=lr&8191,jr=lr>>>13,ci=ue[3]|0,mi=ci&8191,pi=ci>>>13,ei=ue[4]|0,Gr=ei&8191,ti=ei>>>13,fi=ue[5]|0,bi=fi&8191,Ai=fi>>>13,Bi=ue[6]|0,qi=Bi&8191,vn=Bi>>>13,di=ue[7]|0,rr=di&8191,on=di>>>13,si=ue[8]|0,vi=si&8191,Ei=si>>>13,Mi=ue[9]|0,Di=Mi&8191,Ii=Mi>>>13,Ci=bt[0]|0,Vi=Ci&8191,Hi=Ci>>>13,Ji=bt[1]|0,no=Ji&8191,co=Ji>>>13,Fo=bt[2]|0,Io=Fo&8191,Ro=Fo>>>13,Oo=bt[3]|0,To=Oo&8191,Po=Oo>>>13,ia=bt[4]|0,Jo=ia&8191,ea=ia>>>13,zi=bt[5]|0,Gi=zi&8191,uo=zi>>>13,wo=bt[6]|0,xi=wo&8191,Fi=wo>>>13,Ui=bt[7]|0,gi=Ui&8191,Li=Ui>>>13,Qi=bt[8]|0,Wi=Qi&8191,io=Qi>>>13,lo=bt[9]|0,Ao=lo&8191,_o=lo>>>13;ur.negative=se.negative^vt.negative,ur.length=19,F=Math.imul(ii,Vi),k=Math.imul(ii,Hi),k=k+Math.imul(ai,Vi)|0,Ye=Math.imul(ai,Hi);var ca=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ca>>>26)|0,ca&=67108863,F=Math.imul(ri,Vi),k=Math.imul(ri,Hi),k=k+Math.imul(ui,Vi)|0,Ye=Math.imul(ui,Hi),F=F+Math.imul(ii,no)|0,k=k+Math.imul(ii,co)|0,k=k+Math.imul(ai,no)|0,Ye=Ye+Math.imul(ai,co)|0;var Co=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(Co>>>26)|0,Co&=67108863,F=Math.imul(ar,Vi),k=Math.imul(ar,Hi),k=k+Math.imul(jr,Vi)|0,Ye=Math.imul(jr,Hi),F=F+Math.imul(ri,no)|0,k=k+Math.imul(ri,co)|0,k=k+Math.imul(ui,no)|0,Ye=Ye+Math.imul(ui,co)|0,F=F+Math.imul(ii,Io)|0,k=k+Math.imul(ii,Ro)|0,k=k+Math.imul(ai,Io)|0,Ye=Ye+Math.imul(ai,Ro)|0;var $o=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+($o>>>26)|0,$o&=67108863,F=Math.imul(mi,Vi),k=Math.imul(mi,Hi),k=k+Math.imul(pi,Vi)|0,Ye=Math.imul(pi,Hi),F=F+Math.imul(ar,no)|0,k=k+Math.imul(ar,co)|0,k=k+Math.imul(jr,no)|0,Ye=Ye+Math.imul(jr,co)|0,F=F+Math.imul(ri,Io)|0,k=k+Math.imul(ri,Ro)|0,k=k+Math.imul(ui,Io)|0,Ye=Ye+Math.imul(ui,Ro)|0,F=F+Math.imul(ii,To)|0,k=k+Math.imul(ii,Po)|0,k=k+Math.imul(ai,To)|0,Ye=Ye+Math.imul(ai,Po)|0;var ta=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ta>>>26)|0,ta&=67108863,F=Math.imul(Gr,Vi),k=Math.imul(Gr,Hi),k=k+Math.imul(ti,Vi)|0,Ye=Math.imul(ti,Hi),F=F+Math.imul(mi,no)|0,k=k+Math.imul(mi,co)|0,k=k+Math.imul(pi,no)|0,Ye=Ye+Math.imul(pi,co)|0,F=F+Math.imul(ar,Io)|0,k=k+Math.imul(ar,Ro)|0,k=k+Math.imul(jr,Io)|0,Ye=Ye+Math.imul(jr,Ro)|0,F=F+Math.imul(ri,To)|0,k=k+Math.imul(ri,Po)|0,k=k+Math.imul(ui,To)|0,Ye=Ye+Math.imul(ui,Po)|0,F=F+Math.imul(ii,Jo)|0,k=k+Math.imul(ii,ea)|0,k=k+Math.imul(ai,Jo)|0,Ye=Ye+Math.imul(ai,ea)|0;var sa=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(sa>>>26)|0,sa&=67108863,F=Math.imul(bi,Vi),k=Math.imul(bi,Hi),k=k+Math.imul(Ai,Vi)|0,Ye=Math.imul(Ai,Hi),F=F+Math.imul(Gr,no)|0,k=k+Math.imul(Gr,co)|0,k=k+Math.imul(ti,no)|0,Ye=Ye+Math.imul(ti,co)|0,F=F+Math.imul(mi,Io)|0,k=k+Math.imul(mi,Ro)|0,k=k+Math.imul(pi,Io)|0,Ye=Ye+Math.imul(pi,Ro)|0,F=F+Math.imul(ar,To)|0,k=k+Math.imul(ar,Po)|0,k=k+Math.imul(jr,To)|0,Ye=Ye+Math.imul(jr,Po)|0,F=F+Math.imul(ri,Jo)|0,k=k+Math.imul(ri,ea)|0,k=k+Math.imul(ui,Jo)|0,Ye=Ye+Math.imul(ui,ea)|0,F=F+Math.imul(ii,Gi)|0,k=k+Math.imul(ii,uo)|0,k=k+Math.imul(ai,Gi)|0,Ye=Ye+Math.imul(ai,uo)|0;var ga=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ga>>>26)|0,ga&=67108863,F=Math.imul(qi,Vi),k=Math.imul(qi,Hi),k=k+Math.imul(vn,Vi)|0,Ye=Math.imul(vn,Hi),F=F+Math.imul(bi,no)|0,k=k+Math.imul(bi,co)|0,k=k+Math.imul(Ai,no)|0,Ye=Ye+Math.imul(Ai,co)|0,F=F+Math.imul(Gr,Io)|0,k=k+Math.imul(Gr,Ro)|0,k=k+Math.imul(ti,Io)|0,Ye=Ye+Math.imul(ti,Ro)|0,F=F+Math.imul(mi,To)|0,k=k+Math.imul(mi,Po)|0,k=k+Math.imul(pi,To)|0,Ye=Ye+Math.imul(pi,Po)|0,F=F+Math.imul(ar,Jo)|0,k=k+Math.imul(ar,ea)|0,k=k+Math.imul(jr,Jo)|0,Ye=Ye+Math.imul(jr,ea)|0,F=F+Math.imul(ri,Gi)|0,k=k+Math.imul(ri,uo)|0,k=k+Math.imul(ui,Gi)|0,Ye=Ye+Math.imul(ui,uo)|0,F=F+Math.imul(ii,xi)|0,k=k+Math.imul(ii,Fi)|0,k=k+Math.imul(ai,xi)|0,Ye=Ye+Math.imul(ai,Fi)|0;var ya=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ya>>>26)|0,ya&=67108863,F=Math.imul(rr,Vi),k=Math.imul(rr,Hi),k=k+Math.imul(on,Vi)|0,Ye=Math.imul(on,Hi),F=F+Math.imul(qi,no)|0,k=k+Math.imul(qi,co)|0,k=k+Math.imul(vn,no)|0,Ye=Ye+Math.imul(vn,co)|0,F=F+Math.imul(bi,Io)|0,k=k+Math.imul(bi,Ro)|0,k=k+Math.imul(Ai,Io)|0,Ye=Ye+Math.imul(Ai,Ro)|0,F=F+Math.imul(Gr,To)|0,k=k+Math.imul(Gr,Po)|0,k=k+Math.imul(ti,To)|0,Ye=Ye+Math.imul(ti,Po)|0,F=F+Math.imul(mi,Jo)|0,k=k+Math.imul(mi,ea)|0,k=k+Math.imul(pi,Jo)|0,Ye=Ye+Math.imul(pi,ea)|0,F=F+Math.imul(ar,Gi)|0,k=k+Math.imul(ar,uo)|0,k=k+Math.imul(jr,Gi)|0,Ye=Ye+Math.imul(jr,uo)|0,F=F+Math.imul(ri,xi)|0,k=k+Math.imul(ri,Fi)|0,k=k+Math.imul(ui,xi)|0,Ye=Ye+Math.imul(ui,Fi)|0,F=F+Math.imul(ii,gi)|0,k=k+Math.imul(ii,Li)|0,k=k+Math.imul(ai,gi)|0,Ye=Ye+Math.imul(ai,Li)|0;var ma=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ma>>>26)|0,ma&=67108863,F=Math.imul(vi,Vi),k=Math.imul(vi,Hi),k=k+Math.imul(Ei,Vi)|0,Ye=Math.imul(Ei,Hi),F=F+Math.imul(rr,no)|0,k=k+Math.imul(rr,co)|0,k=k+Math.imul(on,no)|0,Ye=Ye+Math.imul(on,co)|0,F=F+Math.imul(qi,Io)|0,k=k+Math.imul(qi,Ro)|0,k=k+Math.imul(vn,Io)|0,Ye=Ye+Math.imul(vn,Ro)|0,F=F+Math.imul(bi,To)|0,k=k+Math.imul(bi,Po)|0,k=k+Math.imul(Ai,To)|0,Ye=Ye+Math.imul(Ai,Po)|0,F=F+Math.imul(Gr,Jo)|0,k=k+Math.imul(Gr,ea)|0,k=k+Math.imul(ti,Jo)|0,Ye=Ye+Math.imul(ti,ea)|0,F=F+Math.imul(mi,Gi)|0,k=k+Math.imul(mi,uo)|0,k=k+Math.imul(pi,Gi)|0,Ye=Ye+Math.imul(pi,uo)|0,F=F+Math.imul(ar,xi)|0,k=k+Math.imul(ar,Fi)|0,k=k+Math.imul(jr,xi)|0,Ye=Ye+Math.imul(jr,Fi)|0,F=F+Math.imul(ri,gi)|0,k=k+Math.imul(ri,Li)|0,k=k+Math.imul(ui,gi)|0,Ye=Ye+Math.imul(ui,Li)|0,F=F+Math.imul(ii,Wi)|0,k=k+Math.imul(ii,io)|0,k=k+Math.imul(ai,Wi)|0,Ye=Ye+Math.imul(ai,io)|0;var fa=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(fa>>>26)|0,fa&=67108863,F=Math.imul(Di,Vi),k=Math.imul(Di,Hi),k=k+Math.imul(Ii,Vi)|0,Ye=Math.imul(Ii,Hi),F=F+Math.imul(vi,no)|0,k=k+Math.imul(vi,co)|0,k=k+Math.imul(Ei,no)|0,Ye=Ye+Math.imul(Ei,co)|0,F=F+Math.imul(rr,Io)|0,k=k+Math.imul(rr,Ro)|0,k=k+Math.imul(on,Io)|0,Ye=Ye+Math.imul(on,Ro)|0,F=F+Math.imul(qi,To)|0,k=k+Math.imul(qi,Po)|0,k=k+Math.imul(vn,To)|0,Ye=Ye+Math.imul(vn,Po)|0,F=F+Math.imul(bi,Jo)|0,k=k+Math.imul(bi,ea)|0,k=k+Math.imul(Ai,Jo)|0,Ye=Ye+Math.imul(Ai,ea)|0,F=F+Math.imul(Gr,Gi)|0,k=k+Math.imul(Gr,uo)|0,k=k+Math.imul(ti,Gi)|0,Ye=Ye+Math.imul(ti,uo)|0,F=F+Math.imul(mi,xi)|0,k=k+Math.imul(mi,Fi)|0,k=k+Math.imul(pi,xi)|0,Ye=Ye+Math.imul(pi,Fi)|0,F=F+Math.imul(ar,gi)|0,k=k+Math.imul(ar,Li)|0,k=k+Math.imul(jr,gi)|0,Ye=Ye+Math.imul(jr,Li)|0,F=F+Math.imul(ri,Wi)|0,k=k+Math.imul(ri,io)|0,k=k+Math.imul(ui,Wi)|0,Ye=Ye+Math.imul(ui,io)|0,F=F+Math.imul(ii,Ao)|0,k=k+Math.imul(ii,_o)|0,k=k+Math.imul(ai,Ao)|0,Ye=Ye+Math.imul(ai,_o)|0;var ra=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ra>>>26)|0,ra&=67108863,F=Math.imul(Di,no),k=Math.imul(Di,co),k=k+Math.imul(Ii,no)|0,Ye=Math.imul(Ii,co),F=F+Math.imul(vi,Io)|0,k=k+Math.imul(vi,Ro)|0,k=k+Math.imul(Ei,Io)|0,Ye=Ye+Math.imul(Ei,Ro)|0,F=F+Math.imul(rr,To)|0,k=k+Math.imul(rr,Po)|0,k=k+Math.imul(on,To)|0,Ye=Ye+Math.imul(on,Po)|0,F=F+Math.imul(qi,Jo)|0,k=k+Math.imul(qi,ea)|0,k=k+Math.imul(vn,Jo)|0,Ye=Ye+Math.imul(vn,ea)|0,F=F+Math.imul(bi,Gi)|0,k=k+Math.imul(bi,uo)|0,k=k+Math.imul(Ai,Gi)|0,Ye=Ye+Math.imul(Ai,uo)|0,F=F+Math.imul(Gr,xi)|0,k=k+Math.imul(Gr,Fi)|0,k=k+Math.imul(ti,xi)|0,Ye=Ye+Math.imul(ti,Fi)|0,F=F+Math.imul(mi,gi)|0,k=k+Math.imul(mi,Li)|0,k=k+Math.imul(pi,gi)|0,Ye=Ye+Math.imul(pi,Li)|0,F=F+Math.imul(ar,Wi)|0,k=k+Math.imul(ar,io)|0,k=k+Math.imul(jr,Wi)|0,Ye=Ye+Math.imul(jr,io)|0,F=F+Math.imul(ri,Ao)|0,k=k+Math.imul(ri,_o)|0,k=k+Math.imul(ui,Ao)|0,Ye=Ye+Math.imul(ui,_o)|0;var ha=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ha>>>26)|0,ha&=67108863,F=Math.imul(Di,Io),k=Math.imul(Di,Ro),k=k+Math.imul(Ii,Io)|0,Ye=Math.imul(Ii,Ro),F=F+Math.imul(vi,To)|0,k=k+Math.imul(vi,Po)|0,k=k+Math.imul(Ei,To)|0,Ye=Ye+Math.imul(Ei,Po)|0,F=F+Math.imul(rr,Jo)|0,k=k+Math.imul(rr,ea)|0,k=k+Math.imul(on,Jo)|0,Ye=Ye+Math.imul(on,ea)|0,F=F+Math.imul(qi,Gi)|0,k=k+Math.imul(qi,uo)|0,k=k+Math.imul(vn,Gi)|0,Ye=Ye+Math.imul(vn,uo)|0,F=F+Math.imul(bi,xi)|0,k=k+Math.imul(bi,Fi)|0,k=k+Math.imul(Ai,xi)|0,Ye=Ye+Math.imul(Ai,Fi)|0,F=F+Math.imul(Gr,gi)|0,k=k+Math.imul(Gr,Li)|0,k=k+Math.imul(ti,gi)|0,Ye=Ye+Math.imul(ti,Li)|0,F=F+Math.imul(mi,Wi)|0,k=k+Math.imul(mi,io)|0,k=k+Math.imul(pi,Wi)|0,Ye=Ye+Math.imul(pi,io)|0,F=F+Math.imul(ar,Ao)|0,k=k+Math.imul(ar,_o)|0,k=k+Math.imul(jr,Ao)|0,Ye=Ye+Math.imul(jr,_o)|0;var Wo=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,F=Math.imul(Di,To),k=Math.imul(Di,Po),k=k+Math.imul(Ii,To)|0,Ye=Math.imul(Ii,Po),F=F+Math.imul(vi,Jo)|0,k=k+Math.imul(vi,ea)|0,k=k+Math.imul(Ei,Jo)|0,Ye=Ye+Math.imul(Ei,ea)|0,F=F+Math.imul(rr,Gi)|0,k=k+Math.imul(rr,uo)|0,k=k+Math.imul(on,Gi)|0,Ye=Ye+Math.imul(on,uo)|0,F=F+Math.imul(qi,xi)|0,k=k+Math.imul(qi,Fi)|0,k=k+Math.imul(vn,xi)|0,Ye=Ye+Math.imul(vn,Fi)|0,F=F+Math.imul(bi,gi)|0,k=k+Math.imul(bi,Li)|0,k=k+Math.imul(Ai,gi)|0,Ye=Ye+Math.imul(Ai,Li)|0,F=F+Math.imul(Gr,Wi)|0,k=k+Math.imul(Gr,io)|0,k=k+Math.imul(ti,Wi)|0,Ye=Ye+Math.imul(ti,io)|0,F=F+Math.imul(mi,Ao)|0,k=k+Math.imul(mi,_o)|0,k=k+Math.imul(pi,Ao)|0,Ye=Ye+Math.imul(pi,_o)|0;var na=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(na>>>26)|0,na&=67108863,F=Math.imul(Di,Jo),k=Math.imul(Di,ea),k=k+Math.imul(Ii,Jo)|0,Ye=Math.imul(Ii,ea),F=F+Math.imul(vi,Gi)|0,k=k+Math.imul(vi,uo)|0,k=k+Math.imul(Ei,Gi)|0,Ye=Ye+Math.imul(Ei,uo)|0,F=F+Math.imul(rr,xi)|0,k=k+Math.imul(rr,Fi)|0,k=k+Math.imul(on,xi)|0,Ye=Ye+Math.imul(on,Fi)|0,F=F+Math.imul(qi,gi)|0,k=k+Math.imul(qi,Li)|0,k=k+Math.imul(vn,gi)|0,Ye=Ye+Math.imul(vn,Li)|0,F=F+Math.imul(bi,Wi)|0,k=k+Math.imul(bi,io)|0,k=k+Math.imul(Ai,Wi)|0,Ye=Ye+Math.imul(Ai,io)|0,F=F+Math.imul(Gr,Ao)|0,k=k+Math.imul(Gr,_o)|0,k=k+Math.imul(ti,Ao)|0,Ye=Ye+Math.imul(ti,_o)|0;var la=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(la>>>26)|0,la&=67108863,F=Math.imul(Di,Gi),k=Math.imul(Di,uo),k=k+Math.imul(Ii,Gi)|0,Ye=Math.imul(Ii,uo),F=F+Math.imul(vi,xi)|0,k=k+Math.imul(vi,Fi)|0,k=k+Math.imul(Ei,xi)|0,Ye=Ye+Math.imul(Ei,Fi)|0,F=F+Math.imul(rr,gi)|0,k=k+Math.imul(rr,Li)|0,k=k+Math.imul(on,gi)|0,Ye=Ye+Math.imul(on,Li)|0,F=F+Math.imul(qi,Wi)|0,k=k+Math.imul(qi,io)|0,k=k+Math.imul(vn,Wi)|0,Ye=Ye+Math.imul(vn,io)|0,F=F+Math.imul(bi,Ao)|0,k=k+Math.imul(bi,_o)|0,k=k+Math.imul(Ai,Ao)|0,Ye=Ye+Math.imul(Ai,_o)|0;var Yo=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,F=Math.imul(Di,xi),k=Math.imul(Di,Fi),k=k+Math.imul(Ii,xi)|0,Ye=Math.imul(Ii,Fi),F=F+Math.imul(vi,gi)|0,k=k+Math.imul(vi,Li)|0,k=k+Math.imul(Ei,gi)|0,Ye=Ye+Math.imul(Ei,Li)|0,F=F+Math.imul(rr,Wi)|0,k=k+Math.imul(rr,io)|0,k=k+Math.imul(on,Wi)|0,Ye=Ye+Math.imul(on,io)|0,F=F+Math.imul(qi,Ao)|0,k=k+Math.imul(qi,_o)|0,k=k+Math.imul(vn,Ao)|0,Ye=Ye+Math.imul(vn,_o)|0;var ho=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(ho>>>26)|0,ho&=67108863,F=Math.imul(Di,gi),k=Math.imul(Di,Li),k=k+Math.imul(Ii,gi)|0,Ye=Math.imul(Ii,Li),F=F+Math.imul(vi,Wi)|0,k=k+Math.imul(vi,io)|0,k=k+Math.imul(Ei,Wi)|0,Ye=Ye+Math.imul(Ei,io)|0,F=F+Math.imul(rr,Ao)|0,k=k+Math.imul(rr,_o)|0,k=k+Math.imul(on,Ao)|0,Ye=Ye+Math.imul(on,_o)|0;var yo=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(yo>>>26)|0,yo&=67108863,F=Math.imul(Di,Wi),k=Math.imul(Di,io),k=k+Math.imul(Ii,Wi)|0,Ye=Math.imul(Ii,io),F=F+Math.imul(vi,Ao)|0,k=k+Math.imul(vi,_o)|0,k=k+Math.imul(Ei,Ao)|0,Ye=Ye+Math.imul(Ei,_o)|0;var No=(_+F|0)+((k&8191)<<13)|0;_=(Ye+(k>>>13)|0)+(No>>>26)|0,No&=67108863,F=Math.imul(Di,Ao),k=Math.imul(Di,_o),k=k+Math.imul(Ii,Ao)|0,Ye=Math.imul(Ii,_o);var vo=(_+F|0)+((k&8191)<<13)|0;return _=(Ye+(k>>>13)|0)+(vo>>>26)|0,vo&=67108863,L[0]=ca,L[1]=Co,L[2]=$o,L[3]=ta,L[4]=sa,L[5]=ga,L[6]=ya,L[7]=ma,L[8]=fa,L[9]=ra,L[10]=ha,L[11]=Wo,L[12]=na,L[13]=la,L[14]=Yo,L[15]=ho,L[16]=yo,L[17]=No,L[18]=vo,_!==0&&(L[19]=_,ur.length++),ur};Math.imul||(E=S);function B(Ze,se,vt){vt.negative=se.negative^Ze.negative,vt.length=Ze.length+se.length;for(var ur=0,ue=0,bt=0;bt<vt.length-1;bt++){var L=ue;ue=0;for(var _=ur&67108863,F=Math.min(bt,se.length-1),k=Math.max(0,bt-Ze.length+1);k<=F;k++){var Ye=bt-k,rn=Ze.words[Ye]|0,ii=se.words[k]|0,ai=rn*ii,ni=ai&67108863;L=L+(ai/67108864|0)|0,ni=ni+_|0,_=ni&67108863,L=L+(ni>>>26)|0,ue+=L>>>26,L&=67108863}vt.words[bt]=_,ur=L,L=ue}return ur!==0?vt.words[bt]=ur:vt.length--,vt._strip()}function ae(Ze,se,vt){return B(Ze,se,vt)}i.prototype.mulTo=function(se,vt){var ur,ue=this.length+se.length;return this.length===10&&se.length===10?ur=E(this,se,vt):ue<63?ur=S(this,se,vt):ue<1024?ur=B(this,se,vt):ur=ae(this,se,vt),ur},i.prototype.mul=function(se){var vt=new i(null);return vt.words=new Array(this.length+se.length),this.mulTo(se,vt)},i.prototype.mulf=function(se){var vt=new i(null);return vt.words=new Array(this.length+se.length),ae(this,se,vt)},i.prototype.imul=function(se){return this.clone().mulTo(se,this)},i.prototype.imuln=function(se){var vt=se<0;vt&&(se=-se),n(typeof se=="number"),n(se<67108864);for(var ur=0,ue=0;ue<this.length;ue++){var bt=(this.words[ue]|0)*se,L=(bt&67108863)+(ur&67108863);ur>>=26,ur+=bt/67108864|0,ur+=L>>>26,this.words[ue]=L&67108863}return ur!==0&&(this.words[ue]=ur,this.length++),this.length=se===0?1:this.length,vt?this.ineg():this},i.prototype.muln=function(se){return this.clone().imuln(se)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(se){var vt=w(se);if(vt.length===0)return new i(1);for(var ur=this,ue=0;ue<vt.length&&vt[ue]===0;ue++,ur=ur.sqr());if(++ue<vt.length)for(var bt=ur.sqr();ue<vt.length;ue++,bt=bt.sqr())vt[ue]!==0&&(ur=ur.mul(bt));return ur},i.prototype.iushln=function(se){n(typeof se=="number"&&se>=0);var vt=se%26,ur=(se-vt)/26,ue=67108863>>>26-vt<<26-vt,bt;if(vt!==0){var L=0;for(bt=0;bt<this.length;bt++){var _=this.words[bt]&ue,F=(this.words[bt]|0)-_<<vt;this.words[bt]=F|L,L=_>>>26-vt}L&&(this.words[bt]=L,this.length++)}if(ur!==0){for(bt=this.length-1;bt>=0;bt--)this.words[bt+ur]=this.words[bt];for(bt=0;bt<ur;bt++)this.words[bt]=0;this.length+=ur}return this._strip()},i.prototype.ishln=function(se){return n(this.negative===0),this.iushln(se)},i.prototype.iushrn=function(se,vt,ur){n(typeof se=="number"&&se>=0);var ue;vt?ue=(vt-vt%26)/26:ue=0;var bt=se%26,L=Math.min((se-bt)/26,this.length),_=67108863^67108863>>>bt<<bt,F=ur;if(ue-=L,ue=Math.max(0,ue),F){for(var k=0;k<L;k++)F.words[k]=this.words[k];F.length=L}if(L!==0)if(this.length>L)for(this.length-=L,k=0;k<this.length;k++)this.words[k]=this.words[k+L];else this.words[0]=0,this.length=1;var Ye=0;for(k=this.length-1;k>=0&&(Ye!==0||k>=ue);k--){var rn=this.words[k]|0;this.words[k]=Ye<<26-bt|rn>>>bt,Ye=rn&_}return F&&Ye!==0&&(F.words[F.length++]=Ye),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(se,vt,ur){return n(this.negative===0),this.iushrn(se,vt,ur)},i.prototype.shln=function(se){return this.clone().ishln(se)},i.prototype.ushln=function(se){return this.clone().iushln(se)},i.prototype.shrn=function(se){return this.clone().ishrn(se)},i.prototype.ushrn=function(se){return this.clone().iushrn(se)},i.prototype.testn=function(se){n(typeof se=="number"&&se>=0);var vt=se%26,ur=(se-vt)/26,ue=1<<vt;if(this.length<=ur)return!1;var bt=this.words[ur];return!!(bt&ue)},i.prototype.imaskn=function(se){n(typeof se=="number"&&se>=0);var vt=se%26,ur=(se-vt)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=ur)return this;if(vt!==0&&ur++,this.length=Math.min(ur,this.length),vt!==0){var ue=67108863^67108863>>>vt<<vt;this.words[this.length-1]&=ue}return this._strip()},i.prototype.maskn=function(se){return this.clone().imaskn(se)},i.prototype.iaddn=function(se){return n(typeof se=="number"),n(se<67108864),se<0?this.isubn(-se):this.negative!==0?this.length===1&&(this.words[0]|0)<=se?(this.words[0]=se-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(se),this.negative=1,this):this._iaddn(se)},i.prototype._iaddn=function(se){this.words[0]+=se;for(var vt=0;vt<this.length&&this.words[vt]>=67108864;vt++)this.words[vt]-=67108864,vt===this.length-1?this.words[vt+1]=1:this.words[vt+1]++;return this.length=Math.max(this.length,vt+1),this},i.prototype.isubn=function(se){if(n(typeof se=="number"),n(se<67108864),se<0)return this.iaddn(-se);if(this.negative!==0)return this.negative=0,this.iaddn(se),this.negative=1,this;if(this.words[0]-=se,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var vt=0;vt<this.length&&this.words[vt]<0;vt++)this.words[vt]+=67108864,this.words[vt+1]-=1;return this._strip()},i.prototype.addn=function(se){return this.clone().iaddn(se)},i.prototype.subn=function(se){return this.clone().isubn(se)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(se,vt,ur){var ue=se.length+ur,bt;this._expand(ue);var L,_=0;for(bt=0;bt<se.length;bt++){L=(this.words[bt+ur]|0)+_;var F=(se.words[bt]|0)*vt;L-=F&67108863,_=(L>>26)-(F/67108864|0),this.words[bt+ur]=L&67108863}for(;bt<this.length-ur;bt++)L=(this.words[bt+ur]|0)+_,_=L>>26,this.words[bt+ur]=L&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,bt=0;bt<this.length;bt++)L=-(this.words[bt]|0)+_,_=L>>26,this.words[bt]=L&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(se,vt){var ur=this.length-se.length,ue=this.clone(),bt=se,L=bt.words[bt.length-1]|0,_=this._countBits(L);ur=26-_,ur!==0&&(bt=bt.ushln(ur),ue.iushln(ur),L=bt.words[bt.length-1]|0);var F=ue.length-bt.length,k;if(vt!=="mod"){k=new i(null),k.length=F+1,k.words=new Array(k.length);for(var Ye=0;Ye<k.length;Ye++)k.words[Ye]=0}var rn=ue.clone()._ishlnsubmul(bt,1,F);rn.negative===0&&(ue=rn,k&&(k.words[F]=1));for(var ii=F-1;ii>=0;ii--){var ai=(ue.words[bt.length+ii]|0)*67108864+(ue.words[bt.length+ii-1]|0);for(ai=Math.min(ai/L|0,67108863),ue._ishlnsubmul(bt,ai,ii);ue.negative!==0;)ai--,ue.negative=0,ue._ishlnsubmul(bt,1,ii),ue.isZero()||(ue.negative^=1);k&&(k.words[ii]=ai)}return k&&k._strip(),ue._strip(),vt!=="div"&&ur!==0&&ue.iushrn(ur),{div:k||null,mod:ue}},i.prototype.divmod=function(se,vt,ur){if(n(!se.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var ue,bt,L;return this.negative!==0&&se.negative===0?(L=this.neg().divmod(se,vt),vt!=="mod"&&(ue=L.div.neg()),vt!=="div"&&(bt=L.mod.neg(),ur&&bt.negative!==0&&bt.iadd(se)),{div:ue,mod:bt}):this.negative===0&&se.negative!==0?(L=this.divmod(se.neg(),vt),vt!=="mod"&&(ue=L.div.neg()),{div:ue,mod:L.mod}):(this.negative&se.negative)!==0?(L=this.neg().divmod(se.neg(),vt),vt!=="div"&&(bt=L.mod.neg(),ur&&bt.negative!==0&&bt.isub(se)),{div:L.div,mod:bt}):se.length>this.length||this.cmp(se)<0?{div:new i(0),mod:this}:se.length===1?vt==="div"?{div:this.divn(se.words[0]),mod:null}:vt==="mod"?{div:null,mod:new i(this.modrn(se.words[0]))}:{div:this.divn(se.words[0]),mod:new i(this.modrn(se.words[0]))}:this._wordDiv(se,vt)},i.prototype.div=function(se){return this.divmod(se,"div",!1).div},i.prototype.mod=function(se){return this.divmod(se,"mod",!1).mod},i.prototype.umod=function(se){return this.divmod(se,"mod",!0).mod},i.prototype.divRound=function(se){var vt=this.divmod(se);if(vt.mod.isZero())return vt.div;var ur=vt.div.negative!==0?vt.mod.isub(se):vt.mod,ue=se.ushrn(1),bt=se.andln(1),L=ur.cmp(ue);return L<0||bt===1&&L===0?vt.div:vt.div.negative!==0?vt.div.isubn(1):vt.div.iaddn(1)},i.prototype.modrn=function(se){var vt=se<0;vt&&(se=-se),n(se<=67108863);for(var ur=(1<<26)%se,ue=0,bt=this.length-1;bt>=0;bt--)ue=(ur*ue+(this.words[bt]|0))%se;return vt?-ue:ue},i.prototype.modn=function(se){return this.modrn(se)},i.prototype.idivn=function(se){var vt=se<0;vt&&(se=-se),n(se<=67108863);for(var ur=0,ue=this.length-1;ue>=0;ue--){var bt=(this.words[ue]|0)+ur*67108864;this.words[ue]=bt/se|0,ur=bt%se}return this._strip(),vt?this.ineg():this},i.prototype.divn=function(se){return this.clone().idivn(se)},i.prototype.egcd=function(se){n(se.negative===0),n(!se.isZero());var vt=this,ur=se.clone();vt.negative!==0?vt=vt.umod(se):vt=vt.clone();for(var ue=new i(1),bt=new i(0),L=new i(0),_=new i(1),F=0;vt.isEven()&&ur.isEven();)vt.iushrn(1),ur.iushrn(1),++F;for(var k=ur.clone(),Ye=vt.clone();!vt.isZero();){for(var rn=0,ii=1;(vt.words[0]&ii)===0&&rn<26;++rn,ii<<=1);if(rn>0)for(vt.iushrn(rn);rn-- >0;)(ue.isOdd()||bt.isOdd())&&(ue.iadd(k),bt.isub(Ye)),ue.iushrn(1),bt.iushrn(1);for(var ai=0,ni=1;(ur.words[0]&ni)===0&&ai<26;++ai,ni<<=1);if(ai>0)for(ur.iushrn(ai);ai-- >0;)(L.isOdd()||_.isOdd())&&(L.iadd(k),_.isub(Ye)),L.iushrn(1),_.iushrn(1);vt.cmp(ur)>=0?(vt.isub(ur),ue.isub(L),bt.isub(_)):(ur.isub(vt),L.isub(ue),_.isub(bt))}return{a:L,b:_,gcd:ur.iushln(F)}},i.prototype._invmp=function(se){n(se.negative===0),n(!se.isZero());var vt=this,ur=se.clone();vt.negative!==0?vt=vt.umod(se):vt=vt.clone();for(var ue=new i(1),bt=new i(0),L=ur.clone();vt.cmpn(1)>0&&ur.cmpn(1)>0;){for(var _=0,F=1;(vt.words[0]&F)===0&&_<26;++_,F<<=1);if(_>0)for(vt.iushrn(_);_-- >0;)ue.isOdd()&&ue.iadd(L),ue.iushrn(1);for(var k=0,Ye=1;(ur.words[0]&Ye)===0&&k<26;++k,Ye<<=1);if(k>0)for(ur.iushrn(k);k-- >0;)bt.isOdd()&&bt.iadd(L),bt.iushrn(1);vt.cmp(ur)>=0?(vt.isub(ur),ue.isub(bt)):(ur.isub(vt),bt.isub(ue))}var rn;return vt.cmpn(1)===0?rn=ue:rn=bt,rn.cmpn(0)<0&&rn.iadd(se),rn},i.prototype.gcd=function(se){if(this.isZero())return se.abs();if(se.isZero())return this.abs();var vt=this.clone(),ur=se.clone();vt.negative=0,ur.negative=0;for(var ue=0;vt.isEven()&&ur.isEven();ue++)vt.iushrn(1),ur.iushrn(1);do{for(;vt.isEven();)vt.iushrn(1);for(;ur.isEven();)ur.iushrn(1);var bt=vt.cmp(ur);if(bt<0){var L=vt;vt=ur,ur=L}else if(bt===0||ur.cmpn(1)===0)break;vt.isub(ur)}while(!0);return ur.iushln(ue)},i.prototype.invm=function(se){return this.egcd(se).a.umod(se)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(se){return this.words[0]&se},i.prototype.bincn=function(se){n(typeof se=="number");var vt=se%26,ur=(se-vt)/26,ue=1<<vt;if(this.length<=ur)return this._expand(ur+1),this.words[ur]|=ue,this;for(var bt=ue,L=ur;bt!==0&&L<this.length;L++){var _=this.words[L]|0;_+=bt,bt=_>>>26,_&=67108863,this.words[L]=_}return bt!==0&&(this.words[L]=bt,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(se){var vt=se<0;if(this.negative!==0&&!vt)return-1;if(this.negative===0&&vt)return 1;this._strip();var ur;if(this.length>1)ur=1;else{vt&&(se=-se),n(se<=67108863,"Number is too big");var ue=this.words[0]|0;ur=ue===se?0:ue<se?-1:1}return this.negative!==0?-ur|0:ur},i.prototype.cmp=function(se){if(this.negative!==0&&se.negative===0)return-1;if(this.negative===0&&se.negative!==0)return 1;var vt=this.ucmp(se);return this.negative!==0?-vt|0:vt},i.prototype.ucmp=function(se){if(this.length>se.length)return 1;if(this.length<se.length)return-1;for(var vt=0,ur=this.length-1;ur>=0;ur--){var ue=this.words[ur]|0,bt=se.words[ur]|0;if(ue!==bt){ue<bt?vt=-1:ue>bt&&(vt=1);break}}return vt},i.prototype.gtn=function(se){return this.cmpn(se)===1},i.prototype.gt=function(se){return this.cmp(se)===1},i.prototype.gten=function(se){return this.cmpn(se)>=0},i.prototype.gte=function(se){return this.cmp(se)>=0},i.prototype.ltn=function(se){return this.cmpn(se)===-1},i.prototype.lt=function(se){return this.cmp(se)===-1},i.prototype.lten=function(se){return this.cmpn(se)<=0},i.prototype.lte=function(se){return this.cmp(se)<=0},i.prototype.eqn=function(se){return this.cmpn(se)===0},i.prototype.eq=function(se){return this.cmp(se)===0},i.red=function(se){return new sr(se)},i.prototype.toRed=function(se){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),se.convertTo(this)._forceRed(se)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(se){return this.red=se,this},i.prototype.forceRed=function(se){return n(!this.red,"Already a number in reduction context"),this._forceRed(se)},i.prototype.redAdd=function(se){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,se)},i.prototype.redIAdd=function(se){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,se)},i.prototype.redSub=function(se){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,se)},i.prototype.redISub=function(se){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,se)},i.prototype.redShl=function(se){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,se)},i.prototype.redMul=function(se){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,se),this.red.mul(this,se)},i.prototype.redIMul=function(se){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,se),this.red.imul(this,se)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(se){return n(this.red&&!se.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,se)};var W={k256:null,p224:null,p192:null,p25519:null};function J(Ze,se){this.name=Ze,this.p=new i(se,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}J.prototype._tmp=function(){var se=new i(null);return se.words=new Array(Math.ceil(this.n/13)),se},J.prototype.ireduce=function(se){var vt=se,ur;do this.split(vt,this.tmp),vt=this.imulK(vt),vt=vt.iadd(this.tmp),ur=vt.bitLength();while(ur>this.n);var ue=ur<this.n?-1:vt.ucmp(this.p);return ue===0?(vt.words[0]=0,vt.length=1):ue>0?vt.isub(this.p):vt.strip!==void 0?vt.strip():vt._strip(),vt},J.prototype.split=function(se,vt){se.iushrn(this.n,0,vt)},J.prototype.imulK=function(se){return se.imul(this.k)};function ve(){J.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(ve,J),ve.prototype.split=function(se,vt){for(var ur=4194303,ue=Math.min(se.length,9),bt=0;bt<ue;bt++)vt.words[bt]=se.words[bt];if(vt.length=ue,se.length<=9){se.words[0]=0,se.length=1;return}var L=se.words[9];for(vt.words[vt.length++]=L&ur,bt=10;bt<se.length;bt++){var _=se.words[bt]|0;se.words[bt-10]=(_&ur)<<4|L>>>22,L=_}L>>>=22,se.words[bt-10]=L,L===0&&se.length>10?se.length-=10:se.length-=9},ve.prototype.imulK=function(se){se.words[se.length]=0,se.words[se.length+1]=0,se.length+=2;for(var vt=0,ur=0;ur<se.length;ur++){var ue=se.words[ur]|0;vt+=ue*977,se.words[ur]=vt&67108863,vt=ue*64+(vt/67108864|0)}return se.words[se.length-1]===0&&(se.length--,se.words[se.length-1]===0&&se.length--),se};function Qe(){J.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(Qe,J);function kt(){J.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(kt,J);function nr(){J.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(nr,J),nr.prototype.imulK=function(se){for(var vt=0,ur=0;ur<se.length;ur++){var ue=(se.words[ur]|0)*19+vt,bt=ue&67108863;ue>>>=26,se.words[ur]=bt,vt=ue}return vt!==0&&(se.words[se.length++]=vt),se},i._prime=function(se){if(W[se])return W[se];var vt;if(se==="k256")vt=new ve;else if(se==="p224")vt=new Qe;else if(se==="p192")vt=new kt;else if(se==="p25519")vt=new nr;else throw new Error("Unknown prime "+se);return W[se]=vt,vt};function sr(Ze){if(typeof Ze=="string"){var se=i._prime(Ze);this.m=se.p,this.prime=se}else n(Ze.gtn(1),"modulus must be greater than 1"),this.m=Ze,this.prime=null}sr.prototype._verify1=function(se){n(se.negative===0,"red works only with positives"),n(se.red,"red works only with red numbers")},sr.prototype._verify2=function(se,vt){n((se.negative|vt.negative)===0,"red works only with positives"),n(se.red&&se.red===vt.red,"red works only with red numbers")},sr.prototype.imod=function(se){return this.prime?this.prime.ireduce(se)._forceRed(this):(c(se,se.umod(this.m)._forceRed(this)),se)},sr.prototype.neg=function(se){return se.isZero()?se.clone():this.m.sub(se)._forceRed(this)},sr.prototype.add=function(se,vt){this._verify2(se,vt);var ur=se.add(vt);return ur.cmp(this.m)>=0&&ur.isub(this.m),ur._forceRed(this)},sr.prototype.iadd=function(se,vt){this._verify2(se,vt);var ur=se.iadd(vt);return ur.cmp(this.m)>=0&&ur.isub(this.m),ur},sr.prototype.sub=function(se,vt){this._verify2(se,vt);var ur=se.sub(vt);return ur.cmpn(0)<0&&ur.iadd(this.m),ur._forceRed(this)},sr.prototype.isub=function(se,vt){this._verify2(se,vt);var ur=se.isub(vt);return ur.cmpn(0)<0&&ur.iadd(this.m),ur},sr.prototype.shl=function(se,vt){return this._verify1(se),this.imod(se.ushln(vt))},sr.prototype.imul=function(se,vt){return this._verify2(se,vt),this.imod(se.imul(vt))},sr.prototype.mul=function(se,vt){return this._verify2(se,vt),this.imod(se.mul(vt))},sr.prototype.isqr=function(se){return this.imul(se,se.clone())},sr.prototype.sqr=function(se){return this.mul(se,se)},sr.prototype.sqrt=function(se){if(se.isZero())return se.clone();var vt=this.m.andln(3);if(n(vt%2===1),vt===3){var ur=this.m.add(new i(1)).iushrn(2);return this.pow(se,ur)}for(var ue=this.m.subn(1),bt=0;!ue.isZero()&&ue.andln(1)===0;)bt++,ue.iushrn(1);n(!ue.isZero());var L=new i(1).toRed(this),_=L.redNeg(),F=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new i(2*k*k).toRed(this);this.pow(k,F).cmp(_)!==0;)k.redIAdd(_);for(var Ye=this.pow(k,ue),rn=this.pow(se,ue.addn(1).iushrn(1)),ii=this.pow(se,ue),ai=bt;ii.cmp(L)!==0;){for(var ni=ii,ri=0;ni.cmp(L)!==0;ri++)ni=ni.redSqr();n(ri<ai);var ui=this.pow(Ye,new i(1).iushln(ai-ri-1));rn=rn.redMul(ui),Ye=ui.redSqr(),ii=ii.redMul(Ye),ai=ri}return rn},sr.prototype.invm=function(se){var vt=se._invmp(this.m);return vt.negative!==0?(vt.negative=0,this.imod(vt).redNeg()):this.imod(vt)},sr.prototype.pow=function(se,vt){if(vt.isZero())return new i(1).toRed(this);if(vt.cmpn(1)===0)return se.clone();var ur=4,ue=new Array(1<<ur);ue[0]=new i(1).toRed(this),ue[1]=se;for(var bt=2;bt<ue.length;bt++)ue[bt]=this.mul(ue[bt-1],se);var L=ue[0],_=0,F=0,k=vt.bitLength()%26;for(k===0&&(k=26),bt=vt.length-1;bt>=0;bt--){for(var Ye=vt.words[bt],rn=k-1;rn>=0;rn--){var ii=Ye>>rn&1;if(L!==ue[0]&&(L=this.sqr(L)),ii===0&&_===0){F=0;continue}_<<=1,_|=ii,F++,!(F!==ur&&(bt!==0||rn!==0))&&(L=this.mul(L,ue[_]),F=0,_=0)}k=26}return L},sr.prototype.convertTo=function(se){var vt=se.umod(this.m);return vt===se?vt.clone():vt},sr.prototype.convertFrom=function(se){var vt=se.clone();return vt.red=null,vt},i.mont=function(se){return new ce(se)};function ce(Ze){sr.call(this,Ze),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(ce,sr),ce.prototype.convertTo=function(se){return this.imod(se.ushln(this.shift))},ce.prototype.convertFrom=function(se){var vt=this.imod(se.mul(this.rinv));return vt.red=null,vt},ce.prototype.imul=function(se,vt){if(se.isZero()||vt.isZero())return se.words[0]=0,se.length=1,se;var ur=se.imul(vt),ue=ur.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),bt=ur.isub(ue).iushrn(this.shift),L=bt;return bt.cmp(this.m)>=0?L=bt.isub(this.m):bt.cmpn(0)<0&&(L=bt.iadd(this.m)),L._forceRed(this)},ce.prototype.mul=function(se,vt){if(se.isZero()||vt.isZero())return new i(0)._forceRed(this);var ur=se.mul(vt),ue=ur.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),bt=ur.isub(ue).iushrn(this.shift),L=bt;return bt.cmp(this.m)>=0?L=bt.isub(this.m):bt.cmpn(0)<0&&(L=bt.iadd(this.m)),L._forceRed(this)},ce.prototype.invm=function(se){var vt=this.imod(se._invmp(this.m).mul(this.r2));return vt._forceRed(this)}})(e,bn$1)})(bn$2)),bn$2.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var e=requireBn(),t=requireBrowser$b(),r=requireSafeBuffer$1().Buffer;function n(u){var a=u.modulus.byteLength(),s;do s=new e(t(a));while(s.cmp(u.modulus)>=0||!s.umod(u.prime1)||!s.umod(u.prime2));return s}function o(u){var a=n(u),s=a.toRed(e.mont(u.modulus)).redPow(new e(u.publicExponent)).fromRed();return{blinder:s,unblinder:a.invm(u.modulus)}}function i(u,a){var s=o(a),f=a.modulus.byteLength(),c=new e(u).mul(s.blinder).umod(a.modulus),d=c.toRed(e.mont(a.prime1)),p=c.toRed(e.mont(a.prime2)),h=a.coefficient,y=a.prime1,b=a.prime2,w=d.redPow(a.exponent1).fromRed(),S=p.redPow(a.exponent2).fromRed(),E=w.isub(S).imul(h).umod(y).imul(b);return S.iadd(E).imul(s.unblinder).umod(a.modulus).toArrayLike(r,"be",f)}return i.getr=n,browserifyRsa=i,browserifyRsa}var elliptic={};const version="6.6.1",require$$0={version};var utils$2={},utils$1={},hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,(function(e){var t=e;function r(i,u){if(Array.isArray(i))return i.slice();if(!i)return[];var a=[];if(typeof i!="string"){for(var s=0;s<i.length;s++)a[s]=i[s]|0;return a}if(u==="hex"){i=i.replace(/[^a-z0-9]+/ig,""),i.length%2!==0&&(i="0"+i);for(var s=0;s<i.length;s+=2)a.push(parseInt(i[s]+i[s+1],16))}else for(var s=0;s<i.length;s++){var f=i.charCodeAt(s),c=f>>8,d=f&255;c?a.push(c,d):a.push(d)}return a}t.toArray=r;function n(i){return i.length===1?"0"+i:i}t.zero2=n;function o(i){for(var u="",a=0;a<i.length;a++)u+=n(i[a].toString(16));return u}t.toHex=o,t.encode=function(u,a){return a==="hex"?o(u):u}})(utils$1)),utils$1}var hasRequiredUtils$1;function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,(function(e){var t=e,r=requireBn$1(),n=requireMinimalisticAssert(),o=requireUtils$2();t.assert=n,t.toArray=o.toArray,t.zero2=o.zero2,t.toHex=o.toHex,t.encode=o.encode;function i(c,d,p){var h=new Array(Math.max(c.bitLength(),p)+1),y;for(y=0;y<h.length;y+=1)h[y]=0;var b=1<<d+1,w=c.clone();for(y=0;y<h.length;y++){var S,E=w.andln(b-1);w.isOdd()?(E>(b>>1)-1?S=(b>>1)-E:S=E,w.isubn(S)):S=0,h[y]=S,w.iushrn(1)}return h}t.getNAF=i;function u(c,d){var p=[[],[]];c=c.clone(),d=d.clone();for(var h=0,y=0,b;c.cmpn(-h)>0||d.cmpn(-y)>0;){var w=c.andln(3)+h&3,S=d.andln(3)+y&3;w===3&&(w=-1),S===3&&(S=-1);var E;(w&1)===0?E=0:(b=c.andln(7)+h&7,(b===3||b===5)&&S===2?E=-w:E=w),p[0].push(E);var B;(S&1)===0?B=0:(b=d.andln(7)+y&7,(b===3||b===5)&&w===2?B=-S:B=S),p[1].push(B),2*h===E+1&&(h=1-h),2*y===B+1&&(y=1-y),c.iushrn(1),d.iushrn(1)}return p}t.getJSF=u;function a(c,d,p){var h="_"+d;c.prototype[d]=function(){return this[h]!==void 0?this[h]:this[h]=p.call(this)}}t.cachedProperty=a;function s(c){return typeof c=="string"?t.toArray(c,"hex"):c}t.parseBytes=s;function f(c){return new r(c,"hex","le")}t.intFromLE=f})(utils$2)),utils$2}var curve={},base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var e=requireBn$1(),t=requireUtils$1(),r=t.getNAF,n=t.getJSF,o=t.assert;function i(a,s){this.type=a,this.p=new e(s.p,16),this.red=s.prime?e.red(s.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=s.n&&new e(s.n,16),this.g=s.g&&this.pointFromJSON(s.g,s.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var f=this.n&&this.p.div(this.n);!f||f.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$1=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(s,f){o(s.precomputed);var c=s._getDoubles(),d=r(f,1,this._bitLength),p=(1<<c.step+1)-(c.step%2===0?2:1);p/=3;var h=[],y,b;for(y=0;y<d.length;y+=c.step){b=0;for(var w=y+c.step-1;w>=y;w--)b=(b<<1)+d[w];h.push(b)}for(var S=this.jpoint(null,null,null),E=this.jpoint(null,null,null),B=p;B>0;B--){for(y=0;y<h.length;y++)b=h[y],b===B?E=E.mixedAdd(c.points[y]):b===-B&&(E=E.mixedAdd(c.points[y].neg()));S=S.add(E)}return S.toP()},i.prototype._wnafMul=function(s,f){var c=4,d=s._getNAFPoints(c);c=d.wnd;for(var p=d.points,h=r(f,c,this._bitLength),y=this.jpoint(null,null,null),b=h.length-1;b>=0;b--){for(var w=0;b>=0&&h[b]===0;b--)w++;if(b>=0&&w++,y=y.dblp(w),b<0)break;var S=h[b];o(S!==0),s.type==="affine"?S>0?y=y.mixedAdd(p[S-1>>1]):y=y.mixedAdd(p[-S-1>>1].neg()):S>0?y=y.add(p[S-1>>1]):y=y.add(p[-S-1>>1].neg())}return s.type==="affine"?y.toP():y},i.prototype._wnafMulAdd=function(s,f,c,d,p){var h=this._wnafT1,y=this._wnafT2,b=this._wnafT3,w=0,S,E,B;for(S=0;S<d;S++){B=f[S];var ae=B._getNAFPoints(s);h[S]=ae.wnd,y[S]=ae.points}for(S=d-1;S>=1;S-=2){var W=S-1,J=S;if(h[W]!==1||h[J]!==1){b[W]=r(c[W],h[W],this._bitLength),b[J]=r(c[J],h[J],this._bitLength),w=Math.max(b[W].length,w),w=Math.max(b[J].length,w);continue}var ve=[f[W],null,null,f[J]];f[W].y.cmp(f[J].y)===0?(ve[1]=f[W].add(f[J]),ve[2]=f[W].toJ().mixedAdd(f[J].neg())):f[W].y.cmp(f[J].y.redNeg())===0?(ve[1]=f[W].toJ().mixedAdd(f[J]),ve[2]=f[W].add(f[J].neg())):(ve[1]=f[W].toJ().mixedAdd(f[J]),ve[2]=f[W].toJ().mixedAdd(f[J].neg()));var Qe=[-3,-1,-5,-7,0,7,5,1,3],kt=n(c[W],c[J]);for(w=Math.max(kt[0].length,w),b[W]=new Array(w),b[J]=new Array(w),E=0;E<w;E++){var nr=kt[0][E]|0,sr=kt[1][E]|0;b[W][E]=Qe[(nr+1)*3+(sr+1)],b[J][E]=0,y[W]=ve}}var ce=this.jpoint(null,null,null),Ze=this._wnafT4;for(S=w;S>=0;S--){for(var se=0;S>=0;){var vt=!0;for(E=0;E<d;E++)Ze[E]=b[E][S]|0,Ze[E]!==0&&(vt=!1);if(!vt)break;se++,S--}if(S>=0&&se++,ce=ce.dblp(se),S<0)break;for(E=0;E<d;E++){var ur=Ze[E];ur!==0&&(ur>0?B=y[E][ur-1>>1]:ur<0&&(B=y[E][-ur-1>>1].neg()),B.type==="affine"?ce=ce.mixedAdd(B):ce=ce.add(B))}}for(S=0;S<d;S++)y[S]=null;return p?ce:ce.toP()};function u(a,s){this.curve=a,this.type=s,this.precomputed=null}return i.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},i.prototype.decodePoint=function(s,f){s=t.toArray(s,f);var c=this.p.byteLength();if((s[0]===4||s[0]===6||s[0]===7)&&s.length-1===2*c){s[0]===6?o(s[s.length-1]%2===0):s[0]===7&&o(s[s.length-1]%2===1);var d=this.point(s.slice(1,1+c),s.slice(1+c,1+2*c));return d}else if((s[0]===2||s[0]===3)&&s.length-1===c)return this.pointFromX(s.slice(1,1+c),s[0]===3);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(s){return this.encode(s,!0)},u.prototype._encode=function(s){var f=this.curve.p.byteLength(),c=this.getX().toArray("be",f);return s?[this.getY().isEven()?2:3].concat(c):[4].concat(c,this.getY().toArray("be",f))},u.prototype.encode=function(s,f){return t.encode(this._encode(f),s)},u.prototype.precompute=function(s){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,s),f.beta=this._getBeta(),this.precomputed=f,this},u.prototype._hasDoubles=function(s){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return f?f.points.length>=Math.ceil((s.bitLength()+1)/f.step):!1},u.prototype._getDoubles=function(s,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,p=0;p<f;p+=s){for(var h=0;h<s;h++)d=d.dbl();c.push(d)}return{step:s,points:c}},u.prototype._getNAFPoints=function(s){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],c=(1<<s)-1,d=c===1?null:this.dbl(),p=1;p<c;p++)f[p]=f[p-1].add(d);return{wnd:s,points:f}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(s){for(var f=this,c=0;c<s;c++)f=f.dbl();return f},base$1}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var e=requireUtils$1(),t=requireBn$1(),r=requireInherits_browser(),n=requireBase$1(),o=e.assert;function i(s){n.call(this,"short",s),this.a=new t(s.a,16).toRed(this.red),this.b=new t(s.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(s),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}r(i,n),short=i,i.prototype._getEndomorphism=function(f){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var c,d;if(f.beta)c=new t(f.beta,16).toRed(this.red);else{var p=this._getEndoRoots(this.p);c=p[0].cmp(p[1])<0?p[0]:p[1],c=c.toRed(this.red)}if(f.lambda)d=new t(f.lambda,16);else{var h=this._getEndoRoots(this.n);this.g.mul(h[0]).x.cmp(this.g.x.redMul(c))===0?d=h[0]:(d=h[1],o(this.g.mul(d).x.cmp(this.g.x.redMul(c))===0))}var y;return f.basis?y=f.basis.map(function(b){return{a:new t(b.a,16),b:new t(b.b,16)}}):y=this._getEndoBasis(d),{beta:c,lambda:d,basis:y}}},i.prototype._getEndoRoots=function(f){var c=f===this.p?this.red:t.mont(f),d=new t(2).toRed(c).redInvm(),p=d.redNeg(),h=new t(3).toRed(c).redNeg().redSqrt().redMul(d),y=p.redAdd(h).fromRed(),b=p.redSub(h).fromRed();return[y,b]},i.prototype._getEndoBasis=function(f){for(var c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=f,p=this.n.clone(),h=new t(1),y=new t(0),b=new t(0),w=new t(1),S,E,B,ae,W,J,ve,Qe=0,kt,nr;d.cmpn(0)!==0;){var sr=p.div(d);kt=p.sub(sr.mul(d)),nr=b.sub(sr.mul(h));var ce=w.sub(sr.mul(y));if(!B&&kt.cmp(c)<0)S=ve.neg(),E=h,B=kt.neg(),ae=nr;else if(B&&++Qe===2)break;ve=kt,p=d,d=kt,b=h,h=nr,w=y,y=ce}W=kt.neg(),J=nr;var Ze=B.sqr().add(ae.sqr()),se=W.sqr().add(J.sqr());return se.cmp(Ze)>=0&&(W=S,J=E),B.negative&&(B=B.neg(),ae=ae.neg()),W.negative&&(W=W.neg(),J=J.neg()),[{a:B,b:ae},{a:W,b:J}]},i.prototype._endoSplit=function(f){var c=this.endo.basis,d=c[0],p=c[1],h=p.b.mul(f).divRound(this.n),y=d.b.neg().mul(f).divRound(this.n),b=h.mul(d.a),w=y.mul(p.a),S=h.mul(d.b),E=y.mul(p.b),B=f.sub(b).sub(w),ae=S.add(E).neg();return{k1:B,k2:ae}},i.prototype.pointFromX=function(f,c){f=new t(f,16),f.red||(f=f.toRed(this.red));var d=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),p=d.redSqrt();if(p.redSqr().redSub(d).cmp(this.zero)!==0)throw new Error("invalid point");var h=p.fromRed().isOdd();return(c&&!h||!c&&h)&&(p=p.redNeg()),this.point(f,p)},i.prototype.validate=function(f){if(f.inf)return!0;var c=f.x,d=f.y,p=this.a.redMul(c),h=c.redSqr().redMul(c).redIAdd(p).redIAdd(this.b);return d.redSqr().redISub(h).cmpn(0)===0},i.prototype._endoWnafMulAdd=function(f,c,d){for(var p=this._endoWnafT1,h=this._endoWnafT2,y=0;y<f.length;y++){var b=this._endoSplit(c[y]),w=f[y],S=w._getBeta();b.k1.negative&&(b.k1.ineg(),w=w.neg(!0)),b.k2.negative&&(b.k2.ineg(),S=S.neg(!0)),p[y*2]=w,p[y*2+1]=S,h[y*2]=b.k1,h[y*2+1]=b.k2}for(var E=this._wnafMulAdd(1,p,h,y*2,d),B=0;B<y*2;B++)p[B]=null,h[B]=null;return E};function u(s,f,c,d){n.BasePoint.call(this,s,"affine"),f===null&&c===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(f,16),this.y=new t(c,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}r(u,n.BasePoint),i.prototype.point=function(f,c,d){return new u(this,f,c,d)},i.prototype.pointFromJSON=function(f,c){return u.fromJSON(this,f,c)},u.prototype._getBeta=function(){if(this.curve.endo){var f=this.precomputed;if(f&&f.beta)return f.beta;var c=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var d=this.curve,p=function(h){return d.point(h.x.redMul(d.endo.beta),h.y)};f.beta=c,c.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(p)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(p)}}}return c}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(f,c,d){typeof c=="string"&&(c=JSON.parse(c));var p=f.point(c[0],c[1],d);if(!c[2])return p;function h(b){return f.point(b[0],b[1],d)}var y=c[2];return p.precomputed={beta:null,doubles:y.doubles&&{step:y.doubles.step,points:[p].concat(y.doubles.points.map(h))},naf:y.naf&&{wnd:y.naf.wnd,points:[p].concat(y.naf.points.map(h))}},p},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(f){if(this.inf)return f;if(f.inf)return this;if(this.eq(f))return this.dbl();if(this.neg().eq(f))return this.curve.point(null,null);if(this.x.cmp(f.x)===0)return this.curve.point(null,null);var c=this.y.redSub(f.y);c.cmpn(0)!==0&&(c=c.redMul(this.x.redSub(f.x).redInvm()));var d=c.redSqr().redISub(this.x).redISub(f.x),p=c.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,p)},u.prototype.dbl=function(){if(this.inf)return this;var f=this.y.redAdd(this.y);if(f.cmpn(0)===0)return this.curve.point(null,null);var c=this.curve.a,d=this.x.redSqr(),p=f.redInvm(),h=d.redAdd(d).redIAdd(d).redIAdd(c).redMul(p),y=h.redSqr().redISub(this.x.redAdd(this.x)),b=h.redMul(this.x.redSub(y)).redISub(this.y);return this.curve.point(y,b)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(f){return f=new t(f,16),this.isInfinity()?this:this._hasDoubles(f)?this.curve._fixedNafMul(this,f):this.curve.endo?this.curve._endoWnafMulAdd([this],[f]):this.curve._wnafMul(this,f)},u.prototype.mulAdd=function(f,c,d){var p=[this,c],h=[f,d];return this.curve.endo?this.curve._endoWnafMulAdd(p,h):this.curve._wnafMulAdd(1,p,h,2)},u.prototype.jmulAdd=function(f,c,d){var p=[this,c],h=[f,d];return this.curve.endo?this.curve._endoWnafMulAdd(p,h,!0):this.curve._wnafMulAdd(1,p,h,2,!0)},u.prototype.eq=function(f){return this===f||this.inf===f.inf&&(this.inf||this.x.cmp(f.x)===0&&this.y.cmp(f.y)===0)},u.prototype.neg=function(f){if(this.inf)return this;var c=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var d=this.precomputed,p=function(h){return h.neg()};c.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(p)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(p)}}}return c},u.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var f=this.curve.jpoint(this.x,this.y,this.curve.one);return f};function a(s,f,c,d){n.BasePoint.call(this,s,"jacobian"),f===null&&c===null&&d===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(f,16),this.y=new t(c,16),this.z=new t(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(a,n.BasePoint),i.prototype.jpoint=function(f,c,d){return new a(this,f,c,d)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),c=f.redSqr(),d=this.x.redMul(c),p=this.y.redMul(c).redMul(f);return this.curve.point(d,p)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var c=f.z.redSqr(),d=this.z.redSqr(),p=this.x.redMul(c),h=f.x.redMul(d),y=this.y.redMul(c.redMul(f.z)),b=f.y.redMul(d.redMul(this.z)),w=p.redSub(h),S=y.redSub(b);if(w.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=w.redSqr(),B=E.redMul(w),ae=p.redMul(E),W=S.redSqr().redIAdd(B).redISub(ae).redISub(ae),J=S.redMul(ae.redISub(W)).redISub(y.redMul(B)),ve=this.z.redMul(f.z).redMul(w);return this.curve.jpoint(W,J,ve)},a.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var c=this.z.redSqr(),d=this.x,p=f.x.redMul(c),h=this.y,y=f.y.redMul(c).redMul(this.z),b=d.redSub(p),w=h.redSub(y);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=b.redSqr(),E=S.redMul(b),B=d.redMul(S),ae=w.redSqr().redIAdd(E).redISub(B).redISub(B),W=w.redMul(B.redISub(ae)).redISub(h.redMul(E)),J=this.z.redMul(b);return this.curve.jpoint(ae,W,J)},a.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();var c;if(this.curve.zeroA||this.curve.threeA){var d=this;for(c=0;c<f;c++)d=d.dbl();return d}var p=this.curve.a,h=this.curve.tinv,y=this.x,b=this.y,w=this.z,S=w.redSqr().redSqr(),E=b.redAdd(b);for(c=0;c<f;c++){var B=y.redSqr(),ae=E.redSqr(),W=ae.redSqr(),J=B.redAdd(B).redIAdd(B).redIAdd(p.redMul(S)),ve=y.redMul(ae),Qe=J.redSqr().redISub(ve.redAdd(ve)),kt=ve.redISub(Qe),nr=J.redMul(kt);nr=nr.redIAdd(nr).redISub(W);var sr=E.redMul(w);c+1<f&&(S=S.redMul(W)),y=Qe,w=sr,E=nr}return this.curve.jpoint(y,E.redMul(h),w)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var f,c,d;if(this.zOne){var p=this.x.redSqr(),h=this.y.redSqr(),y=h.redSqr(),b=this.x.redAdd(h).redSqr().redISub(p).redISub(y);b=b.redIAdd(b);var w=p.redAdd(p).redIAdd(p),S=w.redSqr().redISub(b).redISub(b),E=y.redIAdd(y);E=E.redIAdd(E),E=E.redIAdd(E),f=S,c=w.redMul(b.redISub(S)).redISub(E),d=this.y.redAdd(this.y)}else{var B=this.x.redSqr(),ae=this.y.redSqr(),W=ae.redSqr(),J=this.x.redAdd(ae).redSqr().redISub(B).redISub(W);J=J.redIAdd(J);var ve=B.redAdd(B).redIAdd(B),Qe=ve.redSqr(),kt=W.redIAdd(W);kt=kt.redIAdd(kt),kt=kt.redIAdd(kt),f=Qe.redISub(J).redISub(J),c=ve.redMul(J.redISub(f)).redISub(kt),d=this.y.redMul(this.z),d=d.redIAdd(d)}return this.curve.jpoint(f,c,d)},a.prototype._threeDbl=function(){var f,c,d;if(this.zOne){var p=this.x.redSqr(),h=this.y.redSqr(),y=h.redSqr(),b=this.x.redAdd(h).redSqr().redISub(p).redISub(y);b=b.redIAdd(b);var w=p.redAdd(p).redIAdd(p).redIAdd(this.curve.a),S=w.redSqr().redISub(b).redISub(b);f=S;var E=y.redIAdd(y);E=E.redIAdd(E),E=E.redIAdd(E),c=w.redMul(b.redISub(S)).redISub(E),d=this.y.redAdd(this.y)}else{var B=this.z.redSqr(),ae=this.y.redSqr(),W=this.x.redMul(ae),J=this.x.redSub(B).redMul(this.x.redAdd(B));J=J.redAdd(J).redIAdd(J);var ve=W.redIAdd(W);ve=ve.redIAdd(ve);var Qe=ve.redAdd(ve);f=J.redSqr().redISub(Qe),d=this.y.redAdd(this.z).redSqr().redISub(ae).redISub(B);var kt=ae.redSqr();kt=kt.redIAdd(kt),kt=kt.redIAdd(kt),kt=kt.redIAdd(kt),c=J.redMul(ve.redISub(f)).redISub(kt)}return this.curve.jpoint(f,c,d)},a.prototype._dbl=function(){var f=this.curve.a,c=this.x,d=this.y,p=this.z,h=p.redSqr().redSqr(),y=c.redSqr(),b=d.redSqr(),w=y.redAdd(y).redIAdd(y).redIAdd(f.redMul(h)),S=c.redAdd(c);S=S.redIAdd(S);var E=S.redMul(b),B=w.redSqr().redISub(E.redAdd(E)),ae=E.redISub(B),W=b.redSqr();W=W.redIAdd(W),W=W.redIAdd(W),W=W.redIAdd(W);var J=w.redMul(ae).redISub(W),ve=d.redAdd(d).redMul(p);return this.curve.jpoint(B,J,ve)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),c=this.y.redSqr(),d=this.z.redSqr(),p=c.redSqr(),h=f.redAdd(f).redIAdd(f),y=h.redSqr(),b=this.x.redAdd(c).redSqr().redISub(f).redISub(p);b=b.redIAdd(b),b=b.redAdd(b).redIAdd(b),b=b.redISub(y);var w=b.redSqr(),S=p.redIAdd(p);S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var E=h.redIAdd(b).redSqr().redISub(y).redISub(w).redISub(S),B=c.redMul(E);B=B.redIAdd(B),B=B.redIAdd(B);var ae=this.x.redMul(w).redISub(B);ae=ae.redIAdd(ae),ae=ae.redIAdd(ae);var W=this.y.redMul(E.redMul(S.redISub(E)).redISub(b.redMul(w)));W=W.redIAdd(W),W=W.redIAdd(W),W=W.redIAdd(W);var J=this.z.redAdd(b).redSqr().redISub(d).redISub(w);return this.curve.jpoint(ae,W,J)},a.prototype.mul=function(f,c){return f=new t(f,c),this.curve._wnafMul(this,f)},a.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var c=this.z.redSqr(),d=f.z.redSqr();if(this.x.redMul(d).redISub(f.x.redMul(c)).cmpn(0)!==0)return!1;var p=c.redMul(this.z),h=d.redMul(f.z);return this.y.redMul(h).redISub(f.y.redMul(p)).cmpn(0)===0},a.prototype.eqXToP=function(f){var c=this.z.redSqr(),d=f.toRed(this.curve.red).redMul(c);if(this.x.cmp(d)===0)return!0;for(var p=f.clone(),h=this.curve.redN.redMul(c);;){if(p.iadd(this.curve.n),p.cmp(this.curve.p)>=0)return!1;if(d.redIAdd(h),this.x.cmp(d)===0)return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var e=requireBn$1(),t=requireInherits_browser(),r=requireBase$1(),n=requireUtils$1();function o(u){r.call(this,"mont",u),this.a=new e(u.a,16).toRed(this.red),this.b=new e(u.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}t(o,r),mont=o,o.prototype.validate=function(a){var s=a.normalize().x,f=s.redSqr(),c=f.redMul(s).redAdd(f.redMul(this.a)).redAdd(s),d=c.redSqrt();return d.redSqr().cmp(c)===0};function i(u,a,s){r.BasePoint.call(this,u,"projective"),a===null&&s===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(a,16),this.z=new e(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,r.BasePoint),o.prototype.decodePoint=function(a,s){return this.point(n.toArray(a,s),1)},o.prototype.point=function(a,s){return new i(this,a,s)},o.prototype.pointFromJSON=function(a){return i.fromJSON(this,a)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(a,s){return new i(a,s[0],s[1]||a.one)},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return this.z.cmpn(0)===0},i.prototype.dbl=function(){var a=this.x.redAdd(this.z),s=a.redSqr(),f=this.x.redSub(this.z),c=f.redSqr(),d=s.redSub(c),p=s.redMul(c),h=d.redMul(c.redAdd(this.curve.a24.redMul(d)));return this.curve.point(p,h)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(a,s){var f=this.x.redAdd(this.z),c=this.x.redSub(this.z),d=a.x.redAdd(a.z),p=a.x.redSub(a.z),h=p.redMul(f),y=d.redMul(c),b=s.z.redMul(h.redAdd(y).redSqr()),w=s.x.redMul(h.redISub(y).redSqr());return this.curve.point(b,w)},i.prototype.mul=function(a){for(var s=a.clone(),f=this,c=this.curve.point(null,null),d=this,p=[];s.cmpn(0)!==0;s.iushrn(1))p.push(s.andln(1));for(var h=p.length-1;h>=0;h--)p[h]===0?(f=f.diffAdd(c,d),c=c.dbl()):(c=f.diffAdd(c,d),f=f.dbl());return c},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(a){return this.getX().cmp(a.getX())===0},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards$1,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards$1;hasRequiredEdwards=1;var e=requireUtils$1(),t=requireBn$1(),r=requireInherits_browser(),n=requireBase$1(),o=e.assert;function i(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,n.call(this,"edwards",a),this.a=new t(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}r(i,n),edwards$1=i,i.prototype._mulA=function(s){return this.mOneA?s.redNeg():this.a.redMul(s)},i.prototype._mulC=function(s){return this.oneC?s:this.c.redMul(s)},i.prototype.jpoint=function(s,f,c,d){return this.point(s,f,c,d)},i.prototype.pointFromX=function(s,f){s=new t(s,16),s.red||(s=s.toRed(this.red));var c=s.redSqr(),d=this.c2.redSub(this.a.redMul(c)),p=this.one.redSub(this.c2.redMul(this.d).redMul(c)),h=d.redMul(p.redInvm()),y=h.redSqrt();if(y.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");var b=y.fromRed().isOdd();return(f&&!b||!f&&b)&&(y=y.redNeg()),this.point(s,y)},i.prototype.pointFromY=function(s,f){s=new t(s,16),s.red||(s=s.toRed(this.red));var c=s.redSqr(),d=c.redSub(this.c2),p=c.redMul(this.d).redMul(this.c2).redSub(this.a),h=d.redMul(p.redInvm());if(h.cmp(this.zero)===0){if(f)throw new Error("invalid point");return this.point(this.zero,s)}var y=h.redSqrt();if(y.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==f&&(y=y.redNeg()),this.point(y,s)},i.prototype.validate=function(s){if(s.isInfinity())return!0;s.normalize();var f=s.x.redSqr(),c=s.y.redSqr(),d=f.redMul(this.a).redAdd(c),p=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(c)));return d.cmp(p)===0};function u(a,s,f,c,d){n.BasePoint.call(this,a,"projective"),s===null&&f===null&&c===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(s,16),this.y=new t(f,16),this.z=c?new t(c,16):this.curve.one,this.t=d&&new t(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(u,n.BasePoint),i.prototype.pointFromJSON=function(s){return u.fromJSON(this,s)},i.prototype.point=function(s,f,c,d){return new u(this,s,f,c,d)},u.fromJSON=function(s,f){return new u(s,f[0],f[1],f[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},u.prototype._extDbl=function(){var s=this.x.redSqr(),f=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(s),p=this.x.redAdd(this.y).redSqr().redISub(s).redISub(f),h=d.redAdd(f),y=h.redSub(c),b=d.redSub(f),w=p.redMul(y),S=h.redMul(b),E=p.redMul(b),B=y.redMul(h);return this.curve.point(w,S,B,E)},u.prototype._projDbl=function(){var s=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),c=this.y.redSqr(),d,p,h,y,b,w;if(this.curve.twisted){y=this.curve._mulA(f);var S=y.redAdd(c);this.zOne?(d=s.redSub(f).redSub(c).redMul(S.redSub(this.curve.two)),p=S.redMul(y.redSub(c)),h=S.redSqr().redSub(S).redSub(S)):(b=this.z.redSqr(),w=S.redSub(b).redISub(b),d=s.redSub(f).redISub(c).redMul(w),p=S.redMul(y.redSub(c)),h=S.redMul(w))}else y=f.redAdd(c),b=this.curve._mulC(this.z).redSqr(),w=y.redSub(b).redSub(b),d=this.curve._mulC(s.redISub(y)).redMul(w),p=this.curve._mulC(y).redMul(f.redISub(c)),h=y.redMul(w);return this.curve.point(d,p,h)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(s){var f=this.y.redSub(this.x).redMul(s.y.redSub(s.x)),c=this.y.redAdd(this.x).redMul(s.y.redAdd(s.x)),d=this.t.redMul(this.curve.dd).redMul(s.t),p=this.z.redMul(s.z.redAdd(s.z)),h=c.redSub(f),y=p.redSub(d),b=p.redAdd(d),w=c.redAdd(f),S=h.redMul(y),E=b.redMul(w),B=h.redMul(w),ae=y.redMul(b);return this.curve.point(S,E,ae,B)},u.prototype._projAdd=function(s){var f=this.z.redMul(s.z),c=f.redSqr(),d=this.x.redMul(s.x),p=this.y.redMul(s.y),h=this.curve.d.redMul(d).redMul(p),y=c.redSub(h),b=c.redAdd(h),w=this.x.redAdd(this.y).redMul(s.x.redAdd(s.y)).redISub(d).redISub(p),S=f.redMul(y).redMul(w),E,B;return this.curve.twisted?(E=f.redMul(b).redMul(p.redSub(this.curve._mulA(d))),B=y.redMul(b)):(E=f.redMul(b).redMul(p.redSub(d)),B=this.curve._mulC(y).redMul(b)),this.curve.point(S,E,B)},u.prototype.add=function(s){return this.isInfinity()?s:s.isInfinity()?this:this.curve.extended?this._extAdd(s):this._projAdd(s)},u.prototype.mul=function(s){return this._hasDoubles(s)?this.curve._fixedNafMul(this,s):this.curve._wnafMul(this,s)},u.prototype.mulAdd=function(s,f,c){return this.curve._wnafMulAdd(1,[this,f],[s,c],2,!1)},u.prototype.jmulAdd=function(s,f,c){return this.curve._wnafMulAdd(1,[this,f],[s,c],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var s=this.z.redInvm();return this.x=this.x.redMul(s),this.y=this.y.redMul(s),this.t&&(this.t=this.t.redMul(s)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(s){return this===s||this.getX().cmp(s.getX())===0&&this.getY().cmp(s.getY())===0},u.prototype.eqXToP=function(s){var f=s.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var c=s.clone(),d=this.curve.redN.redMul(this.z);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(d),this.x.cmp(f)===0)return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add,edwards$1}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(function(e){var t=e;t.base=requireBase$1(),t.short=requireShort(),t.mont=requireMont(),t.edwards=requireEdwards()})(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var e=requireMinimalisticAssert(),t=requireInherits_browser();utils.inherits=t;function r(ce,Ze){return(ce.charCodeAt(Ze)&64512)!==55296||Ze<0||Ze+1>=ce.length?!1:(ce.charCodeAt(Ze+1)&64512)===56320}function n(ce,Ze){if(Array.isArray(ce))return ce.slice();if(!ce)return[];var se=[];if(typeof ce=="string")if(Ze){if(Ze==="hex")for(ce=ce.replace(/[^a-z0-9]+/ig,""),ce.length%2!==0&&(ce="0"+ce),ur=0;ur<ce.length;ur+=2)se.push(parseInt(ce[ur]+ce[ur+1],16))}else for(var vt=0,ur=0;ur<ce.length;ur++){var ue=ce.charCodeAt(ur);ue<128?se[vt++]=ue:ue<2048?(se[vt++]=ue>>6|192,se[vt++]=ue&63|128):r(ce,ur)?(ue=65536+((ue&1023)<<10)+(ce.charCodeAt(++ur)&1023),se[vt++]=ue>>18|240,se[vt++]=ue>>12&63|128,se[vt++]=ue>>6&63|128,se[vt++]=ue&63|128):(se[vt++]=ue>>12|224,se[vt++]=ue>>6&63|128,se[vt++]=ue&63|128)}else for(ur=0;ur<ce.length;ur++)se[ur]=ce[ur]|0;return se}utils.toArray=n;function o(ce){for(var Ze="",se=0;se<ce.length;se++)Ze+=a(ce[se].toString(16));return Ze}utils.toHex=o;function i(ce){var Ze=ce>>>24|ce>>>8&65280|ce<<8&16711680|(ce&255)<<24;return Ze>>>0}utils.htonl=i;function u(ce,Ze){for(var se="",vt=0;vt<ce.length;vt++){var ur=ce[vt];Ze==="little"&&(ur=i(ur)),se+=s(ur.toString(16))}return se}utils.toHex32=u;function a(ce){return ce.length===1?"0"+ce:ce}utils.zero2=a;function s(ce){return ce.length===7?"0"+ce:ce.length===6?"00"+ce:ce.length===5?"000"+ce:ce.length===4?"0000"+ce:ce.length===3?"00000"+ce:ce.length===2?"000000"+ce:ce.length===1?"0000000"+ce:ce}utils.zero8=s;function f(ce,Ze,se,vt){var ur=se-Ze;e(ur%4===0);for(var ue=new Array(ur/4),bt=0,L=Ze;bt<ue.length;bt++,L+=4){var _;vt==="big"?_=ce[L]<<24|ce[L+1]<<16|ce[L+2]<<8|ce[L+3]:_=ce[L+3]<<24|ce[L+2]<<16|ce[L+1]<<8|ce[L],ue[bt]=_>>>0}return ue}utils.join32=f;function c(ce,Ze){for(var se=new Array(ce.length*4),vt=0,ur=0;vt<ce.length;vt++,ur+=4){var ue=ce[vt];Ze==="big"?(se[ur]=ue>>>24,se[ur+1]=ue>>>16&255,se[ur+2]=ue>>>8&255,se[ur+3]=ue&255):(se[ur+3]=ue>>>24,se[ur+2]=ue>>>16&255,se[ur+1]=ue>>>8&255,se[ur]=ue&255)}return se}utils.split32=c;function d(ce,Ze){return ce>>>Ze|ce<<32-Ze}utils.rotr32=d;function p(ce,Ze){return ce<<Ze|ce>>>32-Ze}utils.rotl32=p;function h(ce,Ze){return ce+Ze>>>0}utils.sum32=h;function y(ce,Ze,se){return ce+Ze+se>>>0}utils.sum32_3=y;function b(ce,Ze,se,vt){return ce+Ze+se+vt>>>0}utils.sum32_4=b;function w(ce,Ze,se,vt,ur){return ce+Ze+se+vt+ur>>>0}utils.sum32_5=w;function S(ce,Ze,se,vt){var ur=ce[Ze],ue=ce[Ze+1],bt=vt+ue>>>0,L=(bt<vt?1:0)+se+ur;ce[Ze]=L>>>0,ce[Ze+1]=bt}utils.sum64=S;function E(ce,Ze,se,vt){var ur=Ze+vt>>>0,ue=(ur<Ze?1:0)+ce+se;return ue>>>0}utils.sum64_hi=E;function B(ce,Ze,se,vt){var ur=Ze+vt;return ur>>>0}utils.sum64_lo=B;function ae(ce,Ze,se,vt,ur,ue,bt,L){var _=0,F=Ze;F=F+vt>>>0,_+=F<Ze?1:0,F=F+ue>>>0,_+=F<ue?1:0,F=F+L>>>0,_+=F<L?1:0;var k=ce+se+ur+bt+_;return k>>>0}utils.sum64_4_hi=ae;function W(ce,Ze,se,vt,ur,ue,bt,L){var _=Ze+vt+ue+L;return _>>>0}utils.sum64_4_lo=W;function J(ce,Ze,se,vt,ur,ue,bt,L,_,F){var k=0,Ye=Ze;Ye=Ye+vt>>>0,k+=Ye<Ze?1:0,Ye=Ye+ue>>>0,k+=Ye<ue?1:0,Ye=Ye+L>>>0,k+=Ye<L?1:0,Ye=Ye+F>>>0,k+=Ye<F?1:0;var rn=ce+se+ur+bt+_+k;return rn>>>0}utils.sum64_5_hi=J;function ve(ce,Ze,se,vt,ur,ue,bt,L,_,F){var k=Ze+vt+ue+L+F;return k>>>0}utils.sum64_5_lo=ve;function Qe(ce,Ze,se){var vt=Ze<<32-se|ce>>>se;return vt>>>0}utils.rotr64_hi=Qe;function kt(ce,Ze,se){var vt=ce<<32-se|Ze>>>se;return vt>>>0}utils.rotr64_lo=kt;function nr(ce,Ze,se){return ce>>>se}utils.shr64_hi=nr;function sr(ce,Ze,se){var vt=ce<<32-se|Ze>>>se;return vt>>>0}return utils.shr64_lo=sr,utils}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var e=requireUtils(),t=requireMinimalisticAssert();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$1.BlockHash=r,r.prototype.update=function(o,i){if(o=e.toArray(o,i),this.pending?this.pending=this.pending.concat(o):this.pending=o,this.pendingTotal+=o.length,this.pending.length>=this._delta8){o=this.pending;var u=o.length%this._delta8;this.pending=o.slice(o.length-u,o.length),this.pending.length===0&&(this.pending=null),o=e.join32(o,0,o.length-u,this.endian);for(var a=0;a<o.length;a+=this._delta32)this._update(o,a,a+this._delta32)}return this},r.prototype.digest=function(o){return this.update(this._pad()),t(this.pending===null),this._digest(o)},r.prototype._pad=function(){var o=this.pendingTotal,i=this._delta8,u=i-(o+this.padLength)%i,a=new Array(u+this.padLength);a[0]=128;for(var s=1;s<u;s++)a[s]=0;if(o<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)a[s++]=0;a[s++]=0,a[s++]=0,a[s++]=0,a[s++]=0,a[s++]=o>>>24&255,a[s++]=o>>>16&255,a[s++]=o>>>8&255,a[s++]=o&255}else for(a[s++]=o&255,a[s++]=o>>>8&255,a[s++]=o>>>16&255,a[s++]=o>>>24&255,a[s++]=0,a[s++]=0,a[s++]=0,a[s++]=0,f=8;f<this.padLength;f++)a[s++]=0;return a},common$1}var sha={},common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var e=requireUtils(),t=e.rotr32;function r(c,d,p,h){if(c===0)return n(d,p,h);if(c===1||c===3)return i(d,p,h);if(c===2)return o(d,p,h)}common.ft_1=r;function n(c,d,p){return c&d^~c&p}common.ch32=n;function o(c,d,p){return c&d^c&p^d&p}common.maj32=o;function i(c,d,p){return c^d^p}common.p32=i;function u(c){return t(c,2)^t(c,13)^t(c,22)}common.s0_256=u;function a(c){return t(c,6)^t(c,11)^t(c,25)}common.s1_256=a;function s(c){return t(c,7)^t(c,18)^c>>>3}common.g0_256=s;function f(c){return t(c,17)^t(c,19)^c>>>10}return common.g1_256=f,common}var _1$1,hasRequired_1;function require_1(){if(hasRequired_1)return _1$1;hasRequired_1=1;var e=requireUtils(),t=requireCommon$1(),r=requireCommon(),n=e.rotl32,o=e.sum32,i=e.sum32_5,u=r.ft_1,a=t.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(f,a),_1$1=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(d,p){for(var h=this.W,y=0;y<16;y++)h[y]=d[p+y];for(;y<h.length;y++)h[y]=n(h[y-3]^h[y-8]^h[y-14]^h[y-16],1);var b=this.h[0],w=this.h[1],S=this.h[2],E=this.h[3],B=this.h[4];for(y=0;y<h.length;y++){var ae=~~(y/20),W=i(n(b,5),u(ae,w,S,E),B,h[y],s[ae]);B=E,E=S,S=n(w,30),w=b,b=W}this.h[0]=o(this.h[0],b),this.h[1]=o(this.h[1],w),this.h[2]=o(this.h[2],S),this.h[3]=o(this.h[3],E),this.h[4]=o(this.h[4],B)},f.prototype._digest=function(d){return d==="hex"?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_1$1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var e=requireUtils(),t=requireCommon$1(),r=requireCommon(),n=requireMinimalisticAssert(),o=e.sum32,i=e.sum32_4,u=e.sum32_5,a=r.ch32,s=r.maj32,f=r.s0_256,c=r.s1_256,d=r.g0_256,p=r.g1_256,h=t.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}return e.inherits(b,h),_256=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(S,E){for(var B=this.W,ae=0;ae<16;ae++)B[ae]=S[E+ae];for(;ae<B.length;ae++)B[ae]=i(p(B[ae-2]),B[ae-7],d(B[ae-15]),B[ae-16]);var W=this.h[0],J=this.h[1],ve=this.h[2],Qe=this.h[3],kt=this.h[4],nr=this.h[5],sr=this.h[6],ce=this.h[7];for(n(this.k.length===B.length),ae=0;ae<B.length;ae++){var Ze=u(ce,c(kt),a(kt,nr,sr),this.k[ae],B[ae]),se=o(f(W),s(W,J,ve));ce=sr,sr=nr,nr=kt,kt=o(Qe,Ze),Qe=ve,ve=J,J=W,W=o(Ze,se)}this.h[0]=o(this.h[0],W),this.h[1]=o(this.h[1],J),this.h[2]=o(this.h[2],ve),this.h[3]=o(this.h[3],Qe),this.h[4]=o(this.h[4],kt),this.h[5]=o(this.h[5],nr),this.h[6]=o(this.h[6],sr),this.h[7]=o(this.h[7],ce)},b.prototype._digest=function(S){return S==="hex"?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var e=requireUtils(),t=require_256();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),_224=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(o){return o==="hex"?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var e=requireUtils(),t=requireCommon$1(),r=requireMinimalisticAssert(),n=e.rotr64_hi,o=e.rotr64_lo,i=e.shr64_hi,u=e.shr64_lo,a=e.sum64,s=e.sum64_hi,f=e.sum64_lo,c=e.sum64_4_hi,d=e.sum64_4_lo,p=e.sum64_5_hi,h=e.sum64_5_lo,y=t.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function w(){if(!(this instanceof w))return new w;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}e.inherits(w,y),_512=w,w.blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(se,vt){for(var ur=this.W,ue=0;ue<32;ue++)ur[ue]=se[vt+ue];for(;ue<ur.length;ue+=2){var bt=sr(ur[ue-4],ur[ue-3]),L=ce(ur[ue-4],ur[ue-3]),_=ur[ue-14],F=ur[ue-13],k=kt(ur[ue-30],ur[ue-29]),Ye=nr(ur[ue-30],ur[ue-29]),rn=ur[ue-32],ii=ur[ue-31];ur[ue]=c(bt,L,_,F,k,Ye,rn,ii),ur[ue+1]=d(bt,L,_,F,k,Ye,rn,ii)}},w.prototype._update=function(se,vt){this._prepareBlock(se,vt);var ur=this.W,ue=this.h[0],bt=this.h[1],L=this.h[2],_=this.h[3],F=this.h[4],k=this.h[5],Ye=this.h[6],rn=this.h[7],ii=this.h[8],ai=this.h[9],ni=this.h[10],ri=this.h[11],ui=this.h[12],lr=this.h[13],ar=this.h[14],jr=this.h[15];r(this.k.length===ur.length);for(var ci=0;ci<ur.length;ci+=2){var mi=ar,pi=jr,ei=ve(ii,ai),Gr=Qe(ii,ai),ti=S(ii,ai,ni,ri,ui),fi=E(ii,ai,ni,ri,ui,lr),bi=this.k[ci],Ai=this.k[ci+1],Bi=ur[ci],qi=ur[ci+1],vn=p(mi,pi,ei,Gr,ti,fi,bi,Ai,Bi,qi),di=h(mi,pi,ei,Gr,ti,fi,bi,Ai,Bi,qi);mi=W(ue,bt),pi=J(ue,bt),ei=B(ue,bt,L,_,F),Gr=ae(ue,bt,L,_,F,k);var rr=s(mi,pi,ei,Gr),on=f(mi,pi,ei,Gr);ar=ui,jr=lr,ui=ni,lr=ri,ni=ii,ri=ai,ii=s(Ye,rn,vn,di),ai=f(rn,rn,vn,di),Ye=F,rn=k,F=L,k=_,L=ue,_=bt,ue=s(vn,di,rr,on),bt=f(vn,di,rr,on)}a(this.h,0,ue,bt),a(this.h,2,L,_),a(this.h,4,F,k),a(this.h,6,Ye,rn),a(this.h,8,ii,ai),a(this.h,10,ni,ri),a(this.h,12,ui,lr),a(this.h,14,ar,jr)},w.prototype._digest=function(se){return se==="hex"?e.toHex32(this.h,"big"):e.split32(this.h,"big")};function S(Ze,se,vt,ur,ue){var bt=Ze&vt^~Ze&ue;return bt<0&&(bt+=4294967296),bt}function E(Ze,se,vt,ur,ue,bt){var L=se&ur^~se&bt;return L<0&&(L+=4294967296),L}function B(Ze,se,vt,ur,ue){var bt=Ze&vt^Ze&ue^vt&ue;return bt<0&&(bt+=4294967296),bt}function ae(Ze,se,vt,ur,ue,bt){var L=se&ur^se&bt^ur&bt;return L<0&&(L+=4294967296),L}function W(Ze,se){var vt=n(Ze,se,28),ur=n(se,Ze,2),ue=n(se,Ze,7),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function J(Ze,se){var vt=o(Ze,se,28),ur=o(se,Ze,2),ue=o(se,Ze,7),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function ve(Ze,se){var vt=n(Ze,se,14),ur=n(Ze,se,18),ue=n(se,Ze,9),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function Qe(Ze,se){var vt=o(Ze,se,14),ur=o(Ze,se,18),ue=o(se,Ze,9),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function kt(Ze,se){var vt=n(Ze,se,1),ur=n(Ze,se,8),ue=i(Ze,se,7),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function nr(Ze,se){var vt=o(Ze,se,1),ur=o(Ze,se,8),ue=u(Ze,se,7),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function sr(Ze,se){var vt=n(Ze,se,19),ur=n(se,Ze,29),ue=i(Ze,se,6),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}function ce(Ze,se){var vt=o(Ze,se,19),ur=o(se,Ze,29),ue=u(Ze,se,6),bt=vt^ur^ue;return bt<0&&(bt+=4294967296),bt}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var e=requireUtils(),t=require_512();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),_384=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(o){return o==="hex"?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var e=requireUtils(),t=requireCommon$1(),r=e.rotl32,n=e.sum32,o=e.sum32_3,i=e.sum32_4,u=t.BlockHash;function a(){if(!(this instanceof a))return new a;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}e.inherits(a,u),ripemd.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(w,S){for(var E=this.h[0],B=this.h[1],ae=this.h[2],W=this.h[3],J=this.h[4],ve=E,Qe=B,kt=ae,nr=W,sr=J,ce=0;ce<80;ce++){var Ze=n(r(i(E,s(ce,B,ae,W),w[d[ce]+S],f(ce)),h[ce]),J);E=J,J=W,W=r(ae,10),ae=B,B=Ze,Ze=n(r(i(ve,s(79-ce,Qe,kt,nr),w[p[ce]+S],c(ce)),y[ce]),sr),ve=sr,sr=nr,nr=r(kt,10),kt=Qe,Qe=Ze}Ze=o(this.h[1],ae,nr),this.h[1]=o(this.h[2],W,sr),this.h[2]=o(this.h[3],J,ve),this.h[3]=o(this.h[4],E,Qe),this.h[4]=o(this.h[0],B,kt),this.h[0]=Ze},a.prototype._digest=function(w){return w==="hex"?e.toHex32(this.h,"little"):e.split32(this.h,"little")};function s(b,w,S,E){return b<=15?w^S^E:b<=31?w&S|~w&E:b<=47?(w|~S)^E:b<=63?w&E|S&~E:w^(S|~E)}function f(b){return b<=15?0:b<=31?1518500249:b<=47?1859775393:b<=63?2400959708:2840853838}function c(b){return b<=15?1352829926:b<=31?1548603684:b<=47?1836072691:b<=63?2053994217:0}var d=[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],p=[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],h=[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],y=[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];return ripemd}var hmac,hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;var e=requireUtils(),t=requireMinimalisticAssert();function r(n,o,i){if(!(this instanceof r))return new r(n,o,i);this.Hash=n,this.blockSize=n.blockSize/8,this.outSize=n.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(o,i))}return hmac=r,r.prototype._init=function(o){o.length>this.blockSize&&(o=new this.Hash().update(o).digest()),t(o.length<=this.blockSize);for(var i=o.length;i<this.blockSize;i++)o.push(0);for(i=0;i<o.length;i++)o[i]^=54;for(this.inner=new this.Hash().update(o),i=0;i<o.length;i++)o[i]^=106;this.outer=new this.Hash().update(o)},r.prototype.update=function(o,i){return this.inner.update(o,i),this},r.prototype.digest=function(o){return this.outer.update(this.inner.digest()),this.outer.digest(o)},hmac}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(function(e){var t=e;t.utils=requireUtils(),t.common=requireCommon$1(),t.sha=requireSha(),t.ripemd=requireRipemd(),t.hmac=requireHmac(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,(function(e){var t=e,r=requireHash(),n=requireCurve(),o=requireUtils$1(),i=o.assert;function u(f){f.type==="short"?this.curve=new n.short(f):f.type==="edwards"?this.curve=new n.edwards(f):this.curve=new n.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=u;function a(f,c){Object.defineProperty(t,f,{configurable:!0,enumerable:!0,get:function(){var d=new u(c);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:d}),d}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=requireSecp256k1()}catch{s=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})})(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var e=requireHash(),t=requireUtils$2(),r=requireMinimalisticAssert();function n(o){if(!(this instanceof n))return new n(o);this.hash=o.hash,this.predResist=!!o.predResist,this.outLen=this.hash.outSize,this.minEntropy=o.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(o.entropy,o.entropyEnc||"hex"),u=t.toArray(o.nonce,o.nonceEnc||"hex"),a=t.toArray(o.pers,o.persEnc||"hex");r(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,u,a)}return hmacDrbg=n,n.prototype._init=function(i,u,a){var s=i.concat(u).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(s),this._reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},n.prototype._update=function(i){var u=this._hmac().update(this.V).update([0]);i&&(u=u.update(i)),this.K=u.digest(),this.V=this._hmac().update(this.V).digest(),i&&(this.K=this._hmac().update(this.V).update([1]).update(i).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(i,u,a,s){typeof u!="string"&&(s=a,a=u,u=null),i=t.toArray(i,u),a=t.toArray(a,s),r(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(i.concat(a||[])),this._reseed=1},n.prototype.generate=function(i,u,a,s){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof u!="string"&&(s=a,a=u,u=null),a&&(a=t.toArray(a,s||"hex"),this._update(a));for(var f=[];f.length<i;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,i);return this._update(a),this._reseed++,t.encode(c,u)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var e=requireBn$1(),t=requireUtils$1(),r=t.assert;function n(o,i){this.ec=o,this.priv=null,this.pub=null,i.priv&&this._importPrivate(i.priv,i.privEnc),i.pub&&this._importPublic(i.pub,i.pubEnc)}return key$1=n,n.fromPublic=function(i,u,a){return u instanceof n?u:new n(i,{pub:u,pubEnc:a})},n.fromPrivate=function(i,u,a){return u instanceof n?u:new n(i,{priv:u,privEnc:a})},n.prototype.validate=function(){var i=this.getPublic();return i.isInfinity()?{result:!1,reason:"Invalid public key"}:i.validate()?i.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(i,u){return typeof i=="string"&&(u=i,i=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),u?this.pub.encode(u,i):this.pub},n.prototype.getPrivate=function(i){return i==="hex"?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(i,u){this.priv=new e(i,u||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(i,u){if(i.x||i.y){this.ec.curve.type==="mont"?r(i.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&r(i.x&&i.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(i.x,i.y);return}this.pub=this.ec.curve.decodePoint(i,u)},n.prototype.derive=function(i){return i.validate()||r(i.validate(),"public point not validated"),i.mul(this.priv).getX()},n.prototype.sign=function(i,u,a){return this.ec.sign(i,this,u,a)},n.prototype.verify=function(i,u,a){return this.ec.verify(i,u,this,void 0,a)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var e=requireBn$1(),t=requireUtils$1(),r=t.assert;function n(s,f){if(s instanceof n)return s;this._importDER(s,f)||(r(s.r&&s.s,"Signature without r or s"),this.r=new e(s.r,16),this.s=new e(s.s,16),s.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=s.recoveryParam)}signature$1=n;function o(){this.place=0}function i(s,f){var c=s[f.place++];if(!(c&128))return c;var d=c&15;if(d===0||d>4||s[f.place]===0)return!1;for(var p=0,h=0,y=f.place;h<d;h++,y++)p<<=8,p|=s[y],p>>>=0;return p<=127?!1:(f.place=y,p)}function u(s){for(var f=0,c=s.length-1;!s[f]&&!(s[f+1]&128)&&f<c;)f++;return f===0?s:s.slice(f)}n.prototype._importDER=function(f,c){f=t.toArray(f,c);var d=new o;if(f[d.place++]!==48)return!1;var p=i(f,d);if(p===!1||p+d.place!==f.length||f[d.place++]!==2)return!1;var h=i(f,d);if(h===!1||(f[d.place]&128)!==0)return!1;var y=f.slice(d.place,h+d.place);if(d.place+=h,f[d.place++]!==2)return!1;var b=i(f,d);if(b===!1||f.length!==b+d.place||(f[d.place]&128)!==0)return!1;var w=f.slice(d.place,b+d.place);if(y[0]===0)if(y[1]&128)y=y.slice(1);else return!1;if(w[0]===0)if(w[1]&128)w=w.slice(1);else return!1;return this.r=new e(y),this.s=new e(w),this.recoveryParam=null,!0};function a(s,f){if(f<128){s.push(f);return}var c=1+(Math.log(f)/Math.LN2>>>3);for(s.push(c|128);--c;)s.push(f>>>(c<<3)&255);s.push(f)}return n.prototype.toDER=function(f){var c=this.r.toArray(),d=this.s.toArray();for(c[0]&128&&(c=[0].concat(c)),d[0]&128&&(d=[0].concat(d)),c=u(c),d=u(d);!d[0]&&!(d[1]&128);)d=d.slice(1);var p=[2];a(p,c.length),p=p.concat(c),p.push(2),a(p,d.length);var h=p.concat(d),y=[48];return a(y,h.length),y=y.concat(h),t.encode(y,f)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var e=requireBn$1(),t=requireHmacDrbg(),r=requireUtils$1(),n=requireCurves(),o=requireBrorand(),i=r.assert,u=requireKey$1(),a=requireSignature$1();function s(f){if(!(this instanceof s))return new s(f);typeof f=="string"&&(i(Object.prototype.hasOwnProperty.call(n,f),"Unknown curve "+f),f=n[f]),f instanceof n.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}return ec=s,s.prototype.keyPair=function(c){return new u(this,c)},s.prototype.keyFromPrivate=function(c,d){return u.fromPrivate(this,c,d)},s.prototype.keyFromPublic=function(c,d){return u.fromPublic(this,c,d)},s.prototype.genKeyPair=function(c){c||(c={});for(var d=new t({hash:this.hash,pers:c.pers,persEnc:c.persEnc||"utf8",entropy:c.entropy||o(this.hash.hmacStrength),entropyEnc:c.entropy&&c.entropyEnc||"utf8",nonce:this.n.toArray()}),p=this.n.byteLength(),h=this.n.sub(new e(2));;){var y=new e(d.generate(p));if(!(y.cmp(h)>0))return y.iaddn(1),this.keyFromPrivate(y)}},s.prototype._truncateToN=function(c,d,p){var h;if(e.isBN(c)||typeof c=="number")c=new e(c,16),h=c.byteLength();else if(typeof c=="object")h=c.length,c=new e(c,16);else{var y=c.toString();h=y.length+1>>>1,c=new e(y,16)}typeof p!="number"&&(p=h*8);var b=p-this.n.bitLength();return b>0&&(c=c.ushrn(b)),!d&&c.cmp(this.n)>=0?c.sub(this.n):c},s.prototype.sign=function(c,d,p,h){if(typeof p=="object"&&(h=p,p=null),h||(h={}),typeof c!="string"&&typeof c!="number"&&!e.isBN(c)){i(typeof c=="object"&&c&&typeof c.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),i(c.length>>>0===c.length);for(var y=0;y<c.length;y++)i((c[y]&255)===c[y])}d=this.keyFromPrivate(d,p),c=this._truncateToN(c,!1,h.msgBitLength),i(!c.isNeg(),"Can not sign a negative message");var b=this.n.byteLength(),w=d.getPrivate().toArray("be",b),S=c.toArray("be",b);i(new e(S).eq(c),"Can not sign message");for(var E=new t({hash:this.hash,entropy:w,nonce:S,pers:h.pers,persEnc:h.persEnc||"utf8"}),B=this.n.sub(new e(1)),ae=0;;ae++){var W=h.k?h.k(ae):new e(E.generate(this.n.byteLength()));if(W=this._truncateToN(W,!0),!(W.cmpn(1)<=0||W.cmp(B)>=0)){var J=this.g.mul(W);if(!J.isInfinity()){var ve=J.getX(),Qe=ve.umod(this.n);if(Qe.cmpn(0)!==0){var kt=W.invm(this.n).mul(Qe.mul(d.getPrivate()).iadd(c));if(kt=kt.umod(this.n),kt.cmpn(0)!==0){var nr=(J.getY().isOdd()?1:0)|(ve.cmp(Qe)!==0?2:0);return h.canonical&&kt.cmp(this.nh)>0&&(kt=this.n.sub(kt),nr^=1),new a({r:Qe,s:kt,recoveryParam:nr})}}}}}},s.prototype.verify=function(c,d,p,h,y){y||(y={}),c=this._truncateToN(c,!1,y.msgBitLength),p=this.keyFromPublic(p,h),d=new a(d,"hex");var b=d.r,w=d.s;if(b.cmpn(1)<0||b.cmp(this.n)>=0||w.cmpn(1)<0||w.cmp(this.n)>=0)return!1;var S=w.invm(this.n),E=S.mul(c).umod(this.n),B=S.mul(b).umod(this.n),ae;return this.curve._maxwellTrick?(ae=this.g.jmulAdd(E,p.getPublic(),B),ae.isInfinity()?!1:ae.eqXToP(b)):(ae=this.g.mulAdd(E,p.getPublic(),B),ae.isInfinity()?!1:ae.getX().umod(this.n).cmp(b)===0)},s.prototype.recoverPubKey=function(f,c,d,p){i((3&d)===d,"The recovery param is more than two bits"),c=new a(c,p);var h=this.n,y=new e(f),b=c.r,w=c.s,S=d&1,E=d>>1;if(b.cmp(this.curve.p.umod(this.curve.n))>=0&&E)throw new Error("Unable to find sencond key candinate");E?b=this.curve.pointFromX(b.add(this.curve.n),S):b=this.curve.pointFromX(b,S);var B=c.r.invm(h),ae=h.sub(y).mul(B).umod(h),W=w.mul(B).umod(h);return this.g.mulAdd(ae,b,W)},s.prototype.getKeyRecoveryParam=function(f,c,d,p){if(c=new a(c,p),c.recoveryParam!==null)return c.recoveryParam;for(var h=0;h<4;h++){var y;try{y=this.recoverPubKey(f,c,h)}catch{continue}if(y.eq(d))return h}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var e=requireUtils$1(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function o(i,u){this.eddsa=i,this._secret=r(u.secret),i.isPoint(u.pub)?this._pub=u.pub:this._pubBytes=r(u.pub)}return o.fromPublic=function(u,a){return a instanceof o?a:new o(u,{pub:a})},o.fromSecret=function(u,a){return a instanceof o?a:new o(u,{secret:a})},o.prototype.secret=function(){return this._secret},n(o,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),n(o,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),n(o,"privBytes",function(){var u=this.eddsa,a=this.hash(),s=u.encodingLength-1,f=a.slice(0,u.encodingLength);return f[0]&=248,f[s]&=127,f[s]|=64,f}),n(o,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),n(o,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),n(o,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),o.prototype.sign=function(u){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(u,this)},o.prototype.verify=function(u,a){return this.eddsa.verify(u,a,this)},o.prototype.getSecret=function(u){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),u)},o.prototype.getPublic=function(u){return e.encode(this.pubBytes(),u)},key=o,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var e=requireBn$1(),t=requireUtils$1(),r=t.assert,n=t.cachedProperty,o=t.parseBytes;function i(u,a){this.eddsa=u,typeof a!="object"&&(a=o(a)),Array.isArray(a)&&(r(a.length===u.encodingLength*2,"Signature has invalid size"),a={R:a.slice(0,u.encodingLength),S:a.slice(u.encodingLength)}),r(a.R&&a.S,"Signature without R or S"),u.isPoint(a.R)&&(this._R=a.R),a.S instanceof e&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}return n(i,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),n(i,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),n(i,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),n(i,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},signature=i,signature}var eddsa$1,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa$1;hasRequiredEddsa=1;var e=requireHash(),t=requireCurves(),r=requireUtils$1(),n=r.assert,o=r.parseBytes,i=requireKey(),u=requireSignature();function a(s){if(n(s==="ed25519","only tested with ed25519 so far"),!(this instanceof a))return new a(s);s=t[s].curve,this.curve=s,this.g=s.g,this.g.precompute(s.n.bitLength()+1),this.pointClass=s.point().constructor,this.encodingLength=Math.ceil(s.n.bitLength()/8),this.hash=e.sha512}return eddsa$1=a,a.prototype.sign=function(f,c){f=o(f);var d=this.keyFromSecret(c),p=this.hashInt(d.messagePrefix(),f),h=this.g.mul(p),y=this.encodePoint(h),b=this.hashInt(y,d.pubBytes(),f).mul(d.priv()),w=p.add(b).umod(this.curve.n);return this.makeSignature({R:h,S:w,Rencoded:y})},a.prototype.verify=function(f,c,d){if(f=o(f),c=this.makeSignature(c),c.S().gte(c.eddsa.curve.n)||c.S().isNeg())return!1;var p=this.keyFromPublic(d),h=this.hashInt(c.Rencoded(),p.pubBytes(),f),y=this.g.mul(c.S()),b=c.R().add(p.pub().mul(h));return b.eq(y)},a.prototype.hashInt=function(){for(var f=this.hash(),c=0;c<arguments.length;c++)f.update(arguments[c]);return r.intFromLE(f.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(f){return i.fromPublic(this,f)},a.prototype.keyFromSecret=function(f){return i.fromSecret(this,f)},a.prototype.makeSignature=function(f){return f instanceof u?f:new u(this,f)},a.prototype.encodePoint=function(f){var c=f.getY().toArray("le",this.encodingLength);return c[this.encodingLength-1]|=f.getX().isOdd()?128:0,c},a.prototype.decodePoint=function(f){f=r.parseBytes(f);var c=f.length-1,d=f.slice(0,c).concat(f[c]&-129),p=(f[c]&128)!==0,h=r.intFromLE(d);return this.curve.pointFromY(h,p)},a.prototype.encodeInt=function(f){return f.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(f){return r.intFromLE(f)},a.prototype.isPoint=function(f){return f instanceof this.pointClass},eddsa$1}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(function(e){var t=e;t.version=require$$0.version,t.utils=requireUtils$1(),t.rand=requireBrorand(),t.curve=requireCurve(),t.curves=requireCurves(),t.ec=requireEc(),t.eddsa=requireEddsa()})(elliptic)),elliptic}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,(function(exports$1){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch{return function(t,r,n){t[r]=n}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports$1.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,n=r.eval,o=r.execScript;!n&&o&&(o.call(r,"null"),n=r.eval),forEach(Object_keys(e),function(a){r[a]=e[a]}),forEach(globals,function(a){e[a]&&(r[a]=e[a])});var i=Object_keys(r),u=n.call(r,this.code);return forEach(Object_keys(r),function(a){(a in e||indexOf(i,a)===-1)&&(e[a]=r[a])}),forEach(globals,function(a){a in e||defineProp(e,a,r[a])}),document.body.removeChild(t),u},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(n){e[n]=t[n]}),r},forEach(Object_keys(Script.prototype),function(e){exports$1[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}}),exports$1.isContext=function(e){return e instanceof Context},exports$1.createScript=function(e){return exports$1.Script(e)},exports$1.createContext=Script.createContext=function(e){var t=new Context;return typeof e=="object"&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}})(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,(function(e){var t=requireAsn1$1(),r=requireInherits_browser(),n=e;n.define=function(u,a){return new o(u,a)};function o(i,u){this.name=i,this.body=u,this.decoders={},this.encoders={}}o.prototype._createNamed=function(u){var a;try{a=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
135
135
  this._initNamed(entity);
136
136
  })`)}catch{a=function(f){this._initNamed(f)}}return r(a,u),a.prototype._initNamed=function(f){u.call(this,f)},new a(this)},o.prototype._getDecoder=function(u){return u=u||"der",this.decoders.hasOwnProperty(u)||(this.decoders[u]=this._createNamed(t.decoders[u])),this.decoders[u]},o.prototype.decode=function(u,a,s){return this._getDecoder(a).decode(u,s)},o.prototype._getEncoder=function(u){return u=u||"der",this.encoders.hasOwnProperty(u)||(this.encoders[u]=this._createNamed(t.encoders[u])),this.encoders[u]},o.prototype.encode=function(u,a,s){return this._getEncoder(a).encode(u,s)}})(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var e=requireInherits_browser();function t(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}reporter.Reporter=t,t.prototype.isError=function(o){return o instanceof r},t.prototype.save=function(){var o=this._reporterState;return{obj:o.obj,pathLen:o.path.length}},t.prototype.restore=function(o){var i=this._reporterState;i.obj=o.obj,i.path=i.path.slice(0,o.pathLen)},t.prototype.enterKey=function(o){return this._reporterState.path.push(o)},t.prototype.exitKey=function(o){var i=this._reporterState;i.path=i.path.slice(0,o-1)},t.prototype.leaveKey=function(o,i,u){var a=this._reporterState;this.exitKey(o),a.obj!==null&&(a.obj[i]=u)},t.prototype.path=function(){return this._reporterState.path.join("/")},t.prototype.enterObject=function(){var o=this._reporterState,i=o.obj;return o.obj={},i},t.prototype.leaveObject=function(o){var i=this._reporterState,u=i.obj;return i.obj=o,u},t.prototype.error=function(o){var i,u=this._reporterState,a=o instanceof r;if(a?i=o:i=new r(u.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),o.message||o,o.stack),!u.options.partial)throw i;return a||u.errors.push(i),i},t.prototype.wrapResult=function(o){var i=this._reporterState;return i.options.partial?{result:this.isError(o)?null:o,errors:i.errors}:o};function r(n,o){this.path=n,this.rethrow(o)}return e(r,Error),r.prototype.rethrow=function(o){if(this.message=o+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,r),!this.stack)try{throw new Error(this.message)}catch(i){this.stack=i.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var e=requireInherits_browser(),t=requireBase().Reporter,r=requireBuffer$1().Buffer;function n(i,u){if(t.call(this,u),!r.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}e(n,t),buffer.DecoderBuffer=n,n.prototype.save=function(){return{offset:this.offset,reporter:t.prototype.save.call(this)}},n.prototype.restore=function(u){var a=new n(this.base);return a.offset=u.offset,a.length=this.offset,this.offset=u.offset,t.prototype.restore.call(this,u.reporter),a},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(u){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(u||"DecoderBuffer overrun")},n.prototype.skip=function(u,a){if(!(this.offset+u<=this.length))return this.error(a||"DecoderBuffer overrun");var s=new n(this.base);return s._reporterState=this._reporterState,s.offset=this.offset,s.length=this.offset+u,this.offset+=u,s},n.prototype.raw=function(u){return this.base.slice(u?u.offset:this.offset,this.length)};function o(i,u){if(Array.isArray(i))this.length=0,this.value=i.map(function(a){return a instanceof o||(a=new o(a,u)),this.length+=a.length,a},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return u.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=r.byteLength(i);else if(r.isBuffer(i))this.value=i,this.length=i.length;else return u.error("Unsupported type: "+typeof i)}return buffer.EncoderBuffer=o,o.prototype.join=function(u,a){return u||(u=new r(this.length)),a||(a=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(s){s.join(u,a),a+=s.length}):(typeof this.value=="number"?u[a]=this.value:typeof this.value=="string"?u.write(this.value,a):r.isBuffer(this.value)&&this.value.copy(u,a),a+=this.length)),u},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var e=requireBase().Reporter,t=requireBase().EncoderBuffer,r=requireBase().DecoderBuffer,n=requireMinimalisticAssert(),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],i=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o),u=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function a(f,c){var d={};this._baseState=d,d.enc=f,d.parent=c||null,d.children=null,d.tag=null,d.args=null,d.reverseArgs=null,d.choice=null,d.optional=!1,d.any=!1,d.obj=!1,d.use=null,d.useDecoder=null,d.key=null,d.default=null,d.explicit=null,d.implicit=null,d.contains=null,d.parent||(d.children=[],this._wrap())}node=a;var s=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return a.prototype.clone=function(){var c=this._baseState,d={};s.forEach(function(h){d[h]=c[h]});var p=new this.constructor(d.parent);return p._baseState=d,p},a.prototype._wrap=function(){var c=this._baseState;i.forEach(function(d){this[d]=function(){var h=new this.constructor(this);return c.children.push(h),h[d].apply(h,arguments)}},this)},a.prototype._init=function(c){var d=this._baseState;n(d.parent===null),c.call(this),d.children=d.children.filter(function(p){return p._baseState.parent===this},this),n.equal(d.children.length,1,"Root node can have only one child")},a.prototype._useArgs=function(c){var d=this._baseState,p=c.filter(function(h){return h instanceof this.constructor},this);c=c.filter(function(h){return!(h instanceof this.constructor)},this),p.length!==0&&(n(d.children===null),d.children=p,p.forEach(function(h){h._baseState.parent=this},this)),c.length!==0&&(n(d.args===null),d.args=c,d.reverseArgs=c.map(function(h){if(typeof h!="object"||h.constructor!==Object)return h;var y={};return Object.keys(h).forEach(function(b){b==(b|0)&&(b|=0);var w=h[b];y[w]=b}),y}))},u.forEach(function(f){a.prototype[f]=function(){var d=this._baseState;throw new Error(f+" not implemented for encoding: "+d.enc)}}),o.forEach(function(f){a.prototype[f]=function(){var d=this._baseState,p=Array.prototype.slice.call(arguments);return n(d.tag===null),d.tag=f,this._useArgs(p),this}}),a.prototype.use=function(c){n(c);var d=this._baseState;return n(d.use===null),d.use=c,this},a.prototype.optional=function(){var c=this._baseState;return c.optional=!0,this},a.prototype.def=function(c){var d=this._baseState;return n(d.default===null),d.default=c,d.optional=!0,this},a.prototype.explicit=function(c){var d=this._baseState;return n(d.explicit===null&&d.implicit===null),d.explicit=c,this},a.prototype.implicit=function(c){var d=this._baseState;return n(d.explicit===null&&d.implicit===null),d.implicit=c,this},a.prototype.obj=function(){var c=this._baseState,d=Array.prototype.slice.call(arguments);return c.obj=!0,d.length!==0&&this._useArgs(d),this},a.prototype.key=function(c){var d=this._baseState;return n(d.key===null),d.key=c,this},a.prototype.any=function(){var c=this._baseState;return c.any=!0,this},a.prototype.choice=function(c){var d=this._baseState;return n(d.choice===null),d.choice=c,this._useArgs(Object.keys(c).map(function(p){return c[p]})),this},a.prototype.contains=function(c){var d=this._baseState;return n(d.use===null),d.contains=c,this},a.prototype._decode=function(c,d){var p=this._baseState;if(p.parent===null)return c.wrapResult(p.children[0]._decode(c,d));var h=p.default,y=!0,b=null;if(p.key!==null&&(b=c.enterKey(p.key)),p.optional){var w=null;if(p.explicit!==null?w=p.explicit:p.implicit!==null?w=p.implicit:p.tag!==null&&(w=p.tag),w===null&&!p.any){var S=c.save();try{p.choice===null?this._decodeGeneric(p.tag,c,d):this._decodeChoice(c,d),y=!0}catch{y=!1}c.restore(S)}else if(y=this._peekTag(c,w,p.any),c.isError(y))return y}var E;if(p.obj&&y&&(E=c.enterObject()),y){if(p.explicit!==null){var B=this._decodeTag(c,p.explicit);if(c.isError(B))return B;c=B}var ae=c.offset;if(p.use===null&&p.choice===null){if(p.any)var S=c.save();var W=this._decodeTag(c,p.implicit!==null?p.implicit:p.tag,p.any);if(c.isError(W))return W;p.any?h=c.raw(S):c=W}if(d&&d.track&&p.tag!==null&&d.track(c.path(),ae,c.length,"tagged"),d&&d.track&&p.tag!==null&&d.track(c.path(),c.offset,c.length,"content"),p.any?h=h:p.choice===null?h=this._decodeGeneric(p.tag,c,d):h=this._decodeChoice(c,d),c.isError(h))return h;if(!p.any&&p.choice===null&&p.children!==null&&p.children.forEach(function(Qe){Qe._decode(c,d)}),p.contains&&(p.tag==="octstr"||p.tag==="bitstr")){var J=new r(h);h=this._getUse(p.contains,c._reporterState.obj)._decode(J,d)}}return p.obj&&y&&(h=c.leaveObject(E)),p.key!==null&&(h!==null||y===!0)?c.leaveKey(b,p.key,h):b!==null&&c.exitKey(b),h},a.prototype._decodeGeneric=function(c,d,p){var h=this._baseState;return c==="seq"||c==="set"?null:c==="seqof"||c==="setof"?this._decodeList(d,c,h.args[0],p):/str$/.test(c)?this._decodeStr(d,c,p):c==="objid"&&h.args?this._decodeObjid(d,h.args[0],h.args[1],p):c==="objid"?this._decodeObjid(d,null,null,p):c==="gentime"||c==="utctime"?this._decodeTime(d,c,p):c==="null_"?this._decodeNull(d,p):c==="bool"?this._decodeBool(d,p):c==="objDesc"?this._decodeStr(d,c,p):c==="int"||c==="enum"?this._decodeInt(d,h.args&&h.args[0],p):h.use!==null?this._getUse(h.use,d._reporterState.obj)._decode(d,p):d.error("unknown tag: "+c)},a.prototype._getUse=function(c,d){var p=this._baseState;return p.useDecoder=this._use(c,d),n(p.useDecoder._baseState.parent===null),p.useDecoder=p.useDecoder._baseState.children[0],p.implicit!==p.useDecoder._baseState.implicit&&(p.useDecoder=p.useDecoder.clone(),p.useDecoder._baseState.implicit=p.implicit),p.useDecoder},a.prototype._decodeChoice=function(c,d){var p=this._baseState,h=null,y=!1;return Object.keys(p.choice).some(function(b){var w=c.save(),S=p.choice[b];try{var E=S._decode(c,d);if(c.isError(E))return!1;h={type:b,value:E},y=!0}catch{return c.restore(w),!1}return!0},this),y?h:c.error("Choice not matched")},a.prototype._createEncoderBuffer=function(c){return new t(c,this.reporter)},a.prototype._encode=function(c,d,p){var h=this._baseState;if(!(h.default!==null&&h.default===c)){var y=this._encodeValue(c,d,p);if(y!==void 0&&!this._skipDefault(y,d,p))return y}},a.prototype._encodeValue=function(c,d,p){var h=this._baseState;if(h.parent===null)return h.children[0]._encode(c,d||new e);var S=null;if(this.reporter=d,h.optional&&c===void 0)if(h.default!==null)c=h.default;else return;var y=null,b=!1;if(h.any)S=this._createEncoderBuffer(c);else if(h.choice)S=this._encodeChoice(c,d);else if(h.contains)y=this._getUse(h.contains,p)._encode(c,d),b=!0;else if(h.children)y=h.children.map(function(ae){if(ae._baseState.tag==="null_")return ae._encode(null,d,c);if(ae._baseState.key===null)return d.error("Child should have a key");var W=d.enterKey(ae._baseState.key);if(typeof c!="object")return d.error("Child expected, but input is not object");var J=ae._encode(c[ae._baseState.key],d,c);return d.leaveKey(W),J},this).filter(function(ae){return ae}),y=this._createEncoderBuffer(y);else if(h.tag==="seqof"||h.tag==="setof"){if(!(h.args&&h.args.length===1))return d.error("Too many args for : "+h.tag);if(!Array.isArray(c))return d.error("seqof/setof, but data is not Array");var w=this.clone();w._baseState.implicit=null,y=this._createEncoderBuffer(c.map(function(ae){var W=this._baseState;return this._getUse(W.args[0],c)._encode(ae,d)},w))}else h.use!==null?S=this._getUse(h.use,p)._encode(c,d):(y=this._encodePrimitive(h.tag,c),b=!0);var S;if(!h.any&&h.choice===null){var E=h.implicit!==null?h.implicit:h.tag,B=h.implicit===null?"universal":"context";E===null?h.use===null&&d.error("Tag could be omitted only for .use()"):h.use===null&&(S=this._encodeComposite(E,b,B,y))}return h.explicit!==null&&(S=this._encodeComposite(h.explicit,!1,"context",S)),S},a.prototype._encodeChoice=function(c,d){var p=this._baseState,h=p.choice[c.type];return h||n(!1,c.type+" not found in "+JSON.stringify(Object.keys(p.choice))),h._encode(c.value,d)},a.prototype._encodePrimitive=function(c,d){var p=this._baseState;if(/str$/.test(c))return this._encodeStr(d,c);if(c==="objid"&&p.args)return this._encodeObjid(d,p.reverseArgs[0],p.args[1]);if(c==="objid")return this._encodeObjid(d,null,null);if(c==="gentime"||c==="utctime")return this._encodeTime(d,c);if(c==="null_")return this._encodeNull();if(c==="int"||c==="enum")return this._encodeInt(d,p.args&&p.reverseArgs[0]);if(c==="bool")return this._encodeBool(d);if(c==="objDesc")return this._encodeStr(d,c);throw new Error("Unsupported tag: "+c)},a.prototype._isNumstr=function(c){return/^[0-9 ]*$/.test(c)},a.prototype._isPrintstr=function(c){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(c)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(function(e){var t=e;t.Reporter=requireReporter().Reporter,t.DecoderBuffer=requireBuffer().DecoderBuffer,t.EncoderBuffer=requireBuffer().EncoderBuffer,t.Node=requireNode()})(base)),base}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,(function(e){var t=requireConstants();e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t._reverse(e.tag)})(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(function(e){var t=e;t._reverse=function(n){var o={};return Object.keys(n).forEach(function(i){(i|0)==i&&(i=i|0);var u=n[i];o[u]=i}),o},t.der=requireDer$2()})(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var e=requireInherits_browser(),t=requireAsn1$1(),r=t.base,n=t.bignum,o=t.constants.der;function i(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new u,this.tree._init(f.body)}der_1$1=i,i.prototype.decode=function(c,d){return c instanceof r.DecoderBuffer||(c=new r.DecoderBuffer(c,d)),this.tree._decode(c,d)};function u(f){r.Node.call(this,"der",f)}e(u,r.Node),u.prototype._peekTag=function(c,d,p){if(c.isEmpty())return!1;var h=c.save(),y=a(c,'Failed to peek tag: "'+d+'"');return c.isError(y)?y:(c.restore(h),y.tag===d||y.tagStr===d||y.tagStr+"of"===d||p)},u.prototype._decodeTag=function(c,d,p){var h=a(c,'Failed to decode tag of "'+d+'"');if(c.isError(h))return h;var y=s(c,h.primitive,'Failed to get length of "'+d+'"');if(c.isError(y))return y;if(!p&&h.tag!==d&&h.tagStr!==d&&h.tagStr+"of"!==d)return c.error('Failed to match tag: "'+d+'"');if(h.primitive||y!==null)return c.skip(y,'Failed to match body of: "'+d+'"');var b=c.save(),w=this._skipUntilEnd(c,'Failed to skip indefinite length body: "'+this.tag+'"');return c.isError(w)?w:(y=c.offset-b.offset,c.restore(b),c.skip(y,'Failed to match body of: "'+d+'"'))},u.prototype._skipUntilEnd=function(c,d){for(;;){var p=a(c,d);if(c.isError(p))return p;var h=s(c,p.primitive,d);if(c.isError(h))return h;var y;if(p.primitive||h!==null?y=c.skip(h):y=this._skipUntilEnd(c,d),c.isError(y))return y;if(p.tagStr==="end")break}},u.prototype._decodeList=function(c,d,p,h){for(var y=[];!c.isEmpty();){var b=this._peekTag(c,"end");if(c.isError(b))return b;var w=p.decode(c,"der",h);if(c.isError(w)&&b)break;y.push(w)}return y},u.prototype._decodeStr=function(c,d){if(d==="bitstr"){var p=c.readUInt8();return c.isError(p)?p:{unused:p,data:c.raw()}}else if(d==="bmpstr"){var h=c.raw();if(h.length%2===1)return c.error("Decoding of string type: bmpstr length mismatch");for(var y="",b=0;b<h.length/2;b++)y+=String.fromCharCode(h.readUInt16BE(b*2));return y}else if(d==="numstr"){var w=c.raw().toString("ascii");return this._isNumstr(w)?w:c.error("Decoding of string type: numstr unsupported characters")}else{if(d==="octstr")return c.raw();if(d==="objDesc")return c.raw();if(d==="printstr"){var S=c.raw().toString("ascii");return this._isPrintstr(S)?S:c.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(d)?c.raw().toString():c.error("Decoding of string type: "+d+" unsupported")}},u.prototype._decodeObjid=function(c,d,p){for(var h,y=[],b=0;!c.isEmpty();){var w=c.readUInt8();b<<=7,b|=w&127,(w&128)===0&&(y.push(b),b=0)}w&128&&y.push(b);var S=y[0]/40|0,E=y[0]%40;if(p?h=y:h=[S,E].concat(y.slice(1)),d){var B=d[h.join(" ")];B===void 0&&(B=d[h.join(".")]),B!==void 0&&(h=B)}return h},u.prototype._decodeTime=function(c,d){var p=c.raw().toString();if(d==="gentime")var h=p.slice(0,4)|0,y=p.slice(4,6)|0,b=p.slice(6,8)|0,w=p.slice(8,10)|0,S=p.slice(10,12)|0,E=p.slice(12,14)|0;else if(d==="utctime"){var h=p.slice(0,2)|0,y=p.slice(2,4)|0,b=p.slice(4,6)|0,w=p.slice(6,8)|0,S=p.slice(8,10)|0,E=p.slice(10,12)|0;h<70?h=2e3+h:h=1900+h}else return c.error("Decoding "+d+" time is not supported yet");return Date.UTC(h,y-1,b,w,S,E,0)},u.prototype._decodeNull=function(c){return null},u.prototype._decodeBool=function(c){var d=c.readUInt8();return c.isError(d)?d:d!==0},u.prototype._decodeInt=function(c,d){var p=c.raw(),h=new n(p);return d&&(h=d[h.toString(10)]||h),h},u.prototype._use=function(c,d){return typeof c=="function"&&(c=c(d)),c._getDecoder("der").tree};function a(f,c){var d=f.readUInt8(c);if(f.isError(d))return d;var p=o.tagClass[d>>6],h=(d&32)===0;if((d&31)===31){var y=d;for(d=0;(y&128)===128;){if(y=f.readUInt8(c),f.isError(y))return y;d<<=7,d|=y&127}}else d&=31;var b=o.tag[d];return{cls:p,primitive:h,tag:d,tagStr:b}}function s(f,c,d){var p=f.readUInt8(d);if(f.isError(p))return p;if(!c&&p===128)return null;if((p&128)===0)return p;var h=p&127;if(h>4)return f.error("length octect is too long");p=0;for(var y=0;y<h;y++){p<<=8;var b=f.readUInt8(d);if(f.isError(b))return b;p|=b}return p}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var e=requireInherits_browser(),t=requireBuffer$1().Buffer,r=requireDer$1();function n(o){r.call(this,o),this.enc="pem"}return e(n,r),pem$1=n,n.prototype.decode=function(i,u){for(var a=i.toString().split(/[\r\n]+/g),s=u.label.toUpperCase(),f=/^-----(BEGIN|END) ([^-]+)-----$/,c=-1,d=-1,p=0;p<a.length;p++){var h=a[p].match(f);if(h!==null&&h[2]===s)if(c===-1){if(h[1]!=="BEGIN")break;c=p}else{if(h[1]!=="END")break;d=p;break}}if(c===-1||d===-1)throw new Error("PEM section not found for: "+s);var y=a.slice(c+1,d).join("");y.replace(/[^a-z0-9\+\/=]+/gi,"");var b=new t(y,"base64");return r.prototype.decode.call(this,b,u)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(function(e){var t=e;t.der=requireDer$1(),t.pem=requirePem$1()})(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var e=requireInherits_browser(),t=requireBuffer$1().Buffer,r=requireAsn1$1(),n=r.base,o=r.constants.der;function i(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new u,this.tree._init(f.body)}der_1=i,i.prototype.encode=function(c,d){return this.tree._encode(c,d).join()};function u(f){n.Node.call(this,"der",f)}e(u,n.Node),u.prototype._encodeComposite=function(c,d,p,h){var y=s(c,d,p,this.reporter);if(h.length<128){var S=new t(2);return S[0]=y,S[1]=h.length,this._createEncoderBuffer([S,h])}for(var b=1,w=h.length;w>=256;w>>=8)b++;var S=new t(2+b);S[0]=y,S[1]=128|b;for(var w=1+b,E=h.length;E>0;w--,E>>=8)S[w]=E&255;return this._createEncoderBuffer([S,h])},u.prototype._encodeStr=function(c,d){if(d==="bitstr")return this._createEncoderBuffer([c.unused|0,c.data]);if(d==="bmpstr"){for(var p=new t(c.length*2),h=0;h<c.length;h++)p.writeUInt16BE(c.charCodeAt(h),h*2);return this._createEncoderBuffer(p)}else return d==="numstr"?this._isNumstr(c)?this._createEncoderBuffer(c):this.reporter.error("Encoding of string type: numstr supports only digits and space"):d==="printstr"?this._isPrintstr(c)?this._createEncoderBuffer(c):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(d)?this._createEncoderBuffer(c):d==="objDesc"?this._createEncoderBuffer(c):this.reporter.error("Encoding of string type: "+d+" unsupported")},u.prototype._encodeObjid=function(c,d,p){if(typeof c=="string"){if(!d)return this.reporter.error("string objid given, but no values map found");if(!d.hasOwnProperty(c))return this.reporter.error("objid not found in values map");c=d[c].split(/[\s\.]+/g);for(var h=0;h<c.length;h++)c[h]|=0}else if(Array.isArray(c)){c=c.slice();for(var h=0;h<c.length;h++)c[h]|=0}if(!Array.isArray(c))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(c));if(!p){if(c[1]>=40)return this.reporter.error("Second objid identifier OOB");c.splice(0,2,c[0]*40+c[1])}for(var y=0,h=0;h<c.length;h++){var b=c[h];for(y++;b>=128;b>>=7)y++}for(var w=new t(y),S=w.length-1,h=c.length-1;h>=0;h--){var b=c[h];for(w[S--]=b&127;(b>>=7)>0;)w[S--]=128|b&127}return this._createEncoderBuffer(w)};function a(f){return f<10?"0"+f:f}u.prototype._encodeTime=function(c,d){var p,h=new Date(c);return d==="gentime"?p=[a(h.getFullYear()),a(h.getUTCMonth()+1),a(h.getUTCDate()),a(h.getUTCHours()),a(h.getUTCMinutes()),a(h.getUTCSeconds()),"Z"].join(""):d==="utctime"?p=[a(h.getFullYear()%100),a(h.getUTCMonth()+1),a(h.getUTCDate()),a(h.getUTCHours()),a(h.getUTCMinutes()),a(h.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+d+" time is not supported yet"),this._encodeStr(p,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(c,d){if(typeof c=="string"){if(!d)return this.reporter.error("String int or enum given, but no values map");if(!d.hasOwnProperty(c))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(c));c=d[c]}if(typeof c!="number"&&!t.isBuffer(c)){var p=c.toArray();!c.sign&&p[0]&128&&p.unshift(0),c=new t(p)}if(t.isBuffer(c)){var h=c.length;c.length===0&&h++;var b=new t(h);return c.copy(b),c.length===0&&(b[0]=0),this._createEncoderBuffer(b)}if(c<128)return this._createEncoderBuffer(c);if(c<256)return this._createEncoderBuffer([0,c]);for(var h=1,y=c;y>=256;y>>=8)h++;for(var b=new Array(h),y=b.length-1;y>=0;y--)b[y]=c&255,c>>=8;return b[0]&128&&b.unshift(0),this._createEncoderBuffer(new t(b))},u.prototype._encodeBool=function(c){return this._createEncoderBuffer(c?255:0)},u.prototype._use=function(c,d){return typeof c=="function"&&(c=c(d)),c._getEncoder("der").tree},u.prototype._skipDefault=function(c,d,p){var h=this._baseState,y;if(h.default===null)return!1;var b=c.join();if(h.defaultBuffer===void 0&&(h.defaultBuffer=this._encodeValue(h.default,d,p).join()),b.length!==h.defaultBuffer.length)return!1;for(y=0;y<b.length;y++)if(b[y]!==h.defaultBuffer[y])return!1;return!0};function s(f,c,d,p){var h;if(f==="seqof"?f="seq":f==="setof"&&(f="set"),o.tagByName.hasOwnProperty(f))h=o.tagByName[f];else if(typeof f=="number"&&(f|0)===f)h=f;else return p.error("Unknown tag: "+f);return h>=31?p.error("Multi-octet tag encoding unsupported"):(c||(h|=32),h|=o.tagClassByName[d||"universal"]<<6,h)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var e=requireInherits_browser(),t=requireDer();function r(n){t.call(this,n),this.enc="pem"}return e(r,t),pem=r,r.prototype.encode=function(o,i){for(var u=t.prototype.encode.call(this,o),a=u.toString("base64"),s=["-----BEGIN "+i.label+"-----"],f=0;f<a.length;f+=64)s.push(a.slice(f,f+64));return s.push("-----END "+i.label+"-----"),s.join(`