1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4187],{94639:function(e,t,r){t._O=t.Jq=t.KB=t.u8=t.cv=void 0,t.Ik=t.A9=t.n_=t.gM=void 0;let n=r(55872);function checkUint8Array(e){if(!(e instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function uint8ArrayToBuffer(e){return checkUint8Array(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}let Layout=class Layout{constructor(e,t){if(!Number.isInteger(e))throw TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};function nameWithProperty(e,t){return t.property?e+"["+t.property+"]":e}let ExternalLayout=class ExternalLayout extends Layout{isCount(){throw Error("ExternalLayout is abstract")}};let OffsetLayout=class OffsetLayout extends ExternalLayout{constructor(e,t=0,r){if(!(e instanceof Layout))throw TypeError("layout must be a Layout");if(!Number.isInteger(t))throw TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof UInt||this.layout instanceof UIntBE}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}};let UInt=class UInt extends Layout{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return uint8ArrayToBuffer(e).readUIntLE(t,this.span)}encode(e,t,r=0){return uint8ArrayToBuffer(t).writeUIntLE(e,r,this.span),this.span}};let UIntBE=class UIntBE extends Layout{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return uint8ArrayToBuffer(e).readUIntBE(t,this.span)}encode(e,t,r=0){return uint8ArrayToBuffer(t).writeUIntBE(e,r,this.span),this.span}};function divmodInt64(e){let t=Math.floor(e/4294967296);return{hi32:t,lo32:e-4294967296*t}}function roundedInt64(e,t){return 4294967296*e+t}let NearUInt64=class NearUInt64 extends Layout{constructor(e){super(8,e)}decode(e,t=0){let r=uint8ArrayToBuffer(e),n=r.readUInt32LE(t),i=r.readUInt32LE(t+4);return roundedInt64(i,n)}encode(e,t,r=0){let n=divmodInt64(e),i=uint8ArrayToBuffer(t);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}};let NearInt64=class NearInt64 extends Layout{constructor(e){super(8,e)}decode(e,t=0){let r=uint8ArrayToBuffer(e),n=r.readUInt32LE(t),i=r.readInt32LE(t+4);return roundedInt64(i,n)}encode(e,t,r=0){let n=divmodInt64(e),i=uint8ArrayToBuffer(t);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}};let Sequence=class Sequence extends Layout{constructor(e,t,r){if(!(e instanceof Layout))throw TypeError("elementLayout must be a Layout");if(!(t instanceof ExternalLayout&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;t instanceof ExternalLayout||!(0<e.span)||(n=t*e.span),super(n,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof ExternalLayout&&(n=n.decode(e,t)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){let r=[],n=0,i=this.count;for(i instanceof ExternalLayout&&(i=i.decode(e,t));n<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),n+=1;return r}encode(e,t,r=0){let n=this.elementLayout,i=e.reduce((e,i)=>e+n.encode(i,t,r+e),0);return this.count instanceof ExternalLayout&&this.count.encode(e.length,t,r),i}};let Structure=class Structure extends Layout{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((e,t)=>e&&t instanceof Layout,!0)))throw TypeError("fields must be array of Layout instances");for(let n of("boolean"==typeof t&&void 0===r&&(r=t,t=void 0),e))if(0>n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce((e,t)=>
1e+t.getSpan(),0)}catch(e){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let i=n.getSpan(e,t);return t+=i,r+i},0)}catch(e){throw RangeError("indeterminate span")}return r}decode(e,t=0){checkUint8Array(e);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let n=r,i=0,o=0;for(let n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){let i=e[n.property];void 0!==i&&(o=n.encode(i,t,r),0>s&&(s=n.getSpan(t,r)))}i=r,r+=s}return i+o-n}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if("string"!=typeof e)throw TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if("string"!=typeof e)throw TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}};let UnionDiscriminator=class UnionDiscriminator{constructor(e){this.property=e}decode(e,t){throw Error("UnionDiscriminator is abstract")}encode(e,t,r){throw Error("UnionDiscriminator is abstract")}};let UnionLayoutDiscriminator=class UnionLayoutDiscriminator extends UnionDiscriminator{constructor(e,t){if(!(e instanceof ExternalLayout&&e.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}};let Union=class Union extends Layout{constructor(e,t,r){let n;if(e instanceof UInt||e instanceof UIntBE)n=new UnionLayoutDiscriminator(new OffsetLayout(e));else if(e instanceof ExternalLayout&&e.isCount())n=new UnionLayoutDiscriminator(e);else if(e instanceof UnionDiscriminator)n=e;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===t&&(t=null),!(null===t||t instanceof Layout))throw TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let i=-1;t&&0<=(i=t.span)&&(e instanceof UInt||e instanceof UIntBE)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof UInt||e instanceof UIntBE,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return o(e)},this.configGetSourceVariant=function(e){o=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let r=this.getVariant(e,t);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw Error("unable to infer src variant")}decode(e,t=0){let r;let n=this.discriminator,i=n.decode(e,t),o=this.registry[i];if(void 0===o){let o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),(r=this.makeDestinationObject())[n.property]=i,r[o.property]=o.decode(e,t+s)}else r=o.decode(e,t);return r}encode(e,t,r=0){let n=this.getSourceVariant(e);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(e[n.property],t,r),o+i.encode(e[i.property],t,r+o)}return n.encode(e,t,r)}addVariant(e,t,r){let n=new VariantLayout(this,e,t,r);return this.registry[e]=n,n}getVariant(e,t=0){let r;return r=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[r]}};let VariantLayout=class VariantLayout extends Layout{constructor(e,t,r,n){if(!(e instanceof Union))throw TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)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");
1if(null!==e.defaultLayout&&0<=r.span&&r.span>e.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof n)throw TypeError("variant must have a String property")}let i=e.span;0>e.span&&0<=(i=r?r.span:0)&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span),super(i,n),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=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(e,t+r)),r+n}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))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(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let i=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),i+=this.layout.getSpan(t,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};function fixBitwiseResult(e){return 0>e&&(e+=4294967296),e}let BitStructure=class BitStructure extends Layout{constructor(e,t,r){if(!(e instanceof UInt||e instanceof UIntBE))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof t&&void 0===r&&(r=t,t=!1),4<e.span)throw RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let n=0;this._packedSetValue=function(e){return n=fixBitwiseResult(e),this},this._packedGetValue=function(){return n}}decode(e,t=0){let r=this.makeDestinationObject(),n=this.word.decode(e,t);for(let t of(this._packedSetValue(n),this.fields))void 0!==t.property&&(r[t.property]=t.decode(e));return r}encode(e,t,r=0){let n=this.word.decode(t,r);for(let t of(this._packedSetValue(n),this.fields))if(void 0!==t.property){let r=e[t.property];void 0!==r&&t.encode(r)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new BitField(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new Boolean(this,e);return this.fields.push(t),t}fieldFor(e){if("string"!=typeof e)throw TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}};let BitField=class BitField{constructor(e,t,r){if(!(e instanceof BitStructure))throw TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw TypeError("bits must be positive integer");let n=8*e.span,i=e.fields.reduce((e,t)=>e+t.bits,0);if(t+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,32===t&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=n-i-t),this.wordMask=fixBitwiseResult(this.valueMask<<this.start),this.property=r}decode(e,t){let r=this.container._packedGetValue(),n=fixBitwiseResult(r&this.wordMask),i=n>>>this.start;return i}encode(e){if("number"!=typeof e||!Number.isInteger(e)||e!==fixBitwiseResult(e&this.valueMask))throw TypeError(nameWithProperty("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=fixBitwiseResult(e<<this.start);this.container._packedSetValue(fixBitwiseResult(t&~this.wordMask)|r)}};let Boolean=class Boolean extends BitField{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){"boolean"==typeof e&&(e=+e),super.encode(e)}};let Blob=class Blob extends Layout{constructor(e,t){if(!(e instanceof ExternalLayout&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof ExternalLayout||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),uint8ArrayToBuffer(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof ExternalLayout&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw TypeError(nameWithProperty("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw RangeError("encoding overruns Uint8Array");let i=uint8ArrayToBuffer(e);return uint8ArrayToBuffer(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof ExternalLayout&&this.length.encode(n,t,r),n}};t.cv=(e,t,r)=>new OffsetLayout(e,t,r),t.u8=e=>new UInt(1,e),t.KB=e=>
1new UInt(2,e),t.Jq=e=>new UInt(4,e),t._O=e=>new NearUInt64(e),t.gM=e=>new NearInt64(e),t.n_=(e,t,r)=>new Structure(e,t,r),t.A9=(e,t,r)=>new Sequence(e,t,r),t.Ik=(e,t)=>new Blob(e,t)},48797:function(e,t,r){var n=r(55872).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;let f=u(r(51890)),l=u(r(31511)),d=a(r(75394)),c="function"!=typeof TextDecoder?d.TextDecoder:TextDecoder,h=new c("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"==typeof e&&(e=n.from(e,"utf8")),l.default.encode(n.from(e))},t.baseDecode=function(e){return n.from(l.default.decode(e))};let BorshError=class BorshError extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};t.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(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(n.from(new f.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(n.from(new f.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(n.from(new f.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(n.from(new f.default(e).toArray("le",64)))}writeBuffer(e){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),e,n.alloc(1024)]),this.length+=e.length}writeString(e){this.maybeResize();let t=n.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(n.from(e))}writeArray(e,t){for(let r of(this.maybeResize(),this.writeU32(e.length),e))this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}};function handlingRangeError(e,t,r){let n=r.value;r.value=function(...e){try{return n.apply(this,e)}catch(e){if(e instanceof RangeError){let t=e.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t)>=0)throw new BorshError("Reached the end of buffer when deserializing")}throw e}}}t.BinaryWriter=BinaryWriter;let BinaryReader=class BinaryReader{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new f.default(e,"le")}readU128(){let e=this.readBuffer(16);return new f.default(e,"le")}readU256(){let e=this.readBuffer(32);return new f.default(e,"le")}readU512(){let e=this.readBuffer(64);return new f.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new BorshError(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return h.decode(t)}catch(e){throw new BorshError(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=[];for(let n=0;n<t;++n)r.push(e());return r}};function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}function serializeField(e,t,r,n,i){try{if("string"==typeof n)i[`write${capitalizeFirstLetter(n)}`](r);
1else 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`);i.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 t=0;t<n[1];t++)serializeField(e,null,r[t],n[0],i)}else i.writeArray(r,r=>{serializeField(e,t,r,n[0],i)})}else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),serializeField(e,t,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,o)=>{serializeField(e,t,o,n.key,i),serializeField(e,t,r,n.value,i)});break;default:throw new BorshError(`FieldType ${n} unrecognized`)}else serializeStruct(e,r,i)}catch(e){throw e instanceof BorshError&&e.addToFieldPath(t),e}}function serializeStruct(e,t,r){if("function"==typeof t.borshSerialize){t.borshSerialize(r);return}let n=e.get(t.constructor);if(!n)throw new BorshError(`Class ${t.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{serializeField(e,n,t[n],i,r)});else if("enum"===n.kind){let i=t[n.field];for(let o=0;o<n.values.length;++o){let[s,a]=n.values[o];if(s===i){r.writeU8(o),serializeField(e,s,t[s],a,r);break}}}else throw new BorshError(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function deserializeField(e,t,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(()=>deserializeField(e,t,r[0],n));{let t=[];for(let i=0;i<r[1];i++)t.push(deserializeField(e,null,r[0],n));return t}}if("option"===r.kind){let i=n.readU8();if(i)return deserializeField(e,t,r.type,n);return}if("map"===r.kind){let i=new Map,o=n.readU32();for(let s=0;s<o;s++){let o=deserializeField(e,t,r.key,n),s=deserializeField(e,t,r.value,n);i.set(o,s)}return i}return deserializeStruct(e,r,n)}catch(e){throw e instanceof BorshError&&e.addToFieldPath(t),e}}function deserializeStruct(e,t,r){if("function"==typeof t.borshDeserialize)return t.borshDeserialize(r);let n=e.get(t);if(!n)throw new BorshError(`Class ${t.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,o]of e.get(t).fields)n[i]=deserializeField(e,i,o,r);return new t(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new BorshError(`Enum index: ${i} is out of range`);let[o,s]=n.values[i],a=deserializeField(e,o,s,r);return new t({[o]:a})}throw new BorshError(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}s([handlingRangeError],BinaryReader.prototype,"readU8",null),s([handlingRangeError],BinaryReader.prototype,"readU16",null),s([handlingRangeError],BinaryReader.prototype,"readU32",null),s([handlingRangeError],BinaryReader.prototype,"readU64",null),s([handlingRangeError],BinaryReader.prototype,"readU128",null),s([handlingRangeError],BinaryReader.prototype,"readU256",null),s([handlingRangeError],BinaryReader.prototype,"readU512",null),s([handlingRangeError],BinaryReader.prototype,"readString",null),s([handlingRangeError],BinaryReader.prototype,"readFixedArray",null),s([handlingRangeError],BinaryReader.prototype,"readArray",null),t.BinaryReader=BinaryReader,t.serialize=function(e,t,r=BinaryWriter){let n=new r;return serializeStruct(e,t,n),n.toArray()},t.deserialize=function(e,t,r,n=BinaryReader){let i=new n(r),o=deserializeStruct(e,t,i);if(i.offset<r.length)throw new BorshError(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},t.deserializeUnchecked=function(e,t,r,n=BinaryReader){let i=new n(r);return deserializeStruct(e,t,i)}},97039:function(e,t,r){let n=r(2930).v4,i=r(90431),ClientBrowser=function(e,t){if(!(this instanceof ClientBrowser))return new ClientBrowser(e,t);t||(t={}),this.options={reviver:void 0!==t.reviver?t.reviver:null,replacer:void 0!==t.replacer?t.replacer:null,generator:void 0!==t.generator?t.generator:function(){return n()},version:void 0!==t.version?t.version:2,notificationIdNull:"boolean"==typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=ClientBrowser,ClientBrowser.prototype.request=function(e,t,r,n){let o;let s=this,a=null,u=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&u)throw TypeError("JSON-RPC 1.0 does not support batching");let f=!u&&e&&"object"==typeof e&&"function"==typeof t;if(u||f)n=t,a=e;else{"function"==typeof r&&(n=r,r=void 0);let o="function"==typeof n;try{a=i(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(o){n(e);return}throw e}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(e){n(e);return}return this.callServer(o,function(e,t){s._parseResponse(e,t,n)}),a},ClientBrowser.prototype._parseResponse=function(e,t,r){let n;if(e){r(e);return}if(!t){r();return}try{n=JSON.parse(t,this.options.reviver)}catch(e){r(e);return}if(3===r.length){if(Array.isArray(n)){let isError=function(e){return void 0!==e.error};r(null,n.filter(isError),n.filter(function(e){return!isError(e)}));return}r(null,n.error,n.result);return}r(null,n)}},90431:function(e,t,r){let n=r(2930).v4;e.exports=function(e,t,r,i){if("string"!=typeof e)throw TypeError(e+" must be a string");i=i||{};let o="number"==typeof i.version?i.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:e};if(2===o&&(s.jsonrpc="2.0"),t){if("object"!=typeof t&&!Array.isArray(t))throw TypeError(t+" must be an object, array or omitted");s.params=t}if(void 0===r){let e="function"==typeof i.generator?i.generator:function(){return n()};s.id=e(s,i)}else 2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r;return s}},2930:function(e,t,r){r.d(t,{v4:function(){return esm_browser_v4}});for(var n,i=new Uint8Array(16),o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var esm_browser_stringify=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!("string"==typeof r&&o.test(r)))throw TypeError("Stringified UUID is invali
1d");return r},esm_browser_v4=function(e,t,r){var o=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(var s=0;s<16;++s)t[r+s]=o[s];return t}return esm_browser_stringify(o)}},62485:function(e,t,r){r.d(t,{UN:function(){return x}});var n=r(48507),i=r(33578),o=r(81124),s=r(72589),a=r(1469);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let u=BigInt(0),f=BigInt(1),l=BigInt(2),d=BigInt(8);let PrimeEdwardsPoint=class PrimeEdwardsPoint{constructor(e){this.ep=e}static fromBytes(e){(0,s.EQ)()}static fromHex(e){(0,s.EQ)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return(0,i.ci)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}};function anum(e){if(!Number.isSafeInteger(e))throw Error("number expected")}(0,i.iY)("HashToScalar-");let c=BigInt(0),h=BigInt(1),y=BigInt(2);BigInt(3);let p=BigInt(5),m=BigInt(8),g=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),w={p:g,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:m,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},b=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function uvRatio(e,t){let r=(0,a.wQ)(t*t*t,g),n=(0,a.wQ)(r*r*t,g),i=function(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=e*e%g,s=o*e%g,u=(0,a.oA)(s,y,g)*s%g,f=(0,a.oA)(u,h,g)*e%g,l=(0,a.oA)(f,p,g)*f%g,d=(0,a.oA)(l,t,g)*l%g,c=(0,a.oA)(d,r,g)*d%g,m=(0,a.oA)(c,n,g)*c%g,w=(0,a.oA)(m,i,g)*m%g,b=(0,a.oA)(w,i,g)*m%g,E=(0,a.oA)(b,t,g)*l%g,v=(0,a.oA)(E,y,g)*e%g;return{pow_p_5_8:v,b2:s}}(e*n).pow_p_5_8,o=(0,a.wQ)(e*r*i,g),s=(0,a.wQ)(t*o*o,g),u=o,f=(0,a.wQ)(o*b,g),l=s===e,d=s===(0,a.wQ)(-e,g),c=s===(0,a.wQ)(-e*b,g);return l&&(o=u),(d||c)&&(o=f),(0,a.Tu)(o,g)&&(o=(0,a.wQ)(-o,g)),{isValid:l||d,value:o}}let E=(0,a.gN)(w.p,{isLE:!0}),v=(0,a.gN)(w.n,{isLE:!0}),B={...w,Fp:E,hash:n.o,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},uvRatio},x=function(e){let{CURVE:t,curveOpts:r,hash:n,eddsaOpts:c}=function(e){let t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,n=(0,a.gN)(t.n,e.nBitLength,!0),i={Fp:r,Fn:n,uvRatio:e.uvRatio},o={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:i,hash:e.hash,eddsaOpts:o}}(e),h=function(e,t={}){let r=(0,o.rO)("edwards",e,t,t.FpFnLE),{Fp:n,Fn:a}=r,c=r.CURVE,{h:h}=c;(0,s.fA)(t,{},{uvRatio:"function"});let y=l<<BigInt(8*a.BYTES)-f,modP=e=>n.create(e),p=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(n.div(e,t))}}catch(e){return{isValid:!1,value:u}}});if(!function(e,t,r,n){let i=e.sqr(r),o=e.sqr(n),s=e.add(e.mul(t.a,i),o),a=e.add(e.ONE,e.mul(t.d,e.mul(i,o)));return e.eql(s,a)}(n,c,c.Gx,c.Gy))throw Error("bad curve params: generator point");function acoord(e,t,r=!1){let n=r?f:u;return(0,s.Fy)("coordinate "+e,t,n,y),t}function aextpoint(e){if(!(e instanceof Point))throw Error("ExtendedPoint expected")}let m=(0,s.H9)((e,t)=>{let{X:r,Y:i,Z:o}=e,s=e.is0();null==t&&(t=s?d:n.inv(o));let a=modP(r*t),l=modP(i*t),c=n.mul(o,t);if(s)return{x:u,y:f};
1if(c!==f)throw Error("invZ was invalid");return{x:a,y:l}}),g=(0,s.H9)(e=>{let{a:t,d:r}=c;if(e.is0())throw Error("bad point: ZERO");let{X:n,Y:i,Z:o,T:s}=e,a=modP(n*n),u=modP(i*i),f=modP(o*o),l=modP(f*f),d=modP(a*t),h=modP(f*modP(d+u)),y=modP(l+modP(r*modP(a*u)));if(h!==y)throw Error("bad point: equation left != right (1)");let p=modP(n*i),m=modP(o*s);if(p!==m)throw Error("bad point: equation left != right (2)");return!0});let Point=class Point{constructor(e,t,r,n){this.X=acoord("x",e),this.Y=acoord("y",t),this.Z=acoord("z",r,!0),this.T=acoord("t",n),Object.freeze(this)}static CURVE(){return c}static fromAffine(e){if(e instanceof Point)throw Error("extended point not allowed");let{x:t,y:r}=e||{};return acoord("x",t),acoord("y",r),new Point(t,r,f,modP(t*r))}static fromBytes(e,t=!1){let r=n.BYTES,{a:i,d:o}=c;e=(0,s.HV)((0,s.GB)(e,r,"point")),(0,s.po)(t,"zip215");let a=(0,s.HV)(e),l=e[r-1];a[r-1]=-129&l;let d=(0,s.ty)(a),h=t?y:n.ORDER;(0,s.Fy)("point.y",d,u,h);let m=modP(d*d),g=modP(m-f),w=modP(o*m-i),{isValid:b,value:E}=p(g,w);if(!b)throw Error("bad point: invalid y coordinate");let v=(E&f)===f,B=(128&l)!=0;if(!t&&E===u&&B)throw Error("bad point: x=0 and x_0=1");return B!==v&&(E=modP(-E)),Point.fromAffine({x:E,y:d})}static fromHex(e,t=!1){return Point.fromBytes((0,s.ql)("point",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return w.createCache(this,e),t||this.multiply(l),this}assertValidity(){g(this)}equals(e){aextpoint(e);let{X:t,Y:r,Z:n}=this,{X:i,Y:o,Z:s}=e,a=modP(t*s),u=modP(i*n),f=modP(r*s),l=modP(o*n);return a===u&&f===l}is0(){return this.equals(Point.ZERO)}negate(){return new Point(modP(-this.X),this.Y,this.Z,modP(-this.T))}double(){let{a:e}=c,{X:t,Y:r,Z:n}=this,i=modP(t*t),o=modP(r*r),s=modP(l*modP(n*n)),a=modP(e*i),u=t+r,f=modP(modP(u*u)-i-o),d=a+o,h=d-s,y=a-o,p=modP(f*h),m=modP(d*y),g=modP(f*y),w=modP(h*d);return new Point(p,m,w,g)}add(e){aextpoint(e);let{a:t,d:r}=c,{X:n,Y:i,Z:o,T:s}=this,{X:a,Y:u,Z:f,T:l}
1=e,d=modP(n*a),h=modP(i*u),y=modP(s*r*l),p=modP(o*f),m=modP((n+i)*(a+u)-d-h),g=p-y,w=p+y,b=modP(h-t*d),E=modP(m*g),v=modP(w*b),B=modP(m*b),x=modP(g*w);return new Point(E,v,x,B)}subtract(e){return this.add(e.negate())}multiply(e){if(!a.isValidNot0(e))throw Error("invalid scalar: expected 1 <= sc < curve.n");let{p:t,f:r}=w.cached(this,e,e=>(0,o.A1)(Point,e));return(0,o.A1)(Point,[t,r])[0]}multiplyUnsafe(e,t=Point.ZERO){if(!a.isValid(e))throw Error("invalid scalar: expected 0 <= sc < curve.n");return e===u?Point.ZERO:this.is0()||e===f?this:w.unsafe(this,e,e=>(0,o.A1)(Point,e),t)}isSmallOrder(){return this.multiplyUnsafe(h).is0()}isTorsionFree(){return w.unsafe(this,c.n).is0()}toAffine(e){return m(this,e)}clearCofactor(){return h===f?this:this.multiplyUnsafe(h)}toBytes(){let{x:e,y:t}=this.toAffine(),r=n.toBytes(t);return r[r.length-1]|=e&f?128:0,r}toHex(){return(0,i.ci)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return(0,o.A1)(Point,e)}static msm(e,t){return(0,o.D1)(Point,a,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}};Point.BASE=new Point(c.Gx,c.Gy,f,modP(c.Gx*c.Gy)),Point.ZERO=new Point(u,f,f,u),Point.Fp=n,Point.Fn=a;let w=new o.Mx(Point,a.BITS);return Point.BASE.precompute(8),Point}(t,r),y=function(e,t,r={}){if("function"!=typeof t)throw Error('"hash" function param is required');(0,s.fA)(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:n}=r,{BASE:o,Fp:a,Fn:u}=e,l=r.randomBytes||i.O6,d=r.adjustScalarBytes||(e=>e),c=r.domain||((e,t,r)=>{if((0,s.po)(r,"phflag"),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function modN_LE(e){return u.create((0,s.ty)(e))}function getExtendedPublicKey(e){let{head:r,prefix:n,scalar:i}=function(e){let r=p.secretKey;e=(0,s.ql)("private key",e,r);let n=(0,s.ql)("hashed private key",t(e),2*r),i=d(n.slice(0,r)),o=n.slice(r,2*r),a=modN_LE(i);return{head:i,prefix:o,scalar:a}}(e),a=o.multiply(i),u=a.toBytes();return{head:r,prefix:n,scalar:i,point:a,pointBytes:u}}function getPublicKey(e){return getExtendedPublicKey(e).pointBytes}function hashDomainToScalar(e=Uint8Array.of(),...r){let o=(0,i.eV)(...r);return modN_LE(t(c(o,(0,s.ql)("context",e),!!n)))}let h={zip215:!0},y=a.BYTES,p={secretKey:y,publicKey:y,signature:2*y,seed:y};function randomSecretKey(e=l(p.seed)){return(0,s.GB)(e,p.seed,"seed")}let m={getExtendedPublicKey,randomSecretKey,isValidSecretKey:function(e){return(0,i._t)(e)&&e.length===u.BYTES},isValidPublicKey:function(t,r){try{return!!e.fromBytes(t,r)}catch(e){return!1}},toMontgomery(t){let{y:r}=e.fromBytes(t),n=p.publicKey,i=32===n;if(!i&&57!==n)throw Error("only defined for 25519 and 448");let o=i?a.div(f+r,f-r):a.div(r-f,r+f);return a.toBytes(o)},toMontgomerySecret(e){let r=p.secretKey;(0,s.GB)(e,r);let n=t(e.subarray(0,r));return d(n).subarray(0,r)},randomPrivateKey:randomSecretKey,precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};return Object.freeze({keygen:function(e){let t=m.randomSecretKey(e);return{secretKey:t,publicKey:getPublicKey(t)}},getPublicKey,sign:function(e,t,r={}){e=(0,s.ql)("message",e),n&&(e=n(e));let{prefix:a,scalar:f,pointBytes:l}=getExtendedPublicKey(t),d=hashDomainToScalar(r.context,a,e),c=o.multiply(d).toBytes(),h=hashDomainToScalar(r.context,c,l,e),y=u.create(d+h*f);if(!u.isValid(y))throw Error("sign failed: invalid s");let m=(0,i.eV)(c,u.toBytes(y));return(0,s.GB)(m,p.signature,"result")},verify:function(t,r,i,a=h){let u,f,l;let{context:d,zip215:c}=a,y=p.signature;t=(0,s.ql)("signature",t,y),r=(0,s.ql)("message",r),i=(0,s.ql)("publicKey",i,p.publicKey),void 0!==c&&(0,s.po)(c,"zip215"),n&&(r=n(r));let m=y/2,g=t.subarray(0,m),w=(0,s.ty)(t.subarray(m,y));try{u=e.fromBytes(i,c),f=e.fromBytes(g,c),l=o.multiplyUnsafe(w)}catch(e){return!1}if(!c&&u.isSmallOrder())return!1;let b=hashDomainToScalar(d,f.toBytes(),u.toBytes(),r),E=f.add(u.multiplyUnsafe(b));return E.subtract(l).clearCofactor().is0()},utils:m,Point:e,lengths:p})}(h,n,c);return function(e,t){let r=t.Point,n=Object.assign({},t,{ExtendedPoint:r,CURVE:e,nBitLength:r.Fn.BITS,nByteLength:r.Fn.BYTES});return n}(e,y)}(B),S=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),P=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),A=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),U=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),invertSqrt=e=>uvRatio(h,e),R=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bytes255ToNumberLE=e=>x.Point.Fp.create((0,s.ty)(e)&R);function calcElligatorRistrettoMap(e){let{d:t}=w,mod=e=>E.create(e),r=mod(b*e*e),n=mod((r+h)*A),i=BigInt(-1),o=mod((i-t*r)*mod(r+t)),{isValid:s,value:u}=uvRatio(n,o),f=mod(u*e);(0,a.Tu)(f,g)||(f=mod(-f)),s||(u=f),s||(i=r);let l=mod(i*(r-h)*U-o),d=u*u,c=mod((u+u)*o),y=mod(l*S),p=mod(h-d),m=mod(h+d);return new x.Point(mod(c*m),mod(p*y),mod(y*m),mod(c*p))}let _RistrettoPoint=class _RistrettoPoint extends PrimeEdwardsPoint{
1constructor(e){super(e)}static fromAffine(e){return new _RistrettoPoint(x.Point.fromAffine(e))}assertSame(e){if(!(e instanceof _RistrettoPoint))throw Error("RistrettoPoint expected")}init(e){return new _RistrettoPoint(e)}static hashToCurve(e){return function(e){(0,i.gk)(e,64);let t=bytes255ToNumberLE(e.subarray(0,32)),r=calcElligatorRistrettoMap(t),n=bytes255ToNumberLE(e.subarray(32,64)),o=calcElligatorRistrettoMap(n);return new _RistrettoPoint(r.add(o))}((0,s.ql)("ristrettoHash",e,64))}static fromBytes(e){(0,i.gk)(e,32);let{a:t,d:r}=w,mod=e=>E.create(e),n=bytes255ToNumberLE(e);if(!(0,s.Wd)(E.toBytes(n),e)||(0,a.Tu)(n,g))throw Error("invalid ristretto255 encoding 1");let o=mod(n*n),u=mod(h+t*o),f=mod(h-t*o),l=mod(u*u),d=mod(f*f),y=mod(t*r*l-d),{isValid:p,value:m}=invertSqrt(mod(y*d)),b=mod(m*f),v=mod(m*b*y),B=mod((n+n)*b);(0,a.Tu)(B,g)&&(B=mod(-B));let S=mod(u*v),P=mod(B*S);if(!p||(0,a.Tu)(P,g)||S===c)throw Error("invalid ristretto255 encoding 2");return new _RistrettoPoint(new x.Point(B,S,h,P))}static fromHex(e){return _RistrettoPoint.fromBytes((0,s.ql)("ristrettoHex",e,32))}static msm(e,t){return(0,o.D1)(_RistrettoPoint,x.Point.Fn,e,t)}toBytes(){let e,{X:t,Y:r,Z:n,T:i}=this.ep,mod=e=>E.create(e),o=mod(mod(n+r)*mod(n-r)),s=mod(t*r),u=mod(s*s),{value:f}=invertSqrt(mod(o*u)),l=mod(f*o),d=mod(f*s),c=mod(l*d*i);if((0,a.Tu)(i*c,g)){let n=mod(r*b),i=mod(t*b);t=n,r=i,e=mod(l*P)}else e=d;(0,a.Tu)(t*c,g)&&(r=mod(-r));let h=mod((n-r)*e);return(0,a.Tu)(h,g)&&(h=mod(-h)),E.toBytes(h)}equals(e){this.assertSame(e);let{X:t,Y:r}=this.ep,{X:n,Y:i}=e.ep,mod=e=>E.create(e),o=mod(t*i)===mod(r*n),s=mod(r*i)===mod(t*n);return o||s}is0(){return this.equals(_RistrettoPoint.ZERO)}};_RistrettoPoint.BASE=new _RistrettoPoint(x.Point.BASE),_RistrettoPoint.ZERO=new _RistrettoPoint(x.Point.ZERO),_RistrettoPoint.Fp=E,_RistrettoPoint.Fn=v},31063:function(e,t,r){function encodeObjectContextEntry([e,t]){return`${e}=${function encodeValue(e){if(Array.isArray(e)){let t=e.map(encodeValue).join("%2C%20");return"%5B"+t+"%5D"}return"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(t)}`}r.d(t,{GH:function(){return getU64Codec},bP:function(){return getU64Encoder}});var n,i=class extends Error{cause=this.cause;context;constructor(...[e,t]){let r,n;if(t){let{cause:e,...i}=t;e&&(n={cause:e}),Object.keys(i).length>0&&(r=i)}let i=function(e,t={}){{let r=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(r+=` '${function(e){let t=Object.entries(e).map(encodeObjectContextEntry).join("&");return btoa(t)}(t)}'`),`${r}\``}}(e,r);super(i,n),this.context={__code:e,...r},this.name="SolanaError"}};function isFixedSize(e){return"fixedSize"in e&&"number"==typeof e.fixedSize}var o=((n=o||{})[n.Little=0]="Little",n[n.Big=1]="Big",n);function isLittleEndian(e){return e?.endian!==1}var getU64Encoder=(e={})=>{var t,r;return Object.freeze({...r={fixedSize:(t={config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,r)=>e.setBigUint64(0,BigInt(t),r),size:8}).size,write(e,r,n){t.range&&function(e,t,r,n){if(n<t||n>r)throw new i(8078011,{codecDescription:e,max:r,min:t,value:n})}(t.name,t.range[0],t.range[1],e);let o=new ArrayBuffer(t.size);return t.set(new DataView(o),e,isLittleEndian(t.config)),r.set(new Uint8Array(o),n),n+t.size}},encode:e=>{let t=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(e));return r.write(e,t,0),t}})},getU64Decoder=(e={})=>{var t,r;return Object.freeze({...r={fixedSize:(t={config:e,get:(e,t)=>e.getBigUint64(0,t),name:"u64",size:8}).size,read(e,r=0){!function(e,t,r=0){if(t.length-r<=0)throw new i(8078e3,{codecDescription:e})}(t.name,e,r),function(e,t,r,n=0){let o=r.length-n;if(o<t)throw new i(8078001,{bytesLength:o,codecDescription:e,expected:t})}(t.name,t.size,e,r);let n=new DataView(function(e,t,r){let n=e.byteOffset+(t??0),i=r??e.byteLength;return e.buffer.slice(n,n+i)}(e,r,t.size));return[t.get(n,isLittleEndian(t.config)),r+t.size]}},decode:(e,t=0)=>r.read(e,t)[0]})},getU64Codec=(e={})=>(function(e,t){if(isFixedSize(e)!==isFixedSize(t))throw new i(8078004);if(isFixedSize(e)&&isFixedSize(t)&&e.fixedSize!==t.fixedSize)throw new i(8078005,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!isFixedSize(e)&&!isFixedSize(t)&&e.maxSize!==t.maxSize)throw new i(8078006,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}})(getU64Encoder(e),getU64Decoder(e))},52201:function(e,t,r){r(55872),r(73983)},89379:function(e,t,r){r.d(t,{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(e,t){let r;let{message:n,explanation:i,...o}=e,{path:s}=e,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}};function isObject(e){return"object"==typeof e&&null!=e}function isNonArrayObject(e){return isObject(e)&&!Array.isArray(e)}function print(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function*toFailures(e,t,r,n){var i;for(let o of(isObject(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]),e)){let e=function(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});let{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${print(n)}\``}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:u}}(o,t,r,n);e&&(yield e)}}function*run(e,t,r={}){let{path:n=[],branch:i=[e],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i,mask:s};o&&(e=t.coercer(e,a));let u="valid";for(let n of t.validator(e,a))n.explanation=r.message,u="not_val
1id",yield[n,void 0];for(let[f,l,d]of t.entries(e,a)){let t=run(l,d,{path:void 0===f?n:[...n,f],branch:void 0===f?i:[...i,l],coerce:o,mask:s,message:r.message});for(let r of t)r[0]?(u=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):o&&(l=r[1],void 0===f?e=l:e instanceof Map?e.set(f,l):e instanceof Set?e.add(l):isObject(e)&&(void 0!==l||f in e)&&(e[f]=l))}if("not_valid"!==u)for(let n of t.refiner(e,a))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,e])}let Struct=class Struct{constructor(e){let{type:t,schema:r,validator:n,refiner:i,coercer:o=e=>e,entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,n?this.validator=(e,t)=>{let r=n(e,t);return toFailures(r,t,this,e)}:this.validator=()=>[],i?this.refiner=(e,t)=>{let r=i(e,t);return toFailures(r,t,this,e)}:this.refiner=()=>[]}assert(e,t){return function(e,t,r){let n=validate(e,t,{message:r});if(n[0])throw n[0]}(e,this,t)}create(e,t){return create(e,this,t)}is(e){return is(e,this)}mask(e,t){return function(e,t,r){let n=validate(e,t,{coerce:!0,mask:!0,message:r});if(!n[0])return n[1];throw n[0]}(e,this,t)}validate(e,t={}){return validate(e,this,t)}};function create(e,t,r){let n=validate(e,t,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function is(e,t){let r=validate(e,t);return!r[0]}function validate(e,t,r={}){let n=run(e,t,r),i=function(e){let{done:t,value:r}=e.next();return t?void 0:r}(n);if(i[0]){let e=new StructError(i[0],function*(){for(let e of n)e[0]&&(yield e[0])});return[e,void 0]}{let e=i[1];return[void 0,e]}}function define(e,t){return new Struct({type:e,schema:null,validator:t})}function any(){return define("any",()=>!0)}function array(e){return new Struct({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(let[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${print(e)}`})}function boolean(){return define("boolean",e=>"boolean"==typeof e)}function instance(e){return define("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${print(t)}`)}function literal(e){let t=print(e),r=typeof e;return new Struct({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${print(r)}`})}function nullable(e){return new Struct({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function number(){return define("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${print(e)}`)}function optional(e){return new Struct({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function record(e,t){return new Struct({type:"record",schema:null,*entries(r){if(isObject(r))for(let n in r){let i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>isNonArrayObject(e)||`Expected an object, but received: ${print(e)}`,coercer:e=>isNonArrayObject(e)?{...e}:e})}function string(){return define("string",e=>"string"==typeof e||`Expected a string, but received: ${print(e)}`)}function tuple(e){let t=define("never",()=>!1);return new Struct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${print(e)}`,coercer:e=>Array.isArray(e)?e.slice():e})}function type(e){let t=Object.keys(e);return new Struct({type:"type",schema:e,*entries(r){if(isObject(r))for(let n of t)yield[n,r[n],e[n]]},validator:e=>isNonArrayObject(e)||`Expected an object, but received: ${print(e)}`,coercer:e=>isNonArrayObject(e)?{...e}:e})}function union(e){let t=e.map(e=>e.type).join(" | ");return new Struct({type:"union",schema:null,coercer(t,r){for(let n of e){let[e,i]=n.validate(t,{coerce:!0,mask:r.mask});if(!e)return i}return t},validator(r,n){let i=[];for(let t of e){let[...e]=run(r,t,n),[o]=e;if(!o[0])return[];for(let[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${print(r)}`,...i]}})}function unknown(){return define("unknown",()=>!0)}function coerce(e,t,r){return new Struct({...e,coercer:(n,i)=>is(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}},75394:function(e,t,r){function inRange(e,t,r){return t<=e&&e<=r}function ToDictionary(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function Stream(e){this.tokens=[].slice.call(e)}function decoderError(e,t){if(e)throw TypeError("Decoder error");return t||65533}r.r(t),r.d(t,{TextDecoder:function(){return TextDecoder},TextEncoder:function(){return TextEncoder}}
vendor: 3,926 bytes, line 1
1),Stream.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(;e.length;)this.tokens.push(e.shift());else this.tokens.push(e)}};var n="utf-8";function TextDecoder(e,t){if(!(this instanceof TextDecoder))return new TextDecoder(e,t);if((e=void 0!==e?String(e).toLowerCase():n)!==n)throw Error("Encoding not supported. Only utf-8 is supported");t=ToDictionary(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function TextEncoder(e,t){if(!(this instanceof TextEncoder))return new TextEncoder(e,t);if((e=void 0!==e?String(e).toLowerCase():n)!==n)throw Error("Encoding not supported. Only utf-8 is supported");t=ToDictionary(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function UTF8Decoder(e){var t=e.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(e,a){if(-1===a&&0!==i)return i=0,decoderError(t);if(-1===a)return -1;if(0===i){if(inRange(a,0,127))return a;if(inRange(a,194,223))i=1,r=a-192;else if(inRange(a,224,239))224===a&&(o=160),237===a&&(s=159),i=2,r=a-224;else{if(!inRange(a,240,244))return decoderError(t);240===a&&(o=144),244===a&&(s=143),i=3,r=a-240}return r<<=6*i,null}if(!inRange(a,o,s))return r=i=n=0,o=128,s=191,e.prepend(a),decoderError(t);if(o=128,s=191,n+=1,r+=a-128<<6*(i-n),n!==i)return null;var u=r;return r=i=n=0,u}}function UTF8Encoder(e){e.fatal,this.handler=function(e,t){if(-1===t)return -1;if(inRange(t,0,127))return t;inRange(t,128,2047)?(r=1,n=192):inRange(t,2048,65535)?(r=2,n=224):inRange(t,65536,1114111)&&(r=3,n=240);for(var r,n,i=[(t>>6*r)+n];r>0;){var o=t>>6*(r-1);i.push(128|63&o),r-=1}return i}}TextDecoder.prototype={decode:function(e,t){r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=ToDictionary(t),this._streaming||(this._decoder=new UTF8Decoder({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var r,n,i=new Stream(r),o=[];!i.endOfStream()&&-1!==(n=this._decoder.handler(i,i.read()));)null!==n&&(Array.isArray(n)?o.push.apply(o,n):o.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(i,i.read())))break;if(null===n)continue;Array.isArray(n)?o.push.apply(o,n):o.push(n)}while(!i.endOfStream());this._decoder=null}return!o.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(1023&n)+56320))}return t}(o)}},TextEncoder.prototype={encode:function(e,t){e=e?String(e):"",t=ToDictionary(t),this._streaming||(this._encoder=new UTF8Encoder(this._options)),this._streaming=!!t.stream;for(var r,n=[],i=new Stream(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319){if(n===r-1)i.push(65533);else{var s=e.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;i.push(65536+(a<<10)+u),n+=1}else i.push(65533)}}n+=1}return i}(e));!i.endOfStream()&&-1!==(r=this._encoder.handler(i,i.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(i,i.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.