PageSourceSearch

https://avalanchexchain-liquidity-manager.vercel.app/_next/static/chunks/19.e0af9724d263fcd7.js

js avalanchexchain-liquidity-manager.vercel.app collected 2026-10-03 06:09:31 UTC 172,869 bytes, 11 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19],{70539:function(t,e,r){"use strict";var n=r(92336).Buffer;t.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var o=0;o<t.length;o++){var s=t.charAt(o),f=s.charCodeAt(0);if(255!==e[f])throw TypeError(s+" is ambiguous");e[f]=o}var u=t.length,a=t.charAt(0),l=Math.log(u)/Math.log(256),c=Math.log(256)/Math.log(u);function decodeUnsafe(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,o=0,s=0;t[r]===a;)o++,r++;for(var f=(t.length-r)*l+1>>>0,c=new Uint8Array(f);t[r];){var d=e[t.charCodeAt(r)];if(255===d)return;for(var p=0,y=f-1;(0!==d||p<s)&&-1!==y;y--,p++)d+=u*c[y]>>>0,c[y]=d%256>>>0,d=d/256>>>0;if(0!==d)throw Error("Non-zero carry");s=p,r++}for(var g=f-s;g!==f&&0===c[g];)g++;var b=n.allocUnsafe(o+(f-g));b.fill(0,0,o);for(var m=o;g!==f;)b[m++]=c[g++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,o=0,s=0,f=e.length;s!==f&&0===e[s];)s++,r++;for(var l=(f-s)*c+1>>>0,d=new Uint8Array(l);s!==f;){for(var p=e[s],y=0,g=l-1;(0!==p||y<o)&&-1!==g;g--,y++)p+=256*d[g]>>>0,d[g]=p%u>>>0,p=p/u>>>0;if(0!==p)throw Error("Non-zero carry");o=y,s++}for(var b=l-o;b!==l&&0===d[b];)b++;for(var m=a.repeat(r);b<l;++b)m+=t.charAt(d[b]);return m},decodeUnsafe:decodeUnsafe,decode:function(t){var e=decodeUnsafe(t);if(e)return e;throw Error("Non-base"+u+" character")}}}},87081:function(t,e,r){var n=r(70539);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},32452:function(t,e,r){"use strict";e._O=e.Jq=e.KB=e.u8=e.cv=void 0,e.Ik=e.A9=e.n_=e.gM=void 0;let n=r(80734);function checkUint8Array(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function uint8ArrayToBuffer(t){return checkUint8Array(t),n.Buffer.from(t.buffer,t.byteOffset,t.length)}let Layout=class Layout{constructor(t,e){if(!Number.isInteger(t))throw TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}};function nameWithProperty(t,e){return e.property?t+"["+e.property+"]":t}let ExternalLayout=class ExternalLayout extends Layout{isCount(){throw Error("ExternalLayout is abstract")}};let OffsetLayout=class OffsetLayout extends ExternalLayout{constructor(t,e=0,r){if(!(t instanceof Layout))throw TypeError("layout must be a Layout");if(!Number.isInteger(e))throw TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof UInt||this.layout instanceof UIntBE}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}};let UInt=class UInt extends Layout{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return uint8ArrayToBuffer(t).readUIntLE(e,this.span)}encode(t,e,r=0){return uint8ArrayToBuffer(e).writeUIntLE(t,r,this.span),this.span}};let UIntBE=class UIntBE extends Layout{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return uint8ArrayToBuffer(t).readUIntBE(e,this.span)}encode(t,e,r=0){return uint8ArrayToBuffer(e).writeUIntBE(t,r,this.span),this.span}};function divmodInt64(t){let e=Math.floor(t/4294967296);return{hi32:e,lo32:t-4294967296*e}}
1function roundedInt64(t,e){return 4294967296*t+e}let NearUInt64=class NearUInt64 extends Layout{constructor(t){super(8,t)}decode(t,e=0){let r=uint8ArrayToBuffer(t),n=r.readUInt32LE(e),o=r.readUInt32LE(e+4);return roundedInt64(o,n)}encode(t,e,r=0){let n=divmodInt64(t),o=uint8ArrayToBuffer(e);return o.writeUInt32LE(n.lo32,r),o.writeUInt32LE(n.hi32,r+4),8}};let NearInt64=class NearInt64 extends Layout{constructor(t){super(8,t)}decode(t,e=0){let r=uint8ArrayToBuffer(t),n=r.readUInt32LE(e),o=r.readInt32LE(e+4);return roundedInt64(o,n)}encode(t,e,r=0){let n=divmodInt64(t),o=uint8ArrayToBuffer(e);return o.writeUInt32LE(n.lo32,r),o.writeInt32LE(n.hi32,r+4),8}};let Sequence=class Sequence extends Layout{constructor(t,e,r){if(!(t instanceof Layout))throw TypeError("elementLayout must be a Layout");if(!(e instanceof ExternalLayout&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;e instanceof ExternalLayout||!(0<t.span)||(n=e*t.span),super(n,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof ExternalLayout&&(n=n.decode(t,e)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let o=0;for(;o<n;)r+=this.elementLayout.getSpan(t,e+r),++o}return r}decode(t,e=0){let r=[],n=0,o=this.count;for(o instanceof ExternalLayout&&(o=o.decode(t,e));n<o;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),n+=1;return r}encode(t,e,r=0){let n=this.elementLayout,o=t.reduce((t,o)=>t+n.encode(o,e,r+t),0);return this.count instanceof ExternalLayout&&this.count.encode(t.length,e,r),o}};let Structure=class Structure extends Layout{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof Layout,!0)))throw TypeError("fields must be array of Layout instances");for(let n of("boolean"==typeof e&&void 0===r&&(r=e,e=void 0),t))if(0>n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=t.reduce((t,e)=>t+e.getSpan(),0)}catch(t){}super(n,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let o=n.getSpan(t,e);return e+=o,r+o},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){checkUint8Array(t);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(t,e)),e+=n.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let n=r,o=0,s=0;for(let n of this.fields){let f=n.span;if(s=0<f?f:0,void 0!==n.property){let o=t[n.property];void 0!==o&&(s=n.encode(o,e,r),0>f&&(f=n.getSpan(e,r)))}o=r,r+=f}return o+s-n}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw TypeError("property must be string");let e=0;for(let r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}};let UnionDiscriminator=class UnionDiscriminator{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}};let UnionLayoutDiscriminator=class UnionLayoutDiscriminator extends UnionDiscriminator{constructor(t,e){if(!(t instanceof ExternalLayout&&t.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}};let Union=class Union extends Layout{constructor(t,e,r){let n;if(t instanceof UInt||t instanceof UIntBE)n=new UnionLayoutDiscriminator(new OffsetLayout(t));else if(t instanceof ExternalLayout&&t.isCount())n=new UnionLayoutDiscriminator(t);else if(t instanceof UnionDiscriminator)n=t;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===e&&(e=null),!(null===e||e instanceof Layout))throw TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let o=-1;e&&0<=(o=e.span)&&(t instanceof UInt||t instanceof UIntBE)&&(o+=n.layout.span),super(o,r),this.discriminator=n,this.usesPrefixDiscriminator=t instanceof UInt||t instanceof UIntBE,this.defaultLayout=e,this.registry={};let s=this.defaultGetSourceVariant.bind(this);
1this.getSourceVariant=function(t){return s(t)},this.configGetSourceVariant=function(t){s=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw Error("unable to infer src variant")}decode(t,e=0){let r;let n=this.discriminator,o=n.decode(t,e),s=this.registry[o];if(void 0===s){let s=this.defaultLayout,f=0;this.usesPrefixDiscriminator&&(f=n.layout.span),(r=this.makeDestinationObject())[n.property]=o,r[s.property]=s.decode(t,e+f)}else r=s.decode(t,e);return r}encode(t,e,r=0){let n=this.getSourceVariant(t);if(void 0===n){let n=this.discriminator,o=this.defaultLayout,s=0;return this.usesPrefixDiscriminator&&(s=n.layout.span),n.encode(t[n.property],e,r),s+o.encode(t[o.property],e,r+s)}return n.encode(t,e,r)}addVariant(t,e,r){let n=new VariantLayout(this,t,e,r);return this.registry[t]=n,n}getVariant(t,e=0){let r;return r=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[r]}};let VariantLayout=class VariantLayout extends Layout{constructor(t,e,r,n){if(!(t instanceof Union))throw TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof Layout))throw TypeError("layout must be a Layout");if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof n)throw TypeError("variant must have a String property")}let o=t.span;0>t.span&&0<=(o=r?r.span:0)&&t.usesPrefixDiscriminator&&(o+=t.discriminator.layout.span),super(o,n),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(t,e+r)),r+n}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let o=n;if(this.layout&&(this.layout.encode(t[this.property],e,r+n),o+=this.layout.getSpan(e,r+n),0<=this.union.span&&o>this.union.span))throw Error("encoded variant overruns containing union");return o}fromArray(t){if(this.layout)return this.layout.fromArray(t)}};function fixBitwiseResult(t){return 0>t&&(t+=4294967296),t}let BitStructure=class BitStructure extends Layout{constructor(t,e,r){if(!(t instanceof UInt||t instanceof UIntBE))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4<t.span)throw RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!e,this.fields=[];let n=0;this._packedSetValue=function(t){return n=fixBitwiseResult(t),this},this._packedGetValue=function(){return n}}decode(t,e=0){let r=this.makeDestinationObject(),n=this.word.decode(t,e);for(let e of(this._packedSetValue(n),this.fields))void 0!==e.property&&(r[e.property]=e.decode(t));return r}encode(t,e,r=0){let n=this.word.decode(e,r);for(let e of(this._packedSetValue(n),this.fields))if(void 0!==e.property){let r=t[e.property];void 0!==r&&e.encode(r)}return this.word.encode(this._packedGetValue(),e,r)}addField(t,e){let r=new BitField(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new Boolean(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}};let BitField=class BitField{constructor(t,e,r){if(!(t instanceof BitStructure))throw TypeError("container must be a BitStructure");
1if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");let n=8*t.span,o=t.fields.reduce((t,e)=>t+e.bits,0);if(e+o>n)throw Error("bits too long for span remainder ("+(n-o)+" of "+n+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=4294967295),this.start=o,this.container.msb&&(this.start=n-o-e),this.wordMask=fixBitwiseResult(this.valueMask<<this.start),this.property=r}decode(t,e){let r=this.container._packedGetValue(),n=fixBitwiseResult(r&this.wordMask),o=n>>>this.start;return o}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==fixBitwiseResult(t&this.valueMask))throw TypeError(nameWithProperty("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=fixBitwiseResult(t<<this.start);this.container._packedSetValue(fixBitwiseResult(e&~this.wordMask)|r)}};let Boolean=class Boolean extends BitField{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t=+t),super.encode(t)}};let Blob=class Blob extends Layout{constructor(t,e){if(!(t instanceof ExternalLayout&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof ExternalLayout||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),uint8ArrayToBuffer(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof ExternalLayout&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw TypeError(nameWithProperty("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw RangeError("encoding overruns Uint8Array");let o=uint8ArrayToBuffer(t);return uint8ArrayToBuffer(e).write(o.toString("hex"),r,n,"hex"),this.length instanceof ExternalLayout&&this.length.encode(n,e,r),n}};e.cv=(t,e,r)=>new OffsetLayout(t,e,r),e.u8=t=>new UInt(1,t),e.KB=t=>new UInt(2,t),e.Jq=t=>new UInt(4,t),e._O=t=>new NearUInt64(t),e.gM=t=>new NearInt64(t),e.n_=(t,e,r)=>new Structure(t,e,r),e.A9=(t,e,r)=>new Sequence(t,e,r),e.Ik=(t,e)=>new Blob(t,e)},80734:function(t,e,r){"use strict";/*!
2 * The buffer module from node.js, for the browser.
3 *
4 * @author   Feross Aboukhadijeh <https://feross.org>
5 * @license  MIT
6 */let n=r(34699),o=r(19087),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function createBuffer(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,r)}function from(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!Buffer.isEncoding(e))throw TypeError("Unknown encoding: "+e);let r=0|byteLength(t,e),n=createBuffer(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(isInstance(t,Uint8Array)){let e=new Uint8Array(t);return fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength)}return fromArrayLike(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(isInstance(t,SharedArrayBuffer)||t&&isInstance(t.buffer,SharedArrayBuffer)))return fromArrayBuffer(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);let o=function(t){var e;if(Buffer.isBuffer(t)){let e=0|checked(t.length),r=createBuffer(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?createBuffer(0):fromArrayLike(t):"Buffer"===t.type&&Array.isArray(t.data)?fromArrayLike(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function assertSize(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');
6if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function allocUnsafe(t){return assertSize(t),createBuffer(t<0?0:0|checked(t))}function fromArrayLike(t){let e=t.length<0?0:0|checked(t.length),r=createBuffer(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function fromArrayBuffer(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Buffer.prototype),n}function checked(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function byteLength(t,e){if(Buffer.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||isInstance(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(t).length;default:if(o)return n?-1:utf8ToBytes(t).length;e=(""+e).toLowerCase(),o=!0}}function slowToString(t,e,r){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=a[t[n]];return o}(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":var s,f;return s=e,f=r,0===s&&f===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(s,f));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}(this,e,r);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function swap(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function bidirectionalIndexOf(t,e,r,n,o){var s;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return -1;r=t.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:arrayIndexOf(t,e,r,n,o);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):arrayIndexOf(t,[e],r,n,o);throw TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,r,n,o){let s,f=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;f=2,u/=2,a/=2,r/=2}function read(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(o){let n=-1;for(s=r;s<u;s++)if(read(t,s)===read(e,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===a)return n*f}else -1!==n&&(s-=s-n),n=-1}else for(r+a>u&&(r=u-a),s=r;s>=0;s--){let r=!0;for(let n=0;n<a;n++)if(read(t,s+n)!==read(e,n)){r=!1;break}if(r)return s}return -1}function utf8Slice(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let e=t[o],s=null,f=e>239?4:e>223?3:e>191?2:1;if(o+f<=r){let r,n,u,a;switch(f){case 1:e<128&&(s=e);break;case 2:(192&(r=t[o+1]))==128&&(a=(31&e)<<6|63&r)>127&&(s=a);break;case 3:r=t[o+1],n=t[o+2],(192&r)==128&&(192&n)==128&&(a=(15&e)<<12|(63&r)<<6|63&n)>2047&&(a<55296||a>57343)&&(s=a);break;case 4:r=t[o+1],n=t[o+2],u=t[o+3],(192&r)==128&&(192&n)==128&&(192&u)==128&&(a=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&u)>65535&&a<1114112&&(s=a)}}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){let e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function checkOffset(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}
vendor: 9,522 bytes, line 6
6function checkInt(t,e,r,n,o,s){if(!Buffer.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function wrtBigUInt64LE(t,e,r,n,o){checkIntBI(e,n,o,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function wrtBigUInt64BE(t,e,r,n,o){checkIntBI(e,n,o,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function checkIEEE754(t,e,r,n,o,s){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function writeFloat(t,e,r,n,s){return e=+e,r>>>=0,s||checkIEEE754(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function writeDouble(t,e,r,n,s){return e=+e,r>>>=0,s||checkIEEE754(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}e.Buffer=Buffer,e.SlowBuffer=function(t){return+t!=t&&(t=0),Buffer.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=2147483647,Buffer.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(t,e,r){return from(t,e,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(t,e,r){return(assertSize(t),t<=0)?createBuffer(t):void 0!==e?"string"==typeof r?createBuffer(t).fill(e,r):createBuffer(t).fill(e):createBuffer(t)},Buffer.allocUnsafe=function(t){return allocUnsafe(t)},Buffer.allocUnsafeSlow=function(t){return allocUnsafe(t)},Buffer.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==Buffer.prototype},Buffer.compare=function(t,e){if(isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,s=Math.min(r,n);o<s;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(t){switch(String(t).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}},Buffer.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=Buffer.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let e=t[r];if(isInstance(e,Uint8Array))o+e.length>n.length?(Buffer.isBuffer(e)||(e=Buffer.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else if(Buffer.isBuffer(e))e.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=e.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)swap(this,e,e+1);return this},Buffer.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)swap(this,e,e+3),swap(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)swap(this,e,e+7),swap(this,e+1,e+6),swap(this,e+2,e+5),swap(this,e+3,e+4);return this},Buffer.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(Buffer.prototype[s]=Buffer.prototype.inspect),Buffer.prototype.compare=function(t,e,r,n,o){if(isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let s=o-n,f=r-e,u=Math.min(s,f),a=this.slice(n,o),l=t.slice(e,r);for(let t=0;t<u;++t)if(a[t]!==l[t]){s=a[t],f=l[t];break}return s<f?-1:f<s?1:0},Buffer.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},Buffer.prototype.indexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!1)},Buffer.prototype.write=function(t,e,r,n){var o,s,f,u,a,l,c,d;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let y=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let o;r=Number(r)||0;let s=t.length-r;n?(n=Number(n))>s&&(n=s):n=s;let f=e.length;for(n>f/2&&(n=f/2),o=0;o<n;++o){let n=parseInt(e.substr(2*o,2),16);if(n!=n)break;t[r+o]=n}return o}(this,t,e,r);case"utf8":case"utf-8":return o=e,s=r,blitBuffer(utf8ToBytes(t,this.length-o),this,o,s);case"ascii":case"latin1":case"binary":return f=e,u=r,blitBuffer(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,f,u);case"base64":return a=e,l=r,blitBuffer(base64ToBytes(t),this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,d=r,blitBuffer(function(t,e){let r,n;let o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o.push(r%256),o.push(n);return o}(t,this.length-c),this,c,d);default:if(y)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),y=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,Buffer.prototype),n},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=this[t],o=1,s=0;for(;++s<e&&(o*=256);)n+=this[t+s]*o;return n},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(t,e){return t>>>=0,e||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+16777216*this[++t],o=this[++t]+256*this[++t]+65536*this[++t]+16777216*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),Buffer.prototype.readBigUInt64BE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=16777216*e+65536*this[++t]+256*this[++t]+this[++t],o=16777216*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),Buffer.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=this[t],o=1,s=0;for(;
vendor: 6,228 bytes, line 6
6++s<e&&(o*=256);)n+=this[t+s]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=e,o=1,s=this[t+--n];for(;n>0&&(o*=256);)s+=this[t+--n]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*e)),s},Buffer.prototype.readInt8=function(t,e){return(t>>>=0,e||checkOffset(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},Buffer.prototype.readInt16LE=function(t,e){t>>>=0,e||checkOffset(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){t>>>=0,e||checkOffset(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+16777216*this[++t])}),Buffer.prototype.readBigInt64BE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(16777216*this[++t]+65536*this[++t]+256*this[++t]+r)}),Buffer.prototype.readFloatLE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),o.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),o.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return t>>>=0,e||checkOffset(t,8,this.length),o.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return t>>>=0,e||checkOffset(t,8,this.length),o.read(this,t,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;checkInt(this,t,e,r,n,0)}let o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;checkInt(this,t,e,r,n,0)}let o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,1,255,0),this[e]=255&t,e+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64LE(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64BE(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);checkInt(this,t,e,r,n-1,-n)}let o=0,s=1,f=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===f&&0!==this[e+o-1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);checkInt(this,t,e,r,n-1,-n)}let o=r-1,s=1,f=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===f&&0!==this[e+o+1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64LE(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64BE(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Buffer.prototype.writeFloatLE=function(t,e,r){return writeFloat(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return writeFloat(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return writeDouble(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return writeDouble(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(!Buffer.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o}
6,Buffer.prototype.fill=function(t,e,r,n){let o;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{let s=Buffer.isBuffer(t)?t:Buffer.from(t,n),f=s.length;if(0===f)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%f]}return this};let f={};function E(t,e,r){f[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function addNumericalSeparator(t){let e="",r=t.length,n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function checkIntBI(t,e,r,n,o,s){if(t>r||t<e){let n;let o="bigint"==typeof e?"n":"";throw n=s>3?0===e||e===BigInt(0)?`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:`>= ${e}${o} and <= ${r}${o}`,new f.ERR_OUT_OF_RANGE("value",n,t)}validateNumber(o,"offset"),(void 0===n[o]||void 0===n[o+s])&&boundsError(o,n.length-(s+1))}function validateNumber(t,e){if("number"!=typeof t)throw new f.ERR_INVALID_ARG_TYPE(e,"number",t)}function boundsError(t,e,r){if(Math.floor(t)!==t)throw validateNumber(t,r),new f.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new f.ERR_BUFFER_OUT_OF_BOUNDS;throw new f.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}E("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),E("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?o=addNumericalSeparator(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=addNumericalSeparator(o)),o+="n"),n+=` It must be ${e}. Received ${o}`},RangeError);let u=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(t,e){let r;e=e||1/0;let n=t.length,o=null,s=[];for(let f=0;f<n;++f){if((r=t.charCodeAt(f))>55295&&r<57344){if(!o){if(r>56319||f+1===n){(e-=3)>-1&&s.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&s.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function base64ToBytes(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(u,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function blitBuffer(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function isInstance(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let a=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function defineBigIntMethod(t){return"undefined"==typeof BigInt?BufferBigIntNotDefined:t}function BufferBigIntNotDefined(){throw Error("BigInt not supported")}},41880:function(t,e,r){"use strict";var n=r(92336).Buffer;t.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var o=0;o<t.length;o++){var s=t.charAt(o),f=s.charCodeAt(0);if(255!==e[f])throw TypeError(s+" is ambiguous");e[f]=o}var u=t.length,a=t.charAt(0),l=Math.log(u)/Math.log(256),c=Math.log(256)/Math.log(u);
6function decodeUnsafe(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,o=0,s=0;t[r]===a;)o++,r++;for(var f=(t.length-r)*l+1>>>0,c=new Uint8Array(f);t[r];){var d=e[t.charCodeAt(r)];if(255===d)return;for(var p=0,y=f-1;(0!==d||p<s)&&-1!==y;y--,p++)d+=u*c[y]>>>0,c[y]=d%256>>>0,d=d/256>>>0;if(0!==d)throw Error("Non-zero carry");s=p,r++}for(var g=f-s;g!==f&&0===c[g];)g++;var b=n.allocUnsafe(o+(f-g));b.fill(0,0,o);for(var m=o;g!==f;)b[m++]=c[g++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,o=0,s=0,f=e.length;s!==f&&0===e[s];)s++,r++;for(var l=(f-s)*c+1>>>0,d=new Uint8Array(l);s!==f;){for(var p=e[s],y=0,g=l-1;(0!==p||y<o)&&-1!==g;g--,y++)p+=256*d[g]>>>0,d[g]=p%u>>>0,p=p/u>>>0;if(0!==p)throw Error("Non-zero carry");o=y,s++}for(var b=l-o;b!==l&&0===d[b];)b++;for(var m=a.repeat(r);b<l;++b)m+=t.charAt(d[b]);return m},decodeUnsafe:decodeUnsafe,decode:function(t){var e=decodeUnsafe(t);if(e)return e;throw Error("Non-base"+u+" character")}}}},54462:function(t,e,r){var n=r(41880);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},43715:function(t,e,r){"use strict";/*!
7 * The buffer module from node.js, for the browser.
8 *
9 * @author   Feross Aboukhadijeh <https://feross.org>
10 * @license  MIT
11 */let n=r(34699),o=r(19087),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function createBuffer(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,r)}function from(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!Buffer.isEncoding(e))throw TypeError("Unknown encoding: "+e);let r=0|byteLength(t,e),n=createBuffer(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(isInstance(t,Uint8Array)){let e=new Uint8Array(t);return fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength)}return fromArrayLike(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(isInstance(t,SharedArrayBuffer)||t&&isInstance(t.buffer,SharedArrayBuffer)))return fromArrayBuffer(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);let o=function(t){var e;if(Buffer.isBuffer(t)){let e=0|checked(t.length),r=createBuffer(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?createBuffer(0):fromArrayLike(t):"Buffer"===t.type&&Array.isArray(t.data)?fromArrayLike(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function assertSize(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function allocUnsafe(t){return assertSize(t),createBuffer(t<0?0:0|checked(t))}function fromArrayLike(t){let e=t.length<0?0:0|checked(t.length),r=createBuffer(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function fromArrayBuffer(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Buffer.prototype),n}function checked(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function byteLength(t,e){if(Buffer.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||isInstance(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(t).length;default:if(o)return n?-1:utf8ToBytes(t).length;e=(""+e).toLowerCase(),o=!0}}function slowToString(t,e,r){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=a[t[n]];return o}(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":var s,f;return s=e,f=r,0===s&&f===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(s,f));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}(this,e,r);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function swap(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function bidirectionalIndexOf(t,e,r,n,o){var s;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return -1;r=t.length-1}
vendor: 6,300 bytes, line 11
11else if(r<0){if(!o)return -1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:arrayIndexOf(t,e,r,n,o);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):arrayIndexOf(t,[e],r,n,o);throw TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,r,n,o){let s,f=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;f=2,u/=2,a/=2,r/=2}function read(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(o){let n=-1;for(s=r;s<u;s++)if(read(t,s)===read(e,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===a)return n*f}else -1!==n&&(s-=s-n),n=-1}else for(r+a>u&&(r=u-a),s=r;s>=0;s--){let r=!0;for(let n=0;n<a;n++)if(read(t,s+n)!==read(e,n)){r=!1;break}if(r)return s}return -1}function utf8Slice(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let e=t[o],s=null,f=e>239?4:e>223?3:e>191?2:1;if(o+f<=r){let r,n,u,a;switch(f){case 1:e<128&&(s=e);break;case 2:(192&(r=t[o+1]))==128&&(a=(31&e)<<6|63&r)>127&&(s=a);break;case 3:r=t[o+1],n=t[o+2],(192&r)==128&&(192&n)==128&&(a=(15&e)<<12|(63&r)<<6|63&n)>2047&&(a<55296||a>57343)&&(s=a);break;case 4:r=t[o+1],n=t[o+2],u=t[o+3],(192&r)==128&&(192&n)==128&&(192&u)==128&&(a=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&u)>65535&&a<1114112&&(s=a)}}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){let e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function checkOffset(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function checkInt(t,e,r,n,o,s){if(!Buffer.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function wrtBigUInt64LE(t,e,r,n,o){checkIntBI(e,n,o,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function wrtBigUInt64BE(t,e,r,n,o){checkIntBI(e,n,o,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function checkIEEE754(t,e,r,n,o,s){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function writeFloat(t,e,r,n,s){return e=+e,r>>>=0,s||checkIEEE754(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function writeDouble(t,e,r,n,s){return e=+e,r>>>=0,s||checkIEEE754(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}e.lW=Buffer,e.h2=50,Buffer.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(t,e,r){return from(t,e,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(t,e,r){return(assertSize(t),t<=0)?createBuffer(t):void 0!==e?"string"==typeof r?createBuffer(t).fill(e,r):createBuffer(t).fill(e):createBuffer(t)},Buffer.allocUnsafe=function(t){return allocUnsafe(t)},Buffer.allocUnsafeSlow=function(t){return allocUnsafe(t)},Buffer.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==Buffer.prototype},Buffer.compare=function(t,e){if(isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,s=Math.min(r,n);o<s;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(t){switch(String(t).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}},Buffer.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=Buffer.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let e=t[r];if(isInstance(e,Uint8Array))o+e.length>n.length?(Buffer.isBuffer(e)||(e=Buffer.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else if(Buffer.isBuffer(e))e.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=e.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)swap(this,e,e+1);return this},Buffer.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)swap(this,e,e+3),swap(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)swap(this,e,e+7),swap(this,e+1,e+6),swap(this,e+2,e+5),swap(this,e+3,e+4);return this},Buffer.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)}
vendor: 4,974 bytes, line 11
11,Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){let t="",r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(Buffer.prototype[s]=Buffer.prototype.inspect),Buffer.prototype.compare=function(t,e,r,n,o){if(isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let s=o-n,f=r-e,u=Math.min(s,f),a=this.slice(n,o),l=t.slice(e,r);for(let t=0;t<u;++t)if(a[t]!==l[t]){s=a[t],f=l[t];break}return s<f?-1:f<s?1:0},Buffer.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},Buffer.prototype.indexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!1)},Buffer.prototype.write=function(t,e,r,n){var o,s,f,u,a,l,c,d;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-e;if((void 0===r||r>p)&&(r=p),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let y=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let o;r=Number(r)||0;let s=t.length-r;n?(n=Number(n))>s&&(n=s):n=s;let f=e.length;for(n>f/2&&(n=f/2),o=0;o<n;++o){let n=parseInt(e.substr(2*o,2),16);if(n!=n)break;t[r+o]=n}return o}(this,t,e,r);case"utf8":case"utf-8":return o=e,s=r,blitBuffer(utf8ToBytes(t,this.length-o),this,o,s);case"ascii":case"latin1":case"binary":return f=e,u=r,blitBuffer(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,f,u);case"base64":return a=e,l=r,blitBuffer(base64ToBytes(t),this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,d=r,blitBuffer(function(t,e){let r,n;let o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o.push(r%256),o.push(n);return o}(t,this.length-c),this,c,d);default:if(y)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),y=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,Buffer.prototype),n},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=this[t],o=1,s=0;for(;++s<e&&(o*=256);)n+=this[t+s]*o;return n},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(t,e){return t>>>=0,e||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+16777216*this[++t],o=this[++t]+256*this[++t]+65536*this[++t]+16777216*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),Buffer.prototype.readBigUInt64BE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=16777216*e+65536*this[++t]+256*this[++t]+this[++t],o=16777216*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),Buffer.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=this[t],o=1,s=0;for(;
vendor: 6,228 bytes, line 11
11++s<e&&(o*=256);)n+=this[t+s]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||checkOffset(t,e,this.length);let n=e,o=1,s=this[t+--n];for(;n>0&&(o*=256);)s+=this[t+--n]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*e)),s},Buffer.prototype.readInt8=function(t,e){return(t>>>=0,e||checkOffset(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},Buffer.prototype.readInt16LE=function(t,e){t>>>=0,e||checkOffset(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){t>>>=0,e||checkOffset(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+16777216*this[++t])}),Buffer.prototype.readBigInt64BE=defineBigIntMethod(function(t){validateNumber(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&boundsError(t,this.length-8);let n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(16777216*this[++t]+65536*this[++t]+256*this[++t]+r)}),Buffer.prototype.readFloatLE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),o.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return t>>>=0,e||checkOffset(t,4,this.length),o.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return t>>>=0,e||checkOffset(t,8,this.length),o.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return t>>>=0,e||checkOffset(t,8,this.length),o.read(this,t,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;checkInt(this,t,e,r,n,0)}let o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;checkInt(this,t,e,r,n,0)}let o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,1,255,0),this[e]=255&t,e+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64LE(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64BE(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);checkInt(this,t,e,r,n-1,-n)}let o=0,s=1,f=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===f&&0!==this[e+o-1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);checkInt(this,t,e,r,n-1,-n)}let o=r-1,s=1,f=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===f&&0!==this[e+o+1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64LE(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function(t,e=0){return wrtBigUInt64BE(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Buffer.prototype.writeFloatLE=function(t,e,r){return writeFloat(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return writeFloat(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return writeDouble(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return writeDouble(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(!Buffer.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o}
11,Buffer.prototype.fill=function(t,e,r,n){let o;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{let s=Buffer.isBuffer(t)?t:Buffer.from(t,n),f=s.length;if(0===f)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%f]}return this};let f={};function E(t,e,r){f[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function addNumericalSeparator(t){let e="",r=t.length,n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function checkIntBI(t,e,r,n,o,s){if(t>r||t<e){let n;let o="bigint"==typeof e?"n":"";throw n=s>3?0===e||e===BigInt(0)?`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:`>= ${e}${o} and <= ${r}${o}`,new f.ERR_OUT_OF_RANGE("value",n,t)}validateNumber(o,"offset"),(void 0===n[o]||void 0===n[o+s])&&boundsError(o,n.length-(s+1))}function validateNumber(t,e){if("number"!=typeof t)throw new f.ERR_INVALID_ARG_TYPE(e,"number",t)}function boundsError(t,e,r){if(Math.floor(t)!==t)throw validateNumber(t,r),new f.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new f.ERR_BUFFER_OUT_OF_BOUNDS;throw new f.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}E("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),E("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?o=addNumericalSeparator(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=addNumericalSeparator(o)),o+="n"),n+=` It must be ${e}. Received ${o}`},RangeError);let u=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(t,e){let r;e=e||1/0;let n=t.length,o=null,s=[];for(let f=0;f<n;++f){if((r=t.charCodeAt(f))>55295&&r<57344){if(!o){if(r>56319||f+1===n){(e-=3)>-1&&s.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&s.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function base64ToBytes(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(u,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function blitBuffer(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function isInstance(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let a=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function defineBigIntMethod(t){return"undefined"==typeof BigInt?BufferBigIntNotDefined:t}function BufferBigIntNotDefined(){throw Error("BigInt not supported")}},40265:function(t,e,r){"use strict";var n=r(67133).Buffer;e.oU=function(t){{let e=n.from(t);e.reverse();let r=e.toString("hex");return 0===r.length?BigInt(0):BigInt(`0x${r}`)}},e.k$=function(t,e){{let r=t.toString(16),o=n.from(r.padStart(2*e,"0").slice(0,2*e),"hex");return o.reverse(),o}}},84453:function(t,e,r){"use strict";var n=r(67133).Buffer,o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),f=this&&this.__decorate||function(t,e,r,n){var o,s=arguments.length,f=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(f=(s<3?o(f):s>3?o(e,r,f):o(e,r))||f);return s>3&&f&&Object.defineProperty(e,r,f),f},u=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&o(e,t,r);return s(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};
11Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;let l=a(r(56662)),c=a(r(76031)),d=u(r(71332)),p="function"!=typeof TextDecoder?d.TextDecoder:TextDecoder,y=new p("utf-8",{fatal:!0});e.baseEncode=function(t){return"string"==typeof t&&(t=n.from(t,"utf8")),c.default.encode(n.from(t))},e.baseDecode=function(t){return n.from(c.default.decode(t))};let BorshError=class BorshError extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};e.BorshError=BorshError;let BinaryWriter=class BinaryWriter{constructor(){this.buf=n.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(1024)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(n.from(new l.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(n.from(new l.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(n.from(new l.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(n.from(new l.default(t).toArray("le",64)))}writeBuffer(t){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),t,n.alloc(1024)]),this.length+=t.length}writeString(t){this.maybeResize();let e=n.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(n.from(t))}writeArray(t,e){for(let r of(this.maybeResize(),this.writeU32(t.length),t))this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}};function handlingRangeError(t,e,r){let n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError){let e=t.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e)>=0)throw new BorshError("Reached the end of buffer when deserializing")}throw t}}}e.BinaryWriter=BinaryWriter;let BinaryReader=class BinaryReader{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new l.default(t,"le")}readU128(){let t=this.readBuffer(16);return new l.default(t,"le")}readU256(){let t=this.readBuffer(32);return new l.default(t,"le")}readU512(){let t=this.readBuffer(64);return new l.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new BorshError(`Expected buffer length ${t} isn't within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return y.decode(e)}catch(t){throw new BorshError(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=[];for(let n=0;n<e;++n)r.push(t());return r}};function capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)}function serializeField(t,e,r,n,o){try{if("string"==typeof n)o[`write${capitalizeFirstLetter(n)}`](r);else if(n instanceof Array){if("number"==typeof n[0]){if(r.length!==n[0])throw new BorshError(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);o.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new BorshError(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let e=0;e<n[1];e++)serializeField(t,null,r[e],n[0],o)}else o.writeArray(r,r=>{serializeField(t,e,r,n[0],o)})}else if(void 0!==n.kind)switch(n.kind){case"option":null==r?o.writeU8(0):(o.writeU8(1),serializeField(t,e,r,n.type,o));break;case"map":o.writeU32(r.size),r.forEach((r,s)=>{serializeField(t,e,s,n.key,o),serializeField(t,e,r,n.value,o)});break;default:throw new BorshError(`FieldType ${n} unrecognized`)}else serializeStruct(t,r,o)}catch(t){throw t instanceof BorshError&&t.addToFieldPath(e),t}}function serializeStruct(t,e,r){if("function"==typeof e.borshSerialize){e.borshSerialize(r);return}let n=t.get(e.constructor);if(!n)throw new BorshError(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,o])=>{serializeField(t,n,e[n],o,r)});else if("enum"===n.kind){let o=e[n.field];for(let s=0;s<n.values.length;++s){let[f,u]=n.values[s];if(f===o){r.writeU8(s),serializeField(t,f,e[f],u,r);break}}}else throw new BorshError(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function deserializeField(t,e,r,n){try{if("string"==typeof r)return n[`read${capitalizeFirstLetter(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"!=typeof r[1])return n.readArray(()=>
11deserializeField(t,e,r[0],n));{let e=[];for(let o=0;o<r[1];o++)e.push(deserializeField(t,null,r[0],n));return e}}if("option"===r.kind){let o=n.readU8();if(o)return deserializeField(t,e,r.type,n);return}if("map"===r.kind){let o=new Map,s=n.readU32();for(let f=0;f<s;f++){let s=deserializeField(t,e,r.key,n),f=deserializeField(t,e,r.value,n);o.set(s,f)}return o}return deserializeStruct(t,r,n)}catch(t){throw t instanceof BorshError&&t.addToFieldPath(e),t}}function deserializeStruct(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let n=t.get(e);if(!n)throw new BorshError(`Class ${e.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[o,s]of t.get(e).fields)n[o]=deserializeField(t,o,s,r);return new e(n)}if("enum"===n.kind){let o=r.readU8();if(o>=n.values.length)throw new BorshError(`Enum index: ${o} is out of range`);let[s,f]=n.values[o],u=deserializeField(t,s,f,r);return new e({[s]:u})}throw new BorshError(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}f([handlingRangeError],BinaryReader.prototype,"readU8",null),f([handlingRangeError],BinaryReader.prototype,"readU16",null),f([handlingRangeError],BinaryReader.prototype,"readU32",null),f([handlingRangeError],BinaryReader.prototype,"readU64",null),f([handlingRangeError],BinaryReader.prototype,"readU128",null),f([handlingRangeError],BinaryReader.prototype,"readU256",null),f([handlingRangeError],BinaryReader.prototype,"readU512",null),f([handlingRangeError],BinaryReader.prototype,"readString",null),f([handlingRangeError],BinaryReader.prototype,"readFixedArray",null),f([handlingRangeError],BinaryReader.prototype,"readArray",null),e.BinaryReader=BinaryReader,e.serialize=function(t,e,r=BinaryWriter){let n=new r;return serializeStruct(t,e,n),n.toArray()},e.deserialize=function(t,e,r,n=BinaryReader){let o=new n(r),s=deserializeStruct(t,e,o);if(o.offset<r.length)throw new BorshError(`Unexpected ${r.length-o.offset} bytes after deserialized data`);return s},e.deserializeUnchecked=function(t,e,r,n=BinaryReader){let o=new n(r);return deserializeStruct(t,e,o)}},62222:function(t,e,r){"use strict";var n=r(92336).Buffer;t.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var o=0;o<t.length;o++){var s=t.charAt(o),f=s.charCodeAt(0);if(255!==e[f])throw TypeError(s+" is ambiguous");e[f]=o}var u=t.length,a=t.charAt(0),l=Math.log(u)/Math.log(256),c=Math.log(256)/Math.log(u);function decodeUnsafe(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,o=0,s=0;t[r]===a;)o++,r++;for(var f=(t.length-r)*l+1>>>0,c=new Uint8Array(f);t[r];){var d=e[t.charCodeAt(r)];if(255===d)return;for(var p=0,y=f-1;(0!==d||p<s)&&-1!==y;y--,p++)d+=u*c[y]>>>0,c[y]=d%256>>>0,d=d/256>>>0;if(0!==d)throw Error("Non-zero carry");s=p,r++}for(var g=f-s;g!==f&&0===c[g];)g++;var b=n.allocUnsafe(o+(f-g));b.fill(0,0,o);for(var m=o;g!==f;)b[m++]=c[g++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,o=0,s=0,f=e.length;s!==f&&0===e[s];)s++,r++;for(var l=(f-s)*c+1>>>0,d=new Uint8Array(l);s!==f;){for(var p=e[s],y=0,g=l-1;(0!==p||y<o)&&-1!==g;g--,y++)p+=256*d[g]>>>0,d[g]=p%u>>>0,p=p/u>>>0;if(0!==p)throw Error("Non-zero carry");o=y,s++}for(var b=l-o;b!==l&&0===d[b];)b++;for(var m=a.repeat(r);b<l;++b)m+=t.charAt(d[b]);return m},decodeUnsafe:decodeUnsafe,decode:function(t){var e=decodeUnsafe(t);if(e)return e;throw Error("Non-base"+u+" character")}}}},76031:function(t,e,r){var n=r(62222);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},152:function(t,e,r){"use strict";let n=r(37219).v4,o=r(89559),ClientBrowser=function(t,e){if(!(this instanceof ClientBrowser))return new ClientBrowser(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return n()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};t.exports=ClientBrowser,ClientBrowser.prototype.request=function(t,e,r,n){let s;let f=this,u=null,a=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&a)throw TypeError("JSON-RPC 1.0 does not support batching");let l=!a&&t&&"object"==typeof t&&"function"==typeof e;if(a||l)n=e,u=t;else{"function"==typeof r&&(n=r,r=void 0);let s="function"==typeof n;try{u=o(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(s)return n(t);throw t}if(!s)return u}try{s=JSON.stringify(u,this.options.replacer)}catch(t){return n(t)}return this.callServer(s,function(t,e){f._parseResponse(t,e,n)}),u},ClientBrowser.prototype._parseResponse=function(t,e,r){let n;if(t){r(t);return}if(!e)return r();try{n=JSON.parse(e,this.options.reviver)}catch(t){return r(t)}if(3===r.length){if(!Array.isArray(n))return r(null,n.error,n.result);{let isError=function(t){return void 0!==t.error};return r(null,n.filter(isError),n.filter(function(t){return!isError(t)}))}}r(null,n)}},89559:function(t,e,r){"use strict";let n=r(37219).v4;t.exports=function(t,e,r,o){if("string"!=typeof t)throw TypeError(t+" must be a string");o=o||{};let s="number"==typeof o.version?o.version:2;if(1!==s&&2!==s)throw TypeError(s+" must be 1 or 2");let f={method:t};if(2===s&&(f.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");f.params=e}if(void 0===r){let t="function"==typeof o.generator?o.generator:function(){return n()};f.id=t(f,o)}else 2===s&&null===r?o.notificationIdNull&&(f.id=null):f.id=r;return f}},17449:function(t,e,r){"use strict";var n=r(67133).Buffer,o=r(26314);e.Z=void 0;var s=o(r(74001)),f=o(r(64662)),u=o(r(61565)),a=o(r(86358)),l=o(r(1127)),c=o(r(35684)),d=o(r(60746)),p=o(r(83654)),y=r(16814),g=r(19496),__rest=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)0>e.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},b=function(t){(0,c.default)(CommonClient,t);var e,r,o,y,b,m=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,r=(0,p.default)(CommonClient);if(e){var n=(0,p.default)(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return(0,d.default)(this,t)});function CommonClient(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;(0,a.default)(this,CommonClient);var f=n.autoconnect,u=n.reconnect,l=n.reconnect_interval,c=n.max_reconnects,d=__rest(n,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(e=m.call(this)).webSocketFactory=t,e.queue={},e.rpc_id=0,e.address=r,e.autoconnect=void 0===f||f,e.ready=!1,e.reconnect=void 0===u||u,e.reconnect_timer_id=void 0,e.reconnect_interval=void 0===l?1e3:l,e.max_reconnects=void 0===c?5:c,e.rest_options=d,e.current_reconnects=0,e.generate_request_id=o||function(){return++e.rpc_id},s?e.dataPack=s:e.dataPack=new g.DefaultDataPack,e.autoconnect&&e._connect(e.address,Object.assign({autoconnect:e.autoconnect,reconnect:e.reconnect,reconnect_interval:e.reconnect_interval,max_reconnects:e.max_reconnects},e.rest_options)),e}
11return(0,l.default)(CommonClient,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(t,e,r,n){var o=this;return n||"object"!==(0,u.default)(r)||(n=r,r=null),new Promise(function(s,f){if(!o.ready)return f(Error("socket not ready"));var u=o.generate_request_id(t,e);o.socket.send(o.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:u}),n,function(t){if(t)return f(t);o.queue[u]={promise:[s,f]},r&&(o.queue[u].timeout=setTimeout(function(){delete o.queue[u],f(Error("reply timeout"))},r))})})}},{key:"login",value:(r=(0,f.default)(s.default.mark(function _callee(t){var e;return s.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.call("rpc.login",t);case 2:if(e=r.sent){r.next=5;break}throw Error("authentication failed");case 5:return r.abrupt("return",e);case 6:case"end":return r.stop()}},_callee,this)})),function(t){return r.apply(this,arguments)})},{key:"listMethods",value:(o=(0,f.default)(s.default.mark(function _callee2(){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.call("__listMethods");case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},_callee2,this)})),function(){return o.apply(this,arguments)})},{key:"notify",value:function(t,e){var r=this;return new Promise(function(n,o){if(!r.ready)return o(Error("socket not ready"));r.socket.send(r.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),function(t){if(t)return o(t);n()})})}},{key:"subscribe",value:(y=(0,f.default)(s.default.mark(function _callee3(t){var e;return s.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return"string"==typeof t&&(t=[t]),r.next=3,this.call("rpc.on",t);case 3:if(e=r.sent,!("string"==typeof t&&"ok"!==e[t])){r.next=6;break}throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);case 6:return r.abrupt("return",e);case 7:case"end":return r.stop()}},_callee3,this)})),function(t){return y.apply(this,arguments)})},{key:"unsubscribe",value:(b=(0,f.default)(s.default.mark(function _callee4(t){var e;return s.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return"string"==typeof t&&(t=[t]),r.next=3,this.call("rpc.off",t);case 3:if(e=r.sent,!("string"==typeof t&&"ok"!==e[t])){r.next=6;break}throw Error("Failed unsubscribing from an event with: "+e);case 6:return r.abrupt("return",e);case 7:case"end":return r.stop()}},_callee4,this)})),function(t){return b.apply(this,arguments)})},{key:"close",value:function(t,e){this.socket.close(t||1e3,e)}},{key:"_connect",value:function(t,e){var r=this;clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",function(){r.ready=!0,r.emit("open"),r.current_reconnects=0}),this.socket.addEventListener("message",function(t){var e=t.data;e instanceof ArrayBuffer&&(e=n.from(e).toString());try{e=r.dataPack.decode(e)}catch(t){return}if(e.notification&&r.listeners(e.notification).length){if(!Object.keys(e.params).length)return r.emit(e.notification);var o=[e.notification];if(e.params.constructor===Object)o.push(e.params);else for(var s=0;s<e.params.length;s++)o.push(e.params[s]);return Promise.resolve().then(function(){r.emit.apply(r,o)})}if(!r.queue[e.id])return e.method&&e.params?Promise.resolve().then(function(){r.emit(e.method,e.params)}):void 0;"error"in e=="result"in e&&r.queue[e.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),r.queue[e.id].timeout&&clearTimeout(r.queue[e.id].timeout),e.error?r.queue[e.id].promise[1](e.error):r.queue[e.id].promise[0](e.result),delete r.queue[e.id]}),this.socket.addEventListener("error",function(t){return r.emit("error",t)}),this.socket.addEventListener("close",function(n){var o=n.code,s=n.reason;r.ready&&setTimeout(function(){return r.emit("close",o,s)}
11,0),r.ready=!1,r.socket=void 0,1e3!==o&&(r.current_reconnects++,r.reconnect&&(r.max_reconnects>r.current_reconnects||0===r.max_reconnects)&&(r.reconnect_timer_id=setTimeout(function(){return r._connect(t,e)},r.reconnect_interval)))})}}]),CommonClient}(y.EventEmitter);e.Z=b},95400:function(t,e,r){"use strict";var n=r(26314);e.Z=function(t,e){return new l(t,e)};var o=n(r(86358)),s=n(r(1127)),f=n(r(35684)),u=n(r(60746)),a=n(r(83654)),l=function(t){(0,f.default)(WebSocketBrowserImpl,t);var e,r=(e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,r=(0,a.default)(WebSocketBrowserImpl);if(e){var n=(0,a.default)(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return(0,u.default)(this,t)});function WebSocketBrowserImpl(t,e,n){var s;return(0,o.default)(this,WebSocketBrowserImpl),(s=r.call(this)).socket=new window.WebSocket(t,n),s.socket.onopen=function(){return s.emit("open")},s.socket.onmessage=function(t){return s.emit("message",t.data)},s.socket.onerror=function(t){return s.emit("error",t)},s.socket.onclose=function(t){s.emit("close",t.code,t.reason)},s}return(0,s.default)(WebSocketBrowserImpl,[{key:"send",value:function(t,e,r){var n=r||e;try{this.socket.send(t),n()}catch(t){n(t)}}},{key:"close",value:function(t,e){this.socket.close(t,e)}},{key:"addEventListener",value:function(t,e,r){this.socket.addEventListener(t,e,r)}}]),WebSocketBrowserImpl}(r(16814).EventEmitter)},19496:function(t,e,r){"use strict";var n=r(26314);Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultDataPack=void 0,e.createError=function(t,e){var r={code:t,message:f.get(t)||"Internal Server Error"};return e&&(r.data=e),r};var o=n(r(86358)),s=n(r(1127)),f=new Map([[-32e3,"Event not provided"],[-32600,"Invalid Request"],[-32601,"Method not found"],[-32602,"Invalid params"],[-32603,"Internal error"],[-32604,"Params not found"],[-32605,"Method forbidden"],[-32606,"Event forbidden"],[-32700,"Parse error"]]),u=function(){function DefaultDataPack(){(0,o.default)(this,DefaultDataPack)}return(0,s.default)(DefaultDataPack,[{key:"encode",value:function(t){return JSON.stringify(t)}},{key:"decode",value:function(t){return JSON.parse(t)}}]),DefaultDataPack}();e.DefaultDataPack=u},16814:function(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function Events(){}function EE(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function addListener(t,e,n,o,s){if("function"!=typeof n)throw TypeError("The listener must be a function");var f=new EE(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],f]:t._events[u].push(f):(t._events[u]=f,t._eventsCount++),t}function clearEvent(t,e){0==--t._eventsCount?t._events=new Events:delete t._events[e]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(r=!1)),EventEmitter.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},EventEmitter.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,f=Array(s);o<s;o++)f[o]=n[o].fn;return f},EventEmitter.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},EventEmitter.prototype.emit=function(t,e,n,o,s,f){var u=r?r+t:t;if(!this._events[u])return!1;var a,l,c=this._events[u],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,o),!0;case 5:return c.fn.call(c.context,e,n,o,s),!0;case 6:return c.fn.call(c.context,e,n,o,s,f),!0}for(l=1,a=Array(d-1);l<d;l++)a[l-1]=arguments[l];c.fn.apply(c.context,a)}else{var p,y=c.length;for(l=0;l<y;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,o);break;default:if(!a)for(p=1,a=Array(d-1);p<d;p++)a[p-1]=arguments[p];c[l].fn.apply(c[l].context,a)}}return!0},EventEmitter.prototype.on=function(t,e,r){return addListener(this,t,e,r,!1)},EventEmitter.prototype.once=function(t,e,r){return addListener(this,t,e,r,!0)},EventEmitter.prototype.removeListener=function(t,e,n,o){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return clearEvent(this,s),this;var f=this._events[s];if(f.fn)f.fn!==e||o&&!f.once||n&&f.context!==n||clearEvent(this,s);else{for(var u=0,a=[],l=f.length;u<l;u++)(f[u].fn!==e||o&&!f[u].once||n&&f[u].context!==n)&&a.push(f[u]);a.length?this._events[s]=1===a.length?a[0]:a:clearEvent(this,s)}return this},EventEmitter.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&clearEvent(this,e)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=r,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter},92336:function(t,e,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=r(67133),o=n.Buffer;function copyProps(t,e){for(var r in t)e[r]=t[r]}function SafeBuffer(t,e,r){return o(t,e,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(copyProps(n,e),e.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(o.prototype),copyProps(o,SafeBuffer),SafeBuffer.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return o(t,e,r)},SafeBuffer.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=o(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},SafeBuffer.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return o(t)},SafeBuffer.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},37219:function(t,e,r){"use strict";r.d(e,{v4:function(){return n.Z}});var n=r(55894)},95248:function(t){t.exports=function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}
11,t.exports.__esModule=!0,t.exports.default=t.exports},64662:function(t){function asyncGeneratorStep(t,e,r,n,o,s,f){try{var u=t[s](f),a=u.value}catch(t){r(t);return}u.done?e(a):Promise.resolve(a).then(n,o)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function _next(t){asyncGeneratorStep(s,n,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(s,n,o,_next,_throw,"throw",t)}_next(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports},86358:function(t){t.exports=function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},1127:function(t,e,r){var n=r(19040);function _defineProperties(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},83654:function(t){function _getPrototypeOf(e){return t.exports=_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(e)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports},35684:function(t,e,r){var n=r(60795);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},26314:function(t){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},60746:function(t,e,r){var n=r(61565).default,o=r(95248);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports.default=t.exports},14436:function(t,e,r){var n=r(61565).default;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=_regeneratorRuntime=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},o=Object.prototype,s=o.hasOwnProperty,f=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",c=u.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function(t,e,r){return t[e]=r}}function wrap(t,r,n,o){var s,u,a=Object.create((r&&r.prototype instanceof Generator?r:Generator).prototype);return f(a,"_invoke",{value:(s=new Context(o||[]),u=d,function(r,o){if(u===p)throw Error("Generator is already running");if(u===y){if("throw"===r)throw o;return{value:e,done:!0}}for(s.method=r,s.arg=o;;){var f=s.delegate;if(f){var a=function maybeInvokeDelegate(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,maybeInvokeDelegate(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+n+"' method")),g;var s=tryCatch(o,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,g;var f=s.arg;return f?f.done?(r[t.resultName]=f.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):f:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,g)}(f,s);if(a){if(a===g)continue;return a}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(u===d)throw u=y,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);u=p;var l=tryCatch(t,n,s);if("normal"===l.type){if(u=s.done?y:"suspendedYield",l.arg===g)continue;return{value:l.arg,done:s.done}}"throw"===l.type&&(u=y,s.method="throw",s.arg=l.arg)}})}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=wrap;var d="suspendedStart",p="executing",y="completed",g={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var b={};define(b,a,function(){return this});var m=Object.getPrototypeOf,B=m&&m(m(values([])));B&&B!==o&&s.call(B,a)&&(b=B);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(b);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t)})})}function AsyncIterator(t,e){var r;f(this,"_invoke",{value:function(o,f){function callInvokeWithMethodAndArg(){return new e(function(r,u){!function invoke(r,o,f,u){var a=tryCatch(t[r],t,o);if("throw"!==a.type){var l=a.arg,c=l.value;return c&&"object"==n(c)&&s.call(c,"__await")?e.resolve(c.__await).then(function(t){invoke("next",t,f,u)},function(t){invoke("throw",t,f,u)}):e.resolve(c).then(function(t){l.value=t,f(l)},function(t){return invoke("throw",t,f,u)})}u(a.arg)}(o,f,r,u)})}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function next(){for(;++o<t.length;)if(s.call(t,o))return next.value=t[o],next.done=!1,next;return next.value=e,next.done=!0,next};return i.next=i}}throw TypeError(n(t)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,f(w,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),f(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,l,function(){return this}),r.AsyncIterator=AsyncIterator,r.async=function(t,e,n,o,s){void 0===s&&(s=Prom
11ise);var f=new AsyncIterator(wrap(t,e,n,o),s);return r.isGeneratorFunction(e)?f:f.next().then(function(t){return t.done?t.value:f.next()})},defineIteratorMethods(w),define(w,c,"Generator"),define(w,a,function(){return this}),define(w,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(resetTryEntry),!t)for(var r in this)"t"===r.charAt(0)&&s.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function handle(n,o){return f.type="throw",f.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],f=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var u=s.call(o,"catchLoc"),a=s.call(o,"finallyLoc");if(u&&a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!a)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var f=o?o.completion:{};return f.type=t,f.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(f)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:values(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports},60795:function(t){function _setPrototypeOf(e,r){return t.exports=_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(e,r)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports},89944:function(t,e,r){var n=r(61565).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},19040:function(t,e,r){var n=r(61565).default,o=r(89944);t.exports=function(t){var e=o(t,"string");return"symbol"==n(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},61565:function(t){function _typeof(e){return t.exports=_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(e)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports},74001:function(t,e,r){var n=r(14436)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},63606:function(t,e,r){"use strict";r.d(e,{K:function(){return validateBasic},M:function(){return wNAF}});var n=r(52948),o=r(57843);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let s=BigInt(0),f=BigInt(1);function wNAF(t,e){let constTimeNegate=(t,e)=>{let r=e.negate();return t?r:e},opts=t=>({windows:Math.ceil(e/t)+1,windowSize:2**(t-1)});return{constTimeNegate,unsafeLadder(e,r){let n=t.ZERO,o=e;for(;r>s;)r&f&&(n=n.add(o)),o=o.double(),r>>=f;return n},precomputeWindow(t,e){let{windows:r,windowSize:n}=opts(e),o=[],s=t,f=s;for(let t=0;t<r;t++){f=s,o.push(f);for(let t=1;t<n;t++)f=f.add(s),o.push(f);s=f.double()}return o},wNAF(e,r,n){let{windows:o,windowSize:s}=opts(e),u=t.ZERO,a=t.BASE,l=BigInt(2**e-1),c=2**e,d=BigInt(e);for(let t=0;t<o;t++){let e=t*s,o=Number(n&l);n>>=d,o>s&&(o-=c,n+=f);let p=e+Math.abs(o)-1,y=t%2!=0,g=o<0;0===o?a=a.add(constTimeNegate(y,r[e])):u=u.add(constTimeNegate(g,r[p]))}return{p:u,f:a}},wNAFCached(t,e,r,n){let o=t._WINDOW_SIZE||1,s=e.get(t);
11return s||(s=this.precomputeWindow(t,o),1!==o&&e.set(t,n(s))),this.wNAF(o,s,r)}}}function validateBasic(t){return(0,n.OP)(t.Fp),(0,o.FF)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.kK)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}},52948:function(t,e,r){"use strict";r.d(e,{DV:function(){return FpSqrtEven},OP:function(){return validateField},PS:function(){return getMinHashLength},Tu:function(){return isNegativeLE},U_:function(){return invert},Us:function(){return mapHashToField},gN:function(){return Field},kK:function(){return nLength},oA:function(){return pow2},wQ:function(){return mod}});var n=r(57843);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let o=BigInt(0),s=BigInt(1),f=BigInt(2),u=BigInt(3),a=BigInt(4),l=BigInt(5),c=BigInt(8);function mod(t,e){let r=t%e;return r>=o?r:e+r}function pow2(t,e,r){let n=t;for(;e-- >o;)n*=n,n%=r;return n}function invert(t,e){if(t===o||e<=o)throw Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=mod(t,e),n=e,f=o,u=s,a=s,l=o;for(;r!==o;){let t=n/r,e=n%r,o=f-a*t,s=u-l*t;n=r,r=e,f=a,u=l,a=o,l=s}let c=n;if(c!==s)throw Error("invert: does not exist");return mod(f,e)}BigInt(9),BigInt(16);let isNegativeLE=(t,e)=>(mod(t,e)&s)===s,d=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(t){let e=d.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.FF)(t,e)}function nLength(t,e){let r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Field(t,e,r=!1,d={}){if(t<=o)throw Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:p,nByteLength:y}=nLength(t,e);if(y>2048)throw Error("Field lengths over 2048 bytes are not supported");let g=function(t){if(t%a===u){let e=(t+s)/a;return function(t,r){let n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw Error("Cannot find square root");return n}}if(t%c===l){let e=(t-l)/c;return function(t,r){let n=t.mul(r,f),o=t.pow(n,e),s=t.mul(r,o),u=t.mul(t.mul(s,f),o),a=t.mul(s,t.sub(u,t.ONE));if(!t.eql(t.sqr(a),r))throw Error("Cannot find square root");return a}}return function(t){let e,r,n;let u=(t-s)/f;for(e=t-s,r=0;e%f===o;e/=f,r++);for(n=f;n<t&&function(t,e,r){if(r<=o||e<o)throw Error("Expected power/modulo > 0");if(r===s)return o;let n=s;for(;e>o;)e&s&&(n=n*t%r),t=t*t%r,e>>=s;return n}(n,u,t)!==t-s;n++);if(1===r){let e=(t+s)/a;return function(t,r){let n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw Error("Cannot find square root");return n}}let l=(e+s)/f;return function(t,o){if(t.pow(o,u)===t.neg(t.ONE))throw Error("Cannot find square root");let f=r,a=t.pow(t.mul(t.ONE,n),e),c=t.pow(o,l),d=t.pow(o,e);for(;!t.eql(d,t.ONE);){if(t.eql(d,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(d);e<f&&!t.eql(r,t.ONE);e++)r=t.sqr(r);let r=t.pow(a,s<<BigInt(f-e-1));a=t.sqr(r),c=t.mul(c,r),d=t.mul(d,a),f=e}return c}}(t)}(t),b=Object.freeze({ORDER:t,BITS:p,BYTES:y,MASK:(0,n.dQ)(p),ZERO:o,ONE:s,create:e=>mod(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error(`Invalid field element: expected bigint, got ${typeof e}`);return o<=e&&e<t},is0:t=>t===o,isOdd:t=>(t&s)===s,neg:e=>mod(-e,t),eql:(t,e)=>t===e,sqr:e=>mod(e*e,t),add:(e,r)=>mod(e+r,t),sub:(e,r)=>mod(e-r,t),mul:(e,r)=>mod(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<o)throw Error("Expected power > 0");if(r===o)return t.ONE;if(r===s)return e;let n=t.ONE,f=e;for(;r>o;)r&s&&(n=t.mul(n,f)),f=t.sqr(f),r>>=s;return n})(b,t,e),div:(e,r)=>mod(e*invert(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>invert(e,t),sqrt:d.sqrt||(t=>g(b,t)),invertBatch:t=>(function(t,e){let r=Array(e.length),n=e.reduce((e,n,o)=>t.is0(n)?e:(r[o]=e,t.mul(e,n)),t.ONE),o=t.inv(n);return e.reduceRight((e,n,o)=>t.is0(n)?e:(r[o]=t.mul(e,r[o]),t.mul(e,n)),o),r})(b,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?(0,n.S5)(t,y):(0,n.tL)(t,y),fromBytes:t=>{if(t.length!==y)throw Error(`Fp.fromBytes: expected ${y}, got ${t.length}`);return r?(0,n.ty)(t):(0,n.bytesToNumberBE)(t)}});return Object.freeze(b)}function FpSqrtEven(t,e){if(!t.isOdd)throw Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function getFieldBytesLength(t){if("bigint"!=typeof t)throw Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function getMinHashLength(t){let e=getFieldBytesLength(t);return e+Math.ceil(e/2)}function mapHashToField(t,e,r=!1){let o=t.length,f=getFieldBytesLength(e),u=getMinHashLength(e);if(o<16||o<u||o>1024)throw Error(`expected ${u}-1024 bytes of input, got ${o}`);let a=r?(0,n.bytesToNumberBE)(t):(0,n.ty)(t),l=mod(a,e-s)+s;return r?(0,n.S5)(l,f):(0,n.tL)(l,f)}},57843:function(t,e,r){"use strict";r.d(e,{FF:function(){return validateObject},S5:function(){return numberToBytesLE},_t:function(){return isBytes},bytesToNumberBE:function(){return bytesToNumberBE},ci:function(){return bytesToHex},dQ:function(){return bitMask},eV:function(){return concatBytes},hexToBytes:function(){return hexToBytes},n$:function(){return createHmacDrbg},ql:function(){return ensureBytes},tL:function(){return numberToBytesBE},ty:function(){return bytesToNumberLE}}),BigInt(0);let n=BigInt(1),o=BigInt(2);function isBytes(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}let s=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function bytesToHex(t){if(!isBytes(t))throw Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=s[t[r]];return e}function hexToNumber(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}let f={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function asciiToBase16(t){return t>=f._0&&t<=f._9?t-f._0:t>=f._A&&t<=f._F?t-(f._A-10):t>=f._a&&t<=f._f?t-(f._a-10):void 0}function hexToBytes(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let e=0,o=0;e<r;e++,o+=2){let r=asciiToBase16(t.charCodeAt(o)),s=asciiToBase16(t.charCodeAt(o+1));if(void 0===r||void 0===s){let e=t[o]+t[o+1];throw Error('hex string expected, got non-hex character "'+e+'" at index '+o)}n[e]=16*r+s}return n}function bytesToNumberBE(t){return hexToNumber(bytesToHex(t))}function bytesToNumberLE(t){if(!isBytes(t))throw Error("Uint8Array expected");return hexToNumber(bytesToHex(Uint8Array.from(t).reverse()))}function numberToBytesBE(t,e){return hexToBytes(t.toString(16).padStart(2*e,"0"))}function numberToBytesLE(t,e){return numberToBytesBE(t,e).reverse()}function ensureBytes(t,e,r){let n;if("string"==typeof e)try{n=hexToBytes(e)}catch(r){throw Error(`${t} must be valid hex string, got "${e}". Cause: ${r}`)}else if(isBytes(e))n=Uint8Array.from(e);else throw Error(`${t} must be hex string or Uint8Array`);let o=n.length;if("number"==typeof r&&o!==r)throw Error(`${t} expected ${r} bytes, got ${o}`);return n}function concatBytes(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];
11if(!isBytes(n))throw Error("Uint8Array expected");e+=n.length}let r=new Uint8Array(e),n=0;for(let e=0;e<t.length;e++){let o=t[e];r.set(o,n),n+=o.length}return r}let bitMask=t=>(o<<BigInt(t-1))-n,u8n=t=>new Uint8Array(t),u8fr=t=>Uint8Array.from(t);function createHmacDrbg(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=u8n(t),o=u8n(t),s=0,reset=()=>{n.fill(1),o.fill(0),s=0},h=(...t)=>r(o,n,...t),reseed=(t=u8n())=>{o=h(u8fr([0]),t),n=h(),0!==t.length&&(o=h(u8fr([1]),t),n=h())},gen=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){n=h();let e=n.slice();r.push(e),t+=n.length}return concatBytes(...r)};return(t,e)=>{let r;for(reset(),reseed(t);!(r=e(gen()));)reseed();return reset(),r}}let u={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||isBytes(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function validateObject(t,e,r={}){let checkField=(e,r,n)=>{let o=u[r];if("function"!=typeof o)throw Error(`Invalid validator "${r}", expected function`);let s=t[e];if((!n||void 0!==s)&&!o(s,t))throw Error(`Invalid param ${String(e)}=${s} (${typeof s}), expected ${r}`)};for(let[t,r]of Object.entries(e))checkField(t,r,!1);for(let[t,e]of Object.entries(r))checkField(t,e,!0);return t}},4107:function(t,e,r){"use strict";r.d(e,{UN:function(){return T}});var n=r(4727),o=r(10606),s=r(32305);let[f,u]=o.ZP.split(["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","0xf40e3585
115771202a","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(t=>BigInt(t))),a=new Uint32Array(80),l=new Uint32Array(80);let SHA512=class SHA512 extends n.N{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:r,Bl:n,Ch:o,Cl:s,Dh:f,Dl:u,Eh:a,El:l,Fh:c,Fl:d,Gh:p,Gl:y,Hh:g,Hl:b}=this;return[t,e,r,n,o,s,f,u,a,l,c,d,p,y,g,b]}set(t,e,r,n,o,s,f,u,a,l,c,d,p,y,g,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|s,this.Dh=0|f,this.Dl=0|u,this.Eh=0|a,this.El=0|l,this.Fh=0|c,this.Fl=0|d,this.Gh=0|p,this.Gl=0|y,this.Hh=0|g,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)a[r]=t.getUint32(e),l[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|a[t-15],r=0|l[t-15],n=o.ZP.rotrSH(e,r,1)^o.ZP.rotrSH(e,r,8)^o.ZP.shrSH(e,r,7),s=o.ZP.rotrSL(e,r,1)^o.ZP.rotrSL(e,r,8)^o.ZP.shrSL(e,r,7),f=0|a[t-2],u=0|l[t-2],c=o.ZP.rotrSH(f,u,19)^o.ZP.rotrBH(f,u,61)^o.ZP.shrSH(f,u,6),d=o.ZP.rotrSL(f,u,19)^o.ZP.rotrBL(f,u,61)^o.ZP.shrSL(f,u,6),p=o.ZP.add4L(s,d,l[t-7],l[t-16]),y=o.ZP.add4H(p,n,c,a[t-7],a[t-16]);a[t]=0|y,l[t]=0|p}let{Ah:r,Al:n,Bh:s,Bl:c,Ch:d,Cl:p,Dh:y,Dl:g,Eh:b,El:m,Fh:B,Fl:w,Gh:v,Gl:x,Hh:I,Hl:A}=this;for(let t=0;t<80;t++){let e=o.ZP.rotrSH(b,m,14)^o.ZP.rotrSH(b,m,18)^o.ZP.rotrBH(b,m,41),_=o.ZP.rotrSL(b,m,14)^o.ZP.rotrSL(b,m,18)^o.ZP.rotrBL(b,m,41),O=b&B^~b&v,S=m&w^~m&x,U=o.ZP.add5L(A,_,S,u[t],l[t]),L=o.ZP.add5H(U,I,e,O,f[t],a[t]),k=0|U,R=o.ZP.rotrSH(r,n,28)^o.ZP.rotrBH(r,n,34)^o.ZP.rotrBH(r,n,39),P=o.ZP.rotrSL(r,n,28)^o.ZP.rotrBL(r,n,34)^o.ZP.rotrBL(r,n,39),T=r&s^r&d^s&d,N=n&c^n&p^c&p;I=0|v,A=0|x,v=0|B,x=0|w,B=0|b,w=0|m,({h:b,l:m}=o.ZP.add(0|y,0|g,0|L,0|k)),y=0|d,g=0|p,d=0|s,p=0|c,s=0|r,c=0|n;let F=o.ZP.add3L(k,P,N);r=o.ZP.add3H(F,L,R,T),n=0|F}({h:r,l:n}=o.ZP.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l:c}=o.ZP.add(0|this.Bh,0|this.Bl,0|s,0|c)),({h:d,l:p}=o.ZP.add(0|this.Ch,0|this.Cl,0|d,0|p)),({h:y,l:g}=o.ZP.add(0|this.Dh,0|this.Dl,0|y,0|g)),({h:b,l:m}=o.ZP.add(0|this.Eh,0|this.El,0|b,0|m)),({h:B,l:w}=o.ZP.add(0|this.Fh,0|this.Fl,0|B,0|w)),({h:v,l:x}=o.ZP.add(0|this.Gh,0|this.Gl,0|v,0|x)),({h:I,l:A}=o.ZP.add(0|this.Hh,0|this.Hl,0|I,0|A)),this.set(r,n,s,c,d,p,y,g,b,m,B,w,v,x,I,A)}roundClean(){a.fill(0),l.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};let c=(0,s.hE)(()=>new SHA512);var d=r(52948),p=r(57843),y=r(63606);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let g=BigInt(0),b=BigInt(1),m=BigInt(2),B=BigInt(8),w={zip215:!0},v=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),x=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),I=BigInt(0),A=BigInt(1),_=BigInt(2),O=BigInt(5),S=BigInt(10),U=BigInt(20),L=BigInt(40),k=BigInt(80);function uvRatio(t,e){let r=(0,d.wQ)(e*e*e,v),n=(0,d.wQ)(r*r*e,v),o=function(t){let e=t*t%v,r=e*t%v,n=(0,d.oA)(r,_,v)*r%v,o=(0,d.oA)(n,A,v)*t%v,s=(0,d.oA)(o,O,v)*o%v,f=(0,d.oA)(s,S,v)*s%v,u=(0,d.oA)(f,U,v)*f%v,a=(0,d.oA)(u,L,v)*u%v,l=(0,d.oA)(a,k,v)*a%v,c=(0,d.oA)(l,k,v)*a%v,p=(0,d.oA)(c,S,v)*s%v,y=(0,d.oA)(p,_,v)*t%v;return{pow_p_5_8:y,b2:r}}(t*n).pow_p_5_8,s=(0,d.wQ)(t*r*o,v),f=(0,d.wQ)(e*s*s,v),u=s,a=(0,d.wQ)(s*x,v),l=f===t,c=f===(0,d.wQ)(-t,v),p=f===(0,d.wQ)(-t*x,v);return l&&(s=u),(c||p)&&(s=a),(0,d.Tu)(s,v)&&(s=(0,d.wQ)(-s,v)),{isValid:l||c,value:s}}let R=(0,d.gN)(v,void 0,!0),P={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:R,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:c,randomBytes:s.O6,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio},T=function(t){let e=function(t){let e=(0,y.K)(t);return p.FF(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}(t),{Fp:r,n:n,prehash:o,hash:s,randomBytes:f,nByteLength:u,h:a}=e,l=m<<BigInt(8*u)-b,c=r.create,v=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:r.sqrt(t*r.inv(e))}}catch(t){return{isValid:!1,value:g}}}),x=e.adjustScalarBytes||(t=>t),I=e.domain||((t,e,r)=>{if(e.length||r)throw Error("Contexts/pre-hash are not supported");return t}),inBig=t=>"bigint"==typeof t&&g<t,inRange=(t,e)=>inBig(t)&&inBig(e)&&t<e,in0MaskRange=t=>t===g||inRange(t,l);function assertInRange(t,e){if(inRange(t,e))return t;throw Error(`Expected valid scalar < ${e}, got ${typeof t} ${t}`)}function assertGE0(t){return t===g?t:assertInRange(t,n)}let A=new Map;function isPoint(t){if(!(t instanceof Point))throw Error("ExtendedPoint expected")}let Point=class Point{constructor(t,e,r,n){if(this.ex=t,this.ey=e,this.ez=r,this.et=n,!in0MaskRange(t))throw Error("x required");if(!in0MaskRange(e))throw Error("y required");if(!in0MaskRange(r))throw Error("z required");if(!in0MaskRange(n))throw Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(t){if(t instanceof Point)throw Error("extended point not allowed");let{x:e,y:r}=t||{};if(!in0MaskRange(e)||!in0MaskRange(r))throw Error("invalid affine point");return new Point(e,r,b,c(e*r))}static normalizeZ(t){let e=r.invertBatch(t.map(t=>t.ez));return t.map((t,r)=>t.toAffine(e[r])).map(Point.fromAffine)}_setWindowSize(t){this._WINDOW_SIZE=t,A.delete(this)}assertValidity(){let{a:t,d:r}=e;if(this.is0())throw Error("bad point: ZERO");let{ex:n,ey:o,ez:s,et:f}
11=this,u=c(n*n),a=c(o*o),l=c(s*s),d=c(l*l),p=c(u*t),y=c(l*c(p+a)),g=c(d+c(r*c(u*a)));if(y!==g)throw Error("bad point: equation left != right (1)");let b=c(n*o),m=c(s*f);if(b!==m)throw Error("bad point: equation left != right (2)")}equals(t){isPoint(t);let{ex:e,ey:r,ez:n}=this,{ex:o,ey:s,ez:f}=t,u=c(e*f),a=c(o*n),l=c(r*f),d=c(s*n);return u===a&&l===d}is0(){return this.equals(Point.ZERO)}negate(){return new Point(c(-this.ex),this.ey,this.ez,c(-this.et))}double(){let{a:t}=e,{ex:r,ey:n,ez:o}=this,s=c(r*r),f=c(n*n),u=c(m*c(o*o)),a=c(t*s),l=r+n,d=c(c(l*l)-s-f),p=a+f,y=p-u,g=a-f,b=c(d*y),B=c(p*g),w=c(d*g),v=c(y*p);return new Point(b,B,v,w)}add(t){isPoint(t);let{a:r,d:n}=e,{ex:o,ey:s,ez:f,et:u}=this,{ex:a,ey:l,ez:d,et:p}=t;if(r===BigInt(-1)){let t=c((s-o)*(l+a)),e=c((s+o)*(l-a)),r=c(e-t);if(r===g)return this.double();let n=c(f*m*p),y=c(u*m*d),b=y+n,B=e+t,w=y-n,v=c(b*r),x=c(B*w),I=c(b*w),A=c(r*B);return new Point(v,x,A,I)}let y=c(o*a),b=c(s*l),B=c(u*n*p),w=c(f*d),v=c((o+s)*(a+l)-y-b),x=w-B,I=w+B,A=c(b-r*y),_=c(v*x),O=c(I*A),S=c(v*A),U=c(x*I);return new Point(_,O,U,S)}subtract(t){return this.add(t.negate())}wNAF(t){return S.wNAFCached(this,A,t,Point.normalizeZ)}multiply(t){let{p:e,f:r}=this.wNAF(assertInRange(t,n));return Point.normalizeZ([e,r])[0]}multiplyUnsafe(t){let e=assertGE0(t);return e===g?O:this.equals(O)||e===b?this:this.equals(_)?this.wNAF(e).p:S.unsafeLadder(this,e)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return S.unsafeLadder(this,n).is0()}toAffine(t){let{ex:e,ey:n,ez:o}=this,s=this.is0();null==t&&(t=s?B:r.inv(o));let f=c(e*t),u=c(n*t),a=c(o*t);if(s)return{x:g,y:b};if(a!==b)throw Error("invZ was invalid");return{x:f,y:u}}clearCofactor(){let{h:t}=e;return t===b?this:this.multiplyUnsafe(t)}static fromHex(t,n=!1){let{d:o,a:s}=e,f=r.BYTES;t=(0,p.ql)("pointHex",t,f);let u=t.slice(),a=t[f-1];u[f-1]=-129&a;let d=p.ty(u);d===g||(n?assertInRange(d,l):assertInRange(d,r.ORDER));let y=c(d*d),m=c(y-b),B=c(o*y-s),{isValid:w,value:x}=v(m,B);if(!w)throw Error("Point.fromHex: invalid y coordinate");let I=(x&b)===b,A=(128&a)!=0;if(!n&&x===g&&A)throw Error("Point.fromHex: x=0 and x_0=1");return A!==I&&(x=c(-x)),Point.fromAffine({x,y:d})}static fromPrivateKey(t){return getExtendedPublicKey(t).point}toRawBytes(){let{x:t,y:e}=this.toAffine(),n=p.S5(e,r.BYTES);return n[n.length-1]|=t&b?128:0,n}toHex(){return p.ci(this.toRawBytes())}};Point.BASE=new Point(e.Gx,e.Gy,b,c(e.Gx*e.Gy)),Point.ZERO=new Point(g,b,b,g);let{BASE:_,ZERO:O}=Point,S=(0,y.M)(Point,8*u);function modN_LE(t){var e;return e=p.ty(t),(0,d.wQ)(e,n)}function getExtendedPublicKey(t){t=(0,p.ql)("private key",t,u);let e=(0,p.ql)("hashed private key",s(t),2*u),r=x(e.slice(0,u)),n=e.slice(u,2*u),o=modN_LE(r),f=_.multiply(o),a=f.toRawBytes();return{head:r,prefix:n,scalar:o,point:f,pointBytes:a}}function hashDomainToScalar(t=new Uint8Array,...e){let r=p.eV(...e);return modN_LE(s(I(r,(0,p.ql)("context",t),!!o)))}return _._setWindowSize(8),{CURVE:e,getPublicKey:function(t){return getExtendedPublicKey(t).pointBytes},sign:function(t,e,s={}){var f;t=(0,p.ql)("message",t),o&&(t=o(t));let{prefix:a,scalar:l,pointBytes:c}=getExtendedPublicKey(e),y=hashDomainToScalar(s.context,a,t),g=_.multiply(y).toRawBytes(),b=hashDomainToScalar(s.context,g,c,t),m=(f=y+b*l,(0,d.wQ)(f,n));assertGE0(m);let B=p.eV(g,p.S5(m,r.BYTES));return(0,p.ql)("result",B,2*u)},verify:function(t,e,n,s=w){let f,u,a;let{context:l,zip215:c}=s,d=r.BYTES;t=(0,p.ql)("signature",t,2*d),e=(0,p.ql)("message",e),o&&(e=o(e));let y=p.ty(t.slice(d,2*d));try{f=Point.fromHex(n,c),u=Point.fromHex(t.slice(0,d),c),a=_.multiplyUnsafe(y)}catch(t){return!1}if(!c&&f.isSmallOrder())return!1;let g=hashDomainToScalar(l,u.toRawBytes(),f.toRawBytes(),e),b=u.add(f.multiplyUnsafe(g));return b.subtract(a).clearCofactor().equals(Point.ZERO)},ExtendedPoint:Point,utils:{getExtendedPublicKey,randomPrivateKey:()=>f(r.BYTES),precompute:(t=8,e=Point.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}}(P);({...P});let N=(R.ORDER+BigInt(3))/BigInt(8);function assertRstPoint(t){if(!(t instanceof RistPoint))throw Error("RistrettoPoint expected")}R.pow(_,N),R.sqrt(R.neg(R.ONE)),R.ORDER,BigInt(5),BigInt(8),BigInt(486662),(0,d.DV)(R,R.neg(BigInt(486664)));let F=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),j=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),C=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),M=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),invertSqrt=t=>uvRatio(A,t),D=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bytes255ToNumberLE=t=>T.CURVE.Fp.create(bytesToNumberLE(t)&D);function calcElligatorRistrettoMap(t){let{d:e}=T.CURVE,r=T.CURVE.Fp.ORDER,n=T.CURVE.Fp.create,o=n(null*t*t),s=n((o+A)*C),f=BigInt(-1),u=n((f-e*o)*n(o+e)),{isValid:a,value:l}=uvRatio(s,u),c=n(l*t);isNegativeLE(c,r)||(c=n(-c)),a||(l=c),a||(f=o);let d=n(f*(o-A)*M-u),p=l*l,y=n((l+l)*u),g=n(d*F),b=n(A-p),m=n(A+p);return new T.ExtendedPoint(n(y*m),n(b*g),n(g*m),n(y*b))}let RistPoint=class RistPoint{constructor(t){this.ep=t}static fromAffine(t){return new RistPoint(T.ExtendedPoint.fromAffine(t))}static hashToCurve(t){t=ensureBytes("ristrettoHash",t,64);let e=bytes255ToNumberLE(t.slice(0,32)),r=calcElligatorRistrettoMap(e),n=bytes255ToNumberLE(t.slice(32,64)),o=calcElligatorRistrettoMap(n);return new RistPoint(r.add(o))}static fromHex(t){t=ensureBytes("ristrettoHex",t,32);let{a:e,d:r}=T.CURVE,n=T.CURVE.Fp.ORDER,o=T.CURVE.Fp.create,s="RistrettoPoint.fromHex: the hex is not val
11id encoding of RistrettoPoint",f=bytes255ToNumberLE(t);if(!equalBytes(numberToBytesLE(f,32),t)||isNegativeLE(f,n))throw Error(s);let u=o(f*f),a=o(A+e*u),l=o(A-e*u),c=o(a*a),d=o(l*l),p=o(e*r*c-d),{isValid:y,value:g}=invertSqrt(o(p*d)),b=o(g*l),m=o(g*b*p),B=o((f+f)*b);isNegativeLE(B,n)&&(B=o(-B));let w=o(a*m),v=o(B*w);if(!y||isNegativeLE(v,n)||w===I)throw Error(s);return new RistPoint(new T.ExtendedPoint(B,w,A,v))}toRawBytes(){let t,{ex:e,ey:r,ez:n,et:o}=this.ep,s=T.CURVE.Fp.ORDER,f=T.CURVE.Fp.create,u=f(f(n+r)*f(n-r)),a=f(e*r),l=f(a*a),{value:c}=invertSqrt(f(u*l)),d=f(c*u),p=f(c*a),y=f(d*p*o);if(isNegativeLE(o*y,s)){let n=f(null*r),o=f(null*e);e=n,r=o,t=f(d*j)}else t=p;isNegativeLE(e*y,s)&&(r=f(-r));let g=f((n-r)*t);return isNegativeLE(g,s)&&(g=f(-g)),numberToBytesLE(g,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(t){assertRstPoint(t);let{ex:e,ey:r}=this.ep,{ex:n,ey:o}=t.ep,s=T.CURVE.Fp.create,f=s(e*o)===s(r*n),u=s(r*o)===s(e*n);return f||u}add(t){return assertRstPoint(t),new RistPoint(this.ep.add(t.ep))}subtract(t){return assertRstPoint(t),new RistPoint(this.ep.subtract(t.ep))}multiply(t){return new RistPoint(this.ep.multiply(t))}multiplyUnsafe(t){return new RistPoint(this.ep.multiplyUnsafe(t))}double(){return new RistPoint(this.ep.double())}negate(){return new RistPoint(this.ep.negate())}}},79604:function(t,e,r){"use strict";r.d(e,{kA:function(){return x}});var n=r(89802),o=r(52948),s=r(69392),f=r(32305);let HMAC=class HMAC extends f.kb{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,s.vp)(t);let r=(0,f.O0)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<o.length;t++)o[t]^=54;this.iHash.update(o),this.oHash=t.create();for(let t=0;t<o.length;t++)o[t]^=106;this.oHash.update(o),o.fill(0)}update(t){return(0,s.Gg)(this),this.iHash.update(t),this}digestInto(t){(0,s.Gg)(this),(0,s.aI)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:n,destroyed:o,blockLen:s,outputLen:f}=this;return t.finished=n,t.destroyed=o,t.blockLen=s,t.outputLen=f,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};let hmac=(t,e,r)=>new HMAC(t,e).update(r).digest();hmac.create=(t,e)=>new HMAC(t,e);var u=r(57843),a=r(63606);let{bytesToNumberBE:l,hexToBytes:c}=u,d={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){let{Err:e}=d;if(t.length<2||2!==t[0])throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(128&n[0])throw new e("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new e("Invalid signature integer: unnecessary leading zero");return{d:l(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=d,r="string"==typeof t?c(t):t;if(!u._t(r))throw Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:o,l:s}=d._parseInt(r.subarray(2)),{d:f,l:a}=d._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:o,s:f}},hexFromSig(t){let slice=t=>8&Number.parseInt(t[0],16)?"00"+t:t,h=t=>{let e=t.toString(16);return 1&e.length?`0${e}`:e},e=slice(h(t.s)),r=slice(h(t.r)),n=e.length/2,o=r.length/2,s=h(n),f=h(o);return`30${h(o+n+4)}02${f}${r}02${s}${e}`}},p=BigInt(0),y=BigInt(1),g=(BigInt(2),BigInt(3));BigInt(4);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let b=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),m=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),B=BigInt(1),w=BigInt(2),divNearest=(t,e)=>(t+e/w)/e,v=(0,o.gN)(b,void 0,void 0,{sqrt:function(t){let e=BigInt(3),r=BigInt(6),n=BigInt(11),s=BigInt(22),f=BigInt(23),u=BigInt(44),a=BigInt(88),l=t*t*t%b,c=l*l*t%b,d=(0,o.oA)(c,e,b)*c%b,p=(0,o.oA)(d,e,b)*c%b,y=(0,o.oA)(p,w,b)*l%b,g=(0,o.oA)(y,n,b)*y%b,m=(0,o.oA)(g,s,b)*g%b,B=(0,o.oA)(m,u,b)*m%b,x=(0,o.oA)(B,a,b)*B%b,I=(0,o.oA)(x,u,b)*m%b,A=(0,o.oA)(I,e,b)*c%b,_=(0,o.oA)(A,f,b)*g%b,O=(0,o.oA)(_,r,b)*l%b,S=(0,o.oA)(O,w,b);if(!v.eql(v.sqr(S),t))throw Error("Cannot find square root");return S}}),x=function(t,e){let create=e=>(function(t){let e=function(t){let e=(0,a.K)(t);return u.FF(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:r,n:n}=e,s=r.BYTES+1,f=2*r.BYTES+1;function modN(t){return o.wQ(t,n)}function invN(t){return o.U_(t,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:b,isWithinCurveOrder:m}=function(t){let e=/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function(t){let e=(0,a.K)(t);u.FF(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:o}=e;if(r){if(!n.eql(o,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:r}=e,n=e.toBytes||((t,e,n)=>{let o=e.toAffine();return u.eV(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),s=e.fromBytes||(t=>{let e=t.subarray(1),n=r.fromBytes(e.subarray(0,r.BYTES)),o=r.fromBytes(e.subarray(r.BYTES,2*r.BYTES));return{x:n,y:o}});function weierstrassEquation(t){let{a:n,b:o}=e,s=r.sqr(t),f=r.mul(s,t);return r.add(r.add(f,r.mul(t,n)),o)}if(!r.eql(r.sqr(e.Gy),weierstrassEquation(e.Gx)))throw Error("bad generator point: equation left != right");function isWithinCurveOrder(t){return"bigint"==typeof t&&p<t&&t<e.n}function assertGE(t){if(!isWithinCurveOrder(t))throw Error("Expected valid bigint: 0 < bigint < curve.n")}function normPrivateKeyToScalar(t){let r;let{allowedPrivateKeyLengths:n,nByteLength:s,wrapPrivateKey:f,n:a}=e;if(n&&"bigint"!=typeof t){if(u._t(t)&&(t=u.ci(t)),"string"!=typeof t||!n.includes(t.length))throw Error("Invalid key");t=t.padStart(2*s,"0")}try{r="bigint"==typeof t?t:u.bytesToNumberBE((0,u.ql)("private key",t,s))}catch(e){throw Error(`private key must be ${s} bytes, hex or bigint, not ${typeof t}`)}return f&&(r=o.wQ(r,a)),assertGE(r),r}let f=new Map;function assertPrjPoint(t){if(!(t instanceof Point))throw Error("ProjectivePoint expected")}let Point=class Point{constructor(t,e,n){if(this.px=t,this.py=e,this.pz=n,null==t||!r.isValid(t))throw Error("x required");if(null==e||!r.isValid(e))throw Error("y required");if(null==n||!r.isValid(n))throw Error("z required")}static fromAffine(t){let{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw Error("invalid affine point");if(t instanceof Point)throw Error("projective point not allowed");let is0=t=>r.eql(t,r.ZERO);return is0(e)&&is0(n)?Point.ZERO:new Point(e,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){let e=r.invertBatch(t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(Point.fromAffine)}static fromHex(t){let e=Point.fromAffine(s((0,u.ql)("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return Point.BASE.multiply(normPrivateKeyToScalar(t))}_setWindowSize(t){this._WINDOW_SIZE=t,f.delete(this)}
11assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:t,y:n}=this.toAffine();if(!r.isValid(t)||!r.isValid(n))throw Error("bad point: x or y not FE");let o=r.sqr(n),s=weierstrassEquation(t);if(!r.eql(o,s))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:t}=this.toAffine();if(r.isOdd)return!r.isOdd(t);throw Error("Field doesn't support isOdd")}equals(t){assertPrjPoint(t);let{px:e,py:n,pz:o}=this,{px:s,py:f,pz:u}=t,a=r.eql(r.mul(e,u),r.mul(s,o)),l=r.eql(r.mul(n,u),r.mul(f,o));return a&&l}negate(){return new Point(this.px,r.neg(this.py),this.pz)}double(){let{a:t,b:n}=e,o=r.mul(n,g),{px:s,py:f,pz:u}=this,a=r.ZERO,l=r.ZERO,c=r.ZERO,d=r.mul(s,s),p=r.mul(f,f),y=r.mul(u,u),b=r.mul(s,f);return b=r.add(b,b),c=r.mul(s,u),c=r.add(c,c),a=r.mul(t,c),l=r.mul(o,y),l=r.add(a,l),a=r.sub(p,l),l=r.add(p,l),l=r.mul(a,l),a=r.mul(b,a),c=r.mul(o,c),y=r.mul(t,y),b=r.sub(d,y),b=r.mul(t,b),b=r.add(b,c),c=r.add(d,d),d=r.add(c,d),d=r.add(d,y),d=r.mul(d,b),l=r.add(l,d),y=r.mul(f,u),y=r.add(y,y),d=r.mul(y,b),a=r.sub(a,d),c=r.mul(y,p),c=r.add(c,c),c=r.add(c,c),new Point(a,l,c)}add(t){assertPrjPoint(t);let{px:n,py:o,pz:s}=this,{px:f,py:u,pz:a}=t,l=r.ZERO,c=r.ZERO,d=r.ZERO,p=e.a,y=r.mul(e.b,g),b=r.mul(n,f),m=r.mul(o,u),B=r.mul(s,a),w=r.add(n,o),v=r.add(f,u);w=r.mul(w,v),v=r.add(b,m),w=r.sub(w,v),v=r.add(n,s);let x=r.add(f,a);return v=r.mul(v,x),x=r.add(b,B),v=r.sub(v,x),x=r.add(o,s),l=r.add(u,a),x=r.mul(x,l),l=r.add(m,B),x=r.sub(x,l),d=r.mul(p,v),l=r.mul(y,B),d=r.add(l,d),l=r.sub(m,d),d=r.add(m,d),c=r.mul(l,d),m=r.add(b,b),m=r.add(m,b),B=r.mul(p,B),v=r.mul(y,v),m=r.add(m,B),B=r.sub(b,B),B=r.mul(p,B),v=r.add(v,B),b=r.mul(m,v),c=r.add(c,b),b=r.mul(x,v),l=r.mul(w,l),l=r.sub(l,b),b=r.mul(w,m),d=r.mul(x,d),d=r.add(d,b),new Point(l,c,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(Point.ZERO)}wNAF(t){return c.wNAFCached(this,f,t,t=>{let e=r.invertBatch(t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(Point.fromAffine)})}multiplyUnsafe(t){let n=Point.ZERO;if(t===p)return n;if(assertGE(t),t===y)return this;let{endo:o}=e;if(!o)return c.unsafeLadder(this,t);let{k1neg:s,k1:f,k2neg:u,k2:a}=o.splitScalar(t),l=n,d=n,g=this;for(;f>p||a>p;)f&y&&(l=l.add(g)),a&y&&(d=d.add(g)),g=g.double(),f>>=y,a>>=y;return s&&(l=l.negate()),u&&(d=d.negate()),d=new Point(r.mul(d.px,o.beta),d.py,d.pz),l.add(d)}multiply(t){let n,o;assertGE(t);let{endo:s}=e;if(s){let{k1neg:e,k1:f,k2neg:u,k2:a}=s.splitScalar(t),{p:l,f:d}=this.wNAF(f),{p:p,f:y}=this.wNAF(a);l=c.constTimeNegate(e,l),p=c.constTimeNegate(u,p),p=new Point(r.mul(p.px,s.beta),p.py,p.pz),n=l.add(p),o=d.add(y)}else{let{p:e,f:r}=this.wNAF(t);n=e,o=r}return Point.normalizeZ([n,o])[0]}multiplyAndAddUnsafe(t,e,r){let n=Point.BASE,mul=(t,e)=>e!==p&&e!==y&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=mul(this,e).add(mul(t,r));return o.is0()?void 0:o}toAffine(t){let{px:e,py:n,pz:o}=this,s=this.is0();null==t&&(t=s?r.ONE:r.inv(o));let f=r.mul(e,t),u=r.mul(n,t),a=r.mul(o,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(a,r.ONE))throw Error("invZ was invalid");return{x:f,y:u}}isTorsionFree(){let{h:t,isTorsionFree:r}=e;if(t===y)return!0;if(r)return r(Point,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:t,clearCofactor:r}=e;return t===y?this:r?r(Point,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return this.assertValidity(),n(Point,this,t)}toHex(t=!0){return u.ci(this.toRawBytes(t))}};Point.BASE=new Point(e.Gx,e.Gy,r.ONE),Point.ZERO=new Point(r.ZERO,r.ONE,r.ZERO);let l=e.nBitLength,c=(0,a.M)(Point,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:Point,normPrivateKeyToScalar,weierstrassEquation,isWithinCurveOrder}}({...e,toBytes(t,e,n){let o=e.toAffine(),s=r.toBytes(o.x),f=u.eV;return n?f(Uint8Array.from([e.hasEvenY()?2:3]),s):f(Uint8Array.from([4]),s,r.toBytes(o.y))},fromBytes(t){let e=t.length,n=t[0],o=t.subarray(1);if(e===s&&(2===n||3===n)){let t=u.bytesToNumberBE(o);if(!(p<t&&t<r.ORDER))throw Error("Point is not on curve");let e=b(t),s=r.sqrt(e),f=(s&y)===y;return(1&n)==1!==f&&(s=r.neg(s)),{x:t,y:s}}if(e===f&&4===n){let t=r.fromBytes(o.subarray(0,r.BYTES)),e=r.fromBytes(o.subarray(r.BYTES,2*r.BYTES));return{x:t,y:e}}throw Error(`Point of length ${e}
11 was invalid. Expected ${s} compressed bytes or ${f} uncompressed bytes`)}}),numToNByteStr=t=>u.ci(u.tL(t,e.nByteLength));function isBiggerThanHalfOrder(t){let e=n>>y;return t>e}let slcNum=(t,e,r)=>u.bytesToNumberBE(t.slice(e,r));let Signature=class Signature{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){let r=e.nByteLength;return t=(0,u.ql)("compactSignature",t,2*r),new Signature(slcNum(t,0,r),slcNum(t,r,2*r))}static fromDER(t){let{r:e,s:r}=d.toSig((0,u.ql)("DER",t));return new Signature(e,r)}assertValidity(){if(!m(this.r))throw Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(t){return new Signature(this.r,this.s,t)}recoverPublicKey(t){let{r:n,s:o,recovery:s}=this,f=w((0,u.ql)("msgHash",t));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let a=2===s||3===s?n+e.n:n;if(a>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let c=(1&s)==0?"02":"03",d=l.fromHex(c+numToNByteStr(a)),p=invN(a),y=modN(-f*p),g=modN(o*p),b=l.BASE.multiplyAndAddUnsafe(d,y,g);if(!b)throw Error("point at infinify");return b.assertValidity(),b}hasHighS(){return isBiggerThanHalfOrder(this.s)}normalizeS(){return this.hasHighS()?new Signature(this.r,modN(-this.s),this.recovery):this}toDERRawBytes(){return u.hexToBytes(this.toDERHex())}toDERHex(){return d.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return u.hexToBytes(this.toCompactHex())}toCompactHex(){return numToNByteStr(this.r)+numToNByteStr(this.s)}};function isProbPub(t){let e=u._t(t),r="string"==typeof t,n=(e||r)&&t.length;return e?n===s||n===f:r?n===2*s||n===2*f:t instanceof l}let B=e.bits2int||function(t){let r=u.bytesToNumberBE(t),n=8*t.length-e.nBitLength;return n>0?r>>BigInt(n):r},w=e.bits2int_modN||function(t){return modN(B(t))},v=u.dQ(e.nBitLength);function int2octets(t){if("bigint"!=typeof t)throw Error("bigint expected");if(!(p<=t&&t<v))throw Error(`bigint expected < 2^${e.nBitLength}`);return u.tL(t,e.nByteLength)}let x={lowS:e.lowS,prehash:!1},I={lowS:e.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return l.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(isProbPub(t))throw Error("first arg must be private key");if(!isProbPub(e))throw Error("second arg must be public key");let n=l.fromHex(e);return n.multiply(c(t)).toRawBytes(r)},sign:function(t,n,o=x){let{seed:s,k2sig:f}
11=function(t,n,o=x){if(["recovered","canonical"].some(t=>t in o))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:f}=e,{lowS:a,prehash:d,extraEntropy:g}=o;null==a&&(a=!0),t=(0,u.ql)("msgHash",t),d&&(t=(0,u.ql)("prehashed msgHash",s(t)));let b=w(t),v=c(n),I=[int2octets(v),int2octets(b)];if(null!=g){let t=!0===g?f(r.BYTES):g;I.push((0,u.ql)("extraEntropy",t))}let A=u.eV(...I);return{seed:A,k2sig:function(t){let e=B(t);if(!m(e))return;let r=invN(e),n=l.BASE.multiply(e).toAffine(),o=modN(n.x);if(o===p)return;let s=modN(r*modN(b+o*v));if(s===p)return;let f=(n.x===o?0:2)|Number(n.y&y),u=s;return a&&isBiggerThanHalfOrder(s)&&(u=isBiggerThanHalfOrder(s)?modN(-s):s,f^=1),new Signature(o,u,f)}}}(t,n,o),a=u.n$(e.hash.outputLen,e.nByteLength,e.hmac);return a(s,f)},verify:function(t,r,n,o=I){let s,f;if(r=(0,u.ql)("msgHash",r),n=(0,u.ql)("publicKey",n),"strict"in o)throw Error("options.strict was renamed to lowS");let{lowS:a,prehash:c}=o;try{if("string"==typeof t||u._t(t))try{f=Signature.fromDER(t)}catch(e){if(!(e instanceof d.Err))throw e;f=Signature.fromCompact(t)}else if("object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s){let{r:e,s:r}=t;f=new Signature(e,r)}else throw Error("PARSE");s=l.fromHex(n)}catch(t){if("PARSE"===t.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(a&&f.hasHighS())return!1;c&&(r=e.hash(r));let{r:p,s:y}=f,g=w(r),b=invN(y),m=modN(g*b),B=modN(p*b),v=l.BASE.multiplyAndAddUnsafe(s,m,B)?.toAffine();if(!v)return!1;let x=modN(v.x);return x===p},ProjectivePoint:l,Signature,utils:{isValidPrivateKey(t){try{return c(t),!0}catch(t){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>
11{let t=o.PS(e.n);return o.Us(e.randomBytes(t),e.n)},precompute:(t=8,e=l.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}})({...t,hash:e,hmac:(t,...r)=>hmac(e,t,(0,f.eV)(...r)),randomBytes:f.O6});return Object.freeze({...create(e),create})}({a:BigInt(0),b:BigInt(7),Fp:v,n:m,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-B*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=BigInt("0x100000000000000000000000000000000"),f=divNearest(e*t,m),u=divNearest(-r*t,m),a=(0,o.wQ)(t-f*e-u*n,m),l=(0,o.wQ)(-f*r-u*e,m),c=a>s,d=l>s;if(c&&(a=m-a),d&&(l=m-l),a>s||l>s)throw Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:c,k1:a,k2neg:d,k2:l}}}},n.J);BigInt(0),x.ProjectivePoint},69392:function(t,e,r){"use strict";function number(t){if(!Number.isSafeInteger(t)||t<0)throw Error(`Wrong positive integer: ${t}`)}function bytes(t,...e){if(!(t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name))throw Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function hash(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.wrapConstructor");number(t.outputLen),number(t.blockLen)}function exists(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function output(t,e){bytes(t);let r=e.outputLen;if(t.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}r.d(e,{Gg:function(){return exists},J8:function(){return output},Rx:function(){return number},aI:function(){return bytes},vp:function(){return hash}})},4727:function(t,e,r){"use strict";r.d(e,{N:function(){return SHA2}});var n=r(69392),o=r(32305);let SHA2=class SHA2 extends o.kb{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,o.GL)(this.buffer)}update(t){(0,n.Gg)(this);let{view:e,buffer:r,blockLen:s}=this;t=(0,o.O0)(t);let f=t.length;for(let n=0;n<f;){let u=Math.min(s-this.pos,f-n);if(u===s){let e=(0,o.GL)(t);for(;s<=f-n;n+=s)this.process(e,n);continue}r.set(t.subarray(n,n+u),this.pos),this.pos+=u,n+=u,this.pos===s&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,n.Gg)(this),(0,n.J8)(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:s,isLE:f}=this,{pos:u}=this;e[u++]=128,this.buffer.subarray(u).fill(0),this.padOffset>s-u&&(this.process(r,0),u=0);for(let t=u;t<s;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);let o=BigInt(32),s=BigInt(4294967295),f=Number(r>>o&s),u=Number(r&s),a=n?4:0,l=n?0:4;t.setUint32(e+a,f,n),t.setUint32(e+l,u,n)}(r,s-8,BigInt(8*this.length),f),this.process(r,0);let a=(0,o.GL)(t),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,d=this.get();if(c>d.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)a.setUint32(4*t,d[t],f)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:n,finished:o,destroyed:s,pos:f}=this;return t.length=n,t.pos=f,t.finished=o,t.destroyed=s,n%e&&t.buffer.set(r),t}}},10606:function(t,e,r){"use strict";r.d(e,{EP:function(){return rotlSH},SD:function(){return rotlBH},Vl:function(){return split},gm:function(){return rotlSL},mk:function(){return rotlBL}});let n=BigInt(4294967296-1),o=BigInt(32);function fromBig(t,e=!1){return e?{h:Number(t&n),l:Number(t>>o&n)}:{h:0|Number(t>>o&n),l:0|Number(t&n)}}function split(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){let{h:s,l:f}=fromBig(t[o],e);[r[o],n[o]]=[s,f]}return[r,n]}let rotlSH=(t,e,r)=>t<<r|e>>>32-r,rotlSL=(t,e,r)=>e<<r|t>>>32-r,rotlBH=(t,e,r)=>e<<r-32|t>>>64-r,rotlBL=(t,e,r)=>t<<r-32|e>>>64-r;e.ZP={fromBig,split,toBig:(t,e)=>BigInt(t>>>0)<<o|BigInt(e>>>0),shrSH:(t,e,r)=>t>>>r,shrSL:(t,e,r)=>t<<32-r|e>>
11>r,rotrSH:(t,e,r)=>t>>>r|e<<32-r,rotrSL:(t,e,r)=>t<<32-r|e>>>r,rotrBH:(t,e,r)=>t<<64-r|e>>>r-32,rotrBL:(t,e,r)=>t>>>r-32|e<<64-r,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH,rotlSL,rotlBH,rotlBL,add:function(t,e,r,n){let o=(e>>>0)+(n>>>0);return{h:t+r+(o/4294967296|0)|0,l:0|o}},add3L:(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),add3H:(t,e,r,n)=>e+r+n+(t/4294967296|0)|0,add4L:(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),add4H:(t,e,r,n,o)=>e+r+n+o+(t/4294967296|0)|0,add5H:(t,e,r,n,o,s)=>e+r+n+o+s+(t/4294967296|0)|0,add5L:(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0)}},89802:function(t,e,r){"use strict";r.d(e,{J:function(){return a}});var n=r(4727),o=r(32305);let Chi=(t,e,r)=>t&e^~t&r,Maj=(t,e,r)=>t&e^t&r^e&r,s=new Uint32Array([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]),f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);let SHA256=class SHA256 extends n.N{constructor(){super(64,32,8,!1),this.A=0|f[0],this.B=0|f[1],this.C=0|f[2],this.D=0|f[3],this.E=0|f[4],this.F=0|f[5],this.G=0|f[6],this.H=0|f[7]}get(){let{A:t,B:e,C:r,D:n,E:o,F:s,G:f,H:u}=this;return[t,e,r,n,o,s,f,u]}set(t,e,r,n,o,s,f,u){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|s,this.G=0|f,this.H=0|u}process(t,e){for(let r=0;r<16;r++,e+=4)u[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=u[t-15],r=u[t-2],n=(0,o.np)(e,7)^(0,o.np)(e,18)^e>>>3,s=(0,o.np)(r,17)^(0,o.np)(r,19)^r>>>10;u[t]=s+u[t-7]+n+u[t-16]|0}let{A:r,B:n,C:f,D:a,E:l,F:c,G:d,H:p}=this;for(let t=0;t<64;t++){let e=(0,o.np)(l,6)^(0,o.np)(l,11)^(0,o.np)(l,25),y=p+e+Chi(l,c,d)+s[t]+u[t]|0,g=(0,o.np)(r,2)^(0,o.np)(r,13)^(0,o.np)(r,22),b=g+Maj(r,n,f)|0;p=d,d=c,c=l,l=a+y|0,a=f,f=n,n=r,r=y+b|0}r=r+this.A|0,n=n+this.B|0,f=f+this.C|0,a=a+this.D|0,l=l+this.E|0,c=c+this.F|0,d=d+this.G|0,p=p+this.H|0,this.set(r,n,f,a,l,c,d,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};let a=(0,o.hE)(()=>new SHA256)},49658:function(t,e,r){"use strict";r.d(e,{fr:function(){return B}});var n=r(69392),o=r(10606),s=r(32305);let[f,u,a]=[[],[],[]],l=BigInt(0),c=BigInt(1),d=BigInt(2),p=BigInt(7),y=BigInt(256),g=BigInt(113);for(let t=0,e=c,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],f.push(2*(5*n+r)),u.push((t+1)*(t+2)/2%64);let o=l;for(let t=0;t<7;t++)(e=(e<<c^(e>>p)*g)%y)&d&&(o^=c<<(c<<BigInt(t))-c);a.push(o)}let[b,m]=(0,o.Vl)(a,!0),rotlH=(t,e,r)=>r>32?(0,o.SD)(t,e,r):(0,o.EP)(t,e,r),rotlL=(t,e,r)=>r>32?(0,o.mk)(t,e,r):(0,o.gm)(t,e,r);let Keccak=class Keccak extends s.kb{constructor(t,e,r,o=!1,f=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=o,this.rounds=f,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.Rx)(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,s.Jq)(this.state)}keccak(){!function(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let n=(e+8)%10,o=(e+2)%10,s=r[o],f=r[o+1],u=rotlH(s,f,1)^r[n],a=rotlL(s,f,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=u,t[e+r+1]^=a}let e=t[2],o=t[3];for(let r=0;r<24;r++){let n=u[r],s=rotlH(e,o,n),a=rotlL(e,o,n),l=f[r];e=t[l],o=t[l+1],t[l]=s,t[l+1]=a}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=b[n],t[1]^=m[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){(0,n.Gg)(this);let{blockLen:e,state:r}=this;t=(0,s.O0)(t);let o=t.length;for(let n=0;n<o;){let s=Math.min(e-this.pos,o-n);for(let e=0;e<s;e++)r[this.pos++]^=t[n++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,(128&e)!=0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){(0,n.Gg)(this,!1),(0,n.aI)(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,o=t.length;n<o;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,o-n);t.set(e.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,n.Rx)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,n.J8)(t,this),this.finished)throw 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){let{blockLen:e,suffix:r,outputLen:n,rounds:o,enableXOF:s}=this;return t||(t=new Keccak(e,r,n,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=n,t.enableXOF=s,t.destroyed=this.destroyed,t}};let B=(0,s.hE)(()=>new Keccak(136,1,32))},32305:function(t,e,r){"use strict";r.d(e,{kb:function(){return Hash},eV:function(){return concatBytes},GL:function(){return createView},O6:function(){return randomBytes},np:function(){return rotr},O0:function(){return toBytes},Jq:function(){return u32},iY:function(){return utf8ToBytes},hE:function(){return wrapConstructor}});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function isBytes(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}let createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),rotr=(t,e)=>t<<32-e|t>>>e,o=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];if(!o)throw Error("Non little-endian hardware is not supported");function utf8ToBytes(t){if("string"!=typeof t)throw Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function toBytes(t){if("string"==typeof t&&(t=utf8ToBytes(t)),!isBytes(t))throw Error(`expected Uint8Array, got ${typeof t}`);return t}function concatBytes(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];
11if(!isBytes(n))throw Error("Uint8Array expected");e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let o=t[e];r.set(o,n),n+=o.length}return r}let Hash=class Hash{clone(){return this._cloneInto()}};function wrapConstructor(t){let hashC=e=>t().update(toBytes(e)).digest(),e=t();return hashC.outputLen=e.outputLen,hashC.blockLen=e.blockLen,hashC.create=()=>t(),hashC}function randomBytes(t=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(t));throw Error("crypto.getRandomValues must be defined")}},54381:function(t,e,r){"use strict";r.r(e),r.d(e,{ParticleNetwork:function(){return x.gU},SolanaWallet:function(){return T}});var n,o,s,f,u,a,l,c,d,p,y,g,b,m,B,w,v,x=r(69601),I=r(63438),A=r(87081),_=r(67133),O=r(512),S=Object.defineProperty,U=Object.getOwnPropertyDescriptor,L=Object.getOwnPropertyNames,k=Object.prototype.hasOwnProperty,__copyProps=(t,e,r,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let o of L(e))k.call(t,o)||o===r||S(t,o,{get:()=>e[o],enumerable:!(n=U(e,o))||n.enumerable});return t},__toCommonJS=t=>__copyProps(S({},"__esModule",{value:!0}),t),__async=(t,e,r)=>new Promise((n,o)=>{var fulfilled=t=>{try{step(r.next(t))}catch(t){o(t)}},rejected=t=>{try{step(r.throw(t))}catch(t){o(t)}},step=t=>t.done?n(t.value):Promise.resolve(t.value).then(fulfilled,rejected);step((r=r.apply(t,e)).next())}),R={};((t,e)=>{for(var r in e)S(t,r,{get:e[r],enumerable:!0})})(R,{default:()=>v,dependencies:()=>g,devDependencies:()=>m,files:()=>u,gitHead:()=>w,license:()=>p,main:()=>l,module:()=>c,name:()=>s,peerDependencies:()=>b,publishConfig:()=>y,scripts:()=>B,type:()=>a,types:()=>d,version:()=>f});var P=(n={"package.json"(){v={name:s="@particle-network/solana-wallet",version:f="1.3.2",files:u=["es","lib","LICENSE"],type:a="module",main:l="lib/index.js",module:c="es/index.js",types:d="lib/types/index.d.ts",license:p="Apache-2.0",publishConfig:y={access:"public"},dependencies:g={"@particle-network/auth":"^1.3.1"},peerDependencies:b={"@solana/web3.js":"^1.50.1",bs58:"^4.0.1"},devDependencies:m={"@solana/web3.js":"^1.50.1","@types/bs58":"^4.0.1",bs58:"^4.0.1","ts-loader":"^9.3.1","webpack-cli":"^4.10.0"},scripts:B={clean:"shx rm -rf lib/* && shx rm -rf es/*",package:'shx echo \'{ "type": "commonjs" }\' > lib/package.json',build:"yarn clean && node ./esBuild.js && tsc --emitDeclarationOnly -p tsconfig.json && yarn package","build:min.js":"webpack",version:"yarn build"},gitHead:w="cc999e430ebfb1dd821783f7cf099ddd51f3495a"}}},function(){return n&&(o=(0,n[L(n)[0]])(n=0)),o}),T=class{constructor(t){this.auth=t,this.isParticleNetwork=!0,this.name="Particle",this.url="https://particle.network",this.icon="https://static.particle.network/wallet-icons/Particle.png",this.events=new O.EventEmitter,this.auth=t,this._connecting=!1;let e=this.auth.getUserInfo();if(e){let t=e.wallets.find(t=>"solana"===t.chain_name&&t.public_address.length>0);t?this._publicKey=new I.nh(t.public_address):this._publicKey=null}else this._publicKey=null;this.auth.on("connect",t=>{let e=t.wallets.find(t=>"solana"===t.chain_name&&t.public_address.length>0);e&&(this._publicKey=new I.nh(e.public_address),this.events.emit("connect",this._publicKey))}),this.auth.on("disconnect",()=>{this._publicKey=null,this.events.emit("disconnect")}),"undefined"!=typeof window&&window.particle&&(window.particle.solanaWallet=this)}get version(){return function(){let t=(P(),__toCommonJS(R));return`web_${t.version}`}()}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}get connecting(){return this._connecting}get connected(){return null!==this._publicKey}get publicKey(){return this._publicKey}connect(t){return __async(this,null,function*(){try{this._connecting=!0;let e=this.auth.getWallet();if(e||(yield this.auth.login(t),e=this.auth.getWallet()))return this._publicKey=new I.nh(e.public_address),Promise.resolve();return Promise.reject("wallet create failed")}catch(t){return Promise.reject(t)}finally{this._connecting=!1}})}disconnect(){return __async(this,null,function*(){return yield this.auth.logout(),this._publicKey=null,Promise.resolve()})}signTransaction(t){return __async(this,null,function*(){let e=yield this.auth.sign("signTransaction",A.encode(t.serialize({requireAllSignatures:!1,verifySignatures:!1})));return I.YW.from(_.Buffer.from(e,"base64"))})}signAllTransactions(t){return __async(this,null,function*(){let e=yield this.auth.signAllTransactions(t.map(t=>A.encode(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))));return e.map(t=>I.YW.from(_.Buffer.from(t,"base64")))})}signAndSendTransaction(t){return __async(this,null,function*(){return this.auth.sendTransaction(A.encode(t.serialize({requireAllSignatures:!1,verifySignatures:!1})))})}signMessage(t){return __async(this,null,function*(){let e=yield this.auth.sign("signMessage",A.encode(t));return _.Buffer.from(e,"base64")})}getConnection(t){let e=`${(0,x.oy)()}/solana`;return new I.ew(`${e}?chainId=${this.auth.getChainId()}&projectUuid=${this.auth.config.projectId}&projectKey=${this.auth.config.clientKey}`,{commitment:null==t?void 0:t.commitment,wsEndpoint:null==t?void 0:t.wsEndpoint,httpHeaders:{Authorization:this.auth.basicCredentials()},fetch:null==t?void 0:t.fetch,fetchMiddleware:null==t?void 0:t.fetchMiddleware,disableRetryOnRateLimit:null==t?void 0:t.disableRetryOnRateLimit,confirmTransactionInitialTimeout:null==t?void 0:t.confirmTransactionInitialTimeout})}}},88111:function(t,e,r){"use strict";r.d(e,{AG:function(){return nullable},G0:function(){return union},IM:function(){return record},IX:function(){return array},O7:function(){return boolean},Rx:function(){return number},Ue:function(){return create},Yj:function(){return any},Z_:function(){return string},_4:function(){return unknown},bc:function(){return tuple},dt:function(){return type},eE:function(){return instance},i0:function(){return literal},jt:function(){return optional},oQ:function(){return coerce}});let StructError=class StructError extends TypeError{constructor(t,e){let r;let{message:n,...o}=t,{path:s}=t,f=0===s.length?n:"At path: "+s.join(".")+" -- "+n;super(f),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[t,...e()]}}};function isObject(t){return"object"==typeof t&&null!=t}function print(t){return"string"==typeof t?JSON.stringify(t):""+t}function*toFailures(t,e,r,n){var o;for(let s of(isObject(o=t)&&"function"==typeof o[Symbol.iterator]||(t=[t]),t)){let t=function(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});let{path:o,branch:s}=e,{type:f}=r,{refinement:u,message:a="Expected a value of type `"+f+"`"+(u?" with refinement `"+u+"`":"")+", but received: `"+print(n)+"`"}=t;return{value:n,type:f,refinement:u,key:o[o.length-1],path:o,branch:s,...t,message:a}}(s,e,r,n);t&&(yield t)}}function*run(t,e,r={}){let{path:n=[],branch:o=[t],coerce:s=!1,mask:f=!1}=r,u={path:n,branch:o};if(s&&(t=e.coercer(t,u),f&&"type"!==e.type&&isObject(e.schema)&&isObject(t)&&!Array.isArray(t)))for(let r in t)void 0===e.schema[r]&&delete t[r];let a=!0;for(let r of e.validator(t,u))a=!1,yield[r,void 0];for(let[r,l,c]of e.entries(t,u)){let e=run(l,c,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,l],coerce:s,mask:f});for(let n of e)n[0]?(a=!1,yield[n[0],void 0]):s&&(l=n[1],void 0===r?t=l:t instanceof Map?t.set(r,l):t instanceof Set?t.add(l):isObject(t)&&(t[r]=l))}
11if(a)for(let r of e.refiner(t,u))a=!1,yield[r,void 0];a&&(yield[void 0,t])}let Struct=class Struct{constructor(t){let{type:e,schema:r,validator:n,refiner:o,coercer:s=t=>t,entries:f=function*(){}}=t;this.type=e,this.schema=r,this.entries=f,this.coercer=s,n?this.validator=(t,e)=>{let r=n(t,e);return toFailures(r,e,this,t)}:this.validator=()=>[],o?this.refiner=(t,e)=>{let r=o(t,e);return toFailures(r,e,this,t)}:this.refiner=()=>[]}assert(t){return function(t,e){let r=validate(t,e);if(r[0])throw r[0]}(t,this)}create(t){return create(t,this)}is(t){return is(t,this)}mask(t){return function(t,e){let r=validate(t,e,{coerce:!0,mask:!0});if(!r[0])return r[1];throw r[0]}(t,this)}validate(t,e={}){return validate(t,this,e)}};function create(t,e){let r=validate(t,e,{coerce:!0});if(!r[0])return r[1];throw r[0]}function is(t,e){let r=validate(t,e);return!r[0]}function validate(t,e,r={}){let n=run(t,e,r),o=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(n);if(o[0]){let t=new StructError(o[0],function*(){for(let t of n)t[0]&&(yield t[0])});return[t,void 0]}{let t=o[1];return[void 0,t]}}function define(t,e){return new Struct({type:t,schema:null,validator:e})}function any(){return define("any",()=>!0)}function array(t){return new Struct({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||"Expected an array value, but received: "+print(t)})}function boolean(){return define("boolean",t=>"boolean"==typeof t)}function instance(t){return define("instance",e=>e instanceof t||"Expected a `"+t.name+"` instance, but received: "+print(e))}function literal(t){let e=print(t),r=typeof t;return new Struct({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||"Expected the literal `"+e+"`, but received: "+print(r)})}function nullable(t){return new Struct({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function number(){return define("number",t=>"number"==typeof t&&!isNaN(t)||"Expected a number, but received: "+print(t))}function optional(t){return new Struct({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function record(t,e){return new Struct({type:"record",schema:null,*entries(r){if(isObject(r))for(let n in r){let o=r[n];yield[n,n,t],yield[n,o,e]}},validator:t=>isObject(t)||"Expected an object, but received: "+print(t)})}function string(){return define("string",t=>"string"==typeof t||"Expected a string, but received: "+print(t))}function tuple(t){let e=define("never",()=>!1);return new Struct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(t.length,r.length);for(let o=0;o<n;o++)yield[o,r[o],t[o]||e]}},validator:t=>Array.isArray(t)||"Expected an array, but received: "+print(t)})}function type(t){let e=Object.keys(t);return new Struct({type:"type",schema:t,*entries(r){if(isObject(r))for(let n of e)yield[n,r[n],t[n]]},validator:t=>isObject(t)||"Expected an object, but received: "+print(t)})}function union(t){let e=t.map(t=>t.type).join(" | ");return new Struct({type:"union",schema:null,validator(r,n){let o=[];for(let e of t){let[...t]=run(r,e,n),[s]=t;if(!s[0])return[];for(let[e]of t)e&&o.push(e)}return["Expected the value to satisfy a union of `"+e+"`, but received: "+print(r),...o]}})}function unknown(){return define("unknown",()=>!0)}function coerce(t,e,r){return new Struct({...t,coercer:(n,o)=>is(n,e)?t.coercer(r(n,o),o):t.coercer(n,o)})}},71332:function(t,e,r){"use strict";function inRange(t,e,r){return e<=t&&t<=r}function ToDictionary(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function Stream(t){this.tokens=[].slice.call(t)}function decoderError(t,e){if(t)throw TypeError("Decoder error");return e||65533}r.r(e),r.d(e,{TextDecoder:function(){return TextDecoder},TextEncoder:function(){return TextEncoder}}),Stream.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.push(t.shift());else this.tokens.push(t)}};var n="utf-8";function TextDecoder(t,e){if(!(this instanceof TextDecoder))return new TextDecoder(t,e);if((t=void 0!==t?String(t).toLowerCase():n)!==n)throw Error("Encoding not supported. Only utf-8 is supported");e=ToDictionary(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function TextEncoder(t,e){if(!(this instanceof TextEncoder))return new TextEncoder(t,e);if((t=void 0!==t?String(t).toLowerCase():n)!==n)throw Error("Encoding not supported. Only utf-8 is supported");e=ToDictionary(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function UTF8Decoder(t){var e=t.fatal,r=0,n=0,o=0,s=128,f=191;this.handler=function(t,u){if(-1===u&&0!==o)return o=0,decoderError(e);
vendor: 2,582 bytes, line 11
11if(-1===u)return -1;if(0===o){if(inRange(u,0,127))return u;if(inRange(u,194,223))o=1,r=u-192;else if(inRange(u,224,239))224===u&&(s=160),237===u&&(f=159),o=2,r=u-224;else{if(!inRange(u,240,244))return decoderError(e);240===u&&(s=144),244===u&&(f=143),o=3,r=u-240}return r<<=6*o,null}if(!inRange(u,s,f))return r=o=n=0,s=128,f=191,t.prepend(u),decoderError(e);if(s=128,f=191,n+=1,r+=u-128<<6*(o-n),n!==o)return null;var a=r;return r=o=n=0,a}}function UTF8Encoder(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(inRange(e,0,127))return e;inRange(e,128,2047)?(r=1,n=192):inRange(e,2048,65535)?(r=2,n=224):inRange(e,65536,1114111)&&(r=3,n=240);for(var r,n,o=[(e>>6*r)+n];r>0;){var s=e>>6*(r-1);o.push(128|63&s),r-=1}return o}}TextDecoder.prototype={decode:function(t,e){r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=ToDictionary(e),this._streaming||(this._decoder=new UTF8Decoder({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,n,o=new Stream(r),s=[];!o.endOfStream()&&-1!==(n=this._decoder.handler(o,o.read()));)null!==n&&(Array.isArray(n)?s.push.apply(s,n):s.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(o,o.read())))break;if(null===n)continue;Array.isArray(n)?s.push.apply(s,n):s.push(n)}while(!o.endOfStream());this._decoder=null}return!s.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===s[0]?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),function(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(1023&n)+56320))}return e}(s)}},TextEncoder.prototype={encode:function(t,e){t=t?String(t):"",e=ToDictionary(e),this._streaming||(this._encoder=new UTF8Encoder(this._options)),this._streaming=!!e.stream;for(var r,n=[],o=new Stream(function(t){for(var e=String(t),r=e.length,n=0,o=[];n<r;){var s=e.charCodeAt(n);if(s<55296||s>57343)o.push(s);else if(56320<=s&&s<=57343)o.push(65533);else if(55296<=s&&s<=56319){if(n===r-1)o.push(65533);else{var f=t.charCodeAt(n+1);if(56320<=f&&f<=57343){var u=1023&s,a=1023&f;o.push(65536+(u<<10)+a),n+=1}else o.push(65533)}}n+=1}return o}(t));!o.endOfStream()&&-1!==(r=this._encoder.handler(o,o.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(o,o.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.